superdoc 2.28.0-next.18 → 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.
- package/dist/chunks/{create-super-doc-ui-gI3fiM_P.es.js → create-super-doc-ui-BEB7RtD6.es.js} +31 -1
- package/dist/chunks/{create-super-doc-ui-DOnTWcx7.cjs → create-super-doc-ui-DNe9BmHD.cjs} +36 -0
- package/dist/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/document-api/src/lists/lists.types.d.ts +1 -0
- package/dist/document-api/src/sections/sections.types.d.ts +5 -1
- package/dist/document-api/src/types/receipt.d.ts +1 -0
- package/dist/layout-engine/contracts/src/index.d.ts +2 -0
- package/dist/layout-engine/layout-bridge/src/index.d.ts +1 -0
- package/dist/layout-engine/layout-bridge/src/place-inline-drawings.d.ts +9 -0
- package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +2 -1
- package/dist/public/ui-react.cjs +1 -1
- package/dist/public/ui-react.es.js +1 -1
- package/dist/public/ui-vue.cjs +1 -1
- package/dist/public/ui-vue.es.js +1 -1
- package/dist/public/ui.cjs +1 -1
- package/dist/public/ui.es.js +1 -1
- package/dist/style.css +1 -1
- package/dist/style.layered.css +1 -1
- package/dist/superdoc/src/components/CommentsLayer/FloatingComments.vue.d.ts +11 -0
- package/dist/superdoc/src/components/CommentsLayer/PdfCommentsLayer.vue.d.ts +4 -0
- package/dist/superdoc/src/composables/use-superdoc-instance.d.ts +7 -0
- package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +0 -48
- package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +1 -0
- package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +16 -0
- package/dist/superdoc/src/public/ui/types.d.ts +9 -0
- package/dist/superdoc/src/public/ui.d.cts +4 -0
- package/dist/superdoc/src/public/ui.d.ts +1 -1
- package/dist/superdoc.cjs +108 -87
- package/dist/superdoc.es.js +303 -11377
- package/dist-cdn/style.layered.css +1 -1
- package/dist-cdn/superdoc.min.css +1 -1
- package/dist-cdn/superdoc.min.js +42 -42
- package/package.json +4 -3
|
@@ -31,6 +31,21 @@ export interface BuiltInToolbarItemEntry {
|
|
|
31
31
|
*/
|
|
32
32
|
readonly note?: string;
|
|
33
33
|
}
|
|
34
|
+
export declare const TABLE_ACTION_COMMAND_IDS_BY_OPTION: {
|
|
35
|
+
readonly addRowBefore: "table-add-row-before";
|
|
36
|
+
readonly addRowAfter: "table-add-row-after";
|
|
37
|
+
readonly deleteRow: "table-delete-row";
|
|
38
|
+
readonly addColumnBefore: "table-add-column-before";
|
|
39
|
+
readonly addColumnAfter: "table-add-column-after";
|
|
40
|
+
readonly deleteColumn: "table-delete-column";
|
|
41
|
+
readonly deleteTable: "table-delete";
|
|
42
|
+
readonly deleteCellAndTableBorders: "table-remove-borders";
|
|
43
|
+
readonly mergeCells: "table-merge-cells";
|
|
44
|
+
readonly splitCell: "table-split-cell";
|
|
45
|
+
readonly fixTables: "table-fix";
|
|
46
|
+
};
|
|
47
|
+
export declare const TABLE_ACTION_COMMAND_IDS: readonly string[];
|
|
48
|
+
export declare function tableActionCommandId(option: string): string | undefined;
|
|
34
49
|
/**
|
|
35
50
|
* The built-in toolbar compatibility catalog. Order groups items the way the
|
|
36
51
|
* docs present them; it is documentation-only.
|
|
@@ -51,6 +66,7 @@ export declare function listBuiltInToolbarItemsByGroup(group: ToolbarGroup): Bui
|
|
|
51
66
|
* id, or `null` when the item is not controller-routed.
|
|
52
67
|
*/
|
|
53
68
|
export declare function resolveToolbarCommandId(name: string): string | null;
|
|
69
|
+
export declare function resolveBuiltInItemCommandId(name: string): string | null;
|
|
54
70
|
/**
|
|
55
71
|
* Cross-check the catalog against the V2 command controller catalog so the two
|
|
56
72
|
* cannot drift. Throws on the first inconsistency. Exercised by the unit tests;
|
|
@@ -671,6 +671,12 @@ export interface ZoomSlice {
|
|
|
671
671
|
/** @deprecated Fit-width upper bound alias. Use `fitWidth.max`; this does not limit manual zoom. */
|
|
672
672
|
max: number;
|
|
673
673
|
}
|
|
674
|
+
export interface HistorySlice {
|
|
675
|
+
canUndo: boolean;
|
|
676
|
+
canRedo: boolean;
|
|
677
|
+
undoDepth: number;
|
|
678
|
+
redoDepth: number;
|
|
679
|
+
}
|
|
674
680
|
export interface SuperDocDocumentChange {
|
|
675
681
|
documentEpoch: string;
|
|
676
682
|
seq: number;
|
|
@@ -1230,6 +1236,7 @@ export interface ToolbarHandle extends SnapshotSubscribable<ToolbarSnapshotSlice
|
|
|
1230
1236
|
/** Execute a toolbar command by id and await its settled result. */
|
|
1231
1237
|
executeAsync(id: ToolbarCommandId, payload?: unknown): Promise<CommandExecutionResult>;
|
|
1232
1238
|
}
|
|
1239
|
+
export type HistoryHandle = SnapshotSubscribable<HistorySlice>;
|
|
1233
1240
|
/** Zoom handle. */
|
|
1234
1241
|
export interface ZoomHandle extends SnapshotSubscribable<ZoomSlice> {
|
|
1235
1242
|
/** Set an absolute zoom percentage (100 = 100%). */
|
|
@@ -1617,6 +1624,7 @@ export interface SuperDocUIState {
|
|
|
1617
1624
|
contentControls: ContentControlsSlice;
|
|
1618
1625
|
/** Zoom slice. */
|
|
1619
1626
|
zoom: ZoomSlice;
|
|
1627
|
+
history: HistorySlice;
|
|
1620
1628
|
/** Fonts slice. */
|
|
1621
1629
|
fonts: FontsSlice;
|
|
1622
1630
|
/** Styles slice (read-only catalogue + active paragraph style). */
|
|
@@ -1679,6 +1687,7 @@ export interface SuperDocUI {
|
|
|
1679
1687
|
readonly fonts: FontsHandle;
|
|
1680
1688
|
/** Zoom surface. */
|
|
1681
1689
|
readonly zoom: ZoomHandle;
|
|
1690
|
+
readonly history: HistoryHandle;
|
|
1682
1691
|
/** Document surface. */
|
|
1683
1692
|
readonly document: DocumentHandle;
|
|
1684
1693
|
/** Viewport / geometry surface. */
|
|
@@ -50,6 +50,8 @@ import type { FontFamilyOption as __Cjs_FontFamilyOption } from './ui.js' with {
|
|
|
50
50
|
import type { FontsHandle as __Cjs_FontsHandle } from './ui.js' with { "resolution-mode": "import" };
|
|
51
51
|
import type { FontSizeOption as __Cjs_FontSizeOption } from './ui.js' with { "resolution-mode": "import" };
|
|
52
52
|
import type { FontsSlice as __Cjs_FontsSlice } from './ui.js' with { "resolution-mode": "import" };
|
|
53
|
+
import type { HistoryHandle as __Cjs_HistoryHandle } from './ui.js' with { "resolution-mode": "import" };
|
|
54
|
+
import type { HistorySlice as __Cjs_HistorySlice } from './ui.js' with { "resolution-mode": "import" };
|
|
53
55
|
import type { MetadataHandle as __Cjs_MetadataHandle } from './ui.js' with { "resolution-mode": "import" };
|
|
54
56
|
import type { OperationCall as __Cjs_OperationCall } from './ui.js' with { "resolution-mode": "import" };
|
|
55
57
|
import type { OperationCapabilityResolveResult as __Cjs_OperationCapabilityResolveResult } from './ui.js' with { "resolution-mode": "import" };
|
|
@@ -208,6 +210,8 @@ export type { __Cjs_FontsHandle as FontsHandle };
|
|
|
208
210
|
export type { __Cjs_FontSizeOption as FontSizeOption };
|
|
209
211
|
export type { __Cjs_FontsSlice as FontsSlice };
|
|
210
212
|
export declare const getDocumentApiRejectionReason: typeof import('./ui.js', { with: { "resolution-mode": "import" } }).getDocumentApiRejectionReason;
|
|
213
|
+
export type { __Cjs_HistoryHandle as HistoryHandle };
|
|
214
|
+
export type { __Cjs_HistorySlice as HistorySlice };
|
|
211
215
|
export type { __Cjs_MetadataHandle as MetadataHandle };
|
|
212
216
|
export type { __Cjs_OperationCall as OperationCall };
|
|
213
217
|
export type { __Cjs_OperationCapabilityResolveResult as OperationCapabilityResolveResult };
|
|
@@ -18,5 +18,5 @@ export { createSuperDocUI } from './ui/create-super-doc-ui.js';
|
|
|
18
18
|
export { getDocumentApiRejectionReason } from './ui/rejection-reasons.js';
|
|
19
19
|
export { shallowEqual } from './ui/equality.js';
|
|
20
20
|
export { BUILT_IN_COMMAND_IDS } from './ui/commands.js';
|
|
21
|
-
export type { EqualityFn, SelectorFn, Subscribable, SuperDocUI, BorrowedSuperDocUI, SuperDocUIOptions, SuperDocUIState, SuperDocUIScope, SuperDocLike, SuperDocEditorLike, CommandHandle, CommandState, CommandExecutionResult, WorkflowReceipt, WorkflowActionResult, WorkflowScrollResult, SelectionRestoreResult, SuperDocUIReason, CommandId, CommandsHandle, ContextMenuItem, ContextMenuHandle, WatermarkHandle, SearchController, SearchHandle, SearchQueryOptions, CustomCommandContext, CustomCommandHandle, CustomCommandHandleState, CustomCommandRegistration, CustomCommandRegistrationResult, MetadataHandle, SelectionHandle, TablesHandle, TableContextInfo, ToolbarHandle, BuiltInCommandId, ToolbarCommandId, CommentsHandle, TrackChangesHandle, ContentControlsHandle, BookmarksHandle, BookmarkAddress, ContentControlFocusResult, ContentControlHighlightResult, FontsHandle, ZoomHandle, DocumentHandle, DocumentReplacementResult, SuperDocDocumentChange, DocumentVersion, DocumentMarkCleanResult, ScopedDocumentHandle, ViewportHandle, DecorationsHandle, DecorationPointerEvent, StylesHandle, StylesUpdateToMatchSelectionInput, ActiveParagraphStyle, SliceStatus, SelectionSlice, SelectionCapture, CommentAnchorCapture, ToolbarSnapshotSlice, CommentsSlice, TrackChangesSlice, ContentControlsSlice, FontsSlice, ZoomSlice, DocumentSlice, StylesSlice, SearchSnapshot, SearchSlice, StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, CommentInfo, CommentsListQuery, TrackChangeInfo, TrackChangePointHit, TrackChangesItem, FontFamilyOption, FontSizeOption, CommentAddress, TrackedChangeAddress, ContentControlViewportAddress, ViewportEntityAddress, ViewportEntityHit, ViewportContext, ViewportRect, ViewportGetRectInput, ViewportGetRectTarget, ViewportGetRectsInput, ViewportGetRectsResult, ViewportRectResult, BrowserDocumentApi, PartialBrowserDocumentApi, DocumentApi, Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, ScrollIntoViewInput, ScrollIntoViewOutput, EntityAddress, CommentsListResult, TrackChangesListResult, ContentControlsListResult, ContentControlInfo, ContentControlTarget, RichContentInsertInput, OperationCapabilityResolveResult, SDHtmlMarkdownSupportCheckResult, PictureWatermarkInput, RetainedPictureWatermarkInput, TextWatermark, WatermarkInfo, WatermarkTarget, WatermarksApplyInput, WatermarksApplyResult, WatermarksApplySuccess, WatermarksApplyTarget, TemporaryMutationOperation, TemporaryOperationResultTarget, TemporaryOperationEffects, TemporaryMutationInput, TemporaryMutationReplaceInput, TemporaryMutationHandleInput, TemporaryMutationReceipt, DocumentStoryLocator, OperationId, OperationCall, OperationInput, OperationOptions, OperationOutput, } from './ui/types.js';
|
|
21
|
+
export type { EqualityFn, SelectorFn, Subscribable, SuperDocUI, BorrowedSuperDocUI, SuperDocUIOptions, SuperDocUIState, SuperDocUIScope, SuperDocLike, SuperDocEditorLike, CommandHandle, CommandState, CommandExecutionResult, WorkflowReceipt, WorkflowActionResult, WorkflowScrollResult, SelectionRestoreResult, SuperDocUIReason, CommandId, CommandsHandle, ContextMenuItem, ContextMenuHandle, WatermarkHandle, SearchController, SearchHandle, SearchQueryOptions, CustomCommandContext, CustomCommandHandle, CustomCommandHandleState, CustomCommandRegistration, CustomCommandRegistrationResult, MetadataHandle, SelectionHandle, TablesHandle, TableContextInfo, ToolbarHandle, BuiltInCommandId, ToolbarCommandId, CommentsHandle, TrackChangesHandle, ContentControlsHandle, BookmarksHandle, BookmarkAddress, ContentControlFocusResult, ContentControlHighlightResult, FontsHandle, ZoomHandle, HistoryHandle, DocumentHandle, DocumentReplacementResult, SuperDocDocumentChange, DocumentVersion, DocumentMarkCleanResult, ScopedDocumentHandle, ViewportHandle, DecorationsHandle, DecorationPointerEvent, StylesHandle, StylesUpdateToMatchSelectionInput, ActiveParagraphStyle, SliceStatus, SelectionSlice, SelectionCapture, CommentAnchorCapture, ToolbarSnapshotSlice, CommentsSlice, TrackChangesSlice, ContentControlsSlice, FontsSlice, ZoomSlice, HistorySlice, DocumentSlice, StylesSlice, SearchSnapshot, SearchSlice, StyleCatalogView, StyleCatalogItemType, StyleCatalogFilterType, StyleProvenance, StyleCatalogItemVisibility, StyleCatalogItemUsage, StyleCatalogItemPreview, StyleCatalogItem, StyleCatalogDefaults, StyleCatalogDiagnostic, StyleCatalogSourceStatus, StylesGetCatalogInput, StylesGetCatalogResult, CommentInfo, CommentsListQuery, TrackChangeInfo, TrackChangePointHit, TrackChangesItem, FontFamilyOption, FontSizeOption, CommentAddress, TrackedChangeAddress, ContentControlViewportAddress, ViewportEntityAddress, ViewportEntityHit, ViewportContext, ViewportRect, ViewportGetRectInput, ViewportGetRectTarget, ViewportGetRectsInput, ViewportGetRectsResult, ViewportRectResult, BrowserDocumentApi, PartialBrowserDocumentApi, DocumentApi, Receipt, DocumentApiRejectionReason, DocumentApiRejectionDetails, TextRangeRejectionReason, ContentControlCreationRejectionReason, SelectionInfo, SelectionTarget, SelectionPoint, TextTarget, TextAddress, ScrollIntoViewInput, ScrollIntoViewOutput, EntityAddress, CommentsListResult, TrackChangesListResult, ContentControlsListResult, ContentControlInfo, ContentControlTarget, RichContentInsertInput, OperationCapabilityResolveResult, SDHtmlMarkdownSupportCheckResult, PictureWatermarkInput, RetainedPictureWatermarkInput, TextWatermark, WatermarkInfo, WatermarkTarget, WatermarksApplyInput, WatermarksApplyResult, WatermarksApplySuccess, WatermarksApplyTarget, TemporaryMutationOperation, TemporaryOperationResultTarget, TemporaryOperationEffects, TemporaryMutationInput, TemporaryMutationReplaceInput, TemporaryMutationHandleInput, TemporaryMutationReceipt, DocumentStoryLocator, OperationId, OperationCall, OperationInput, OperationOptions, OperationOutput, } from './ui/types.js';
|
|
22
22
|
export type { PageMetricsHandle, PageMetricsSnapshot, PageMetricsPage, PageBodyTarget } from './ui/page-metrics.js';
|
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-
|
|
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.
|
|
261
|
+
return "2.28.0-next.19";
|
|
262
262
|
} catch {
|
|
263
263
|
return "unknown";
|
|
264
264
|
}
|
|
@@ -15963,6 +15963,18 @@ function useHighContrastMode() {
|
|
|
15963
15963
|
setHighContrastMode
|
|
15964
15964
|
};
|
|
15965
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
|
+
}
|
|
15966
15978
|
var VALID_COMMENTS_LAYOUTS = /* @__PURE__ */ new Set([
|
|
15967
15979
|
"auto",
|
|
15968
15980
|
"sidebar",
|
|
@@ -20981,9 +20993,9 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
|
|
|
20981
20993
|
});
|
|
20982
20994
|
const { getConfig, documentsWithConverations, commentsList, pendingComment, activeComment, skipSelectionUpdate, commentsByDocument, isCommentsListVisible, isFloatingCommentsReady, generalCommentIds, hasSyncedCollaborationComments, editorCommentPositions, hasInitializedLocations, isCommentHighlighted, hasOpenTrackedChanges } = storeToRefs(commentsStore);
|
|
20983
20995
|
const { showAddComment, handleEditorLocationsUpdate, handleTrackedChangeUpdate, addComment, addHydratedComment, getComment, resolveCommentPositionEntry, belongsToDocument, COMMENT_EVENTS, requestInstantSidebarAlignment, peekInstantSidebarAlignment, clearInstantSidebarAlignment } = commentsStore;
|
|
20984
|
-
const { proxy } =
|
|
20996
|
+
const { proxy, superdoc } = useSuperDocInstance();
|
|
20985
20997
|
commentsStore.proxy = proxy;
|
|
20986
|
-
const documentOpenTelemetry = createDocumentOpenTelemetry(
|
|
20998
|
+
const documentOpenTelemetry = createDocumentOpenTelemetry(superdoc.config);
|
|
20987
20999
|
const resolvedEditorIntegration = createDefaultV2Integration();
|
|
20988
21000
|
const V2DocumentEditor = require__plugin_vue_export_helper.markRaw(resolvedEditorIntegration.EditorComponent);
|
|
20989
21001
|
const V2Ruler = resolvedEditorIntegration.RulerComponent ? require__plugin_vue_export_helper.markRaw(resolvedEditorIntegration.RulerComponent) : null;
|
|
@@ -21093,7 +21105,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
|
|
|
21093
21105
|
});
|
|
21094
21106
|
}
|
|
21095
21107
|
});
|
|
21096
|
-
const pdfConfig =
|
|
21108
|
+
const pdfConfig = superdoc.config.modules?.pdf || {};
|
|
21097
21109
|
const handleDocumentReady = (documentId, container) => {
|
|
21098
21110
|
const doc = getDocument(documentId);
|
|
21099
21111
|
if (!doc || doc.loadScope && !doc.loadScope.finish()) return;
|
|
@@ -23549,7 +23561,7 @@ var SuperDoc_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_v
|
|
|
23549
23561
|
], 46, _hoisted_1$17);
|
|
23550
23562
|
};
|
|
23551
23563
|
}
|
|
23552
|
-
}, [["__scopeId", "data-v-
|
|
23564
|
+
}, [["__scopeId", "data-v-ba00d895"]]);
|
|
23553
23565
|
//#endregion
|
|
23554
23566
|
//#region src/core/create-app.js
|
|
23555
23567
|
var PINIA_DEVTOOLS_SETUP_EVENT = "devtools-plugin:setup";
|
|
@@ -37668,6 +37680,69 @@ var EditorRuntimeRegistry = class {
|
|
|
37668
37680
|
} catch {}
|
|
37669
37681
|
}
|
|
37670
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" };
|
|
37671
37746
|
/**
|
|
37672
37747
|
* The built-in toolbar compatibility catalog. Order groups items the way the
|
|
37673
37748
|
* docs present them; it is documentation-only.
|
|
@@ -37839,18 +37914,7 @@ var BUILT_IN_TOOLBAR_CATALOG = [
|
|
|
37839
37914
|
instanceMethod: null,
|
|
37840
37915
|
disposition: "shell-owned",
|
|
37841
37916
|
group: "center",
|
|
37842
|
-
memberCommandIds:
|
|
37843
|
-
"table-add-row-before",
|
|
37844
|
-
"table-add-row-after",
|
|
37845
|
-
"table-delete-row",
|
|
37846
|
-
"table-add-column-before",
|
|
37847
|
-
"table-add-column-after",
|
|
37848
|
-
"table-delete-column",
|
|
37849
|
-
"table-delete",
|
|
37850
|
-
"table-merge-cells",
|
|
37851
|
-
"table-split-cell",
|
|
37852
|
-
"table-remove-borders"
|
|
37853
|
-
],
|
|
37917
|
+
memberCommandIds: ROUTED_TABLE_ACTION_COMMAND_IDS,
|
|
37854
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"
|
|
37855
37919
|
},
|
|
37856
37920
|
{
|
|
@@ -37950,6 +38014,9 @@ function resolveToolbarCommandId(name) {
|
|
|
37950
38014
|
const entry = CATALOG_BY_NAME.get(name);
|
|
37951
38015
|
return entry?.disposition === "controller-routed" ? entry.commandId : null;
|
|
37952
38016
|
}
|
|
38017
|
+
function resolveBuiltInItemCommandId(name) {
|
|
38018
|
+
return resolveToolbarCommandId(name) ?? UNCATALOGED_ITEM_COMMAND_IDS[name] ?? null;
|
|
38019
|
+
}
|
|
37953
38020
|
//#endregion
|
|
37954
38021
|
//#region src/internal/toolbar/built-in/helpers.js
|
|
37955
38022
|
var sanitizeNumber = (value, defaultNumber) => {
|
|
@@ -40448,54 +40515,6 @@ var RESPONSIVE_BREAKPOINTS = {
|
|
|
40448
40515
|
lg: 1280,
|
|
40449
40516
|
xl: 1410
|
|
40450
40517
|
};
|
|
40451
|
-
var HEADLESS_ITEM_MAP = {
|
|
40452
|
-
undo: "undo",
|
|
40453
|
-
redo: "redo",
|
|
40454
|
-
bold: "bold",
|
|
40455
|
-
italic: "italic",
|
|
40456
|
-
underline: "underline",
|
|
40457
|
-
strike: "strikethrough",
|
|
40458
|
-
acceptTrackedChangeBySelection: "track-changes-accept-selection",
|
|
40459
|
-
rejectTrackedChangeOnSelection: "track-changes-reject-selection",
|
|
40460
|
-
ruler: "ruler",
|
|
40461
|
-
formattingMarks: "formatting-marks",
|
|
40462
|
-
zoom: "zoom",
|
|
40463
|
-
measurementUnit: "measurement-unit",
|
|
40464
|
-
documentMode: "document-mode",
|
|
40465
|
-
link: "link",
|
|
40466
|
-
fontFamily: "font-family",
|
|
40467
|
-
fontSize: "font-size",
|
|
40468
|
-
list: "bullet-list",
|
|
40469
|
-
numberedlist: "numbered-list",
|
|
40470
|
-
table: "table-insert",
|
|
40471
|
-
image: "image",
|
|
40472
|
-
tableOfContents: "table-of-contents-insert",
|
|
40473
|
-
color: "text-color",
|
|
40474
|
-
highlight: "highlight-color",
|
|
40475
|
-
textAlign: "text-align",
|
|
40476
|
-
lineHeight: "line-height",
|
|
40477
|
-
linkedStyles: "linked-style",
|
|
40478
|
-
indentleft: "indent-decrease",
|
|
40479
|
-
indentright: "indent-increase",
|
|
40480
|
-
directionLtr: "direction-ltr",
|
|
40481
|
-
directionRtl: "direction-rtl",
|
|
40482
|
-
clearFormatting: "clear-formatting",
|
|
40483
|
-
copyFormat: "copy-format"
|
|
40484
|
-
};
|
|
40485
|
-
var TABLE_ACTION_COMMAND_MAP = {
|
|
40486
|
-
addRowBefore: "table-add-row-before",
|
|
40487
|
-
addRowAfter: "table-add-row-after",
|
|
40488
|
-
deleteRow: "table-delete-row",
|
|
40489
|
-
addColumnBefore: "table-add-column-before",
|
|
40490
|
-
addColumnAfter: "table-add-column-after",
|
|
40491
|
-
deleteColumn: "table-delete-column",
|
|
40492
|
-
deleteTable: "table-delete",
|
|
40493
|
-
deleteCellAndTableBorders: "table-remove-borders",
|
|
40494
|
-
mergeCells: "table-merge-cells",
|
|
40495
|
-
splitCell: "table-split-cell",
|
|
40496
|
-
fixTables: "table-fix"
|
|
40497
|
-
};
|
|
40498
|
-
var TABLE_ACTION_COMMAND_IDS = Object.values(TABLE_ACTION_COMMAND_MAP);
|
|
40499
40518
|
//#endregion
|
|
40500
40519
|
//#region src/internal/toolbar/built-in/Toolbar.vue
|
|
40501
40520
|
var _hoisted_1$10 = ["data-superdoc-ui-owner"];
|
|
@@ -41947,6 +41966,7 @@ var TableGrid_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_
|
|
|
41947
41966
|
//#region src/internal/toolbar/built-in/TableActions.vue
|
|
41948
41967
|
var _hoisted_1$1 = { class: "toolbar-table-actions" };
|
|
41949
41968
|
var _hoisted_2$1 = [
|
|
41969
|
+
"aria-disabled",
|
|
41950
41970
|
"onClick",
|
|
41951
41971
|
"data-item",
|
|
41952
41972
|
"ariaLabel"
|
|
@@ -41961,12 +41981,17 @@ var _sfc_main$1 = {
|
|
|
41961
41981
|
setup(__props, { emit: __emit }) {
|
|
41962
41982
|
const emit = __emit;
|
|
41963
41983
|
const handleClick = (item) => {
|
|
41984
|
+
if (item.disabled) return;
|
|
41964
41985
|
emit("select", { command: item.command });
|
|
41965
41986
|
};
|
|
41966
41987
|
return (_ctx, _cache) => {
|
|
41967
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) => {
|
|
41968
41989
|
return require__plugin_vue_export_helper.openBlock(), require__plugin_vue_export_helper.createElementBlock("div", {
|
|
41969
|
-
class: require__plugin_vue_export_helper.normalizeClass(["toolbar-table-actions__item", {
|
|
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,
|
|
41970
41995
|
onClick: ($event) => handleClick(option),
|
|
41971
41996
|
"data-item": option.props?.["data-item"] || "",
|
|
41972
41997
|
ariaLabel: option.props?.ariaLabel,
|
|
@@ -41979,7 +42004,7 @@ var _sfc_main$1 = {
|
|
|
41979
42004
|
};
|
|
41980
42005
|
}
|
|
41981
42006
|
};
|
|
41982
|
-
var TableActions_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$1, [["__scopeId", "data-v-
|
|
42007
|
+
var TableActions_default = /*#__PURE__*/ require__plugin_vue_export_helper._plugin_vue_export_helper_default(_sfc_main$1, [["__scopeId", "data-v-72123aae"]]);
|
|
41983
42008
|
//#endregion
|
|
41984
42009
|
//#region src/internal/toolbar/built-in/PageNumberMenu.vue
|
|
41985
42010
|
var _hoisted_1 = ["aria-busy"];
|
|
@@ -43094,7 +43119,10 @@ var makeDefaultItems = ({ superToolbar, toolbarIcons, toolbarTexts, toolbarFonts
|
|
|
43094
43119
|
];
|
|
43095
43120
|
function renderTableActions(tableActionsItem) {
|
|
43096
43121
|
return require__plugin_vue_export_helper.h(TableActions_default, {
|
|
43097
|
-
options: tableActionsOptions
|
|
43122
|
+
options: tableActionsOptions.map((option) => ({
|
|
43123
|
+
...option,
|
|
43124
|
+
disabled: !superToolbar.isCommandEnabled(tableActionCommandId(option.command))
|
|
43125
|
+
})),
|
|
43098
43126
|
onSelect: (event) => {
|
|
43099
43127
|
closeDropdown(tableActionsItem);
|
|
43100
43128
|
const { command } = event;
|
|
@@ -43869,8 +43897,6 @@ var findElementBySelector = (selector) => {
|
|
|
43869
43897
|
* Internal only: nothing here is a public package export and no
|
|
43870
43898
|
* `headless-toolbar*` subpath is reintroduced.
|
|
43871
43899
|
*/
|
|
43872
|
-
var HEADLESS_COMMAND_IDS = HEADLESS_ITEM_MAP;
|
|
43873
|
-
var TABLE_ACTION_COMMANDS = TABLE_ACTION_COMMAND_MAP;
|
|
43874
43900
|
function isThenable(value) {
|
|
43875
43901
|
return (typeof value === "object" || typeof value === "function") && value !== null && "then" in value && typeof value.then === "function";
|
|
43876
43902
|
}
|
|
@@ -43886,15 +43912,6 @@ function isListenerTarget(value) {
|
|
|
43886
43912
|
function hasClosest(target) {
|
|
43887
43913
|
return target !== null && "closest" in target && typeof target.closest === "function";
|
|
43888
43914
|
}
|
|
43889
|
-
/**
|
|
43890
|
-
* Resolve a legacy built-in item name to its canonical V2 controller command
|
|
43891
|
-
* id. The compatibility catalog is the primary truth; a small supplemental map
|
|
43892
|
-
* (`HEADLESS_ITEM_MAP`) covers documented items the renderer can surface that
|
|
43893
|
-
* are not modeled as catalog rows yet (e.g. table-of-contents, direction).
|
|
43894
|
-
*/
|
|
43895
|
-
function resolveCommandId(name) {
|
|
43896
|
-
return resolveToolbarCommandId(name) ?? HEADLESS_COMMAND_IDS[name] ?? null;
|
|
43897
|
-
}
|
|
43898
43915
|
function executeCommand(ui, commandId, argument, options = {}) {
|
|
43899
43916
|
if (!ui?.commands || !commandId) return false;
|
|
43900
43917
|
if (typeof ui.commands.has === "function" && !ui.commands.has(commandId)) return false;
|
|
@@ -44415,18 +44432,22 @@ var BuiltInToolbar = class extends require_eventemitter3.import_eventemitter3.de
|
|
|
44415
44432
|
#isFontFamilyMixedState(commandState) {
|
|
44416
44433
|
return Boolean(commandState) && commandState?.disabled === false && commandState?.value == null;
|
|
44417
44434
|
}
|
|
44435
|
+
isCommandEnabled(commandId) {
|
|
44436
|
+
if (!commandId) return false;
|
|
44437
|
+
const commandState = this.snapshot?.commands?.[commandId];
|
|
44438
|
+
return Boolean(commandState && !commandState.disabled);
|
|
44439
|
+
}
|
|
44418
44440
|
#applyHeadlessState(item) {
|
|
44419
44441
|
const name = item.name.value;
|
|
44420
44442
|
if (item.isCustomToolbarItem && typeof item.command === "string") {
|
|
44421
44443
|
const commandState = this.snapshot?.commands?.[item.command];
|
|
44422
|
-
item.setDisabled(item.initiallyDisabled || !
|
|
44444
|
+
item.setDisabled(item.initiallyDisabled || !this.isCommandEnabled(item.command));
|
|
44423
44445
|
if (commandState?.active) item.activate();
|
|
44424
44446
|
else item.deactivate();
|
|
44425
44447
|
return true;
|
|
44426
44448
|
}
|
|
44427
44449
|
if (name === "tableActions") {
|
|
44428
|
-
|
|
44429
|
-
item.setDisabled(!hasAnyEnabled);
|
|
44450
|
+
item.setDisabled(!TABLE_ACTION_COMMAND_IDS.some((commandId) => this.isCommandEnabled(commandId)));
|
|
44430
44451
|
return true;
|
|
44431
44452
|
}
|
|
44432
44453
|
if (name === "search") {
|
|
@@ -44445,7 +44466,7 @@ var BuiltInToolbar = class extends require_eventemitter3.import_eventemitter3.de
|
|
|
44445
44466
|
else item.deactivate();
|
|
44446
44467
|
return true;
|
|
44447
44468
|
}
|
|
44448
|
-
const commandId =
|
|
44469
|
+
const commandId = resolveBuiltInItemCommandId(name);
|
|
44449
44470
|
if (!commandId) return false;
|
|
44450
44471
|
const commandState = this.snapshot?.commands?.[commandId];
|
|
44451
44472
|
if (shouldKeepEnabledForV1ToolbarParity(name, commandState)) item.setDisabled(false);
|
|
@@ -44610,12 +44631,12 @@ var BuiltInToolbar = class extends require_eventemitter3.import_eventemitter3.de
|
|
|
44610
44631
|
if (name === "image" && argument == null) return this.#startImagePick();
|
|
44611
44632
|
if (name === "tableActions") {
|
|
44612
44633
|
const tableAction = typeof argument === "object" && argument !== null && "command" in argument ? argument.command : void 0;
|
|
44613
|
-
const commandId = typeof tableAction === "string" ?
|
|
44634
|
+
const commandId = typeof tableAction === "string" ? tableActionCommandId(tableAction) : void 0;
|
|
44614
44635
|
if (!commandId) return false;
|
|
44615
44636
|
return executeCommand(this.ui, commandId, void 0, callbacks);
|
|
44616
44637
|
}
|
|
44617
44638
|
if (getBuiltInToolbarItem(name)?.disposition === "unsupported") return true;
|
|
44618
|
-
const commandId =
|
|
44639
|
+
const commandId = resolveBuiltInItemCommandId(name);
|
|
44619
44640
|
if (!commandId) return false;
|
|
44620
44641
|
return executeCommand(this.ui, commandId, argument, callbacks);
|
|
44621
44642
|
}
|
|
@@ -45281,7 +45302,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
45281
45302
|
}
|
|
45282
45303
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
45283
45304
|
this.colorIndex = 0;
|
|
45284
|
-
this.version = "2.28.0-next.
|
|
45305
|
+
this.version = "2.28.0-next.19";
|
|
45285
45306
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
45286
45307
|
this.superdocId = config.superdocId || require_uuid.v4();
|
|
45287
45308
|
this.colors = this.config.colors ?? [];
|