@harbour-enterprises/superdoc 1.0.0-next.1 → 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-Cu04k0JZ.cjs → PdfViewer-B9LcTIm2.cjs} +1 -1
  2. package/dist/chunks/{PdfViewer-BKujh9gl.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-Cl0tjE1C.es.js → index-1n6qegaQ.es.js} +564 -325
  5. package/dist/chunks/{index-CZ4149Px.cjs → index-4FiyZ-0E.cjs} +561 -322
  6. package/dist/chunks/{index-Dlj3l0Hk-BuYH_UIe.es.js → index-DdTDm9oI-BXzE00pk.es.js} +1 -1
  7. package/dist/chunks/{index-Dlj3l0Hk-CJ0YBOja.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-CjRtsxTt.cjs → super-editor.es-BQQuazyp.cjs} +28653 -25964
  10. package/dist/chunks/{super-editor.es-D0WByw5h.es.js → super-editor.es-DKr759cY.es.js} +28654 -25965
  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-BS4FD8AG.js → converter-BavE2jnW.js} +1 -1
  25. package/dist/super-editor/chunks/{docx-zipper-DpiCpt0d.js → docx-zipper-CY4M19qa.js} +1 -1
  26. package/dist/super-editor/chunks/{editor-BeacbTQe.js → editor-Cslr04KI.js} +28125 -26039
  27. package/dist/super-editor/chunks/{index-Dlj3l0Hk.js → index-DdTDm9oI.js} +1 -1
  28. package/dist/super-editor/chunks/{toolbar-BNQDvBCn.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 +44 -19
  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 +29300 -26372
  41. package/dist/superdoc.umd.js.map +1 -1
  42. package/package.json +1 -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,11 +1,11 @@
1
- import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-D0WByw5h.es.js";
1
+ import { q as index, C as CommentsPluginKey, h as TrackChangesBasePluginKey, E as Editor, n as getRichTextExtensions, f as SuperInput, P as PresentationEditor, e as SuperEditor, A as AIWriter, g as SuperToolbar, i as createZip } from "./super-editor.es-DKr759cY.es.js";
2
2
  import { B as BlankDOCX } from "./blank-docx-ABm6XYAA.es.js";
3
- import { E as EventEmitter } from "./eventemitter3-CcXAdeql.es.js";
3
+ import { E as EventEmitter } from "./eventemitter3-44XulWQe.es.js";
4
4
  import { HocuspocusProvider, HocuspocusProviderWebsocket } from "@hocuspocus/provider";
5
- import { a1 as effectScope, r as ref, X as markRaw, a0 as process$1, a2 as toRaw, a as computed, a3 as isRef, a4 as isReactive, E as toRef, i as inject, m as getCurrentInstance, l as watch, v as unref, a5 as hasInjectionContext, M as reactive, q as nextTick, a6 as getCurrentScope, a7 as onScopeDispose, a8 as toRefs, g as global$1, B as shallowRef, N as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, S as onActivated, p as onDeactivated, D as createTextVNode, F as Fragment, Q as Comment, y as defineComponent, G as provide, I as withDirectives, z as h, U as Teleport, R as renderSlot, V as isVNode, J as watchEffect, O as Transition, a9 as TransitionGroup, A as mergeProps, P as vShow, H as cloneVNode, T as Text, b as createElementBlock, o as openBlock, t as toDisplayString, u as createVNode, C as withCtx, f as createBaseVNode, x as normalizeStyle, e as createCommentVNode, s as createBlock, w as withModifiers, n as normalizeClass, aa as resolveDirective, d as renderList, c as createApp, Y as resolveDynamicComponent, ab as defineAsyncComponent } from "./vue-Dysv_7z5.es.js";
5
+ import { a1 as effectScope, r as ref, D as markRaw, a0 as process$1, a2 as toRaw, a as computed, a3 as isRef, a4 as isReactive, H as toRef, i as inject, m as getCurrentInstance, l as watch, x as unref, a5 as hasInjectionContext, N as reactive, q as nextTick, a6 as getCurrentScope, a7 as onScopeDispose, a8 as toRefs, g as global$1, C as shallowRef, b as createElementBlock, o as openBlock, t as toDisplayString, O as readonly, j as onMounted, k as onBeforeUnmount, h as onBeforeMount, U as onActivated, p as onDeactivated, G as createTextVNode, F as Fragment, R as Comment, y as defineComponent, E as provide, J as withDirectives, A as h, V as Teleport, S as renderSlot, W as isVNode, K as watchEffect, P as Transition, a9 as TransitionGroup, B as mergeProps, Q as vShow, I as cloneVNode, T as Text, s as createVNode, u as withCtx, f as createBaseVNode, z as normalizeStyle, e as createCommentVNode, v as createBlock, w as withModifiers, n as normalizeClass, aa as resolveDirective, d as renderList, c as createApp, Y as resolveDynamicComponent, ab as defineAsyncComponent } from "./vue-BuPTonTJ.es.js";
6
6
  import * as Y from "yjs";
7
7
  import { Doc, Map as Map$2 } from "yjs";
8
- import { B as Buffer$2 } from "./jszip-5vvIqAEE.es.js";
8
+ import { B as Buffer$2 } from "./jszip-VP334ufO.es.js";
9
9
  import { v as v4 } from "./uuid-CjlX8hrF.es.js";
10
10
  const DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.document";
11
11
  const PDF = "application/pdf";
@@ -3310,17 +3310,17 @@ function setupAwarenessHandler(provider, superdocInstance, user) {
3310
3310
  });
3311
3311
  });
3312
3312
  }
3313
- const addYComment = (yArray, ydoc, event) => {
3313
+ const addYComment = (yArray, ydoc, event, user) => {
3314
3314
  const { comment } = event;
3315
3315
  const yComment = new Map$2(Object.entries(comment));
3316
3316
  ydoc.transact(
3317
3317
  () => {
3318
3318
  yArray.push([yComment]);
3319
3319
  },
3320
- { user: superdoc.user }
3320
+ { user }
3321
3321
  );
3322
3322
  };
3323
- const updateYComment = (yArray, ydoc, event) => {
3323
+ const updateYComment = (yArray, ydoc, event, user) => {
3324
3324
  const { comment } = event;
3325
3325
  const yComment = new Map$2(Object.entries(comment));
3326
3326
  const commentIndex = getCommentIndex(yArray, comment);
@@ -3330,10 +3330,10 @@ const updateYComment = (yArray, ydoc, event) => {
3330
3330
  yArray.delete(commentIndex, 1);
3331
3331
  yArray.insert(commentIndex, [yComment]);
3332
3332
  },
3333
- { user: superdoc.user }
3333
+ { user }
3334
3334
  );
3335
3335
  };
3336
- const deleteYComment = (yArray, ydoc, event) => {
3336
+ const deleteYComment = (yArray, ydoc, event, user) => {
3337
3337
  const { comment } = event;
3338
3338
  const commentIndex = getCommentIndex(yArray, comment);
3339
3339
  if (commentIndex === -1) return;
@@ -3341,26 +3341,26 @@ const deleteYComment = (yArray, ydoc, event) => {
3341
3341
  () => {
3342
3342
  yArray.delete(commentIndex, 1);
3343
3343
  },
3344
- { user: superdoc.user }
3344
+ { user }
3345
3345
  );
3346
3346
  };
3347
3347
  const getCommentIndex = (yArray, comment) => {
3348
3348
  const baseArray = yArray.toJSON();
3349
3349
  return baseArray.findIndex((c2) => c2.commentId === comment.commentId);
3350
3350
  };
3351
- const initCollaborationComments = (superdoc2) => {
3352
- if (!superdoc2.config.modules.comments || !superdoc2.provider) return;
3351
+ const initCollaborationComments = (superdoc) => {
3352
+ if (!superdoc.config.modules.comments || !superdoc.provider) return;
3353
3353
  const onSuperDocYdocSynced = () => {
3354
- const parent = superdoc2.commentsStore.commentsParentElement;
3355
- const ids = superdoc2.commentsStore.editorCommentIds;
3356
- superdoc2.commentsStore.handleEditorLocationsUpdate(parent, ids);
3357
- superdoc2.commentsStore.hasSyncedCollaborationComments = true;
3358
- superdoc2.provider.off("synced", onSuperDocYdocSynced);
3354
+ const parent = superdoc.commentsStore.commentsParentElement;
3355
+ const ids = superdoc.commentsStore.editorCommentIds;
3356
+ superdoc.commentsStore.handleEditorLocationsUpdate(parent, ids);
3357
+ superdoc.commentsStore.hasSyncedCollaborationComments = true;
3358
+ superdoc.provider.off("synced", onSuperDocYdocSynced);
3359
3359
  };
3360
- superdoc2.provider.on("synced", onSuperDocYdocSynced);
3361
- const commentsArray = superdoc2.ydoc.getArray("comments");
3360
+ superdoc.provider.on("synced", onSuperDocYdocSynced);
3361
+ const commentsArray = superdoc.ydoc.getArray("comments");
3362
3362
  commentsArray.observe((event) => {
3363
- const currentUser = superdoc2.config.user;
3363
+ const currentUser = superdoc.config.user;
3364
3364
  const { user = {} } = event.transaction.origin;
3365
3365
  if (currentUser.name === user.name && currentUser.email === user.email) return;
3366
3366
  const comments = commentsArray.toJSON();
@@ -3372,59 +3372,60 @@ const initCollaborationComments = (superdoc2) => {
3372
3372
  filtered.push(c2);
3373
3373
  }
3374
3374
  });
3375
- superdoc2.commentsStore.commentsList = filtered.map((c2) => useComment(c2));
3375
+ superdoc.commentsStore.commentsList = filtered.map((c2) => useComment(c2));
3376
3376
  });
3377
3377
  };
3378
- const initSuperdocYdoc = (superdoc2) => {
3379
- const { isInternal } = superdoc2.config;
3380
- const baseName = `${superdoc2.config.superdocId}-superdoc`;
3381
- if (!superdoc2.config.superdocId) return;
3378
+ const initSuperdocYdoc = (superdoc) => {
3379
+ const { isInternal } = superdoc.config;
3380
+ const baseName = `${superdoc.config.superdocId}-superdoc`;
3381
+ if (!superdoc.config.superdocId) return;
3382
3382
  const documentId = isInternal ? baseName : `${baseName}-external`;
3383
3383
  const superdocCollaborationOptions = {
3384
- config: superdoc2.config.modules.collaboration,
3385
- user: superdoc2.config.user,
3384
+ config: superdoc.config.modules.collaboration,
3385
+ user: superdoc.config.user,
3386
3386
  documentId,
3387
- socket: superdoc2.config.socket,
3388
- superdocInstance: superdoc2
3387
+ socket: superdoc.config.socket,
3388
+ superdocInstance: superdoc
3389
3389
  };
3390
3390
  const { provider: superdocProvider, ydoc: superdocYdoc } = createProvider(superdocCollaborationOptions);
3391
3391
  return { ydoc: superdocYdoc, provider: superdocProvider };
3392
3392
  };
3393
- const makeDocumentsCollaborative = (superdoc2) => {
3393
+ const makeDocumentsCollaborative = (superdoc) => {
3394
3394
  const processedDocuments = [];
3395
- superdoc2.config.documents.forEach((doc) => {
3396
- superdoc2.config.user.color = superdoc2.colors[0];
3395
+ superdoc.config.documents.forEach((doc) => {
3396
+ superdoc.config.user.color = superdoc.colors[0];
3397
3397
  const options = {
3398
- config: superdoc2.config.modules.collaboration,
3399
- user: superdoc2.config.user,
3398
+ config: superdoc.config.modules.collaboration,
3399
+ user: superdoc.config.user,
3400
3400
  documentId: doc.id,
3401
- socket: superdoc2.config.socket,
3402
- superdocInstance: superdoc2
3401
+ socket: superdoc.config.socket,
3402
+ superdocInstance: superdoc
3403
3403
  };
3404
3404
  const { provider, ydoc } = createProvider(options);
3405
3405
  doc.provider = provider;
3406
- doc.socket = superdoc2.config.socket;
3406
+ doc.socket = superdoc.config.socket;
3407
3407
  doc.ydoc = ydoc;
3408
- doc.role = superdoc2.config.role;
3408
+ doc.role = superdoc.config.role;
3409
3409
  processedDocuments.push(doc);
3410
3410
  });
3411
3411
  return processedDocuments;
3412
3412
  };
3413
- const syncCommentsToClients = (superdoc2, event) => {
3414
- if (!superdoc2.isCollaborative || !superdoc2.config.modules.comments) return;
3415
- const yArray = superdoc2.ydoc.getArray("comments");
3413
+ const syncCommentsToClients = (superdoc, event) => {
3414
+ if (!superdoc.isCollaborative || !superdoc.config.modules.comments) return;
3415
+ const yArray = superdoc.ydoc.getArray("comments");
3416
+ const user = superdoc.config.user;
3416
3417
  switch (event.type) {
3417
3418
  case "add":
3418
- addYComment(yArray, superdoc2.ydoc, event);
3419
+ addYComment(yArray, superdoc.ydoc, event, user);
3419
3420
  break;
3420
3421
  case "update":
3421
- updateYComment(yArray, superdoc2.ydoc, event);
3422
+ updateYComment(yArray, superdoc.ydoc, event, user);
3422
3423
  break;
3423
3424
  case "resolved":
3424
- updateYComment(yArray, superdoc2.ydoc, event);
3425
+ updateYComment(yArray, superdoc.ydoc, event, user);
3425
3426
  break;
3426
3427
  case "deleted":
3427
- deleteYComment(yArray, superdoc2.ydoc, event);
3428
+ deleteYComment(yArray, superdoc.ydoc, event, user);
3428
3429
  break;
3429
3430
  }
3430
3431
  };
@@ -3499,22 +3500,22 @@ function useComment(params2) {
3499
3500
  const resolvedTime = ref(params2.resolvedTime || null);
3500
3501
  const resolvedByEmail = ref(params2.resolvedByEmail || null);
3501
3502
  const resolvedByName = ref(params2.resolvedByName || null);
3502
- const resolveComment = ({ email, name, superdoc: superdoc2 }) => {
3503
+ const resolveComment = ({ email, name, superdoc }) => {
3503
3504
  if (resolvedTime.value) return;
3504
3505
  resolvedTime.value = Date.now();
3505
3506
  resolvedByEmail.value = email;
3506
3507
  resolvedByName.value = name;
3507
3508
  if (trackedChange.value) {
3508
3509
  const emitData2 = { type: comments_module_events.RESOLVED, comment: getValues() };
3509
- propagateUpdate(superdoc2, emitData2);
3510
- superdoc2.activeEditor?.commands?.resolveComment({ commentId, importedId });
3510
+ propagateUpdate(superdoc, emitData2);
3511
+ superdoc.activeEditor?.commands?.resolveComment({ commentId, importedId });
3511
3512
  return;
3512
3513
  }
3513
3514
  const emitData = { type: comments_module_events.RESOLVED, comment: getValues() };
3514
- propagateUpdate(superdoc2, emitData);
3515
- superdoc2.activeEditor?.commands?.resolveComment({ commentId, importedId });
3515
+ propagateUpdate(superdoc, emitData);
3516
+ superdoc.activeEditor?.commands?.resolveComment({ commentId, importedId });
3516
3517
  };
3517
- const setIsInternal = ({ isInternal: newIsInternal, superdoc: superdoc2 }) => {
3518
+ const setIsInternal = ({ isInternal: newIsInternal, superdoc }) => {
3518
3519
  const previousValue = isInternal.value;
3519
3520
  if (previousValue === newIsInternal) return;
3520
3521
  isInternal.value = newIsInternal;
@@ -3523,16 +3524,16 @@ function useComment(params2) {
3523
3524
  changes: [{ key: "isInternal", value: newIsInternal, previousValue }],
3524
3525
  comment: getValues()
3525
3526
  };
3526
- propagateUpdate(superdoc2, emitData);
3527
- const activeEditor = superdoc2.activeEditor;
3527
+ propagateUpdate(superdoc, emitData);
3528
+ const activeEditor = superdoc.activeEditor;
3528
3529
  if (!activeEditor) return;
3529
3530
  activeEditor.commands.setCommentInternal({ commentId, importedId, isInternal: newIsInternal });
3530
3531
  };
3531
- const setActive = (superdoc2) => {
3532
- const { activeEditor } = superdoc2;
3532
+ const setActive = (superdoc) => {
3533
+ const { activeEditor } = superdoc;
3533
3534
  activeEditor?.commands.setActiveComment({ commentId, importedId });
3534
3535
  };
3535
- const setText = ({ text, superdoc: superdoc2, suppressUpdate }) => {
3536
+ const setText = ({ text, superdoc, suppressUpdate }) => {
3536
3537
  commentText.value = text;
3537
3538
  mentions.value = extractMentions(text);
3538
3539
  if (suppressUpdate) return;
@@ -3541,7 +3542,7 @@ function useComment(params2) {
3541
3542
  changes: [{ key: "text", value: text }],
3542
3543
  comment: getValues()
3543
3544
  };
3544
- propagateUpdate(superdoc2, emitData);
3545
+ propagateUpdate(superdoc, emitData);
3545
3546
  };
3546
3547
  const extractMentions = (htmlString) => {
3547
3548
  const parser = new DOMParser();
@@ -3578,9 +3579,9 @@ function useComment(params2) {
3578
3579
  const user = importedAuthor.value ? { name: importedAuthor.value.name || "(Imported)", email: importedAuthor.value.email } : { name: creatorName, email: creatorEmail, image: creatorImage };
3579
3580
  return user;
3580
3581
  };
3581
- const propagateUpdate = (superdoc2, event) => {
3582
- superdoc2.emit("comments-update", event);
3583
- syncCommentsToClients(superdoc2, event);
3582
+ const propagateUpdate = (superdoc, event) => {
3583
+ superdoc.emit("comments-update", event);
3584
+ syncCommentsToClients(superdoc, event);
3584
3585
  };
3585
3586
  const getValues = () => {
3586
3587
  return {
@@ -4005,21 +4006,21 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4005
4006
  if (id === void 0 || id === null) return null;
4006
4007
  return commentsList.value.find((c2) => c2.commentId == id || c2.importedId == id);
4007
4008
  };
4008
- const setActiveComment = (superdoc2, id) => {
4009
+ const setActiveComment = (superdoc, id) => {
4009
4010
  if (id === void 0 || id === null) {
4010
4011
  activeComment.value = null;
4011
- if (superdoc2.activeEditor) {
4012
- superdoc2.activeEditor.commands?.setActiveComment({ commentId: null });
4012
+ if (superdoc.activeEditor) {
4013
+ superdoc.activeEditor.commands?.setActiveComment({ commentId: null });
4013
4014
  }
4014
4015
  return;
4015
4016
  }
4016
4017
  const comment = getComment(id);
4017
4018
  if (comment) activeComment.value = comment.commentId;
4018
- if (superdoc2.activeEditor) {
4019
- superdoc2.activeEditor.commands?.setActiveComment({ commentId: activeComment.value });
4019
+ if (superdoc.activeEditor) {
4020
+ superdoc.activeEditor.commands?.setActiveComment({ commentId: activeComment.value });
4020
4021
  }
4021
4022
  };
4022
- const handleTrackedChangeUpdate = ({ superdoc: superdoc2, params: params2 }) => {
4023
+ const handleTrackedChangeUpdate = ({ superdoc, params: params2 }) => {
4023
4024
  const {
4024
4025
  event,
4025
4026
  changeId,
@@ -4052,7 +4053,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4052
4053
  }
4053
4054
  });
4054
4055
  if (event === "add") {
4055
- addComment({ superdoc: superdoc2, comment });
4056
+ addComment({ superdoc, comment });
4056
4057
  } else if (event === "update") {
4057
4058
  const existingTrackedChange = commentsList.value.find((comment2) => comment2.commentId === changeId);
4058
4059
  if (!existingTrackedChange) return;
@@ -4064,33 +4065,33 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4064
4065
  type: COMMENT_EVENTS.UPDATE,
4065
4066
  comment: existingTrackedChange.getValues()
4066
4067
  };
4067
- syncCommentsToClients(superdoc2, emitData);
4068
- debounceEmit(changeId, emitData, superdoc2);
4068
+ syncCommentsToClients(superdoc, emitData);
4069
+ debounceEmit(changeId, emitData, superdoc);
4069
4070
  }
4070
4071
  };
4071
- const debounceEmit = (commentId, event, superdoc2, delay = 1e3) => {
4072
+ const debounceEmit = (commentId, event, superdoc, delay = 1e3) => {
4072
4073
  if (debounceTimers[commentId]) {
4073
4074
  clearTimeout(debounceTimers[commentId]);
4074
4075
  }
4075
4076
  debounceTimers[commentId] = setTimeout(() => {
4076
- if (superdoc2) {
4077
- superdoc2.emit("comments-update", event);
4077
+ if (superdoc) {
4078
+ superdoc.emit("comments-update", event);
4078
4079
  }
4079
4080
  delete debounceTimers[commentId];
4080
4081
  }, delay);
4081
4082
  };
4082
- const showAddComment = (superdoc2) => {
4083
+ const showAddComment = (superdoc) => {
4083
4084
  const event = { type: COMMENT_EVENTS.PENDING };
4084
- superdoc2.emit("comments-update", event);
4085
+ superdoc.emit("comments-update", event);
4085
4086
  const selection = { ...superdocStore.activeSelection };
4086
4087
  selection.selectionBounds = { ...selection.selectionBounds };
4087
4088
  if (superdocStore.selectionPosition?.source) {
4088
4089
  superdocStore.selectionPosition.source = null;
4089
4090
  }
4090
4091
  pendingComment.value = getPendingComment({ selection, documentId: selection.documentId, parentCommentId: null });
4091
- if (!superdoc2.config.isInternal) pendingComment.value.isInternal = false;
4092
- if (superdoc2.activeEditor?.commands) {
4093
- superdoc2.activeEditor.commands.insertComment({
4092
+ if (!superdoc.config.isInternal) pendingComment.value.isInternal = false;
4093
+ if (superdoc.activeEditor?.commands) {
4094
+ superdoc.activeEditor.commands.insertComment({
4094
4095
  ...pendingComment.value.getValues(),
4095
4096
  commentId: "pending",
4096
4097
  skipEmit: true
@@ -4160,14 +4161,14 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4160
4161
  ...options
4161
4162
  });
4162
4163
  };
4163
- const removePendingComment = (superdoc2) => {
4164
+ const removePendingComment = (superdoc) => {
4164
4165
  currentCommentText.value = "";
4165
4166
  pendingComment.value = null;
4166
4167
  activeComment.value = null;
4167
4168
  superdocStore.selectionPosition = null;
4168
- superdoc2.activeEditor?.commands.removeComment({ commentId: "pending" });
4169
+ superdoc.activeEditor?.commands.removeComment({ commentId: "pending" });
4169
4170
  };
4170
- const addComment = ({ superdoc: superdoc2, comment, skipEditorUpdate = false }) => {
4171
+ const addComment = ({ superdoc, comment, skipEditorUpdate = false }) => {
4171
4172
  let parentComment = commentsList.value.find((c2) => c2.commentId === activeComment.value);
4172
4173
  if (!parentComment) parentComment = comment;
4173
4174
  const newComment = useComment(comment.getValues());
@@ -4178,22 +4179,22 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4178
4179
  const isParentInternal = parentComment.isInternal;
4179
4180
  newComment.isInternal = isParentInternal;
4180
4181
  }
4181
- if (!superdoc2.config.isInternal) newComment.isInternal = false;
4182
+ if (!superdoc.config.isInternal) newComment.isInternal = false;
4182
4183
  commentsList.value.push(newComment);
4183
- removePendingComment(superdoc2);
4184
- if (!skipEditorUpdate && !comment.trackedChange && superdoc2.activeEditor?.commands && !comment.parentCommentId) {
4185
- superdoc2.activeEditor.commands.insertComment({ ...newComment.getValues(), skipEmit: true });
4184
+ removePendingComment(superdoc);
4185
+ if (!skipEditorUpdate && !comment.trackedChange && superdoc.activeEditor?.commands && !comment.parentCommentId) {
4186
+ superdoc.activeEditor.commands.insertComment({ ...newComment.getValues(), skipEmit: true });
4186
4187
  }
4187
4188
  const event = { type: COMMENT_EVENTS.ADD, comment: newComment.getValues() };
4188
- syncCommentsToClients(superdoc2, event);
4189
- superdoc2.emit("comments-update", event);
4189
+ syncCommentsToClients(superdoc, event);
4190
+ superdoc.emit("comments-update", event);
4190
4191
  };
4191
- const deleteComment = ({ commentId: commentIdToDelete, superdoc: superdoc2 }) => {
4192
+ const deleteComment = ({ commentId: commentIdToDelete, superdoc }) => {
4192
4193
  const commentIndex = commentsList.value.findIndex((c2) => c2.commentId === commentIdToDelete);
4193
4194
  const comment = commentsList.value[commentIndex];
4194
4195
  const { commentId, importedId } = comment;
4195
4196
  const { fileId } = comment;
4196
- superdoc2.activeEditor?.commands?.removeComment({ commentId, importedId });
4197
+ superdoc.activeEditor?.commands?.removeComment({ commentId, importedId });
4197
4198
  commentsList.value.splice(commentIndex, 1);
4198
4199
  const childCommentIds = commentsList.value.filter((c2) => c2.parentCommentId === commentId).map((c2) => c2.commentId || c2.importedId);
4199
4200
  commentsList.value = commentsList.value.filter((c2) => !childCommentIds.includes(c2.commentId));
@@ -4202,13 +4203,13 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4202
4203
  comment: comment.getValues(),
4203
4204
  changes: [{ key: "deleted", commentId, fileId }]
4204
4205
  };
4205
- superdoc2.emit("comments-update", event);
4206
- syncCommentsToClients(superdoc2, event);
4206
+ superdoc.emit("comments-update", event);
4207
+ syncCommentsToClients(superdoc, event);
4207
4208
  };
4208
- const cancelComment = (superdoc2) => {
4209
- removePendingComment(superdoc2);
4209
+ const cancelComment = (superdoc) => {
4210
+ removePendingComment(superdoc);
4210
4211
  };
4211
- const processLoadedDocxComments = async ({ superdoc: superdoc2, editor, comments, documentId }) => {
4212
+ const processLoadedDocxComments = async ({ superdoc, editor, comments, documentId }) => {
4212
4213
  const document2 = superdocStore.getDocument(documentId);
4213
4214
  comments.forEach((comment) => {
4214
4215
  const htmlContent = getHtmlFromComment(comment.textJson);
@@ -4240,7 +4241,7 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4240
4241
  trackedChangeType: comment.trackedChangeType,
4241
4242
  deletedText: comment.trackedDeletedText
4242
4243
  });
4243
- addComment({ superdoc: superdoc2, comment: newComment });
4244
+ addComment({ superdoc, comment: newComment });
4244
4245
  });
4245
4246
  setTimeout(() => {
4246
4247
  createCommentForTrackChanges(editor);
@@ -4408,6 +4409,62 @@ const useCommentsStore = /* @__PURE__ */ defineStore("comments", () => {
4408
4409
  handleTrackedChangeUpdate
4409
4410
  };
4410
4411
  });
4412
+ 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>';
4413
+ 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>';
4414
+ 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>';
4415
+ 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>';
4416
+ 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>';
4417
+ 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>';
4418
+ 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>';
4419
+ const superdocIcons = {
4420
+ comment: commentIconSvg,
4421
+ caretDown: caretDownIconSvg,
4422
+ internal: userCheckIconSvg,
4423
+ external: usersIconSvg,
4424
+ markDone: checkIconSvg,
4425
+ acceptChange: checkIconSvg,
4426
+ rejectChange: xmarkIconSvg,
4427
+ overflow: ellipsisVerticalSvg
4428
+ };
4429
+ const _export_sfc = (sfc, props) => {
4430
+ const target = sfc.__vccOpts || sfc;
4431
+ for (const [key, val] of props) {
4432
+ target[key] = val;
4433
+ }
4434
+ return target;
4435
+ };
4436
+ const _hoisted_1$f = { class: "user-container" };
4437
+ const _hoisted_2$9 = ["src"];
4438
+ const _hoisted_3$7 = {
4439
+ key: 1,
4440
+ class: "user-bg"
4441
+ };
4442
+ const _sfc_main$g = {
4443
+ __name: "Avatar",
4444
+ props: {
4445
+ user: {
4446
+ type: Object,
4447
+ required: true
4448
+ }
4449
+ },
4450
+ setup(__props) {
4451
+ const getInitials = (name, email) => {
4452
+ if (!name && !email) return;
4453
+ const firstLetter = name?.substring(0, 1) || email?.substring(0, 1) || null;
4454
+ return firstLetter;
4455
+ };
4456
+ return (_ctx, _cache) => {
4457
+ return openBlock(), createElementBlock("div", _hoisted_1$f, [
4458
+ __props.user.image ? (openBlock(), createElementBlock("img", {
4459
+ key: 0,
4460
+ class: "user-bg",
4461
+ src: __props.user.image.startsWith("http") ? __props.user.image : `data:image/png;base64,${__props.user.image}`
4462
+ }, null, 8, _hoisted_2$9)) : (openBlock(), createElementBlock("span", _hoisted_3$7, toDisplayString(getInitials(__props.user.name, __props.user.email)), 1))
4463
+ ]);
4464
+ };
4465
+ }
4466
+ };
4467
+ const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-53e13009"]]);
4411
4468
  function plugin$1(options) {
4412
4469
  let _bPrefix = ".";
4413
4470
  let _ePrefix = "__";
@@ -8008,30 +8065,30 @@ const defaultClsPrefix = "n";
8008
8065
  function useConfig(props = {}, options = {
8009
8066
  defaultBordered: true
8010
8067
  }) {
8011
- const NConfigProvider = inject(configProviderInjectionKey, null);
8068
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
8012
8069
  return {
8013
8070
  // NConfigProvider,
8014
- inlineThemeDisabled: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.inlineThemeDisabled,
8015
- mergedRtlRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedRtlRef,
8016
- mergedComponentPropsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedComponentPropsRef,
8017
- mergedBreakpointsRef: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedBreakpointsRef,
8071
+ inlineThemeDisabled: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled,
8072
+ mergedRtlRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef,
8073
+ mergedComponentPropsRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef,
8074
+ mergedBreakpointsRef: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef,
8018
8075
  mergedBorderedRef: computed(() => {
8019
8076
  var _a, _b;
8020
8077
  const {
8021
8078
  bordered
8022
8079
  } = props;
8023
8080
  if (bordered !== void 0) return bordered;
8024
- 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;
8081
+ 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;
8025
8082
  }),
8026
- mergedClsPrefixRef: NConfigProvider ? NConfigProvider.mergedClsPrefixRef : shallowRef(defaultClsPrefix),
8027
- namespaceRef: computed(() => NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedNamespaceRef.value)
8083
+ mergedClsPrefixRef: NConfigProvider2 ? NConfigProvider2.mergedClsPrefixRef : shallowRef(defaultClsPrefix),
8084
+ namespaceRef: computed(() => NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value)
8028
8085
  };
8029
8086
  }
8030
8087
  function useThemeClass(componentName, hashRef, cssVarsRef, props) {
8031
8088
  if (!cssVarsRef) throwError("useThemeClass", "cssVarsRef is not passed");
8032
- const NConfigProvider = inject(configProviderInjectionKey, null);
8033
- const mergedThemeHashRef = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeHashRef;
8034
- const styleMountTarget = NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget;
8089
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
8090
+ const mergedThemeHashRef = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeHashRef;
8091
+ const styleMountTarget = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget;
8035
8092
  const themeClassRef = ref("");
8036
8093
  const ssrAdapter2 = useSsrAdapter();
8037
8094
  let renderCallback;
@@ -9500,7 +9557,7 @@ function useRtl(mountId, rtlStateRef, clsPrefixRef) {
9500
9557
  }
9501
9558
  return componentRtlState;
9502
9559
  });
9503
- const NConfigProvider = inject(configProviderInjectionKey, null);
9560
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
9504
9561
  const mountStyle = () => {
9505
9562
  watchEffect(() => {
9506
9563
  const {
@@ -9520,7 +9577,7 @@ function useRtl(mountId, rtlStateRef, clsPrefixRef) {
9520
9577
  bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
9521
9578
  },
9522
9579
  ssr: ssrAdapter2,
9523
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9580
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9524
9581
  });
9525
9582
  });
9526
9583
  };
@@ -9579,7 +9636,7 @@ function useStyle(mountId, style2, clsPrefixRef) {
9579
9636
  return;
9580
9637
  }
9581
9638
  const ssrAdapter2 = useSsrAdapter();
9582
- const NConfigProvider = inject(configProviderInjectionKey, null);
9639
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
9583
9640
  const mountStyle = () => {
9584
9641
  const clsPrefix = clsPrefixRef.value;
9585
9642
  style2.mount({
@@ -9590,15 +9647,15 @@ function useStyle(mountId, style2, clsPrefixRef) {
9590
9647
  bPrefix: clsPrefix ? `.${clsPrefix}-` : void 0
9591
9648
  },
9592
9649
  ssr: ssrAdapter2,
9593
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9650
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9594
9651
  });
9595
- if (!(NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.preflightStyleDisabled)) {
9652
+ if (!(NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled)) {
9596
9653
  globalStyle.mount({
9597
9654
  id: "n-global",
9598
9655
  head: true,
9599
9656
  anchorMetaName: cssrAnchorMetaName,
9600
9657
  ssr: ssrAdapter2,
9601
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9658
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9602
9659
  });
9603
9660
  }
9604
9661
  };
@@ -9613,7 +9670,7 @@ function createTheme(theme) {
9613
9670
  }
9614
9671
  function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef) {
9615
9672
  const ssrAdapter2 = useSsrAdapter();
9616
- const NConfigProvider = inject(configProviderInjectionKey, null);
9673
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
9617
9674
  if (style2) {
9618
9675
  const mountStyle = () => {
9619
9676
  const clsPrefix = clsPrefixRef === null || clsPrefixRef === void 0 ? void 0 : clsPrefixRef.value;
@@ -9625,15 +9682,15 @@ function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef)
9625
9682
  },
9626
9683
  anchorMetaName: cssrAnchorMetaName,
9627
9684
  ssr: ssrAdapter2,
9628
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9685
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9629
9686
  });
9630
- if (!(NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.preflightStyleDisabled)) {
9687
+ if (!(NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled)) {
9631
9688
  globalStyle.mount({
9632
9689
  id: "n-global",
9633
9690
  head: true,
9634
9691
  anchorMetaName: cssrAnchorMetaName,
9635
9692
  ssr: ssrAdapter2,
9636
- parent: NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.styleMountTarget
9693
+ parent: NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget
9637
9694
  });
9638
9695
  }
9639
9696
  };
@@ -9665,11 +9722,11 @@ function useTheme(resolveId, mountId, style2, defaultTheme, props, clsPrefixRef)
9665
9722
  self: globalSelf = void 0,
9666
9723
  peers: globalPeers = {}
9667
9724
  } = {}
9668
- } = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeRef.value) || {};
9725
+ } = (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value) || {};
9669
9726
  const {
9670
9727
  common: globalCommonOverrides = void 0,
9671
9728
  [resolveId]: globalSelfOverrides = {}
9672
- } = (NConfigProvider === null || NConfigProvider === void 0 ? void 0 : NConfigProvider.mergedThemeOverridesRef.value) || {};
9729
+ } = (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value) || {};
9673
9730
  const {
9674
9731
  common: globalSelfCommonOverrides,
9675
9732
  peers: globalPeersOverrides = {}
@@ -13512,6 +13569,209 @@ const NCheckbox = defineComponent({
13512
13569
  }))), labelNode);
13513
13570
  }
13514
13571
  });
13572
+ const configProviderProps = {
13573
+ abstract: Boolean,
13574
+ bordered: {
13575
+ type: Boolean,
13576
+ default: void 0
13577
+ },
13578
+ clsPrefix: String,
13579
+ locale: Object,
13580
+ dateLocale: Object,
13581
+ namespace: String,
13582
+ rtl: Array,
13583
+ tag: {
13584
+ type: String,
13585
+ default: "div"
13586
+ },
13587
+ hljs: Object,
13588
+ katex: Object,
13589
+ theme: Object,
13590
+ themeOverrides: Object,
13591
+ componentOptions: Object,
13592
+ icons: Object,
13593
+ breakpoints: Object,
13594
+ preflightStyleDisabled: Boolean,
13595
+ styleMountTarget: Object,
13596
+ inlineThemeDisabled: {
13597
+ type: Boolean,
13598
+ default: void 0
13599
+ },
13600
+ // deprecated
13601
+ as: {
13602
+ type: String,
13603
+ validator: () => {
13604
+ warn("config-provider", "`as` is deprecated, please use `tag` instead.");
13605
+ return true;
13606
+ },
13607
+ default: void 0
13608
+ }
13609
+ };
13610
+ const NConfigProvider = defineComponent({
13611
+ name: "ConfigProvider",
13612
+ alias: ["App"],
13613
+ props: configProviderProps,
13614
+ setup(props) {
13615
+ const NConfigProvider2 = inject(configProviderInjectionKey, null);
13616
+ const mergedThemeRef = computed(() => {
13617
+ const {
13618
+ theme
13619
+ } = props;
13620
+ if (theme === null) return void 0;
13621
+ const inheritedTheme = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeRef.value;
13622
+ return theme === void 0 ? inheritedTheme : inheritedTheme === void 0 ? theme : Object.assign({}, inheritedTheme, theme);
13623
+ });
13624
+ const mergedThemeOverridesRef = computed(() => {
13625
+ const {
13626
+ themeOverrides
13627
+ } = props;
13628
+ if (themeOverrides === null) return void 0;
13629
+ if (themeOverrides === void 0) {
13630
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
13631
+ } else {
13632
+ const inheritedThemeOverrides = NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedThemeOverridesRef.value;
13633
+ if (inheritedThemeOverrides === void 0) {
13634
+ return themeOverrides;
13635
+ } else {
13636
+ return merge$1({}, inheritedThemeOverrides, themeOverrides);
13637
+ }
13638
+ }
13639
+ });
13640
+ const mergedNamespaceRef = useMemo(() => {
13641
+ const {
13642
+ namespace: namespace2
13643
+ } = props;
13644
+ return namespace2 === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedNamespaceRef.value : namespace2;
13645
+ });
13646
+ const mergedBorderedRef = useMemo(() => {
13647
+ const {
13648
+ bordered
13649
+ } = props;
13650
+ return bordered === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBorderedRef.value : bordered;
13651
+ });
13652
+ const mergedIconsRef = computed(() => {
13653
+ const {
13654
+ icons
13655
+ } = props;
13656
+ return icons === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedIconsRef.value : icons;
13657
+ });
13658
+ const mergedComponentPropsRef = computed(() => {
13659
+ const {
13660
+ componentOptions
13661
+ } = props;
13662
+ if (componentOptions !== void 0) return componentOptions;
13663
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedComponentPropsRef.value;
13664
+ });
13665
+ const mergedClsPrefixRef = computed(() => {
13666
+ const {
13667
+ clsPrefix
13668
+ } = props;
13669
+ if (clsPrefix !== void 0) return clsPrefix;
13670
+ if (NConfigProvider2) return NConfigProvider2.mergedClsPrefixRef.value;
13671
+ return defaultClsPrefix;
13672
+ });
13673
+ const mergedRtlRef = computed(() => {
13674
+ var _a;
13675
+ const {
13676
+ rtl
13677
+ } = props;
13678
+ if (rtl === void 0) {
13679
+ return NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedRtlRef.value;
13680
+ }
13681
+ const rtlEnabledState = {};
13682
+ for (const rtlInfo of rtl) {
13683
+ rtlEnabledState[rtlInfo.name] = markRaw(rtlInfo);
13684
+ (_a = rtlInfo.peers) === null || _a === void 0 ? void 0 : _a.forEach((peerRtlInfo) => {
13685
+ if (!(peerRtlInfo.name in rtlEnabledState)) {
13686
+ rtlEnabledState[peerRtlInfo.name] = markRaw(peerRtlInfo);
13687
+ }
13688
+ });
13689
+ }
13690
+ return rtlEnabledState;
13691
+ });
13692
+ const mergedBreakpointsRef = computed(() => {
13693
+ return props.breakpoints || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedBreakpointsRef.value);
13694
+ });
13695
+ const inlineThemeDisabled = props.inlineThemeDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.inlineThemeDisabled);
13696
+ const preflightStyleDisabled = props.preflightStyleDisabled || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.preflightStyleDisabled);
13697
+ const styleMountTarget = props.styleMountTarget || (NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.styleMountTarget);
13698
+ const mergedThemeHashRef = computed(() => {
13699
+ const {
13700
+ value: theme
13701
+ } = mergedThemeRef;
13702
+ const {
13703
+ value: mergedThemeOverrides
13704
+ } = mergedThemeOverridesRef;
13705
+ const hasThemeOverrides = mergedThemeOverrides && Object.keys(mergedThemeOverrides).length !== 0;
13706
+ const themeName = theme === null || theme === void 0 ? void 0 : theme.name;
13707
+ if (themeName) {
13708
+ if (hasThemeOverrides) {
13709
+ return `${themeName}-${murmur2(JSON.stringify(mergedThemeOverridesRef.value))}`;
13710
+ }
13711
+ return themeName;
13712
+ } else {
13713
+ if (hasThemeOverrides) {
13714
+ return murmur2(JSON.stringify(mergedThemeOverridesRef.value));
13715
+ }
13716
+ return "";
13717
+ }
13718
+ });
13719
+ provide(configProviderInjectionKey, {
13720
+ mergedThemeHashRef,
13721
+ mergedBreakpointsRef,
13722
+ mergedRtlRef,
13723
+ mergedIconsRef,
13724
+ mergedComponentPropsRef,
13725
+ mergedBorderedRef,
13726
+ mergedNamespaceRef,
13727
+ mergedClsPrefixRef,
13728
+ mergedLocaleRef: computed(() => {
13729
+ const {
13730
+ locale
13731
+ } = props;
13732
+ if (locale === null) return void 0;
13733
+ return locale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedLocaleRef.value : locale;
13734
+ }),
13735
+ mergedDateLocaleRef: computed(() => {
13736
+ const {
13737
+ dateLocale
13738
+ } = props;
13739
+ if (dateLocale === null) return void 0;
13740
+ return dateLocale === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedDateLocaleRef.value : dateLocale;
13741
+ }),
13742
+ mergedHljsRef: computed(() => {
13743
+ const {
13744
+ hljs
13745
+ } = props;
13746
+ return hljs === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedHljsRef.value : hljs;
13747
+ }),
13748
+ mergedKatexRef: computed(() => {
13749
+ const {
13750
+ katex
13751
+ } = props;
13752
+ return katex === void 0 ? NConfigProvider2 === null || NConfigProvider2 === void 0 ? void 0 : NConfigProvider2.mergedKatexRef.value : katex;
13753
+ }),
13754
+ mergedThemeRef,
13755
+ mergedThemeOverridesRef,
13756
+ inlineThemeDisabled: inlineThemeDisabled || false,
13757
+ preflightStyleDisabled: preflightStyleDisabled || false,
13758
+ styleMountTarget
13759
+ });
13760
+ return {
13761
+ mergedClsPrefix: mergedClsPrefixRef,
13762
+ mergedBordered: mergedBorderedRef,
13763
+ mergedNamespace: mergedNamespaceRef,
13764
+ mergedTheme: mergedThemeRef,
13765
+ mergedThemeOverrides: mergedThemeOverridesRef
13766
+ };
13767
+ },
13768
+ render() {
13769
+ var _a, _b, _c, _d;
13770
+ return !this.abstract ? h(this.as || this.tag, {
13771
+ class: `${this.mergedClsPrefix || defaultClsPrefix}-config-provider`
13772
+ }, (_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);
13773
+ }
13774
+ });
13515
13775
  const commonVariables$1 = {
13516
13776
  padding: "4px 0",
13517
13777
  optionIconSizeSmall: "14px",
@@ -15388,62 +15648,20 @@ const NMessageProvider = defineComponent({
15388
15648
  }))) : null);
15389
15649
  }
15390
15650
  });
15391
- 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>';
15392
- 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>';
15393
- 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>';
15394
- 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>';
15395
- 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>';
15396
- 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>';
15397
- 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>';
15398
- const superdocIcons = {
15399
- comment: commentIconSvg,
15400
- caretDown: caretDownIconSvg,
15401
- internal: userCheckIconSvg,
15402
- external: usersIconSvg,
15403
- markDone: checkIconSvg,
15404
- acceptChange: checkIconSvg,
15405
- rejectChange: xmarkIconSvg,
15406
- overflow: ellipsisVerticalSvg
15407
- };
15408
- const _export_sfc = (sfc, props) => {
15409
- const target = sfc.__vccOpts || sfc;
15410
- for (const [key, val] of props) {
15411
- target[key] = val;
15412
- }
15413
- return target;
15414
- };
15415
- const _hoisted_1$f = { class: "user-container" };
15416
- const _hoisted_2$9 = ["src"];
15417
- const _hoisted_3$7 = {
15418
- key: 1,
15419
- class: "user-bg"
15420
- };
15421
- const _sfc_main$g = {
15422
- __name: "Avatar",
15423
- props: {
15424
- user: {
15425
- type: Object,
15426
- required: true
15427
- }
15428
- },
15429
- setup(__props) {
15430
- const getInitials = (name, email) => {
15431
- if (!name && !email) return;
15432
- const firstLetter = name?.substring(0, 1) || email?.substring(0, 1) || null;
15433
- return firstLetter;
15434
- };
15435
- return (_ctx, _cache) => {
15436
- return openBlock(), createElementBlock("div", _hoisted_1$f, [
15437
- __props.user.image ? (openBlock(), createElementBlock("img", {
15438
- key: 0,
15439
- class: "user-bg",
15440
- src: __props.user.image.startsWith("http") ? __props.user.image : `data:image/png;base64,${__props.user.image}`
15441
- }, null, 8, _hoisted_2$9)) : (openBlock(), createElementBlock("span", _hoisted_3$7, toDisplayString(getInitials(__props.user.name, __props.user.email)), 1))
15442
- ]);
15443
- };
15444
- }
15445
- };
15446
- const Avatar = /* @__PURE__ */ _export_sfc(_sfc_main$g, [["__scopeId", "data-v-53e13009"]]);
15651
+ const DEFAULT_UI_FONT_FAMILY = "Arial, Helvetica, sans-serif";
15652
+ function useUiFontFamily() {
15653
+ const instance = getCurrentInstance();
15654
+ const uiFontFamily = computed(() => {
15655
+ const configured = instance?.proxy?.$superdoc?.config?.uiDisplayFallbackFont;
15656
+ if (typeof configured === "string" && configured.trim()) {
15657
+ return configured.trim();
15658
+ }
15659
+ return DEFAULT_UI_FONT_FAMILY;
15660
+ });
15661
+ return {
15662
+ uiFontFamily
15663
+ };
15664
+ }
15447
15665
  const _hoisted_1$e = { class: "comment-option" };
15448
15666
  const _hoisted_2$8 = ["innerHTML"];
15449
15667
  const _hoisted_3$6 = { class: "option-state" };
@@ -15464,6 +15682,7 @@ const _sfc_main$f = {
15464
15682
  setup(__props, { emit: __emit }) {
15465
15683
  const emit = __emit;
15466
15684
  const props = __props;
15685
+ const { uiFontFamily } = useUiFontFamily();
15467
15686
  const renderIcon = (icon) => {
15468
15687
  return () => {
15469
15688
  return h("div", { innerHTML: icon, class: "internal-dropdown__item-icon" });
@@ -15525,7 +15744,8 @@ const _sfc_main$f = {
15525
15744
  trigger: "click",
15526
15745
  options,
15527
15746
  onSelect: _cache[0] || (_cache[0] = ($event) => handleSelect($event)),
15528
- disabled: __props.isDisabled
15747
+ disabled: __props.isDisabled,
15748
+ "content-style": { fontFamily: unref(uiFontFamily) }
15529
15749
  }, {
15530
15750
  default: withCtx(() => [
15531
15751
  createBaseVNode("div", _hoisted_1$e, [
@@ -15541,12 +15761,12 @@ const _sfc_main$f = {
15541
15761
  ])
15542
15762
  ]),
15543
15763
  _: 1
15544
- }, 8, ["disabled"])
15764
+ }, 8, ["disabled", "content-style"])
15545
15765
  ], 4);
15546
15766
  };
15547
15767
  }
15548
15768
  };
15549
- const InternalDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-a88dddd9"]]);
15769
+ const InternalDropdown = /* @__PURE__ */ _export_sfc(_sfc_main$f, [["__scopeId", "data-v-8b9e3b75"]]);
15550
15770
  function formatDate(timestamp) {
15551
15771
  const date = new Date(timestamp);
15552
15772
  const hours = date.getHours();
@@ -15692,6 +15912,7 @@ const _sfc_main$e = {
15692
15912
  const role = proxy.$superdoc.config.role;
15693
15913
  const isInternal = proxy.$superdoc.config.isInternal;
15694
15914
  const isOwnComment = props.comment.creatorEmail === proxy.$superdoc.config.user.email;
15915
+ const { uiFontFamily } = useUiFontFamily();
15695
15916
  const OVERFLOW_OPTIONS = Object.freeze({
15696
15917
  edit: { label: "Edit", key: "edit" },
15697
15918
  delete: { label: "Delete", key: "delete" }
@@ -15795,7 +16016,8 @@ const _sfc_main$e = {
15795
16016
  key: 2,
15796
16017
  trigger: "click",
15797
16018
  options: getOverflowOptions.value,
15798
- onSelect: handleSelect
16019
+ onSelect: handleSelect,
16020
+ "content-style": { fontFamily: unref(uiFontFamily) }
15799
16021
  }, {
15800
16022
  default: withCtx(() => [
15801
16023
  createBaseVNode("div", {
@@ -15810,13 +16032,13 @@ const _sfc_main$e = {
15810
16032
  ])
15811
16033
  ]),
15812
16034
  _: 1
15813
- }, 8, ["options"])) : createCommentVNode("", true)
16035
+ }, 8, ["options", "content-style"])) : createCommentVNode("", true)
15814
16036
  ])
15815
16037
  ]);
15816
16038
  };
15817
16039
  }
15818
16040
  };
15819
- const CommentHeader = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-0f4f53ef"]]);
16041
+ const CommentHeader = /* @__PURE__ */ _export_sfc(_sfc_main$e, [["__scopeId", "data-v-5e404f08"]]);
15820
16042
  const _hoisted_1$c = { class: "input-section" };
15821
16043
  const _sfc_main$d = {
15822
16044
  __name: "CommentInput",
@@ -16236,7 +16458,7 @@ const _sfc_main$c = {
16236
16458
  };
16237
16459
  }
16238
16460
  };
16239
- const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-36e5f63e"]]);
16461
+ const CommentDialog = /* @__PURE__ */ _export_sfc(_sfc_main$c, [["__scopeId", "data-v-abfa4e05"]]);
16240
16462
  const _hoisted_1$a = { class: "comments-list" };
16241
16463
  const _hoisted_2$5 = { key: 0 };
16242
16464
  const _hoisted_3$3 = { class: "comment-item" };
@@ -16299,12 +16521,12 @@ class SuperComments extends EventEmitter {
16299
16521
  element: null,
16300
16522
  commentsStore: null
16301
16523
  };
16302
- constructor(options, superdoc2) {
16524
+ constructor(options, superdoc) {
16303
16525
  super();
16304
16526
  this.config = { ...this.config, ...options };
16305
16527
  this.element = this.config.element;
16306
16528
  this.app = null;
16307
- this.superdoc = superdoc2;
16529
+ this.superdoc = superdoc;
16308
16530
  this.open();
16309
16531
  }
16310
16532
  createVueApp() {
@@ -16533,7 +16755,8 @@ const _sfc_main$9 = {
16533
16755
  measurementTimeoutId.value = null;
16534
16756
  }
16535
16757
  const totalComments = getFloatingComments.value.length;
16536
- if (totalComments === 0) {
16758
+ const measuredComments = renderedSizes.value.length;
16759
+ if (totalComments === 0 || measuredComments === 0) {
16537
16760
  return;
16538
16761
  }
16539
16762
  nextTick(processLocations);
@@ -16614,7 +16837,7 @@ const _sfc_main$9 = {
16614
16837
  };
16615
16838
  }
16616
16839
  };
16617
- const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-6905dd07"]]);
16840
+ const FloatingComments = /* @__PURE__ */ _export_sfc(_sfc_main$9, [["__scopeId", "data-v-1402ce8c"]]);
16618
16841
  const _sfc_main$8 = {
16619
16842
  __name: "TextField",
16620
16843
  props: {
@@ -16837,7 +17060,7 @@ const _sfc_main$4 = {
16837
17060
  };
16838
17061
  }
16839
17062
  };
16840
- const SelectField = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-b8cacb22"]]);
17063
+ const SelectField = /* @__PURE__ */ _export_sfc(_sfc_main$4, [["__scopeId", "data-v-1e49d9b3"]]);
16841
17064
  const floor = (val, precision) => {
16842
17065
  const multiplier = 10 ** precision;
16843
17066
  return Math.floor(val * multiplier) / multiplier;
@@ -17242,7 +17465,7 @@ const _sfc_main = {
17242
17465
  __name: "SuperDoc",
17243
17466
  emits: ["selection-update"],
17244
17467
  setup(__props, { emit: __emit }) {
17245
- const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-BKujh9gl.es.js"));
17468
+ const PdfViewer = defineAsyncComponent(() => import("./PdfViewer-CZG4udaT.es.js"));
17246
17469
  const superdocStore = useSuperdocStore();
17247
17470
  const commentsStore = useCommentsStore();
17248
17471
  const {
@@ -17282,11 +17505,15 @@ const _sfc_main = {
17282
17505
  const { proxy } = getCurrentInstance();
17283
17506
  commentsStore.proxy = proxy;
17284
17507
  const { isHighContrastMode: isHighContrastMode2 } = useHighContrastMode();
17508
+ const { uiFontFamily } = useUiFontFamily();
17285
17509
  const commentsModuleConfig = computed(() => {
17286
17510
  const config = modules.comments;
17287
17511
  if (config === false || config == null) return null;
17288
17512
  return config;
17289
17513
  });
17514
+ const superdocStyleVars = computed(() => ({
17515
+ "--sd-ui-font-family": uiFontFamily.value
17516
+ }));
17290
17517
  const layers = ref(null);
17291
17518
  const commentsLayer = ref(null);
17292
17519
  const toolsMenuPosition = reactive({ top: null, right: "-25px", zIndex: 101 });
@@ -17803,155 +18030,164 @@ const _sfc_main = {
17803
18030
  });
17804
18031
  return (_ctx, _cache) => {
17805
18032
  const _directive_click_outside = resolveDirective("click-outside");
17806
- return openBlock(), createElementBlock("div", {
17807
- class: normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value, "high-contrast": unref(isHighContrastMode2) }])
17808
- }, [
17809
- createBaseVNode("div", {
17810
- class: "superdoc__layers layers",
17811
- ref_key: "layers",
17812
- ref: layers,
17813
- role: "group"
17814
- }, [
17815
- showToolsFloatingMenu.value ? (openBlock(), createElementBlock("div", {
17816
- key: 0,
17817
- class: "superdoc__tools tools",
17818
- style: normalizeStyle(toolsMenuPosition)
18033
+ return openBlock(), createBlock(unref(NConfigProvider), {
18034
+ abstract: "",
18035
+ "preflight-style-disabled": ""
18036
+ }, {
18037
+ default: withCtx(() => [
18038
+ createBaseVNode("div", {
18039
+ class: normalizeClass(["superdoc", { "superdoc--with-sidebar": showCommentsSidebar.value, "high-contrast": unref(isHighContrastMode2) }]),
18040
+ style: normalizeStyle(superdocStyleVars.value)
17819
18041
  }, [
17820
18042
  createBaseVNode("div", {
17821
- class: "tools-item",
17822
- "data-id": "is-tool",
17823
- onMousedown: _cache[0] || (_cache[0] = withModifiers(($event) => handleToolClick("comments"), ["stop", "prevent"]))
17824
- }, [
17825
- createBaseVNode("div", {
17826
- class: "superdoc__tools-icon",
17827
- innerHTML: unref(superdocIcons).comment
17828
- }, null, 8, _hoisted_1)
17829
- ], 32),
17830
- unref(proxy).$superdoc.config.modules.ai ? (openBlock(), createElementBlock("div", {
17831
- key: 0,
17832
- class: "tools-item",
17833
- "data-id": "is-tool",
17834
- onMousedown: _cache[1] || (_cache[1] = withModifiers(($event) => handleToolClick("ai"), ["stop", "prevent"]))
17835
- }, [..._cache[3] || (_cache[3] = [
17836
- createBaseVNode("div", { class: "superdoc__tools-icon ai-tool" }, null, -1)
17837
- ])], 32)) : createCommentVNode("", true)
17838
- ], 4)) : createCommentVNode("", true),
17839
- createBaseVNode("div", _hoisted_2, [
17840
- isCommentsEnabled.value ? (openBlock(), createElementBlock("div", {
17841
- key: 0,
17842
- class: "superdoc__selection-layer selection-layer",
17843
- onMousedown: handleSelectionStart,
17844
- onMouseup: handleDragEnd,
17845
- ref_key: "selectionLayer",
17846
- ref: selectionLayer
18043
+ class: "superdoc__layers layers",
18044
+ ref_key: "layers",
18045
+ ref: layers,
18046
+ role: "group"
17847
18047
  }, [
17848
- unref(selectionPosition) && shouldShowSelection.value ? (openBlock(), createElementBlock("div", {
18048
+ showToolsFloatingMenu.value ? (openBlock(), createElementBlock("div", {
17849
18049
  key: 0,
17850
- style: normalizeStyle(getSelectionPosition.value),
17851
- class: "superdoc__temp-selection temp-selection sd-highlight sd-initial-highlight"
17852
- }, null, 4)) : createCommentVNode("", true)
17853
- ], 544)) : createCommentVNode("", true),
17854
- "hrbr-fields" in unref(modules) && layers.value ? (openBlock(), createBlock(HrbrFieldsLayer, {
17855
- key: 1,
17856
- fields: unref(modules)["hrbr-fields"],
17857
- class: "superdoc__comments-layer comments-layer",
17858
- style: { "z-index": "2" },
17859
- ref_key: "hrbrFieldsLayer",
17860
- ref: hrbrFieldsLayer
17861
- }, null, 8, ["fields"])) : createCommentVNode("", true),
17862
- layers.value ? (openBlock(), createBlock(CommentsLayer, {
17863
- key: 2,
17864
- class: "superdoc__comments-layer comments-layer",
17865
- style: { "z-index": "3" },
17866
- ref_key: "commentsLayer",
17867
- ref: commentsLayer,
17868
- parent: layers.value,
17869
- user: unref(user),
17870
- onHighlightClick: handleHighlightClick
17871
- }, null, 8, ["parent", "user"])) : createCommentVNode("", true),
17872
- unref(showAiLayer) ? (openBlock(), createBlock(AiLayer, {
17873
- key: 3,
17874
- class: "ai-layer",
17875
- style: { "z-index": "4" },
17876
- ref_key: "aiLayer",
17877
- ref: aiLayer,
17878
- editor: unref(proxy).$superdoc.activeEditor
17879
- }, null, 8, ["editor"])) : createCommentVNode("", true),
17880
- (openBlock(true), createElementBlock(Fragment, null, renderList(unref(documents), (doc) => {
17881
- return openBlock(), createElementBlock("div", {
17882
- class: "superdoc__sub-document sub-document",
17883
- key: doc.id
18050
+ class: "superdoc__tools tools",
18051
+ style: normalizeStyle(toolsMenuPosition)
17884
18052
  }, [
17885
- doc.type === unref(PDF) ? (openBlock(), createBlock(unref(PdfViewer), {
18053
+ createBaseVNode("div", {
18054
+ class: "tools-item",
18055
+ "data-id": "is-tool",
18056
+ onMousedown: _cache[0] || (_cache[0] = withModifiers(($event) => handleToolClick("comments"), ["stop", "prevent"]))
18057
+ }, [
18058
+ createBaseVNode("div", {
18059
+ class: "superdoc__tools-icon",
18060
+ innerHTML: unref(superdocIcons).comment
18061
+ }, null, 8, _hoisted_1)
18062
+ ], 32),
18063
+ unref(proxy).$superdoc.config.modules.ai ? (openBlock(), createElementBlock("div", {
18064
+ key: 0,
18065
+ class: "tools-item",
18066
+ "data-id": "is-tool",
18067
+ onMousedown: _cache[1] || (_cache[1] = withModifiers(($event) => handleToolClick("ai"), ["stop", "prevent"]))
18068
+ }, [..._cache[3] || (_cache[3] = [
18069
+ createBaseVNode("div", { class: "superdoc__tools-icon ai-tool" }, null, -1)
18070
+ ])], 32)) : createCommentVNode("", true)
18071
+ ], 4)) : createCommentVNode("", true),
18072
+ createBaseVNode("div", _hoisted_2, [
18073
+ isCommentsEnabled.value ? (openBlock(), createElementBlock("div", {
17886
18074
  key: 0,
17887
- "document-data": doc,
17888
- config: unref(pdfConfig),
17889
- onSelectionChange: handleSelectionChange,
17890
- onReady: handleDocumentReady,
17891
- onPageLoaded: unref(handlePageReady),
17892
- onBypassSelection: handlePdfClick
17893
- }, null, 8, ["document-data", "config", "onPageLoaded"])) : createCommentVNode("", true),
17894
- createVNode(unref(NMessageProvider), null, {
17895
- default: withCtx(() => [
17896
- doc.type === unref(DOCX) ? (openBlock(), createBlock(unref(SuperEditor), {
18075
+ class: "superdoc__selection-layer selection-layer",
18076
+ onMousedown: handleSelectionStart,
18077
+ onMouseup: handleDragEnd,
18078
+ ref_key: "selectionLayer",
18079
+ ref: selectionLayer
18080
+ }, [
18081
+ unref(selectionPosition) && shouldShowSelection.value ? (openBlock(), createElementBlock("div", {
18082
+ key: 0,
18083
+ style: normalizeStyle(getSelectionPosition.value),
18084
+ class: "superdoc__temp-selection temp-selection sd-highlight sd-initial-highlight"
18085
+ }, null, 4)) : createCommentVNode("", true)
18086
+ ], 544)) : createCommentVNode("", true),
18087
+ "hrbr-fields" in unref(modules) && layers.value ? (openBlock(), createBlock(HrbrFieldsLayer, {
18088
+ key: 1,
18089
+ fields: unref(modules)["hrbr-fields"],
18090
+ class: "superdoc__comments-layer comments-layer",
18091
+ style: { "z-index": "2" },
18092
+ ref_key: "hrbrFieldsLayer",
18093
+ ref: hrbrFieldsLayer
18094
+ }, null, 8, ["fields"])) : createCommentVNode("", true),
18095
+ layers.value ? (openBlock(), createBlock(CommentsLayer, {
18096
+ key: 2,
18097
+ class: "superdoc__comments-layer comments-layer",
18098
+ style: { "z-index": "3" },
18099
+ ref_key: "commentsLayer",
18100
+ ref: commentsLayer,
18101
+ parent: layers.value,
18102
+ user: unref(user),
18103
+ onHighlightClick: handleHighlightClick
18104
+ }, null, 8, ["parent", "user"])) : createCommentVNode("", true),
18105
+ unref(showAiLayer) ? (openBlock(), createBlock(AiLayer, {
18106
+ key: 3,
18107
+ class: "ai-layer",
18108
+ style: { "z-index": "4" },
18109
+ ref_key: "aiLayer",
18110
+ ref: aiLayer,
18111
+ editor: unref(proxy).$superdoc.activeEditor
18112
+ }, null, 8, ["editor"])) : createCommentVNode("", true),
18113
+ (openBlock(true), createElementBlock(Fragment, null, renderList(unref(documents), (doc) => {
18114
+ return openBlock(), createElementBlock("div", {
18115
+ class: "superdoc__sub-document sub-document",
18116
+ key: doc.id
18117
+ }, [
18118
+ doc.type === unref(PDF) ? (openBlock(), createBlock(unref(PdfViewer), {
17897
18119
  key: 0,
18120
+ "document-data": doc,
18121
+ config: unref(pdfConfig),
18122
+ onSelectionChange: handleSelectionChange,
18123
+ onReady: handleDocumentReady,
18124
+ onPageLoaded: unref(handlePageReady),
18125
+ onBypassSelection: handlePdfClick
18126
+ }, null, 8, ["document-data", "config", "onPageLoaded"])) : createCommentVNode("", true),
18127
+ createVNode(unref(NMessageProvider), null, {
18128
+ default: withCtx(() => [
18129
+ doc.type === unref(DOCX) ? (openBlock(), createBlock(unref(SuperEditor), {
18130
+ key: 0,
18131
+ "file-source": doc.data,
18132
+ state: doc.state,
18133
+ "document-id": doc.id,
18134
+ options: { ...editorOptions(doc), rulers: doc.rulers },
18135
+ onEditorReady,
18136
+ onPageMarginsChange: ($event) => handleSuperEditorPageMarginsChange(doc, $event)
18137
+ }, null, 8, ["file-source", "state", "document-id", "options", "onPageMarginsChange"])) : createCommentVNode("", true)
18138
+ ]),
18139
+ _: 2
18140
+ }, 1024),
18141
+ doc.type === unref(HTML) ? (openBlock(), createBlock(HtmlViewer, {
18142
+ key: 1,
18143
+ onReady: _cache[2] || (_cache[2] = (id) => handleDocumentReady(id, null)),
18144
+ onSelectionChange: handleSelectionChange,
17898
18145
  "file-source": doc.data,
17899
- state: doc.state,
17900
- "document-id": doc.id,
17901
- options: { ...editorOptions(doc), rulers: doc.rulers },
17902
- onEditorReady,
17903
- onPageMarginsChange: ($event) => handleSuperEditorPageMarginsChange(doc, $event)
17904
- }, null, 8, ["file-source", "state", "document-id", "options", "onPageMarginsChange"])) : createCommentVNode("", true)
17905
- ]),
17906
- _: 2
17907
- }, 1024),
17908
- doc.type === unref(HTML) ? (openBlock(), createBlock(HtmlViewer, {
17909
- key: 1,
17910
- onReady: _cache[2] || (_cache[2] = (id) => handleDocumentReady(id, null)),
17911
- onSelectionChange: handleSelectionChange,
17912
- "file-source": doc.data,
17913
- "document-id": doc.id
17914
- }, null, 8, ["file-source", "document-id"])) : createCommentVNode("", true)
17915
- ]);
17916
- }), 128))
17917
- ])
17918
- ], 512),
17919
- showCommentsSidebar.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
17920
- unref(pendingComment) ? withDirectives((openBlock(), createBlock(CommentDialog, {
17921
- key: 0,
17922
- comment: unref(pendingComment),
17923
- "auto-focus": true,
17924
- "is-floating": true
17925
- }, null, 8, ["comment"])), [
17926
- [_directive_click_outside, cancelPendingComment]
17927
- ]) : createCommentVNode("", true),
17928
- createBaseVNode("div", _hoisted_4, [
17929
- unref(hasInitializedLocations) && unref(getFloatingComments).length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(documentsWithConverations), (doc) => {
17930
- return openBlock(), createBlock(FloatingComments, {
17931
- parent: layers.value,
17932
- "current-document": doc
17933
- }, null, 8, ["parent", "current-document"]);
17934
- }), 256)) : createCommentVNode("", true)
17935
- ])
17936
- ])) : createCommentVNode("", true),
17937
- unref(showAiWriter) ? (openBlock(), createElementBlock("div", {
17938
- key: 1,
17939
- class: "ai-writer-container",
17940
- style: normalizeStyle(unref(aiWriterPosition))
17941
- }, [
17942
- createVNode(unref(AIWriter), {
17943
- "selected-text": unref(selectedText),
17944
- "handle-close": unref(handleAiWriterClose),
17945
- editor: unref(proxy).$superdoc.activeEditor,
17946
- "api-key": unref(proxy).$superdoc.toolbar?.config?.aiApiKey,
17947
- endpoint: unref(proxy).$superdoc.config?.modules?.ai?.endpoint
17948
- }, null, 8, ["selected-text", "handle-close", "editor", "api-key", "endpoint"])
17949
- ], 4)) : createCommentVNode("", true)
17950
- ], 2);
18146
+ "document-id": doc.id
18147
+ }, null, 8, ["file-source", "document-id"])) : createCommentVNode("", true)
18148
+ ]);
18149
+ }), 128))
18150
+ ])
18151
+ ], 512),
18152
+ showCommentsSidebar.value ? (openBlock(), createElementBlock("div", _hoisted_3, [
18153
+ unref(pendingComment) ? withDirectives((openBlock(), createBlock(CommentDialog, {
18154
+ key: 0,
18155
+ comment: unref(pendingComment),
18156
+ "auto-focus": true,
18157
+ "is-floating": true
18158
+ }, null, 8, ["comment"])), [
18159
+ [_directive_click_outside, cancelPendingComment]
18160
+ ]) : createCommentVNode("", true),
18161
+ createBaseVNode("div", _hoisted_4, [
18162
+ unref(hasInitializedLocations) && unref(getFloatingComments).length > 0 ? (openBlock(true), createElementBlock(Fragment, { key: 0 }, renderList(unref(documentsWithConverations), (doc) => {
18163
+ return openBlock(), createBlock(FloatingComments, {
18164
+ parent: layers.value,
18165
+ "current-document": doc
18166
+ }, null, 8, ["parent", "current-document"]);
18167
+ }), 256)) : createCommentVNode("", true)
18168
+ ])
18169
+ ])) : createCommentVNode("", true),
18170
+ unref(showAiWriter) ? (openBlock(), createElementBlock("div", {
18171
+ key: 1,
18172
+ class: "ai-writer-container",
18173
+ style: normalizeStyle(unref(aiWriterPosition))
18174
+ }, [
18175
+ createVNode(unref(AIWriter), {
18176
+ "selected-text": unref(selectedText),
18177
+ "handle-close": unref(handleAiWriterClose),
18178
+ editor: unref(proxy).$superdoc.activeEditor,
18179
+ "api-key": unref(proxy).$superdoc.toolbar?.config?.aiApiKey,
18180
+ endpoint: unref(proxy).$superdoc.config?.modules?.ai?.endpoint
18181
+ }, null, 8, ["selected-text", "handle-close", "editor", "api-key", "endpoint"])
18182
+ ], 4)) : createCommentVNode("", true)
18183
+ ], 6)
18184
+ ]),
18185
+ _: 1
18186
+ });
17951
18187
  };
17952
18188
  }
17953
18189
  };
17954
- const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-e229774d"]]);
18190
+ const App = /* @__PURE__ */ _export_sfc(_sfc_main, [["__scopeId", "data-v-309688b3"]]);
17955
18191
  const createSuperdocVueApp = () => {
17956
18192
  const app = createApp(App);
17957
18193
  const pinia = createPinia();
@@ -18061,6 +18297,8 @@ class SuperDoc extends EventEmitter {
18061
18297
  toolbarGroups: ["left", "center", "right"],
18062
18298
  toolbarIcons: {},
18063
18299
  toolbarTexts: {},
18300
+ // UI font for SuperDoc surfaces (toolbar, comments UI, etc.)
18301
+ uiDisplayFallbackFont: "Arial, Helvetica, sans-serif",
18064
18302
  isDev: false,
18065
18303
  // telemetry config
18066
18304
  telemetry: null,
@@ -18131,7 +18369,7 @@ class SuperDoc extends EventEmitter {
18131
18369
  this.config.colors = shuffleArray(this.config.colors);
18132
18370
  this.userColorMap = /* @__PURE__ */ new Map();
18133
18371
  this.colorIndex = 0;
18134
- this.version = "1.0.0-next.1";
18372
+ this.version = "1.0.0-next.10";
18135
18373
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
18136
18374
  this.superdocId = config.superdocId || v4();
18137
18375
  this.colors = this.config.colors;
@@ -18490,6 +18728,7 @@ class SuperDoc extends EventEmitter {
18490
18728
  superdoc: this,
18491
18729
  aiApiKey: this.config.modules?.ai?.apiKey,
18492
18730
  aiEndpoint: this.config.modules?.ai?.endpoint,
18731
+ uiDisplayFallbackFont: this.config.uiDisplayFallbackFont,
18493
18732
  ...moduleConfig,
18494
18733
  excludeItems
18495
18734
  // Override moduleConfig.excludeItems with our computed list