@harbour-enterprises/superdoc 0.27.3-next.2 → 0.28.0-next.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 (58) hide show
  1. package/dist/chunks/{PdfViewer-BjZ5mGJm.es.js → PdfViewer-9z5hlRyt.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-B4iIjHV0.cjs → PdfViewer-Jb55JUCS.cjs} +1 -1
  3. package/dist/chunks/{index-D6aLyyxJ.cjs → index-D0UvyM8m.cjs} +10 -4
  4. package/dist/chunks/{index-DkzQzDKS.es.js → index-DqP-8_tO.es.js} +10 -4
  5. package/dist/chunks/{super-editor.es-DAZHU_K5.es.js → super-editor.es-BBJIKdhr.es.js} +129 -34
  6. package/dist/chunks/{super-editor.es-BbpZtQLg.cjs → super-editor.es-Ca5D3ZTW.cjs} +129 -34
  7. package/dist/chunks/uuid-CjlX8hrF.es.js +35 -0
  8. package/dist/chunks/uuid-R7L08bOx.cjs +34 -0
  9. package/dist/components/CommentsLayer/use-comment.d.ts.map +1 -1
  10. package/dist/core/types/index.d.ts.map +1 -1
  11. package/dist/stores/comments-store.d.ts.map +1 -1
  12. package/dist/super-editor/ai-writer.es.js +2 -2
  13. package/dist/super-editor/chunks/{converter-qTrGAY0a.js → converter-AR-76siZ.js} +37 -30
  14. package/dist/super-editor/chunks/{docx-zipper-BRttLmZq.js → docx-zipper-DVb-VGgt.js} +1 -1
  15. package/dist/super-editor/chunks/{editor-DqOCeU9J.js → editor-mK_uimq6.js} +93 -5
  16. package/dist/super-editor/chunks/{toolbar-cZin2t1V.js → toolbar-ByoNwr7x.js} +2 -2
  17. package/dist/super-editor/converter.es.js +1 -1
  18. package/dist/super-editor/docx-zipper.es.js +2 -2
  19. package/dist/super-editor/editor.es.js +3 -3
  20. package/dist/super-editor/file-zipper.es.js +1 -1
  21. package/dist/super-editor/super-editor/src/components/toolbar/use-toolbar-item.d.ts +1 -1
  22. package/dist/super-editor/super-editor/src/core/commands/getSelectionMarks.d.ts +1 -0
  23. package/dist/super-editor/super-editor/src/core/commands/index.d.ts +2 -0
  24. package/dist/super-editor/super-editor/src/core/commands/setTextSelection.d.ts +4 -0
  25. package/dist/super-editor/super-editor/src/extensions/comment/comments-plugin.d.ts +2 -1
  26. package/dist/super-editor/super-editor/src/tests/helpers/helpers.d.ts +1 -1
  27. package/dist/super-editor/super-editor.es.js +6 -6
  28. package/dist/super-editor/toolbar.es.js +2 -2
  29. package/dist/super-editor.cjs +1 -1
  30. package/dist/super-editor.es.js +1 -1
  31. package/dist/superdoc.cjs +2 -2
  32. package/dist/superdoc.es.js +2 -2
  33. package/dist/superdoc.umd.js +161 -62
  34. package/dist/superdoc.umd.js.map +1 -1
  35. package/package.json +5 -8
  36. package/dist/chunks/uuid-CQzaMNgL.cjs +0 -36
  37. package/dist/chunks/uuid-DIIKH5Zc.es.js +0 -37
  38. package/dist/images/altText_add.svg +0 -3
  39. package/dist/images/altText_done.svg +0 -3
  40. package/dist/images/annotation-check.svg +0 -11
  41. package/dist/images/annotation-comment.svg +0 -16
  42. package/dist/images/annotation-help.svg +0 -26
  43. package/dist/images/annotation-insert.svg +0 -10
  44. package/dist/images/annotation-key.svg +0 -11
  45. package/dist/images/annotation-newparagraph.svg +0 -11
  46. package/dist/images/annotation-noicon.svg +0 -7
  47. package/dist/images/annotation-note.svg +0 -42
  48. package/dist/images/annotation-paperclip.svg +0 -6
  49. package/dist/images/annotation-paragraph.svg +0 -16
  50. package/dist/images/annotation-pushpin.svg +0 -7
  51. package/dist/images/cursor-editorFreeHighlight.svg +0 -6
  52. package/dist/images/cursor-editorFreeText.svg +0 -3
  53. package/dist/images/cursor-editorInk.svg +0 -4
  54. package/dist/images/cursor-editorTextHighlight.svg +0 -8
  55. package/dist/images/editor-toolbar-delete.svg +0 -5
  56. package/dist/images/loading-icon.gif +0 -0
  57. package/dist/images/toolbarButton-editorHighlight.svg +0 -6
  58. package/dist/images/toolbarButton-menuArrow.svg +0 -3
@@ -7762,9 +7762,9 @@
7762
7762
  var revLookup = [];
7763
7763
  var Arr = typeof Uint8Array !== "undefined" ? Uint8Array : Array;
7764
7764
  var code$1 = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
7765
- for (var i$1$1 = 0, len = code$1.length; i$1$1 < len; ++i$1$1) {
7766
- lookup[i$1$1] = code$1[i$1$1];
7767
- revLookup[code$1.charCodeAt(i$1$1)] = i$1$1;
7765
+ for (var i$1 = 0, len = code$1.length; i$1 < len; ++i$1) {
7766
+ lookup[i$1] = code$1[i$1];
7767
+ revLookup[code$1.charCodeAt(i$1)] = i$1;
7768
7768
  }
7769
7769
  revLookup["-".charCodeAt(0)] = 62;
7770
7770
  revLookup["_".charCodeAt(0)] = 63;
@@ -19072,39 +19072,37 @@
19072
19072
  }
19073
19073
  var libExports = requireLib();
19074
19074
  const xmljs = /* @__PURE__ */ getDefaultExportFromCjs$2(libExports);
19075
- var getRandomValues$1;
19076
- var rnds8$1 = new Uint8Array(16);
19075
+ let getRandomValues$1;
19076
+ const rnds8$1 = new Uint8Array(16);
19077
19077
  function rng$1() {
19078
19078
  if (!getRandomValues$1) {
19079
- getRandomValues$1 = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
19079
+ getRandomValues$1 = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
19080
19080
  if (!getRandomValues$1) {
19081
19081
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
19082
19082
  }
19083
19083
  }
19084
19084
  return getRandomValues$1(rnds8$1);
19085
19085
  }
19086
- const REGEX$1 = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
19087
- function validate$1(uuid) {
19088
- return typeof uuid === "string" && REGEX$1.test(uuid);
19086
+ const byteToHex$1 = [];
19087
+ for (let i2 = 0; i2 < 256; ++i2) {
19088
+ byteToHex$1.push((i2 + 256).toString(16).slice(1));
19089
19089
  }
19090
- var byteToHex$1 = [];
19091
- for (var i$2 = 0; i$2 < 256; ++i$2) {
19092
- byteToHex$1.push((i$2 + 256).toString(16).substr(1));
19093
- }
19094
- function stringify$1(arr) {
19095
- var offset2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
19096
- var uuid = (byteToHex$1[arr[offset2 + 0]] + byteToHex$1[arr[offset2 + 1]] + byteToHex$1[arr[offset2 + 2]] + byteToHex$1[arr[offset2 + 3]] + "-" + byteToHex$1[arr[offset2 + 4]] + byteToHex$1[arr[offset2 + 5]] + "-" + byteToHex$1[arr[offset2 + 6]] + byteToHex$1[arr[offset2 + 7]] + "-" + byteToHex$1[arr[offset2 + 8]] + byteToHex$1[arr[offset2 + 9]] + "-" + byteToHex$1[arr[offset2 + 10]] + byteToHex$1[arr[offset2 + 11]] + byteToHex$1[arr[offset2 + 12]] + byteToHex$1[arr[offset2 + 13]] + byteToHex$1[arr[offset2 + 14]] + byteToHex$1[arr[offset2 + 15]]).toLowerCase();
19097
- if (!validate$1(uuid)) {
19098
- throw TypeError("Stringified UUID is invalid");
19099
- }
19100
- return uuid;
19090
+ function unsafeStringify$1(arr, offset2 = 0) {
19091
+ return byteToHex$1[arr[offset2 + 0]] + byteToHex$1[arr[offset2 + 1]] + byteToHex$1[arr[offset2 + 2]] + byteToHex$1[arr[offset2 + 3]] + "-" + byteToHex$1[arr[offset2 + 4]] + byteToHex$1[arr[offset2 + 5]] + "-" + byteToHex$1[arr[offset2 + 6]] + byteToHex$1[arr[offset2 + 7]] + "-" + byteToHex$1[arr[offset2 + 8]] + byteToHex$1[arr[offset2 + 9]] + "-" + byteToHex$1[arr[offset2 + 10]] + byteToHex$1[arr[offset2 + 11]] + byteToHex$1[arr[offset2 + 12]] + byteToHex$1[arr[offset2 + 13]] + byteToHex$1[arr[offset2 + 14]] + byteToHex$1[arr[offset2 + 15]];
19101
19092
  }
19093
+ const randomUUID$1 = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
19094
+ const native$1 = {
19095
+ randomUUID: randomUUID$1
19096
+ };
19102
19097
  function v4$1(options, buf, offset2) {
19098
+ if (native$1.randomUUID && true && !options) {
19099
+ return native$1.randomUUID();
19100
+ }
19103
19101
  options = options || {};
19104
- var rnds = options.random || (options.rng || rng$1)();
19102
+ const rnds = options.random || (options.rng || rng$1)();
19105
19103
  rnds[6] = rnds[6] & 15 | 64;
19106
19104
  rnds[8] = rnds[8] & 63 | 128;
19107
- return stringify$1(rnds);
19105
+ return unsafeStringify$1(rnds);
19108
19106
  }
19109
19107
  function getDefaultExportFromCjs$3(x) {
19110
19108
  return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x["default"] : x;
@@ -22157,6 +22155,7 @@
22157
22155
  addTextNode(dom, marks) {
22158
22156
  let value = dom.nodeValue;
22159
22157
  let top2 = this.top, preserveWS = top2.options & OPT_PRESERVE_WS_FULL ? "full" : this.localPreserveWS || (top2.options & OPT_PRESERVE_WS) > 0;
22158
+ let { schema } = this.parser;
22160
22159
  if (preserveWS === "full" || top2.inlineContext(dom) || /[^ \t\r\n\u000c]/.test(value)) {
22161
22160
  if (!preserveWS) {
22162
22161
  value = value.replace(/[ \t\r\n\u000c]+/g, " ");
@@ -22166,13 +22165,22 @@
22166
22165
  if (!nodeBefore || domNodeBefore && domNodeBefore.nodeName == "BR" || nodeBefore.isText && /[ \t\r\n\u000c]$/.test(nodeBefore.text))
22167
22166
  value = value.slice(1);
22168
22167
  }
22169
- } else if (preserveWS !== "full") {
22170
- value = value.replace(/\r?\n|\r/g, " ");
22171
- } else {
22168
+ } else if (preserveWS === "full") {
22172
22169
  value = value.replace(/\r\n?/g, "\n");
22170
+ } else if (schema.linebreakReplacement && /[\r\n]/.test(value) && this.top.findWrapping(schema.linebreakReplacement.create())) {
22171
+ let lines = value.split(/\r?\n|\r/);
22172
+ for (let i2 = 0; i2 < lines.length; i2++) {
22173
+ if (i2)
22174
+ this.insertNode(schema.linebreakReplacement.create(), marks, true);
22175
+ if (lines[i2])
22176
+ this.insertNode(schema.text(lines[i2]), marks, !/\S/.test(lines[i2]));
22177
+ }
22178
+ value = "";
22179
+ } else {
22180
+ value = value.replace(/\r?\n|\r/g, " ");
22173
22181
  }
22174
22182
  if (value)
22175
- this.insertNode(this.parser.schema.text(value), marks, !/\S/.test(value));
22183
+ this.insertNode(schema.text(value), marks, !/\S/.test(value));
22176
22184
  this.findInText(dom);
22177
22185
  } else {
22178
22186
  this.findInside(dom);
@@ -26732,7 +26740,6 @@
26732
26740
  } else {
26733
26741
  if (to == null)
26734
26742
  to = from2;
26735
- to = to == null ? from2 : to;
26736
26743
  if (!text)
26737
26744
  return this.deleteRange(from2, to);
26738
26745
  let marks = this.storedMarks;
@@ -26741,7 +26748,7 @@
26741
26748
  marks = to == from2 ? $from.marks() : $from.marksAcross(this.doc.resolve(to));
26742
26749
  }
26743
26750
  this.replaceRangeWith(from2, to, schema.text(text, marks));
26744
- if (!this.selection.empty)
26751
+ if (!this.selection.empty && this.selection.to == from2 + text.length)
26745
26752
  this.setSelection(Selection.near(this.selection.$to));
26746
26753
  return this;
26747
26754
  }
@@ -26933,7 +26940,7 @@
26933
26940
  return newInstance;
26934
26941
  }
26935
26942
  /**
26936
- Start a [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
26943
+ Accessor that constructs and returns a new [transaction](https://prosemirror.net/docs/ref/#state.Transaction) from this state.
26937
26944
  */
26938
26945
  get tr() {
26939
26946
  return new Transaction(this);
@@ -35986,11 +35993,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
35986
35993
  } else {
35987
35994
  return hexColor;
35988
35995
  }
35989
- const clamp = (n) => Math.max(0, Math.min(255, Math.round(n)));
35996
+ const clamp2 = (n) => Math.max(0, Math.min(255, Math.round(n)));
35990
35997
  const toHex2 = (n) => n.toString(16).padStart(2, "0");
35991
- newR = clamp(newR);
35992
- newG = clamp(newG);
35993
- newB = clamp(newB);
35998
+ newR = clamp2(newR);
35999
+ newG = clamp2(newG);
36000
+ newB = clamp2(newB);
35994
36001
  const result = `#${toHex2(newR)}${toHex2(newG)}${toHex2(newB)}`;
35995
36002
  return result;
35996
36003
  }
@@ -43641,7 +43648,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
43641
43648
  });
43642
43649
  relationships.elements = [...relationships.elements, ...newRels];
43643
43650
  };
43644
- exportProcessMediaFiles_fn = async function(media = {}, editor) {
43651
+ exportProcessMediaFiles_fn = async function(media = {}) {
43645
43652
  const processedData = {
43646
43653
  ...this.convertedXml.media || {}
43647
43654
  };
@@ -51408,6 +51415,8 @@ Please report this to https://github.com/markedjs/marked.`, e) {
51408
51415
  let deflt = () => mkTr(view.state.tr.insertText(text, chFrom, chTo));
51409
51416
  if (!view.someProp("handleTextInput", (f2) => f2(view, chFrom, chTo, text, deflt)))
51410
51417
  view.dispatch(deflt());
51418
+ } else {
51419
+ view.dispatch(mkTr());
51411
51420
  }
51412
51421
  } else {
51413
51422
  view.dispatch(mkTr());
@@ -56605,6 +56614,49 @@ Please report this to https://github.com/markedjs/marked.`, e) {
56605
56614
  editor.view.dispatch(selectionTr);
56606
56615
  }
56607
56616
  };
56617
+ const clamp = (value, min2, max2) => Math.max(min2, Math.min(value, max2));
56618
+ const setTextSelection = ({ from: from2, to }) => ({ state: state2, dispatch, editor }) => {
56619
+ if (typeof from2 !== "number" && typeof to !== "number") {
56620
+ return false;
56621
+ }
56622
+ const doc2 = state2.doc;
56623
+ const docSize = doc2.content.size;
56624
+ const nextFrom = clamp(typeof from2 === "number" ? from2 : state2.selection.from, 0, docSize);
56625
+ const nextToBase = typeof to === "number" ? to : nextFrom;
56626
+ const nextTo = clamp(nextToBase, 0, docSize);
56627
+ const [head, anchor] = nextFrom <= nextTo ? [nextFrom, nextTo] : [nextTo, nextFrom];
56628
+ const selection = TextSelection$1.create(doc2, head, anchor);
56629
+ if (dispatch) {
56630
+ const transaction = state2.tr.setSelection(selection);
56631
+ dispatch(transaction);
56632
+ }
56633
+ if (editor?.view?.focus) {
56634
+ editor.view.focus();
56635
+ }
56636
+ return true;
56637
+ };
56638
+ const getSelectionMarks = () => ({ state: state2, tr }) => {
56639
+ tr.setMeta("preventDispatch", true);
56640
+ const marks = getMarksFromSelection(state2) ?? [];
56641
+ const uniqueByType = /* @__PURE__ */ new Map();
56642
+ for (const mark of marks) {
56643
+ const typeName = typeof mark?.type === "string" ? mark.type : mark?.type?.name;
56644
+ if (!typeName) continue;
56645
+ const existing = uniqueByType.get(typeName);
56646
+ if (!existing) {
56647
+ uniqueByType.set(typeName, mark);
56648
+ continue;
56649
+ }
56650
+ const existingAttrs = existing?.attrs ?? {};
56651
+ const nextAttrs = mark?.attrs ?? {};
56652
+ const existingHasValues = Object.values(existingAttrs).some((value) => value != null);
56653
+ const nextHasValues = Object.values(nextAttrs).some((value) => value != null);
56654
+ if (!existingHasValues && nextHasValues) {
56655
+ uniqueByType.set(typeName, mark);
56656
+ }
56657
+ }
56658
+ return Array.from(uniqueByType.values());
56659
+ };
56608
56660
  const commands$1 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
56609
56661
  __proto__: null,
56610
56662
  atVisualParaEnd,
@@ -56620,6 +56672,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
56620
56672
  first,
56621
56673
  getEffectiveStyleId,
56622
56674
  getParaCtx,
56675
+ getSelectionMarks,
56623
56676
  getStyleIdFromMarks,
56624
56677
  handleBackspaceNextToList,
56625
56678
  handleDeleteNextToList,
@@ -56651,6 +56704,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
56651
56704
  setMark,
56652
56705
  setMeta,
56653
56706
  setNode,
56707
+ setTextSelection,
56654
56708
  sinkListItem,
56655
56709
  splitBlock: splitBlock$1,
56656
56710
  splitListItem,
@@ -56928,11 +56982,11 @@ Please report this to https://github.com/markedjs/marked.`, e) {
56928
56982
  };
56929
56983
  var mac$1 = typeof navigator != "undefined" && /Mac/.test(navigator.platform);
56930
56984
  var ie = typeof navigator != "undefined" && /MSIE \d|Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(navigator.userAgent);
56931
- for (var i$1 = 0; i$1 < 10; i$1++) base$2[48 + i$1] = base$2[96 + i$1] = String(i$1);
56932
- for (var i$1 = 1; i$1 <= 24; i$1++) base$2[i$1 + 111] = "F" + i$1;
56933
- for (var i$1 = 65; i$1 <= 90; i$1++) {
56934
- base$2[i$1] = String.fromCharCode(i$1 + 32);
56935
- shift[i$1] = String.fromCharCode(i$1);
56985
+ for (var i = 0; i < 10; i++) base$2[48 + i] = base$2[96 + i] = String(i);
56986
+ for (var i = 1; i <= 24; i++) base$2[i + 111] = "F" + i;
56987
+ for (var i = 65; i <= 90; i++) {
56988
+ base$2[i] = String.fromCharCode(i + 32);
56989
+ shift[i] = String.fromCharCode(i);
56936
56990
  }
56937
56991
  for (var code in base$2) if (!shift.hasOwnProperty(code)) shift[code] = base$2[code];
56938
56992
  function keyName(event) {
@@ -57315,6 +57369,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
57315
57369
  id,
57316
57370
  author: user.name,
57317
57371
  authorEmail: user.email,
57372
+ authorImage: user.image,
57318
57373
  date
57319
57374
  });
57320
57375
  tr.addMark(from2, to, insertionMark);
@@ -57351,6 +57406,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
57351
57406
  id,
57352
57407
  author: user.name,
57353
57408
  authorEmail: user.email,
57409
+ authorImage: user.image,
57354
57410
  date
57355
57411
  });
57356
57412
  const deletionMap = new Mapping();
@@ -58047,6 +58103,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58047
58103
  if (!normalized.creatorEmail && user?.email) {
58048
58104
  normalized.creatorEmail = user.email;
58049
58105
  }
58106
+ if (!normalized.creatorImage && user?.image) {
58107
+ normalized.creatorImage = user.image;
58108
+ }
58050
58109
  if (!normalized.createdTime) {
58051
58110
  normalized.createdTime = Date.now();
58052
58111
  }
@@ -58505,7 +58564,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58505
58564
  const trackedMark = marks.insertedMark || marks.deletionMark || marks.formatMark;
58506
58565
  const { type: type2, attrs } = trackedMark;
58507
58566
  const { name: trackedChangeType } = type2;
58508
- const { author, authorEmail, date, importedAuthor } = attrs;
58567
+ const { author, authorEmail, authorImage, date, importedAuthor } = attrs;
58509
58568
  const id = attrs.id;
58510
58569
  const node = nodes[0];
58511
58570
  const isDeletionInsertion = !!(marks.insertedMark && marks.deletionMark);
@@ -58536,6 +58595,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58536
58595
  deletedText: marks.deletionMark ? deletionText : null,
58537
58596
  author,
58538
58597
  authorEmail,
58598
+ ...authorImage && { authorImage },
58539
58599
  date,
58540
58600
  ...importedAuthor && {
58541
58601
  importedAuthor: {
@@ -58680,6 +58740,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58680
58740
  id: wid,
58681
58741
  author: user.name,
58682
58742
  authorEmail: user.email,
58743
+ authorImage: user.image,
58683
58744
  date,
58684
58745
  before,
58685
58746
  after
@@ -58745,6 +58806,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
58745
58806
  id: v4$1(),
58746
58807
  author: user.name,
58747
58808
  authorEmail: user.email,
58809
+ authorImage: user.image,
58748
58810
  date,
58749
58811
  before,
58750
58812
  after
@@ -62744,6 +62806,9 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62744
62806
  return GapCursor.valid($pos) ? new GapCursor($pos) : Selection.near($pos);
62745
62807
  }
62746
62808
  }
62809
+ function needsGap(type2) {
62810
+ return type2.isAtom || type2.spec.isolating || type2.spec.createGapCursor;
62811
+ }
62747
62812
  function closedBefore($pos) {
62748
62813
  for (let d2 = $pos.depth; d2 >= 0; d2--) {
62749
62814
  let index2 = $pos.index(d2), parent = $pos.node(d2);
@@ -62753,7 +62818,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62753
62818
  continue;
62754
62819
  }
62755
62820
  for (let before = parent.child(index2 - 1); ; before = before.lastChild) {
62756
- if (before.childCount == 0 && !before.inlineContent || before.isAtom || before.type.spec.isolating)
62821
+ if (before.childCount == 0 && !before.inlineContent || needsGap(before.type))
62757
62822
  return true;
62758
62823
  if (before.inlineContent)
62759
62824
  return false;
@@ -62770,7 +62835,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
62770
62835
  continue;
62771
62836
  }
62772
62837
  for (let after = parent.child(index2); ; after = after.firstChild) {
62773
- if (after.childCount == 0 && !after.inlineContent || after.isAtom || after.type.spec.isolating)
62838
+ if (after.childCount == 0 && !after.inlineContent || needsGap(after.type))
62774
62839
  return true;
62775
62840
  if (after.inlineContent)
62776
62841
  return false;
@@ -77655,6 +77720,16 @@ ${l}
77655
77720
  };
77656
77721
  }
77657
77722
  },
77723
+ authorImage: {
77724
+ default: "",
77725
+ parseDOM: (elem) => elem.getAttribute("data-authorimage"),
77726
+ renderDOM: (attrs) => {
77727
+ if (!attrs.authorImage) return {};
77728
+ return {
77729
+ "data-authorimage": attrs.authorImage
77730
+ };
77731
+ }
77732
+ },
77658
77733
  date: {
77659
77734
  default: "",
77660
77735
  parseDOM: (elem) => elem.getAttribute("data-date"),
@@ -77722,6 +77797,16 @@ ${l}
77722
77797
  };
77723
77798
  }
77724
77799
  },
77800
+ authorImage: {
77801
+ default: "",
77802
+ parseDOM: (elem) => elem.getAttribute("data-authorimage"),
77803
+ renderDOM: (attrs) => {
77804
+ if (!attrs.authorImage) return {};
77805
+ return {
77806
+ "data-authorimage": attrs.authorImage
77807
+ };
77808
+ }
77809
+ },
77725
77810
  date: {
77726
77811
  default: "",
77727
77812
  parseDOM: (elem) => elem.getAttribute("data-date"),
@@ -77821,6 +77906,16 @@ ${l}
77821
77906
  };
77822
77907
  }
77823
77908
  },
77909
+ authorImage: {
77910
+ default: "",
77911
+ parseDOM: (elem) => elem.getAttribute("data-authorimage"),
77912
+ renderDOM: (attrs) => {
77913
+ if (!attrs.authorImage) return {};
77914
+ return {
77915
+ "data-authorimage": attrs.authorImage
77916
+ };
77917
+ }
77918
+ },
77824
77919
  date: {
77825
77920
  default: "",
77826
77921
  parseDOM: (elem) => elem.getAttribute("data-date"),
@@ -100078,39 +100173,37 @@ ${style2}
100078
100173
  }
100079
100174
  var eventemitter3Exports = requireEventemitter3();
100080
100175
  const EventEmitter = /* @__PURE__ */ getDefaultExportFromCjs(eventemitter3Exports);
100081
- var getRandomValues;
100082
- var rnds8 = new Uint8Array(16);
100176
+ let getRandomValues;
100177
+ const rnds8 = new Uint8Array(16);
100083
100178
  function rng() {
100084
100179
  if (!getRandomValues) {
100085
- getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto) || typeof msCrypto !== "undefined" && typeof msCrypto.getRandomValues === "function" && msCrypto.getRandomValues.bind(msCrypto);
100180
+ getRandomValues = typeof crypto !== "undefined" && crypto.getRandomValues && crypto.getRandomValues.bind(crypto);
100086
100181
  if (!getRandomValues) {
100087
100182
  throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");
100088
100183
  }
100089
100184
  }
100090
100185
  return getRandomValues(rnds8);
100091
100186
  }
100092
- const REGEX = /^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;
100093
- function validate(uuid) {
100094
- return typeof uuid === "string" && REGEX.test(uuid);
100095
- }
100096
- var byteToHex = [];
100097
- for (var i = 0; i < 256; ++i) {
100098
- byteToHex.push((i + 256).toString(16).substr(1));
100187
+ const byteToHex = [];
100188
+ for (let i2 = 0; i2 < 256; ++i2) {
100189
+ byteToHex.push((i2 + 256).toString(16).slice(1));
100099
100190
  }
100100
- function stringify(arr) {
100101
- var offset2 = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : 0;
100102
- var uuid = (byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]]).toLowerCase();
100103
- if (!validate(uuid)) {
100104
- throw TypeError("Stringified UUID is invalid");
100105
- }
100106
- return uuid;
100191
+ function unsafeStringify(arr, offset2 = 0) {
100192
+ return byteToHex[arr[offset2 + 0]] + byteToHex[arr[offset2 + 1]] + byteToHex[arr[offset2 + 2]] + byteToHex[arr[offset2 + 3]] + "-" + byteToHex[arr[offset2 + 4]] + byteToHex[arr[offset2 + 5]] + "-" + byteToHex[arr[offset2 + 6]] + byteToHex[arr[offset2 + 7]] + "-" + byteToHex[arr[offset2 + 8]] + byteToHex[arr[offset2 + 9]] + "-" + byteToHex[arr[offset2 + 10]] + byteToHex[arr[offset2 + 11]] + byteToHex[arr[offset2 + 12]] + byteToHex[arr[offset2 + 13]] + byteToHex[arr[offset2 + 14]] + byteToHex[arr[offset2 + 15]];
100107
100193
  }
100194
+ const randomUUID = typeof crypto !== "undefined" && crypto.randomUUID && crypto.randomUUID.bind(crypto);
100195
+ const native = {
100196
+ randomUUID
100197
+ };
100108
100198
  function v4(options, buf, offset2) {
100199
+ if (native.randomUUID && true && !options) {
100200
+ return native.randomUUID();
100201
+ }
100109
100202
  options = options || {};
100110
- var rnds = options.random || (options.rng || rng)();
100203
+ const rnds = options.random || (options.rng || rng)();
100111
100204
  rnds[6] = rnds[6] & 15 | 64;
100112
100205
  rnds[8] = rnds[8] & 63 | 128;
100113
- return stringify(rnds);
100206
+ return unsafeStringify(rnds);
100114
100207
  }
100115
100208
  let activePinia;
100116
100209
  const setActivePinia = (pinia) => activePinia = pinia;
@@ -102074,6 +102167,7 @@ ${reason}`);
102074
102167
  const isFocused = ref$1(params2.isFocused || false);
102075
102168
  const creatorEmail = params2.creatorEmail;
102076
102169
  const creatorName = params2.creatorName;
102170
+ const creatorImage = params2.creatorImage;
102077
102171
  const createdTime = params2.createdTime || Date.now();
102078
102172
  const importedAuthor = ref$1(params2.importedAuthor || null);
102079
102173
  const commentText = ref$1(params2.commentText || "");
@@ -102166,7 +102260,7 @@ ${reason}`);
102166
102260
  selection.selectionBounds = newCoords;
102167
102261
  };
102168
102262
  const getCommentUser = () => {
102169
- const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail };
102263
+ const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail, image: creatorImage };
102170
102264
  return user;
102171
102265
  };
102172
102266
  const propagateUpdate = (superdoc2, event) => {
@@ -102187,6 +102281,7 @@ ${reason}`);
102187
102281
  createdAtVersionNumber,
102188
102282
  creatorEmail,
102189
102283
  creatorName,
102284
+ creatorImage,
102190
102285
  createdTime,
102191
102286
  importedAuthor: importedAuthor.value,
102192
102287
  isInternal: isInternal.value,
@@ -102213,6 +102308,7 @@ ${reason}`);
102213
102308
  isFocused,
102214
102309
  creatorEmail,
102215
102310
  creatorName,
102311
+ creatorImage,
102216
102312
  createdTime,
102217
102313
  isInternal,
102218
102314
  commentText,
@@ -102609,6 +102705,7 @@ ${reason}`);
102609
102705
  trackedChangeType,
102610
102706
  deletedText,
102611
102707
  authorEmail,
102708
+ authorImage,
102612
102709
  date,
102613
102710
  author: authorName,
102614
102711
  importedAuthor,
@@ -102625,6 +102722,7 @@ ${reason}`);
102625
102722
  createdTime: date,
102626
102723
  creatorName: authorName,
102627
102724
  creatorEmail: authorEmail,
102725
+ creatorImage: authorImage,
102628
102726
  isInternal: false,
102629
102727
  importedAuthor,
102630
102728
  selection: {
@@ -102734,6 +102832,7 @@ ${reason}`);
102734
102832
  parentCommentId,
102735
102833
  creatorEmail: superdocStore.user.email,
102736
102834
  creatorName: superdocStore.user.name,
102835
+ creatorImage: superdocStore.user.image,
102737
102836
  commentText: currentCommentText.value,
102738
102837
  selection,
102739
102838
  ...options