@harbour-enterprises/superdoc 0.28.0-next.1 → 0.28.0-next.11

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 (99) hide show
  1. package/dist/chunks/{PdfViewer-9z5hlRyt.es.js → PdfViewer-CLpN99Rl.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-Jb55JUCS.cjs → PdfViewer-CvsrAT4c.cjs} +1 -1
  3. package/dist/chunks/default-BS6z0SoE-BS6z0SoE.es.js +5 -0
  4. package/dist/chunks/default-BS6z0SoE-Gl4f7Y7J.cjs +4 -0
  5. package/dist/chunks/index-CHAKf7mX-C5aFF6Zl.es.js +2213 -0
  6. package/dist/chunks/index-CHAKf7mX-Dx-DOGGJ.cjs +2213 -0
  7. package/dist/chunks/{index-DqP-8_tO.es.js → index-CNPV5EVY.es.js} +2 -2
  8. package/dist/chunks/index-CSaZZzfe-BzemjgYL.cjs +264 -0
  9. package/dist/chunks/index-CSaZZzfe-CSaZZzfe.es.js +265 -0
  10. package/dist/chunks/index-C_x_N6Uh-DJn8hIEt.es.js +2200 -0
  11. package/dist/chunks/index-C_x_N6Uh-Db3CUJMX.cjs +2200 -0
  12. package/dist/chunks/index-Cd3D_8gF-CFhMnajQ.es.js +862 -0
  13. package/dist/chunks/index-Cd3D_8gF-DKJ_wTu_.cjs +861 -0
  14. package/dist/chunks/index-CvBqQJbG-CvBqQJbG.es.js +878 -0
  15. package/dist/chunks/index-CvBqQJbG-Dwm0THD7.cjs +877 -0
  16. package/dist/chunks/index-DL9bff78-8izww2lB.es.js +845 -0
  17. package/dist/chunks/index-DL9bff78-Cf4UBVvQ.cjs +845 -0
  18. package/dist/chunks/index-DRCvimau-Cw339678.es.js +9876 -0
  19. package/dist/chunks/index-DRCvimau-H4Ck3S9a.cjs +9876 -0
  20. package/dist/chunks/index-D_sWOSiG-BtDZzJ6I.cjs +588 -0
  21. package/dist/chunks/index-D_sWOSiG-DE96TaT5.es.js +588 -0
  22. package/dist/chunks/{index-D0UvyM8m.cjs → index-sLveeSfi.cjs} +2 -2
  23. package/dist/chunks/{super-editor.es-BBJIKdhr.es.js → super-editor.es-0SXIzzbj.es.js} +1846 -1655
  24. package/dist/chunks/{super-editor.es-Ca5D3ZTW.cjs → super-editor.es-Dy32MdYk.cjs} +1845 -1654
  25. package/dist/core/types/index.d.ts +2 -1
  26. package/dist/core/types/index.d.ts.map +1 -1
  27. package/dist/images/altText_add.svg +3 -0
  28. package/dist/images/altText_disclaimer.svg +3 -0
  29. package/dist/images/altText_done.svg +3 -0
  30. package/dist/images/altText_spinner.svg +30 -0
  31. package/dist/images/altText_warning.svg +3 -0
  32. package/dist/images/annotation-check.svg +11 -0
  33. package/dist/images/annotation-comment.svg +16 -0
  34. package/dist/images/annotation-help.svg +26 -0
  35. package/dist/images/annotation-insert.svg +10 -0
  36. package/dist/images/annotation-key.svg +11 -0
  37. package/dist/images/annotation-newparagraph.svg +11 -0
  38. package/dist/images/annotation-noicon.svg +7 -0
  39. package/dist/images/annotation-note.svg +42 -0
  40. package/dist/images/annotation-paperclip.svg +6 -0
  41. package/dist/images/annotation-paragraph.svg +16 -0
  42. package/dist/images/annotation-pushpin.svg +7 -0
  43. package/dist/images/cursor-editorFreeHighlight.svg +6 -0
  44. package/dist/images/cursor-editorFreeText.svg +3 -0
  45. package/dist/images/cursor-editorInk.svg +4 -0
  46. package/dist/images/cursor-editorTextHighlight.svg +8 -0
  47. package/dist/images/editor-toolbar-delete.svg +5 -0
  48. package/dist/images/loading-icon.gif +0 -0
  49. package/dist/images/messageBar_closingButton.svg +3 -0
  50. package/dist/images/messageBar_warning.svg +3 -0
  51. package/dist/images/toolbarButton-editorHighlight.svg +6 -0
  52. package/dist/images/toolbarButton-menuArrow.svg +3 -0
  53. package/dist/stores/comments-store.d.ts +1 -1
  54. package/dist/super-editor/ai-writer.es.js +2 -2
  55. package/dist/super-editor/chunks/{converter-AR-76siZ.js → converter-DMwo26F4.js} +1299 -1211
  56. package/dist/super-editor/chunks/default-BS6z0SoE.js +5 -0
  57. package/dist/super-editor/chunks/{docx-zipper-DVb-VGgt.js → docx-zipper-CuoYR_fZ.js} +1 -1
  58. package/dist/super-editor/chunks/{editor-mK_uimq6.js → editor-BQ9mPcm5.js} +202 -104
  59. package/dist/super-editor/chunks/index-CHAKf7mX.js +2213 -0
  60. package/dist/super-editor/chunks/index-CSaZZzfe.js +265 -0
  61. package/dist/super-editor/chunks/index-C_x_N6Uh.js +2200 -0
  62. package/dist/super-editor/chunks/index-Cd3D_8gF.js +862 -0
  63. package/dist/super-editor/chunks/index-CvBqQJbG.js +878 -0
  64. package/dist/super-editor/chunks/index-DL9bff78.js +845 -0
  65. package/dist/super-editor/chunks/index-DRCvimau.js +9876 -0
  66. package/dist/super-editor/chunks/index-D_sWOSiG.js +588 -0
  67. package/dist/super-editor/chunks/{toolbar-ByoNwr7x.js → toolbar-D59d-aMm.js} +2 -2
  68. package/dist/super-editor/converter.es.js +1 -1
  69. package/dist/super-editor/docx-zipper.es.js +2 -2
  70. package/dist/super-editor/editor.es.js +3 -3
  71. package/dist/super-editor/file-zipper.es.js +1 -1
  72. package/dist/super-editor/super-editor/src/core/Editor.d.ts +7 -1
  73. package/dist/super-editor/super-editor/src/core/commands/decreaseListIndent.d.ts +1 -1
  74. package/dist/super-editor/super-editor/src/core/commands/increaseListIndent.d.ts +1 -1
  75. package/dist/super-editor/super-editor/src/core/commands/list-helpers/list-indent-helpers.d.ts +3 -0
  76. package/dist/super-editor/super-editor/src/core/super-converter/exporter.d.ts +6 -0
  77. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/docxImporter.d.ts +1 -0
  78. package/dist/super-editor/super-editor/src/core/super-converter/v2/importer/types/index.d.ts +1 -0
  79. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/sdt/helpers/translate-structured-content.d.ts +2 -2
  80. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/t/index.d.ts +1 -0
  81. package/dist/super-editor/super-editor/src/core/super-converter/v3/handlers/w/t/t-translator.d.ts +7 -0
  82. package/dist/super-editor/super-editor/src/core/super-converter/v3/node-translator/node-translator.d.ts +2 -1
  83. package/dist/super-editor/super-editor/src/extensions/structured-content/structured-content-block.d.ts +8 -6
  84. package/dist/super-editor/super-editor/src/extensions/structured-content/structured-content.d.ts +8 -1
  85. package/dist/super-editor/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentBlockTags.d.ts +11 -4
  86. package/dist/super-editor/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentInlineTags.d.ts +11 -4
  87. package/dist/super-editor/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTablesById.d.ts +8 -4
  88. package/dist/super-editor/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTags.d.ts +11 -4
  89. package/dist/super-editor/super-editor/src/extensions/structured-content/structuredContentHelpers/getStructuredContentTagsById.d.ts +12 -5
  90. package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts +2 -1
  91. package/dist/super-editor/super-editor.es.js +22 -22
  92. package/dist/super-editor/toolbar.es.js +2 -2
  93. package/dist/super-editor.cjs +1 -1
  94. package/dist/super-editor.es.js +1 -1
  95. package/dist/superdoc.cjs +2 -2
  96. package/dist/superdoc.es.js +2 -2
  97. package/dist/superdoc.umd.js +26057 -8172
  98. package/dist/superdoc.umd.js.map +1 -1
  99. package/package.json +1 -1
@@ -0,0 +1,588 @@
1
+ import { h as handle, f as formatCodeAsIndented, a as formatHeadingAsSetext, p as patternInScope, e as encodeCharacterReference } from "./index-Cd3D_8gF-CFhMnajQ.es.js";
2
+ const own$1 = {}.hasOwnProperty;
3
+ function zwitch(key, options) {
4
+ const settings = options || {};
5
+ function one(value, ...parameters) {
6
+ let fn = one.invalid;
7
+ const handlers = one.handlers;
8
+ if (value && own$1.call(value, key)) {
9
+ const id = String(value[key]);
10
+ fn = own$1.call(handlers, id) ? handlers[id] : one.unknown;
11
+ }
12
+ if (fn) {
13
+ return fn.call(this, value, ...parameters);
14
+ }
15
+ }
16
+ one.handlers = settings.handlers || {};
17
+ one.invalid = settings.invalid;
18
+ one.unknown = settings.unknown;
19
+ return one;
20
+ }
21
+ const own = {}.hasOwnProperty;
22
+ function configure(base, extension) {
23
+ let index = -1;
24
+ let key;
25
+ if (extension.extensions) {
26
+ while (++index < extension.extensions.length) {
27
+ configure(base, extension.extensions[index]);
28
+ }
29
+ }
30
+ for (key in extension) {
31
+ if (own.call(extension, key)) {
32
+ switch (key) {
33
+ case "extensions": {
34
+ break;
35
+ }
36
+ /* c8 ignore next 4 */
37
+ case "unsafe": {
38
+ list(base[key], extension[key]);
39
+ break;
40
+ }
41
+ case "join": {
42
+ list(base[key], extension[key]);
43
+ break;
44
+ }
45
+ case "handlers": {
46
+ map(base[key], extension[key]);
47
+ break;
48
+ }
49
+ default: {
50
+ base.options[key] = extension[key];
51
+ }
52
+ }
53
+ }
54
+ }
55
+ return base;
56
+ }
57
+ function list(left, right) {
58
+ if (right) {
59
+ left.push(...right);
60
+ }
61
+ }
62
+ function map(left, right) {
63
+ if (right) {
64
+ Object.assign(left, right);
65
+ }
66
+ }
67
+ const join = [joinDefaults];
68
+ function joinDefaults(left, right, parent, state) {
69
+ if (right.type === "code" && formatCodeAsIndented(right, state) && (left.type === "list" || left.type === right.type && formatCodeAsIndented(left, state))) {
70
+ return false;
71
+ }
72
+ if ("spread" in parent && typeof parent.spread === "boolean") {
73
+ if (left.type === "paragraph" && // Two paragraphs.
74
+ (left.type === right.type || right.type === "definition" || // Paragraph followed by a setext heading.
75
+ right.type === "heading" && formatHeadingAsSetext(right, state))) {
76
+ return;
77
+ }
78
+ return parent.spread ? 1 : 0;
79
+ }
80
+ }
81
+ const fullPhrasingSpans = [
82
+ "autolink",
83
+ "destinationLiteral",
84
+ "destinationRaw",
85
+ "reference",
86
+ "titleQuote",
87
+ "titleApostrophe"
88
+ ];
89
+ const unsafe = [
90
+ { character: " ", after: "[\\r\\n]", inConstruct: "phrasing" },
91
+ { character: " ", before: "[\\r\\n]", inConstruct: "phrasing" },
92
+ {
93
+ character: " ",
94
+ inConstruct: ["codeFencedLangGraveAccent", "codeFencedLangTilde"]
95
+ },
96
+ {
97
+ character: "\r",
98
+ inConstruct: [
99
+ "codeFencedLangGraveAccent",
100
+ "codeFencedLangTilde",
101
+ "codeFencedMetaGraveAccent",
102
+ "codeFencedMetaTilde",
103
+ "destinationLiteral",
104
+ "headingAtx"
105
+ ]
106
+ },
107
+ {
108
+ character: "\n",
109
+ inConstruct: [
110
+ "codeFencedLangGraveAccent",
111
+ "codeFencedLangTilde",
112
+ "codeFencedMetaGraveAccent",
113
+ "codeFencedMetaTilde",
114
+ "destinationLiteral",
115
+ "headingAtx"
116
+ ]
117
+ },
118
+ { character: " ", after: "[\\r\\n]", inConstruct: "phrasing" },
119
+ { character: " ", before: "[\\r\\n]", inConstruct: "phrasing" },
120
+ {
121
+ character: " ",
122
+ inConstruct: ["codeFencedLangGraveAccent", "codeFencedLangTilde"]
123
+ },
124
+ // An exclamation mark can start an image, if it is followed by a link or
125
+ // a link reference.
126
+ {
127
+ character: "!",
128
+ after: "\\[",
129
+ inConstruct: "phrasing",
130
+ notInConstruct: fullPhrasingSpans
131
+ },
132
+ // A quote can break out of a title.
133
+ { character: '"', inConstruct: "titleQuote" },
134
+ // A number sign could start an ATX heading if it starts a line.
135
+ { atBreak: true, character: "#" },
136
+ { character: "#", inConstruct: "headingAtx", after: "(?:[\r\n]|$)" },
137
+ // Dollar sign and percentage are not used in markdown.
138
+ // An ampersand could start a character reference.
139
+ { character: "&", after: "[#A-Za-z]", inConstruct: "phrasing" },
140
+ // An apostrophe can break out of a title.
141
+ { character: "'", inConstruct: "titleApostrophe" },
142
+ // A left paren could break out of a destination raw.
143
+ { character: "(", inConstruct: "destinationRaw" },
144
+ // A left paren followed by `]` could make something into a link or image.
145
+ {
146
+ before: "\\]",
147
+ character: "(",
148
+ inConstruct: "phrasing",
149
+ notInConstruct: fullPhrasingSpans
150
+ },
151
+ // A right paren could start a list item or break out of a destination
152
+ // raw.
153
+ { atBreak: true, before: "\\d+", character: ")" },
154
+ { character: ")", inConstruct: "destinationRaw" },
155
+ // An asterisk can start thematic breaks, list items, emphasis, strong.
156
+ { atBreak: true, character: "*", after: "(?:[ \r\n*])" },
157
+ { character: "*", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans },
158
+ // A plus sign could start a list item.
159
+ { atBreak: true, character: "+", after: "(?:[ \r\n])" },
160
+ // A dash can start thematic breaks, list items, and setext heading
161
+ // underlines.
162
+ { atBreak: true, character: "-", after: "(?:[ \r\n-])" },
163
+ // A dot could start a list item.
164
+ { atBreak: true, before: "\\d+", character: ".", after: "(?:[ \r\n]|$)" },
165
+ // Slash, colon, and semicolon are not used in markdown for constructs.
166
+ // A less than can start html (flow or text) or an autolink.
167
+ // HTML could start with an exclamation mark (declaration, cdata, comment),
168
+ // slash (closing tag), question mark (instruction), or a letter (tag).
169
+ // An autolink also starts with a letter.
170
+ // Finally, it could break out of a destination literal.
171
+ { atBreak: true, character: "<", after: "[!/?A-Za-z]" },
172
+ {
173
+ character: "<",
174
+ after: "[!/?A-Za-z]",
175
+ inConstruct: "phrasing",
176
+ notInConstruct: fullPhrasingSpans
177
+ },
178
+ { character: "<", inConstruct: "destinationLiteral" },
179
+ // An equals to can start setext heading underlines.
180
+ { atBreak: true, character: "=" },
181
+ // A greater than can start block quotes and it can break out of a
182
+ // destination literal.
183
+ { atBreak: true, character: ">" },
184
+ { character: ">", inConstruct: "destinationLiteral" },
185
+ // Question mark and at sign are not used in markdown for constructs.
186
+ // A left bracket can start definitions, references, labels,
187
+ { atBreak: true, character: "[" },
188
+ { character: "[", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans },
189
+ { character: "[", inConstruct: ["label", "reference"] },
190
+ // A backslash can start an escape (when followed by punctuation) or a
191
+ // hard break (when followed by an eol).
192
+ // Note: typical escapes are handled in `safe`!
193
+ { character: "\\", after: "[\\r\\n]", inConstruct: "phrasing" },
194
+ // A right bracket can exit labels.
195
+ { character: "]", inConstruct: ["label", "reference"] },
196
+ // Caret is not used in markdown for constructs.
197
+ // An underscore can start emphasis, strong, or a thematic break.
198
+ { atBreak: true, character: "_" },
199
+ { character: "_", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans },
200
+ // A grave accent can start code (fenced or text), or it can break out of
201
+ // a grave accent code fence.
202
+ { atBreak: true, character: "`" },
203
+ {
204
+ character: "`",
205
+ inConstruct: ["codeFencedLangGraveAccent", "codeFencedMetaGraveAccent"]
206
+ },
207
+ { character: "`", inConstruct: "phrasing", notInConstruct: fullPhrasingSpans },
208
+ // Left brace, vertical bar, right brace are not used in markdown for
209
+ // constructs.
210
+ // A tilde can start code (fenced).
211
+ { atBreak: true, character: "~" }
212
+ ];
213
+ const element = document.createElement("i");
214
+ function decodeNamedCharacterReference(value) {
215
+ const characterReference = "&" + value + ";";
216
+ element.innerHTML = characterReference;
217
+ const character = element.textContent;
218
+ if (
219
+ // @ts-expect-error: TypeScript is wrong that `textContent` on elements can
220
+ // yield `null`.
221
+ character.charCodeAt(character.length - 1) === 59 && value !== "semi"
222
+ ) {
223
+ return false;
224
+ }
225
+ return character === characterReference ? false : character;
226
+ }
227
+ function decodeNumericCharacterReference(value, base) {
228
+ const code = Number.parseInt(value, base);
229
+ if (
230
+ // C0 except for HT, LF, FF, CR, space.
231
+ code < 9 || code === 11 || code > 13 && code < 32 || // Control character (DEL) of C0, and C1 controls.
232
+ code > 126 && code < 160 || // Lone high surrogates and low surrogates.
233
+ code > 55295 && code < 57344 || // Noncharacters.
234
+ code > 64975 && code < 65008 || /* eslint-disable no-bitwise */
235
+ (code & 65535) === 65535 || (code & 65535) === 65534 || /* eslint-enable no-bitwise */
236
+ // Out of range
237
+ code > 1114111
238
+ ) {
239
+ return "�";
240
+ }
241
+ return String.fromCodePoint(code);
242
+ }
243
+ const characterEscapeOrReference = /\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;
244
+ function decodeString(value) {
245
+ return value.replace(characterEscapeOrReference, decode);
246
+ }
247
+ function decode($0, $1, $2) {
248
+ if ($1) {
249
+ return $1;
250
+ }
251
+ const head = $2.charCodeAt(0);
252
+ if (head === 35) {
253
+ const head2 = $2.charCodeAt(1);
254
+ const hex = head2 === 120 || head2 === 88;
255
+ return decodeNumericCharacterReference($2.slice(hex ? 2 : 1), hex ? 16 : 10);
256
+ }
257
+ return decodeNamedCharacterReference($2) || $0;
258
+ }
259
+ function association(node) {
260
+ if (node.label || !node.identifier) {
261
+ return node.label || "";
262
+ }
263
+ return decodeString(node.identifier);
264
+ }
265
+ function compilePattern(pattern) {
266
+ if (!pattern._compiled) {
267
+ const before = (pattern.atBreak ? "[\\r\\n][\\t ]*" : "") + (pattern.before ? "(?:" + pattern.before + ")" : "");
268
+ pattern._compiled = new RegExp(
269
+ (before ? "(" + before + ")" : "") + (/[|\\{}()[\]^$+*?.-]/.test(pattern.character) ? "\\" : "") + pattern.character + (pattern.after ? "(?:" + pattern.after + ")" : ""),
270
+ "g"
271
+ );
272
+ }
273
+ return pattern._compiled;
274
+ }
275
+ function containerPhrasing(parent, state, info) {
276
+ const indexStack = state.indexStack;
277
+ const children = parent.children || [];
278
+ const results = [];
279
+ let index = -1;
280
+ let before = info.before;
281
+ let encodeAfter;
282
+ indexStack.push(-1);
283
+ let tracker = state.createTracker(info);
284
+ while (++index < children.length) {
285
+ const child = children[index];
286
+ let after;
287
+ indexStack[indexStack.length - 1] = index;
288
+ if (index + 1 < children.length) {
289
+ let handle2 = state.handle.handlers[children[index + 1].type];
290
+ if (handle2 && handle2.peek) handle2 = handle2.peek;
291
+ after = handle2 ? handle2(children[index + 1], parent, state, {
292
+ before: "",
293
+ after: "",
294
+ ...tracker.current()
295
+ }).charAt(0) : "";
296
+ } else {
297
+ after = info.after;
298
+ }
299
+ if (results.length > 0 && (before === "\r" || before === "\n") && child.type === "html") {
300
+ results[results.length - 1] = results[results.length - 1].replace(
301
+ /(\r?\n|\r)$/,
302
+ " "
303
+ );
304
+ before = " ";
305
+ tracker = state.createTracker(info);
306
+ tracker.move(results.join(""));
307
+ }
308
+ let value = state.handle(child, parent, state, {
309
+ ...tracker.current(),
310
+ after,
311
+ before
312
+ });
313
+ if (encodeAfter && encodeAfter === value.slice(0, 1)) {
314
+ value = encodeCharacterReference(encodeAfter.charCodeAt(0)) + value.slice(1);
315
+ }
316
+ const encodingInfo = state.attentionEncodeSurroundingInfo;
317
+ state.attentionEncodeSurroundingInfo = void 0;
318
+ encodeAfter = void 0;
319
+ if (encodingInfo) {
320
+ if (results.length > 0 && encodingInfo.before && before === results[results.length - 1].slice(-1)) {
321
+ results[results.length - 1] = results[results.length - 1].slice(0, -1) + encodeCharacterReference(before.charCodeAt(0));
322
+ }
323
+ if (encodingInfo.after) encodeAfter = after;
324
+ }
325
+ tracker.move(value);
326
+ results.push(value);
327
+ before = value.slice(-1);
328
+ }
329
+ indexStack.pop();
330
+ return results.join("");
331
+ }
332
+ function containerFlow(parent, state, info) {
333
+ const indexStack = state.indexStack;
334
+ const children = parent.children || [];
335
+ const tracker = state.createTracker(info);
336
+ const results = [];
337
+ let index = -1;
338
+ indexStack.push(-1);
339
+ while (++index < children.length) {
340
+ const child = children[index];
341
+ indexStack[indexStack.length - 1] = index;
342
+ results.push(
343
+ tracker.move(
344
+ state.handle(child, parent, state, {
345
+ before: "\n",
346
+ after: "\n",
347
+ ...tracker.current()
348
+ })
349
+ )
350
+ );
351
+ if (child.type !== "list") {
352
+ state.bulletLastUsed = void 0;
353
+ }
354
+ if (index < children.length - 1) {
355
+ results.push(
356
+ tracker.move(between(child, children[index + 1], parent, state))
357
+ );
358
+ }
359
+ }
360
+ indexStack.pop();
361
+ return results.join("");
362
+ }
363
+ function between(left, right, parent, state) {
364
+ let index = state.join.length;
365
+ while (index--) {
366
+ const result = state.join[index](left, right, parent, state);
367
+ if (result === true || result === 1) {
368
+ break;
369
+ }
370
+ if (typeof result === "number") {
371
+ return "\n".repeat(1 + result);
372
+ }
373
+ if (result === false) {
374
+ return "\n\n<!---->\n\n";
375
+ }
376
+ }
377
+ return "\n\n";
378
+ }
379
+ const eol = /\r?\n|\r/g;
380
+ function indentLines(value, map2) {
381
+ const result = [];
382
+ let start = 0;
383
+ let line = 0;
384
+ let match;
385
+ while (match = eol.exec(value)) {
386
+ one(value.slice(start, match.index));
387
+ result.push(match[0]);
388
+ start = match.index + match[0].length;
389
+ line++;
390
+ }
391
+ one(value.slice(start));
392
+ return result.join("");
393
+ function one(value2) {
394
+ result.push(map2(value2, line, !value2));
395
+ }
396
+ }
397
+ function safe(state, input, config) {
398
+ const value = (config.before || "") + (input || "") + (config.after || "");
399
+ const positions = [];
400
+ const result = [];
401
+ const infos = {};
402
+ let index = -1;
403
+ while (++index < state.unsafe.length) {
404
+ const pattern = state.unsafe[index];
405
+ if (!patternInScope(state.stack, pattern)) {
406
+ continue;
407
+ }
408
+ const expression = state.compilePattern(pattern);
409
+ let match;
410
+ while (match = expression.exec(value)) {
411
+ const before = "before" in pattern || Boolean(pattern.atBreak);
412
+ const after = "after" in pattern;
413
+ const position = match.index + (before ? match[1].length : 0);
414
+ if (positions.includes(position)) {
415
+ if (infos[position].before && !before) {
416
+ infos[position].before = false;
417
+ }
418
+ if (infos[position].after && !after) {
419
+ infos[position].after = false;
420
+ }
421
+ } else {
422
+ positions.push(position);
423
+ infos[position] = { before, after };
424
+ }
425
+ }
426
+ }
427
+ positions.sort(numerical);
428
+ let start = config.before ? config.before.length : 0;
429
+ const end = value.length - (config.after ? config.after.length : 0);
430
+ index = -1;
431
+ while (++index < positions.length) {
432
+ const position = positions[index];
433
+ if (position < start || position >= end) {
434
+ continue;
435
+ }
436
+ if (position + 1 < end && positions[index + 1] === position + 1 && infos[position].after && !infos[position + 1].before && !infos[position + 1].after || positions[index - 1] === position - 1 && infos[position].before && !infos[position - 1].before && !infos[position - 1].after) {
437
+ continue;
438
+ }
439
+ if (start !== position) {
440
+ result.push(escapeBackslashes(value.slice(start, position), "\\"));
441
+ }
442
+ start = position;
443
+ if (/[!-/:-@[-`{-~]/.test(value.charAt(position)) && (!config.encode || !config.encode.includes(value.charAt(position)))) {
444
+ result.push("\\");
445
+ } else {
446
+ result.push(encodeCharacterReference(value.charCodeAt(position)));
447
+ start++;
448
+ }
449
+ }
450
+ result.push(escapeBackslashes(value.slice(start, end), config.after));
451
+ return result.join("");
452
+ }
453
+ function numerical(a, b) {
454
+ return a - b;
455
+ }
456
+ function escapeBackslashes(value, after) {
457
+ const expression = /\\(?=[!-/:-@[-`{-~])/g;
458
+ const positions = [];
459
+ const results = [];
460
+ const whole = value + after;
461
+ let index = -1;
462
+ let start = 0;
463
+ let match;
464
+ while (match = expression.exec(whole)) {
465
+ positions.push(match.index);
466
+ }
467
+ while (++index < positions.length) {
468
+ if (start !== positions[index]) {
469
+ results.push(value.slice(start, positions[index]));
470
+ }
471
+ results.push("\\");
472
+ start = positions[index];
473
+ }
474
+ results.push(value.slice(start));
475
+ return results.join("");
476
+ }
477
+ function track(config) {
478
+ const options = config || {};
479
+ const now = options.now || {};
480
+ let lineShift = options.lineShift || 0;
481
+ let line = now.line || 1;
482
+ let column = now.column || 1;
483
+ return { move, current, shift };
484
+ function current() {
485
+ return { now: { line, column }, lineShift };
486
+ }
487
+ function shift(value) {
488
+ lineShift += value;
489
+ }
490
+ function move(input) {
491
+ const value = input || "";
492
+ const chunks = value.split(/\r?\n|\r/g);
493
+ const tail = chunks[chunks.length - 1];
494
+ line += chunks.length - 1;
495
+ column = chunks.length === 1 ? column + tail.length : 1 + tail.length + lineShift;
496
+ return value;
497
+ }
498
+ }
499
+ function toMarkdown(tree, options) {
500
+ const settings = options || {};
501
+ const state = {
502
+ associationId: association,
503
+ containerPhrasing: containerPhrasingBound,
504
+ containerFlow: containerFlowBound,
505
+ createTracker: track,
506
+ compilePattern,
507
+ enter,
508
+ // @ts-expect-error: GFM / frontmatter are typed in `mdast` but not defined
509
+ // here.
510
+ handlers: { ...handle },
511
+ // @ts-expect-error: add `handle` in a second.
512
+ handle: void 0,
513
+ indentLines,
514
+ indexStack: [],
515
+ join: [...join],
516
+ options: {},
517
+ safe: safeBound,
518
+ stack: [],
519
+ unsafe: [...unsafe]
520
+ };
521
+ configure(state, settings);
522
+ if (state.options.tightDefinitions) {
523
+ state.join.push(joinDefinition);
524
+ }
525
+ state.handle = zwitch("type", {
526
+ invalid,
527
+ unknown,
528
+ handlers: state.handlers
529
+ });
530
+ let result = state.handle(tree, void 0, state, {
531
+ before: "\n",
532
+ after: "\n",
533
+ now: { line: 1, column: 1 },
534
+ lineShift: 0
535
+ });
536
+ if (result && result.charCodeAt(result.length - 1) !== 10 && result.charCodeAt(result.length - 1) !== 13) {
537
+ result += "\n";
538
+ }
539
+ return result;
540
+ function enter(name) {
541
+ state.stack.push(name);
542
+ return exit;
543
+ function exit() {
544
+ state.stack.pop();
545
+ }
546
+ }
547
+ }
548
+ function invalid(value) {
549
+ throw new Error("Cannot handle value `" + value + "`, expected node");
550
+ }
551
+ function unknown(value) {
552
+ const node = (
553
+ /** @type {Nodes} */
554
+ value
555
+ );
556
+ throw new Error("Cannot handle unknown node `" + node.type + "`");
557
+ }
558
+ function joinDefinition(left, right) {
559
+ if (left.type === "definition" && left.type === right.type) {
560
+ return 0;
561
+ }
562
+ }
563
+ function containerPhrasingBound(parent, info) {
564
+ return containerPhrasing(parent, this, info);
565
+ }
566
+ function containerFlowBound(parent, info) {
567
+ return containerFlow(parent, this, info);
568
+ }
569
+ function safeBound(value, config) {
570
+ return safe(this, value, config);
571
+ }
572
+ function remarkStringify(options) {
573
+ const self = this;
574
+ self.compiler = compiler;
575
+ function compiler(tree) {
576
+ return toMarkdown(tree, {
577
+ ...self.data("settings"),
578
+ ...options,
579
+ // Note: this option is not in the readme.
580
+ // The goal is for it to be set by plugins on `data` instead of being
581
+ // passed by users.
582
+ extensions: self.data("toMarkdownExtensions") || []
583
+ });
584
+ }
585
+ }
586
+ export {
587
+ remarkStringify as default
588
+ };
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-Ca5D3ZTW.cjs");
2
+ const superEditor_es = require("./super-editor.es-Dy32MdYk.cjs");
3
3
  const vue = require("./vue-DKMj1I9B.cjs");
4
4
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
5
5
  const eventemitter3 = require("./eventemitter3-DkXkH2rT.cjs");
@@ -17173,7 +17173,7 @@ const _sfc_main = {
17173
17173
  __name: "SuperDoc",
17174
17174
  emits: ["selection-update"],
17175
17175
  setup(__props, { emit: __emit }) {
17176
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-Jb55JUCS.cjs")));
17176
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CvsrAT4c.cjs")));
17177
17177
  const superdocStore = useSuperdocStore();
17178
17178
  const commentsStore = useCommentsStore();
17179
17179
  const {