superdoc 2.6.0-next.13 → 2.6.0-next.15
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/collaboration-upgrade-engine.cjs +1 -1
- package/dist/collaboration-upgrade-engine.es.js +1 -1
- package/dist/layout-engine/contracts/src/header-footer-resolution.d.ts +14 -0
- package/dist/layout-engine/contracts/src/index.d.ts +1 -1
- package/dist/layout-engine/layout-bridge/src/cache.d.ts +12 -0
- package/dist/layout-engine/layout-bridge/src/incrementalLayout.d.ts +20 -0
- package/dist/superdoc.cjs +4 -2
- package/dist/superdoc.es.js +4 -2
- package/dist-cdn/superdoc.min.js +3 -3
- package/package.json +2 -2
|
@@ -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.
|
|
22
|
+
superdocVersion: "2.6.0-next.15",
|
|
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.
|
|
21
|
+
superdocVersion: "2.6.0-next.15",
|
|
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
|
|
@@ -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';
|
|
@@ -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;
|
package/dist/superdoc.cjs
CHANGED
|
@@ -18104,7 +18104,9 @@ function scrollToElement(targetElement, options = {
|
|
|
18104
18104
|
if (!targetElement) return;
|
|
18105
18105
|
const container = getScrollableParent(targetElement);
|
|
18106
18106
|
const containerRect = container.getBoundingClientRect();
|
|
18107
|
-
const
|
|
18107
|
+
const targetRect = targetElement.getBoundingClientRect();
|
|
18108
|
+
const containerTop = container === (document.scrollingElement || document.documentElement) ? 0 : containerRect.top;
|
|
18109
|
+
const offsetTop = targetRect.top - containerTop + container.scrollTop;
|
|
18108
18110
|
const scrollPaddingTopValue = window.getComputedStyle(container).scrollPaddingTop?.trim();
|
|
18109
18111
|
const resolvedScrollPaddingTop = scrollPaddingTopValue?.endsWith("px") ? Number(scrollPaddingTopValue.slice(0, -2)) : 0;
|
|
18110
18112
|
const scrollPaddingTop = Number.isFinite(resolvedScrollPaddingTop) && resolvedScrollPaddingTop >= 0 ? resolvedScrollPaddingTop : 0;
|
|
@@ -43603,7 +43605,7 @@ var SuperDoc = class extends require_eventemitter3.import_eventemitter3.default
|
|
|
43603
43605
|
this.config.colors = shuffleArray(this.config.colors);
|
|
43604
43606
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
43605
43607
|
this.colorIndex = 0;
|
|
43606
|
-
this.version = "2.6.0-next.
|
|
43608
|
+
this.version = "2.6.0-next.15";
|
|
43607
43609
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
43608
43610
|
this.superdocId = config.superdocId || require_uuid.v4();
|
|
43609
43611
|
this.colors = this.config.colors ?? [];
|
package/dist/superdoc.es.js
CHANGED
|
@@ -18072,7 +18072,9 @@ function scrollToElement(targetElement, options = {
|
|
|
18072
18072
|
if (!targetElement) return;
|
|
18073
18073
|
const container = getScrollableParent(targetElement);
|
|
18074
18074
|
const containerRect = container.getBoundingClientRect();
|
|
18075
|
-
const
|
|
18075
|
+
const targetRect = targetElement.getBoundingClientRect();
|
|
18076
|
+
const containerTop = container === (document.scrollingElement || document.documentElement) ? 0 : containerRect.top;
|
|
18077
|
+
const offsetTop = targetRect.top - containerTop + container.scrollTop;
|
|
18076
18078
|
const scrollPaddingTopValue = window.getComputedStyle(container).scrollPaddingTop?.trim();
|
|
18077
18079
|
const resolvedScrollPaddingTop = scrollPaddingTopValue?.endsWith("px") ? Number(scrollPaddingTopValue.slice(0, -2)) : 0;
|
|
18078
18080
|
const scrollPaddingTop = Number.isFinite(resolvedScrollPaddingTop) && resolvedScrollPaddingTop >= 0 ? resolvedScrollPaddingTop : 0;
|
|
@@ -43536,7 +43538,7 @@ var SuperDoc = class extends import_eventemitter3.default {
|
|
|
43536
43538
|
this.config.colors = shuffleArray(this.config.colors);
|
|
43537
43539
|
this.userColorMap = /* @__PURE__ */ new Map();
|
|
43538
43540
|
this.colorIndex = 0;
|
|
43539
|
-
this.version = "2.6.0-next.
|
|
43541
|
+
this.version = "2.6.0-next.15";
|
|
43540
43542
|
this.#log("🦋 [superdoc] Using SuperDoc version:", this.version);
|
|
43541
43543
|
this.superdocId = config.superdocId || v4();
|
|
43542
43544
|
this.colors = this.config.colors ?? [];
|