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
package/dist/superdoc.cjs CHANGED
@@ -1,10 +1,10 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_rolldown_runtime = require("./chunks/rolldown-runtime-74VwNCz7.cjs");
2
+ const require_rolldown_runtime = require("./chunks/rolldown-runtime-DtsSbkrh.cjs");
3
3
  const require_blank_docx = require("./chunks/blank-docx-BuFAbRjs.cjs");
4
- const require_eventemitter3 = require("./chunks/eventemitter3-C_TAnXOl.cjs");
4
+ const require_eventemitter3 = require("./chunks/eventemitter3-D38u8ta_.cjs");
5
5
  const require_uuid = require("./chunks/uuid-BhG0ngwk.cjs");
6
- const require_jszip = require("./chunks/jszip-D8mAFF-r.cjs");
7
- const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-CqGmoMMA.cjs");
6
+ const require_jszip = require("./chunks/jszip-RC64TPzL.cjs");
7
+ const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-Bom7oDPv.cjs");
8
8
  const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-SDR04tiH.cjs");
9
9
  const require_constants = require("./chunks/constants-DpXuDx_g.cjs");
10
10
  let vue = require("vue");
@@ -3752,9 +3752,7 @@ var getDeep = (object, path) => {
3752
3752
  case "key":
3753
3753
  object = keyOfRow;
3754
3754
  break;
3755
- case "value":
3756
- object = object.get(keyOfRow);
3757
- break;
3755
+ case "value": object = object.get(keyOfRow);
3758
3756
  }
3759
3757
  } else object = object[key];
3760
3758
  }
@@ -3782,9 +3780,7 @@ var setDeep = (object, path, mapper) => {
3782
3780
  case "key":
3783
3781
  parent = keyOfRow;
3784
3782
  break;
3785
- case "value":
3786
- parent = parent.get(keyOfRow);
3787
- break;
3783
+ case "value": parent = parent.get(keyOfRow);
3788
3784
  }
3789
3785
  }
3790
3786
  }
@@ -3809,9 +3805,7 @@ var setDeep = (object, path, mapper) => {
3809
3805
  if (newKey !== keyToRow) parent.delete(keyToRow);
3810
3806
  break;
3811
3807
  }
3812
- case "value":
3813
- parent.set(keyToRow, mapper(parent.get(keyToRow)));
3814
- break;
3808
+ case "value": parent.set(keyToRow, mapper(parent.get(keyToRow)));
3815
3809
  }
3816
3810
  }
3817
3811
  return object;
@@ -5602,9 +5596,7 @@ var syncCommentsToClients = (superdoc, event) => {
5602
5596
  case "resolved":
5603
5597
  updateYComment(yArray, superdoc.ydoc, event, user);
5604
5598
  break;
5605
- case "deleted":
5606
- deleteYComment(yArray, superdoc.ydoc, event, user);
5607
- break;
5599
+ case "deleted": deleteYComment(yArray, superdoc.ydoc, event, user);
5608
5600
  }
5609
5601
  };
5610
5602
  //#endregion
@@ -5745,6 +5737,7 @@ function useComment(params) {
5745
5737
  const trackedChangeLabel = (0, vue.ref)(params.trackedChangeLabel || null);
5746
5738
  const trackedChangeDetailLines = (0, vue.ref)(params.trackedChangeDetailLines || null);
5747
5739
  const trackedChangeImagePreview = (0, vue.ref)(params.trackedChangeImagePreview || null);
5740
+ const customAttributes = (0, vue.ref)(params.customAttributes ?? null);
5748
5741
  const resolvedTime = (0, vue.ref)(params.resolvedTime || null);
5749
5742
  const resolvedById = (0, vue.ref)(params.resolvedById || null);
5750
5743
  const resolvedByEmail = (0, vue.ref)(params.resolvedByEmail || null);
@@ -5982,6 +5975,7 @@ function useComment(params) {
5982
5975
  trackedChangeLabel: trackedChangeLabel.value,
5983
5976
  trackedChangeDetailLines: trackedChangeDetailLines.value,
5984
5977
  trackedChangeImagePreview: trackedChangeImagePreview.value,
5978
+ customAttributes: customAttributes.value,
5985
5979
  deletedText: deletedText.value,
5986
5980
  resolvedTime: resolvedTime.value,
5987
5981
  resolvedById: resolvedById.value,
@@ -6032,6 +6026,7 @@ function useComment(params) {
6032
6026
  trackedChangeLabel,
6033
6027
  trackedChangeDetailLines,
6034
6028
  trackedChangeImagePreview,
6029
+ customAttributes,
6035
6030
  resolvedTime,
6036
6031
  resolvedById,
6037
6032
  resolvedByEmail,
@@ -7097,6 +7092,20 @@ var trackedChangeDetailLinesEqual = (a, b) => {
7097
7092
  if (!Array.isArray(a) || !Array.isArray(b) || a.length !== b.length) return false;
7098
7093
  return a.every((line, index) => shallowEqual(line, b[index]));
7099
7094
  };
7095
+ var normalizeTrackedChangeCustomAttributes = (attributes) => {
7096
+ if (!Array.isArray(attributes)) return null;
7097
+ return attributes.filter((attribute) => attribute && typeof attribute === "object").map((attribute) => ({
7098
+ name: typeof attribute.name === "string" ? attribute.name : "",
7099
+ namespaceUri: typeof attribute.namespaceUri === "string" ? attribute.namespaceUri : "",
7100
+ localName: typeof attribute.localName === "string" ? attribute.localName : "",
7101
+ value: typeof attribute.value === "string" ? attribute.value : ""
7102
+ })).filter((attribute) => attribute.name && attribute.namespaceUri && attribute.localName);
7103
+ };
7104
+ var trackedChangeCustomAttributesEqual = (left, right) => {
7105
+ if (left === right) return true;
7106
+ if (!Array.isArray(left) || !Array.isArray(right) || left.length !== right.length) return false;
7107
+ return left.every((attribute, index) => shallowEqual(attribute, right[index]));
7108
+ };
7100
7109
  var normalizeTrackedChangeImagePreview = (preview) => {
7101
7110
  if (!preview || typeof preview !== "object") return null;
7102
7111
  const src = typeof preview.src === "string" ? preview.src : null;
@@ -7823,12 +7832,14 @@ var useCommentsStore = defineStore("comments", () => {
7823
7832
  documentId: params?.documentId ?? null
7824
7833
  });
7825
7834
  try {
7826
- 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;
7835
+ 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;
7827
7836
  const normalizedChangeId = changeId != null ? String(changeId) : null;
7828
7837
  const normalizedTrackedChangeCanonicalId = trackedChangeCanonicalId != null ? String(trackedChangeCanonicalId) : null;
7829
7838
  const hasTrackedChangePositionAliases = Object.prototype.hasOwnProperty.call(params, "trackedChangePositionAliases");
7830
7839
  const normalizedTrackedChangePositionAliases = hasTrackedChangePositionAliases ? normalizeTrackedChangePositionAliases(trackedChangePositionAliases) : void 0;
7831
7840
  const hasImportedId = Object.prototype.hasOwnProperty.call(params, "importedId");
7841
+ const hasCustomAttributes = Object.prototype.hasOwnProperty.call(params, "customAttributes");
7842
+ const normalizedCustomAttributes = hasCustomAttributes ? normalizeTrackedChangeCustomAttributes(customAttributes) : void 0;
7832
7843
  const normalizedImportedId = hasImportedId ? importedId != null ? String(importedId) : null : void 0;
7833
7844
  const normalizedDocumentId = documentId != null ? String(documentId) : null;
7834
7845
  if (!(trackedChangeDisplayType === "tableInsert" || trackedChangeDisplayType === "tableDelete") && normalizedChangeId) {
@@ -7872,6 +7883,7 @@ var useCommentsStore = defineStore("comments", () => {
7872
7883
  trackedChangeLabel: normalizedTrackedChangeLabel,
7873
7884
  trackedChangeDetailLines: normalizedTrackedChangeDetailLines,
7874
7885
  trackedChangeImagePreview: normalizedTrackedChangeImagePreview,
7886
+ ...hasCustomAttributes ? { customAttributes: normalizedCustomAttributes } : {},
7875
7887
  createdTime: date,
7876
7888
  creatorId: authorId ?? null,
7877
7889
  creatorName: authorName,
@@ -7987,6 +7999,10 @@ var useCommentsStore = defineStore("comments", () => {
7987
7999
  target.trackedChangeDetailLines = normalizedTrackedChangeDetailLines;
7988
8000
  didChange = true;
7989
8001
  }
8002
+ if (hasCustomAttributes && target && !trackedChangeCustomAttributesEqual(target.customAttributes, normalizedCustomAttributes)) {
8003
+ target.customAttributes = normalizedCustomAttributes;
8004
+ didChange = true;
8005
+ }
7990
8006
  return applyStoryMetadata(target) || didChange;
7991
8007
  };
7992
8008
  const updateExistingTrackedChange = (trackedComment) => {
@@ -8681,6 +8697,7 @@ var useCommentsStore = defineStore("comments", () => {
8681
8697
  trackedChangeLabel: typeof params.trackedChangeLabel === "string" && params.trackedChangeLabel.length > 0 ? params.trackedChangeLabel : null,
8682
8698
  trackedChangeDetailLines: normalizeTrackedChangeDetailLines(params.trackedChangeDetailLines),
8683
8699
  trackedChangeImagePreview: normalizeTrackedChangeImagePreview(params.trackedChangeImagePreview),
8700
+ ...Object.prototype.hasOwnProperty.call(params, "customAttributes") ? { customAttributes: normalizeTrackedChangeCustomAttributes(params.customAttributes) } : {},
8684
8701
  createdTime: params.date,
8685
8702
  creatorId: params.authorId ?? null,
8686
8703
  creatorName: params.author,
@@ -12410,6 +12427,7 @@ var _sfc_main$33 = {
12410
12427
  const commentsAreReadOnly = () => getConfig.value?.readOnly === true;
12411
12428
  const isReplying = (0, vue.ref)(false);
12412
12429
  const isSubmittingReply = (0, vue.ref)(false);
12430
+ const isSubmittingNewComment = (0, vue.ref)(false);
12413
12431
  const startReply = () => {
12414
12432
  if (commentsAreReadOnly()) return readOnlyMutationOutcome();
12415
12433
  if (isV2WriteDisabled.value) return {
@@ -12498,7 +12516,7 @@ var _sfc_main$33 = {
12498
12516
  if (!shouldCollapseThread.value) return comments.value;
12499
12517
  return [comments.value[0], childComments.value[childComments.value.length - 1]].filter(Boolean);
12500
12518
  });
12501
- (0, vue.watch)((0, vue.computed)(() => {
12519
+ const overflowMeasurementKey = (0, vue.computed)(() => {
12502
12520
  const comment = visibleComments.value[0];
12503
12521
  if (!comment) return "";
12504
12522
  return JSON.stringify({
@@ -12511,7 +12529,8 @@ var _sfc_main$33 = {
12511
12529
  trackedChangeDisplayType: comment.trackedChangeDisplayType,
12512
12530
  trackedChangeDetailLines: comment.trackedChangeDetailLines
12513
12531
  });
12514
- }), () => {
12532
+ });
12533
+ (0, vue.watch)(overflowMeasurementKey, () => {
12515
12534
  (0, vue.nextTick)(checkOverflow);
12516
12535
  });
12517
12536
  const collapsedReplyCount = (0, vue.computed)(() => {
@@ -12655,9 +12674,10 @@ var _sfc_main$33 = {
12655
12674
  };
12656
12675
  isSubmittingReply.value = true;
12657
12676
  try {
12677
+ const parentCommentId = getV2ExistingReplyParentId(props.comment);
12658
12678
  const outcome = await commentsStore.replyCommentV2({
12659
12679
  superdoc: proxy.$superdoc,
12660
- parentCommentId: getV2ExistingReplyParentId(props.comment),
12680
+ parentCommentId,
12661
12681
  text: currentCommentText.value
12662
12682
  });
12663
12683
  if (!outcome?.ok) {
@@ -12672,6 +12692,13 @@ var _sfc_main$33 = {
12672
12692
  isSubmittingReply.value = false;
12673
12693
  }
12674
12694
  }
12695
+ if (isPendingNewComment.value) {
12696
+ if (isSubmittingNewComment.value) return {
12697
+ ok: false,
12698
+ reason: "comment-submit-in-flight"
12699
+ };
12700
+ isSubmittingNewComment.value = true;
12701
+ }
12675
12702
  const options = {
12676
12703
  documentId: props.comment.fileId,
12677
12704
  isInternal: pendingComment.value ? pendingComment.value.isInternal : isInternal.value,
@@ -12683,10 +12710,13 @@ var _sfc_main$33 = {
12683
12710
  text: currentCommentText.value,
12684
12711
  suppressUpdate: true
12685
12712
  });
12686
- Promise.resolve(addComment({
12713
+ Promise.resolve().then(() => addComment({
12687
12714
  superdoc: proxy.$superdoc,
12688
12715
  comment
12689
- })).finally(() => {
12716
+ })).catch((err) => {
12717
+ console.error("[SuperDoc] addComment failed", err);
12718
+ }).finally(() => {
12719
+ isSubmittingNewComment.value = false;
12690
12720
  isReplying.value = false;
12691
12721
  (0, vue.nextTick)(() => emit("resize"));
12692
12722
  });
@@ -12935,12 +12965,10 @@ var _sfc_main$33 = {
12935
12965
  focusEditInput(comment.commentId);
12936
12966
  });
12937
12967
  break;
12938
- case "delete":
12939
- deleteComment({
12940
- superdoc: proxy.$superdoc,
12941
- commentId: comment.commentId
12942
- });
12943
- break;
12968
+ case "delete": deleteComment({
12969
+ superdoc: proxy.$superdoc,
12970
+ commentId: comment.commentId
12971
+ });
12944
12972
  }
12945
12973
  };
12946
12974
  const handleCommentUpdate = async (comment) => {
@@ -13079,9 +13107,9 @@ var _sfc_main$33 = {
13079
13107
  class: "sd-button reply-btn-cancel",
13080
13108
  onClick: (0, vue.withModifiers)(handleCancel, ["stop", "prevent"])
13081
13109
  }, "Cancel"), (0, vue.createElementVNode)("button", {
13082
- class: (0, vue.normalizeClass)(["sd-button primary reply-btn-primary", { "sd-is-disabled": !hasTextContent.value }]),
13110
+ class: (0, vue.normalizeClass)(["sd-button primary reply-btn-primary", { "sd-is-disabled": !hasTextContent.value || isSubmittingNewComment.value }]),
13083
13111
  onClick: (0, vue.withModifiers)(handleAddComment, ["stop", "prevent"]),
13084
- disabled: !hasTextContent.value
13112
+ disabled: !hasTextContent.value || isSubmittingNewComment.value
13085
13113
  }, " Comment ", 10, _hoisted_5$6)])
13086
13114
  ], 64)) : ((0, vue.openBlock)(), (0, vue.createElementBlock)(vue.Fragment, { key: 1 }, [
13087
13115
  resolvedBadgeLabel.value ? ((0, vue.openBlock)(), (0, vue.createElementBlock)("div", _hoisted_6$5, [(0, vue.createElementVNode)("span", {
@@ -13256,7 +13284,7 @@ var _sfc_main$33 = {
13256
13284
  };
13257
13285
  }
13258
13286
  };
13259
- var CommentDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$33, [["__scopeId", "data-v-0277e53b"]]);
13287
+ var CommentDialog_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$33, [["__scopeId", "data-v-fd214e1f"]]);
13260
13288
  //#endregion
13261
13289
  //#region src/components/CommentsLayer/commentsList/ReviewDirectoryListItem.vue
13262
13290
  var _hoisted_1$25 = [
@@ -21769,17 +21797,20 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
21769
21797
  },
21770
21798
  fontAssets: proxy.$superdoc.config.fonts,
21771
21799
  workerUrls: proxy.$superdoc.config.workerUrls,
21800
+ workerStartupTimeoutMs: proxy.$superdoc.config.workerStartupTimeoutMs,
21772
21801
  proofing: resolvedProofingConfig.value,
21773
21802
  isNewFile,
21774
21803
  password: getDocumentLoadPassword(doc),
21775
21804
  handleImageUpload: proxy.$superdoc.config.handleImageUpload,
21776
21805
  externalExtensions: proxy.$superdoc.config.editorExtensions || [],
21777
21806
  extensions: proxy.$superdoc.config.extensions || [],
21807
+ ...pdfConfig?.pdfLib ? { pdfLib: pdfConfig.pdfLib } : {},
21778
21808
  suppressDefaultDocxStyles: proxy.$superdoc.config.suppressDefaultDocxStyles,
21779
21809
  disableContextMenu: !proxy.$superdoc.uiConfig.contextMenu.enabled || proxy.$superdoc.config.disableContextMenu === true,
21780
21810
  jsonOverride: proxy.$superdoc.config.jsonOverride,
21781
21811
  viewOptions: proxy.$superdoc.config.viewOptions,
21782
21812
  contained: proxy.$superdoc.config.contained,
21813
+ documentLoading: proxy.$superdoc.uiConfig.loading.enabled,
21783
21814
  linkPopoverResolver: proxy.$superdoc.uiConfig.linkPopover.options.popoverResolver,
21784
21815
  layoutEngineOptions: useLayoutEngine ? {
21785
21816
  ...proxy.$superdoc.config.layoutEngineOptions || {},
@@ -22764,7 +22795,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
22764
22795
  ], 38);
22765
22796
  };
22766
22797
  }
22767
- }, [["__scopeId", "data-v-7770edae"]]);
22798
+ }, [["__scopeId", "data-v-af3574db"]]);
22768
22799
  //#endregion
22769
22800
  //#region src/core/create-app.js
22770
22801
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -26842,9 +26873,7 @@ function parseCSSFilters(cssFilter) {
26842
26873
  const KonvaFilters = Konva$2.Filters;
26843
26874
  if (KonvaFilters && KonvaFilters.Invert) KonvaFilters.Invert.call(this, imageData);
26844
26875
  };
26845
- default:
26846
- Util.warn(`CSS filter "${filterName}" is not supported in fallback mode. Consider using function filters for better compatibility.`);
26847
- break;
26876
+ default: Util.warn(`CSS filter "${filterName}" is not supported in fallback mode. Consider using function filters for better compatibility.`);
26848
26877
  }
26849
26878
  }
26850
26879
  return () => {};
@@ -31264,7 +31293,6 @@ var Path = class Path extends Shape {
31264
31293
  case "z":
31265
31294
  isClosed = true;
31266
31295
  context.closePath();
31267
- break;
31268
31296
  }
31269
31297
  }
31270
31298
  if (!isClosed && !this.hasFill()) context.strokeShape(this);
@@ -31734,7 +31762,6 @@ var Path = class Path extends Shape {
31734
31762
  cpy += p.shift();
31735
31763
  cmd = "A";
31736
31764
  points = this.convertEndpointToCenterParameterization(x1, y1, cpx, cpy, fa, fs, rx, ry, psi);
31737
- break;
31738
31765
  }
31739
31766
  ca.push({
31740
31767
  command: cmd || c,
@@ -32192,7 +32219,6 @@ var Label = class extends Group {
32192
32219
  case LEFT$1:
32193
32220
  x = -1 * pointerWidth;
32194
32221
  y = height / 2;
32195
- break;
32196
32222
  }
32197
32223
  tag.setAttrs({
32198
32224
  x: -1 * x,
@@ -35275,11 +35301,14 @@ function backgroundMask(idata, threshold) {
35275
35301
  rgbv_so
35276
35302
  ]);
35277
35303
  const mask = [];
35278
- for (let i = 0; i < idata.width * idata.height; i++) mask[i] = rgbDistance(mean, [
35279
- idata.data[i * 4],
35280
- idata.data[i * 4 + 1],
35281
- idata.data[i * 4 + 2]
35282
- ]) < thres ? 0 : 255;
35304
+ for (let i = 0; i < idata.width * idata.height; i++) {
35305
+ const d = rgbDistance(mean, [
35306
+ idata.data[i * 4],
35307
+ idata.data[i * 4 + 1],
35308
+ idata.data[i * 4 + 2]
35309
+ ]);
35310
+ mask[i] = d < thres ? 0 : 255;
35311
+ }
35283
35312
  return mask;
35284
35313
  }
35285
35314
  }
@@ -36136,6 +36165,7 @@ var HISTORICAL_DEFAULTS = Object.freeze({
36136
36165
  toolbar: true,
36137
36166
  comments: true,
36138
36167
  contextMenu: true,
36168
+ loading: true,
36139
36169
  search: false,
36140
36170
  linkPopover: false,
36141
36171
  ruler: false,
@@ -36222,6 +36252,7 @@ function withoutCommentPolicy(options) {
36222
36252
  * toolbar: { enabled: boolean, container: string | HTMLElement | null, options: Record<string, unknown> },
36223
36253
  * comments: { enabled: boolean, options: Record<string, unknown> },
36224
36254
  * contextMenu: { enabled: boolean, suppressed: boolean, options: Record<string, unknown> },
36255
+ * loading: { enabled: boolean },
36225
36256
  * search: { enabled: boolean, options: Record<string, unknown> },
36226
36257
  * linkPopover: { enabled: boolean, suppressed: boolean, options: Record<string, unknown> },
36227
36258
  * ruler: { enabled: boolean, suppressed: boolean, container: string | HTMLElement | null },
@@ -36278,6 +36309,7 @@ function normalizeUiConfig(config = {}) {
36278
36309
  suppressed: allDisabled || explicit("contextMenu") === false,
36279
36310
  options: allDisabled ? {} : mergeDefined(legacyContextMenu, options("contextMenu"))
36280
36311
  },
36312
+ loading: { enabled: enabled("loading") },
36281
36313
  search: {
36282
36314
  enabled: explicit("search") ?? (!allDisabled && Boolean(config.modules?.surfaces?.findReplace)),
36283
36315
  options: allDisabled ? {} : mergeDefined(legacySearch, options("search"))
@@ -38243,8 +38275,6 @@ var _sfc_main$14 = {
38243
38275
  event.preventDefault();
38244
38276
  resetToApplied();
38245
38277
  (0, vue.nextTick)(() => inputRef.value?.focus());
38246
- break;
38247
- default: break;
38248
38278
  }
38249
38279
  };
38250
38280
  const onCaretMousedown = (event) => {
@@ -38301,8 +38331,6 @@ var _sfc_main$14 = {
38301
38331
  shiftKey: event.shiftKey,
38302
38332
  target: inputRef.value
38303
38333
  });
38304
- break;
38305
- default: break;
38306
38334
  }
38307
38335
  };
38308
38336
  const handleDocumentPointerDown = (event) => {
@@ -39043,11 +39071,8 @@ var _sfc_main$10 = {
39043
39071
  closeDropdowns();
39044
39072
  moveToPreviousButton(e);
39045
39073
  break;
39046
- case "Tab":
39047
- if (e.shiftKey) moveToPreviousButtonGroup(e);
39048
- else moveToNextButtonGroup(e);
39049
- break;
39050
- default: break;
39074
+ case "Tab": if (e.shiftKey) moveToPreviousButtonGroup(e);
39075
+ else moveToNextButtonGroup(e);
39051
39076
  }
39052
39077
  };
39053
39078
  const handleFocus = (e) => {
@@ -39835,10 +39860,7 @@ var AlignmentButtons_default = /*#__PURE__*/ require__plugin_vue_export_helper._
39835
39860
  case "ArrowRight":
39836
39861
  moveToNextButton(index);
39837
39862
  break;
39838
- case "Enter":
39839
- select(alignmentButtons[index].key);
39840
- break;
39841
- default: break;
39863
+ case "Enter": select(alignmentButtons[index].key);
39842
39864
  }
39843
39865
  };
39844
39866
  (0, vue.onMounted)(() => {
@@ -39928,10 +39950,7 @@ var _sfc_main$7 = {
39928
39950
  case "ArrowRight":
39929
39951
  moveToNextButton(index);
39930
39952
  break;
39931
- case "Enter":
39932
- select(props.buttons[index].key);
39933
- break;
39934
- default: break;
39953
+ case "Enter": select(props.buttons[index].key);
39935
39954
  }
39936
39955
  };
39937
39956
  (0, vue.onMounted)(() => {
@@ -40066,10 +40085,7 @@ var _sfc_main$6 = {
40066
40085
  case "ArrowUp":
40067
40086
  moveToPreviousOption(index);
40068
40087
  break;
40069
- case "Enter":
40070
- handleClick(props.options[index]);
40071
- break;
40072
- default: break;
40088
+ case "Enter": handleClick(props.options[index]);
40073
40089
  }
40074
40090
  };
40075
40091
  (0, vue.onMounted)(() => {
@@ -40162,8 +40178,6 @@ var _sfc_main$5 = {
40162
40178
  case "Enter":
40163
40179
  event.preventDefault();
40164
40180
  select(style);
40165
- break;
40166
- default: break;
40167
40181
  }
40168
40182
  };
40169
40183
  const styleLabel = (style) => style?.name ?? style?.id ?? "";
@@ -40465,10 +40479,7 @@ var _sfc_main$3 = {
40465
40479
  case "Enter":
40466
40480
  handleClick(option);
40467
40481
  break;
40468
- case "Escape":
40469
- emit("clickoutside");
40470
- break;
40471
- default: break;
40482
+ case "Escape": emit("clickoutside");
40472
40483
  }
40473
40484
  };
40474
40485
  return (_ctx, _cache) => {
@@ -40753,13 +40764,10 @@ var TableGrid_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_
40753
40764
  selectGridItems(tableGridItems.value, cols, rows - 1);
40754
40765
  break;
40755
40766
  }
40756
- case "Enter":
40757
- handleClick({
40758
- cols,
40759
- rows
40760
- });
40761
- break;
40762
- default: break;
40767
+ case "Enter": handleClick({
40768
+ cols,
40769
+ rows
40770
+ });
40763
40771
  }
40764
40772
  };
40765
40773
  (0, vue.onMounted)(() => {
@@ -41709,8 +41717,9 @@ var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts
41709
41717
  }
41710
41718
  ];
41711
41719
  function renderDocumentMode(renderDocumentButton) {
41720
+ const optionsAfterRole = getDocumentOptionsAfterRole(role, documentOptions);
41712
41721
  return (0, vue.h)(DocumentMode_default, {
41713
- options: getDocumentOptionsAfterRole(role, documentOptions),
41722
+ options: optionsAfterRole,
41714
41723
  onSelect: (item) => {
41715
41724
  const selectedEditor = superToolbar.superdoc?.activeEditor ?? superToolbar.activeEditor;
41716
41725
  closeDropdown(renderDocumentButton);
@@ -43268,7 +43277,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
43268
43277
  this.config.colors = shuffleArray(this.config.colors);
43269
43278
  this.userColorMap = /* @__PURE__ */ new Map();
43270
43279
  this.colorIndex = 0;
43271
- this.version = "2.4.0";
43280
+ this.version = "2.5.0";
43272
43281
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
43273
43282
  this.superdocId = config.superdocId || require_uuid.v4();
43274
43283
  this.colors = this.config.colors ?? [];