@harbour-enterprises/superdoc 1.0.0-beta.99 → 1.0.0-next.10

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 (69) hide show
  1. package/dist/chunks/{PdfViewer-BtuTHUW7.cjs → PdfViewer-B9LcTIm2.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-DF-v5Yrr.es.js → PdfViewer-CZG4udaT.es.js} +2 -2
  3. package/dist/chunks/{eventemitter3-CcXAdeql.es.js → eventemitter3-44XulWQe.es.js} +1 -1
  4. package/dist/chunks/{index-CJy3FxL7.es.js → index-1n6qegaQ.es.js} +564 -325
  5. package/dist/chunks/{index-BBu9BBvp.cjs → index-4FiyZ-0E.cjs} +561 -322
  6. package/dist/chunks/{index-BB0msI45-DUPBw4Bh.es.js → index-DdTDm9oI-BXzE00pk.es.js} +1 -1
  7. package/dist/chunks/{index-BB0msI45-CPU6Ak2R.cjs → index-DdTDm9oI-Duiy8M_G.cjs} +1 -1
  8. package/dist/chunks/{jszip-5vvIqAEE.es.js → jszip-VP334ufO.es.js} +1 -1
  9. package/dist/chunks/{super-editor.es-C04sFzVD.cjs → super-editor.es-BQQuazyp.cjs} +28809 -25325
  10. package/dist/chunks/{super-editor.es-BiaFIbw-.es.js → super-editor.es-DKr759cY.es.js} +28810 -25326
  11. package/dist/chunks/{vue-Dysv_7z5.es.js → vue-BuPTonTJ.es.js} +27 -27
  12. package/dist/chunks/xml-js-LkEmUa9-.es.js +2 -0
  13. package/dist/packages/superdoc/src/composables/useUiFontFamily.d.ts +42 -0
  14. package/dist/packages/superdoc/src/composables/useUiFontFamily.d.ts.map +1 -0
  15. package/dist/packages/superdoc/src/core/SuperDoc.d.ts +3 -3
  16. package/dist/packages/superdoc/src/core/SuperDoc.d.ts.map +1 -1
  17. package/dist/packages/superdoc/src/core/collaboration/collaboration-comments.d.ts +3 -3
  18. package/dist/packages/superdoc/src/core/collaboration/collaboration-comments.d.ts.map +1 -1
  19. package/dist/packages/superdoc/src/core/collaboration/helpers.d.ts.map +1 -1
  20. package/dist/packages/superdoc/src/core/types/index.d.ts +4 -167
  21. package/dist/packages/superdoc/src/core/types/index.d.ts.map +1 -1
  22. package/dist/style.css +94 -92
  23. package/dist/super-editor/ai-writer.es.js +3 -3
  24. package/dist/super-editor/chunks/{converter-B_cVJPnh.js → converter-BavE2jnW.js} +12 -6
  25. package/dist/super-editor/chunks/{docx-zipper-fPWx7kV0.js → docx-zipper-CY4M19qa.js} +1 -1
  26. package/dist/super-editor/chunks/{editor-DS9z42Je.js → editor-Cslr04KI.js} +28419 -25540
  27. package/dist/super-editor/chunks/{index-BB0msI45.js → index-DdTDm9oI.js} +1 -1
  28. package/dist/super-editor/chunks/{toolbar-aIFlIr6h.js → toolbar-Zdgn--Js.js} +804 -568
  29. package/dist/super-editor/converter.es.js +1 -1
  30. package/dist/super-editor/docx-zipper.es.js +2 -2
  31. package/dist/super-editor/editor.es.js +3 -3
  32. package/dist/super-editor/file-zipper.es.js +1 -1
  33. package/dist/super-editor/style.css +22 -21
  34. package/dist/super-editor/super-editor.es.js +48 -23
  35. package/dist/super-editor/toolbar.es.js +2 -2
  36. package/dist/super-editor.cjs +1 -1
  37. package/dist/super-editor.es.js +2 -2
  38. package/dist/superdoc.cjs +2 -2
  39. package/dist/superdoc.es.js +2 -2
  40. package/dist/superdoc.umd.js +29358 -25635
  41. package/dist/superdoc.umd.js.map +1 -1
  42. package/package.json +10 -1
  43. package/dist/chunks/xml-js-ClO_jHnq.es.js +0 -2
  44. package/dist/images/altText_add.svg +0 -3
  45. package/dist/images/altText_disclaimer.svg +0 -3
  46. package/dist/images/altText_done.svg +0 -3
  47. package/dist/images/altText_spinner.svg +0 -30
  48. package/dist/images/altText_warning.svg +0 -3
  49. package/dist/images/annotation-check.svg +0 -11
  50. package/dist/images/annotation-comment.svg +0 -16
  51. package/dist/images/annotation-help.svg +0 -26
  52. package/dist/images/annotation-insert.svg +0 -10
  53. package/dist/images/annotation-key.svg +0 -11
  54. package/dist/images/annotation-newparagraph.svg +0 -11
  55. package/dist/images/annotation-noicon.svg +0 -7
  56. package/dist/images/annotation-note.svg +0 -42
  57. package/dist/images/annotation-paperclip.svg +0 -6
  58. package/dist/images/annotation-paragraph.svg +0 -16
  59. package/dist/images/annotation-pushpin.svg +0 -7
  60. package/dist/images/cursor-editorFreeHighlight.svg +0 -6
  61. package/dist/images/cursor-editorFreeText.svg +0 -3
  62. package/dist/images/cursor-editorInk.svg +0 -4
  63. package/dist/images/cursor-editorTextHighlight.svg +0 -8
  64. package/dist/images/editor-toolbar-delete.svg +0 -5
  65. package/dist/images/loading-icon.gif +0 -0
  66. package/dist/images/messageBar_closingButton.svg +0 -3
  67. package/dist/images/messageBar_warning.svg +0 -3
  68. package/dist/images/toolbarButton-editorHighlight.svg +0 -6
  69. package/dist/images/toolbarButton-menuArrow.svg +0 -3
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
- const superEditor_es = require("./super-editor.es-C04sFzVD.cjs");
2
+ const superEditor_es = require("./super-editor.es-BQQuazyp.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);
@@ -4425,6 +4426,62 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4425
4426
  handleTrackedChangeUpdate
4426
4427
  };
4427
4428
  });
4429
+ const commentIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"/></svg>';
4430
+ const caretDownIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"/></svg>';
4431
+ const userCheckIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM625 177L497 305c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L591 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>';
4432
+ const usersIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M144 0a80 80 0 1 1 0 160A80 80 0 1 1 144 0zM512 0a80 80 0 1 1 0 160A80 80 0 1 1 512 0zM0 298.7C0 239.8 47.8 192 106.7 192l42.7 0c15.9 0 31 3.5 44.6 9.7c-1.3 7.2-1.9 14.7-1.9 22.3c0 38.2 16.8 72.5 43.3 96c-.2 0-.4 0-.7 0L21.3 320C9.6 320 0 310.4 0 298.7zM405.3 320c-.2 0-.4 0-.7 0c26.6-23.5 43.3-57.8 43.3-96c0-7.6-.7-15-1.9-22.3c13.6-6.3 28.7-9.7 44.6-9.7l42.7 0C592.2 192 640 239.8 640 298.7c0 11.8-9.6 21.3-21.3 21.3l-213.3 0zM224 224a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zM128 485.3C128 411.7 187.7 352 261.3 352l117.3 0C452.3 352 512 411.7 512 485.3c0 14.7-11.9 26.7-26.7 26.7l-330.7 0c-14.7 0-26.7-11.9-26.7-26.7z"/></svg>';
4433
+ const checkIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>';
4434
+ const xmarkIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>';
4435
+ const ellipsisVerticalSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/></svg>';
4436
+ const superdocIcons = {
4437
+ comment: commentIconSvg,
4438
+ caretDown: caretDownIconSvg,
4439
+ internal: userCheckIconSvg,
4440
+ external: usersIconSvg,
4441
+ markDone: checkIconSvg,
4442
+ acceptChange: checkIconSvg,
4443
+ rejectChange: xmarkIconSvg,
4444
+ overflow: ellipsisVerticalSvg
4445
+ };
4446
+ const _export_sfc = (sfc, props) => {
4447
+ const target = sfc.__vccOpts || sfc;
4448
+ for (const [key, val] of props) {
4449
+ target[key] = val;
4450
+ }
4451
+ return target;
4452
+ };
4453
+ const _hoisted_1$f = { class: "user-container" };
4454
+ const _hoisted_2$9 = ["src"];
4455
+ const _hoisted_3$7 = {
4456
+ key: 1,
4457
+ class: "user-bg"
4458
+ };
4459
+ const _sfc_main$g = {
4460
+ __name: "Avatar",
4461
+ props: {
4462
+ user: {
4463
+ type: Object,
4464
+ required: true
4465
+ }
4466
+ },
4467
+ setup(__props) {
4468
+ const getInitials = (name, email) => {
4469
+ if (!name && !email) return;
4470
+ const firstLetter = name?.substring(0, 1) || email?.substring(0, 1) || null;
4471
+ return firstLetter;
4472
+ };
4473
+ return (_ctx, _cache) => {
4474
+ return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
4475
+ __props.user.image ? (vue.openBlock(), vue.createElementBlock("img", {
4476
+ key: 0,
4477
+ class: "user-bg",
4478
+ src: __props.user.image.startsWith("http") ? __props.user.image : `data:image/png;base64,${__props.user.image}`
4479
+ }, null, 8, _hoisted_2$9)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$7, vue.toDisplayString(getInitials(__props.user.name, __props.user.email)), 1))
4480
+ ]);
4481
+ };
4482
+ }
4483
+ };
4484
+ const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-53e13009"]]);
4428
4485
  function plugin$1(options) {
4429
4486
  let _bPrefix = ".";
4430
4487
  let _ePrefix = "__";
@@ -8025,30 +8082,30 @@ const defaultClsPrefix = "n";
8025
8082
  function useConfig(props = {}, options = {
8026
8083
  defaultBordered: true
8027
8084
  }) {
8028
- const NConfigProvider = vue.inject(configProviderInjectionKey, null);
8085
+ const NConfigProvider2 = vue.inject(configProviderInjectionKey, null);
8029
8086
  return {
8030
8087
  // NConfigProvider,
8031
- inlineThemeDisabled: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.inlineThemeDisabled,
8032
- mergedRtlRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedRtlRef,
8033
- mergedComponentPropsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedComponentPropsRef,
8034
- mergedBreakpointsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBreakpointsRef,
8088
+ inlineThemeDisabled: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled,
8089
+ mergedRtlRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef,
8090
+ mergedComponentPropsRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef,
8091
+ mergedBreakpointsRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef,
8035
8092
  mergedBorderedRef: vue.computed(() => {
8036
8093
  var _a, _b;
8037
8094
  const {
8038
8095
  bordered
8039
8096
  } = props;
8040
8097
  if (bordered !== void 0) return bordered;
8041
- return (_b = (_a = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBorderedRef.value) !== null && _a !== void 0 ? _a : options.defaultBordered) !== null && _b !== void 0 ? _b : true;
8098
+ return (_b = (_a = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBorderedRef.value) !== null && _a !== void 0 ? _a : options.defaultBordered) !== null && _b !== void 0 ? _b : true;
8042
8099
  }),
8043
- mergedClsPrefixRef: NConfigProvider ? NConfigProvider.mergedClsPrefixRef : vue.shallowRef(defaultClsPrefix),
8044
- namespaceRef: vue.computed(() => NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedNamespaceRef.value)
8100
+ mergedClsPrefixRef: NConfigProvider2 ? NConfigProvider2.mergedClsPrefixRef : vue.shallowRef(defaultClsPrefix),
8101
+ namespaceRef: vue.computed(() => NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value)
8045
8102
  };
8046
8103
  }
8047
8104
  function useThemeClass(componentName, hashRef, cssVarsRef, props) {
8048
8105
  if (!cssVarsRef) throwError("useThemeClass", "cssVarsRef is not passed");
8049
- const NConfigProvider = vue.inject(configProviderInjectionKey, null);
8050
- const mergedThemeHashRef = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeHashRef;
8051
- const styleMountTarget = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget;
8106
+ const NConfigProvider2 = vue.inject(configProviderInjectionKey, null);
8107
+ const mergedThemeHashRef = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeHashRef;
8108
+ const styleMountTarget = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget;
8052
8109
  const themeClassRef = vue.ref("");
8053
8110
  const ssrAdapter2 = useSsrAdapter();
8054
8111
  let renderCallback;
@@ -9517,7 +9574,7 @@ function useRtl(mountId, rtlStateRef, clsPrefixRef) {
9517
9574
  }
9518
9575
  return componentRtlState;
9519
9576
  });
9520
- const NConfigProvider = vue.inject(configProviderInjectionKey, null);
9577
+ const NConfigProvider2 = vue.inject(configProviderInjectionKey, null);
9521
9578
  const mountStyle = () => {
9522
9579
  vue.watchEffect(() => {
9523
9580
  const {
@@ -9537,7 +9594,7 @@ function useRtl(mountId, rtlStateRef, clsPrefixRef) {
9537
9594
  bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
9538
9595
  },
9539
9596
  ssr: ssrAdapter2,
9540
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9597
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9541
9598
  });
9542
9599
  });
9543
9600
  };
@@ -9596,7 +9653,7 @@ function useStyle(mountId, style2, clsPrefixRef) {
9596
9653
  return;
9597
9654
  }
9598
9655
  const ssrAdapter2 = useSsrAdapter();
9599
- const NConfigProvider = vue.inject(configProviderInjectionKey, null);
9656
+ const NConfigProvider2 = vue.inject(configProviderInjectionKey, null);
9600
9657
  const mountStyle = () => {
9601
9658
  const clsPrefix = clsPrefixRef.value;
9602
9659
  style2.mount({
@@ -9607,15 +9664,15 @@ function useStyle(mountId, style2, clsPrefixRef) {
9607
9664
  bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
9608
9665
  },
9609
9666
  ssr: ssrAdapter2,
9610
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9667
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9611
9668
  });
9612
- if (!(NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.preflightStyleDisabled)) {
9669
+ if (!(NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled)) {
9613
9670
  globalStyle.mount({
9614
9671
  id: "n-global",
9615
9672
  head: true,
9616
9673
  anchorMetaName: cssrAnchorMetaName,
9617
9674
  ssr: ssrAdapter2,
9618
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9675
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9619
9676
  });
9620
9677
  }
9621
9678
  };
@@ -9630,7 +9687,7 @@ function createTheme(theme) {
9630
9687
  }
9631
9688
  function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef) {
9632
9689
  const ssrAdapter2 = useSsrAdapter();
9633
- const NConfigProvider = vue.inject(configProviderInjectionKey, null);
9690
+ const NConfigProvider2 = vue.inject(configProviderInjectionKey, null);
9634
9691
  if (style2) {
9635
9692
  const mountStyle = () => {
9636
9693
  const clsPrefix = clsPrefixRef === null || clsPrefixRef === void 0 ? void 0 : clsPrefixRef.value;
@@ -9642,15 +9699,15 @@ function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef)
9642
9699
  },
9643
9700
  anchorMetaName: cssrAnchorMetaName,
9644
9701
  ssr: ssrAdapter2,
9645
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9702
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9646
9703
  });
9647
- if (!(NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.preflightStyleDisabled)) {
9704
+ if (!(NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled)) {
9648
9705
  globalStyle.mount({
9649
9706
  id: "n-global",
9650
9707
  head: true,
9651
9708
  anchorMetaName: cssrAnchorMetaName,
9652
9709
  ssr: ssrAdapter2,
9653
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9710
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9654
9711
  });
9655
9712
  }
9656
9713
  };
@@ -9682,11 +9739,11 @@ function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef)
9682
9739
  self: globalSelf = void 0,
9683
9740
  peers: globalPeers = {}
9684
9741
  } = {}
9685
- } = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeRef.value) || {};
9742
+ } = (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value) || {};
9686
9743
  const {
9687
9744
  common: globalCommonOverrides = void 0,
9688
9745
  [resolveId]: globalSelfOverrides = {}
9689
- } = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeOverridesRef.value) || {};
9746
+ } = (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value) || {};
9690
9747
  const {
9691
9748
  common: globalSelfCommonOverrides,
9692
9749
  peers: globalPeersOverrides = {}
@@ -13529,6 +13586,209 @@ const NCheckbox = vue.defineComponent({
13529
13586
  }))), labelNode);
13530
13587
  }
13531
13588
  });
13589
+ const configProviderProps = {
13590
+ abstract: Boolean,
13591
+ bordered: {
13592
+ type: Boolean,
13593
+ default: void 0
13594
+ },
13595
+ clsPrefix: String,
13596
+ locale: Object,
13597
+ dateLocale: Object,
13598
+ namespace: String,
13599
+ rtl: Array,
13600
+ tag: {
13601
+ type: String,
13602
+ default: "div"
13603
+ },
13604
+ hljs: Object,
13605
+ katex: Object,
13606
+ theme: Object,
13607
+ themeOverrides: Object,
13608
+ componentOptions: Object,
13609
+ icons: Object,
13610
+ breakpoints: Object,
13611
+ preflightStyleDisabled: Boolean,
13612
+ styleMountTarget: Object,
13613
+ inlineThemeDisabled: {
13614
+ type: Boolean,
13615
+ default: void 0
13616
+ },
13617
+ // deprecated
13618
+ as: {
13619
+ type: String,
13620
+ validator: () => {
13621
+ warn("config-provider", "`as` is deprecated, please use `tag` instead.");
13622
+ return true;
13623
+ },
13624
+ default: void 0
13625
+ }
13626
+ };
13627
+ const NConfigProvider = vue.defineComponent({
13628
+ name: "ConfigProvider",
13629
+ alias: ["App"],
13630
+ props: configProviderProps,
13631
+ setup(props) {
13632
+ const NConfigProvider2 = vue.inject(configProviderInjectionKey, null);
13633
+ const mergedThemeRef = vue.computed(() => {
13634
+ const {
13635
+ theme
13636
+ } = props;
13637
+ if (theme === null) return void 0;
13638
+ const inheritedTheme = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value;
13639
+ return theme === void 0 ? inheritedTheme : inheritedTheme === void 0 ? theme : Object.assign({}, inheritedTheme, theme);
13640
+ });
13641
+ const mergedThemeOverridesRef = vue.computed(() => {
13642
+ const {
13643
+ themeOverrides
13644
+ } = props;
13645
+ if (themeOverrides === null) return void 0;
13646
+ if (themeOverrides === void 0) {
13647
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
13648
+ } else {
13649
+ const inheritedThemeOverrides = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
13650
+ if (inheritedThemeOverrides === void 0) {
13651
+ return themeOverrides;
13652
+ } else {
13653
+ return merge$1({}, inheritedThemeOverrides, themeOverrides);
13654
+ }
13655
+ }
13656
+ });
13657
+ const mergedNamespaceRef = useMemo(() => {
13658
+ const {
13659
+ namespace: namespace2
13660
+ } = props;
13661
+ return namespace2 === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value : namespace2;
13662
+ });
13663
+ const mergedBorderedRef = useMemo(() => {
13664
+ const {
13665
+ bordered
13666
+ } = props;
13667
+ return bordered === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBorderedRef.value : bordered;
13668
+ });
13669
+ const mergedIconsRef = vue.computed(() => {
13670
+ const {
13671
+ icons
13672
+ } = props;
13673
+ return icons === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedIconsRef.value : icons;
13674
+ });
13675
+ const mergedComponentPropsRef = vue.computed(() => {
13676
+ const {
13677
+ componentOptions
13678
+ } = props;
13679
+ if (componentOptions !== void 0) return componentOptions;
13680
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef.value;
13681
+ });
13682
+ const mergedClsPrefixRef = vue.computed(() => {
13683
+ const {
13684
+ clsPrefix
13685
+ } = props;
13686
+ if (clsPrefix !== void 0) return clsPrefix;
13687
+ if (NConfigProvider2) return NConfigProvider2.mergedClsPrefixRef.value;
13688
+ return defaultClsPrefix;
13689
+ });
13690
+ const mergedRtlRef = vue.computed(() => {
13691
+ var _a;
13692
+ const {
13693
+ rtl
13694
+ } = props;
13695
+ if (rtl === void 0) {
13696
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef.value;
13697
+ }
13698
+ const rtlEnabledState = {};
13699
+ for (const rtlInfo of rtl) {
13700
+ rtlEnabledState[rtlInfo.name] = vue.markRaw(rtlInfo);
13701
+ (_a = rtlInfo.peers) === null || _a === void 0 ? void 0 : _a.forEach((peerRtlInfo) => {
13702
+ if (!(peerRtlInfo.name in rtlEnabledState)) {
13703
+ rtlEnabledState[peerRtlInfo.name] = vue.markRaw(peerRtlInfo);
13704
+ }
13705
+ });
13706
+ }
13707
+ return rtlEnabledState;
13708
+ });
13709
+ const mergedBreakpointsRef = vue.computed(() => {
13710
+ return props.breakpoints || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef.value);
13711
+ });
13712
+ const inlineThemeDisabled = props.inlineThemeDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled);
13713
+ const preflightStyleDisabled = props.preflightStyleDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled);
13714
+ const styleMountTarget = props.styleMountTarget || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget);
13715
+ const mergedThemeHashRef = vue.computed(() => {
13716
+ const {
13717
+ value: theme
13718
+ } = mergedThemeRef;
13719
+ const {
13720
+ value: mergedThemeOverrides
13721
+ } = mergedThemeOverridesRef;
13722
+ const hasThemeOverrides = mergedThemeOverrides && Object.keys(mergedThemeOverrides).length !== 0;
13723
+ const themeName = theme === null || theme === void 0 ? void 0 : theme.name;
13724
+ if (themeName) {
13725
+ if (hasThemeOverrides) {
13726
+ return `${themeName}-${murmur2(JSON.stringify(mergedThemeOverridesRef.value))}`;
13727
+ }
13728
+ return themeName;
13729
+ } else {
13730
+ if (hasThemeOverrides) {
13731
+ return murmur2(JSON.stringify(mergedThemeOverridesRef.value));
13732
+ }
13733
+ return "";
13734
+ }
13735
+ });
13736
+ vue.provide(configProviderInjectionKey, {
13737
+ mergedThemeHashRef,
13738
+ mergedBreakpointsRef,
13739
+ mergedRtlRef,
13740
+ mergedIconsRef,
13741
+ mergedComponentPropsRef,
13742
+ mergedBorderedRef,
13743
+ mergedNamespaceRef,
13744
+ mergedClsPrefixRef,
13745
+ mergedLocaleRef: vue.computed(() => {
13746
+ const {
13747
+ locale
13748
+ } = props;
13749
+ if (locale === null) return void 0;
13750
+ return locale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedLocaleRef.value : locale;
13751
+ }),
13752
+ mergedDateLocaleRef: vue.computed(() => {
13753
+ const {
13754
+ dateLocale
13755
+ } = props;
13756
+ if (dateLocale === null) return void 0;
13757
+ return dateLocale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedDateLocaleRef.value : dateLocale;
13758
+ }),
13759
+ mergedHljsRef: vue.computed(() => {
13760
+ const {
13761
+ hljs
13762
+ } = props;
13763
+ return hljs === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedHljsRef.value : hljs;
13764
+ }),
13765
+ mergedKatexRef: vue.computed(() => {
13766
+ const {
13767
+ katex
13768
+ } = props;
13769
+ return katex === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedKatexRef.value : katex;
13770
+ }),
13771
+ mergedThemeRef,
13772
+ mergedThemeOverridesRef,
13773
+ inlineThemeDisabled: inlineThemeDisabled || false,
13774
+ preflightStyleDisabled: preflightStyleDisabled || false,
13775
+ styleMountTarget
13776
+ });
13777
+ return {
13778
+ mergedClsPrefix: mergedClsPrefixRef,
13779
+ mergedBordered: mergedBorderedRef,
13780
+ mergedNamespace: mergedNamespaceRef,
13781
+ mergedTheme: mergedThemeRef,
13782
+ mergedThemeOverrides: mergedThemeOverridesRef
13783
+ };
13784
+ },
13785
+ render() {
13786
+ var _a, _b, _c, _d;
13787
+ return !this.abstract ? vue.h(this.as || this.tag, {
13788
+ class: `${this.mergedClsPrefix || defaultClsPrefix}-config-provider`
13789
+ }, (_b = (_a = this.$slots).default) === null || _b === void 0 ? void 0 : _b.call(_a)) : (_d = (_c = this.$slots).default) === null || _d === void 0 ? void 0 : _d.call(_c);
13790
+ }
13791
+ });
13532
13792
  const commonVariables$1 = {
13533
13793
  padding: "4px 0",
13534
13794
  optionIconSizeSmall: "14px",
@@ -15405,62 +15665,20 @@ const NMessageProvider = vue.defineComponent({
15405
15665
  }))) : null);
15406
15666
  }
15407
15667
  });
15408
- const commentIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M512 240c0 114.9-114.6 208-256 208c-37.1 0-72.3-6.4-104.1-17.9c-11.9 8.7-31.3 20.6-54.3 30.6C73.6 471.1 44.7 480 16 480c-6.5 0-12.3-3.9-14.8-9.9c-2.5-6-1.1-12.8 3.4-17.4c0 0 0 0 0 0s0 0 0 0s0 0 0 0c0 0 0 0 0 0l.3-.3c.3-.3 .7-.7 1.3-1.4c1.1-1.2 2.8-3.1 4.9-5.7c4.1-5 9.6-12.4 15.2-21.6c10-16.6 19.5-38.4 21.4-62.9C17.7 326.8 0 285.1 0 240C0 125.1 114.6 32 256 32s256 93.1 256 208z"/></svg>';
15409
- const caretDownIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 320 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M137.4 374.6c12.5 12.5 32.8 12.5 45.3 0l128-128c9.2-9.2 11.9-22.9 6.9-34.9s-16.6-19.8-29.6-19.8L32 192c-12.9 0-24.6 7.8-29.6 19.8s-2.2 25.7 6.9 34.9l128 128z"/></svg>';
15410
- const userCheckIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M96 128a128 128 0 1 1 256 0A128 128 0 1 1 96 128zM0 482.3C0 383.8 79.8 304 178.3 304l91.4 0C368.2 304 448 383.8 448 482.3c0 16.4-13.3 29.7-29.7 29.7L29.7 512C13.3 512 0 498.7 0 482.3zM625 177L497 305c-9.4 9.4-24.6 9.4-33.9 0l-64-64c-9.4-9.4-9.4-24.6 0-33.9s24.6-9.4 33.9 0l47 47L591 143c9.4-9.4 24.6-9.4 33.9 0s9.4 24.6 0 33.9z"/></svg>';
15411
- const usersIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 640 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M144 0a80 80 0 1 1 0 160A80 80 0 1 1 144 0zM512 0a80 80 0 1 1 0 160A80 80 0 1 1 512 0zM0 298.7C0 239.8 47.8 192 106.7 192l42.7 0c15.9 0 31 3.5 44.6 9.7c-1.3 7.2-1.9 14.7-1.9 22.3c0 38.2 16.8 72.5 43.3 96c-.2 0-.4 0-.7 0L21.3 320C9.6 320 0 310.4 0 298.7zM405.3 320c-.2 0-.4 0-.7 0c26.6-23.5 43.3-57.8 43.3-96c0-7.6-.7-15-1.9-22.3c13.6-6.3 28.7-9.7 44.6-9.7l42.7 0C592.2 192 640 239.8 640 298.7c0 11.8-9.6 21.3-21.3 21.3l-213.3 0zM224 224a96 96 0 1 1 192 0 96 96 0 1 1 -192 0zM128 485.3C128 411.7 187.7 352 261.3 352l117.3 0C452.3 352 512 411.7 512 485.3c0 14.7-11.9 26.7-26.7 26.7l-330.7 0c-14.7 0-26.7-11.9-26.7-26.7z"/></svg>';
15412
- const checkIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M438.6 105.4c12.5 12.5 12.5 32.8 0 45.3l-256 256c-12.5 12.5-32.8 12.5-45.3 0l-128-128c-12.5-12.5-12.5-32.8 0-45.3s32.8-12.5 45.3 0L160 338.7 393.4 105.4c12.5-12.5 32.8-12.5 45.3 0z"/></svg>';
15413
- const xmarkIconSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 384 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M342.6 150.6c12.5-12.5 12.5-32.8 0-45.3s-32.8-12.5-45.3 0L192 210.7 86.6 105.4c-12.5-12.5-32.8-12.5-45.3 0s-12.5 32.8 0 45.3L146.7 256 41.4 361.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L192 301.3 297.4 406.6c12.5 12.5 32.8 12.5 45.3 0s12.5-32.8 0-45.3L237.3 256 342.6 150.6z"/></svg>';
15414
- const ellipsisVerticalSvg = '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 128 512"><!--!Font Awesome Free 6.7.2 by @fontawesome - https://fontawesome.com License - https://fontawesome.com/license/free Copyright 2025 Fonticons, Inc.--><path d="M64 360a56 56 0 1 0 0 112 56 56 0 1 0 0-112zm0-160a56 56 0 1 0 0 112 56 56 0 1 0 0-112zM120 96A56 56 0 1 0 8 96a56 56 0 1 0 112 0z"/></svg>';
15415
- const superdocIcons = {
15416
- comment: commentIconSvg,
15417
- caretDown: caretDownIconSvg,
15418
- internal: userCheckIconSvg,
15419
- external: usersIconSvg,
15420
- markDone: checkIconSvg,
15421
- acceptChange: checkIconSvg,
15422
- rejectChange: xmarkIconSvg,
15423
- overflow: ellipsisVerticalSvg
15424
- };
15425
- const _export_sfc = (sfc, props) => {
15426
- const target = sfc.__vccOpts || sfc;
15427
- for (const [key, val] of props) {
15428
- target[key] = val;
15429
- }
15430
- return target;
15431
- };
15432
- const _hoisted_1$f = { class: "user-container" };
15433
- const _hoisted_2$9 = ["src"];
15434
- const _hoisted_3$7 = {
15435
- key: 1,
15436
- class: "user-bg"
15437
- };
15438
- const _sfc_main$g = {
15439
- __name: "Avatar",
15440
- props: {
15441
- user: {
15442
- type: Object,
15443
- required: true
15444
- }
15445
- },
15446
- setup(__props) {
15447
- const getInitials = (name, email) => {
15448
- if (!name && !email) return;
15449
- const firstLetter = name?.substring(0, 1) || email?.substring(0, 1) || null;
15450
- return firstLetter;
15451
- };
15452
- return (_ctx, _cache) => {
15453
- return vue.openBlock(), vue.createElementBlock("div", _hoisted_1$f, [
15454
- __props.user.image ? (vue.openBlock(), vue.createElementBlock("img", {
15455
- key: 0,
15456
- class: "user-bg",
15457
- src: __props.user.image.startsWith("http") ? __props.user.image : `data:image/png;base64,${__props.user.image}`
15458
- }, null, 8, _hoisted_2$9)) : (vue.openBlock(), vue.createElementBlock("span", _hoisted_3$7, vue.toDisplayString(getInitials(__props.user.name, __props.user.email)), 1))
15459
- ]);
15460
- };
15461
- }
15462
- };
15463
- const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-53e13009"]]);
15668
+ const DEFAULT_UI_FONT_FAMILY = "Arial, Helvetica, sans-serif";
15669
+ function useUiFontFamily() {
15670
+ const instance = vue.getCurrentInstance();
15671
+ const uiFontFamily = vue.computed(() => {
15672
+ const configured = instance?.proxy?.$superdoc?.config?.uiDisplayFallbackFont;
15673
+ if (typeof configured === "string" && configured.trim()) {
15674
+ return configured.trim();
15675
+ }
15676
+ return DEFAULT_UI_FONT_FAMILY;
15677
+ });
15678
+ return {
15679
+ uiFontFamily
15680
+ };
15681
+ }
15464
15682
  const _hoisted_1$e = { class: "comment-option" };
15465
15683
  const _hoisted_2$8 = ["innerHTML"];
15466
15684
  const _hoisted_3$6 = { class: "option-state" };
@@ -15481,6 +15699,7 @@ const _sfc_main$f = {
15481
15699
  setup(__props, { emit: __emit }) {
15482
15700
  const emit = __emit;
15483
15701
  const props = __props;
15702
+ const { uiFontFamily } = useUiFontFamily();
15484
15703
  const renderIcon = (icon) => {
15485
15704
  return () => {
15486
15705
  return vue.h("div", { innerHTML: icon, class: "internal-dropdown__item-icon" });
@@ -15542,7 +15761,8 @@ const _sfc_main$f = {
15542
15761
  trigger: "click",
15543
15762
  options,
15544
15763
  onSelect: _cache[0] || (_cache[0] = ($event) => handleSelect($event)),
15545
- disabled: __props.isDisabled
15764
+ disabled: __props.isDisabled,
15765
+ "content-style": { fontFamily: vue.unref(uiFontFamily) }
15546
15766
  }, {
15547
15767
  default: vue.withCtx(() => [
15548
15768
  vue.createBaseVNode("div", _hoisted_1$e, [
@@ -15558,12 +15778,12 @@ const _sfc_main$f = {
15558
15778
  ])
15559
15779
  ]),
15560
15780
  _: 1
15561
- }, 8, ["disabled"])
15781
+ }, 8, ["disabled", "content-style"])
15562
15782
  ], 4);
15563
15783
  };
15564
15784
  }
15565
15785
  };
15566
- const InternalDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-a88dddd9"]]);
15786
+ const InternalDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-8b9e3b75"]]);
15567
15787
  function formatDate(timestamp) {
15568
15788
  const date = new Date(timestamp);
15569
15789
  const hours = date.getHours();
@@ -15709,6 +15929,7 @@ const _sfc_main$e = {
15709
15929
  const role = proxy.$superdoc.config.role;
15710
15930
  const isInternal = proxy.$superdoc.config.isInternal;
15711
15931
  const isOwnComment = props.comment.creatorEmail === proxy.$superdoc.config.user.email;
15932
+ const { uiFontFamily } = useUiFontFamily();
15712
15933
  const OVERFLOW_OPTIONS = Object.freeze({
15713
15934
  edit: { label: "Edit", key: "edit" },
15714
15935
  delete: { label: "Delete", key: "delete" }
@@ -15812,7 +16033,8 @@ const _sfc_main$e = {
15812
16033
  key: 2,
15813
16034
  trigger: "click",
15814
16035
  options: getOverflowOptions.value,
15815
- onSelect: handleSelect
16036
+ onSelect: handleSelect,
16037
+ "content-style": { fontFamily: vue.unref(uiFontFamily) }
15816
16038
  }, {
15817
16039
  default: vue.withCtx(() => [
15818
16040
  vue.createBaseVNode("div", {
@@ -15827,13 +16049,13 @@ const _sfc_main$e = {
15827
16049
  ])
15828
16050
  ]),
15829
16051
  _: 1
15830
- }, 8, ["options"])) : vue.createCommentVNode("", true)
16052
+ }, 8, ["options", "content-style"])) : vue.createCommentVNode("", true)
15831
16053
  ])
15832
16054
  ]);
15833
16055
  };
15834
16056
  }
15835
16057
  };
15836
- const CommentHeader = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-0f4f53ef"]]);
16058
+ const CommentHeader = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-5e404f08"]]);
15837
16059
  const _hoisted_1$c = { class: "input-section" };
15838
16060
  const _sfc_main$d = {
15839
16061
  __name: "CommentInput",
@@ -16253,7 +16475,7 @@ const _sfc_main$c = {
16253
16475
  };
16254
16476
  }
16255
16477
  };
16256
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-36e5f63e"]]);
16478
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-abfa4e05"]]);
16257
16479
  const _hoisted_1$a = { class: "comments-list" };
16258
16480
  const _hoisted_2$5 = { key: 0 };
16259
16481
  const _hoisted_3$3 = { class: "comment-item" };
@@ -16316,12 +16538,12 @@ class SuperComments extends eventemitter3.EventEmitter {
16316
16538
  element: null,
16317
16539
  commentsStore: null
16318
16540
  };
16319
- constructor(options, superdoc2) {
16541
+ constructor(options, superdoc) {
16320
16542
  super();
16321
16543
  this.config = { ...this.config, ...options };
16322
16544
  this.element = this.config.element;
16323
16545
  this.app = null;
16324
- this.superdoc = superdoc2;
16546
+ this.superdoc = superdoc;
16325
16547
  this.open();
16326
16548
  }
16327
16549
  createVueApp() {
@@ -16550,7 +16772,8 @@ const _sfc_main$9 = {
16550
16772
  measurementTimeoutId.value = null;
16551
16773
  }
16552
16774
  const totalComments = getFloatingComments.value.length;
16553
- if (totalComments === 0) {
16775
+ const measuredComments = renderedSizes.value.length;
16776
+ if (totalComments === 0 || measuredComments === 0) {
16554
16777
  return;
16555
16778
  }
16556
16779
  vue.nextTick(processLocations);
@@ -16631,7 +16854,7 @@ const _sfc_main$9 = {
16631
16854
  };
16632
16855
  }
16633
16856
  };
16634
- 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"]]);
16635
16858
  const _sfc_main$8 = {
16636
16859
  __name: "TextField",
16637
16860
  props: {
@@ -16854,7 +17077,7 @@ const _sfc_main$4 = {
16854
17077
  };
16855
17078
  }
16856
17079
  };
16857
- const SelectField = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b8cacb22"]]);
17080
+ const SelectField = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-1e49d9b3"]]);
16858
17081
  const floor = (val, precision) => {
16859
17082
  const multiplier = 10 ** precision;
16860
17083
  return Math.floor(val * multiplier) / multiplier;
@@ -17259,7 +17482,7 @@ const _sfc_main = {
17259
17482
  __name: "SuperDoc",
17260
17483
  emits: ["selection-update"],
17261
17484
  setup(__props, { emit: __emit }) {
17262
- const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-BtuTHUW7.cjs")));
17485
+ const PdfViewer = vue.defineAsyncComponent(() => Promise.resolve().then(() => require("./PdfViewer-B9LcTIm2.cjs")));
17263
17486
  const superdocStore = useSuperdocStore();
17264
17487
  const commentsStore = useCommentsStore();
17265
17488
  const {
@@ -17299,11 +17522,15 @@ const _sfc_main = {
17299
17522
  const { proxy } = vue.getCurrentInstance();
17300
17523
  commentsStore.proxy = proxy;
17301
17524
  const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
17525
+ const { uiFontFamily } = useUiFontFamily();
17302
17526
  const commentsModuleConfig = vue.computed(() => {
17303
17527
  const config = modules.comments;
17304
17528
  if (config === false || config == null) return null;
17305
17529
  return config;
17306
17530
  });
17531
+ const superdocStyleVars = vue.computed(() => ({
17532
+ "--sd-ui-font-family": uiFontFamily.value
17533
+ }));
17307
17534
  const layers = vue.ref(null);
17308
17535
  const commentsLayer = vue.ref(null);
17309
17536
  const toolsMenuPosition = vue.reactive({ top: null, right: "-25px", zIndex: 101 });
@@ -17820,155 +18047,164 @@ const _sfc_main = {
17820
18047
  });
17821
18048
  return (_ctx, _cache) => {
17822
18049
  const _directive_click_outside = vue.resolveDirective("click-outside");
17823
- return vue.openBlock(), vue.createElementBlock("div", {
17824
- class: vue.normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value, "high-contrast": vue.unref(isHighContrastMode2) }])
17825
- }, [
17826
- vue.createBaseVNode("div", {
17827
- class: "superdoc__layers layers",
17828
- ref_key: "layers",
17829
- ref: layers,
17830
- role: "group"
17831
- }, [
17832
- showToolsFloatingMenu.value ? (vue.openBlock(), vue.createElementBlock("div", {
17833
- key: 0,
17834
- class: "superdoc__tools tools",
17835
- style: vue.normalizeStyle(toolsMenuPosition)
18050
+ return vue.openBlock(), vue.createBlock(vue.unref(NConfigProvider), {
18051
+ abstract: "",
18052
+ "preflight-style-disabled": ""
18053
+ }, {
18054
+ default: vue.withCtx(() => [
18055
+ vue.createBaseVNode("div", {
18056
+ class: vue.normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value, "high-contrast": vue.unref(isHighContrastMode2) }]),
18057
+ style: vue.normalizeStyle(superdocStyleVars.value)
17836
18058
  }, [
17837
18059
  vue.createBaseVNode("div", {
17838
- class: "tools-item",
17839
- "data-id": "is-tool",
17840
- onMousedown: _cache[0] || (_cache[0] = vue.withModifiers(($event) => handleToolClick("comments"), ["stop", "prevent"]))
17841
- }, [
17842
- vue.createBaseVNode("div", {
17843
- class: "superdoc__tools-icon",
17844
- innerHTML: vue.unref(superdocIcons).comment
17845
- }, null, 8, _hoisted_1)
17846
- ], 32),
17847
- vue.unref(proxy).$superdoc.config.modules.ai ? (vue.openBlock(), vue.createElementBlock("div", {
17848
- key: 0,
17849
- class: "tools-item",
17850
- "data-id": "is-tool",
17851
- onMousedown: _cache[1] || (_cache[1] = vue.withModifiers(($event) => handleToolClick("ai"), ["stop", "prevent"]))
17852
- }, [..._cache[3] || (_cache[3] = [
17853
- vue.createBaseVNode("div", { class: "superdoc__tools-icon ai-tool" }, null, -1)
17854
- ])], 32)) : vue.createCommentVNode("", true)
17855
- ], 4)) : vue.createCommentVNode("", true),
17856
- vue.createBaseVNode("div", _hoisted_2, [
17857
- isCommentsEnabled.value ? (vue.openBlock(), vue.createElementBlock("div", {
17858
- key: 0,
17859
- class: "superdoc__selection-layer selection-layer",
17860
- onMousedown: handleSelectionStart,
17861
- onMouseup: handleDragEnd,
17862
- ref_key: "selectionLayer",
17863
- ref: selectionLayer
18060
+ class: "superdoc__layers layers",
18061
+ ref_key: "layers",
18062
+ ref: layers,
18063
+ role: "group"
17864
18064
  }, [
17865
- vue.unref(selectionPosition) && shouldShowSelection.value ? (vue.openBlock(), vue.createElementBlock("div", {
18065
+ showToolsFloatingMenu.value ? (vue.openBlock(), vue.createElementBlock("div", {
17866
18066
  key: 0,
17867
- style: vue.normalizeStyle(getSelectionPosition.value),
17868
- class: "superdoc__temp-selection temp-selection sd-highlight sd-initial-highlight"
17869
- }, null, 4)) : vue.createCommentVNode("", true)
17870
- ], 544)) : vue.createCommentVNode("", true),
17871
- "hrbr-fields" in vue.unref(modules) && layers.value ? (vue.openBlock(), vue.createBlock(HrbrFieldsLayer, {
17872
- key: 1,
17873
- fields: vue.unref(modules)["hrbr-fields"],
17874
- class: "superdoc__comments-layer comments-layer",
17875
- style: { "z-index": "2" },
17876
- ref_key: "hrbrFieldsLayer",
17877
- ref: hrbrFieldsLayer
17878
- }, null, 8, ["fields"])) : vue.createCommentVNode("", true),
17879
- layers.value ? (vue.openBlock(), vue.createBlock(CommentsLayer, {
17880
- key: 2,
17881
- class: "superdoc__comments-layer comments-layer",
17882
- style: { "z-index": "3" },
17883
- ref_key: "commentsLayer",
17884
- ref: commentsLayer,
17885
- parent: layers.value,
17886
- user: vue.unref(user),
17887
- onHighlightClick: handleHighlightClick
17888
- }, null, 8, ["parent", "user"])) : vue.createCommentVNode("", true),
17889
- vue.unref(showAiLayer) ? (vue.openBlock(), vue.createBlock(AiLayer, {
17890
- key: 3,
17891
- class: "ai-layer",
17892
- style: { "z-index": "4" },
17893
- ref_key: "aiLayer",
17894
- ref: aiLayer,
17895
- editor: vue.unref(proxy).$superdoc.activeEditor
17896
- }, null, 8, ["editor"])) : vue.createCommentVNode("", true),
17897
- (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(documents), (doc) => {
17898
- return vue.openBlock(), vue.createElementBlock("div", {
17899
- class: "superdoc__sub-document sub-document",
17900
- key: doc.id
18067
+ class: "superdoc__tools tools",
18068
+ style: vue.normalizeStyle(toolsMenuPosition)
17901
18069
  }, [
17902
- doc.type === vue.unref(PDF) ? (vue.openBlock(), vue.createBlock(vue.unref(PdfViewer), {
18070
+ vue.createBaseVNode("div", {
18071
+ class: "tools-item",
18072
+ "data-id": "is-tool",
18073
+ onMousedown: _cache[0] || (_cache[0] = vue.withModifiers(($event) => handleToolClick("comments"), ["stop", "prevent"]))
18074
+ }, [
18075
+ vue.createBaseVNode("div", {
18076
+ class: "superdoc__tools-icon",
18077
+ innerHTML: vue.unref(superdocIcons).comment
18078
+ }, null, 8, _hoisted_1)
18079
+ ], 32),
18080
+ vue.unref(proxy).$superdoc.config.modules.ai ? (vue.openBlock(), vue.createElementBlock("div", {
18081
+ key: 0,
18082
+ class: "tools-item",
18083
+ "data-id": "is-tool",
18084
+ onMousedown: _cache[1] || (_cache[1] = vue.withModifiers(($event) => handleToolClick("ai"), ["stop", "prevent"]))
18085
+ }, [..._cache[3] || (_cache[3] = [
18086
+ vue.createBaseVNode("div", { class: "superdoc__tools-icon ai-tool" }, null, -1)
18087
+ ])], 32)) : vue.createCommentVNode("", true)
18088
+ ], 4)) : vue.createCommentVNode("", true),
18089
+ vue.createBaseVNode("div", _hoisted_2, [
18090
+ isCommentsEnabled.value ? (vue.openBlock(), vue.createElementBlock("div", {
17903
18091
  key: 0,
17904
- "document-data": doc,
17905
- config: vue.unref(pdfConfig),
17906
- onSelectionChange: handleSelectionChange,
17907
- onReady: handleDocumentReady,
17908
- onPageLoaded: vue.unref(handlePageReady),
17909
- onBypassSelection: handlePdfClick
17910
- }, null, 8, ["document-data", "config", "onPageLoaded"])) : vue.createCommentVNode("", true),
17911
- vue.createVNode(vue.unref(NMessageProvider), null, {
17912
- default: vue.withCtx(() => [
17913
- doc.type === vue.unref(DOCX) ? (vue.openBlock(), vue.createBlock(vue.unref(superEditor_es.SuperEditor), {
18092
+ class: "superdoc__selection-layer selection-layer",
18093
+ onMousedown: handleSelectionStart,
18094
+ onMouseup: handleDragEnd,
18095
+ ref_key: "selectionLayer",
18096
+ ref: selectionLayer
18097
+ }, [
18098
+ vue.unref(selectionPosition) && shouldShowSelection.value ? (vue.openBlock(), vue.createElementBlock("div", {
18099
+ key: 0,
18100
+ style: vue.normalizeStyle(getSelectionPosition.value),
18101
+ class: "superdoc__temp-selection temp-selection sd-highlight sd-initial-highlight"
18102
+ }, null, 4)) : vue.createCommentVNode("", true)
18103
+ ], 544)) : vue.createCommentVNode("", true),
18104
+ "hrbr-fields" in vue.unref(modules) && layers.value ? (vue.openBlock(), vue.createBlock(HrbrFieldsLayer, {
18105
+ key: 1,
18106
+ fields: vue.unref(modules)["hrbr-fields"],
18107
+ class: "superdoc__comments-layer comments-layer",
18108
+ style: { "z-index": "2" },
18109
+ ref_key: "hrbrFieldsLayer",
18110
+ ref: hrbrFieldsLayer
18111
+ }, null, 8, ["fields"])) : vue.createCommentVNode("", true),
18112
+ layers.value ? (vue.openBlock(), vue.createBlock(CommentsLayer, {
18113
+ key: 2,
18114
+ class: "superdoc__comments-layer comments-layer",
18115
+ style: { "z-index": "3" },
18116
+ ref_key: "commentsLayer",
18117
+ ref: commentsLayer,
18118
+ parent: layers.value,
18119
+ user: vue.unref(user),
18120
+ onHighlightClick: handleHighlightClick
18121
+ }, null, 8, ["parent", "user"])) : vue.createCommentVNode("", true),
18122
+ vue.unref(showAiLayer) ? (vue.openBlock(), vue.createBlock(AiLayer, {
18123
+ key: 3,
18124
+ class: "ai-layer",
18125
+ style: { "z-index": "4" },
18126
+ ref_key: "aiLayer",
18127
+ ref: aiLayer,
18128
+ editor: vue.unref(proxy).$superdoc.activeEditor
18129
+ }, null, 8, ["editor"])) : vue.createCommentVNode("", true),
18130
+ (vue.openBlock(true), vue.createElementBlock(vue.Fragment, null, vue.renderList(vue.unref(documents), (doc) => {
18131
+ return vue.openBlock(), vue.createElementBlock("div", {
18132
+ class: "superdoc__sub-document sub-document",
18133
+ key: doc.id
18134
+ }, [
18135
+ doc.type === vue.unref(PDF) ? (vue.openBlock(), vue.createBlock(vue.unref(PdfViewer), {
17914
18136
  key: 0,
18137
+ "document-data": doc,
18138
+ config: vue.unref(pdfConfig),
18139
+ onSelectionChange: handleSelectionChange,
18140
+ onReady: handleDocumentReady,
18141
+ onPageLoaded: vue.unref(handlePageReady),
18142
+ onBypassSelection: handlePdfClick
18143
+ }, null, 8, ["document-data", "config", "onPageLoaded"])) : vue.createCommentVNode("", true),
18144
+ vue.createVNode(vue.unref(NMessageProvider), null, {
18145
+ default: vue.withCtx(() => [
18146
+ doc.type === vue.unref(DOCX) ? (vue.openBlock(), vue.createBlock(vue.unref(superEditor_es.SuperEditor), {
18147
+ key: 0,
18148
+ "file-source": doc.data,
18149
+ state: doc.state,
18150
+ "document-id": doc.id,
18151
+ options: { ...editorOptions(doc), rulers: doc.rulers },
18152
+ onEditorReady,
18153
+ onPageMarginsChange: ($event) => handleSuperEditorPageMarginsChange(doc, $event)
18154
+ }, null, 8, ["file-source", "state", "document-id", "options", "onPageMarginsChange"])) : vue.createCommentVNode("", true)
18155
+ ]),
18156
+ _: 2
18157
+ }, 1024),
18158
+ doc.type === vue.unref(HTML) ? (vue.openBlock(), vue.createBlock(HtmlViewer, {
18159
+ key: 1,
18160
+ onReady: _cache[2] || (_cache[2] = (id) => handleDocumentReady(id, null)),
18161
+ onSelectionChange: handleSelectionChange,
17915
18162
  "file-source": doc.data,
17916
- state: doc.state,
17917
- "document-id": doc.id,
17918
- options: { ...editorOptions(doc), rulers: doc.rulers },
17919
- onEditorReady,
17920
- onPageMarginsChange: ($event) => handleSuperEditorPageMarginsChange(doc, $event)
17921
- }, null, 8, ["file-source", "state", "document-id", "options", "onPageMarginsChange"])) : vue.createCommentVNode("", true)
17922
- ]),
17923
- _: 2
17924
- }, 1024),
17925
- doc.type === vue.unref(HTML) ? (vue.openBlock(), vue.createBlock(HtmlViewer, {
17926
- key: 1,
17927
- onReady: _cache[2] || (_cache[2] = (id) => handleDocumentReady(id, null)),
17928
- onSelectionChange: handleSelectionChange,
17929
- "file-source": doc.data,
17930
- "document-id": doc.id
17931
- }, null, 8, ["file-source", "document-id"])) : vue.createCommentVNode("", true)
17932
- ]);
17933
- }), 128))
17934
- ])
17935
- ], 512),
17936
- showCommentsSidebar.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
17937
- vue.unref(pendingComment) ? vue.withDirectives((vue.openBlock(), vue.createBlock(CommentDialog, {
17938
- key: 0,
17939
- comment: vue.unref(pendingComment),
17940
- "auto-focus": true,
17941
- "is-floating": true
17942
- }, null, 8, ["comment"])), [
17943
- [_directive_click_outside, cancelPendingComment]
17944
- ]) : vue.createCommentVNode("", true),
17945
- vue.createBaseVNode("div", _hoisted_4, [
17946
- vue.unref(hasInitializedLocations) && vue.unref(getFloatingComments).length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(documentsWithConverations), (doc) => {
17947
- return vue.openBlock(), vue.createBlock(FloatingComments, {
17948
- parent: layers.value,
17949
- "current-document": doc
17950
- }, null, 8, ["parent", "current-document"]);
17951
- }), 256)) : vue.createCommentVNode("", true)
17952
- ])
17953
- ])) : vue.createCommentVNode("", true),
17954
- vue.unref(showAiWriter) ? (vue.openBlock(), vue.createElementBlock("div", {
17955
- key: 1,
17956
- class: "ai-writer-container",
17957
- style: vue.normalizeStyle(vue.unref(aiWriterPosition))
17958
- }, [
17959
- vue.createVNode(vue.unref(superEditor_es.AIWriter), {
17960
- "selected-text": vue.unref(selectedText),
17961
- "handle-close": vue.unref(handleAiWriterClose),
17962
- editor: vue.unref(proxy).$superdoc.activeEditor,
17963
- "api-key": vue.unref(proxy).$superdoc.toolbar?.config?.aiApiKey,
17964
- endpoint: vue.unref(proxy).$superdoc.config?.modules?.ai?.endpoint
17965
- }, null, 8, ["selected-text", "handle-close", "editor", "api-key", "endpoint"])
17966
- ], 4)) : vue.createCommentVNode("", true)
17967
- ], 2);
18163
+ "document-id": doc.id
18164
+ }, null, 8, ["file-source", "document-id"])) : vue.createCommentVNode("", true)
18165
+ ]);
18166
+ }), 128))
18167
+ ])
18168
+ ], 512),
18169
+ showCommentsSidebar.value ? (vue.openBlock(), vue.createElementBlock("div", _hoisted_3, [
18170
+ vue.unref(pendingComment) ? vue.withDirectives((vue.openBlock(), vue.createBlock(CommentDialog, {
18171
+ key: 0,
18172
+ comment: vue.unref(pendingComment),
18173
+ "auto-focus": true,
18174
+ "is-floating": true
18175
+ }, null, 8, ["comment"])), [
18176
+ [_directive_click_outside, cancelPendingComment]
18177
+ ]) : vue.createCommentVNode("", true),
18178
+ vue.createBaseVNode("div", _hoisted_4, [
18179
+ vue.unref(hasInitializedLocations) && vue.unref(getFloatingComments).length > 0 ? (vue.openBlock(true), vue.createElementBlock(vue.Fragment, { key: 0 }, vue.renderList(vue.unref(documentsWithConverations), (doc) => {
18180
+ return vue.openBlock(), vue.createBlock(FloatingComments, {
18181
+ parent: layers.value,
18182
+ "current-document": doc
18183
+ }, null, 8, ["parent", "current-document"]);
18184
+ }), 256)) : vue.createCommentVNode("", true)
18185
+ ])
18186
+ ])) : vue.createCommentVNode("", true),
18187
+ vue.unref(showAiWriter) ? (vue.openBlock(), vue.createElementBlock("div", {
18188
+ key: 1,
18189
+ class: "ai-writer-container",
18190
+ style: vue.normalizeStyle(vue.unref(aiWriterPosition))
18191
+ }, [
18192
+ vue.createVNode(vue.unref(superEditor_es.AIWriter), {
18193
+ "selected-text": vue.unref(selectedText),
18194
+ "handle-close": vue.unref(handleAiWriterClose),
18195
+ editor: vue.unref(proxy).$superdoc.activeEditor,
18196
+ "api-key": vue.unref(proxy).$superdoc.toolbar?.config?.aiApiKey,
18197
+ endpoint: vue.unref(proxy).$superdoc.config?.modules?.ai?.endpoint
18198
+ }, null, 8, ["selected-text", "handle-close", "editor", "api-key", "endpoint"])
18199
+ ], 4)) : vue.createCommentVNode("", true)
18200
+ ], 6)
18201
+ ]),
18202
+ _: 1
18203
+ });
17968
18204
  };
17969
18205
  }
17970
18206
  };
17971
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e229774d"]]);
18207
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-309688b3"]]);
17972
18208
  const createSuperdocVueApp = () => {
17973
18209
  const app = vue.createApp(App);
17974
18210
  const pinia = createPinia();
@@ -18078,6 +18314,8 @@ class SuperDoc extends eventemitter3.EventEmitter {
18078
18314
  toolbarGroups: ["left", "center", "right"],
18079
18315
  toolbarIcons: {},
18080
18316
  toolbarTexts: {},
18317
+ // UI font for SuperDoc surfaces (toolbar, comments UI, etc.)
18318
+ uiDisplayFallbackFont: "Arial, Helvetica, sans-serif",
18081
18319
  isDev: false,
18082
18320
  // telemetry config
18083
18321
  telemetry: null,
@@ -18148,7 +18386,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18148
18386
  this.config.colors = shuffleArray(this.config.colors);
18149
18387
  this.userColorMap = /* @__PURE__ */ new Map();
18150
18388
  this.colorIndex = 0;
18151
- this.version = "1.0.0-beta.99";
18389
+ this.version = "1.0.0-next.10";
18152
18390
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18153
18391
  this.superdocId = config.superdocId || uuid.v4();
18154
18392
  this.colors = this.config.colors;
@@ -18507,6 +18745,7 @@ class SuperDoc extends eventemitter3.EventEmitter {
18507
18745
  superdoc: this,
18508
18746
  aiApiKey: this.config.modules?.ai?.apiKey,
18509
18747
  aiEndpoint: this.config.modules?.ai?.endpoint,
18748
+ uiDisplayFallbackFont: this.config.uiDisplayFallbackFont,
18510
18749
  ...moduleConfig,
18511
18750
  excludeItems
18512
18751
  // Override moduleConfig.excludeItems with our computed list