@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
@@ -1,5 +1,5 @@
1
1
  import { y as defineComponent, A as h, P as Transition, a0 as process$1, K as watchEffect, a as computed, r as ref, j as onMounted, X as onUnmounted, b as createElementBlock, o as openBlock, f as createBaseVNode, e as createCommentVNode, s as createVNode, x as unref } from "./vue-BuPTonTJ.es.js";
2
- import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-Cxv7dMYN.es.js";
2
+ import { d as derived, c, a as cB, f as fadeInTransition, b as cM, N as NBaseLoading, w as warnOnce, u as useConfig, e as useTheme, p as pxfy, g as createKey, h as useThemeClass, i as useCompitable, _ as _export_sfc, j as useSuperdocStore, s as storeToRefs, k as useSelection } from "./index-CocFivpQ.es.js";
3
3
  function self(vars) {
4
4
  const {
5
5
  opacityDisabled,
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
3
  const vue = require("./vue-jWLMl8Ts.cjs");
4
- const superdoc = require("./index-Bj1kFbYe.cjs");
4
+ const superdoc = require("./index-BcHbK1Ip.cjs");
5
5
  function self(vars) {
6
6
  const {
7
7
  opacityDisabled,
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-BhQu31e4.cjs");
2
+ const superEditor_es = require("./super-editor.es-TXxmZOAu.cjs");
3
3
  const blankDocx = require("./blank-docx-DfW3Eeh2.cjs");
4
4
  const eventemitter3 = require("./eventemitter3-DQmQUge-.cjs");
5
5
  const provider = require("@hocuspocus/provider");
@@ -3327,17 +3327,17 @@ function setupAwarenessHandler(provider2, superdocInstance, user) {
3327
3327
  });
3328
3328
  });
3329
3329
  }
3330
- const addYComment = (yArray, ydoc, event) => {
3330
+ const addYComment = (yArray, ydoc, event, user) => {
3331
3331
  const { comment } = event;
3332
3332
  const yComment = new Y.Map(Object.entries(comment));
3333
3333
  ydoc.transact(
3334
3334
  () => {
3335
3335
  yArray.push([yComment]);
3336
3336
  },
3337
- { user: superdoc.user }
3337
+ { user }
3338
3338
  );
3339
3339
  };
3340
- const updateYComment = (yArray, ydoc, event) => {
3340
+ const updateYComment = (yArray, ydoc, event, user) => {
3341
3341
  const { comment } = event;
3342
3342
  const yComment = new Y.Map(Object.entries(comment));
3343
3343
  const commentIndex = getCommentIndex(yArray, comment);
@@ -3347,10 +3347,10 @@ const updateYComment = (yArray, ydoc, event) => {
3347
3347
  yArray.delete(commentIndex, 1);
3348
3348
  yArray.insert(commentIndex, [yComment]);
3349
3349
  },
3350
- { user: superdoc.user }
3350
+ { user }
3351
3351
  );
3352
3352
  };
3353
- const deleteYComment = (yArray, ydoc, event) => {
3353
+ const deleteYComment = (yArray, ydoc, event, user) => {
3354
3354
  const { comment } = event;
3355
3355
  const commentIndex = getCommentIndex(yArray, comment);
3356
3356
  if (commentIndex === -1) return;
@@ -3358,26 +3358,26 @@ const deleteYComment = (yArray, ydoc, event) => {
3358
3358
  () => {
3359
3359
  yArray.delete(commentIndex, 1);
3360
3360
  },
3361
- { user: superdoc.user }
3361
+ { user }
3362
3362
  );
3363
3363
  };
3364
3364
  const getCommentIndex = (yArray, comment) => {
3365
3365
  const baseArray = yArray.toJSON();
3366
3366
  return baseArray.findIndex((c2) => c2.commentId === comment.commentId);
3367
3367
  };
3368
- const initCollaborationComments = (superdoc2) => {
3369
- if (!superdoc2.config.modules.comments || !superdoc2.provider) return;
3368
+ const initCollaborationComments = (superdoc) => {
3369
+ if (!superdoc.config.modules.comments || !superdoc.provider) return;
3370
3370
  const onSuperDocYdocSynced = () => {
3371
- const parent = superdoc2.commentsStore.commentsParentElement;
3372
- const ids = superdoc2.commentsStore.editorCommentIds;
3373
- superdoc2.commentsStore.handleEditorLocationsUpdate(parent, ids);
3374
- superdoc2.commentsStore.hasSyncedCollaborationComments = true;
3375
- superdoc2.provider.off("synced", onSuperDocYdocSynced);
3371
+ const parent = superdoc.commentsStore.commentsParentElement;
3372
+ const ids = superdoc.commentsStore.editorCommentIds;
3373
+ superdoc.commentsStore.handleEditorLocationsUpdate(parent, ids);
3374
+ superdoc.commentsStore.hasSyncedCollaborationComments = true;
3375
+ superdoc.provider.off("synced", onSuperDocYdocSynced);
3376
3376
  };
3377
- superdoc2.provider.on("synced", onSuperDocYdocSynced);
3378
- const commentsArray = superdoc2.ydoc.getArray("comments");
3377
+ superdoc.provider.on("synced", onSuperDocYdocSynced);
3378
+ const commentsArray = superdoc.ydoc.getArray("comments");
3379
3379
  commentsArray.observe((event) => {
3380
- const currentUser = superdoc2.config.user;
3380
+ const currentUser = superdoc.config.user;
3381
3381
  const { user = {} } = event.transaction.origin;
3382
3382
  if (currentUser.name === user.name && currentUser.email === user.email) return;
3383
3383
  const comments = commentsArray.toJSON();
@@ -3389,59 +3389,60 @@ const initCollaborationComments = (superdoc2) => {
3389
3389
  filtered.push(c2);
3390
3390
  }
3391
3391
  });
3392
- superdoc2.commentsStore.commentsList = filtered.map((c2) => useComment(c2));
3392
+ superdoc.commentsStore.commentsList = filtered.map((c2) => useComment(c2));
3393
3393
  });
3394
3394
  };
3395
- const initSuperdocYdoc = (superdoc2) => {
3396
- const { isInternal } = superdoc2.config;
3397
- const baseName = `${superdoc2.config.superdocId}-superdoc`;
3398
- if (!superdoc2.config.superdocId) return;
3395
+ const initSuperdocYdoc = (superdoc) => {
3396
+ const { isInternal } = superdoc.config;
3397
+ const baseName = `${superdoc.config.superdocId}-superdoc`;
3398
+ if (!superdoc.config.superdocId) return;
3399
3399
  const documentId = isInternal ? baseName : `${baseName}-external`;
3400
3400
  const superdocCollaborationOptions = {
3401
- config: superdoc2.config.modules.collaboration,
3402
- user: superdoc2.config.user,
3401
+ config: superdoc.config.modules.collaboration,
3402
+ user: superdoc.config.user,
3403
3403
  documentId,
3404
- socket: superdoc2.config.socket,
3405
- superdocInstance: superdoc2
3404
+ socket: superdoc.config.socket,
3405
+ superdocInstance: superdoc
3406
3406
  };
3407
3407
  const { provider: superdocProvider, ydoc: superdocYdoc } = createProvider(superdocCollaborationOptions);
3408
3408
  return { ydoc: superdocYdoc, provider: superdocProvider };
3409
3409
  };
3410
- const makeDocumentsCollaborative = (superdoc2) => {
3410
+ const makeDocumentsCollaborative = (superdoc) => {
3411
3411
  const processedDocuments = [];
3412
- superdoc2.config.documents.forEach((doc) => {
3413
- superdoc2.config.user.color = superdoc2.colors[0];
3412
+ superdoc.config.documents.forEach((doc) => {
3413
+ superdoc.config.user.color = superdoc.colors[0];
3414
3414
  const options = {
3415
- config: superdoc2.config.modules.collaboration,
3416
- user: superdoc2.config.user,
3415
+ config: superdoc.config.modules.collaboration,
3416
+ user: superdoc.config.user,
3417
3417
  documentId: doc.id,
3418
- socket: superdoc2.config.socket,
3419
- superdocInstance: superdoc2
3418
+ socket: superdoc.config.socket,
3419
+ superdocInstance: superdoc
3420
3420
  };
3421
3421
  const { provider: provider2, ydoc } = createProvider(options);
3422
3422
  doc.provider = provider2;
3423
- doc.socket = superdoc2.config.socket;
3423
+ doc.socket = superdoc.config.socket;
3424
3424
  doc.ydoc = ydoc;
3425
- doc.role = superdoc2.config.role;
3425
+ doc.role = superdoc.config.role;
3426
3426
  processedDocuments.push(doc);
3427
3427
  });
3428
3428
  return processedDocuments;
3429
3429
  };
3430
- const syncCommentsToClients = (superdoc2, event) => {
3431
- if (!superdoc2.isCollaborative || !superdoc2.config.modules.comments) return;
3432
- const yArray = superdoc2.ydoc.getArray("comments");
3430
+ const syncCommentsToClients = (superdoc, event) => {
3431
+ if (!superdoc.isCollaborative || !superdoc.config.modules.comments) return;
3432
+ const yArray = superdoc.ydoc.getArray("comments");
3433
+ const user = superdoc.config.user;
3433
3434
  switch (event.type) {
3434
3435
  case "add":
3435
- addYComment(yArray, superdoc2.ydoc, event);
3436
+ addYComment(yArray, superdoc.ydoc, event, user);
3436
3437
  break;
3437
3438
  case "update":
3438
- updateYComment(yArray, superdoc2.ydoc, event);
3439
+ updateYComment(yArray, superdoc.ydoc, event, user);
3439
3440
  break;
3440
3441
  case "resolved":
3441
- updateYComment(yArray, superdoc2.ydoc, event);
3442
+ updateYComment(yArray, superdoc.ydoc, event, user);
3442
3443
  break;
3443
3444
  case "deleted":
3444
- deleteYComment(yArray, superdoc2.ydoc, event);
3445
+ deleteYComment(yArray, superdoc.ydoc, event, user);
3445
3446
  break;
3446
3447
  }
3447
3448
  };
@@ -3516,22 +3517,22 @@ function useComment(params2) {
3516
3517
  const resolvedTime = vue.ref(params2.resolvedTime || null);
3517
3518
  const resolvedByEmail = vue.ref(params2.resolvedByEmail || null);
3518
3519
  const resolvedByName = vue.ref(params2.resolvedByName || null);
3519
- const resolveComment = ({ email, name, superdoc: superdoc2 }) => {
3520
+ const resolveComment = ({ email, name, superdoc }) => {
3520
3521
  if (resolvedTime.value) return;
3521
3522
  resolvedTime.value = Date.now();
3522
3523
  resolvedByEmail.value = email;
3523
3524
  resolvedByName.value = name;
3524
3525
  if (trackedChange.value) {
3525
3526
  const emitData2 = { type: comments_module_events.RESOLVED, comment: getValues() };
3526
- propagateUpdate(superdoc2, emitData2);
3527
- superdoc2.activeEditor?.commands?.resolveComment({ commentId, importedId });
3527
+ propagateUpdate(superdoc, emitData2);
3528
+ superdoc.activeEditor?.commands?.resolveComment({ commentId, importedId });
3528
3529
  return;
3529
3530
  }
3530
3531
  const emitData = { type: comments_module_events.RESOLVED, comment: getValues() };
3531
- propagateUpdate(superdoc2, emitData);
3532
- superdoc2.activeEditor?.commands?.resolveComment({ commentId, importedId });
3532
+ propagateUpdate(superdoc, emitData);
3533
+ superdoc.activeEditor?.commands?.resolveComment({ commentId, importedId });
3533
3534
  };
3534
- const setIsInternal = ({ isInternal: newIsInternal, superdoc: superdoc2 }) => {
3535
+ const setIsInternal = ({ isInternal: newIsInternal, superdoc }) => {
3535
3536
  const previousValue = isInternal.value;
3536
3537
  if (previousValue === newIsInternal) return;
3537
3538
  isInternal.value = newIsInternal;
@@ -3540,16 +3541,16 @@ function useComment(params2) {
3540
3541
  changes: [{ key: "isInternal", value: newIsInternal, previousValue }],
3541
3542
  comment: getValues()
3542
3543
  };
3543
- propagateUpdate(superdoc2, emitData);
3544
- const activeEditor = superdoc2.activeEditor;
3544
+ propagateUpdate(superdoc, emitData);
3545
+ const activeEditor = superdoc.activeEditor;
3545
3546
  if (!activeEditor) return;
3546
3547
  activeEditor.commands.setCommentInternal({ commentId, importedId, isInternal: newIsInternal });
3547
3548
  };
3548
- const setActive = (superdoc2) => {
3549
- const { activeEditor } = superdoc2;
3549
+ const setActive = (superdoc) => {
3550
+ const { activeEditor } = superdoc;
3550
3551
  activeEditor?.commands.setActiveComment({ commentId, importedId });
3551
3552
  };
3552
- const setText = ({ text, superdoc: superdoc2, suppressUpdate }) => {
3553
+ const setText = ({ text, superdoc, suppressUpdate }) => {
3553
3554
  commentText.value = text;
3554
3555
  mentions.value = extractMentions(text);
3555
3556
  if (suppressUpdate) return;
@@ -3558,7 +3559,7 @@ function useComment(params2) {
3558
3559
  changes: [{ key: "text", value: text }],
3559
3560
  comment: getValues()
3560
3561
  };
3561
- propagateUpdate(superdoc2, emitData);
3562
+ propagateUpdate(superdoc, emitData);
3562
3563
  };
3563
3564
  const extractMentions = (htmlString) => {
3564
3565
  const parser = new DOMParser();
@@ -3595,9 +3596,9 @@ function useComment(params2) {
3595
3596
  const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail, image: creatorImage };
3596
3597
  return user;
3597
3598
  };
3598
- const propagateUpdate = (superdoc2, event) => {
3599
- superdoc2.emit("comments-update", event);
3600
- syncCommentsToClients(superdoc2, event);
3599
+ const propagateUpdate = (superdoc, event) => {
3600
+ superdoc.emit("comments-update", event);
3601
+ syncCommentsToClients(superdoc, event);
3601
3602
  };
3602
3603
  const getValues = () => {
3603
3604
  return {
@@ -4022,21 +4023,21 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4022
4023
  if (id === void 0 || id === null) return null;
4023
4024
  return commentsList.value.find((c2) => c2.commentId == id || c2.importedId == id);
4024
4025
  };
4025
- const setActiveComment = (superdoc2, id) => {
4026
+ const setActiveComment = (superdoc, id) => {
4026
4027
  if (id === void 0 || id === null) {
4027
4028
  activeComment.value = null;
4028
- if (superdoc2.activeEditor) {
4029
- superdoc2.activeEditor.commands?.setActiveComment({ commentId: null });
4029
+ if (superdoc.activeEditor) {
4030
+ superdoc.activeEditor.commands?.setActiveComment({ commentId: null });
4030
4031
  }
4031
4032
  return;
4032
4033
  }
4033
4034
  const comment = getComment(id);
4034
4035
  if (comment) activeComment.value = comment.commentId;
4035
- if (superdoc2.activeEditor) {
4036
- superdoc2.activeEditor.commands?.setActiveComment({ commentId: activeComment.value });
4036
+ if (superdoc.activeEditor) {
4037
+ superdoc.activeEditor.commands?.setActiveComment({ commentId: activeComment.value });
4037
4038
  }
4038
4039
  };
4039
- const handleTrackedChangeUpdate = ({ superdoc: superdoc2, params: params2 }) => {
4040
+ const handleTrackedChangeUpdate = ({ superdoc, params: params2 }) => {
4040
4041
  const {
4041
4042
  event,
4042
4043
  changeId,
@@ -4069,7 +4070,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4069
4070
  }
4070
4071
  });
4071
4072
  if (event === "add") {
4072
- addComment({ superdoc: superdoc2, comment });
4073
+ addComment({ superdoc, comment });
4073
4074
  } else if (event === "update") {
4074
4075
  const existingTrackedChange = commentsList.value.find((comment2) => comment2.commentId === changeId);
4075
4076
  if (!existingTrackedChange) return;
@@ -4081,33 +4082,33 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4081
4082
  type: COMMENT_EVENTS.UPDATE,
4082
4083
  comment: existingTrackedChange.getValues()
4083
4084
  };
4084
- syncCommentsToClients(superdoc2, emitData);
4085
- debounceEmit(changeId, emitData, superdoc2);
4085
+ syncCommentsToClients(superdoc, emitData);
4086
+ debounceEmit(changeId, emitData, superdoc);
4086
4087
  }
4087
4088
  };
4088
- const debounceEmit = (commentId, event, superdoc2, delay = 1e3) => {
4089
+ const debounceEmit = (commentId, event, superdoc, delay = 1e3) => {
4089
4090
  if (debounceTimers[commentId]) {
4090
4091
  clearTimeout(debounceTimers[commentId]);
4091
4092
  }
4092
4093
  debounceTimers[commentId] = setTimeout(() => {
4093
- if (superdoc2) {
4094
- superdoc2.emit("comments-update", event);
4094
+ if (superdoc) {
4095
+ superdoc.emit("comments-update", event);
4095
4096
  }
4096
4097
  delete debounceTimers[commentId];
4097
4098
  }, delay);
4098
4099
  };
4099
- const showAddComment = (superdoc2) => {
4100
+ const showAddComment = (superdoc) => {
4100
4101
  const event = { type: COMMENT_EVENTS.PENDING };
4101
- superdoc2.emit("comments-update", event);
4102
+ superdoc.emit("comments-update", event);
4102
4103
  const selection = { ...superdocStore.activeSelection };
4103
4104
  selection.selectionBounds = { ...selection.selectionBounds };
4104
4105
  if (superdocStore.selectionPosition?.source) {
4105
4106
  superdocStore.selectionPosition.source = null;
4106
4107
  }
4107
4108
  pendingComment.value = getPendingComment({ selection, documentId: selection.documentId, parentCommentId: null });
4108
- if (!superdoc2.config.isInternal) pendingComment.value.isInternal = false;
4109
- if (superdoc2.activeEditor?.commands) {
4110
- superdoc2.activeEditor.commands.insertComment({
4109
+ if (!superdoc.config.isInternal) pendingComment.value.isInternal = false;
4110
+ if (superdoc.activeEditor?.commands) {
4111
+ superdoc.activeEditor.commands.insertComment({
4111
4112
  ...pendingComment.value.getValues(),
4112
4113
  commentId: "pending",
4113
4114
  skipEmit: true
@@ -4177,14 +4178,14 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4177
4178
  ...options
4178
4179
  });
4179
4180
  };
4180
- const removePendingComment = (superdoc2) => {
4181
+ const removePendingComment = (superdoc) => {
4181
4182
  currentCommentText.value = "";
4182
4183
  pendingComment.value = null;
4183
4184
  activeComment.value = null;
4184
4185
  superdocStore.selectionPosition = null;
4185
- superdoc2.activeEditor?.commands.removeComment({ commentId: "pending" });
4186
+ superdoc.activeEditor?.commands.removeComment({ commentId: "pending" });
4186
4187
  };
4187
- const addComment = ({ superdoc: superdoc2, comment, skipEditorUpdate = false }) => {
4188
+ const addComment = ({ superdoc, comment, skipEditorUpdate = false }) => {
4188
4189
  let parentComment = commentsList.value.find((c2) => c2.commentId === activeComment.value);
4189
4190
  if (!parentComment) parentComment = comment;
4190
4191
  const newComment = useComment(comment.getValues());
@@ -4195,22 +4196,22 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4195
4196
  const isParentInternal = parentComment.isInternal;
4196
4197
  newComment.isInternal = isParentInternal;
4197
4198
  }
4198
- if (!superdoc2.config.isInternal) newComment.isInternal = false;
4199
+ if (!superdoc.config.isInternal) newComment.isInternal = false;
4199
4200
  commentsList.value.push(newComment);
4200
- removePendingComment(superdoc2);
4201
- if (!skipEditorUpdate && !comment.trackedChange && superdoc2.activeEditor?.commands && !comment.parentCommentId) {
4202
- superdoc2.activeEditor.commands.insertComment({ ...newComment.getValues(), skipEmit: true });
4201
+ removePendingComment(superdoc);
4202
+ if (!skipEditorUpdate && !comment.trackedChange && superdoc.activeEditor?.commands && !comment.parentCommentId) {
4203
+ superdoc.activeEditor.commands.insertComment({ ...newComment.getValues(), skipEmit: true });
4203
4204
  }
4204
4205
  const event = { type: COMMENT_EVENTS.ADD, comment: newComment.getValues() };
4205
- syncCommentsToClients(superdoc2, event);
4206
- superdoc2.emit("comments-update", event);
4206
+ syncCommentsToClients(superdoc, event);
4207
+ superdoc.emit("comments-update", event);
4207
4208
  };
4208
- const deleteComment = ({ commentId: commentIdToDelete, superdoc: superdoc2 }) => {
4209
+ const deleteComment = ({ commentId: commentIdToDelete, superdoc }) => {
4209
4210
  const commentIndex = commentsList.value.findIndex((c2) => c2.commentId === commentIdToDelete);
4210
4211
  const comment = commentsList.value[commentIndex];
4211
4212
  const { commentId, importedId } = comment;
4212
4213
  const { fileId } = comment;
4213
- superdoc2.activeEditor?.commands?.removeComment({ commentId, importedId });
4214
+ superdoc.activeEditor?.commands?.removeComment({ commentId, importedId });
4214
4215
  commentsList.value.splice(commentIndex, 1);
4215
4216
  const childCommentIds = commentsList.value.filter((c2) => c2.parentCommentId === commentId).map((c2) => c2.commentId || c2.importedId);
4216
4217
  commentsList.value = commentsList.value.filter((c2) => !childCommentIds.includes(c2.commentId));
@@ -4219,13 +4220,13 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4219
4220
  comment: comment.getValues(),
4220
4221
  changes: [{ key: "deleted", commentId, fileId }]
4221
4222
  };
4222
- superdoc2.emit("comments-update", event);
4223
- syncCommentsToClients(superdoc2, event);
4223
+ superdoc.emit("comments-update", event);
4224
+ syncCommentsToClients(superdoc, event);
4224
4225
  };
4225
- const cancelComment = (superdoc2) => {
4226
- removePendingComment(superdoc2);
4226
+ const cancelComment = (superdoc) => {
4227
+ removePendingComment(superdoc);
4227
4228
  };
4228
- const processLoadedDocxComments = async ({ superdoc: superdoc2, editor, comments, documentId }) => {
4229
+ const processLoadedDocxComments = async ({ superdoc, editor, comments, documentId }) => {
4229
4230
  const document2 = superdocStore.getDocument(documentId);
4230
4231
  comments.forEach((comment) => {
4231
4232
  const htmlContent = getHtmlFromComment(comment.textJson);
@@ -4257,7 +4258,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4257
4258
  trackedChangeType: comment.trackedChangeType,
4258
4259
  deletedText: comment.trackedDeletedText
4259
4260
  });
4260
- addComment({ superdoc: superdoc2, comment: newComment });
4261
+ addComment({ superdoc, comment: newComment });
4261
4262
  });
4262
4263
  setTimeout(() => {
4263
4264
  createCommentForTrackChanges(editor);
@@ -16537,12 +16538,12 @@ class SuperComments extends eventemitter3.EventEmitter {
16537
16538
  element: null,
16538
16539
  commentsStore: null
16539
16540
  };
16540
- constructor(options, superdoc2) {
16541
+ constructor(options, superdoc) {
16541
16542
  super();
16542
16543
  this.config = { ...this.config, ...options };
16543
16544
  this.element = this.config.element;
16544
16545
  this.app = null;
16545
- this.superdoc = superdoc2;
16546
+ this.superdoc = superdoc;
16546
16547
  this.open();
16547
16548
  }
16548
16549
  createVueApp() {
@@ -16771,7 +16772,8 @@ const _sfc_main$9 = {
16771
16772
  measurementTimeoutId.value = null;
16772
16773
  }
16773
16774
  const totalComments = getFloatingComments.value.length;
16774
- if (totalComments === 0) {
16775
+ const measuredComments = renderedSizes.value.length;
16776
+ if (totalComments === 0 || measuredComments === 0) {
16775
16777
  return;
16776
16778
  }
16777
16779
  vue.nextTick(processLocations);
@@ -16852,7 +16854,7 @@ const _sfc_main$9 = {
16852
16854
  };
16853
16855
  }
16854
16856
  };
16855
- const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-6905dd07"]]);
16857
+ const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-1402ce8c"]]);
16856
16858
  const _sfc_main$8 = {
16857
16859
  __name: "TextField",
16858
16860
  props: {
@@ -17480,7 +17482,7 @@ const _sfc_main = {
17480
17482
  __name: "SuperDoc",
17481
17483
  emits: ["selection-update"],
17482
17484
  setup(__props, { emit: __emit }) {
17483
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CtSTAdvv.cjs")));
17485
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-CF4W_li8.cjs")));
17484
17486
  const superdocStore = useSuperdocStore();
17485
17487
  const commentsStore = useCommentsStore();
17486
17488
  const {
@@ -18384,7 +18386,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18384
18386
  this.config.colors = shuffleArray(this.config.colors);
18385
18387
  this.userColorMap = /* @__PURE__ */ new Map();
18386
18388
  this.colorIndex = 0;
18387
- this.version = "1.0.0-next.4";
18389
+ this.version = "1.0.0-next.6";
18388
18390
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18389
18391
  this.superdocId = config.superdocId || uuid.v4();
18390
18392
  this.colors = this.config.colors;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const superEditor_es = require("./super-editor.es-BhQu31e4.cjs");
3
+ const superEditor_es = require("./super-editor.es-TXxmZOAu.cjs");
4
4
  const indexCvBqQJbG = require("./index-CvBqQJbG-Dwm0THD7.cjs");
5
5
  function bail(error) {
6
6
  if (error) {
@@ -1,4 +1,4 @@
1
- import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-B2fSLkzN.es.js";
1
+ import { s as getDefaultExportFromCjs$2 } from "./super-editor.es-C7JZxENm.es.js";
2
2
  import { V as VFile } from "./index-CvBqQJbG-CvBqQJbG.es.js";
3
3
  function bail(error) {
4
4
  if (error) {