diff options
| author | bobzel <zzzman@gmail.com> | 2024-03-01 08:23:06 -0500 |
|---|---|---|
| committer | bobzel <zzzman@gmail.com> | 2024-03-01 08:23:06 -0500 |
| commit | 25474b83f908732b2618cb7110f1e410030f9280 (patch) | |
| tree | a942453765eb876ffaa3899d623fa77e13a196b4 /src/client/views/nodes/formattedText/nodes_rts.ts | |
| parent | 4e837a73f5fae06368416f99c047d78f6b94565b (diff) | |
| parent | 3179048be75fb7662fc472249798b2d103dc5544 (diff) | |
Merge branch 'master' into info-ui-observable
Diffstat (limited to 'src/client/views/nodes/formattedText/nodes_rts.ts')
| -rw-r--r-- | src/client/views/nodes/formattedText/nodes_rts.ts | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/client/views/nodes/formattedText/nodes_rts.ts b/src/client/views/nodes/formattedText/nodes_rts.ts index d023020e1..4706a97fa 100644 --- a/src/client/views/nodes/formattedText/nodes_rts.ts +++ b/src/client/views/nodes/formattedText/nodes_rts.ts @@ -2,6 +2,8 @@ import * as React from 'react'; import { DOMOutputSpec, Node, NodeSpec } from 'prosemirror-model'; import { listItem, orderedList } from 'prosemirror-schema-list'; import { ParagraphNodeSpec, toParagraphDOM, getParagraphNodeAttrs } from './ParagraphNodeSpec'; +import { DocServer } from '../../../DocServer'; +import { Doc, Field } from '../../../../fields/Doc'; const blockquoteDOM: DOMOutputSpec = ['blockquote', 0], hrDOM: DOMOutputSpec = ['hr'], @@ -177,6 +179,7 @@ export const nodes: { [index: string]: NodeSpec } = { dashComment: { attrs: { docId: { default: '' }, + reflow: { default: true }, }, inline: true, group: 'inline', @@ -264,6 +267,18 @@ export const nodes: { [index: string]: NodeSpec } = { hideKey: { default: false }, editable: { default: true }, }, + leafText: node => Field.toString((DocServer.GetCachedRefField(node.attrs.docId as string) as Doc)?.[node.attrs.fieldKey as string] as Field), + group: 'inline', + draggable: false, + toDOM(node) { + const attrs = { style: `width: ${node.attrs.width}, height: ${node.attrs.height}` }; + return ['div', { ...node.attrs, ...attrs }]; + }, + }, + + paintButton: { + inline: true, + attrs: {}, group: 'inline', draggable: false, toDOM(node) { |
