@harbour-enterprises/superdoc 1.0.0-next.4 → 1.0.0-next.6

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 (57) hide show
  1. package/dist/chunks/{PdfViewer-DtdN17V4.es.js → PdfViewer-BYeEi4Kx.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-CtSTAdvv.cjs → PdfViewer-CF4W_li8.cjs} +1 -1
  3. package/dist/chunks/{index-Bj1kFbYe.cjs → index-BcHbK1Ip.cjs} +99 -97
  4. package/dist/chunks/{index-D_KE9gpD-radGpP4I.cjs → index-CKb2zoi7-BEMsbmpK.cjs} +1 -1
  5. package/dist/chunks/{index-D_KE9gpD-aIqhxcuF.es.js → index-CKb2zoi7-aboErZCf.es.js} +1 -1
  6. package/dist/chunks/{index-Cxv7dMYN.es.js → index-CocFivpQ.es.js} +99 -97
  7. package/dist/chunks/{super-editor.es-B2fSLkzN.es.js → super-editor.es-C7JZxENm.es.js} +4 -4
  8. package/dist/chunks/{super-editor.es-BhQu31e4.cjs → super-editor.es-TXxmZOAu.cjs} +4 -4
  9. package/dist/packages/superdoc/src/core/collaboration/collaboration-comments.d.ts +3 -3
  10. package/dist/packages/superdoc/src/core/collaboration/collaboration-comments.d.ts.map +1 -1
  11. package/dist/packages/superdoc/src/core/collaboration/helpers.d.ts.map +1 -1
  12. package/dist/style.css +6 -6
  13. package/dist/super-editor/ai-writer.es.js +2 -2
  14. package/dist/super-editor/chunks/{converter-CVqUjX24.js → converter-CyZvCMe8.js} +1 -1
  15. package/dist/super-editor/chunks/{docx-zipper-CsWjoVKD.js → docx-zipper-DPV5rnMJ.js} +1 -1
  16. package/dist/super-editor/chunks/{editor-Cc8nus2C.js → editor-uiCiCr8n.js} +5 -5
  17. package/dist/super-editor/chunks/{index-D_KE9gpD.js → index-CKb2zoi7.js} +1 -1
  18. package/dist/super-editor/chunks/{toolbar-CoOpR1xE.js → toolbar-Icc3CdW0.js} +2 -2
  19. package/dist/super-editor/converter.es.js +1 -1
  20. package/dist/super-editor/docx-zipper.es.js +2 -2
  21. package/dist/super-editor/editor.es.js +3 -3
  22. package/dist/super-editor/file-zipper.es.js +1 -1
  23. package/dist/super-editor/super-editor.es.js +6 -6
  24. package/dist/super-editor/toolbar.es.js +2 -2
  25. package/dist/super-editor.cjs +1 -1
  26. package/dist/super-editor.es.js +1 -1
  27. package/dist/superdoc.cjs +2 -2
  28. package/dist/superdoc.es.js +2 -2
  29. package/dist/superdoc.umd.js +103 -101
  30. package/dist/superdoc.umd.js.map +1 -1
  31. package/package.json +1 -1
  32. package/dist/images/altText_add.svg +0 -3
  33. package/dist/images/altText_disclaimer.svg +0 -3
  34. package/dist/images/altText_done.svg +0 -3
  35. package/dist/images/altText_spinner.svg +0 -30
  36. package/dist/images/altText_warning.svg +0 -3
  37. package/dist/images/annotation-check.svg +0 -11
  38. package/dist/images/annotation-comment.svg +0 -16
  39. package/dist/images/annotation-help.svg +0 -26
  40. package/dist/images/annotation-insert.svg +0 -10
  41. package/dist/images/annotation-key.svg +0 -11
  42. package/dist/images/annotation-newparagraph.svg +0 -11
  43. package/dist/images/annotation-noicon.svg +0 -7
  44. package/dist/images/annotation-note.svg +0 -42
  45. package/dist/images/annotation-paperclip.svg +0 -6
  46. package/dist/images/annotation-paragraph.svg +0 -16
  47. package/dist/images/annotation-pushpin.svg +0 -7
  48. package/dist/images/cursor-editorFreeHighlight.svg +0 -6
  49. package/dist/images/cursor-editorFreeText.svg +0 -3
  50. package/dist/images/cursor-editorInk.svg +0 -4
  51. package/dist/images/cursor-editorTextHighlight.svg +0 -8
  52. package/dist/images/editor-toolbar-delete.svg +0 -5
  53. package/dist/images/loading-icon.gif +0 -0
  54. package/dist/images/messageBar_closingButton.svg +0 -3
  55. package/dist/images/messageBar_warning.svg +0 -3
  56. package/dist/images/toolbarButton-editorHighlight.svg +0 -6
  57. package/dist/images/toolbarButton-menuArrow.svg +0 -3
@@ -42428,7 +42428,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
42428
42428
  static getStoredSuperdocVersion(docx) {
42429
42429
  return _SuperConverter2.getStoredCustomProperty(docx, "SuperdocVersion");
42430
42430
  }
42431
- static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-next.4") {
42431
+ static setStoredSuperdocVersion(docx = this.convertedXml, version2 = "1.0.0-next.6") {
42432
42432
  return _SuperConverter2.setStoredCustomProperty(docx, "SuperdocVersion", version2, false);
42433
42433
  }
42434
42434
  /**
@@ -67513,7 +67513,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
67513
67513
  const shouldSkipNodeView = (editor) => {
67514
67514
  return isHeadless(editor);
67515
67515
  };
67516
- const summaryVersion = "1.0.0-next.4";
67516
+ const summaryVersion = "1.0.0-next.6";
67517
67517
  const nodeKeys = ["group", "content", "marks", "inline", "atom", "defining", "code", "tableRole", "summary"];
67518
67518
  const markKeys = ["group", "inclusive", "excludes", "spanning", "code"];
67519
67519
  function mapAttributes(attrs) {
@@ -68302,7 +68302,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68302
68302
  { default: remarkStringify2 },
68303
68303
  { default: remarkGfm2 }
68304
68304
  ] = await Promise.all([
68305
- Promise.resolve().then(() => indexD_KE9gpD),
68305
+ Promise.resolve().then(() => indexCKb2zoi7),
68306
68306
  Promise.resolve().then(() => indexDRCvimau),
68307
68307
  Promise.resolve().then(() => indexC_x_N6Uh),
68308
68308
  Promise.resolve().then(() => indexD_sWOSiG),
@@ -68507,7 +68507,7 @@ Please report this to https://github.com/markedjs/marked.`, e) {
68507
68507
  * Process collaboration migrations
68508
68508
  */
68509
68509
  processCollaborationMigrations() {
68510
- console.debug("[checkVersionMigrations] Current editor version", "1.0.0-next.4");
68510
+ console.debug("[checkVersionMigrations] Current editor version", "1.0.0-next.6");
68511
68511
  if (!this.options.ydoc) return;
68512
68512
  const metaMap = this.options.ydoc.getMap("meta");
68513
68513
  let docVersion = metaMap.get("version");
@@ -138518,17 +138518,17 @@ ${reason}`);
138518
138518
  });
138519
138519
  });
138520
138520
  }
138521
- const addYComment = (yArray, ydoc, event) => {
138521
+ const addYComment = (yArray, ydoc, event, user) => {
138522
138522
  const { comment: comment2 } = event;
138523
138523
  const yComment = new Y.Map(Object.entries(comment2));
138524
138524
  ydoc.transact(
138525
138525
  () => {
138526
138526
  yArray.push([yComment]);
138527
138527
  },
138528
- { user: superdoc.user }
138528
+ { user }
138529
138529
  );
138530
138530
  };
138531
- const updateYComment = (yArray, ydoc, event) => {
138531
+ const updateYComment = (yArray, ydoc, event, user) => {
138532
138532
  const { comment: comment2 } = event;
138533
138533
  const yComment = new Y.Map(Object.entries(comment2));
138534
138534
  const commentIndex = getCommentIndex(yArray, comment2);
@@ -138538,10 +138538,10 @@ ${reason}`);
138538
138538
  yArray.delete(commentIndex, 1);
138539
138539
  yArray.insert(commentIndex, [yComment]);
138540
138540
  },
138541
- { user: superdoc.user }
138541
+ { user }
138542
138542
  );
138543
138543
  };
138544
- const deleteYComment = (yArray, ydoc, event) => {
138544
+ const deleteYComment = (yArray, ydoc, event, user) => {
138545
138545
  const { comment: comment2 } = event;
138546
138546
  const commentIndex = getCommentIndex(yArray, comment2);
138547
138547
  if (commentIndex === -1) return;
@@ -138549,26 +138549,26 @@ ${reason}`);
138549
138549
  () => {
138550
138550
  yArray.delete(commentIndex, 1);
138551
138551
  },
138552
- { user: superdoc.user }
138552
+ { user }
138553
138553
  );
138554
138554
  };
138555
138555
  const getCommentIndex = (yArray, comment2) => {
138556
138556
  const baseArray = yArray.toJSON();
138557
138557
  return baseArray.findIndex((c2) => c2.commentId === comment2.commentId);
138558
138558
  };
138559
- const initCollaborationComments = (superdoc2) => {
138560
- if (!superdoc2.config.modules.comments || !superdoc2.provider) return;
138559
+ const initCollaborationComments = (superdoc) => {
138560
+ if (!superdoc.config.modules.comments || !superdoc.provider) return;
138561
138561
  const onSuperDocYdocSynced = () => {
138562
- const parent = superdoc2.commentsStore.commentsParentElement;
138563
- const ids = superdoc2.commentsStore.editorCommentIds;
138564
- superdoc2.commentsStore.handleEditorLocationsUpdate(parent, ids);
138565
- superdoc2.commentsStore.hasSyncedCollaborationComments = true;
138566
- superdoc2.provider.off("synced", onSuperDocYdocSynced);
138567
- };
138568
- superdoc2.provider.on("synced", onSuperDocYdocSynced);
138569
- const commentsArray = superdoc2.ydoc.getArray("comments");
138562
+ const parent = superdoc.commentsStore.commentsParentElement;
138563
+ const ids = superdoc.commentsStore.editorCommentIds;
138564
+ superdoc.commentsStore.handleEditorLocationsUpdate(parent, ids);
138565
+ superdoc.commentsStore.hasSyncedCollaborationComments = true;
138566
+ superdoc.provider.off("synced", onSuperDocYdocSynced);
138567
+ };
138568
+ superdoc.provider.on("synced", onSuperDocYdocSynced);
138569
+ const commentsArray = superdoc.ydoc.getArray("comments");
138570
138570
  commentsArray.observe((event) => {
138571
- const currentUser = superdoc2.config.user;
138571
+ const currentUser = superdoc.config.user;
138572
138572
  const { user = {} } = event.transaction.origin;
138573
138573
  if (currentUser.name === user.name && currentUser.email === user.email) return;
138574
138574
  const comments = commentsArray.toJSON();
@@ -138580,59 +138580,60 @@ ${reason}`);
138580
138580
  filtered.push(c2);
138581
138581
  }
138582
138582
  });
138583
- superdoc2.commentsStore.commentsList = filtered.map((c2) => useComment(c2));
138583
+ superdoc.commentsStore.commentsList = filtered.map((c2) => useComment(c2));
138584
138584
  });
138585
138585
  };
138586
- const initSuperdocYdoc = (superdoc2) => {
138587
- const { isInternal } = superdoc2.config;
138588
- const baseName = `${superdoc2.config.superdocId}-superdoc`;
138589
- if (!superdoc2.config.superdocId) return;
138586
+ const initSuperdocYdoc = (superdoc) => {
138587
+ const { isInternal } = superdoc.config;
138588
+ const baseName = `${superdoc.config.superdocId}-superdoc`;
138589
+ if (!superdoc.config.superdocId) return;
138590
138590
  const documentId = isInternal ? baseName : `${baseName}-external`;
138591
138591
  const superdocCollaborationOptions = {
138592
- config: superdoc2.config.modules.collaboration,
138593
- user: superdoc2.config.user,
138592
+ config: superdoc.config.modules.collaboration,
138593
+ user: superdoc.config.user,
138594
138594
  documentId,
138595
- socket: superdoc2.config.socket,
138596
- superdocInstance: superdoc2
138595
+ socket: superdoc.config.socket,
138596
+ superdocInstance: superdoc
138597
138597
  };
138598
138598
  const { provider: superdocProvider, ydoc: superdocYdoc } = createProvider(superdocCollaborationOptions);
138599
138599
  return { ydoc: superdocYdoc, provider: superdocProvider };
138600
138600
  };
138601
- const makeDocumentsCollaborative = (superdoc2) => {
138601
+ const makeDocumentsCollaborative = (superdoc) => {
138602
138602
  const processedDocuments = [];
138603
- superdoc2.config.documents.forEach((doc2) => {
138604
- superdoc2.config.user.color = superdoc2.colors[0];
138603
+ superdoc.config.documents.forEach((doc2) => {
138604
+ superdoc.config.user.color = superdoc.colors[0];
138605
138605
  const options = {
138606
- config: superdoc2.config.modules.collaboration,
138607
- user: superdoc2.config.user,
138606
+ config: superdoc.config.modules.collaboration,
138607
+ user: superdoc.config.user,
138608
138608
  documentId: doc2.id,
138609
- socket: superdoc2.config.socket,
138610
- superdocInstance: superdoc2
138609
+ socket: superdoc.config.socket,
138610
+ superdocInstance: superdoc
138611
138611
  };
138612
138612
  const { provider: provider2, ydoc } = createProvider(options);
138613
138613
  doc2.provider = provider2;
138614
- doc2.socket = superdoc2.config.socket;
138614
+ doc2.socket = superdoc.config.socket;
138615
138615
  doc2.ydoc = ydoc;
138616
- doc2.role = superdoc2.config.role;
138616
+ doc2.role = superdoc.config.role;
138617
138617
  processedDocuments.push(doc2);
138618
138618
  });
138619
138619
  return processedDocuments;
138620
138620
  };
138621
- const syncCommentsToClients = (superdoc2, event) => {
138622
- if (!superdoc2.isCollaborative || !superdoc2.config.modules.comments) return;
138623
- const yArray = superdoc2.ydoc.getArray("comments");
138621
+ const syncCommentsToClients = (superdoc, event) => {
138622
+ if (!superdoc.isCollaborative || !superdoc.config.modules.comments) return;
138623
+ const yArray = superdoc.ydoc.getArray("comments");
138624
+ const user = superdoc.config.user;
138624
138625
  switch (event.type) {
138625
138626
  case "add":
138626
- addYComment(yArray, superdoc2.ydoc, event);
138627
+ addYComment(yArray, superdoc.ydoc, event, user);
138627
138628
  break;
138628
138629
  case "update":
138629
- updateYComment(yArray, superdoc2.ydoc, event);
138630
+ updateYComment(yArray, superdoc.ydoc, event, user);
138630
138631
  break;
138631
138632
  case "resolved":
138632
- updateYComment(yArray, superdoc2.ydoc, event);
138633
+ updateYComment(yArray, superdoc.ydoc, event, user);
138633
138634
  break;
138634
138635
  case "deleted":
138635
- deleteYComment(yArray, superdoc2.ydoc, event);
138636
+ deleteYComment(yArray, superdoc.ydoc, event, user);
138636
138637
  break;
138637
138638
  }
138638
138639
  };
@@ -138707,22 +138708,22 @@ ${reason}`);
138707
138708
  const resolvedTime = ref(params2.resolvedTime || null);
138708
138709
  const resolvedByEmail = ref(params2.resolvedByEmail || null);
138709
138710
  const resolvedByName = ref(params2.resolvedByName || null);
138710
- const resolveComment = ({ email, name, superdoc: superdoc2 }) => {
138711
+ const resolveComment = ({ email, name, superdoc }) => {
138711
138712
  if (resolvedTime.value) return;
138712
138713
  resolvedTime.value = Date.now();
138713
138714
  resolvedByEmail.value = email;
138714
138715
  resolvedByName.value = name;
138715
138716
  if (trackedChange.value) {
138716
138717
  const emitData2 = { type: comments_module_events.RESOLVED, comment: getValues() };
138717
- propagateUpdate(superdoc2, emitData2);
138718
- superdoc2.activeEditor?.commands?.resolveComment({ commentId, importedId });
138718
+ propagateUpdate(superdoc, emitData2);
138719
+ superdoc.activeEditor?.commands?.resolveComment({ commentId, importedId });
138719
138720
  return;
138720
138721
  }
138721
138722
  const emitData = { type: comments_module_events.RESOLVED, comment: getValues() };
138722
- propagateUpdate(superdoc2, emitData);
138723
- superdoc2.activeEditor?.commands?.resolveComment({ commentId, importedId });
138723
+ propagateUpdate(superdoc, emitData);
138724
+ superdoc.activeEditor?.commands?.resolveComment({ commentId, importedId });
138724
138725
  };
138725
- const setIsInternal = ({ isInternal: newIsInternal, superdoc: superdoc2 }) => {
138726
+ const setIsInternal = ({ isInternal: newIsInternal, superdoc }) => {
138726
138727
  const previousValue = isInternal.value;
138727
138728
  if (previousValue === newIsInternal) return;
138728
138729
  isInternal.value = newIsInternal;
@@ -138731,16 +138732,16 @@ ${reason}`);
138731
138732
  changes: [{ key: "isInternal", value: newIsInternal, previousValue }],
138732
138733
  comment: getValues()
138733
138734
  };
138734
- propagateUpdate(superdoc2, emitData);
138735
- const activeEditor = superdoc2.activeEditor;
138735
+ propagateUpdate(superdoc, emitData);
138736
+ const activeEditor = superdoc.activeEditor;
138736
138737
  if (!activeEditor) return;
138737
138738
  activeEditor.commands.setCommentInternal({ commentId, importedId, isInternal: newIsInternal });
138738
138739
  };
138739
- const setActive = (superdoc2) => {
138740
- const { activeEditor } = superdoc2;
138740
+ const setActive = (superdoc) => {
138741
+ const { activeEditor } = superdoc;
138741
138742
  activeEditor?.commands.setActiveComment({ commentId, importedId });
138742
138743
  };
138743
- const setText = ({ text: text2, superdoc: superdoc2, suppressUpdate }) => {
138744
+ const setText = ({ text: text2, superdoc, suppressUpdate }) => {
138744
138745
  commentText.value = text2;
138745
138746
  mentions.value = extractMentions(text2);
138746
138747
  if (suppressUpdate) return;
@@ -138749,7 +138750,7 @@ ${reason}`);
138749
138750
  changes: [{ key: "text", value: text2 }],
138750
138751
  comment: getValues()
138751
138752
  };
138752
- propagateUpdate(superdoc2, emitData);
138753
+ propagateUpdate(superdoc, emitData);
138753
138754
  };
138754
138755
  const extractMentions = (htmlString) => {
138755
138756
  const parser = new DOMParser();
@@ -138786,9 +138787,9 @@ ${reason}`);
138786
138787
  const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail, image: creatorImage };
138787
138788
  return user;
138788
138789
  };
138789
- const propagateUpdate = (superdoc2, event) => {
138790
- superdoc2.emit("comments-update", event);
138791
- syncCommentsToClients(superdoc2, event);
138790
+ const propagateUpdate = (superdoc, event) => {
138791
+ superdoc.emit("comments-update", event);
138792
+ syncCommentsToClients(superdoc, event);
138792
138793
  };
138793
138794
  const getValues = () => {
138794
138795
  return {
@@ -139213,21 +139214,21 @@ ${reason}`);
139213
139214
  if (id === void 0 || id === null) return null;
139214
139215
  return commentsList.value.find((c2) => c2.commentId == id || c2.importedId == id);
139215
139216
  };
139216
- const setActiveComment = (superdoc2, id) => {
139217
+ const setActiveComment = (superdoc, id) => {
139217
139218
  if (id === void 0 || id === null) {
139218
139219
  activeComment.value = null;
139219
- if (superdoc2.activeEditor) {
139220
- superdoc2.activeEditor.commands?.setActiveComment({ commentId: null });
139220
+ if (superdoc.activeEditor) {
139221
+ superdoc.activeEditor.commands?.setActiveComment({ commentId: null });
139221
139222
  }
139222
139223
  return;
139223
139224
  }
139224
139225
  const comment2 = getComment(id);
139225
139226
  if (comment2) activeComment.value = comment2.commentId;
139226
- if (superdoc2.activeEditor) {
139227
- superdoc2.activeEditor.commands?.setActiveComment({ commentId: activeComment.value });
139227
+ if (superdoc.activeEditor) {
139228
+ superdoc.activeEditor.commands?.setActiveComment({ commentId: activeComment.value });
139228
139229
  }
139229
139230
  };
139230
- const handleTrackedChangeUpdate = ({ superdoc: superdoc2, params: params2 }) => {
139231
+ const handleTrackedChangeUpdate = ({ superdoc, params: params2 }) => {
139231
139232
  const {
139232
139233
  event,
139233
139234
  changeId,
@@ -139260,7 +139261,7 @@ ${reason}`);
139260
139261
  }
139261
139262
  });
139262
139263
  if (event === "add") {
139263
- addComment({ superdoc: superdoc2, comment: comment2 });
139264
+ addComment({ superdoc, comment: comment2 });
139264
139265
  } else if (event === "update") {
139265
139266
  const existingTrackedChange = commentsList.value.find((comment22) => comment22.commentId === changeId);
139266
139267
  if (!existingTrackedChange) return;
@@ -139272,33 +139273,33 @@ ${reason}`);
139272
139273
  type: COMMENT_EVENTS.UPDATE,
139273
139274
  comment: existingTrackedChange.getValues()
139274
139275
  };
139275
- syncCommentsToClients(superdoc2, emitData);
139276
- debounceEmit(changeId, emitData, superdoc2);
139276
+ syncCommentsToClients(superdoc, emitData);
139277
+ debounceEmit(changeId, emitData, superdoc);
139277
139278
  }
139278
139279
  };
139279
- const debounceEmit = (commentId, event, superdoc2, delay = 1e3) => {
139280
+ const debounceEmit = (commentId, event, superdoc, delay = 1e3) => {
139280
139281
  if (debounceTimers[commentId]) {
139281
139282
  clearTimeout(debounceTimers[commentId]);
139282
139283
  }
139283
139284
  debounceTimers[commentId] = setTimeout(() => {
139284
- if (superdoc2) {
139285
- superdoc2.emit("comments-update", event);
139285
+ if (superdoc) {
139286
+ superdoc.emit("comments-update", event);
139286
139287
  }
139287
139288
  delete debounceTimers[commentId];
139288
139289
  }, delay);
139289
139290
  };
139290
- const showAddComment = (superdoc2) => {
139291
+ const showAddComment = (superdoc) => {
139291
139292
  const event = { type: COMMENT_EVENTS.PENDING };
139292
- superdoc2.emit("comments-update", event);
139293
+ superdoc.emit("comments-update", event);
139293
139294
  const selection = { ...superdocStore.activeSelection };
139294
139295
  selection.selectionBounds = { ...selection.selectionBounds };
139295
139296
  if (superdocStore.selectionPosition?.source) {
139296
139297
  superdocStore.selectionPosition.source = null;
139297
139298
  }
139298
139299
  pendingComment.value = getPendingComment({ selection, documentId: selection.documentId, parentCommentId: null });
139299
- if (!superdoc2.config.isInternal) pendingComment.value.isInternal = false;
139300
- if (superdoc2.activeEditor?.commands) {
139301
- superdoc2.activeEditor.commands.insertComment({
139300
+ if (!superdoc.config.isInternal) pendingComment.value.isInternal = false;
139301
+ if (superdoc.activeEditor?.commands) {
139302
+ superdoc.activeEditor.commands.insertComment({
139302
139303
  ...pendingComment.value.getValues(),
139303
139304
  commentId: "pending",
139304
139305
  skipEmit: true
@@ -139368,14 +139369,14 @@ ${reason}`);
139368
139369
  ...options
139369
139370
  });
139370
139371
  };
139371
- const removePendingComment = (superdoc2) => {
139372
+ const removePendingComment = (superdoc) => {
139372
139373
  currentCommentText.value = "";
139373
139374
  pendingComment.value = null;
139374
139375
  activeComment.value = null;
139375
139376
  superdocStore.selectionPosition = null;
139376
- superdoc2.activeEditor?.commands.removeComment({ commentId: "pending" });
139377
+ superdoc.activeEditor?.commands.removeComment({ commentId: "pending" });
139377
139378
  };
139378
- const addComment = ({ superdoc: superdoc2, comment: comment2, skipEditorUpdate = false }) => {
139379
+ const addComment = ({ superdoc, comment: comment2, skipEditorUpdate = false }) => {
139379
139380
  let parentComment = commentsList.value.find((c2) => c2.commentId === activeComment.value);
139380
139381
  if (!parentComment) parentComment = comment2;
139381
139382
  const newComment = useComment(comment2.getValues());
@@ -139386,22 +139387,22 @@ ${reason}`);
139386
139387
  const isParentInternal = parentComment.isInternal;
139387
139388
  newComment.isInternal = isParentInternal;
139388
139389
  }
139389
- if (!superdoc2.config.isInternal) newComment.isInternal = false;
139390
+ if (!superdoc.config.isInternal) newComment.isInternal = false;
139390
139391
  commentsList.value.push(newComment);
139391
- removePendingComment(superdoc2);
139392
- if (!skipEditorUpdate && !comment2.trackedChange && superdoc2.activeEditor?.commands && !comment2.parentCommentId) {
139393
- superdoc2.activeEditor.commands.insertComment({ ...newComment.getValues(), skipEmit: true });
139392
+ removePendingComment(superdoc);
139393
+ if (!skipEditorUpdate && !comment2.trackedChange && superdoc.activeEditor?.commands && !comment2.parentCommentId) {
139394
+ superdoc.activeEditor.commands.insertComment({ ...newComment.getValues(), skipEmit: true });
139394
139395
  }
139395
139396
  const event = { type: COMMENT_EVENTS.ADD, comment: newComment.getValues() };
139396
- syncCommentsToClients(superdoc2, event);
139397
- superdoc2.emit("comments-update", event);
139397
+ syncCommentsToClients(superdoc, event);
139398
+ superdoc.emit("comments-update", event);
139398
139399
  };
139399
- const deleteComment = ({ commentId: commentIdToDelete, superdoc: superdoc2 }) => {
139400
+ const deleteComment = ({ commentId: commentIdToDelete, superdoc }) => {
139400
139401
  const commentIndex = commentsList.value.findIndex((c2) => c2.commentId === commentIdToDelete);
139401
139402
  const comment2 = commentsList.value[commentIndex];
139402
139403
  const { commentId, importedId } = comment2;
139403
139404
  const { fileId } = comment2;
139404
- superdoc2.activeEditor?.commands?.removeComment({ commentId, importedId });
139405
+ superdoc.activeEditor?.commands?.removeComment({ commentId, importedId });
139405
139406
  commentsList.value.splice(commentIndex, 1);
139406
139407
  const childCommentIds = commentsList.value.filter((c2) => c2.parentCommentId === commentId).map((c2) => c2.commentId || c2.importedId);
139407
139408
  commentsList.value = commentsList.value.filter((c2) => !childCommentIds.includes(c2.commentId));
@@ -139410,13 +139411,13 @@ ${reason}`);
139410
139411
  comment: comment2.getValues(),
139411
139412
  changes: [{ key: "deleted", commentId, fileId }]
139412
139413
  };
139413
- superdoc2.emit("comments-update", event);
139414
- syncCommentsToClients(superdoc2, event);
139414
+ superdoc.emit("comments-update", event);
139415
+ syncCommentsToClients(superdoc, event);
139415
139416
  };
139416
- const cancelComment = (superdoc2) => {
139417
- removePendingComment(superdoc2);
139417
+ const cancelComment = (superdoc) => {
139418
+ removePendingComment(superdoc);
139418
139419
  };
139419
- const processLoadedDocxComments = async ({ superdoc: superdoc2, editor, comments, documentId }) => {
139420
+ const processLoadedDocxComments = async ({ superdoc, editor, comments, documentId }) => {
139420
139421
  const document2 = superdocStore.getDocument(documentId);
139421
139422
  comments.forEach((comment2) => {
139422
139423
  const htmlContent = getHtmlFromComment(comment2.textJson);
@@ -139448,7 +139449,7 @@ ${reason}`);
139448
139449
  trackedChangeType: comment2.trackedChangeType,
139449
139450
  deletedText: comment2.trackedDeletedText
139450
139451
  });
139451
- addComment({ superdoc: superdoc2, comment: newComment });
139452
+ addComment({ superdoc, comment: newComment });
139452
139453
  });
139453
139454
  setTimeout(() => {
139454
139455
  createCommentForTrackChanges(editor);
@@ -151896,12 +151897,12 @@ ${style2}
151896
151897
  element: null,
151897
151898
  commentsStore: null
151898
151899
  };
151899
- constructor(options, superdoc2) {
151900
+ constructor(options, superdoc) {
151900
151901
  super();
151901
151902
  this.config = { ...this.config, ...options };
151902
151903
  this.element = this.config.element;
151903
151904
  this.app = null;
151904
- this.superdoc = superdoc2;
151905
+ this.superdoc = superdoc;
151905
151906
  this.open();
151906
151907
  }
151907
151908
  createVueApp() {
@@ -152130,7 +152131,8 @@ ${style2}
152130
152131
  measurementTimeoutId.value = null;
152131
152132
  }
152132
152133
  const totalComments = getFloatingComments.value.length;
152133
- if (totalComments === 0) {
152134
+ const measuredComments = renderedSizes.value.length;
152135
+ if (totalComments === 0 || measuredComments === 0) {
152134
152136
  return;
152135
152137
  }
152136
152138
  nextTick(processLocations);
@@ -152211,7 +152213,7 @@ ${style2}
152211
152213
  };
152212
152214
  }
152213
152215
  };
152214
- const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-6905dd07"]]);
152216
+ const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$a, [["__scopeId", "data-v-1402ce8c"]]);
152215
152217
  const _sfc_main$9 = {
152216
152218
  __name: "TextField",
152217
152219
  props: {
@@ -153743,7 +153745,7 @@ ${style2}
153743
153745
  this.config.colors = shuffleArray(this.config.colors);
153744
153746
  this.userColorMap = /* @__PURE__ */ new Map();
153745
153747
  this.colorIndex = 0;
153746
- this.version = "1.0.0-next.4";
153748
+ this.version = "1.0.0-next.6";
153747
153749
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
153748
153750
  this.superdocId = config2.superdocId || v4();
153749
153751
  this.colors = this.config.colors;
@@ -156216,7 +156218,7 @@ ${style2}
156216
156218
  value && typeof value === "object" && "byteLength" in value && "byteOffset" in value
156217
156219
  );
156218
156220
  }
156219
- const indexD_KE9gpD = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
156221
+ const indexCKb2zoi7 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
156220
156222
  __proto__: null,
156221
156223
  unified
156222
156224
  }, Symbol.toStringTag, { value: "Module" }));