@portone/docx-editor 0.4.0 → 0.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (180) hide show
  1. package/CHANGELOG.md +201 -0
  2. package/CONTRIBUTING.md +2 -0
  3. package/assets/editor.png +0 -0
  4. package/dist/DocxEditor.d.ts +1 -1
  5. package/dist/DocxEditor.js +44 -25
  6. package/dist/docx/cloning.js +4 -9
  7. package/dist/docx/commentOnlyChange.d.ts +5 -3
  8. package/dist/docx/comments/grammar.d.ts +27 -10
  9. package/dist/docx/comments/grammar.js +18 -67
  10. package/dist/docx/comments/model.d.ts +5 -6
  11. package/dist/docx/comments/model.js +0 -9
  12. package/dist/docx/comments/parts.d.ts +16 -10
  13. package/dist/docx/comments/parts.js +65 -13
  14. package/dist/docx/comments/people.d.ts +11 -3
  15. package/dist/docx/comments/people.js +20 -6
  16. package/dist/docx/comments/policy.js +7 -1
  17. package/dist/docx/comments/reading.d.ts +4 -2
  18. package/dist/docx/comments/reading.js +1 -14
  19. package/dist/docx/comments/writing.js +65 -28
  20. package/dist/docx/exportDocx.js +10 -14
  21. package/dist/docx/exportRefs.d.ts +8 -3
  22. package/dist/docx/exportRefs.js +2 -1
  23. package/dist/docx/fidelity.js +24 -10
  24. package/dist/docx/fields.d.ts +42 -0
  25. package/dist/docx/fields.js +76 -0
  26. package/dist/docx/formatting/styles.d.ts +0 -2
  27. package/dist/docx/formatting/styles.js +2 -15
  28. package/dist/docx/headersFooters.d.ts +89 -20
  29. package/dist/docx/headersFooters.js +163 -172
  30. package/dist/docx/identities.js +17 -26
  31. package/dist/docx/importDocx.d.ts +1 -1
  32. package/dist/docx/importDocx.js +100 -48
  33. package/dist/docx/importParagraph.d.ts +18 -5
  34. package/dist/docx/importParagraph.js +75 -128
  35. package/dist/docx/importPolicy.d.ts +70 -0
  36. package/dist/docx/importPolicy.js +195 -0
  37. package/dist/docx/importPreserved.d.ts +30 -0
  38. package/dist/docx/importPreserved.js +54 -0
  39. package/dist/docx/importTable.js +56 -12
  40. package/dist/docx/invariants.js +16 -18
  41. package/dist/docx/notes.d.ts +6 -1
  42. package/dist/docx/notes.js +6 -16
  43. package/dist/docx/pageGeometry.d.ts +5 -14
  44. package/dist/docx/pageGeometry.js +0 -12
  45. package/dist/docx/protectionPolicy.d.ts +13 -5
  46. package/dist/docx/protectionPolicy.js +32 -22
  47. package/dist/docx/scan.d.ts +18 -8
  48. package/dist/docx/scan.js +17 -11
  49. package/dist/docx/sections.d.ts +126 -0
  50. package/dist/docx/sections.js +207 -0
  51. package/dist/docx/serializeBlock.d.ts +13 -4
  52. package/dist/docx/serializeBlock.js +16 -18
  53. package/dist/docx/serializeParagraph.d.ts +9 -4
  54. package/dist/docx/serializeParagraph.js +23 -58
  55. package/dist/docx/serializePreserved.d.ts +14 -0
  56. package/dist/docx/serializePreserved.js +24 -0
  57. package/dist/docx/serializeStory.d.ts +17 -0
  58. package/dist/docx/serializeStory.js +17 -0
  59. package/dist/docx/serializeTable.js +10 -13
  60. package/dist/docx/session.d.ts +23 -6
  61. package/dist/docx/session.js +26 -5
  62. package/dist/docx/story.d.ts +140 -0
  63. package/dist/docx/story.js +237 -0
  64. package/dist/docx/storyProjection.js +6 -1
  65. package/dist/docx/tableTemplate.d.ts +25 -0
  66. package/dist/docx/tableTemplate.js +30 -16
  67. package/dist/docx/wrappers.d.ts +67 -0
  68. package/dist/docx/wrappers.js +117 -0
  69. package/dist/editor/clipboard/blockReaders.d.ts +74 -0
  70. package/dist/editor/clipboard/blockReaders.js +193 -0
  71. package/dist/editor/clipboard/htmlReader.d.ts +26 -0
  72. package/dist/editor/clipboard/htmlReader.js +376 -0
  73. package/dist/editor/clipboard/inlineFormatting.d.ts +0 -7
  74. package/dist/editor/clipboard/inlineFormatting.js +1 -7
  75. package/dist/editor/clipboard/internalChannel.d.ts +57 -0
  76. package/dist/editor/clipboard/internalChannel.js +58 -0
  77. package/dist/editor/clipboard/normalizers.d.ts +99 -0
  78. package/dist/editor/clipboard/normalizers.js +199 -0
  79. package/dist/editor/clipboard/parser.d.ts +34 -0
  80. package/dist/editor/clipboard/parser.js +58 -0
  81. package/dist/editor/clipboard/plugin.d.ts +21 -0
  82. package/dist/editor/clipboard/plugin.js +188 -0
  83. package/dist/editor/clipboard/readContext.d.ts +34 -0
  84. package/dist/editor/clipboard/readContext.js +25 -0
  85. package/dist/editor/clipboard/readers.d.ts +33 -0
  86. package/dist/editor/clipboard/readers.js +37 -0
  87. package/dist/editor/clipboard/source.d.ts +12 -0
  88. package/dist/editor/clipboard/source.js +21 -0
  89. package/dist/editor/commands/comments/editing.d.ts +26 -6
  90. package/dist/editor/commands/comments/editing.js +177 -106
  91. package/dist/editor/commands/comments/model.d.ts +34 -17
  92. package/dist/editor/commands/comments/model.js +11 -0
  93. package/dist/editor/commands/comments/reading.d.ts +5 -3
  94. package/dist/editor/commands/comments/reading.js +8 -58
  95. package/dist/editor/commands/index.d.ts +2 -2
  96. package/dist/editor/commands/index.js +2 -0
  97. package/dist/editor/commands/linkCommands.js +20 -5
  98. package/dist/editor/commands/listCommands.d.ts +6 -0
  99. package/dist/editor/commands/listCommands.js +3 -2
  100. package/dist/editor/commands/lockCommands.js +59 -16
  101. package/dist/editor/commands/noteQueries.d.ts +22 -5
  102. package/dist/editor/commands/noteQueries.js +34 -6
  103. package/dist/editor/commands/paragraphCommands.js +2 -2
  104. package/dist/editor/createEditor.js +13 -3
  105. package/dist/editor/documentStyles.d.ts +26 -4
  106. package/dist/editor/documentStyles.js +9 -4
  107. package/dist/editor/imageFiles.d.ts +2 -2
  108. package/dist/editor/imageFiles.js +2 -0
  109. package/dist/editor/insertTable.d.ts +1 -1
  110. package/dist/editor/insertTable.js +2 -2
  111. package/dist/editor/plainText.d.ts +12 -0
  112. package/dist/editor/plainText.js +2 -1
  113. package/dist/editor/plugins/columnResize.js +6 -3
  114. package/dist/editor/plugins/commentComposer.d.ts +28 -0
  115. package/dist/editor/plugins/commentComposer.js +46 -0
  116. package/dist/editor/plugins/commentDecorations.d.ts +29 -2
  117. package/dist/editor/plugins/commentDecorations.js +89 -15
  118. package/dist/editor/plugins/documentProjection.d.ts +31 -0
  119. package/dist/editor/plugins/documentProjection.js +22 -0
  120. package/dist/editor/plugins/imagePaste.js +15 -8
  121. package/dist/editor/plugins/linkPanel.d.ts +7 -3
  122. package/dist/editor/plugins/linkPanel.js +13 -27
  123. package/dist/editor/plugins/panelState.d.ts +67 -0
  124. package/dist/editor/plugins/panelState.js +54 -0
  125. package/dist/editor/plugins/tableContextMenu.d.ts +1 -1
  126. package/dist/editor/plugins/tableContextMenu.js +30 -47
  127. package/dist/editor/plugins/textContextMenu.d.ts +1 -1
  128. package/dist/editor/plugins/textContextMenu.js +30 -47
  129. package/dist/ooxml/fragment.d.ts +11 -0
  130. package/dist/ooxml/fragment.js +14 -4
  131. package/dist/ooxml/image.d.ts +3 -4
  132. package/dist/ooxml/image.js +50 -5
  133. package/dist/ooxml/names.d.ts +6 -0
  134. package/dist/ooxml/names.js +2 -0
  135. package/dist/ooxml/props.d.ts +10 -0
  136. package/dist/ooxml/props.js +28 -4
  137. package/dist/ooxml/rangeMarkers.d.ts +5 -0
  138. package/dist/ooxml/rangeMarkers.js +24 -0
  139. package/dist/page/PageGuides.d.ts +7 -3
  140. package/dist/page/PageGuides.js +13 -24
  141. package/dist/page/pageLayout.d.ts +64 -5
  142. package/dist/page/pageLayout.js +90 -29
  143. package/dist/page/usePageLayout.d.ts +14 -4
  144. package/dist/page/usePageLayout.js +19 -20
  145. package/dist/schema/attrRoles.js +46 -23
  146. package/dist/schema/clipboard.d.ts +72 -0
  147. package/dist/schema/clipboard.js +288 -0
  148. package/dist/schema/docxSchema.d.ts +9 -1
  149. package/dist/schema/docxSchema.js +217 -165
  150. package/dist/schema/editGuard.d.ts +1 -1
  151. package/dist/schema/guards.js +2 -2
  152. package/dist/schema/index.d.ts +1 -0
  153. package/dist/schema/locks.d.ts +3 -0
  154. package/dist/schema/locks.js +29 -12
  155. package/dist/schema/preservedFragments.d.ts +12 -0
  156. package/dist/schema/preservedFragments.js +38 -0
  157. package/dist/schema/preservedGuards.d.ts +9 -7
  158. package/dist/schema/preservedGuards.js +112 -11
  159. package/dist/schema/protection.d.ts +34 -5
  160. package/dist/schema/protection.js +42 -14
  161. package/dist/schema/rendering.d.ts +14 -0
  162. package/dist/schema/rendering.js +27 -12
  163. package/dist/schema/stories.d.ts +49 -0
  164. package/dist/schema/stories.js +78 -0
  165. package/dist/schema/wrappers.d.ts +58 -0
  166. package/dist/schema/wrappers.js +77 -0
  167. package/dist/styles/classNames.d.ts +3 -5
  168. package/dist/styles/classNames.js +3 -5
  169. package/dist/styles.css +74 -12
  170. package/dist/table/resize.d.ts +5 -3
  171. package/dist/ui/CommentsPanel.d.ts +1 -3
  172. package/dist/ui/CommentsPanel.js +24 -15
  173. package/dist/ui/NotesPanel.js +2 -2
  174. package/dist/ui/TextMenu.d.ts +1 -3
  175. package/dist/ui/TextMenu.js +10 -6
  176. package/dist/ui/comments/CommentComposer.d.ts +6 -1
  177. package/dist/ui/comments/CommentComposer.js +26 -3
  178. package/package.json +5 -4
  179. package/dist/editor/externalClipboard.d.ts +0 -22
  180. package/dist/editor/externalClipboard.js +0 -486
@@ -0,0 +1,288 @@
1
+ // src/schema/clipboard.ts
2
+ import {
3
+ DOMSerializer,
4
+ Fragment
5
+ } from "prosemirror-model";
6
+ import {
7
+ spanCount,
8
+ toCellFormat,
9
+ toGridCols,
10
+ toParagraphFormat,
11
+ toRowFormat,
12
+ toRunFormat,
13
+ toTableFormat,
14
+ toTableWidth
15
+ } from "../model/format.js";
16
+ import { styleIdOf } from "../ooxml/props.js";
17
+ import { editorClassNames } from "../styles/classNames.js";
18
+ import { DEFAULT_FONT_FALLBACKS } from "../styles/fontStack.js";
19
+ import {
20
+ cellStyle,
21
+ columnWidthPx,
22
+ paragraphStyle,
23
+ rowStyle,
24
+ tableStyle
25
+ } from "../styles/inlineStyle.js";
26
+ import { isPageBreak } from "./docxSchema.js";
27
+ import { imageAttrs, runAttrs } from "./rendering.js";
28
+ var COPIED_STYLE_ATTRIBUTE = "data-style";
29
+ function safeHref(value) {
30
+ const href = value?.trim() ?? "";
31
+ if (href === "") return null;
32
+ if (/^(?:https?|mailto|tel):/i.test(href)) return href;
33
+ return /^(?:[./]|#)/.test(href) ? href : null;
34
+ }
35
+ function textAttr(value) {
36
+ return typeof value === "string" ? value : void 0;
37
+ }
38
+ function noteLabel(node) {
39
+ return node.attrs.customMarkFollows === true ? "" : textAttr(node.attrs.label) ?? "";
40
+ }
41
+ function oneLine(text) {
42
+ return text.replace(/[\n\f]+/g, " ");
43
+ }
44
+ function spanAttribute(count) {
45
+ const span = spanCount(count);
46
+ return span > 1 ? `${span}` : void 0;
47
+ }
48
+ function preservedText(node) {
49
+ const display = node.attrs.display;
50
+ if (display === "break") return "\n";
51
+ if (display !== "text" && display !== "chip") return null;
52
+ const drawn = textAttr(node.attrs.text);
53
+ return drawn === void 0 || drawn === "" ? null : drawn;
54
+ }
55
+ var PRESERVED_SPEC = {
56
+ toClipboardDOM: (node) => {
57
+ const said = preservedText(node);
58
+ if (said === null) return null;
59
+ return said === "\n" ? ["br"] : ["span", said];
60
+ },
61
+ toClipboardText: preservedText
62
+ };
63
+ var WRITES_NOTHING = {
64
+ toClipboardDOM: null,
65
+ toClipboardText: null
66
+ };
67
+ var CLIPBOARD_NODES = {
68
+ // A slice carries blocks, never the document itself, so neither answer is ever asked for
69
+ doc: WRITES_NOTHING,
70
+ paragraph: {
71
+ toClipboardDOM: (node) => [
72
+ "p",
73
+ {
74
+ class: editorClassNames.paragraph,
75
+ style: paragraphStyle(
76
+ toParagraphFormat(node.attrs.format),
77
+ toRunFormat(node.attrs.styleRun)
78
+ ),
79
+ [COPIED_STYLE_ATTRIBUTE]: styleIdOf(node.attrs.pPr) ?? void 0
80
+ },
81
+ 0
82
+ ],
83
+ toClipboardText: (_node, children) => children.join("")
84
+ },
85
+ table: {
86
+ toClipboardDOM: (node) => {
87
+ const attrs = {
88
+ class: editorClassNames.table,
89
+ style: tableStyle(
90
+ toTableFormat(node.attrs.format),
91
+ toTableWidth(node.attrs.tblW)
92
+ )
93
+ };
94
+ const body = ["tbody", 0];
95
+ const columns = toGridCols(node.attrs.gridCols).map((dxa) => [
96
+ "col",
97
+ { style: `width:${columnWidthPx(dxa)}px` }
98
+ ]);
99
+ if (columns.length === 0) return ["table", attrs, body];
100
+ return ["table", attrs, ["colgroup", ...columns], body];
101
+ },
102
+ toClipboardText: (_node, children) => children.join("\n")
103
+ },
104
+ tableRow: {
105
+ toClipboardDOM: (node) => [
106
+ "tr",
107
+ {
108
+ class: editorClassNames.tableRow,
109
+ style: rowStyle(toRowFormat(node.attrs.format))
110
+ },
111
+ 0
112
+ ],
113
+ toClipboardText: (_node, children) => children.join(" ")
114
+ },
115
+ tableCell: {
116
+ toClipboardDOM: (node) => [
117
+ "td",
118
+ {
119
+ class: editorClassNames.tableCell,
120
+ style: cellStyle(toCellFormat(node.attrs.format)),
121
+ colspan: spanAttribute(node.attrs.colspan),
122
+ rowspan: spanAttribute(node.attrs.rowspan)
123
+ },
124
+ 0
125
+ ],
126
+ // A tab stands between two cells and a line between two rows wherever a table is pasted as
127
+ // text, so nothing inside a cell may write a line: several paragraphs, a line break of their
128
+ // own and a nested table all say what they hold on the one line this cell stands on
129
+ toClipboardText: (_node, children) => oneLine(children.join(" "))
130
+ },
131
+ rawBlock: WRITES_NOTHING,
132
+ hardBreak: {
133
+ toClipboardDOM: () => ["br"],
134
+ // A page break ends more than a line, and the form feed is what says so in plain text
135
+ toClipboardText: (node) => isPageBreak(node.attrs.brAttrs) ? "\f" : "\n"
136
+ },
137
+ image: {
138
+ // The measure the document keeps stays behind. The pixels it was drawn at are what another
139
+ // application reads a size from, and what a paste back into this editor reads one from
140
+ toClipboardDOM: (node) => ["img", imageAttrs(node.attrs)],
141
+ // A picture is not text. But a copy may be read where no picture can follow, and there the
142
+ // words the document gave it for that very case are better than a gap
143
+ toClipboardText: (node) => textAttr(node.attrs.alt) ?? ""
144
+ },
145
+ commentStart: WRITES_NOTHING,
146
+ commentEnd: WRITES_NOTHING,
147
+ commentReference: WRITES_NOTHING,
148
+ noteReference: {
149
+ // A note whose own mark follows draws no number, and an empty superscript would stand for
150
+ // nothing wherever the copy lands
151
+ toClipboardDOM: (node) => {
152
+ const label = noteLabel(node);
153
+ if (label === "") return null;
154
+ const kind = node.attrs.kind === "endnote" ? "Endnote" : "Footnote";
155
+ return ["sup", { "aria-label": `${kind} ${label}` }, label];
156
+ },
157
+ toClipboardText: noteLabel
158
+ },
159
+ rawRunContent: PRESERVED_SPEC,
160
+ rawInline: PRESERVED_SPEC,
161
+ text: {
162
+ // `DOMSerializer` writes a text node itself and never asks a spec for one, so there is no
163
+ // drawing to declare. The characters travel as they stand
164
+ toClipboardDOM: null,
165
+ toClipboardText: (node) => node.text ?? ""
166
+ }
167
+ };
168
+ var CLIPBOARD_MARKS = {
169
+ // A content control is a wrapper the file keeps and nothing outside this editor reads back, so
170
+ // the text it held leaves on its own rather than inside a span standing for nothing
171
+ sdt: { toClipboardDOM: null },
172
+ link: {
173
+ // The editor draws the address as data so that a click inside the text places the caret.
174
+ // Anywhere else an anchor is what a link is: it follows in mail or a document, and it comes
175
+ // back as a link when it is pasted here again
176
+ toClipboardDOM: (mark) => {
177
+ const href = safeHref(textAttr(mark.attrs.href) ?? null);
178
+ const attrs = { class: editorClassNames.link, href: href ?? void 0 };
179
+ return href === null ? ["span", attrs, 0] : ["a", attrs, 0];
180
+ }
181
+ },
182
+ run: {
183
+ // The built-in fallbacks rather than the ones this editor was given: a copy is read where the
184
+ // host's font list means nothing, and the schema cannot see which editor it is drawing for
185
+ toClipboardDOM: (mark) => [
186
+ "span",
187
+ runAttrs(mark.attrs, DEFAULT_FONT_FALLBACKS),
188
+ 0
189
+ ]
190
+ },
191
+ tab: { toClipboardDOM: () => ["span", { class: editorClassNames.tab }, 0] }
192
+ };
193
+ var clipboardSpecs = { nodes: CLIPBOARD_NODES, marks: CLIPBOARD_MARKS };
194
+ var NODES_BY_NAME = CLIPBOARD_NODES;
195
+ function nodeSpec(node) {
196
+ return NODES_BY_NAME[node.type.name];
197
+ }
198
+ function clipboardDOMOf(node) {
199
+ const spec = nodeSpec(node);
200
+ if (spec === void 0 || spec.toClipboardDOM === null) return null;
201
+ return spec.toClipboardDOM(node);
202
+ }
203
+ function written(fragment) {
204
+ const kept = [];
205
+ fragment.forEach((child) => {
206
+ if (child.isText || clipboardDOMOf(child) !== null) kept.push(child);
207
+ });
208
+ return kept.length === fragment.childCount ? fragment : Fragment.from(kept);
209
+ }
210
+ var ClipboardSerializer = class extends DOMSerializer {
211
+ constructor(stampCopy) {
212
+ super(clipboardNodes(), clipboardMarks());
213
+ this.stampCopy = stampCopy;
214
+ }
215
+ stampCopy;
216
+ serializeFragment(fragment, options, target) {
217
+ const dom = super.serializeFragment(written(fragment), options, target);
218
+ if (target !== void 0) return dom;
219
+ if (dom.firstChild === null && fragment.childCount > 0) {
220
+ carrier(dom, options?.document);
221
+ }
222
+ this.stampCopy?.(dom);
223
+ return dom;
224
+ }
225
+ };
226
+ function carrier(copy, document) {
227
+ const owner = document ?? copy.ownerDocument;
228
+ if (owner !== null) copy.appendChild(owner.createElement("span"));
229
+ }
230
+ function clipboardNodes() {
231
+ return Object.fromEntries(
232
+ Object.entries(CLIPBOARD_NODES).flatMap(([name, spec]) => {
233
+ const draw = spec.toClipboardDOM;
234
+ return draw === null ? [] : [
235
+ [
236
+ name,
237
+ (node) => {
238
+ const drawn = draw(node);
239
+ if (drawn === null) {
240
+ throw new Error(
241
+ `${name} was serialized after drawing nothing`
242
+ );
243
+ }
244
+ return drawn;
245
+ }
246
+ ]
247
+ ];
248
+ })
249
+ );
250
+ }
251
+ function clipboardMarks() {
252
+ return Object.fromEntries(
253
+ Object.entries(CLIPBOARD_MARKS).flatMap(
254
+ ([name, spec]) => (
255
+ // A mark with no drawing of its own is left out, and `DOMSerializer` writes the content it
256
+ // covered without a wrapper
257
+ spec.toClipboardDOM === null ? [] : [[name, spec.toClipboardDOM]]
258
+ )
259
+ )
260
+ );
261
+ }
262
+ function clipboardSerializer(stampCopy) {
263
+ return new ClipboardSerializer(stampCopy);
264
+ }
265
+ function textPieces(fragment) {
266
+ const pieces = [];
267
+ fragment.forEach((child) => {
268
+ const piece = clipboardTextOf(child);
269
+ if (piece !== null) pieces.push(piece);
270
+ });
271
+ return pieces;
272
+ }
273
+ function clipboardTextOf(node) {
274
+ const spec = nodeSpec(node);
275
+ if (spec === void 0 || spec.toClipboardText === null) return null;
276
+ return spec.toClipboardText(node, textPieces(node.content));
277
+ }
278
+ function clipboardText(slice) {
279
+ const pieces = textPieces(slice.content);
280
+ return pieces.join(slice.content.firstChild?.isInline === true ? "" : "\n");
281
+ }
282
+ export {
283
+ COPIED_STYLE_ATTRIBUTE,
284
+ clipboardSerializer,
285
+ clipboardSpecs,
286
+ clipboardText,
287
+ safeHref
288
+ };
@@ -15,4 +15,12 @@ import { Schema } from "prosemirror-model";
15
15
  export { imageNodeSpec, runMarkSpec } from "./rendering";
16
16
  /** Whether this is a page-splitting break (`<w:br w:type="page"/>`). Read straight from the original attribute text */
17
17
  export declare function isPageBreak(brAttrs: unknown): boolean;
18
- export declare const docxSchema: Schema<"bookmarkBlock" | "commentEnd" | "commentReference" | "commentStart" | "doc" | "docxRaw" | "hardBreak" | "image" | "noteReference" | "paragraph" | "rawBlock" | "rawInline" | "table" | "tableCell" | "tableRow" | "text", "link" | "run" | "sdt" | "tab">;
18
+ /**
19
+ * How a preserved fragment is drawn, baked into the node's attrs when the document is opened
20
+ * (`docx/importPolicy`) so that this layer reads a value rather than a vocabulary.
21
+ *
22
+ * `hidden` puts nothing on screen, `text` draws the character the fragment stands for, `break`
23
+ * ends the line where it stood, and `chip` draws a small box naming the element.
24
+ */
25
+ export type PreservedDisplay = "hidden" | "text" | "break" | "chip";
26
+ export declare const docxSchema: Schema<"commentEnd" | "commentReference" | "commentStart" | "doc" | "hardBreak" | "image" | "noteReference" | "paragraph" | "rawBlock" | "rawInline" | "rawRunContent" | "table" | "tableCell" | "tableRow" | "text", "link" | "run" | "sdt" | "tab">;