superdoc 2.6.0-next.9 → 2.6.1-next.1

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.
@@ -5509,9 +5509,18 @@ function createSuperDocUI(options) {
5509
5509
  const entry = readListApplyStateEntry();
5510
5510
  const shippedStatus = typeof entry?.shippedStatus === "string" ? entry.shippedStatus : null;
5511
5511
  const supported = shippedStatus !== "not-shipped" && shippedStatus !== "disabled";
5512
+ const enabled = supported && (typeof entry?.enabled === "boolean" ? entry.enabled : true);
5513
+ const activeSeed = supported ? readListActiveSeed(entry) : null;
5514
+ if (readonly) return normalizeCommandState({
5515
+ enabled: false,
5516
+ active: activeSeed === listKind,
5517
+ supported,
5518
+ value: entry?.value,
5519
+ reason: SUPERDOC_UI_REASONS.documentReadonly
5520
+ }, "builtin");
5512
5521
  return normalizeCommandState({
5513
- enabled: supported && (typeof entry?.enabled === "boolean" ? entry.enabled : true),
5514
- active: (supported ? readListActiveSeed(entry) : null) === listKind,
5522
+ enabled,
5523
+ active: activeSeed === listKind,
5515
5524
  supported,
5516
5525
  value: entry?.value
5517
5526
  }, "builtin");
@@ -8154,6 +8163,7 @@ function createSuperDocUI(options) {
8154
8163
  }
8155
8164
  const listKind = listToggleKind(id);
8156
8165
  if (listKind) {
8166
+ if (readDocumentMode() === "viewing") return false;
8157
8167
  if (typeof (getEditCommands()?.lists)?.apply === "function") return executeListToggleCommand(listKind, payload);
8158
8168
  }
8159
8169
  const trackCommand = trackDecisionCommand(id);
@@ -5509,9 +5509,18 @@ function createSuperDocUI(options) {
5509
5509
  const entry = readListApplyStateEntry();
5510
5510
  const shippedStatus = typeof entry?.shippedStatus === "string" ? entry.shippedStatus : null;
5511
5511
  const supported = shippedStatus !== "not-shipped" && shippedStatus !== "disabled";
5512
+ const enabled = supported && (typeof entry?.enabled === "boolean" ? entry.enabled : true);
5513
+ const activeSeed = supported ? readListActiveSeed(entry) : null;
5514
+ if (readonly) return normalizeCommandState({
5515
+ enabled: false,
5516
+ active: activeSeed === listKind,
5517
+ supported,
5518
+ value: entry?.value,
5519
+ reason: SUPERDOC_UI_REASONS.documentReadonly
5520
+ }, "builtin");
5512
5521
  return normalizeCommandState({
5513
- enabled: supported && (typeof entry?.enabled === "boolean" ? entry.enabled : true),
5514
- active: (supported ? readListActiveSeed(entry) : null) === listKind,
5522
+ enabled,
5523
+ active: activeSeed === listKind,
5515
5524
  supported,
5516
5525
  value: entry?.value
5517
5526
  }, "builtin");
@@ -8154,6 +8163,7 @@ function createSuperDocUI(options) {
8154
8163
  }
8155
8164
  const listKind = listToggleKind(id);
8156
8165
  if (listKind) {
8166
+ if (readDocumentMode() === "viewing") return false;
8157
8167
  if (typeof (getEditCommands()?.lists)?.apply === "function") return executeListToggleCommand(listKind, payload);
8158
8168
  }
8159
8169
  const trackCommand = trackDecisionCommand(id);
@@ -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.6.0-next.9",
22
+ superdocVersion: "2.6.1-next.1",
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.6.0-next.9",
21
+ superdocVersion: "2.6.1-next.1",
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
@@ -28,6 +28,19 @@ export declare function isPagePositionedParagraphFrame(frame: {
28
28
  vAnchor: 'page';
29
29
  y: number;
30
30
  };
31
+ export declare function isPagePositionedFloatingTable<T extends {
32
+ kind?: string;
33
+ anchor?: {
34
+ isAnchored?: boolean;
35
+ vRelativeFrom?: string;
36
+ };
37
+ }>(block: T | undefined): block is T & {
38
+ kind: 'table';
39
+ anchor: {
40
+ isAnchored: true;
41
+ vRelativeFrom: 'page';
42
+ };
43
+ };
31
44
  /**
32
45
  * Resolve the page-space origin used for page-anchored paragraph frames in a footer.
33
46
  * Invalid or negative bottom margins behave like a zero margin.
@@ -24,5 +24,19 @@ export type HeaderFooterEffectiveRefResult = {
24
24
  matchedSectionIndex: number;
25
25
  matchedVariant: HeaderFooterVariant;
26
26
  };
27
+ /**
28
+ * Ordered, snapshot-backed resolver for repeated header/footer lookups.
29
+ * Runtime section updates must go through `updateSection` so cached inherited
30
+ * results cannot outlive a reference change.
31
+ */
32
+ export declare class HeaderFooterResolutionIndex {
33
+ #private;
34
+ constructor(sections: readonly HeaderFooterResolutionSection[]);
35
+ get revision(): number;
36
+ hasAny(kind: HeaderFooterKind): boolean;
37
+ resolve(sectionIndex: number, kind: HeaderFooterKind, variant: HeaderFooterVariant): HeaderFooterEffectiveRefResult | null;
38
+ updateSection(section: HeaderFooterResolutionSection): boolean;
39
+ }
40
+ export declare function createHeaderFooterResolutionIndex(sections: readonly HeaderFooterResolutionSection[]): HeaderFooterResolutionIndex;
27
41
  export declare function selectHeaderFooterVariantForPage({ documentPageNumber, sectionPageNumber, titlePg, alternateHeaders, }: HeaderFooterVariantSelectionInput): HeaderFooterVariant | null;
28
42
  export declare function resolveEffectiveHeaderFooterRef({ sections, sectionIndex, kind, variant, }: HeaderFooterEffectiveRefInput): HeaderFooterEffectiveRefResult | null;
@@ -10,7 +10,7 @@ export type { BaseDirection, WritingMode, SectionDirectionContext, TableDirectio
10
10
  export { getParagraphInlineDirection, getTableVisualDirection } from './direction-context.js';
11
11
  export { OOXML_PCT_DIVISOR, resolveTableWidthAttr, type TableWidthAttr, type TableColumnSpec, } from './engines/tables.js';
12
12
  export { effectiveTableCellSpacing } from './table-cell-spacing.js';
13
- export { selectHeaderFooterVariantForPage, resolveEffectiveHeaderFooterRef, type HeaderFooterKind, type HeaderFooterVariant, type HeaderFooterSectionRefs, type HeaderFooterResolutionSection, type HeaderFooterVariantSelectionInput, type HeaderFooterEffectiveRefInput, type HeaderFooterEffectiveRefResult, } from './header-footer-resolution.js';
13
+ export { createHeaderFooterResolutionIndex, selectHeaderFooterVariantForPage, resolveEffectiveHeaderFooterRef, type HeaderFooterResolutionIndex, type HeaderFooterKind, type HeaderFooterVariant, type HeaderFooterSectionRefs, type HeaderFooterResolutionSection, type HeaderFooterVariantSelectionInput, type HeaderFooterEffectiveRefInput, type HeaderFooterEffectiveRefResult, } from './header-footer-resolution.js';
14
14
  export { rescaleColumnWidths } from './table-column-rescale.js';
15
15
  export { getCellSpacingPx } from './cell-spacing.js';
16
16
  export { normalizeZIndex, coerceRelativeHeight, isPlainObject, OOXML_Z_INDEX_BASE, resolveFloatingZIndex, getFragmentZIndex, } from './ooxml-z-index.js';
@@ -18,7 +18,7 @@ export { shouldApplyJustify, calculateJustifySpacing, getFirstLineIndentOffset,
18
18
  export { parseInsetClipPathForScale, formatInsetClipPathTransform, type InsetClipPathScale, } from './clip-path-inset.js';
19
19
  export { SUBSCRIPT_SUPERSCRIPT_SCALE, normalizeBaselineShift, hasExplicitBaselineShift, isSuperscriptOrSubscript, usesDefaultScriptLayout, scaleFontSizeForVerticalText, resolveBaseFontSizeForVerticalText, type VerticalTextAlign, } from './vertical-text.js';
20
20
  export { computeFragmentPmRange, computeLinePmRange, type LinePmRange } from './pm-range.js';
21
- export { resolveAnchoredGraphicY, resolveAnchoredGraphicX, resolveFooterPageFrameOriginY, isPositionedParagraphFrame, isPagePositionedParagraphFrame, isAnchorHRelative, isAnchorVRelative, isAnchorAlignH, isAnchorAlignV, ANCHOR_H_RELATIVE_VALUES, ANCHOR_V_RELATIVE_VALUES, ANCHOR_H_ALIGN_VALUES, ANCHOR_V_ALIGN_VALUES, type ColumnLayoutForAnchor, type ResolveAnchoredGraphicYInput, type ResolveAnchoredGraphicXContext, type AnchorHRelative, type AnchorVRelative, type AnchorAlignH, type AnchorAlignV, } from './graphic-placement.js';
21
+ export { resolveAnchoredGraphicY, resolveAnchoredGraphicX, resolveFooterPageFrameOriginY, isPositionedParagraphFrame, isPagePositionedParagraphFrame, isPagePositionedFloatingTable, isAnchorHRelative, isAnchorVRelative, isAnchorAlignH, isAnchorAlignV, ANCHOR_H_RELATIVE_VALUES, ANCHOR_V_RELATIVE_VALUES, ANCHOR_H_ALIGN_VALUES, ANCHOR_V_ALIGN_VALUES, type ColumnLayoutForAnchor, type ResolveAnchoredGraphicYInput, type ResolveAnchoredGraphicXContext, type AnchorHRelative, type AnchorVRelative, type AnchorAlignH, type AnchorAlignV, } from './graphic-placement.js';
22
22
  export { LAYOUT_BOUNDARY_SCHEMA, bodyStoryLocator, namedStoryLocator, computeLayoutFragmentId, buildLayoutSourceIdentity, buildLayoutSourceIdentityForFragment, } from './layout-identity.js';
23
23
  export type { LayoutBlockRef, LayoutFragmentId, LayoutPartialRowIdentity, LayoutSourceIdentity, LayoutStoryKind, LayoutStoryLocator, } from './layout-identity.js';
24
24
  export { LAYOUT_SEGMENT_GEOMETRY_SCHEMA } from './segment-geometry.js';
@@ -538,6 +538,8 @@ export type ImageRun = {
538
538
  placeholder?: RenderPlaceholder;
539
539
  /** DrawingML docPr/@id of the picture (used to target the Document API for interactive resize). */
540
540
  imageId?: string;
541
+ /** Opaque Document API identity when projection can resolve it without a catalog read. */
542
+ imageMutationId?: string;
541
543
  /** Clip-path value for cropped images. */
542
544
  clipPath?: string;
543
545
  /** DrawingML picture frame; paint-only and excluded from layout sizing. */
@@ -932,6 +934,8 @@ export type ImageBlock = {
932
934
  placeholder?: RenderPlaceholder;
933
935
  /** DrawingML docPr/@id of the picture (used to target the Document API for interactive resize). */
934
936
  imageId?: string;
937
+ /** Opaque Document API identity when projection can resolve it without a catalog read. */
938
+ imageMutationId?: string;
935
939
  objectFit?: 'contain' | 'cover' | 'fill' | 'scale-down';
936
940
  display?: 'inline' | 'block';
937
941
  padding?: BoxSpacing;
@@ -2600,6 +2604,8 @@ export type PartialRowInfo = {
2600
2604
  export type TableFragment = {
2601
2605
  kind: 'table';
2602
2606
  blockId: BlockId;
2607
+ /** True when this fragment was emitted by floating-table placement. */
2608
+ isAnchored?: boolean;
2603
2609
  /** Flow column that owns this fragment, distinct from visual x when overflow crosses margins. */
2604
2610
  columnIndex?: number;
2605
2611
  fromRow: number;
@@ -46,6 +46,10 @@ export type MeasureCacheStats = {
46
46
  */
47
47
  memorySizeEstimate: number;
48
48
  };
49
+ declare const preparedMeasureCacheKeyBrand: unique symbol;
50
+ export type PreparedMeasureCacheKey = string & {
51
+ readonly [preparedMeasureCacheKeyBrand]: true;
52
+ };
49
53
  /**
50
54
  * LRU-enhanced MeasureCache
51
55
  *
@@ -77,6 +81,12 @@ export declare class MeasureCache<T> {
77
81
  * @returns The cached value or undefined
78
82
  */
79
83
  get(block: FlowBlock | null | undefined, width: number, height: number, fontSignature?: string): T | undefined;
84
+ /**
85
+ * Compose the complete content, constraint, and font key once for a cache
86
+ * read followed by an insertion in the same measurement transaction.
87
+ */
88
+ prepareKey(block: FlowBlock | null | undefined, width: number, height: number, fontSignature?: string): PreparedMeasureCacheKey | undefined;
89
+ getPrepared(key: PreparedMeasureCacheKey | undefined): T | undefined;
80
90
  /**
81
91
  * Store a measure in the cache for the given block and dimensions.
82
92
  * Silently returns if the block is null/undefined or lacks an ID.
@@ -87,6 +97,7 @@ export declare class MeasureCache<T> {
87
97
  * @param value - The value to cache
88
98
  */
89
99
  set(block: FlowBlock | null | undefined, width: number, height: number, value: T, fontSignature?: string): void;
100
+ setPrepared(key: PreparedMeasureCacheKey | undefined, blockId: string | undefined, value: T): void;
90
101
  /**
91
102
  * Invalidates cached measurements for specific block IDs.
92
103
  * Removes all cache entries whose keys start with any of the provided block IDs.
@@ -144,3 +155,4 @@ export declare class MeasureCache<T> {
144
155
  */
145
156
  private composeKey;
146
157
  }
158
+ export {};
@@ -95,6 +95,10 @@ export type IncrementalLayoutBridgeTiming = {
95
95
  /** Union wall time spent inside caller-owned measure callbacks across body and furniture. */
96
96
  measureCallbackWallMs: number;
97
97
  measureCacheLookupMs: number;
98
+ /** Body-measure cache insertion wall time, including content-key composition. */
99
+ measureCacheWriteMs: number;
100
+ /** Previous-measure content-adoption lookup/build wall time. */
101
+ measureContentAdoptionMs: number;
98
102
  measureActualMs: number;
99
103
  headerFooterPreLayoutMs: number;
100
104
  headerPreLayoutMs: number;
@@ -104,6 +108,14 @@ export type IncrementalLayoutBridgeTiming = {
104
108
  layoutDocumentMs: number;
105
109
  /** Initial body-layout wrapper work outside `layoutDocument` (proof, slice, convergence, splice). */
106
110
  layoutReuseOrchestrationMs: number;
111
+ /** Initial pagination invocation including bridge reuse orchestration. */
112
+ paginationInitialMs: number;
113
+ /** Body page-token convergence pagination only. */
114
+ paginationPageTokenMs: number;
115
+ /** Footnote convergence pagination only; overlaps `footnoteMs`. */
116
+ paginationFootnoteMs: number;
117
+ /** All initial, page-token, and footnote pagination invocation wall time. */
118
+ paginationTotalMs: number;
107
119
  paginationMs: number;
108
120
  pageTokenSetupMs: number;
109
121
  pageTokenTotalMs: number;
@@ -116,8 +128,16 @@ export type IncrementalLayoutBridgeTiming = {
116
128
  unattributedMs: number;
117
129
  counters: {
118
130
  blocksRead: number;
131
+ blocksByKind?: Record<FlowBlock['kind'], number>;
132
+ bodyBlocksMeasuredByKind: Record<FlowBlock['kind'], number>;
119
133
  cacheHits: number;
120
134
  cacheMisses: number;
135
+ bodyMeasureCacheReads: number;
136
+ bodyMeasureCacheWrites: number;
137
+ bodyMeasureCacheKeyComputations: number;
138
+ measureContentSignatureComputations: number;
139
+ fontSignaturePresent: number;
140
+ fontSignatureChanged: number;
121
141
  measuresAdopted: number;
122
142
  pagesPaginated: number | null;
123
143
  pagesSplicedByReuse: number;
@@ -331,8 +331,9 @@ export declare function layoutDocumentRange(input: LayoutRangeInput): LayoutRang
331
331
  * transformations and computing the actual height required by visible content.
332
332
  *
333
333
  * When `kind` and `constraints.pageHeight` are provided, page-relative and
334
- * margin-relative anchored drawings are post-normalized from the synthetic
335
- * measurement canvas to header/footer-local coordinates.
334
+ * margin-relative anchored drawings and page-relative floating footer tables
335
+ * are post-normalized from the synthetic measurement canvas to
336
+ * header/footer-local coordinates.
336
337
  *
337
338
  * Returns separate measurement bounds (for pagination) and render bounds
338
339
  * (for overlay shift). See the Coordinate Contract in the fix plan for details.
@@ -32,9 +32,9 @@ export type RegionConstraints = {
32
32
  * offset so they do not inflate the reserved header height by carrying
33
33
  * body-canvas coordinates.
34
34
  *
35
- * Page-anchored paragraph frames are likewise converted from physical-page
36
- * coordinates; other paragraphs, inline images, and absolute overlays pass
37
- * through unchanged.
35
+ * Page-anchored paragraph frames and floating footer tables are likewise
36
+ * converted from physical-page coordinates; other paragraphs, inline images,
37
+ * and absolute overlays pass through unchanged.
38
38
  */
39
39
  export declare function normalizeFragmentsForRegion(pages: Array<{
40
40
  number: number;
@@ -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-Bom7oDPv.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-CwCvqMOa.cjs");
3
3
  let react = require("react");
4
4
  //#region src/public/ui/react.ts
5
5
  /**
@@ -1,4 +1,4 @@
1
- import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-DbzVC0rr.es.js";
1
+ import { t as createSuperDocUI } from "../chunks/create-super-doc-ui-DCjm-_Xo.es.js";
2
2
  import { createContext, createElement, useCallback, useContext, useEffect, useRef, useState } from "react";
3
3
  //#region src/public/ui/react.ts
4
4
  /**
@@ -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-Bom7oDPv.cjs");
2
+ const require_create_super_doc_ui = require("../chunks/create-super-doc-ui-CwCvqMOa.cjs");
3
3
  exports.BUILT_IN_COMMAND_IDS = require_create_super_doc_ui.BUILT_IN_COMMAND_IDS;
4
4
  exports.createSuperDocUI = require_create_super_doc_ui.createSuperDocUI;
5
5
  exports.shallowEqual = require_create_super_doc_ui.shallowEqual;
@@ -1,2 +1,2 @@
1
- import { n as shallowEqual, r as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-DbzVC0rr.es.js";
1
+ import { n as shallowEqual, r as BUILT_IN_COMMAND_IDS, t as createSuperDocUI } from "../chunks/create-super-doc-ui-DCjm-_Xo.es.js";
2
2
  export { BUILT_IN_COMMAND_IDS, createSuperDocUI, shallowEqual };