superdoc 1.0.0-next.10 → 1.0.0-next.3

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-CZG4udaT.es.js → PdfViewer-PUn0q_lG.es.js} +1 -1
  2. package/dist/chunks/{PdfViewer-B9LcTIm2.cjs → PdfViewer-cVGt7Ne7.cjs} +1 -1
  3. package/dist/chunks/{index-DdTDm9oI-Duiy8M_G.cjs → index-DLO-SgUP-BNtYQDPq.cjs} +1 -1
  4. package/dist/chunks/{index-DdTDm9oI-BXzE00pk.es.js → index-DLO-SgUP-c73otQJ5.es.js} +1 -1
  5. package/dist/chunks/{index-4FiyZ-0E.cjs → index-Djmhr-R6.cjs} +97 -99
  6. package/dist/chunks/{index-1n6qegaQ.es.js → index-mHanL4xN.es.js} +97 -99
  7. package/dist/chunks/{super-editor.es-BQQuazyp.cjs → super-editor.es-Cve8WKfM.cjs} +25570 -28023
  8. package/dist/chunks/{super-editor.es-DKr759cY.es.js → super-editor.es-S9Kp_7dy.es.js} +25570 -28023
  9. package/dist/images/altText_add.svg +3 -0
  10. package/dist/images/altText_disclaimer.svg +3 -0
  11. package/dist/images/altText_done.svg +3 -0
  12. package/dist/images/altText_spinner.svg +30 -0
  13. package/dist/images/altText_warning.svg +3 -0
  14. package/dist/images/annotation-check.svg +11 -0
  15. package/dist/images/annotation-comment.svg +16 -0
  16. package/dist/images/annotation-help.svg +26 -0
  17. package/dist/images/annotation-insert.svg +10 -0
  18. package/dist/images/annotation-key.svg +11 -0
  19. package/dist/images/annotation-newparagraph.svg +11 -0
  20. package/dist/images/annotation-noicon.svg +7 -0
  21. package/dist/images/annotation-note.svg +42 -0
  22. package/dist/images/annotation-paperclip.svg +6 -0
  23. package/dist/images/annotation-paragraph.svg +16 -0
  24. package/dist/images/annotation-pushpin.svg +7 -0
  25. package/dist/images/cursor-editorFreeHighlight.svg +6 -0
  26. package/dist/images/cursor-editorFreeText.svg +3 -0
  27. package/dist/images/cursor-editorInk.svg +4 -0
  28. package/dist/images/cursor-editorTextHighlight.svg +8 -0
  29. package/dist/images/editor-toolbar-delete.svg +5 -0
  30. package/dist/images/loading-icon.gif +0 -0
  31. package/dist/images/messageBar_closingButton.svg +3 -0
  32. package/dist/images/messageBar_warning.svg +3 -0
  33. package/dist/images/toolbarButton-editorHighlight.svg +6 -0
  34. package/dist/images/toolbarButton-menuArrow.svg +3 -0
  35. package/dist/packages/superdoc/src/core/collaboration/collaboration-comments.d.ts +3 -3
  36. package/dist/packages/superdoc/src/core/collaboration/collaboration-comments.d.ts.map +1 -1
  37. package/dist/packages/superdoc/src/core/collaboration/helpers.d.ts.map +1 -1
  38. package/dist/style.css +6 -6
  39. package/dist/super-editor/ai-writer.es.js +2 -2
  40. package/dist/super-editor/chunks/{converter-BavE2jnW.js → converter-ByybZRFp.js} +1 -1
  41. package/dist/super-editor/chunks/{docx-zipper-CY4M19qa.js → docx-zipper-CFQANTLI.js} +1 -1
  42. package/dist/super-editor/chunks/{editor-Cslr04KI.js → editor-Cu4hD14N.js} +25808 -27898
  43. package/dist/super-editor/chunks/{index-DdTDm9oI.js → index-DLO-SgUP.js} +1 -1
  44. package/dist/super-editor/chunks/{toolbar-Zdgn--Js.js → toolbar-5MMla0sj.js} +2 -2
  45. package/dist/super-editor/converter.es.js +1 -1
  46. package/dist/super-editor/docx-zipper.es.js +2 -2
  47. package/dist/super-editor/editor.es.js +3 -3
  48. package/dist/super-editor/file-zipper.es.js +1 -1
  49. package/dist/super-editor/super-editor.es.js +19 -40
  50. package/dist/super-editor/toolbar.es.js +2 -2
  51. package/dist/super-editor.cjs +1 -1
  52. package/dist/super-editor.es.js +1 -1
  53. package/dist/superdoc.cjs +2 -2
  54. package/dist/superdoc.es.js +2 -2
  55. package/dist/superdoc.umd.js +25652 -28107
  56. package/dist/superdoc.umd.js.map +1 -1
  57. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-DKr759cY.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-S9Kp_7dy.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
3
  import { E as EventEmitter } from "./eventemitter3-44XulWQe.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
@@ -3310,17 +3310,17 @@ function setupAwarenessHandler(provider, superdocInstance, user) {
3310
3310
  });
3311
3311
  });
3312
3312
  }
3313
- const addYComment = (yArray, ydoc, event, user) => {
3313
+ const addYComment = (yArray, ydoc, event) => {
3314
3314
  const { comment } = event;
3315
3315
  const yComment = new Map$2(Object.entries(comment));
3316
3316
  ydoc.transact(
3317
3317
  () => {
3318
3318
  yArray.push([yComment]);
3319
3319
  },
3320
- { user }
3320
+ { user: superdoc.user }
3321
3321
  );
3322
3322
  };
3323
- const updateYComment = (yArray, ydoc, event, user) => {
3323
+ const updateYComment = (yArray, ydoc, event) => {
3324
3324
  const { comment } = event;
3325
3325
  const yComment = new Map$2(Object.entries(comment));
3326
3326
  const commentIndex = getCommentIndex(yArray, comment);
@@ -3330,10 +3330,10 @@ const updateYComment = (yArray, ydoc, event, user) => {
3330
3330
  yArray.delete(commentIndex, 1);
3331
3331
  yArray.insert(commentIndex, [yComment]);
3332
3332
  },
3333
- { user }
3333
+ { user: superdoc.user }
3334
3334
  );
3335
3335
  };
3336
- const deleteYComment = (yArray, ydoc, event, user) => {
3336
+ const deleteYComment = (yArray, ydoc, event) => {
3337
3337
  const { comment } = event;
3338
3338
  const commentIndex = getCommentIndex(yArray, comment);
3339
3339
  if (commentIndex === -1) return;
@@ -3341,26 +3341,26 @@ const deleteYComment = (yArray, ydoc, event, user) => {
3341
3341
  () => {
3342
3342
  yArray.delete(commentIndex, 1);
3343
3343
  },
3344
- { user }
3344
+ { user: superdoc.user }
3345
3345
  );
3346
3346
  };
3347
3347
  const getCommentIndex = (yArray, comment) => {
3348
3348
  const baseArray = yArray.toJSON();
3349
3349
  return baseArray.findIndex((c2) => c2.commentId === comment.commentId);
3350
3350
  };
3351
- const initCollaborationComments = (superdoc) => {
3352
- if (!superdoc.config.modules.comments || !superdoc.provider) return;
3351
+ const initCollaborationComments = (superdoc2) => {
3352
+ if (!superdoc2.config.modules.comments || !superdoc2.provider) return;
3353
3353
  const onSuperDocYdocSynced = () => {
3354
- const parent = superdoc.commentsStore.commentsParentElement;
3355
- const ids = superdoc.commentsStore.editorCommentIds;
3356
- superdoc.commentsStore.handleEditorLocationsUpdate(parent, ids);
3357
- superdoc.commentsStore.hasSyncedCollaborationComments = true;
3358
- superdoc.provider.off("synced", onSuperDocYdocSynced);
3354
+ const parent = superdoc2.commentsStore.commentsParentElement;
3355
+ const ids = superdoc2.commentsStore.editorCommentIds;
3356
+ superdoc2.commentsStore.handleEditorLocationsUpdate(parent, ids);
3357
+ superdoc2.commentsStore.hasSyncedCollaborationComments = true;
3358
+ superdoc2.provider.off("synced", onSuperDocYdocSynced);
3359
3359
  };
3360
- superdoc.provider.on("synced", onSuperDocYdocSynced);
3361
- const commentsArray = superdoc.ydoc.getArray("comments");
3360
+ superdoc2.provider.on("synced", onSuperDocYdocSynced);
3361
+ const commentsArray = superdoc2.ydoc.getArray("comments");
3362
3362
  commentsArray.observe((event) => {
3363
- const currentUser = superdoc.config.user;
3363
+ const currentUser = superdoc2.config.user;
3364
3364
  const { user = {} } = event.transaction.origin;
3365
3365
  if (currentUser.name === user.name && currentUser.email === user.email) return;
3366
3366
  const comments = commentsArray.toJSON();
@@ -3372,60 +3372,59 @@ const initCollaborationComments = (superdoc) => {
3372
3372
  filtered.push(c2);
3373
3373
  }
3374
3374
  });
3375
- superdoc.commentsStore.commentsList = filtered.map((c2) => useComment(c2));
3375
+ superdoc2.commentsStore.commentsList = filtered.map((c2) => useComment(c2));
3376
3376
  });
3377
3377
  };
3378
- const initSuperdocYdoc = (superdoc) => {
3379
- const { isInternal } = superdoc.config;
3380
- const baseName = `${superdoc.config.superdocId}-superdoc`;
3381
- if (!superdoc.config.superdocId) return;
3378
+ const initSuperdocYdoc = (superdoc2) => {
3379
+ const { isInternal } = superdoc2.config;
3380
+ const baseName = `${superdoc2.config.superdocId}-superdoc`;
3381
+ if (!superdoc2.config.superdocId) return;
3382
3382
  const documentId = isInternal ? baseName : `${baseName}-external`;
3383
3383
  const superdocCollaborationOptions = {
3384
- config: superdoc.config.modules.collaboration,
3385
- user: superdoc.config.user,
3384
+ config: superdoc2.config.modules.collaboration,
3385
+ user: superdoc2.config.user,
3386
3386
  documentId,
3387
- socket: superdoc.config.socket,
3388
- superdocInstance: superdoc
3387
+ socket: superdoc2.config.socket,
3388
+ superdocInstance: superdoc2
3389
3389
  };
3390
3390
  const { provider: superdocProvider, ydoc: superdocYdoc } = createProvider(superdocCollaborationOptions);
3391
3391
  return { ydoc: superdocYdoc, provider: superdocProvider };
3392
3392
  };
3393
- const makeDocumentsCollaborative = (superdoc) => {
3393
+ const makeDocumentsCollaborative = (superdoc2) => {
3394
3394
  const processedDocuments = [];
3395
- superdoc.config.documents.forEach((doc) => {
3396
- superdoc.config.user.color = superdoc.colors[0];
3395
+ superdoc2.config.documents.forEach((doc) => {
3396
+ superdoc2.config.user.color = superdoc2.colors[0];
3397
3397
  const options = {
3398
- config: superdoc.config.modules.collaboration,
3399
- user: superdoc.config.user,
3398
+ config: superdoc2.config.modules.collaboration,
3399
+ user: superdoc2.config.user,
3400
3400
  documentId: doc.id,
3401
- socket: superdoc.config.socket,
3402
- superdocInstance: superdoc
3401
+ socket: superdoc2.config.socket,
3402
+ superdocInstance: superdoc2
3403
3403
  };
3404
3404
  const { provider, ydoc } = createProvider(options);
3405
3405
  doc.provider = provider;
3406
- doc.socket = superdoc.config.socket;
3406
+ doc.socket = superdoc2.config.socket;
3407
3407
  doc.ydoc = ydoc;
3408
- doc.role = superdoc.config.role;
3408
+ doc.role = superdoc2.config.role;
3409
3409
  processedDocuments.push(doc);
3410
3410
  });
3411
3411
  return processedDocuments;
3412
3412
  };
3413
- const syncCommentsToClients = (superdoc, event) => {
3414
- if (!superdoc.isCollaborative || !superdoc.config.modules.comments) return;
3415
- const yArray = superdoc.ydoc.getArray("comments");
3416
- const user = superdoc.config.user;
3413
+ const syncCommentsToClients = (superdoc2, event) => {
3414
+ if (!superdoc2.isCollaborative || !superdoc2.config.modules.comments) return;
3415
+ const yArray = superdoc2.ydoc.getArray("comments");
3417
3416
  switch (event.type) {
3418
3417
  case "add":
3419
- addYComment(yArray, superdoc.ydoc, event, user);
3418
+ addYComment(yArray, superdoc2.ydoc, event);
3420
3419
  break;
3421
3420
  case "update":
3422
- updateYComment(yArray, superdoc.ydoc, event, user);
3421
+ updateYComment(yArray, superdoc2.ydoc, event);
3423
3422
  break;
3424
3423
  case "resolved":
3425
- updateYComment(yArray, superdoc.ydoc, event, user);
3424
+ updateYComment(yArray, superdoc2.ydoc, event);
3426
3425
  break;
3427
3426
  case "deleted":
3428
- deleteYComment(yArray, superdoc.ydoc, event, user);
3427
+ deleteYComment(yArray, superdoc2.ydoc, event);
3429
3428
  break;
3430
3429
  }
3431
3430
  };
@@ -3500,22 +3499,22 @@ function useComment(params2) {
3500
3499
  const resolvedTime = ref(params2.resolvedTime || null);
3501
3500
  const resolvedByEmail = ref(params2.resolvedByEmail || null);
3502
3501
  const resolvedByName = ref(params2.resolvedByName || null);
3503
- const resolveComment = ({ email, name, superdoc }) => {
3502
+ const resolveComment = ({ email, name, superdoc: superdoc2 }) => {
3504
3503
  if (resolvedTime.value) return;
3505
3504
  resolvedTime.value = Date.now();
3506
3505
  resolvedByEmail.value = email;
3507
3506
  resolvedByName.value = name;
3508
3507
  if (trackedChange.value) {
3509
3508
  const emitData2 = { type: comments_module_events.RESOLVED, comment: getValues() };
3510
- propagateUpdate(superdoc, emitData2);
3511
- superdoc.activeEditor?.commands?.resolveComment({ commentId, importedId });
3509
+ propagateUpdate(superdoc2, emitData2);
3510
+ superdoc2.activeEditor?.commands?.resolveComment({ commentId, importedId });
3512
3511
  return;
3513
3512
  }
3514
3513
  const emitData = { type: comments_module_events.RESOLVED, comment: getValues() };
3515
- propagateUpdate(superdoc, emitData);
3516
- superdoc.activeEditor?.commands?.resolveComment({ commentId, importedId });
3514
+ propagateUpdate(superdoc2, emitData);
3515
+ superdoc2.activeEditor?.commands?.resolveComment({ commentId, importedId });
3517
3516
  };
3518
- const setIsInternal = ({ isInternal: newIsInternal, superdoc }) => {
3517
+ const setIsInternal = ({ isInternal: newIsInternal, superdoc: superdoc2 }) => {
3519
3518
  const previousValue = isInternal.value;
3520
3519
  if (previousValue === newIsInternal) return;
3521
3520
  isInternal.value = newIsInternal;
@@ -3524,16 +3523,16 @@ function useComment(params2) {
3524
3523
  changes: [{ key: "isInternal", value: newIsInternal, previousValue }],
3525
3524
  comment: getValues()
3526
3525
  };
3527
- propagateUpdate(superdoc, emitData);
3528
- const activeEditor = superdoc.activeEditor;
3526
+ propagateUpdate(superdoc2, emitData);
3527
+ const activeEditor = superdoc2.activeEditor;
3529
3528
  if (!activeEditor) return;
3530
3529
  activeEditor.commands.setCommentInternal({ commentId, importedId, isInternal: newIsInternal });
3531
3530
  };
3532
- const setActive = (superdoc) => {
3533
- const { activeEditor } = superdoc;
3531
+ const setActive = (superdoc2) => {
3532
+ const { activeEditor } = superdoc2;
3534
3533
  activeEditor?.commands.setActiveComment({ commentId, importedId });
3535
3534
  };
3536
- const setText = ({ text, superdoc, suppressUpdate }) => {
3535
+ const setText = ({ text, superdoc: superdoc2, suppressUpdate }) => {
3537
3536
  commentText.value = text;
3538
3537
  mentions.value = extractMentions(text);
3539
3538
  if (suppressUpdate) return;
@@ -3542,7 +3541,7 @@ function useComment(params2) {
3542
3541
  changes: [{ key: "text", value: text }],
3543
3542
  comment: getValues()
3544
3543
  };
3545
- propagateUpdate(superdoc, emitData);
3544
+ propagateUpdate(superdoc2, emitData);
3546
3545
  };
3547
3546
  const extractMentions = (htmlString) => {
3548
3547
  const parser = new DOMParser();
@@ -3579,9 +3578,9 @@ function useComment(params2) {
3579
3578
  const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail, image: creatorImage };
3580
3579
  return user;
3581
3580
  };
3582
- const propagateUpdate = (superdoc, event) => {
3583
- superdoc.emit("comments-update", event);
3584
- syncCommentsToClients(superdoc, event);
3581
+ const propagateUpdate = (superdoc2, event) => {
3582
+ superdoc2.emit("comments-update", event);
3583
+ syncCommentsToClients(superdoc2, event);
3585
3584
  };
3586
3585
  const getValues = () => {
3587
3586
  return {
@@ -4006,21 +4005,21 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4006
4005
  if (id === void 0 || id === null) return null;
4007
4006
  return commentsList.value.find((c2) => c2.commentId == id || c2.importedId == id);
4008
4007
  };
4009
- const setActiveComment = (superdoc, id) => {
4008
+ const setActiveComment = (superdoc2, id) => {
4010
4009
  if (id === void 0 || id === null) {
4011
4010
  activeComment.value = null;
4012
- if (superdoc.activeEditor) {
4013
- superdoc.activeEditor.commands?.setActiveComment({ commentId: null });
4011
+ if (superdoc2.activeEditor) {
4012
+ superdoc2.activeEditor.commands?.setActiveComment({ commentId: null });
4014
4013
  }
4015
4014
  return;
4016
4015
  }
4017
4016
  const comment = getComment(id);
4018
4017
  if (comment) activeComment.value = comment.commentId;
4019
- if (superdoc.activeEditor) {
4020
- superdoc.activeEditor.commands?.setActiveComment({ commentId: activeComment.value });
4018
+ if (superdoc2.activeEditor) {
4019
+ superdoc2.activeEditor.commands?.setActiveComment({ commentId: activeComment.value });
4021
4020
  }
4022
4021
  };
4023
- const handleTrackedChangeUpdate = ({ superdoc, params: params2 }) => {
4022
+ const handleTrackedChangeUpdate = ({ superdoc: superdoc2, params: params2 }) => {
4024
4023
  const {
4025
4024
  event,
4026
4025
  changeId,
@@ -4053,7 +4052,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4053
4052
  }
4054
4053
  });
4055
4054
  if (event === "add") {
4056
- addComment({ superdoc, comment });
4055
+ addComment({ superdoc: superdoc2, comment });
4057
4056
  } else if (event === "update") {
4058
4057
  const existingTrackedChange = commentsList.value.find((comment2) => comment2.commentId === changeId);
4059
4058
  if (!existingTrackedChange) return;
@@ -4065,33 +4064,33 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4065
4064
  type: COMMENT_EVENTS.UPDATE,
4066
4065
  comment: existingTrackedChange.getValues()
4067
4066
  };
4068
- syncCommentsToClients(superdoc, emitData);
4069
- debounceEmit(changeId, emitData, superdoc);
4067
+ syncCommentsToClients(superdoc2, emitData);
4068
+ debounceEmit(changeId, emitData, superdoc2);
4070
4069
  }
4071
4070
  };
4072
- const debounceEmit = (commentId, event, superdoc, delay = 1e3) => {
4071
+ const debounceEmit = (commentId, event, superdoc2, delay = 1e3) => {
4073
4072
  if (debounceTimers[commentId]) {
4074
4073
  clearTimeout(debounceTimers[commentId]);
4075
4074
  }
4076
4075
  debounceTimers[commentId] = setTimeout(() => {
4077
- if (superdoc) {
4078
- superdoc.emit("comments-update", event);
4076
+ if (superdoc2) {
4077
+ superdoc2.emit("comments-update", event);
4079
4078
  }
4080
4079
  delete debounceTimers[commentId];
4081
4080
  }, delay);
4082
4081
  };
4083
- const showAddComment = (superdoc) => {
4082
+ const showAddComment = (superdoc2) => {
4084
4083
  const event = { type: COMMENT_EVENTS.PENDING };
4085
- superdoc.emit("comments-update", event);
4084
+ superdoc2.emit("comments-update", event);
4086
4085
  const selection = { ...superdocStore.activeSelection };
4087
4086
  selection.selectionBounds = { ...selection.selectionBounds };
4088
4087
  if (superdocStore.selectionPosition?.source) {
4089
4088
  superdocStore.selectionPosition.source = null;
4090
4089
  }
4091
4090
  pendingComment.value = getPendingComment({ selection, documentId: selection.documentId, parentCommentId: null });
4092
- if (!superdoc.config.isInternal) pendingComment.value.isInternal = false;
4093
- if (superdoc.activeEditor?.commands) {
4094
- superdoc.activeEditor.commands.insertComment({
4091
+ if (!superdoc2.config.isInternal) pendingComment.value.isInternal = false;
4092
+ if (superdoc2.activeEditor?.commands) {
4093
+ superdoc2.activeEditor.commands.insertComment({
4095
4094
  ...pendingComment.value.getValues(),
4096
4095
  commentId: "pending",
4097
4096
  skipEmit: true
@@ -4161,14 +4160,14 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4161
4160
  ...options
4162
4161
  });
4163
4162
  };
4164
- const removePendingComment = (superdoc) => {
4163
+ const removePendingComment = (superdoc2) => {
4165
4164
  currentCommentText.value = "";
4166
4165
  pendingComment.value = null;
4167
4166
  activeComment.value = null;
4168
4167
  superdocStore.selectionPosition = null;
4169
- superdoc.activeEditor?.commands.removeComment({ commentId: "pending" });
4168
+ superdoc2.activeEditor?.commands.removeComment({ commentId: "pending" });
4170
4169
  };
4171
- const addComment = ({ superdoc, comment, skipEditorUpdate = false }) => {
4170
+ const addComment = ({ superdoc: superdoc2, comment, skipEditorUpdate = false }) => {
4172
4171
  let parentComment = commentsList.value.find((c2) => c2.commentId === activeComment.value);
4173
4172
  if (!parentComment) parentComment = comment;
4174
4173
  const newComment = useComment(comment.getValues());
@@ -4179,22 +4178,22 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4179
4178
  const isParentInternal = parentComment.isInternal;
4180
4179
  newComment.isInternal = isParentInternal;
4181
4180
  }
4182
- if (!superdoc.config.isInternal) newComment.isInternal = false;
4181
+ if (!superdoc2.config.isInternal) newComment.isInternal = false;
4183
4182
  commentsList.value.push(newComment);
4184
- removePendingComment(superdoc);
4185
- if (!skipEditorUpdate && !comment.trackedChange && superdoc.activeEditor?.commands && !comment.parentCommentId) {
4186
- superdoc.activeEditor.commands.insertComment({ ...newComment.getValues(), skipEmit: true });
4183
+ removePendingComment(superdoc2);
4184
+ if (!skipEditorUpdate && !comment.trackedChange && superdoc2.activeEditor?.commands && !comment.parentCommentId) {
4185
+ superdoc2.activeEditor.commands.insertComment({ ...newComment.getValues(), skipEmit: true });
4187
4186
  }
4188
4187
  const event = { type: COMMENT_EVENTS.ADD, comment: newComment.getValues() };
4189
- syncCommentsToClients(superdoc, event);
4190
- superdoc.emit("comments-update", event);
4188
+ syncCommentsToClients(superdoc2, event);
4189
+ superdoc2.emit("comments-update", event);
4191
4190
  };
4192
- const deleteComment = ({ commentId: commentIdToDelete, superdoc }) => {
4191
+ const deleteComment = ({ commentId: commentIdToDelete, superdoc: superdoc2 }) => {
4193
4192
  const commentIndex = commentsList.value.findIndex((c2) => c2.commentId === commentIdToDelete);
4194
4193
  const comment = commentsList.value[commentIndex];
4195
4194
  const { commentId, importedId } = comment;
4196
4195
  const { fileId } = comment;
4197
- superdoc.activeEditor?.commands?.removeComment({ commentId, importedId });
4196
+ superdoc2.activeEditor?.commands?.removeComment({ commentId, importedId });
4198
4197
  commentsList.value.splice(commentIndex, 1);
4199
4198
  const childCommentIds = commentsList.value.filter((c2) => c2.parentCommentId === commentId).map((c2) => c2.commentId || c2.importedId);
4200
4199
  commentsList.value = commentsList.value.filter((c2) => !childCommentIds.includes(c2.commentId));
@@ -4203,13 +4202,13 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4203
4202
  comment: comment.getValues(),
4204
4203
  changes: [{ key: "deleted", commentId, fileId }]
4205
4204
  };
4206
- superdoc.emit("comments-update", event);
4207
- syncCommentsToClients(superdoc, event);
4205
+ superdoc2.emit("comments-update", event);
4206
+ syncCommentsToClients(superdoc2, event);
4208
4207
  };
4209
- const cancelComment = (superdoc) => {
4210
- removePendingComment(superdoc);
4208
+ const cancelComment = (superdoc2) => {
4209
+ removePendingComment(superdoc2);
4211
4210
  };
4212
- const processLoadedDocxComments = async ({ superdoc, editor, comments, documentId }) => {
4211
+ const processLoadedDocxComments = async ({ superdoc: superdoc2, editor, comments, documentId }) => {
4213
4212
  const document2 = superdocStore.getDocument(documentId);
4214
4213
  comments.forEach((comment) => {
4215
4214
  const htmlContent = getHtmlFromComment(comment.textJson);
@@ -4241,7 +4240,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4241
4240
  trackedChangeType: comment.trackedChangeType,
4242
4241
  deletedText: comment.trackedDeletedText
4243
4242
  });
4244
- addComment({ superdoc, comment: newComment });
4243
+ addComment({ superdoc: superdoc2, comment: newComment });
4245
4244
  });
4246
4245
  setTimeout(() => {
4247
4246
  createCommentForTrackChanges(editor);
@@ -16521,12 +16520,12 @@ class SuperComments extends EventEmitter {
16521
16520
  element: null,
16522
16521
  commentsStore: null
16523
16522
  };
16524
- constructor(options, superdoc) {
16523
+ constructor(options, superdoc2) {
16525
16524
  super();
16526
16525
  this.config = { ...this.config, ...options };
16527
16526
  this.element = this.config.element;
16528
16527
  this.app = null;
16529
- this.superdoc = superdoc;
16528
+ this.superdoc = superdoc2;
16530
16529
  this.open();
16531
16530
  }
16532
16531
  createVueApp() {
@@ -16755,8 +16754,7 @@ const _sfc_main$9 = {
16755
16754
  measurementTimeoutId.value = null;
16756
16755
  }
16757
16756
  const totalComments = getFloatingComments.value.length;
16758
- const measuredComments = renderedSizes.value.length;
16759
- if (totalComments === 0 || measuredComments === 0) {
16757
+ if (totalComments === 0) {
16760
16758
  return;
16761
16759
  }
16762
16760
  nextTick(processLocations);
@@ -16837,7 +16835,7 @@ const _sfc_main$9 = {
16837
16835
  };
16838
16836
  }
16839
16837
  };
16840
- const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-1402ce8c"]]);
16838
+ const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-6905dd07"]]);
16841
16839
  const _sfc_main$8 = {
16842
16840
  __name: "TextField",
16843
16841
  props: {
@@ -17465,7 +17463,7 @@ const _sfc_main = {
17465
17463
  __name: "SuperDoc",
17466
17464
  emits: ["selection-update"],
17467
17465
  setup(__props, { emit: __emit }) {
17468
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CZG4udaT.es.js"));
17466
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-PUn0q_lG.es.js"));
17469
17467
  const superdocStore = useSuperdocStore();
17470
17468
  const commentsStore = useCommentsStore();
17471
17469
  const {
@@ -18369,7 +18367,7 @@ class SuperDoc extends EventEmitter {
18369
18367
  this.config.colors = shuffleArray(this.config.colors);
18370
18368
  this.userColorMap = /* @__PURE__ */ new Map();
18371
18369
  this.colorIndex = 0;
18372
- this.version = "1.0.0-next.10";
18370
+ this.version = "1.0.0-next.3";
18373
18371
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18374
18372
  this.superdocId = config.superdocId || v4();
18375
18373
  this.colors = this.config.colors;