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.
Files changed (34) hide show
  1. package/dist/chunks/{create-super-doc-ui-gI3fiM_P.es.js → create-super-doc-ui-BEB7RtD6.es.js} +31 -1
  2. package/dist/chunks/{create-super-doc-ui-DOnTWcx7.cjs → create-super-doc-ui-DNe9BmHD.cjs} +36 -0
  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/lists/lists.types.d.ts +1 -0
  6. package/dist/document-api/src/sections/sections.types.d.ts +5 -1
  7. package/dist/document-api/src/types/receipt.d.ts +1 -0
  8. package/dist/layout-engine/contracts/src/index.d.ts +2 -0
  9. package/dist/layout-engine/layout-bridge/src/index.d.ts +1 -0
  10. package/dist/layout-engine/layout-bridge/src/place-inline-drawings.d.ts +9 -0
  11. package/dist/layout-engine/layout-engine/src/layout-drawing.d.ts +2 -1
  12. package/dist/public/ui-react.cjs +1 -1
  13. package/dist/public/ui-react.es.js +1 -1
  14. package/dist/public/ui-vue.cjs +1 -1
  15. package/dist/public/ui-vue.es.js +1 -1
  16. package/dist/public/ui.cjs +1 -1
  17. package/dist/public/ui.es.js +1 -1
  18. package/dist/style.css +1 -1
  19. package/dist/style.layered.css +1 -1
  20. package/dist/superdoc/src/components/CommentsLayer/FloatingComments.vue.d.ts +11 -0
  21. package/dist/superdoc/src/components/CommentsLayer/PdfCommentsLayer.vue.d.ts +4 -0
  22. package/dist/superdoc/src/composables/use-superdoc-instance.d.ts +7 -0
  23. package/dist/superdoc/src/internal/toolbar/built-in/constants.d.ts +0 -48
  24. package/dist/superdoc/src/internal/toolbar/built-in-toolbar.d.ts +1 -0
  25. package/dist/superdoc/src/internal/toolbar/compatibility-catalog.d.ts +16 -0
  26. package/dist/superdoc/src/public/ui/types.d.ts +9 -0
  27. package/dist/superdoc/src/public/ui.d.cts +4 -0
  28. package/dist/superdoc/src/public/ui.d.ts +1 -1
  29. package/dist/superdoc.cjs +108 -87
  30. package/dist/superdoc.es.js +303 -11377
  31. package/dist-cdn/style.layered.css +1 -1
  32. package/dist-cdn/superdoc.min.css +1 -1
  33. package/dist-cdn/superdoc.min.js +42 -42
  34. package/package.json +4 -3
@@ -8139,6 +8139,33 @@ function createSuperDocUI(options) {
8139
8139
  sizeOptions: DEFAULT_FONT_SIZE_OPTIONS
8140
8140
  };
8141
8141
  };
8142
+ const EMPTY_HISTORY = {
8143
+ canUndo: false,
8144
+ canRedo: false,
8145
+ undoDepth: 0,
8146
+ redoDepth: 0
8147
+ };
8148
+ let historySlice = EMPTY_HISTORY;
8149
+ let historySource = null;
8150
+ const computeHistory = () => {
8151
+ const source = getEditCommands();
8152
+ if (source !== historySource) {
8153
+ historySource = source;
8154
+ historySlice = EMPTY_HISTORY;
8155
+ }
8156
+ const getSnapshot = hostMethod(source, "getSnapshot");
8157
+ const snapshot = getSnapshot ? safeCall(() => getSnapshot(), null) : null;
8158
+ const { undoDepth, redoDepth } = (isPlainObject(snapshot) && isPlainObject(snapshot.history) ? snapshot.history : null) ?? {};
8159
+ if (typeof undoDepth !== "number" || typeof redoDepth !== "number") return historySlice;
8160
+ const next = {
8161
+ canUndo: undoDepth > 0,
8162
+ canRedo: redoDepth > 0,
8163
+ undoDepth,
8164
+ redoDepth
8165
+ };
8166
+ if (!shallowEqual(next, historySlice)) historySlice = next;
8167
+ return historySlice;
8168
+ };
8142
8169
  let zoomFitWidth;
8143
8170
  const computeZoom = () => {
8144
8171
  const getZoomState = hostMethod(superdoc, "getZoomState");
@@ -9951,6 +9978,7 @@ function createSuperDocUI(options) {
9951
9978
  trackChanges: measure("trackChanges", () => computeTrackChanges(selection)),
9952
9979
  contentControls: measure("contentControls", () => computeContentControls(selection)),
9953
9980
  zoom: measure("zoom", computeZoom),
9981
+ history: measure("history", computeHistory),
9954
9982
  fonts: measure("fonts", computeFonts),
9955
9983
  styles: measure("styles", () => computeStyles(selection))
9956
9984
  };
@@ -13792,6 +13820,7 @@ function createSuperDocUI(options) {
13792
13820
  getFamilyOptions: () => state.fonts.options,
13793
13821
  getSizeOptions: () => state.fonts.sizeOptions
13794
13822
  };
13823
+ const history = snapshotHandle(sliceHandle((s) => s.history));
13795
13824
  const zoomSnap = snapshotHandle(sliceHandle((s) => s.zoom));
13796
13825
  const zoom = {
13797
13826
  get: zoomSnap.get,
@@ -15465,6 +15494,7 @@ function createSuperDocUI(options) {
15465
15494
  bookmarks,
15466
15495
  fonts,
15467
15496
  zoom,
15497
+ history,
15468
15498
  document: documentHandle,
15469
15499
  viewport,
15470
15500
  decorations,
@@ -15686,4 +15716,4 @@ function commandIsActive(descriptor, selection) {
15686
15716
  return descriptor.activeMark ? selection.activeMarks.includes(descriptor.activeMark) : false;
15687
15717
  }
15688
15718
  //#endregion
15689
- export { closeInteractionHistory as _, registerFirstPartyCommandMutation as a, isWorkflowRecordingEnabled as b, applyV2CommentInvalidationFromMutation as c, isPlainObject as d, createImageFilePicker as f, DOM_CLASS_NAMES as g, isSyntheticTrackedChangeCommentLaneItem as h, readFirstPartyPageNumbers as i, getV2TrackedChangeMutationImpact as l, shallowEqual as m, executeFirstPartyCommandAsync as n, isRecord as o, resolveImageSrc as p, executeFirstPartyShortcutAsync as r, BUILT_IN_COMMAND_IDS as s, createSuperDocUI as t, mutationCommittedEventChangedDocument as u, createInteractionHistory as v, recordInteraction as x, getWorkflowRecording as y };
15719
+ export { recordInteraction as S, DOM_CLASS_NAMES as _, registerFirstPartyCommandMutation as a, getWorkflowRecording as b, getCommandDescriptor as c, mutationCommittedEventChangedDocument as d, isPlainObject as f, isSyntheticTrackedChangeCommentLaneItem as g, shallowEqual as h, readFirstPartyPageNumbers as i, applyV2CommentInvalidationFromMutation as l, resolveImageSrc as m, executeFirstPartyCommandAsync as n, isRecord as o, createImageFilePicker as p, executeFirstPartyShortcutAsync as r, BUILT_IN_COMMAND_IDS as s, createSuperDocUI as t, getV2TrackedChangeMutationImpact as u, closeInteractionHistory as v, isWorkflowRecordingEnabled as x, createInteractionHistory as y };
@@ -8140,6 +8140,33 @@ function createSuperDocUI(options) {
8140
8140
  sizeOptions: DEFAULT_FONT_SIZE_OPTIONS
8141
8141
  };
8142
8142
  };
8143
+ const EMPTY_HISTORY = {
8144
+ canUndo: false,
8145
+ canRedo: false,
8146
+ undoDepth: 0,
8147
+ redoDepth: 0
8148
+ };
8149
+ let historySlice = EMPTY_HISTORY;
8150
+ let historySource = null;
8151
+ const computeHistory = () => {
8152
+ const source = getEditCommands();
8153
+ if (source !== historySource) {
8154
+ historySource = source;
8155
+ historySlice = EMPTY_HISTORY;
8156
+ }
8157
+ const getSnapshot = hostMethod(source, "getSnapshot");
8158
+ const snapshot = getSnapshot ? safeCall(() => getSnapshot(), null) : null;
8159
+ const { undoDepth, redoDepth } = (isPlainObject(snapshot) && isPlainObject(snapshot.history) ? snapshot.history : null) ?? {};
8160
+ if (typeof undoDepth !== "number" || typeof redoDepth !== "number") return historySlice;
8161
+ const next = {
8162
+ canUndo: undoDepth > 0,
8163
+ canRedo: redoDepth > 0,
8164
+ undoDepth,
8165
+ redoDepth
8166
+ };
8167
+ if (!shallowEqual(next, historySlice)) historySlice = next;
8168
+ return historySlice;
8169
+ };
8143
8170
  let zoomFitWidth;
8144
8171
  const computeZoom = () => {
8145
8172
  const getZoomState = hostMethod(superdoc, "getZoomState");
@@ -9952,6 +9979,7 @@ function createSuperDocUI(options) {
9952
9979
  trackChanges: measure("trackChanges", () => computeTrackChanges(selection)),
9953
9980
  contentControls: measure("contentControls", () => computeContentControls(selection)),
9954
9981
  zoom: measure("zoom", computeZoom),
9982
+ history: measure("history", computeHistory),
9955
9983
  fonts: measure("fonts", computeFonts),
9956
9984
  styles: measure("styles", () => computeStyles(selection))
9957
9985
  };
@@ -13793,6 +13821,7 @@ function createSuperDocUI(options) {
13793
13821
  getFamilyOptions: () => state.fonts.options,
13794
13822
  getSizeOptions: () => state.fonts.sizeOptions
13795
13823
  };
13824
+ const history = snapshotHandle(sliceHandle((s) => s.history));
13796
13825
  const zoomSnap = snapshotHandle(sliceHandle((s) => s.zoom));
13797
13826
  const zoom = {
13798
13827
  get: zoomSnap.get,
@@ -15466,6 +15495,7 @@ function createSuperDocUI(options) {
15466
15495
  bookmarks,
15467
15496
  fonts,
15468
15497
  zoom,
15498
+ history,
15469
15499
  document: documentHandle,
15470
15500
  viewport,
15471
15501
  decorations,
@@ -15741,6 +15771,12 @@ Object.defineProperty(exports, "executeFirstPartyShortcutAsync", {
15741
15771
  return executeFirstPartyShortcutAsync;
15742
15772
  }
15743
15773
  });
15774
+ Object.defineProperty(exports, "getCommandDescriptor", {
15775
+ enumerable: true,
15776
+ get: function() {
15777
+ return getCommandDescriptor;
15778
+ }
15779
+ });
15744
15780
  Object.defineProperty(exports, "getV2TrackedChangeMutationImpact", {
15745
15781
  enumerable: true,
15746
15782
  get: function() {
@@ -19,7 +19,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
19
19
  var PRIVATE_ENGINE_INFO = (0, _superdoc_docx_engine_collaboration_upgrade_engine.getCollaborationUpgradeEngineInfo)();
20
20
  var ENGINE_INFO = Object.freeze({
21
21
  ...PRIVATE_ENGINE_INFO,
22
- superdocVersion: "2.28.0-next.18",
22
+ superdocVersion: "2.28.0-next.19",
23
23
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
24
24
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
25
25
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -18,7 +18,7 @@ var COLLABORATION_UPGRADE_ENGINE_MINIMUM_NODE_MAJOR = 20;
18
18
  var PRIVATE_ENGINE_INFO = getCollaborationUpgradeEngineInfo$1();
19
19
  var ENGINE_INFO = Object.freeze({
20
20
  ...PRIVATE_ENGINE_INFO,
21
- superdocVersion: "2.28.0-next.18",
21
+ superdocVersion: "2.28.0-next.19",
22
22
  roomSchemaVersion: Object.freeze({ ...PRIVATE_ENGINE_INFO.roomSchemaVersion }),
23
23
  supportedBundleVersions: SUPPORTED_COLLABORATION_UPGRADE_BUNDLE_VERSIONS,
24
24
  supportedV1ReaderContractVersions: SUPPORTED_V1_READER_CONTRACT_VERSIONS
@@ -214,6 +214,7 @@ export interface ListLevelTemplate {
214
214
  customFormat?: string;
215
215
  lvlText?: string;
216
216
  start?: number;
217
+ lvlRestart?: number;
217
218
  alignment?: LevelAlignment;
218
219
  indents?: {
219
220
  left?: number;
@@ -1,4 +1,4 @@
1
- import { BlockNodeAddress, ChangeMode, ReceiptFailure } from '../types/index.js';
1
+ import { BlockNodeAddress, ChangeMode, ReceiptFailure, TrackedChangeAddress } from '../types/index.js';
2
2
  import { DiscoveryOutput } from '../types/discovery.js';
3
3
  export type SectionAddress = {
4
4
  kind: 'section';
@@ -111,6 +111,7 @@ export interface SectionsGetInput {
111
111
  export type SectionsListResult = DiscoveryOutput<SectionDomain>;
112
112
  export interface SectionMutationSuccessResult {
113
113
  success: true;
114
+ dryRun?: boolean;
114
115
  section: SectionAddress;
115
116
  /** Committed review-aware content mode; omitted for dry runs, no-ops and non-reviewable settings. */
116
117
  appliedChangeMode?: ChangeMode;
@@ -126,11 +127,14 @@ export type SectionMutationResult = SectionMutationSuccessResult | SectionMutati
126
127
  */
127
128
  export interface DocumentMutationSuccessResult {
128
129
  success: true;
130
+ dryRun?: boolean;
131
+ changed?: boolean;
129
132
  }
130
133
  export type DocumentMutationResult = DocumentMutationSuccessResult | SectionMutationFailureResult;
131
134
  export interface CreateSectionBreakSuccessResult {
132
135
  success: true;
133
136
  appliedChangeMode?: 'direct' | 'tracked';
137
+ trackedChangeRefs?: TrackedChangeAddress[];
134
138
  section: SectionAddress;
135
139
  /**
136
140
  * Present only when the break is represented as a dedicated paragraph.
@@ -145,6 +145,7 @@ export type ReceiptSuccess = {
145
145
  /** Temporary-preview lifecycle and caller tag, also delivered through mutation events. */
146
146
  temporary?: import('./temporary-mutation.js').TemporaryMutationMetadata;
147
147
  success: true;
148
+ status?: 'NO_OP';
148
149
  /** Whether a successful request changed the document; false represents a no-op commit. */
149
150
  changed?: boolean;
150
151
  /** Tracked changes authored by this mutation. */
@@ -564,6 +564,7 @@ export type RenderPlaceholder = {
564
564
  */
565
565
  export type ImageRun = {
566
566
  kind: 'image';
567
+ inlineDrawingId?: string;
567
568
  /** Image source URL (data URI or external URL). */
568
569
  src: string;
569
570
  /** Image width in pixels. */
@@ -2406,6 +2407,7 @@ export type ImageMeasure = {
2406
2407
  };
2407
2408
  export type DrawingMeasure = {
2408
2409
  kind: 'drawing';
2410
+ inlineDrawing?: boolean;
2409
2411
  drawingKind: DrawingKind;
2410
2412
  width: number;
2411
2413
  height: number;
@@ -213,3 +213,4 @@ export declare function pmPosToCharOffset(block: FlowBlock, line: Line, pmPos: n
213
213
  export declare function pmPosToVisualCharOffset(block: FlowBlock, line: Line, pmPos: number): number;
214
214
  export { measureVisualBidiFragment, type MeasuredVisualBidiFragment } from './neutral-segment-geometry.js';
215
215
  export { measuredVisualBidiCaretX, measuredVisualBidiOffsetAtX, measuredVisualBidiRangeBands, isMeasuredVisualBidiLineCurrent, type MeasuredVisualBidiLine, } from './visual-bidi-geometry.js';
216
+ export { placeInlineDrawings } from './place-inline-drawings.js';
@@ -0,0 +1,9 @@
1
+ import { FlowBlock, Layout, Measure } from '../../contracts/src/index.js';
2
+ export declare function placeInlineDrawings(layout: Layout, blocks: FlowBlock[], measures: Measure[], blockIndexById?: ReadonlyMap<string, number>, retainedPages?: {
3
+ prefixEndPageIndex?: number;
4
+ tail?: {
5
+ startPageIndex: number;
6
+ endPageIndexExclusive: number;
7
+ blockIdRewrites?: ReadonlyMap<string, string> | null;
8
+ };
9
+ }): Layout;
@@ -9,6 +9,7 @@ import { PageState } from './paginator.js';
9
9
  * callbacks for positioning the drawing fragment on the current page/column.
10
10
  */
11
11
  export type DrawingLayoutContext = {
12
+ inlineParagraphBound?: boolean;
12
13
  /** The drawing block to layout */
13
14
  block: DrawingBlock;
14
15
  /** Measured dimensions and geometry data for the drawing */
@@ -57,4 +58,4 @@ export type DrawingLayoutContext = {
57
58
  * - Anchored drawings (`block.anchor?.isAnchored === true`) are skipped
58
59
  * - They are positioned via the paragraph anchoring pre-pass
59
60
  */
60
- export declare function layoutDrawingBlock({ block, measure, columns, ensurePage, advanceColumn, columnX, textboxContentMeasures, }: DrawingLayoutContext): void;
61
+ export declare function layoutDrawingBlock({ block, measure, columns, ensurePage, advanceColumn, columnX, textboxContentMeasures, inlineParagraphBound, }: DrawingLayoutContext): void;
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DOnTWcx7.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DNe9BmHD.cjs");
3
3
  const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
4
4
  let react = require("react");
5
5
  let use_sync_external_store_shim = require("use-sync-external-store/shim");
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-gI3fiM_P.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-BEB7RtD6.es.js";
2
2
  import { t as toSliceSource } from "../chunks/slice-source-gfOhG2MW.es.js";
3
3
  import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
4
4
  import { useSyncExternalStore } from "use-sync-external-store/shim";
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DOnTWcx7.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DNe9BmHD.cjs");
3
3
  const require_slice_source = require("../chunks/slice-source-CFaqq0Vo.cjs");
4
4
  let superdoc_entry_vue = require("vue");
5
5
  //#region src/public/ui/vue.ts
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-gI3fiM_P.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-BEB7RtD6.es.js";
2
2
  import { t as toSliceSource } from "../chunks/slice-source-gfOhG2MW.es.js";
3
3
  import { computed, inject, onScopeDispose, provide, shallowRef, toRaw, toValue, watch } from "vue";
4
4
  //#region src/public/ui/vue.ts
@@ -1,5 +1,5 @@
1
1
  Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
- const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DOnTWcx7.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-DNe9BmHD.cjs");
3
3
  //#region ../document-api/src/types/receipt.ts
4
4
  /** Read a known failure.details.reason without assuming every failure has one. */
5
5
  function getDocumentApiRejectionReason(details) {
@@ -1,4 +1,4 @@
1
- import { m as shallowEqual, s as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-gI3fiM_P.es.js";
1
+ import { h as shallowEqual, s as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-BEB7RtD6.es.js";
2
2
  //#region ../document-api/src/types/receipt.ts
3
3
  /** Read a known failure.details.reason without assuming every failure has one. */
4
4
  function getDocumentApiRejectionReason(details) {