superdoc 2.28.0-next.17 → 2.28.0-next.19

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 (37) hide show
  1. package/dist/chunks/{create-super-doc-ui-CAfcpwSS.es.js → create-super-doc-ui-BEB7RtD6.es.js} +63 -3
  2. package/dist/chunks/{create-super-doc-ui-CXdsObDZ.cjs → create-super-doc-ui-DNe9BmHD.cjs} +68 -2
  3. package/dist/collaboration-upgrade-engine.cjs +1 -1
  4. package/dist/collaboration-upgrade-engine.es.js +1 -1
  5. package/dist/document-api/src/contract/operation-definitions.d.ts +1 -1
  6. package/dist/document-api/src/lists/lists.types.d.ts +1 -0
  7. package/dist/document-api/src/sections/sections.types.d.ts +5 -1
  8. package/dist/document-api/src/types/receipt.d.ts +1 -0
  9. package/dist/layout-engine/contracts/src/index.d.ts +2 -0
  10. package/dist/layout-engine/layout-bridge/src/index.d.ts +1 -0
  11. package/dist/layout-engine/layout-bridge/src/place-inline-drawings.d.ts +9 -0
  12. package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +2 -1
  13. package/dist/public/ui-react.cjs +1 -1
  14. package/dist/public/ui-react.es.js +1 -1
  15. package/dist/public/ui-vue.cjs +1 -1
  16. package/dist/public/ui-vue.es.js +1 -1
  17. package/dist/public/ui.cjs +1 -1
  18. package/dist/public/ui.es.js +1 -1
  19. package/dist/style.css +1 -1
  20. package/dist/style.layered.css +1 -1
  21. package/dist/superdoc/src/components/CommentsLayer/FloatingComments.vue.d.ts +11 -0
  22. package/dist/superdoc/src/components/CommentsLayer/PdfCommentsLayer.vue.d.ts +4 -0
  23. package/dist/superdoc/src/composables/use-superdoc-instance.d.ts +7 -0
  24. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +0 -48
  25. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +1 -0
  26. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +16 -0
  27. package/dist/superdoc/src/public/ui/types.d.ts +20 -0
  28. package/dist/superdoc/src/public/ui.d.cts +8 -0
  29. package/dist/superdoc/src/public/ui.d.ts +1 -1
  30. package/dist/superdoc/src/stores/comments-store.d.ts +4 -37
  31. package/dist/superdoc/src/stores/superdoc-store.d.ts +12 -111
  32. package/dist/superdoc.cjs +110 -206
  33. package/dist/superdoc.es.js +277 -11468
  34. package/dist-cdn/style.layered.css +1 -1
  35. package/dist-cdn/superdoc.min.css +1 -1
  36. package/dist-cdn/superdoc.min.js +40 -40
  37. package/package.json +4 -3
package/dist/superdoc.cjs CHANGED
@@ -1,7 +1,7 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
2
  const require_rolldown_runtime = require("./chunks/rolldown-runtime-74VwNCz7.cjs");
3
3
  const require_blank_docx = require("./chunks/blank-docx-BuFAbRjs.cjs");
4
- const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-CXdsObDZ.cjs");
4
+ const require_create_super_doc_ui = require("./chunks/create-super-doc-ui-DNe9BmHD.cjs");
5
5
  const require_eventemitter3 = require("./chunks/eventemitter3-C_TAnXOl.cjs");
6
6
  const require_uuid = require("./chunks/uuid-BhG0ngwk.cjs");
7
7
  const require__plugin_vue_export_helper = require("./chunks/_plugin-vue_export-helper-BUdjGKyl.cjs");
@@ -258,7 +258,7 @@ var v_click_outside_default = {
258
258
  var DEFAULT_ENDPOINT = "https://ingest.superdoc.dev/v1/collect";
259
259
  function getSuperdocVersion() {
260
260
  try {
261
- return "2.28.0-next.17";
261
+ return "2.28.0-next.19";
262
262
  } catch {
263
263
  return "unknown";
264
264
  }
@@ -7940,17 +7940,6 @@ var useCommentsStore = defineStore("comments", () => {
7940
7940
  comment.resolvedByName = null;
7941
7941
  comment.trackedChangeDecision = null;
7942
7942
  };
7943
- const restoreResolvedMetadata = (comment) => {
7944
- if (!comment) return false;
7945
- const snapshot = trackedChangeResolutionSnapshots.get(comment);
7946
- if (!snapshot) return false;
7947
- comment.resolvedTime = snapshot.resolvedTime ?? Date.now();
7948
- comment.resolvedById = snapshot.resolvedById ?? null;
7949
- comment.resolvedByEmail = snapshot.resolvedByEmail ?? null;
7950
- comment.resolvedByName = snapshot.resolvedByName ?? null;
7951
- comment.trackedChangeDecision = snapshot.trackedChangeDecision ?? null;
7952
- return true;
7953
- };
7954
7943
  const getCommentEventPayload = (comment) => typeof comment?.getValues === "function" ? comment.getValues() : { ...comment };
7955
7944
  /**
7956
7945
  * Check if a comment originated from the document editor (or has no explicit source).
@@ -7965,63 +7954,14 @@ var useCommentsStore = defineStore("comments", () => {
7965
7954
  return source === DOCUMENT_EDITOR_SELECTION_SOURCE;
7966
7955
  };
7967
7956
  const isTrackedChangeThread = (comment) => Boolean(comment?.trackedChange) || Boolean(trackedChangeThreadParentIdForComment$1(comment));
7968
- const collectStandardCommentDocumentState = (editor) => {
7969
- const doc = editor?.state?.doc;
7970
- if (!doc || typeof doc.descendants !== "function") return null;
7971
- const liveMarkIds = /* @__PURE__ */ new Set();
7972
- const resolvedAnchorIds = /* @__PURE__ */ new Set();
7973
- doc.descendants((node) => {
7974
- node.marks?.filter((mark) => mark?.type?.name === "commentMark").forEach((mark) => {
7975
- [mark.attrs?.commentId, mark.attrs?.importedId].map((id) => normalizeCommentId(id)).filter(Boolean).forEach((id) => liveMarkIds.add(id));
7976
- });
7977
- const typeName = node.type?.name;
7978
- if (typeName !== "commentRangeStart" && typeName !== "commentRangeEnd") return;
7979
- const anchorId = normalizeCommentId(node.attrs?.["w:id"]);
7980
- if (anchorId) resolvedAnchorIds.add(anchorId);
7981
- });
7982
- return {
7983
- liveMarkIds,
7984
- resolvedAnchorIds
7985
- };
7986
- };
7987
- /**
7988
- * Fall back to a live editor when the caller has none (the store watchers).
7989
- * `editorCommentPositions` refreshes asynchronously, so a positions-based
7990
- * decision taken mid-undo/redo can act on STALE keys — e.g. clearing the
7991
- * resolved metadata that the redo restore just wrote back. The document
7992
- * itself is the source of truth; prefer it whenever an editor is reachable.
7993
- */
7994
- const getFallbackCommentsEditor = () => {
7995
- const docs = superdocStore.documents;
7996
- if (!Array.isArray(docs)) return null;
7997
- for (const doc of docs) {
7998
- const editor = typeof doc?.getEditor === "function" ? doc.getEditor() : null;
7999
- if (editor?.state?.doc) return editor;
8000
- }
8001
- return null;
8002
- };
8003
- const syncResolvedCommentsWithDocument = ({ editor } = {}) => {
7957
+ const syncResolvedCommentsWithDocument = () => {
8004
7958
  if (v2CommentsAdapter.value) return 0;
8005
- const effectiveEditor = editor ?? getFallbackCommentsEditor();
8006
- const documentState = collectStandardCommentDocumentState(effectiveEditor);
8007
7959
  const docPositions = editorCommentPositions.value || {};
8008
7960
  const activeKeys = new Set(Object.keys(docPositions));
8009
- if (!documentState && !activeKeys.size) return 0;
7961
+ if (!activeKeys.size) return 0;
8010
7962
  let changed = 0;
8011
7963
  commentsList.value.forEach((comment) => {
8012
7964
  if (!isEditorBackedComment(comment) || isTrackedChangeThread(comment)) return;
8013
- if (documentState) {
8014
- const aliasIds = getCommentAliasIds(comment);
8015
- const hasLiveMark = aliasIds.some((id) => documentState.liveMarkIds.has(id));
8016
- const hasResolvedAnchor = aliasIds.some((id) => documentState.resolvedAnchorIds.has(id));
8017
- if (hasLiveMark && comment.resolvedTime != null) {
8018
- clearResolvedMetadata(comment);
8019
- changed += 1;
8020
- return;
8021
- }
8022
- if (!hasLiveMark && hasResolvedAnchor && comment.resolvedTime == null && restoreResolvedMetadata(comment)) changed += 1;
8023
- return;
8024
- }
8025
7965
  const { key } = resolveCommentPositionEntry(comment);
8026
7966
  if (!key) return;
8027
7967
  if (activeKeys.has(String(key)) && comment.resolvedTime != null) {
@@ -8039,23 +7979,6 @@ var useCommentsStore = defineStore("comments", () => {
8039
7979
  syncResolvedCommentsWithDocument();
8040
7980
  }, { deep: false });
8041
7981
  /**
8042
- * Normalize a position object to a consistent { start, end } format.
8043
- * Handles different editor position schemas (start/end, pos/to, from/to).
8044
- *
8045
- * @param {Object | null | undefined} position The position object
8046
- * @returns {{ start: number, end: number } | null} The normalized range or null
8047
- */
8048
- const getCommentPositionRange = (position) => {
8049
- if (!position) return null;
8050
- const start = position.start ?? position.pos ?? position.from;
8051
- const end = position.end ?? position.to ?? start;
8052
- if (!Number.isFinite(start) || !Number.isFinite(end)) return null;
8053
- return {
8054
- start,
8055
- end
8056
- };
8057
- };
8058
- /**
8059
7982
  * Get the editor position data for a comment.
8060
7983
  *
8061
7984
  * @param {Object | string} commentOrId The comment object or comment ID
@@ -8064,44 +7987,6 @@ var useCommentsStore = defineStore("comments", () => {
8064
7987
  const getCommentPosition = (commentOrId) => {
8065
7988
  return resolveCommentPositionEntry(commentOrId).entry ?? null;
8066
7989
  };
8067
- /**
8068
- * Get the text that a comment is anchored to in the document.
8069
- *
8070
- * @param {Object | string} commentOrId The comment object or comment ID
8071
- * @param {Object} [options] Options for text extraction
8072
- * @param {string} [options.separator=' '] Separator for textBetween when crossing nodes
8073
- * @param {boolean} [options.trim=true] Whether to trim whitespace from the result
8074
- * @returns {string | null} The anchored text or null if unavailable
8075
- */
8076
- const getCommentAnchoredText = (commentOrId, options = {}) => {
8077
- const comment = typeof commentOrId === "object" ? commentOrId : getComment(commentOrId);
8078
- if (!comment) return null;
8079
- const position = resolveCommentPositionEntry(commentOrId).entry ?? null;
8080
- const range = getCommentPositionRange(position);
8081
- if (!range) return null;
8082
- const docNode = (superdocStore.getDocument(comment.fileId)?.getEditor?.())?.state?.doc;
8083
- if (!docNode?.textBetween) return null;
8084
- const separator = options.separator ?? " ";
8085
- const text = docNode.textBetween(range.start, range.end, separator, separator);
8086
- return options.trim === false ? text : text?.trim();
8087
- };
8088
- /**
8089
- * Get both position and anchored text data for a comment.
8090
- *
8091
- * @param {Object | string} commentOrId The comment object or comment ID
8092
- * @param {Object} [options] Options passed to getCommentAnchoredText
8093
- * @param {string} [options.separator=' '] Separator for textBetween when crossing nodes
8094
- * @param {boolean} [options.trim=true] Whether to trim whitespace from the result
8095
- * @returns {{ position: Object, anchoredText: string | null } | null} The anchor data or null
8096
- */
8097
- const getCommentAnchorData = (commentOrId, options = {}) => {
8098
- const position = getCommentPosition(commentOrId);
8099
- if (!position) return null;
8100
- return {
8101
- position,
8102
- anchoredText: getCommentAnchoredText(commentOrId, options)
8103
- };
8104
- };
8105
7990
  const isThreadVisible = (comment) => {
8106
7991
  if (!isViewingMode.value) return true;
8107
7992
  const parent = getThreadParent(comment);
@@ -11019,8 +10904,6 @@ var useCommentsStore = defineStore("comments", () => {
11019
10904
  getTrackedChangeThread,
11020
10905
  getCommentPositionKey,
11021
10906
  getCommentPosition,
11022
- getCommentAnchoredText,
11023
- getCommentAnchorData,
11024
10907
  resolveCommentPositionEntry,
11025
10908
  getCommentDocumentId,
11026
10909
  belongsToDocument,
@@ -16080,6 +15963,18 @@ function useHighContrastMode() {
16080
15963
  setHighContrastMode
16081
15964
  };
16082
15965
  }
15966
+ //#endregion
15967
+ //#region src/composables/use-superdoc-instance.ts
15968
+ function useSuperDocInstance() {
15969
+ const instance = require__plugin_vue_export_helper.getCurrentInstance();
15970
+ if (!instance?.proxy) throw new Error("useSuperDocInstance() must be called during a component setup function.");
15971
+ const superdoc = instance.appContext.config.globalProperties.$superdoc;
15972
+ if (!superdoc) throw new Error("useSuperDocInstance() found no SuperDoc registered at app.config.globalProperties.$superdoc.");
15973
+ return {
15974
+ proxy: instance.proxy,
15975
+ superdoc
15976
+ };
15977
+ }
16083
15978
  var VALID_COMMENTS_LAYOUTS = /* @__PURE__ */ new Set([
16084
15979
  "auto",
16085
15980
  "sidebar",
@@ -21098,9 +20993,9 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
21098
20993
  });
21099
20994
  const { getConfig, documentsWithConverations, commentsList, pendingComment, activeComment, skipSelectionUpdate, commentsByDocument, isCommentsListVisible, isFloatingCommentsReady, generalCommentIds, hasSyncedCollaborationComments, editorCommentPositions, hasInitializedLocations, isCommentHighlighted, hasOpenTrackedChanges } = storeToRefs(commentsStore);
21100
20995
  const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate, addComment, addHydratedComment, getComment, resolveCommentPositionEntry, belongsToDocument, COMMENT_EVENTS, requestInstantSidebarAlignment, peekInstantSidebarAlignment, clearInstantSidebarAlignment } = commentsStore;
21101
- const { proxy } = require__plugin_vue_export_helper.getCurrentInstance();
20996
+ const { proxy, superdoc } = useSuperDocInstance();
21102
20997
  commentsStore.proxy = proxy;
21103
- const documentOpenTelemetry = createDocumentOpenTelemetry(proxy.$superdoc.config);
20998
+ const documentOpenTelemetry = createDocumentOpenTelemetry(superdoc.config);
21104
20999
  const resolvedEditorIntegration = createDefaultV2Integration();
21105
21000
  const V2DocumentEditor = require__plugin_vue_export_helper.markRaw(resolvedEditorIntegration.EditorComponent);
21106
21001
  const V2Ruler = resolvedEditorIntegration.RulerComponent ? require__plugin_vue_export_helper.markRaw(resolvedEditorIntegration.RulerComponent) : null;
@@ -21210,7 +21105,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
21210
21105
  });
21211
21106
  }
21212
21107
  });
21213
- const pdfConfig = proxy.$superdoc.config.modules?.pdf || {};
21108
+ const pdfConfig = superdoc.config.modules?.pdf || {};
21214
21109
  const handleDocumentReady = (documentId, container) => {
21215
21110
  const doc = getDocument(documentId);
21216
21111
  if (!doc || doc.loadScope && !doc.loadScope.finish()) return;
@@ -23666,7 +23561,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
23666
23561
  ], 46, _hoisted_1$17);
23667
23562
  };
23668
23563
  }
23669
- }, [["__scopeId", "data-v-2c57eaa1"]]);
23564
+ }, [["__scopeId", "data-v-ba00d895"]]);
23670
23565
  //#endregion
23671
23566
  //#region src/core/create-app.js
23672
23567
  var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
@@ -37785,6 +37680,69 @@ var EditorRuntimeRegistry = class {
37785
37680
  } catch {}
37786
37681
  }
37787
37682
  };
37683
+ //#endregion
37684
+ //#region src/internal/toolbar/compatibility-catalog.ts
37685
+ /**
37686
+ * Internal built-in toolbar compatibility catalog (V2 toolbar parity, phase 1).
37687
+ *
37688
+ * This module is the SINGLE place the legacy built-in toolbar item names (the
37689
+ * ids v1 toolbars, `modules.toolbar.groups`, and the docs use) are mapped onto
37690
+ * the V2 world. Later renderers, the toolbar authority, and any proof helper
37691
+ * consume this catalog instead of rediscovering the mapping ad hoc.
37692
+ *
37693
+ * It does NOT re-implement command routing. The V2 command controller catalog
37694
+ * in `../../public/ui/commands.ts` stays the single source of truth for how a
37695
+ * command is backed; every `controller-routed` entry here points at a canonical
37696
+ * command id that must exist there (enforced by `assertCatalogAlignedWithController`).
37697
+ *
37698
+ * Every documented built-in item is classified into exactly one disposition:
37699
+ *
37700
+ * - `controller-routed` → driven by the V2 command controller (a routed
37701
+ * command id in `COMMAND_CATALOG`).
37702
+ * - `host-routed` → driven by a public `SuperDoc`-instance method the built-in
37703
+ * shell owns directly (e.g. formatting-marks toggle), not by the controller
37704
+ * command set.
37705
+ * - `shell-owned` → pure rendered-shell chrome/config the built-in toolbar
37706
+ * owns (custom buttons, layout groups). Has no command and no document
37707
+ * effect of its own.
37708
+ * - `unsupported` → documented built-in item that is explicitly out of V2
37709
+ * functional parity (a signed product decision). The controller command (if
37710
+ * any) fails closed with `command-unsupported`; the docs do not call it
37711
+ * supported.
37712
+ * - `unresolved` → documented today but with no identified public V2 surface
37713
+ * yet. Recorded explicitly so later phases close it deliberately rather than
37714
+ * pretending it already works.
37715
+ *
37716
+ * Nothing here reintroduces a public `headless-toolbar*` export; the catalog is
37717
+ * internal to the `superdoc` package.
37718
+ */
37719
+ var TABLE_ACTION_COMMAND_IDS_BY_OPTION = {
37720
+ addRowBefore: "table-add-row-before",
37721
+ addRowAfter: "table-add-row-after",
37722
+ deleteRow: "table-delete-row",
37723
+ addColumnBefore: "table-add-column-before",
37724
+ addColumnAfter: "table-add-column-after",
37725
+ deleteColumn: "table-delete-column",
37726
+ deleteTable: "table-delete",
37727
+ deleteCellAndTableBorders: "table-remove-borders",
37728
+ mergeCells: "table-merge-cells",
37729
+ splitCell: "table-split-cell",
37730
+ fixTables: "table-fix"
37731
+ };
37732
+ var TABLE_ACTION_COMMAND_IDS = Object.values(TABLE_ACTION_COMMAND_IDS_BY_OPTION);
37733
+ function tableActionCommandId(option) {
37734
+ return TABLE_ACTION_COMMAND_IDS_BY_OPTION[option];
37735
+ }
37736
+ /**
37737
+ * Member controller command ids the legacy `tableActions` dropdown fans out
37738
+ * into. These are real V2 `tables.*` operations now routed through the shared
37739
+ * table-context facade (`ui.tables` / `host.getTableContext()`): each is a
37740
+ * `routed` controller command that enables when a table context is resolvable
37741
+ * and fails closed with `table-context-unavailable` otherwise. The dropdown
37742
+ * itself is shell chrome; its members are controller-routed.
37743
+ */
37744
+ var ROUTED_TABLE_ACTION_COMMAND_IDS = TABLE_ACTION_COMMAND_IDS.filter((commandId) => require_create_super_doc_ui.getCommandDescriptor(commandId)?.disposition === "routed");
37745
+ var UNCATALOGED_ITEM_COMMAND_IDS = { tableOfContents: "table-of-contents-insert" };
37788
37746
  /**
37789
37747
  * The built-in toolbar compatibility catalog. Order groups items the way the
37790
37748
  * docs present them; it is documentation-only.
@@ -37956,18 +37914,7 @@ var BUILT_IN_TOOLBAR_CATALOG = [
37956
37914
  instanceMethod: null,
37957
37915
  disposition: "shell-owned",
37958
37916
  group: "center",
37959
- memberCommandIds: [
37960
- "table-add-row-before",
37961
- "table-add-row-after",
37962
- "table-delete-row",
37963
- "table-add-column-before",
37964
- "table-add-column-after",
37965
- "table-delete-column",
37966
- "table-delete",
37967
- "table-merge-cells",
37968
- "table-split-cell",
37969
- "table-remove-borders"
37970
- ],
37917
+ memberCommandIds: ROUTED_TABLE_ACTION_COMMAND_IDS,
37971
37918
  note: "table editing dropdown is shell chrome; its member commands are controller-routed through the shared table-context facade (ui.tables / host.getTableContext()) and fail closed with table-context-unavailable when the caret is not in a table"
37972
37919
  },
37973
37920
  {
@@ -38067,6 +38014,9 @@ function resolveToolbarCommandId(name) {
38067
38014
  const entry = CATALOG_BY_NAME.get(name);
38068
38015
  return entry?.disposition === "controller-routed" ? entry.commandId : null;
38069
38016
  }
38017
+ function resolveBuiltInItemCommandId(name) {
38018
+ return resolveToolbarCommandId(name) ?? UNCATALOGED_ITEM_COMMAND_IDS[name] ?? null;
38019
+ }
38070
38020
  //#endregion
38071
38021
  //#region src/internal/toolbar/built-in/helpers.js
38072
38022
  var sanitizeNumber = (value, defaultNumber) => {
@@ -40565,54 +40515,6 @@ var RESPONSIVE_BREAKPOINTS = {
40565
40515
  lg: 1280,
40566
40516
  xl: 1410
40567
40517
  };
40568
- var HEADLESS_ITEM_MAP = {
40569
- undo: "undo",
40570
- redo: "redo",
40571
- bold: "bold",
40572
- italic: "italic",
40573
- underline: "underline",
40574
- strike: "strikethrough",
40575
- acceptTrackedChangeBySelection: "track-changes-accept-selection",
40576
- rejectTrackedChangeOnSelection: "track-changes-reject-selection",
40577
- ruler: "ruler",
40578
- formattingMarks: "formatting-marks",
40579
- zoom: "zoom",
40580
- measurementUnit: "measurement-unit",
40581
- documentMode: "document-mode",
40582
- link: "link",
40583
- fontFamily: "font-family",
40584
- fontSize: "font-size",
40585
- list: "bullet-list",
40586
- numberedlist: "numbered-list",
40587
- table: "table-insert",
40588
- image: "image",
40589
- tableOfContents: "table-of-contents-insert",
40590
- color: "text-color",
40591
- highlight: "highlight-color",
40592
- textAlign: "text-align",
40593
- lineHeight: "line-height",
40594
- linkedStyles: "linked-style",
40595
- indentleft: "indent-decrease",
40596
- indentright: "indent-increase",
40597
- directionLtr: "direction-ltr",
40598
- directionRtl: "direction-rtl",
40599
- clearFormatting: "clear-formatting",
40600
- copyFormat: "copy-format"
40601
- };
40602
- var TABLE_ACTION_COMMAND_MAP = {
40603
- addRowBefore: "table-add-row-before",
40604
- addRowAfter: "table-add-row-after",
40605
- deleteRow: "table-delete-row",
40606
- addColumnBefore: "table-add-column-before",
40607
- addColumnAfter: "table-add-column-after",
40608
- deleteColumn: "table-delete-column",
40609
- deleteTable: "table-delete",
40610
- deleteCellAndTableBorders: "table-remove-borders",
40611
- mergeCells: "table-merge-cells",
40612
- splitCell: "table-split-cell",
40613
- fixTables: "table-fix"
40614
- };
40615
- var TABLE_ACTION_COMMAND_IDS = Object.values(TABLE_ACTION_COMMAND_MAP);
40616
40518
  //#endregion
40617
40519
  //#region src/internal/toolbar/built-in/Toolbar.vue
40618
40520
  var _hoisted_1$10 = ["data-superdoc-ui-owner"];
@@ -42064,6 +41966,7 @@ var TableGrid_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_
42064
41966
  //#region src/internal/toolbar/built-in/TableActions.vue
42065
41967
  var _hoisted_1$1 = { class: "toolbar-table-actions" };
42066
41968
  var _hoisted_2$1 = [
41969
+ "aria-disabled",
42067
41970
  "onClick",
42068
41971
  "data-item",
42069
41972
  "ariaLabel"
@@ -42078,12 +41981,17 @@ var _sfc_main$1 = {
42078
41981
  setup(__props, { emit: __emit }) {
42079
41982
  const emit = __emit;
42080
41983
  const handleClick = (item) => {
41984
+ if (item.disabled) return;
42081
41985
  emit("select", { command: item.command });
42082
41986
  };
42083
41987
  return (_ctx, _cache) => {
42084
41988
  return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", _hoisted_1$1, [(require__plugin_vue_export_helper.openBlock(true), require__plugin_vue_export_helper.createElementBlock(require__plugin_vue_export_helper.Fragment, null, require__plugin_vue_export_helper.renderList(__props.options, (option) => {
42085
41989
  return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", {
42086
- class: require__plugin_vue_export_helper.normalizeClass(["toolbar-table-actions__item", { "toolbar-table-actions__item--border": option.bottomBorder }]),
41990
+ class: require__plugin_vue_export_helper.normalizeClass(["toolbar-table-actions__item", {
41991
+ "toolbar-table-actions__item--border": option.bottomBorder,
41992
+ "sd-disabled": option.disabled
41993
+ }]),
41994
+ "aria-disabled": option.disabled ? "true" : void 0,
42087
41995
  onClick: ($event) => handleClick(option),
42088
41996
  "data-item": option.props?.["data-item"] || "",
42089
41997
  ariaLabel: option.props?.ariaLabel,
@@ -42096,7 +42004,7 @@ var _sfc_main$1 = {
42096
42004
  };
42097
42005
  }
42098
42006
  };
42099
- var TableActions_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$1, [["__scopeId", "data-v-0cdad084"]]);
42007
+ var TableActions_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$1, [["__scopeId", "data-v-72123aae"]]);
42100
42008
  //#endregion
42101
42009
  //#region src/internal/toolbar/built-in/PageNumberMenu.vue
42102
42010
  var _hoisted_1 = ["aria-busy"];
@@ -43211,7 +43119,10 @@ var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts
43211
43119
  ];
43212
43120
  function renderTableActions(tableActionsItem) {
43213
43121
  return require__plugin_vue_export_helper.h(TableActions_default, {
43214
- options: tableActionsOptions,
43122
+ options: tableActionsOptions.map((option) => ({
43123
+ ...option,
43124
+ disabled: !superToolbar.isCommandEnabled(tableActionCommandId(option.command))
43125
+ })),
43215
43126
  onSelect: (event) => {
43216
43127
  closeDropdown(tableActionsItem);
43217
43128
  const { command } = event;
@@ -43986,8 +43897,6 @@ var findElementBySelector = (selector) => {
43986
43897
  * Internal only: nothing here is a public package export and no
43987
43898
  * `headless-toolbar*` subpath is reintroduced.
43988
43899
  */
43989
- var HEADLESS_COMMAND_IDS = HEADLESS_ITEM_MAP;
43990
- var TABLE_ACTION_COMMANDS = TABLE_ACTION_COMMAND_MAP;
43991
43900
  function isThenable(value) {
43992
43901
  return (typeof value === "object" || typeof value === "function") && value !== null && "then" in value && typeof value.then === "function";
43993
43902
  }
@@ -44003,15 +43912,6 @@ function isListenerTarget(value) {
44003
43912
  function hasClosest(target) {
44004
43913
  return target !== null && "closest" in target && typeof target.closest === "function";
44005
43914
  }
44006
- /**
44007
- * Resolve a legacy built-in item name to its canonical V2 controller command
44008
- * id. The compatibility catalog is the primary truth; a small supplemental map
44009
- * (`HEADLESS_ITEM_MAP`) covers documented items the renderer can surface that
44010
- * are not modeled as catalog rows yet (e.g. table-of-contents, direction).
44011
- */
44012
- function resolveCommandId(name) {
44013
- return resolveToolbarCommandId(name) ?? HEADLESS_COMMAND_IDS[name] ?? null;
44014
- }
44015
43915
  function executeCommand(ui, commandId, argument, options = {}) {
44016
43916
  if (!ui?.commands || !commandId) return false;
44017
43917
  if (typeof ui.commands.has === "function" && !ui.commands.has(commandId)) return false;
@@ -44532,18 +44432,22 @@ var BuiltInToolbar = class extends require_eventemitter3.import_eventemitter3.de
44532
44432
  #isFontFamilyMixedState(commandState) {
44533
44433
  return Boolean(commandState) && commandState?.disabled === false && commandState?.value == null;
44534
44434
  }
44435
+ isCommandEnabled(commandId) {
44436
+ if (!commandId) return false;
44437
+ const commandState = this.snapshot?.commands?.[commandId];
44438
+ return Boolean(commandState && !commandState.disabled);
44439
+ }
44535
44440
  #applyHeadlessState(item) {
44536
44441
  const name = item.name.value;
44537
44442
  if (item.isCustomToolbarItem && typeof item.command === "string") {
44538
44443
  const commandState = this.snapshot?.commands?.[item.command];
44539
- item.setDisabled(item.initiallyDisabled || !commandState || Boolean(commandState.disabled));
44444
+ item.setDisabled(item.initiallyDisabled || !this.isCommandEnabled(item.command));
44540
44445
  if (commandState?.active) item.activate();
44541
44446
  else item.deactivate();
44542
44447
  return true;
44543
44448
  }
44544
44449
  if (name === "tableActions") {
44545
- const hasAnyEnabled = TABLE_ACTION_COMMAND_IDS.map((commandId) => this.snapshot?.commands?.[commandId]).some((state) => state && !state.disabled);
44546
- item.setDisabled(!hasAnyEnabled);
44450
+ item.setDisabled(!TABLE_ACTION_COMMAND_IDS.some((commandId) => this.isCommandEnabled(commandId)));
44547
44451
  return true;
44548
44452
  }
44549
44453
  if (name === "search") {
@@ -44562,7 +44466,7 @@ var BuiltInToolbar = class extends require_eventemitter3.import_eventemitter3.de
44562
44466
  else item.deactivate();
44563
44467
  return true;
44564
44468
  }
44565
- const commandId = resolveCommandId(name);
44469
+ const commandId = resolveBuiltInItemCommandId(name);
44566
44470
  if (!commandId) return false;
44567
44471
  const commandState = this.snapshot?.commands?.[commandId];
44568
44472
  if (shouldKeepEnabledForV1ToolbarParity(name, commandState)) item.setDisabled(false);
@@ -44727,12 +44631,12 @@ var BuiltInToolbar = class extends require_eventemitter3.import_eventemitter3.de
44727
44631
  if (name === "image" && argument == null) return this.#startImagePick();
44728
44632
  if (name === "tableActions") {
44729
44633
  const tableAction = typeof argument === "object" && argument !== null && "command" in argument ? argument.command : void 0;
44730
- const commandId = typeof tableAction === "string" ? TABLE_ACTION_COMMANDS[tableAction] : void 0;
44634
+ const commandId = typeof tableAction === "string" ? tableActionCommandId(tableAction) : void 0;
44731
44635
  if (!commandId) return false;
44732
44636
  return executeCommand(this.ui, commandId, void 0, callbacks);
44733
44637
  }
44734
44638
  if (getBuiltInToolbarItem(name)?.disposition === "unsupported") return true;
44735
- const commandId = resolveCommandId(name);
44639
+ const commandId = resolveBuiltInItemCommandId(name);
44736
44640
  if (!commandId) return false;
44737
44641
  return executeCommand(this.ui, commandId, argument, callbacks);
44738
44642
  }
@@ -45398,7 +45302,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
45398
45302
  }
45399
45303
  this.userColorMap = /* @__PURE__ */ new Map();
45400
45304
  this.colorIndex = 0;
45401
- this.version = "2.28.0-next.17";
45305
+ this.version = "2.28.0-next.19";
45402
45306
  this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
45403
45307
  this.superdocId = config.superdocId || require_uuid.v4();
45404
45308
  this.colors = this.config.colors ?? [];