superdoc 2.4.0 → 2.5.0

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 (63) hide show
  1. package/README.md +12 -90
  2. package/dist/chunks/{create-super-doc-ui-CqGmoMMA.cjs → create-super-doc-ui-Bom7oDPv.cjs} +194 -29
  3. package/dist/chunks/{create-super-doc-ui-CmOSA_lN.es.js → create-super-doc-ui-DbzVC0rr.es.js} +194 -29
  4. package/dist/chunks/{eventemitter3-DEIiXiH2.es.js → eventemitter3-CMOjDs74.es.js} +1 -1
  5. package/dist/chunks/{eventemitter3-C_TAnXOl.cjs → eventemitter3-D38u8ta_.cjs} +1 -1
  6. package/dist/chunks/{jszip-D8mAFF-r.cjs → jszip-RC64TPzL.cjs} +1 -1
  7. package/dist/chunks/{jszip-BzJ3CyxR.es.js → jszip-VxCFV9YS.es.js} +1 -1
  8. package/dist/chunks/{rolldown-runtime-0pSA04fp.es.js → rolldown-runtime-B5TtN50X.es.js} +1 -1
  9. package/dist/chunks/{rolldown-runtime-74VwNCz7.cjs → rolldown-runtime-DtsSbkrh.cjs} +1 -1
  10. package/dist/collaboration-upgrade-engine.cjs +1 -1
  11. package/dist/collaboration-upgrade-engine.es.js +1 -1
  12. package/dist/document-api/src/types/track-changes.types.d.ts +17 -0
  13. package/dist/layout-engine/contracts/src/graphic-placement.d.ts +35 -6
  14. package/dist/layout-engine/contracts/src/index.d.ts +296 -13
  15. package/dist/layout-engine/contracts/src/resolved-layout.d.ts +5 -0
  16. package/dist/layout-engine/dom-contract/src/class-names.d.ts +2 -0
  17. package/dist/layout-engine/layout-bridge/src/footnote-scorer.d.ts +1 -1
  18. package/dist/layout-engine/layout-bridge/src/hydrateTableTextboxMeasures.d.ts +9 -0
  19. package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +40 -12
  20. package/dist/layout-engine/layout-bridge/src/index.d.ts +3 -2
  21. package/dist/layout-engine/layout-bridge/src/layoutHeaderFooter.d.ts +10 -7
  22. package/dist/layout-engine/layout-bridge/src/remeasure.d.ts +2 -2
  23. package/dist/layout-engine/layout-engine/src/anchors.d.ts +4 -0
  24. package/dist/layout-engine/layout-engine/src/execution.d.ts +21 -0
  25. package/dist/layout-engine/layout-engine/src/floating-objects.d.ts +15 -2
  26. package/dist/layout-engine/layout-engine/src/floating-table-anchor.d.ts +2 -0
  27. package/dist/layout-engine/layout-engine/src/footnote-anchor-index.d.ts +17 -0
  28. package/dist/layout-engine/layout-engine/src/index.d.ts +13 -10
  29. package/dist/layout-engine/layout-engine/src/inline-drawing-alignment.d.ts +9 -0
  30. package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +3 -3
  31. package/dist/layout-engine/layout-engine/src/layout-paragraph.d.ts +2 -2
  32. package/dist/layout-engine/layout-engine/src/layout-textbox.d.ts +3 -3
  33. package/dist/layout-engine/layout-engine/src/pageNumbering.d.ts +3 -41
  34. package/dist/layout-engine/layout-engine/src/paginator.d.ts +7 -2
  35. package/dist/layout-engine/layout-engine/src/resolvePageTokens.d.ts +2 -0
  36. package/dist/layout-engine/layout-engine/src/section-breaks.d.ts +1 -0
  37. package/dist/layout-engine/layout-engine/src/section-props.d.ts +5 -0
  38. package/dist/layout-engine/painters/dom/src/chart-renderer.d.ts +3 -3
  39. package/dist/layout-engine/painters/dom/src/images/image-outline.d.ts +7 -0
  40. package/dist/layout-engine/painters/dom/src/images/render-placeholder.d.ts +12 -0
  41. package/dist/layout-engine/painters/dom/src/renderer.d.ts +54 -0
  42. package/dist/layout-engine/painters/dom/src/runs/text-effects.d.ts +30 -0
  43. package/dist/layout-engine/painters/dom/src/runs/text-run.d.ts +6 -4
  44. package/dist/layout-engine/painters/dom/src/shapes/preset-text-warp-data.d.ts +32 -0
  45. package/dist/layout-engine/painters/dom/src/shapes/wordart-warp.d.ts +39 -0
  46. package/dist/layout-engine/painters/dom/src/table/border-utils.d.ts +20 -27
  47. package/dist/layout-engine/painters/dom/src/table/renderTableFragment.d.ts +1 -1
  48. package/dist/layout-engine/style-engine/src/ooxml/word-style-model/parse-theme.d.ts +7 -0
  49. package/dist/public/ui-react.cjs +1 -1
  50. package/dist/public/ui-react.es.js +1 -1
  51. package/dist/public/ui.cjs +1 -1
  52. package/dist/public/ui.es.js +1 -1
  53. package/dist/style.css +87 -87
  54. package/dist/style.layered.css +87 -87
  55. package/dist/superdoc/src/core/config/normalize-ui-config.d.ts +5 -0
  56. package/dist/superdoc/src/core/types/index.d.ts +24 -0
  57. package/dist/superdoc.cjs +88 -79
  58. package/dist/superdoc.es.js +88 -79
  59. package/dist-cdn/style.layered.css +1 -1
  60. package/dist-cdn/superdoc.min.css +1 -1
  61. package/dist-cdn/superdoc.min.js +37 -37
  62. package/package.json +2 -6
  63. package/AGENTS.md +0 -337
@@ -1,9 +1,9 @@
1
- import { i as __toESM$2 } from "./chunks/rolldown-runtime-0pSA04fp.es.js";
1
+ import { i as __toESM$2 } from "./chunks/rolldown-runtime-B5TtN50X.es.js";
2
2
  import { t as blank_default } from "./chunks/blank-docx-DzQccOlW.es.js";
3
- import { t as import_eventemitter3 } from "./chunks/eventemitter3-DEIiXiH2.es.js";
3
+ import { t as import_eventemitter3 } from "./chunks/eventemitter3-CMOjDs74.es.js";
4
4
  import { t as v4 } from "./chunks/uuid-H0Xcmmhy.es.js";
5
- import { a as init_dist$1, i as global, n as init_dist$2, o as Buffer, r as process$1, s as init_dist, t as require_jszip_min } from "./chunks/jszip-BzJ3CyxR.es.js";
6
- import { a as DOM_CLASS_NAMES, i as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-CmOSA_lN.es.js";
5
+ import { a as init_dist$1, i as global, n as init_dist$2, o as Buffer, r as process$1, s as init_dist, t as require_jszip_min } from "./chunks/jszip-VxCFV9YS.es.js";
6
+ import { a as DOM_CLASS_NAMES, i as getV2TrackedChangeMutationImpact, t as createSuperDocUI } from "./chunks/create-super-doc-ui-DbzVC0rr.es.js";
7
7
  import { t as _plugin_vue_export_helper_default } from "./chunks/_plugin-vue_export-helper-BOaGB7Aw.es.js";
8
8
  import { t as PDF_TO_CSS_UNITS } from "./chunks/constants-B6VBlmKp.es.js";
9
9
  import * as Vue from "vue";
@@ -3751,9 +3751,7 @@ var getDeep = (object, path) => {
3751
3751
  case "key":
3752
3752
  object = keyOfRow;
3753
3753
  break;
3754
- case "value":
3755
- object = object.get(keyOfRow);
3756
- break;
3754
+ case "value": object = object.get(keyOfRow);
3757
3755
  }
3758
3756
  } else object = object[key];
3759
3757
  }
@@ -3781,9 +3779,7 @@ var setDeep = (object, path, mapper) => {
3781
3779
  case "key":
3782
3780
  parent = keyOfRow;
3783
3781
  break;
3784
- case "value":
3785
- parent = parent.get(keyOfRow);
3786
- break;
3782
+ case "value": parent = parent.get(keyOfRow);
3787
3783
  }
3788
3784
  }
3789
3785
  }
@@ -3808,9 +3804,7 @@ var setDeep = (object, path, mapper) => {
3808
3804
  if (newKey !== keyToRow) parent.delete(keyToRow);
3809
3805
  break;
3810
3806
  }
3811
- case "value":
3812
- parent.set(keyToRow, mapper(parent.get(keyToRow)));
3813
- break;
3807
+ case "value": parent.set(keyToRow, mapper(parent.get(keyToRow)));
3814
3808
  }
3815
3809
  }
3816
3810
  return object;
@@ -5601,9 +5595,7 @@ var syncCommentsToClients = (superdoc, event) => {
5601
5595
  case "resolved":
5602
5596
  updateYComment(yArray, superdoc.ydoc, event, user);
5603
5597
  break;
5604
- case "deleted":
5605
- deleteYComment(yArray, superdoc.ydoc, event, user);
5606
- break;
5598
+ case "deleted": deleteYComment(yArray, superdoc.ydoc, event, user);
5607
5599
  }
5608
5600
  };
5609
5601
  //#endregion
@@ -5744,6 +5736,7 @@ function useComment(params) {
5744
5736
  const trackedChangeLabel = ref(params.trackedChangeLabel || null);
5745
5737
  const trackedChangeDetailLines = ref(params.trackedChangeDetailLines || null);
5746
5738
  const trackedChangeImagePreview = ref(params.trackedChangeImagePreview || null);
5739
+ const customAttributes = ref(params.customAttributes ?? null);
5747
5740
  const resolvedTime = ref(params.resolvedTime || null);
5748
5741
  const resolvedById = ref(params.resolvedById || null);
5749
5742
  const resolvedByEmail = ref(params.resolvedByEmail || null);
@@ -5981,6 +5974,7 @@ function useComment(params) {
5981
5974
  trackedChangeLabel: trackedChangeLabel.value,
5982
5975
  trackedChangeDetailLines: trackedChangeDetailLines.value,
5983
5976
  trackedChangeImagePreview: trackedChangeImagePreview.value,
5977
+ customAttributes: customAttributes.value,
5984
5978
  deletedText: deletedText.value,
5985
5979
  resolvedTime: resolvedTime.value,
5986
5980
  resolvedById: resolvedById.value,
@@ -6031,6 +6025,7 @@ function useComment(params) {
6031
6025
  trackedChangeLabel,
6032
6026
  trackedChangeDetailLines,
6033
6027
  trackedChangeImagePreview,
6028
+ customAttributes,
6034
6029
  resolvedTime,
6035
6030
  resolvedById,
6036
6031
  resolvedByEmail,
@@ -7096,6 +7091,20 @@ var trackedChangeDetailLinesEqual = (a, b) => {
7096
7091
  if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
7097
7092
  return a.every((line, index) => shallowEqual(line, b[index]));
7098
7093
  };
7094
+ var normalizeTrackedChangeCustomAttributes = (attributes) => {
7095
+ if (!Array.isArray(attributes)) return null;
7096
+ return attributes.filter((attribute) => attribute && typeof attribute === "object").map((attribute) => ({
7097
+ name: typeof attribute.name === "string" ? attribute.name : "",
7098
+ namespaceUri: typeof attribute.namespaceUri === "string" ? attribute.namespaceUri : "",
7099
+ localName: typeof attribute.localName === "string" ? attribute.localName : "",
7100
+ value: typeof attribute.value === "string" ? attribute.value : ""
7101
+ })).filter((attribute) => attribute.name && attribute.namespaceUri && attribute.localName);
7102
+ };
7103
+ var trackedChangeCustomAttributesEqual = (left, right) => {
7104
+ if (left === right) return true;
7105
+ if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) return false;
7106
+ return left.every((attribute, index) => shallowEqual(attribute, right[index]));
7107
+ };
7099
7108
  var normalizeTrackedChangeImagePreview = (preview) => {
7100
7109
  if (!preview || typeof preview !== "object") return null;
7101
7110
  const src = typeof preview.src === "string" ? preview.src : null;
@@ -7822,12 +7831,14 @@ var useCommentsStore = defineStore("comments", () => {
7822
7831
  documentId: params?.documentId ?? null
7823
7832
  });
7824
7833
  try {
7825
- const { event, changeId, trackedChangeText, trackedChangeType, trackedChangeDisplayType, semanticColorKey, semanticColor, deletedText, trackedChangeLabel, trackedChangeDetailLines, trackedChangeImagePreview, authorId, authorEmail, authorImage, date, author: authorName, importedAuthor, documentId, coords, trackedChangeStory, trackedChangeStoryKind, trackedChangeStoryLabel, trackedChangeAnchorKey, trackedChangeCanonicalId, trackedChangePositionAliases, importedId } = params;
7834
+ const { event, changeId, trackedChangeText, trackedChangeType, trackedChangeDisplayType, semanticColorKey, semanticColor, deletedText, trackedChangeLabel, trackedChangeDetailLines, trackedChangeImagePreview, customAttributes, authorId, authorEmail, authorImage, date, author: authorName, importedAuthor, documentId, coords, trackedChangeStory, trackedChangeStoryKind, trackedChangeStoryLabel, trackedChangeAnchorKey, trackedChangeCanonicalId, trackedChangePositionAliases, importedId } = params;
7826
7835
  const normalizedChangeId = changeId != null ? String(changeId) : null;
7827
7836
  const normalizedTrackedChangeCanonicalId = trackedChangeCanonicalId != null ? String(trackedChangeCanonicalId) : null;
7828
7837
  const hasTrackedChangePositionAliases = Object.prototype.hasOwnProperty.call(params, "trackedChangePositionAliases");
7829
7838
  const normalizedTrackedChangePositionAliases = hasTrackedChangePositionAliases ? normalizeTrackedChangePositionAliases(trackedChangePositionAliases) : void 0;
7830
7839
  const hasImportedId = Object.prototype.hasOwnProperty.call(params, "importedId");
7840
+ const hasCustomAttributes = Object.prototype.hasOwnProperty.call(params, "customAttributes");
7841
+ const normalizedCustomAttributes = hasCustomAttributes ? normalizeTrackedChangeCustomAttributes(customAttributes) : void 0;
7831
7842
  const normalizedImportedId = hasImportedId ? importedId != null ? String(importedId) : null : void 0;
7832
7843
  const normalizedDocumentId = documentId != null ? String(documentId) : null;
7833
7844
  if (!(trackedChangeDisplayType === "tableInsert" || trackedChangeDisplayType === "tableDelete") && normalizedChangeId) {
@@ -7871,6 +7882,7 @@ var useCommentsStore = defineStore("comments", () => {
7871
7882
  trackedChangeLabel: normalizedTrackedChangeLabel,
7872
7883
  trackedChangeDetailLines: normalizedTrackedChangeDetailLines,
7873
7884
  trackedChangeImagePreview: normalizedTrackedChangeImagePreview,
7885
+ ...hasCustomAttributes ? { customAttributes: normalizedCustomAttributes } : {},
7874
7886
  createdTime: date,
7875
7887
  creatorId: authorId ?? null,
7876
7888
  creatorName: authorName,
@@ -7986,6 +7998,10 @@ var useCommentsStore = defineStore("comments", () => {
7986
7998
  target.trackedChangeDetailLines = normalizedTrackedChangeDetailLines;
7987
7999
  didChange = true;
7988
8000
  }
8001
+ if (hasCustomAttributes && target && !trackedChangeCustomAttributesEqual(target.customAttributes, normalizedCustomAttributes)) {
8002
+ target.customAttributes = normalizedCustomAttributes;
8003
+ didChange = true;
8004
+ }
7989
8005
  return applyStoryMetadata(target) || didChange;
7990
8006
  };
7991
8007
  const updateExistingTrackedChange = (trackedComment) => {
@@ -8680,6 +8696,7 @@ var useCommentsStore = defineStore("comments", () => {
8680
8696
  trackedChangeLabel: typeof params.trackedChangeLabel === "string" && params.trackedChangeLabel.length > 0 ? params.trackedChangeLabel : null,
8681
8697
  trackedChangeDetailLines: normalizeTrackedChangeDetailLines(params.trackedChangeDetailLines),
8682
8698
  trackedChangeImagePreview: normalizeTrackedChangeImagePreview(params.trackedChangeImagePreview),
8699
+ ...Object.prototype.hasOwnProperty.call(params, "customAttributes") ? { customAttributes: normalizeTrackedChangeCustomAttributes(params.customAttributes) } : {},
8683
8700
  createdTime: params.date,
8684
8701
  creatorId: params.authorId ?? null,
8685
8702
  creatorName: params.author,
@@ -12404,6 +12421,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12404
12421
  const commentsAreReadOnly = () => getConfig.value?.readOnly === true;
12405
12422
  const isReplying = ref(false);
12406
12423
  const isSubmittingReply = ref(false);
12424
+ const isSubmittingNewComment = ref(false);
12407
12425
  const startReply = () => {
12408
12426
  if (commentsAreReadOnly()) return readOnlyMutationOutcome();
12409
12427
  if (isV2WriteDisabled.value) return {
@@ -12492,7 +12510,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12492
12510
  if (!shouldCollapseThread.value) return comments.value;
12493
12511
  return [comments.value[0], childComments.value[childComments.value.length - 1]].filter(Boolean);
12494
12512
  });
12495
- watch(computed(() => {
12513
+ const overflowMeasurementKey = computed(() => {
12496
12514
  const comment = visibleComments.value[0];
12497
12515
  if (!comment) return "";
12498
12516
  return JSON.stringify({
@@ -12505,7 +12523,8 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12505
12523
  trackedChangeDisplayType: comment.trackedChangeDisplayType,
12506
12524
  trackedChangeDetailLines: comment.trackedChangeDetailLines
12507
12525
  });
12508
- }), () => {
12526
+ });
12527
+ watch(overflowMeasurementKey, () => {
12509
12528
  nextTick(checkOverflow);
12510
12529
  });
12511
12530
  const collapsedReplyCount = computed(() => {
@@ -12649,9 +12668,10 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12649
12668
  };
12650
12669
  isSubmittingReply.value = true;
12651
12670
  try {
12671
+ const parentCommentId = getV2ExistingReplyParentId(props.comment);
12652
12672
  const outcome = await commentsStore.replyCommentV2({
12653
12673
  superdoc: proxy.$superdoc,
12654
- parentCommentId: getV2ExistingReplyParentId(props.comment),
12674
+ parentCommentId,
12655
12675
  text: currentCommentText.value
12656
12676
  });
12657
12677
  if (!outcome?.ok) {
@@ -12666,6 +12686,13 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12666
12686
  isSubmittingReply.value = false;
12667
12687
  }
12668
12688
  }
12689
+ if (isPendingNewComment.value) {
12690
+ if (isSubmittingNewComment.value) return {
12691
+ ok: false,
12692
+ reason: "comment-submit-in-flight"
12693
+ };
12694
+ isSubmittingNewComment.value = true;
12695
+ }
12669
12696
  const options = {
12670
12697
  documentId: props.comment.fileId,
12671
12698
  isInternal: pendingComment.value ? pendingComment.value.isInternal : isInternal.value,
@@ -12677,10 +12704,13 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12677
12704
  text: currentCommentText.value,
12678
12705
  suppressUpdate: true
12679
12706
  });
12680
- Promise.resolve(addComment({
12707
+ Promise.resolve().then(() => addComment({
12681
12708
  superdoc: proxy.$superdoc,
12682
12709
  comment
12683
- })).finally(() => {
12710
+ })).catch((err) => {
12711
+ console.error("[SuperDoc] addComment failed", err);
12712
+ }).finally(() => {
12713
+ isSubmittingNewComment.value = false;
12684
12714
  isReplying.value = false;
12685
12715
  nextTick(() => emit("resize"));
12686
12716
  });
@@ -12929,12 +12959,10 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
12929
12959
  focusEditInput(comment.commentId);
12930
12960
  });
12931
12961
  break;
12932
- case "delete":
12933
- deleteComment({
12934
- superdoc: proxy.$superdoc,
12935
- commentId: comment.commentId
12936
- });
12937
- break;
12962
+ case "delete": deleteComment({
12963
+ superdoc: proxy.$superdoc,
12964
+ commentId: comment.commentId
12965
+ });
12938
12966
  }
12939
12967
  };
12940
12968
  const handleCommentUpdate = async (comment) => {
@@ -13073,9 +13101,9 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
13073
13101
  class: "sd-button reply-btn-cancel",
13074
13102
  onClick: withModifiers(handleCancel, ["stop", "prevent"])
13075
13103
  }, "Cancel"), createElementVNode("button", {
13076
- class: normalizeClass(["sd-button primary reply-btn-primary", { "sd-is-disabled": !hasTextContent.value }]),
13104
+ class: normalizeClass(["sd-button primary reply-btn-primary", { "sd-is-disabled": !hasTextContent.value || isSubmittingNewComment.value }]),
13077
13105
  onClick: withModifiers(handleAddComment, ["stop", "prevent"]),
13078
- disabled: !hasTextContent.value
13106
+ disabled: !hasTextContent.value || isSubmittingNewComment.value
13079
13107
  }, " Comment ", 10, _hoisted_5$6)])
13080
13108
  ], 64)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [
13081
13109
  resolvedBadgeLabel.value ? (openBlock(), createElementBlock("div", _hoisted_6$5, [createElementVNode("span", {
@@ -13249,7 +13277,7 @@ var CommentDialog_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
13249
13277
  ], 64))], 14, _hoisted_1$26)), [[_directive_click_outside, handleClickOutside]]);
13250
13278
  };
13251
13279
  }
13252
- }, [["__scopeId", "data-v-0277e53b"]]);
13280
+ }, [["__scopeId", "data-v-fd214e1f"]]);
13253
13281
  //#endregion
13254
13282
  //#region src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue
13255
13283
  var _hoisted_1$25 = [
@@ -21729,17 +21757,20 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
21729
21757
  },
21730
21758
  fontAssets: proxy.$superdoc.config.fonts,
21731
21759
  workerUrls: proxy.$superdoc.config.workerUrls,
21760
+ workerStartupTimeoutMs: proxy.$superdoc.config.workerStartupTimeoutMs,
21732
21761
  proofing: resolvedProofingConfig.value,
21733
21762
  isNewFile,
21734
21763
  password: getDocumentLoadPassword(doc),
21735
21764
  handleImageUpload: proxy.$superdoc.config.handleImageUpload,
21736
21765
  externalExtensions: proxy.$superdoc.config.editorExtensions || [],
21737
21766
  extensions: proxy.$superdoc.config.extensions || [],
21767
+ ...pdfConfig?.pdfLib ? { pdfLib: pdfConfig.pdfLib } : {},
21738
21768
  suppressDefaultDocxStyles: proxy.$superdoc.config.suppressDefaultDocxStyles,
21739
21769
  disableContextMenu: !proxy.$superdoc.uiConfig.contextMenu.enabled || proxy.$superdoc.config.disableContextMenu === true,
21740
21770
  jsonOverride: proxy.$superdoc.config.jsonOverride,
21741
21771
  viewOptions: proxy.$superdoc.config.viewOptions,
21742
21772
  contained: proxy.$superdoc.config.contained,
21773
+ documentLoading: proxy.$superdoc.uiConfig.loading.enabled,
21743
21774
  linkPopoverResolver: proxy.$superdoc.uiConfig.linkPopover.options.popoverResolver,
21744
21775
  layoutEngineOptions: useLayoutEngine ? {
21745
21776
  ...proxy.$superdoc.config.layoutEngineOptions || {},
@@ -22724,7 +22755,7 @@ var SuperDoc_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
22724
22755
  ], 38);
22725
22756
  };
22726
22757
  }
22727
- }, [["__scopeId", "data-v-7770edae"]]);
22758
+ }, [["__scopeId", "data-v-af3574db"]]);
22728
22759
  //#endregion
22729
22760
  //#region src/core/create-app.js
22730
22761
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -26802,9 +26833,7 @@ function parseCSSFilters(cssFilter) {
26802
26833
  const KonvaFilters = Konva$2.Filters;
26803
26834
  if (KonvaFilters && KonvaFilters.Invert) KonvaFilters.Invert.call(this, imageData);
26804
26835
  };
26805
- default:
26806
- Util.warn(`CSS filter "${filterName}" is not supported in fallback mode. Consider using function filters for better compatibility.`);
26807
- break;
26836
+ default: Util.warn(`CSS filter "${filterName}" is not supported in fallback mode. Consider using function filters for better compatibility.`);
26808
26837
  }
26809
26838
  }
26810
26839
  return () => {};
@@ -31224,7 +31253,6 @@ var Path = class Path extends Shape {
31224
31253
  case "z":
31225
31254
  isClosed = true;
31226
31255
  context.closePath();
31227
- break;
31228
31256
  }
31229
31257
  }
31230
31258
  if (!isClosed && !this.hasFill()) context.strokeShape(this);
@@ -31694,7 +31722,6 @@ var Path = class Path extends Shape {
31694
31722
  cpy += p.shift();
31695
31723
  cmd = "A";
31696
31724
  points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);
31697
- break;
31698
31725
  }
31699
31726
  ca.push({
31700
31727
  command: cmd || c,
@@ -32152,7 +32179,6 @@ var Label = class extends Group {
32152
32179
  case LEFT$1:
32153
32180
  x = -1 * pointerWidth;
32154
32181
  y = height / 2;
32155
- break;
32156
32182
  }
32157
32183
  tag.setAttrs({
32158
32184
  x: -1 * x,
@@ -35235,11 +35261,14 @@ function backgroundMask(idata, threshold) {
35235
35261
  rgbv_so
35236
35262
  ]);
35237
35263
  const mask = [];
35238
- for (let i = 0; i < idata.width * idata.height; i++) mask[i] = rgbDistance(mean, [
35239
- idata.data[i * 4],
35240
- idata.data[i * 4 + 1],
35241
- idata.data[i * 4 + 2]
35242
- ]) < thres ? 0 : 255;
35264
+ for (let i = 0; i < idata.width * idata.height; i++) {
35265
+ const d = rgbDistance(mean, [
35266
+ idata.data[i * 4],
35267
+ idata.data[i * 4 + 1],
35268
+ idata.data[i * 4 + 2]
35269
+ ]);
35270
+ mask[i] = d < thres ? 0 : 255;
35271
+ }
35243
35272
  return mask;
35244
35273
  }
35245
35274
  }
@@ -36096,6 +36125,7 @@ var HISTORICAL_DEFAULTS = Object.freeze({
36096
36125
  toolbar: true,
36097
36126
  comments: true,
36098
36127
  contextMenu: true,
36128
+ loading: true,
36099
36129
  search: false,
36100
36130
  linkPopover: false,
36101
36131
  ruler: false,
@@ -36182,6 +36212,7 @@ function withoutCommentPolicy(options) {
36182
36212
  * toolbar: { enabled: boolean, container: string | HTMLElement | null, options: Record<string, unknown> },
36183
36213
  * comments: { enabled: boolean, options: Record<string, unknown> },
36184
36214
  * contextMenu: { enabled: boolean, suppressed: boolean, options: Record<string, unknown> },
36215
+ * loading: { enabled: boolean },
36185
36216
  * search: { enabled: boolean, options: Record<string, unknown> },
36186
36217
  * linkPopover: { enabled: boolean, suppressed: boolean, options: Record<string, unknown> },
36187
36218
  * ruler: { enabled: boolean, suppressed: boolean, container: string | HTMLElement | null },
@@ -36238,6 +36269,7 @@ function normalizeUiConfig(config = {}) {
36238
36269
  suppressed: allDisabled || explicit("contextMenu") === false,
36239
36270
  options: allDisabled ? {} : mergeDefined(legacyContextMenu, options("contextMenu"))
36240
36271
  },
36272
+ loading: { enabled: enabled("loading") },
36241
36273
  search: {
36242
36274
  enabled: explicit("search") ?? (!allDisabled && Boolean(config.modules?.surfaces?.findReplace)),
36243
36275
  options: allDisabled ? {} : mergeDefined(legacySearch, options("search"))
@@ -38198,8 +38230,6 @@ var ToolbarComboBox_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
38198
38230
  event.preventDefault();
38199
38231
  resetToApplied();
38200
38232
  nextTick(() => inputRef.value?.focus());
38201
- break;
38202
- default: break;
38203
38233
  }
38204
38234
  };
38205
38235
  const onCaretMousedown = (event) => {
@@ -38256,8 +38286,6 @@ var ToolbarComboBox_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
38256
38286
  shiftKey: event.shiftKey,
38257
38287
  target: inputRef.value
38258
38288
  });
38259
- break;
38260
- default: break;
38261
38289
  }
38262
38290
  };
38263
38291
  const handleDocumentPointerDown = (event) => {
@@ -38996,11 +39024,8 @@ var ButtonGroup_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
38996
39024
  closeDropdowns();
38997
39025
  moveToPreviousButton(e);
38998
39026
  break;
38999
- case "Tab":
39000
- if (e.shiftKey) moveToPreviousButtonGroup(e);
39001
- else moveToNextButtonGroup(e);
39002
- break;
39003
- default: break;
39027
+ case "Tab": if (e.shiftKey) moveToPreviousButtonGroup(e);
39028
+ else moveToNextButtonGroup(e);
39004
39029
  }
39005
39030
  };
39006
39031
  const handleFocus = (e) => {
@@ -39787,10 +39812,7 @@ var AlignmentButtons_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
39787
39812
  case "ArrowRight":
39788
39813
  moveToNextButton(index);
39789
39814
  break;
39790
- case "Enter":
39791
- select(alignmentButtons[index].key);
39792
- break;
39793
- default: break;
39815
+ case "Enter": select(alignmentButtons[index].key);
39794
39816
  }
39795
39817
  };
39796
39818
  onMounted(() => {
@@ -39880,10 +39902,7 @@ var StyleButtonsList_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
39880
39902
  case "ArrowRight":
39881
39903
  moveToNextButton(index);
39882
39904
  break;
39883
- case "Enter":
39884
- select(props.buttons[index].key);
39885
- break;
39886
- default: break;
39905
+ case "Enter": select(props.buttons[index].key);
39887
39906
  }
39888
39907
  };
39889
39908
  onMounted(() => {
@@ -40017,10 +40036,7 @@ var DocumentMode_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
40017
40036
  case "ArrowUp":
40018
40037
  moveToPreviousOption(index);
40019
40038
  break;
40020
- case "Enter":
40021
- handleClick(props.options[index]);
40022
- break;
40023
- default: break;
40039
+ case "Enter": handleClick(props.options[index]);
40024
40040
  }
40025
40041
  };
40026
40042
  onMounted(() => {
@@ -40100,8 +40116,6 @@ var LinkedStyle_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
40100
40116
  case "Enter":
40101
40117
  event.preventDefault();
40102
40118
  select(style);
40103
- break;
40104
- default: break;
40105
40119
  }
40106
40120
  };
40107
40121
  const styleLabel = (style) => style?.name ?? style?.id ?? "";
@@ -40401,10 +40415,7 @@ var IconGridRow_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
40401
40415
  case "Enter":
40402
40416
  handleClick(option);
40403
40417
  break;
40404
- case "Escape":
40405
- emit("clickoutside");
40406
- break;
40407
- default: break;
40418
+ case "Escape": emit("clickoutside");
40408
40419
  }
40409
40420
  };
40410
40421
  return (_ctx, _cache) => {
@@ -40687,13 +40698,10 @@ var TableGrid_default = /*#__PURE__*/ _plugin_vue_export_helper_default({
40687
40698
  selectGridItems(tableGridItems.value, cols, rows - 1);
40688
40699
  break;
40689
40700
  }
40690
- case "Enter":
40691
- handleClick({
40692
- cols,
40693
- rows
40694
- });
40695
- break;
40696
- default: break;
40701
+ case "Enter": handleClick({
40702
+ cols,
40703
+ rows
40704
+ });
40697
40705
  }
40698
40706
  };
40699
40707
  onMounted(() => {
@@ -41642,8 +41650,9 @@ var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts
41642
41650
  }
41643
41651
  ];
41644
41652
  function renderDocumentMode(renderDocumentButton) {
41653
+ const optionsAfterRole = getDocumentOptionsAfterRole(role, documentOptions);
41645
41654
  return h(DocumentMode_default, {
41646
- options: getDocumentOptionsAfterRole(role, documentOptions),
41655
+ options: optionsAfterRole,
41647
41656
  onSelect: (item) => {
41648
41657
  const selectedEditor = superToolbar.superdoc?.activeEditor ?? superToolbar.activeEditor;
41649
41658
  closeDropdown(renderDocumentButton);
@@ -43201,7 +43210,7 @@ var SuperDoc = class extends import_eventemitter3.default {
43201
43210
  this.config.colors = shuffleArray(this.config.colors);
43202
43211
  this.userColorMap = /* @__PURE__ */ new Map();
43203
43212
  this.colorIndex = 0;
43204
- this.version = "2.4.0";
43213
+ this.version = "2.5.0";
43205
43214
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
43206
43215
  this.superdocId = config.superdocId || v4();
43207
43216
  this.colors = this.config.colors ?? [];