@harbour-enterprises/superdoc 0.28.0 → 0.28.2

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 (87) hide show
  1. package/dist/chunks/{PdfViewer-COOBTu0Z.es.js → PdfViewer-DpWYWlWj.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-D-d9sxeo.cjs → PdfViewer-lAbA0-lT.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-lzF76amP.cjs → index-ByVhw_G0.cjs} +3 -3
  6. package/dist/chunks/index-CHAKf7mX-C5aFF6Zl.es.js +2213 -0
  7. package/dist/chunks/index-CHAKf7mX-Dx-DOGGJ.cjs +2213 -0
  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-DRCvimau-Cw339678.es.js +9876 -0
  17. package/dist/chunks/index-DRCvimau-H4Ck3S9a.cjs +9876 -0
  18. package/dist/chunks/index-D_sWOSiG-BtDZzJ6I.cjs +588 -0
  19. package/dist/chunks/index-D_sWOSiG-DE96TaT5.es.js +588 -0
  20. package/dist/chunks/{index-CeV3gm4O.es.js → index-Dw2T2UIP.es.js} +3 -3
  21. package/dist/chunks/index-Dz5_CDAf-B9kc0ArX.es.js +845 -0
  22. package/dist/chunks/index-Dz5_CDAf-C5D7BTD6.cjs +845 -0
  23. package/dist/chunks/{super-editor.es-CsOCPht5.cjs → super-editor.es-7iRvcDFc.cjs} +7812 -24984
  24. package/dist/chunks/{super-editor.es-CBBT9MkW.es.js → super-editor.es-DnZ5Ru-q.es.js} +7903 -25075
  25. package/dist/core/types/index.d.ts +6 -6
  26. package/dist/core/types/index.d.ts.map +1 -1
  27. package/dist/super-editor/ai-writer.es.js +2 -2
  28. package/dist/super-editor/chunks/{converter-3mtRTJOI.js → converter-C5g1OhUM.js} +702 -692
  29. package/dist/super-editor/chunks/default-BS6z0SoE.js +5 -0
  30. package/dist/super-editor/chunks/{docx-zipper-DIkBRy6i.js → docx-zipper-D9LLIDXC.js} +1 -1
  31. package/dist/super-editor/chunks/{editor-DakKNLen.js → editor-CD7hiFDo.js} +4186 -21369
  32. package/dist/super-editor/chunks/index-CHAKf7mX.js +2213 -0
  33. package/dist/super-editor/chunks/index-CSaZZzfe.js +265 -0
  34. package/dist/super-editor/chunks/index-C_x_N6Uh.js +2200 -0
  35. package/dist/super-editor/chunks/index-Cd3D_8gF.js +862 -0
  36. package/dist/super-editor/chunks/index-CvBqQJbG.js +878 -0
  37. package/dist/super-editor/chunks/index-DRCvimau.js +9876 -0
  38. package/dist/super-editor/chunks/index-D_sWOSiG.js +588 -0
  39. package/dist/super-editor/chunks/index-Dz5_CDAf.js +845 -0
  40. package/dist/super-editor/chunks/{toolbar-D4J4zzEp.js → toolbar-BC_z_xMq.js} +2 -2
  41. package/dist/super-editor/converter.es.js +2 -2
  42. package/dist/super-editor/docx-zipper.es.js +2 -2
  43. package/dist/super-editor/editor.es.js +3 -3
  44. package/dist/super-editor/file-zipper.es.js +1 -1
  45. package/dist/super-editor/super-editor/src/core/Editor.d.ts +2 -2
  46. package/dist/super-editor/super-editor/src/core/helpers/rangeUtils.d.ts +2 -0
  47. package/dist/super-editor/super-editor/src/extensions/field-annotation/FieldAnnotationPlugin.d.ts +5 -1
  48. package/dist/super-editor/super-editor/src/extensions/image/imageHelpers/imagePositionPlugin.d.ts +2 -0
  49. package/dist/super-editor/super-editor/src/extensions/list-item/helpers/listItemTypography.d.ts +5 -0
  50. package/dist/super-editor/super-editor/src/extensions/list-item/helpers/styledListMarkerPlugin.d.ts +11 -2
  51. package/dist/super-editor/super-editor/src/extensions/tab/helpers/tabDecorations.d.ts +4 -1
  52. package/dist/super-editor/super-editor/src/extensions/track-changes/permission-helpers.d.ts +6 -6
  53. package/dist/super-editor/super-editor.es.js +15 -15
  54. package/dist/super-editor/toolbar.es.js +2 -2
  55. package/dist/super-editor.cjs +1 -1
  56. package/dist/super-editor.es.js +1 -1
  57. package/dist/superdoc.cjs +2 -2
  58. package/dist/superdoc.es.js +2 -2
  59. package/dist/superdoc.umd.js +75068 -74546
  60. package/dist/superdoc.umd.js.map +1 -1
  61. package/package.json +1 -1
  62. package/dist/images/altText_add.svg +0 -3
  63. package/dist/images/altText_disclaimer.svg +0 -3
  64. package/dist/images/altText_done.svg +0 -3
  65. package/dist/images/altText_spinner.svg +0 -30
  66. package/dist/images/altText_warning.svg +0 -3
  67. package/dist/images/annotation-check.svg +0 -11
  68. package/dist/images/annotation-comment.svg +0 -16
  69. package/dist/images/annotation-help.svg +0 -26
  70. package/dist/images/annotation-insert.svg +0 -10
  71. package/dist/images/annotation-key.svg +0 -11
  72. package/dist/images/annotation-newparagraph.svg +0 -11
  73. package/dist/images/annotation-noicon.svg +0 -7
  74. package/dist/images/annotation-note.svg +0 -42
  75. package/dist/images/annotation-paperclip.svg +0 -6
  76. package/dist/images/annotation-paragraph.svg +0 -16
  77. package/dist/images/annotation-pushpin.svg +0 -7
  78. package/dist/images/cursor-editorFreeHighlight.svg +0 -6
  79. package/dist/images/cursor-editorFreeText.svg +0 -3
  80. package/dist/images/cursor-editorInk.svg +0 -4
  81. package/dist/images/cursor-editorTextHighlight.svg +0 -8
  82. package/dist/images/editor-toolbar-delete.svg +0 -5
  83. package/dist/images/loading-icon.gif +0 -0
  84. package/dist/images/messageBar_closingButton.svg +0 -3
  85. package/dist/images/messageBar_warning.svg +0 -3
  86. package/dist/images/toolbarButton-editorHighlight.svg +0 -6
  87. package/dist/images/toolbarButton-menuArrow.svg +0 -3
@@ -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,4 +1,4 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-CBBT9MkW.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-DnZ5Ru-q.es.js";
2
2
  import { a0 as effectScope, r as ref, _ as markRaw, $ as process$1, a1 as toRaw, d as computed, a2 as isRef, a3 as isReactive, C as toRef, i as inject, p as getCurrentInstance, l as watch, x as unref, a4 as hasInjectionContext, M as reactive, s as nextTick, a5 as getCurrentScope, a6 as onScopeDispose, a7 as toRefs, g as global$1, J as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, q as onDeactivated, z as createTextVNode, F as Fragment, Q as Comment, m as defineComponent, D as provide, H as withDirectives, B as h, U as Teleport, R as renderSlot, V as isVNode, I as watchEffect, O as Transition, a8 as TransitionGroup, E as mergeProps, P as vShow, G as cloneVNode, T as Text, c as createElementBlock, o as openBlock, t as toDisplayString, v as createVNode, y as withCtx, a as createBaseVNode, A as normalizeStyle, f as createCommentVNode, u as createBlock, w as withModifiers, n as normalizeClass, a9 as resolveDirective, e as renderList, b as createApp, X as resolveDynamicComponent, aa as defineAsyncComponent } from "./vue-ZWZLQtoU.es.js";
3
3
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
4
4
  import { E as EventEmitter } from "./eventemitter3-BWEnUdTY.es.js";
@@ -17156,7 +17156,7 @@ const _sfc_main = {
17156
17156
  __name: "SuperDoc",
17157
17157
  emits: ["selection-update"],
17158
17158
  setup(__props, { emit: __emit }) {
17159
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-COOBTu0Z.es.js"));
17159
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-DpWYWlWj.es.js"));
17160
17160
  const superdocStore = useSuperdocStore();
17161
17161
  const commentsStore = useCommentsStore();
17162
17162
  const {
@@ -17920,7 +17920,7 @@ class SuperDoc extends EventEmitter {
17920
17920
  this.config.colors = shuffleArray(this.config.colors);
17921
17921
  this.userColorMap = /* @__PURE__ */ new Map();
17922
17922
  this.colorIndex = 0;
17923
- this.version = "0.27.3";
17923
+ this.version = "0.28.1";
17924
17924
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
17925
17925
  this.superdocId = config.superdocId || v4();
17926
17926
  this.colors = this.config.colors;