@beyondwork/docx-react-component 1.0.132 → 1.0.134
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/api/public-types.cjs +161 -68
- package/dist/api/public-types.d.cts +1 -1
- package/dist/api/public-types.d.ts +1 -1
- package/dist/api/public-types.js +3 -3
- package/dist/api/v3.cjs +9878 -7387
- package/dist/api/v3.d.cts +2 -2
- package/dist/api/v3.d.ts +2 -2
- package/dist/api/v3.js +10 -10
- package/dist/{chunk-QUTVR72L.js → chunk-3YR47WTD.js} +296 -587
- package/dist/{chunk-RYMMKOFI.js → chunk-5KTJKTNE.js} +32 -0
- package/dist/{chunk-UP2KDOYE.js → chunk-74R5B2EZ.js} +6 -2
- package/dist/{chunk-6736GA6J.js → chunk-7Y6JCIK3.js} +1 -1
- package/dist/{chunk-43JAPM2F.js → chunk-EBSI6VQX.js} +546 -144
- package/dist/{chunk-JVTDBX67.js → chunk-EFEW7BTT.js} +2 -2
- package/dist/{chunk-YUHNDEV5.js → chunk-ESEEWELA.js} +3534 -1870
- package/dist/{chunk-XYTWOJII.js → chunk-IJD6D7HU.js} +745 -103
- package/dist/{chunk-UFPBYJMA.js → chunk-INLRCC4N.js} +2 -2
- package/dist/{chunk-N5FTU4HZ.js → chunk-MQ5GAJ54.js} +68 -39
- package/dist/{chunk-W2I47J2Q.js → chunk-NJFKPDNG.js} +216 -2
- package/dist/{chunk-LPLJZJT2.js → chunk-O4EDZR44.js} +131 -70
- package/dist/{chunk-4HGFJ6Z2.js → chunk-PZIEOEJZ.js} +1 -1
- package/dist/{chunk-C5LXKR54.js → chunk-QTRJLKR2.js} +1 -1
- package/dist/{chunk-SZ6BJA4Q.js → chunk-REFHJ2FN.js} +3 -3
- package/dist/{chunk-ZDYGRO2Z.js → chunk-RP76USJE.js} +1 -1
- package/dist/{chunk-RBWJHRNP.js → chunk-T66OS7MN.js} +8 -3
- package/dist/{chunk-ALWXYGXP.js → chunk-V2JF42SI.js} +2 -2
- package/dist/{chunk-CDEZGLQ3.js → chunk-VA24T4EB.js} +1 -1
- package/dist/{chunk-6TLZ6CMP.js → chunk-WDDFU2N2.js} +2 -2
- package/dist/{chunk-U3UMKA7B.js → chunk-XBQFDBXE.js} +1 -1
- package/dist/core/commands/formatting-commands.d.cts +1 -1
- package/dist/core/commands/formatting-commands.d.ts +1 -1
- package/dist/core/commands/image-commands.cjs +32 -0
- package/dist/core/commands/image-commands.d.cts +1 -1
- package/dist/core/commands/image-commands.d.ts +1 -1
- package/dist/core/commands/image-commands.js +5 -5
- package/dist/core/commands/section-layout-commands.d.cts +1 -1
- package/dist/core/commands/section-layout-commands.d.ts +1 -1
- package/dist/core/commands/style-commands.d.cts +1 -1
- package/dist/core/commands/style-commands.d.ts +1 -1
- package/dist/core/commands/table-structure-commands.cjs +32 -0
- package/dist/core/commands/table-structure-commands.d.cts +1 -1
- package/dist/core/commands/table-structure-commands.d.ts +1 -1
- package/dist/core/commands/table-structure-commands.js +4 -4
- package/dist/core/commands/text-commands.cjs +99 -38
- package/dist/core/commands/text-commands.d.cts +12 -1
- package/dist/core/commands/text-commands.d.ts +12 -1
- package/dist/core/commands/text-commands.js +5 -5
- package/dist/core/selection/mapping.d.cts +1 -1
- package/dist/core/selection/mapping.d.ts +1 -1
- package/dist/core/state/editor-state.d.cts +1 -1
- package/dist/core/state/editor-state.d.ts +1 -1
- package/dist/index.cjs +5365 -2298
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +388 -63
- package/dist/io/docx-session.cjs +7 -2
- package/dist/io/docx-session.d.cts +3 -3
- package/dist/io/docx-session.d.ts +3 -3
- package/dist/io/docx-session.js +4 -4
- package/dist/legal.js +3 -3
- package/dist/{loader-MAa8VpzW.d.cts → loader-CK3lZy4h.d.cts} +2 -2
- package/dist/{loader-CfpeEPAa.d.ts → loader-CQXplstv.d.ts} +2 -2
- package/dist/{public-types-KBS6JnOs.d.cts → public-types-BR1SYK2F.d.cts} +783 -189
- package/dist/{public-types-Cjs8glST.d.ts → public-types-DXNZVKrS.d.ts} +783 -189
- package/dist/public-types.cjs +161 -68
- package/dist/public-types.d.cts +1 -1
- package/dist/public-types.d.ts +1 -1
- package/dist/public-types.js +3 -3
- package/dist/runtime/collab.d.cts +2 -2
- package/dist/runtime/collab.d.ts +2 -2
- package/dist/runtime/document-runtime.cjs +1597 -444
- package/dist/runtime/document-runtime.d.cts +1 -1
- package/dist/runtime/document-runtime.d.ts +1 -1
- package/dist/runtime/document-runtime.js +14 -14
- package/dist/{session-CkoH8FoY.d.ts → session-C9UjrhJF.d.ts} +2 -2
- package/dist/{session-wwe0Gib-.d.cts → session-CSbwkgII.d.cts} +2 -2
- package/dist/session.cjs +7 -2
- package/dist/session.d.cts +4 -4
- package/dist/session.d.ts +4 -4
- package/dist/session.js +5 -5
- package/dist/tailwind.cjs +451 -650
- package/dist/tailwind.d.cts +1 -1
- package/dist/tailwind.d.ts +1 -1
- package/dist/tailwind.js +7 -7
- package/dist/{types-B3SGRW0w.d.cts → types-CZtAueri.d.cts} +1 -1
- package/dist/{types-CH7NWqVL.d.ts → types-RzkCXDNV.d.ts} +1 -1
- package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +2 -2
- package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +2 -2
- package/dist/ui-tailwind/editor-surface/search-plugin.js +4 -4
- package/dist/ui-tailwind.cjs +451 -650
- package/dist/ui-tailwind.d.cts +3 -2
- package/dist/ui-tailwind.d.ts +3 -2
- package/dist/ui-tailwind.js +7 -7
- package/package.json +1 -1
|
@@ -12,6 +12,7 @@ import {
|
|
|
12
12
|
parseTextStory
|
|
13
13
|
} from "./chunk-QIO6V46H.js";
|
|
14
14
|
import {
|
|
15
|
+
NO_EDITABLE_TARGETS_INDEX,
|
|
15
16
|
createEditorSurfaceSnapshot,
|
|
16
17
|
formatPageNumber,
|
|
17
18
|
formatPageNumberWithChapter,
|
|
@@ -19,13 +20,13 @@ import {
|
|
|
19
20
|
resolveSectionVariants,
|
|
20
21
|
sectionSupportsStoryTarget,
|
|
21
22
|
storyTargetKey
|
|
22
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-XBQFDBXE.js";
|
|
23
24
|
import {
|
|
24
25
|
createSelectionSnapshot
|
|
25
26
|
} from "./chunk-OYGMRRR7.js";
|
|
26
27
|
import {
|
|
27
28
|
collectCanonicalLayoutInputs
|
|
28
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-5KTJKTNE.js";
|
|
29
30
|
import {
|
|
30
31
|
MAIN_STORY_TARGET,
|
|
31
32
|
createDetachedAnchor,
|
|
@@ -2176,7 +2177,8 @@ function buildResolvedSections(document2) {
|
|
|
2176
2177
|
const mainSurface = createEditorSurfaceSnapshot(
|
|
2177
2178
|
document2,
|
|
2178
2179
|
createSelectionSnapshot(0, 0),
|
|
2179
|
-
MAIN_STORY_TARGET
|
|
2180
|
+
MAIN_STORY_TARGET,
|
|
2181
|
+
{ editableTargetsByBlockPath: NO_EDITABLE_TARGETS_INDEX }
|
|
2180
2182
|
);
|
|
2181
2183
|
const sections = [];
|
|
2182
2184
|
let sectionStart = 0;
|
|
@@ -8085,7 +8087,7 @@ function fnv1a(input) {
|
|
|
8085
8087
|
}
|
|
8086
8088
|
|
|
8087
8089
|
// src/runtime/layout/layout-engine-version.ts
|
|
8088
|
-
var LAYOUT_ENGINE_VERSION =
|
|
8090
|
+
var LAYOUT_ENGINE_VERSION = 94;
|
|
8089
8091
|
var LAYCACHE_SCHEMA_VERSION = 13;
|
|
8090
8092
|
|
|
8091
8093
|
// src/runtime/layout/layout-engine-instance.ts
|
|
@@ -8312,11 +8314,45 @@ function createLayoutEngine(options = {}) {
|
|
|
8312
8314
|
const telemetryBus = options.telemetryBus;
|
|
8313
8315
|
const dirtyFieldFamilies = /* @__PURE__ */ new Set();
|
|
8314
8316
|
const listeners = /* @__PURE__ */ new Set();
|
|
8315
|
-
let
|
|
8316
|
-
let
|
|
8317
|
-
let cachedFormatting = null;
|
|
8318
|
-
let cachedMapper = null;
|
|
8317
|
+
let cachedFull = null;
|
|
8318
|
+
let cachedWindowed = null;
|
|
8319
8319
|
let previousPageCount = 0;
|
|
8320
|
+
function isFullViewportKey(key) {
|
|
8321
|
+
return key === FULL_VIEWPORT_WINDOW_KEY;
|
|
8322
|
+
}
|
|
8323
|
+
function getCachedSlot(viewportWindowKeyValue) {
|
|
8324
|
+
return isFullViewportKey(viewportWindowKeyValue) ? cachedFull : cachedWindowed;
|
|
8325
|
+
}
|
|
8326
|
+
function preferredCachedGraph() {
|
|
8327
|
+
return cachedFull?.graph ?? cachedWindowed?.graph ?? null;
|
|
8328
|
+
}
|
|
8329
|
+
function clearAllSlots() {
|
|
8330
|
+
cachedFull = null;
|
|
8331
|
+
cachedWindowed = null;
|
|
8332
|
+
}
|
|
8333
|
+
function clearWindowedSlot() {
|
|
8334
|
+
cachedWindowed = null;
|
|
8335
|
+
}
|
|
8336
|
+
function evictStaleSiblingSlot(freshKey) {
|
|
8337
|
+
const sibling = isFullViewportKey(freshKey.viewportWindowKey) ? cachedWindowed : cachedFull;
|
|
8338
|
+
if (sibling === null) return;
|
|
8339
|
+
if (sibling.key.content === freshKey.content && sibling.key.styles === freshKey.styles && sibling.key.subParts === freshKey.subParts) {
|
|
8340
|
+
return;
|
|
8341
|
+
}
|
|
8342
|
+
if (isFullViewportKey(freshKey.viewportWindowKey)) {
|
|
8343
|
+
cachedWindowed = null;
|
|
8344
|
+
} else {
|
|
8345
|
+
cachedFull = null;
|
|
8346
|
+
}
|
|
8347
|
+
}
|
|
8348
|
+
function commitSlot(slot) {
|
|
8349
|
+
if (isFullViewportKey(slot.key.viewportWindowKey)) {
|
|
8350
|
+
cachedFull = slot;
|
|
8351
|
+
} else {
|
|
8352
|
+
cachedWindowed = slot;
|
|
8353
|
+
}
|
|
8354
|
+
evictStaleSiblingSlot(slot.key);
|
|
8355
|
+
}
|
|
8320
8356
|
let pendingInvalidation = null;
|
|
8321
8357
|
function emit(event) {
|
|
8322
8358
|
for (const listener of listeners) {
|
|
@@ -8462,27 +8498,31 @@ function createLayoutEngine(options = {}) {
|
|
|
8462
8498
|
subParts: document2.subParts,
|
|
8463
8499
|
anchors: layoutInputs.anchors
|
|
8464
8500
|
});
|
|
8501
|
+
const priorGraphForMaterialization = preferredCachedGraph();
|
|
8465
8502
|
const graph = applyViewportWindowMaterialization(
|
|
8466
8503
|
measuredGraph,
|
|
8467
8504
|
viewportWindow,
|
|
8468
|
-
|
|
8505
|
+
priorGraphForMaterialization
|
|
8469
8506
|
);
|
|
8470
|
-
const
|
|
8507
|
+
const priorGraphForFieldDirtiness = preferredCachedGraph();
|
|
8508
|
+
const dirtyFamilies = computeFieldDirtiness(priorGraphForFieldDirtiness, graph);
|
|
8471
8509
|
for (const family of dirtyFamilies) {
|
|
8472
8510
|
dirtyFieldFamilies.add(family);
|
|
8473
8511
|
}
|
|
8474
8512
|
const formatting = buildResolvedFormattingState(document2, mainSurface);
|
|
8475
8513
|
const currentPageCount = graph.contentPageCount;
|
|
8476
8514
|
const pageCountDelta = currentPageCount !== previousPageCount ? { previous: previousPageCount, current: currentPageCount } : void 0;
|
|
8477
|
-
|
|
8478
|
-
|
|
8479
|
-
|
|
8480
|
-
|
|
8481
|
-
|
|
8482
|
-
|
|
8483
|
-
|
|
8484
|
-
|
|
8485
|
-
|
|
8515
|
+
commitSlot({
|
|
8516
|
+
key: {
|
|
8517
|
+
content: document2.content,
|
|
8518
|
+
styles: document2.styles,
|
|
8519
|
+
subParts: document2.subParts,
|
|
8520
|
+
viewportWindowKey: viewportWindowKey(viewportWindow)
|
|
8521
|
+
},
|
|
8522
|
+
graph,
|
|
8523
|
+
formatting,
|
|
8524
|
+
mapper: createPageFragmentMapper(graph)
|
|
8525
|
+
});
|
|
8486
8526
|
if (pageCountDelta) {
|
|
8487
8527
|
emit({
|
|
8488
8528
|
kind: "page_count_changed",
|
|
@@ -8523,7 +8563,7 @@ function createLayoutEngine(options = {}) {
|
|
|
8523
8563
|
return graph;
|
|
8524
8564
|
}
|
|
8525
8565
|
function incrementalRelayout(input, pending) {
|
|
8526
|
-
const priorGraph =
|
|
8566
|
+
const priorGraph = cachedFull?.graph ?? null;
|
|
8527
8567
|
const range = pending.result.dirtyPageRange;
|
|
8528
8568
|
if (!priorGraph || !range) return null;
|
|
8529
8569
|
const telemetryOn = telemetryBus?.isEnabled("layout") ?? false;
|
|
@@ -8616,6 +8656,22 @@ function createLayoutEngine(options = {}) {
|
|
|
8616
8656
|
deriveDocumentPageSnapshots(splicedGraph)
|
|
8617
8657
|
);
|
|
8618
8658
|
const pageCountDelta = currentPageCount !== previousPageCount ? { previous: previousPageCount, current: currentPageCount } : void 0;
|
|
8659
|
+
const priorMapper = cachedFull?.mapper ?? null;
|
|
8660
|
+
commitSlot({
|
|
8661
|
+
key: {
|
|
8662
|
+
content: document2.content,
|
|
8663
|
+
styles: document2.styles,
|
|
8664
|
+
subParts: document2.subParts,
|
|
8665
|
+
viewportWindowKey: FULL_VIEWPORT_WINDOW_KEY
|
|
8666
|
+
},
|
|
8667
|
+
graph: splicedGraph,
|
|
8668
|
+
formatting,
|
|
8669
|
+
mapper: rebuildMapper(
|
|
8670
|
+
priorMapper ?? createPageFragmentMapper(splicedGraph),
|
|
8671
|
+
splicedGraph,
|
|
8672
|
+
firstDirty
|
|
8673
|
+
)
|
|
8674
|
+
});
|
|
8619
8675
|
if (pageCountDelta) {
|
|
8620
8676
|
emit({
|
|
8621
8677
|
kind: "page_count_changed",
|
|
@@ -8645,19 +8701,6 @@ function createLayoutEngine(options = {}) {
|
|
|
8645
8701
|
...dirtyFamilies.length > 0 ? { dirtyFieldFamilies: dirtyFamilies } : {},
|
|
8646
8702
|
...pageCountDelta ? { pageCountDelta } : {}
|
|
8647
8703
|
});
|
|
8648
|
-
cachedKey = {
|
|
8649
|
-
content: document2.content,
|
|
8650
|
-
styles: document2.styles,
|
|
8651
|
-
subParts: document2.subParts,
|
|
8652
|
-
viewportWindowKey: FULL_VIEWPORT_WINDOW_KEY
|
|
8653
|
-
};
|
|
8654
|
-
cachedGraph = splicedGraph;
|
|
8655
|
-
cachedFormatting = formatting;
|
|
8656
|
-
cachedMapper = rebuildMapper(
|
|
8657
|
-
cachedMapper ?? createPageFragmentMapper(splicedGraph),
|
|
8658
|
-
splicedGraph,
|
|
8659
|
-
firstDirty
|
|
8660
|
-
);
|
|
8661
8704
|
if (telemetryOn) {
|
|
8662
8705
|
emitRecomputeCompleted(
|
|
8663
8706
|
"bounded",
|
|
@@ -8674,13 +8717,14 @@ function createLayoutEngine(options = {}) {
|
|
|
8674
8717
|
const document2 = input.document;
|
|
8675
8718
|
const normalizedWindow = normalizeViewportPageWindow(input.viewportPageWindow);
|
|
8676
8719
|
const currentViewportWindowKey = viewportWindowKey(normalizedWindow);
|
|
8677
|
-
const
|
|
8720
|
+
const slot = getCachedSlot(currentViewportWindowKey);
|
|
8721
|
+
const keyEqual = slot !== null && slot.key.content === document2.content && slot.key.styles === document2.styles && slot.key.subParts === document2.subParts && slot.key.viewportWindowKey === currentViewportWindowKey;
|
|
8678
8722
|
if (keyEqual && pendingInvalidation === null) {
|
|
8679
|
-
return
|
|
8723
|
+
return slot.graph;
|
|
8680
8724
|
}
|
|
8681
8725
|
const pending = pendingInvalidation;
|
|
8682
8726
|
pendingInvalidation = null;
|
|
8683
|
-
if (pending !== null && pending.result.scope === "bounded" &&
|
|
8727
|
+
if (pending !== null && pending.result.scope === "bounded" && cachedFull !== null && normalizedWindow === void 0) {
|
|
8684
8728
|
const spliced = incrementalRelayout(input, pending);
|
|
8685
8729
|
if (spliced !== null) {
|
|
8686
8730
|
return spliced;
|
|
@@ -8689,16 +8733,39 @@ function createLayoutEngine(options = {}) {
|
|
|
8689
8733
|
}
|
|
8690
8734
|
return fullRebuild(input, pending?.reason);
|
|
8691
8735
|
}
|
|
8736
|
+
function ensureSlotMapperAndFormatting(slot, document2) {
|
|
8737
|
+
if (slot.mapper === null) {
|
|
8738
|
+
slot.mapper = createPageFragmentMapper(slot.graph);
|
|
8739
|
+
}
|
|
8740
|
+
if (slot.formatting === null) {
|
|
8741
|
+
const mainSurface = createEditorSurfaceSnapshot(
|
|
8742
|
+
document2,
|
|
8743
|
+
createSelectionSnapshot(0, 0),
|
|
8744
|
+
MAIN_STORY_TARGET
|
|
8745
|
+
);
|
|
8746
|
+
slot.formatting = buildResolvedFormattingState(document2, mainSurface);
|
|
8747
|
+
}
|
|
8748
|
+
}
|
|
8692
8749
|
function getMapper(input) {
|
|
8693
8750
|
getGraphInternal(input);
|
|
8694
|
-
|
|
8751
|
+
const currentViewportWindowKey = viewportWindowKey(
|
|
8752
|
+
normalizeViewportPageWindow(input.viewportPageWindow)
|
|
8753
|
+
);
|
|
8754
|
+
const slot = getCachedSlot(currentViewportWindowKey);
|
|
8755
|
+
ensureSlotMapperAndFormatting(slot, input.document);
|
|
8756
|
+
return slot.mapper;
|
|
8695
8757
|
}
|
|
8696
8758
|
function getFormatting(input) {
|
|
8697
8759
|
getGraphInternal(input);
|
|
8698
|
-
|
|
8760
|
+
const currentViewportWindowKey = viewportWindowKey(
|
|
8761
|
+
normalizeViewportPageWindow(input.viewportPageWindow)
|
|
8762
|
+
);
|
|
8763
|
+
const slot = getCachedSlot(currentViewportWindowKey);
|
|
8764
|
+
ensureSlotMapperAndFormatting(slot, input.document);
|
|
8765
|
+
return slot.formatting;
|
|
8699
8766
|
}
|
|
8700
8767
|
if (autoUpgradeToCanvas && options.measurementProvider === void 0 && typeof document !== "undefined" && typeof HTMLCanvasElement !== "undefined") {
|
|
8701
|
-
const readCachedRevision = () =>
|
|
8768
|
+
const readCachedRevision = () => preferredCachedGraph()?.revision ?? 0;
|
|
8702
8769
|
void (async () => {
|
|
8703
8770
|
try {
|
|
8704
8771
|
const mod = await import("./measurement-backend-canvas-F7ZYDACK.js");
|
|
@@ -8708,10 +8775,7 @@ function createLayoutEngine(options = {}) {
|
|
|
8708
8775
|
options.measurementCache,
|
|
8709
8776
|
telemetryBus
|
|
8710
8777
|
);
|
|
8711
|
-
|
|
8712
|
-
cachedGraph = null;
|
|
8713
|
-
cachedFormatting = null;
|
|
8714
|
-
cachedMapper = null;
|
|
8778
|
+
clearAllSlots();
|
|
8715
8779
|
emit({
|
|
8716
8780
|
kind: "measurement_backend_ready",
|
|
8717
8781
|
revision: readCachedRevision(),
|
|
@@ -8755,22 +8819,19 @@ function createLayoutEngine(options = {}) {
|
|
|
8755
8819
|
return getMapper(input);
|
|
8756
8820
|
},
|
|
8757
8821
|
invalidate(reason) {
|
|
8758
|
-
const result = analyzeInvalidation(reason,
|
|
8822
|
+
const result = analyzeInvalidation(reason, preferredCachedGraph());
|
|
8759
8823
|
for (const family of result.dirtyFieldFamilies) {
|
|
8760
8824
|
dirtyFieldFamilies.add(family);
|
|
8761
8825
|
}
|
|
8762
8826
|
if (result.scope === "bounded") {
|
|
8763
8827
|
pendingInvalidation = { reason, result };
|
|
8764
8828
|
} else {
|
|
8765
|
-
|
|
8766
|
-
cachedGraph = null;
|
|
8767
|
-
cachedFormatting = null;
|
|
8768
|
-
cachedMapper = null;
|
|
8829
|
+
clearAllSlots();
|
|
8769
8830
|
pendingInvalidation = { reason, result };
|
|
8770
8831
|
}
|
|
8771
8832
|
},
|
|
8772
8833
|
analyzeInvalidation(reason) {
|
|
8773
|
-
return analyzeInvalidation(reason,
|
|
8834
|
+
return analyzeInvalidation(reason, preferredCachedGraph());
|
|
8774
8835
|
},
|
|
8775
8836
|
getDirtyFieldFamilies() {
|
|
8776
8837
|
return Array.from(dirtyFieldFamilies);
|
|
@@ -8798,14 +8859,11 @@ function createLayoutEngine(options = {}) {
|
|
|
8798
8859
|
telemetryBus
|
|
8799
8860
|
);
|
|
8800
8861
|
if (previousFidelity !== provider.fidelity) {
|
|
8801
|
-
|
|
8802
|
-
cachedGraph = null;
|
|
8803
|
-
cachedFormatting = null;
|
|
8804
|
-
cachedMapper = null;
|
|
8862
|
+
clearAllSlots();
|
|
8805
8863
|
}
|
|
8806
8864
|
emit({
|
|
8807
8865
|
kind: "measurement_backend_ready",
|
|
8808
|
-
revision:
|
|
8866
|
+
revision: preferredCachedGraph()?.revision ?? 0,
|
|
8809
8867
|
fidelity: provider.fidelity
|
|
8810
8868
|
});
|
|
8811
8869
|
},
|
|
@@ -8820,30 +8878,33 @@ function createLayoutEngine(options = {}) {
|
|
|
8820
8878
|
*/
|
|
8821
8879
|
invalidateMeasurementCache() {
|
|
8822
8880
|
measurementProvider.invalidateCache();
|
|
8823
|
-
|
|
8824
|
-
cachedGraph = null;
|
|
8825
|
-
cachedFormatting = null;
|
|
8826
|
-
cachedMapper = null;
|
|
8881
|
+
clearAllSlots();
|
|
8827
8882
|
},
|
|
8828
8883
|
getMeasurementCacheStats() {
|
|
8829
8884
|
if (!isCachedLayoutMeasurementProvider(measurementProvider)) return null;
|
|
8830
8885
|
return measurementProvider.measurementCacheStats();
|
|
8831
8886
|
},
|
|
8832
8887
|
/**
|
|
8833
|
-
* L7 Phase 2.5 — seed the cached graph from a prerender
|
|
8834
|
-
* Populates
|
|
8835
|
-
*
|
|
8836
|
-
* returns the seeded graph directly.
|
|
8837
|
-
* invalidates normally through the existing
|
|
8888
|
+
* L7 Phase 2.5 — seed the full-slot cached graph from a prerender
|
|
8889
|
+
* envelope. Populates the full slot (graph + key, with formatting and
|
|
8890
|
+
* mapper computed lazily on first read) so the next viewport-
|
|
8891
|
+
* independent `getPageGraph` query returns the seeded graph directly.
|
|
8892
|
+
* Any subsequent mutation invalidates normally through the existing
|
|
8893
|
+
* path; sibling eviction in `commitSlot` clears `cachedWindowed` if
|
|
8894
|
+
* it carried a different document tuple.
|
|
8838
8895
|
*/
|
|
8839
8896
|
seedCachedGraph(graph, document2) {
|
|
8840
|
-
|
|
8841
|
-
|
|
8842
|
-
|
|
8843
|
-
|
|
8844
|
-
|
|
8845
|
-
|
|
8846
|
-
|
|
8897
|
+
commitSlot({
|
|
8898
|
+
key: {
|
|
8899
|
+
content: document2.content,
|
|
8900
|
+
styles: document2.styles,
|
|
8901
|
+
subParts: document2.subParts,
|
|
8902
|
+
viewportWindowKey: FULL_VIEWPORT_WINDOW_KEY
|
|
8903
|
+
},
|
|
8904
|
+
graph,
|
|
8905
|
+
formatting: null,
|
|
8906
|
+
mapper: null
|
|
8907
|
+
});
|
|
8847
8908
|
previousPageCount = graph.contentPageCount;
|
|
8848
8909
|
}
|
|
8849
8910
|
};
|
|
@@ -3,7 +3,7 @@ import {
|
|
|
3
3
|
} from "./chunk-Y4XZCMCS.js";
|
|
4
4
|
import {
|
|
5
5
|
applyTextTransaction
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-MQ5GAJ54.js";
|
|
7
7
|
import {
|
|
8
8
|
createInsertedTableBlock,
|
|
9
9
|
createNoopStructuralMutation,
|
|
@@ -11,11 +11,11 @@ import {
|
|
|
11
11
|
replaceParagraphScope,
|
|
12
12
|
resolveInsertedTableStyleId,
|
|
13
13
|
resolveParagraphScope
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-QTRJLKR2.js";
|
|
15
15
|
import {
|
|
16
16
|
NO_EDITABLE_TARGETS_INDEX,
|
|
17
17
|
createEditorSurfaceSnapshot
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-XBQFDBXE.js";
|
|
19
19
|
import {
|
|
20
20
|
createSelectionSnapshot
|
|
21
21
|
} from "./chunk-OYGMRRR7.js";
|
|
@@ -6,7 +6,7 @@ import {
|
|
|
6
6
|
createHeaderFooterStoryKey,
|
|
7
7
|
createNoteStoryKey,
|
|
8
8
|
sha256TextHex
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-5KTJKTNE.js";
|
|
10
10
|
import {
|
|
11
11
|
SCOPE_MARKER_BOOKMARK_PREFIX,
|
|
12
12
|
buildGrabBagSourceChildFromParsed,
|
|
@@ -1147,7 +1147,7 @@ function readNumPicBullet(node, numPicBulletId, context, xmlPath) {
|
|
|
1147
1147
|
const rEmbed = blip?.attributes["r:embed"] ?? blip?.attributes.embed;
|
|
1148
1148
|
if (rEmbed) {
|
|
1149
1149
|
const rel = context.relationships.find((r) => r.id === rEmbed);
|
|
1150
|
-
if (rel) {
|
|
1150
|
+
if (isEmbeddedImageRelationship(rel)) {
|
|
1151
1151
|
const packagePartName = normalizePartPath(
|
|
1152
1152
|
resolveRelationshipTarget(context.partPath ?? "/word/numbering.xml", rel)
|
|
1153
1153
|
);
|
|
@@ -1165,7 +1165,7 @@ function readNumPicBullet(node, numPicBulletId, context, xmlPath) {
|
|
|
1165
1165
|
const rId = imagedata?.attributes["r:id"] ?? imagedata?.attributes.id;
|
|
1166
1166
|
if (rId && context?.relationships && context.relationships.length > 0) {
|
|
1167
1167
|
const rel = context.relationships.find((r) => r.id === rId);
|
|
1168
|
-
if (rel) {
|
|
1168
|
+
if (isEmbeddedImageRelationship(rel)) {
|
|
1169
1169
|
const packagePartName = normalizePartPath(
|
|
1170
1170
|
resolveRelationshipTarget(context.partPath ?? "/word/numbering.xml", rel)
|
|
1171
1171
|
);
|
|
@@ -1190,6 +1190,11 @@ function readNumPicBullet(node, numPicBulletId, context, xmlPath) {
|
|
|
1190
1190
|
...mediaId !== void 0 ? { mediaId } : {}
|
|
1191
1191
|
};
|
|
1192
1192
|
}
|
|
1193
|
+
function isEmbeddedImageRelationship(relationship) {
|
|
1194
|
+
return Boolean(
|
|
1195
|
+
relationship && relationship.targetMode === "internal" && relationship.type.endsWith("/image")
|
|
1196
|
+
);
|
|
1197
|
+
}
|
|
1193
1198
|
function toCanonicalAbstractNumberingId(value) {
|
|
1194
1199
|
return value.startsWith("abstract-num:") ? value : `abstract-num:${value}`;
|
|
1195
1200
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
2
|
loadDocxSessionAsync
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-EFEW7BTT.js";
|
|
4
4
|
import {
|
|
5
5
|
buildCompatibilityReport,
|
|
6
6
|
createLoadScheduler
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-PZIEOEJZ.js";
|
|
8
8
|
import {
|
|
9
9
|
decodePersistedSourcePackageBytes,
|
|
10
10
|
hasValidPersistedSourcePackageDigest,
|
|
@@ -3,12 +3,12 @@ import {
|
|
|
3
3
|
createNoopStructuralMutation,
|
|
4
4
|
findTableCellParagraphSelection,
|
|
5
5
|
findTopLevelParagraphSelectionNearBlock
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-QTRJLKR2.js";
|
|
7
7
|
import {
|
|
8
8
|
collectEditableTargetRefs,
|
|
9
9
|
collectStoryBlockContexts,
|
|
10
10
|
createHeaderFooterStoryKey
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5KTJKTNE.js";
|
|
12
12
|
import {
|
|
13
13
|
createDetachedAnchor,
|
|
14
14
|
createNodeAnchor,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'prosemirror-state';
|
|
2
2
|
import 'prosemirror-model';
|
|
3
|
-
export {
|
|
3
|
+
export { gc as Alignment, gd as FormattingMutationResult, ge as FormattingOperation, gf as TextMarkClearTarget, gg as TextMarkRangeOperation, gh as applyFormattingOperationToDocument, gi as applyIndentation, gj as applyTextMarkOperationToDocumentRange, gk as getFormattingStateFromRenderSnapshot, gl as isMarkActive, gm as makeSetAlignment, gn as makeSetFontFamily, go as makeSetFontSize, gp as makeSetHighlight, gq as makeSetTextColor, gr as makeToggleAllCaps, gs as makeToggleBold, gt as makeToggleItalic, gu as makeToggleSmallCaps, gv as makeToggleStrikethrough, gw as makeToggleSubscript, gx as makeToggleSuperscript, gy as makeToggleUnderline } from '../../public-types-BR1SYK2F.cjs';
|
|
4
4
|
import '../../canonical-document-CfZIc-fC.cjs';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'yjs';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import 'prosemirror-state';
|
|
2
2
|
import 'prosemirror-model';
|
|
3
|
-
export {
|
|
3
|
+
export { gc as Alignment, gd as FormattingMutationResult, ge as FormattingOperation, gf as TextMarkClearTarget, gg as TextMarkRangeOperation, gh as applyFormattingOperationToDocument, gi as applyIndentation, gj as applyTextMarkOperationToDocumentRange, gk as getFormattingStateFromRenderSnapshot, gl as isMarkActive, gm as makeSetAlignment, gn as makeSetFontFamily, go as makeSetFontSize, gp as makeSetHighlight, gq as makeSetTextColor, gr as makeToggleAllCaps, gs as makeToggleBold, gt as makeToggleItalic, gu as makeToggleSmallCaps, gv as makeToggleStrikethrough, gw as makeToggleSubscript, gx as makeToggleSuperscript, gy as makeToggleUnderline } from '../../public-types-DXNZVKrS.js';
|
|
4
4
|
import '../../canonical-document-CfZIc-fC.js';
|
|
5
5
|
import 'react';
|
|
6
6
|
import 'yjs';
|
|
@@ -2402,7 +2402,20 @@ function sourceJoinHash(refs) {
|
|
|
2402
2402
|
if (sourceIds.length === 0) return void 0;
|
|
2403
2403
|
return hashText(sourceIds.join("\0"));
|
|
2404
2404
|
}
|
|
2405
|
+
var numberingCatalogHashCache = /* @__PURE__ */ new WeakMap();
|
|
2406
|
+
var numberingTargetHashCache = /* @__PURE__ */ new WeakMap();
|
|
2405
2407
|
function createNumberingCatalogRevisionHash(doc) {
|
|
2408
|
+
const numbering = doc.numbering;
|
|
2409
|
+
if (numbering !== void 0) {
|
|
2410
|
+
const cached = numberingCatalogHashCache.get(numbering);
|
|
2411
|
+
if (cached !== void 0) return cached;
|
|
2412
|
+
const fresh = computeNumberingCatalogRevisionHash(doc);
|
|
2413
|
+
numberingCatalogHashCache.set(numbering, fresh);
|
|
2414
|
+
return fresh;
|
|
2415
|
+
}
|
|
2416
|
+
return computeNumberingCatalogRevisionHash(doc);
|
|
2417
|
+
}
|
|
2418
|
+
function computeNumberingCatalogRevisionHash(doc) {
|
|
2406
2419
|
const catalog = doc.numbering ?? { abstractDefinitions: {}, instances: {} };
|
|
2407
2420
|
const abstractDefinitions = catalog.abstractDefinitions ?? {};
|
|
2408
2421
|
const instances = catalog.instances ?? {};
|
|
@@ -2453,8 +2466,27 @@ function createNumberingCatalogRevisionHash(doc) {
|
|
|
2453
2466
|
}));
|
|
2454
2467
|
}
|
|
2455
2468
|
function createNumberingTargetRevisionHash(doc) {
|
|
2469
|
+
const numbering = doc.numbering;
|
|
2470
|
+
const styles = doc.styles;
|
|
2471
|
+
if (numbering !== void 0 && styles !== void 0) {
|
|
2472
|
+
let inner = numberingTargetHashCache.get(numbering);
|
|
2473
|
+
if (inner === void 0) {
|
|
2474
|
+
inner = /* @__PURE__ */ new WeakMap();
|
|
2475
|
+
numberingTargetHashCache.set(numbering, inner);
|
|
2476
|
+
}
|
|
2477
|
+
const cached = inner.get(styles);
|
|
2478
|
+
if (cached !== void 0) return cached;
|
|
2479
|
+
const fresh = computeNumberingTargetRevisionHash(doc);
|
|
2480
|
+
inner.set(styles, fresh);
|
|
2481
|
+
return fresh;
|
|
2482
|
+
}
|
|
2483
|
+
return computeNumberingTargetRevisionHash(doc);
|
|
2484
|
+
}
|
|
2485
|
+
function computeNumberingTargetRevisionHash(doc) {
|
|
2456
2486
|
const paragraphStyles = doc.styles?.paragraphs ?? {};
|
|
2457
2487
|
return hashText(JSON.stringify({
|
|
2488
|
+
// Reuses the memoized catalog hash on the hot path so a typing edit
|
|
2489
|
+
// pays for the catalog hash at most once across both helpers.
|
|
2458
2490
|
numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
|
|
2459
2491
|
paragraphStyleNumbering: Object.keys(paragraphStyles).sort().map((styleId) => {
|
|
2460
2492
|
const style = paragraphStyles[styleId];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CanonicalDocumentEnvelope,
|
|
1
|
+
import { C as CanonicalDocumentEnvelope, e as SelectionSnapshot, i as TransactionMapping } from '../../public-types-BR1SYK2F.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { C as CanonicalDocumentEnvelope,
|
|
1
|
+
import { C as CanonicalDocumentEnvelope, e as SelectionSnapshot, i as TransactionMapping } from '../../public-types-DXNZVKrS.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
@@ -2,13 +2,13 @@ import {
|
|
|
2
2
|
insertImage,
|
|
3
3
|
repositionFloatingImage,
|
|
4
4
|
resizeImage
|
|
5
|
-
} from "../../chunk-
|
|
6
|
-
import "../../chunk-
|
|
7
|
-
import "../../chunk-
|
|
5
|
+
} from "../../chunk-INLRCC4N.js";
|
|
6
|
+
import "../../chunk-MQ5GAJ54.js";
|
|
7
|
+
import "../../chunk-QTRJLKR2.js";
|
|
8
8
|
import "../../chunk-QIO6V46H.js";
|
|
9
|
-
import "../../chunk-
|
|
9
|
+
import "../../chunk-XBQFDBXE.js";
|
|
10
10
|
import "../../chunk-OYGMRRR7.js";
|
|
11
|
-
import "../../chunk-
|
|
11
|
+
import "../../chunk-5KTJKTNE.js";
|
|
12
12
|
import "../../chunk-UFVDIR2C.js";
|
|
13
13
|
import "../../chunk-PGGPPZ65.js";
|
|
14
14
|
import "../../chunk-DNXYUIIS.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as SelectionSnapshot, M as MarginPresetDefinition, k as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-BR1SYK2F.cjs';
|
|
2
2
|
import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-CfZIc-fC.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { j as SelectionSnapshot, M as MarginPresetDefinition, k as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-DXNZVKrS.js';
|
|
2
2
|
import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-CfZIc-fC.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-
|
|
1
|
+
import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-BR1SYK2F.cjs';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-
|
|
1
|
+
import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-DXNZVKrS.js';
|
|
2
2
|
import 'react';
|
|
3
3
|
import 'yjs';
|
|
4
4
|
import 'y-protocols/awareness';
|