@beyondwork/docx-react-component 1.0.132 → 1.0.133
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 +158 -67
- 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 +9326 -7478
- 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-XYTWOJII.js → chunk-224TSMEB.js} +635 -89
- package/dist/{chunk-43JAPM2F.js → chunk-3JEE5RJU.js} +92 -131
- package/dist/{chunk-UP2KDOYE.js → chunk-57HTKX3P.js} +6 -2
- package/dist/{chunk-RYMMKOFI.js → chunk-5KTJKTNE.js} +32 -0
- package/dist/{chunk-LPLJZJT2.js → chunk-CVSD3UNK.js} +128 -69
- package/dist/{chunk-JVTDBX67.js → chunk-EFEW7BTT.js} +2 -2
- package/dist/{chunk-UFPBYJMA.js → chunk-INLRCC4N.js} +2 -2
- package/dist/{chunk-6736GA6J.js → chunk-KL4TZSZV.js} +1 -1
- package/dist/{chunk-N5FTU4HZ.js → chunk-MQ5GAJ54.js} +68 -39
- package/dist/{chunk-W2I47J2Q.js → chunk-NJFKPDNG.js} +216 -2
- package/dist/{chunk-YUHNDEV5.js → chunk-OTRVGNZQ.js} +2934 -1815
- 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-QUTVR72L.js → chunk-S3PEKX6H.js} +246 -43
- package/dist/{chunk-RBWJHRNP.js → chunk-T66OS7MN.js} +8 -3
- package/dist/{chunk-ALWXYGXP.js → chunk-V2JF42SI.js} +2 -2
- package/dist/{chunk-6TLZ6CMP.js → chunk-WDDFU2N2.js} +2 -2
- package/dist/{chunk-U3UMKA7B.js → chunk-XBQFDBXE.js} +1 -1
- package/dist/{chunk-CDEZGLQ3.js → chunk-ZFCZ7XXH.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 +4827 -2434
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +292 -53
- 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-B2H99237.d.cts} +2 -2
- package/dist/{loader-CfpeEPAa.d.ts → loader-DfTjqVwn.d.ts} +2 -2
- package/dist/{public-types-Cjs8glST.d.ts → public-types-B5lOUIrP.d.ts} +689 -232
- package/dist/{public-types-KBS6JnOs.d.cts → public-types-S8gTYwKo.d.cts} +689 -232
- package/dist/public-types.cjs +158 -67
- 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 +1032 -416
- 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-CBDIOYXA.d.ts} +2 -2
- package/dist/{session-wwe0Gib-.d.cts → session-CR2A1hGZ.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 +398 -105
- package/dist/tailwind.d.cts +1 -1
- package/dist/tailwind.d.ts +1 -1
- package/dist/tailwind.js +7 -7
- package/dist/{types-CH7NWqVL.d.ts → types-B-90ywjU.d.ts} +1 -1
- package/dist/{types-B3SGRW0w.d.cts → types-yty2K-hk.d.cts} +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 +398 -105
- 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
|
@@ -11,7 +11,7 @@ import {
|
|
|
11
11
|
} from "./chunk-M6XR534O.js";
|
|
12
12
|
import {
|
|
13
13
|
buildBookmarkNameMap
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-RP76USJE.js";
|
|
15
15
|
import {
|
|
16
16
|
deleteSelectionOrBackward,
|
|
17
17
|
deleteSelectionOrForward,
|
|
@@ -22,7 +22,7 @@ import {
|
|
|
22
22
|
insertText,
|
|
23
23
|
outdentParagraphAtSelection,
|
|
24
24
|
splitParagraph
|
|
25
|
-
} from "./chunk-
|
|
25
|
+
} from "./chunk-REFHJ2FN.js";
|
|
26
26
|
import {
|
|
27
27
|
applyFormattingOperationToDocument,
|
|
28
28
|
applyTextMarkOperationToDocumentRange,
|
|
@@ -32,29 +32,30 @@ import {
|
|
|
32
32
|
insertImage,
|
|
33
33
|
repositionFloatingImage,
|
|
34
34
|
resizeImage
|
|
35
|
-
} from "./chunk-
|
|
35
|
+
} from "./chunk-INLRCC4N.js";
|
|
36
36
|
import {
|
|
37
37
|
applyTextTransaction
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-MQ5GAJ54.js";
|
|
39
39
|
import {
|
|
40
40
|
applyTableStructureOperationForEditableTarget,
|
|
41
41
|
removeCellFromRow,
|
|
42
42
|
removeTableRowPure
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-WDDFU2N2.js";
|
|
44
44
|
import {
|
|
45
45
|
resolveParagraphScope
|
|
46
|
-
} from "./chunk-
|
|
46
|
+
} from "./chunk-QTRJLKR2.js";
|
|
47
47
|
import {
|
|
48
48
|
buildGeometryDebugEntry,
|
|
49
49
|
collectLineBoxesForRegion,
|
|
50
50
|
createGeometryFacet
|
|
51
|
-
} from "./chunk-
|
|
51
|
+
} from "./chunk-57HTKX3P.js";
|
|
52
52
|
import {
|
|
53
53
|
AI_ACTION_POLICIES,
|
|
54
54
|
allocateNumberingInstance,
|
|
55
55
|
buildFormattingDebugEntry,
|
|
56
56
|
cloneNumberingCatalog,
|
|
57
57
|
collectScopeLocations,
|
|
58
|
+
computeScopeStoryLayout,
|
|
58
59
|
createDocumentOutlineSnapshot,
|
|
59
60
|
createDocumentSectionSnapshots,
|
|
60
61
|
createScopeCompilerService,
|
|
@@ -64,19 +65,25 @@ import {
|
|
|
64
65
|
findAllScopesAt,
|
|
65
66
|
findBookmarkNameForOffset,
|
|
66
67
|
findDocumentSectionSnapshot,
|
|
68
|
+
findOwningBlockSlotAtPosition,
|
|
69
|
+
findParagraphSlotAtPosition,
|
|
67
70
|
findScopesIntersecting,
|
|
68
71
|
findTextMatches,
|
|
69
72
|
findTextWithStyleMatches,
|
|
70
73
|
getListKind,
|
|
74
|
+
inlineLengthForScopeCoordinates,
|
|
71
75
|
rebuildFieldRegistry,
|
|
76
|
+
removeScopeMarkersFromBlockList,
|
|
77
|
+
replaceParagraphChildrenAtPath,
|
|
72
78
|
resolveEditableCommandTarget,
|
|
73
79
|
resolveEditableTableStructureTarget,
|
|
74
80
|
resolveEditableTextTarget,
|
|
75
81
|
resolveHeadingPath,
|
|
76
82
|
resolveScope,
|
|
83
|
+
sameScopeParagraphPath,
|
|
77
84
|
serializeFragmentToWordML,
|
|
78
85
|
setStartOverride
|
|
79
|
-
} from "./chunk-
|
|
86
|
+
} from "./chunk-224TSMEB.js";
|
|
80
87
|
import {
|
|
81
88
|
ISSUE_METADATA_ID,
|
|
82
89
|
LAYOUT_ENGINE_VERSION,
|
|
@@ -114,7 +121,7 @@ import {
|
|
|
114
121
|
setWorkspaceMode,
|
|
115
122
|
setZoomLevel,
|
|
116
123
|
snapCommentAnchorAwayFromTable
|
|
117
|
-
} from "./chunk-
|
|
124
|
+
} from "./chunk-CVSD3UNK.js";
|
|
118
125
|
import {
|
|
119
126
|
countLogicalPositions,
|
|
120
127
|
createPlainText,
|
|
@@ -133,7 +140,7 @@ import {
|
|
|
133
140
|
replaceStoryBlocks,
|
|
134
141
|
resolvePageFieldDisplayText,
|
|
135
142
|
storyTargetKey
|
|
136
|
-
} from "./chunk-
|
|
143
|
+
} from "./chunk-XBQFDBXE.js";
|
|
137
144
|
import {
|
|
138
145
|
createCommentSidebarProjection,
|
|
139
146
|
createCommentStoreFromRuntimeComments
|
|
@@ -157,12 +164,12 @@ import {
|
|
|
157
164
|
persistedSnapshotFromEditorSessionState,
|
|
158
165
|
remapRevisionStore,
|
|
159
166
|
setRevisionStatus
|
|
160
|
-
} from "./chunk-
|
|
167
|
+
} from "./chunk-PZIEOEJZ.js";
|
|
161
168
|
import {
|
|
162
169
|
isSupportedFieldFamily,
|
|
163
170
|
parseTocLevelRange,
|
|
164
171
|
resolveRefFieldText
|
|
165
|
-
} from "./chunk-
|
|
172
|
+
} from "./chunk-T66OS7MN.js";
|
|
166
173
|
import {
|
|
167
174
|
collectEditableTargetRefs,
|
|
168
175
|
collectEditableTargetRefsForStoryBlockRanges,
|
|
@@ -171,7 +178,7 @@ import {
|
|
|
171
178
|
createHeaderFooterStoryKey,
|
|
172
179
|
sha256TextHex,
|
|
173
180
|
validateEditableTargetRef
|
|
174
|
-
} from "./chunk-
|
|
181
|
+
} from "./chunk-5KTJKTNE.js";
|
|
175
182
|
import {
|
|
176
183
|
setActiveSerializeTelemetryBus
|
|
177
184
|
} from "./chunk-FM4K4XFJ.js";
|
|
@@ -2022,13 +2029,14 @@ function mapRecordAnchor(anchor, mapping) {
|
|
|
2022
2029
|
return toPublicAnchorProjection(mapAnchor(toInternalAnchorProjection(anchor), mapping));
|
|
2023
2030
|
}
|
|
2024
2031
|
function withCommandTextTarget(context, command) {
|
|
2025
|
-
|
|
2026
|
-
|
|
2032
|
+
let next = context;
|
|
2033
|
+
if (next.precomputedSurface === void 0 && next.renderSnapshot?.surface !== void 0) {
|
|
2034
|
+
next = { ...next, precomputedSurface: next.renderSnapshot.surface };
|
|
2027
2035
|
}
|
|
2028
|
-
|
|
2029
|
-
...
|
|
2030
|
-
|
|
2031
|
-
|
|
2036
|
+
if (command.textTarget && next.textTarget !== command.textTarget) {
|
|
2037
|
+
next = { ...next, textTarget: command.textTarget };
|
|
2038
|
+
}
|
|
2039
|
+
return next;
|
|
2032
2040
|
}
|
|
2033
2041
|
function listCommandContext(context) {
|
|
2034
2042
|
return {
|
|
@@ -7232,39 +7240,8 @@ function insertScopeMarkers(document, params) {
|
|
|
7232
7240
|
to: normalizedTo
|
|
7233
7241
|
};
|
|
7234
7242
|
}
|
|
7235
|
-
const
|
|
7236
|
-
|
|
7237
|
-
let fromBlockIndex = -1;
|
|
7238
|
-
let fromBlockKind = null;
|
|
7239
|
-
let toBlockIndex = -1;
|
|
7240
|
-
let toBlockKind = null;
|
|
7241
|
-
let storyLength = 0;
|
|
7242
|
-
for (let i = 0; i < root.children.length; i += 1) {
|
|
7243
|
-
const block = root.children[i];
|
|
7244
|
-
const blockFrom = cursor;
|
|
7245
|
-
let blockLength;
|
|
7246
|
-
if (block.type === "paragraph") {
|
|
7247
|
-
blockLength = block.children.reduce(
|
|
7248
|
-
(total, child) => total + inlineLength(child),
|
|
7249
|
-
0
|
|
7250
|
-
);
|
|
7251
|
-
paraSlots.push({ index: i, from: blockFrom, to: blockFrom + blockLength });
|
|
7252
|
-
} else {
|
|
7253
|
-
blockLength = 1;
|
|
7254
|
-
}
|
|
7255
|
-
const blockTo = blockFrom + blockLength;
|
|
7256
|
-
if (fromBlockIndex === -1 && normalizedFrom >= blockFrom && normalizedFrom <= blockTo) {
|
|
7257
|
-
fromBlockIndex = i;
|
|
7258
|
-
fromBlockKind = block.type;
|
|
7259
|
-
}
|
|
7260
|
-
if (toBlockIndex === -1 && normalizedTo >= blockFrom && normalizedTo <= blockTo) {
|
|
7261
|
-
toBlockIndex = i;
|
|
7262
|
-
toBlockKind = block.type;
|
|
7263
|
-
}
|
|
7264
|
-
cursor = blockTo;
|
|
7265
|
-
if (i < root.children.length - 1) cursor += 1;
|
|
7266
|
-
storyLength = cursor;
|
|
7267
|
-
}
|
|
7243
|
+
const layout = computeScopeStoryLayout(document);
|
|
7244
|
+
const storyLength = layout.storyLength;
|
|
7268
7245
|
if (normalizedFrom < 0 || normalizedTo > storyLength) {
|
|
7269
7246
|
return {
|
|
7270
7247
|
status: "range-out-of-bounds",
|
|
@@ -7274,73 +7251,71 @@ function insertScopeMarkers(document, params) {
|
|
|
7274
7251
|
storyLength
|
|
7275
7252
|
};
|
|
7276
7253
|
}
|
|
7277
|
-
|
|
7278
|
-
|
|
7279
|
-
|
|
7280
|
-
|
|
7281
|
-
|
|
7282
|
-
|
|
7283
|
-
|
|
7284
|
-
|
|
7285
|
-
|
|
7286
|
-
if (fromBlockKind !== "paragraph" || toBlockKind !== "paragraph") {
|
|
7287
|
-
const nonParaIndex = fromBlockKind !== "paragraph" ? fromBlockIndex : toBlockIndex;
|
|
7288
|
-
const nonParaKind = fromBlockKind !== "paragraph" ? fromBlockKind : toBlockKind;
|
|
7254
|
+
const startSlot = findParagraphSlotAtPosition(
|
|
7255
|
+
layout,
|
|
7256
|
+
normalizedFrom,
|
|
7257
|
+
"start"
|
|
7258
|
+
);
|
|
7259
|
+
const endSlot = findParagraphSlotAtPosition(layout, normalizedTo, "end");
|
|
7260
|
+
if (!startSlot || !endSlot) {
|
|
7261
|
+
const offenderPosition = !startSlot ? normalizedFrom : normalizedTo;
|
|
7262
|
+
const owner = findOwningBlockSlotAtPosition(layout, offenderPosition);
|
|
7289
7263
|
return {
|
|
7290
7264
|
status: "non-paragraph-target",
|
|
7291
7265
|
scopeId,
|
|
7292
7266
|
from: normalizedFrom,
|
|
7293
7267
|
to: normalizedTo,
|
|
7294
|
-
blockIndex:
|
|
7295
|
-
blockKind:
|
|
7268
|
+
blockIndex: owner?.rootBlockIndex ?? -1,
|
|
7269
|
+
blockKind: owner?.kind ?? "unknown"
|
|
7296
7270
|
};
|
|
7297
7271
|
}
|
|
7298
|
-
|
|
7299
|
-
const endSlot = paraSlots.find((s) => s.index === toBlockIndex);
|
|
7300
|
-
if (startSlot.index === endSlot.index) {
|
|
7272
|
+
if (sameScopeParagraphPath(startSlot.path, endSlot.path)) {
|
|
7301
7273
|
const newChildren = injectMarkersIntoInlineList(
|
|
7302
|
-
|
|
7274
|
+
startSlot.paragraph.children,
|
|
7303
7275
|
scopeId,
|
|
7304
7276
|
normalizedFrom - startSlot.from,
|
|
7305
7277
|
normalizedTo - startSlot.from,
|
|
7306
7278
|
"both"
|
|
7307
7279
|
);
|
|
7308
|
-
const
|
|
7309
|
-
|
|
7280
|
+
const nextRoot = replaceParagraphChildrenAtPath(
|
|
7281
|
+
root,
|
|
7282
|
+
startSlot.path,
|
|
7283
|
+
newChildren
|
|
7310
7284
|
);
|
|
7311
7285
|
return {
|
|
7312
7286
|
status: "planted",
|
|
7313
|
-
document: { ...document, content:
|
|
7287
|
+
document: { ...document, content: nextRoot },
|
|
7314
7288
|
scopeId,
|
|
7315
7289
|
plantedRange: { from: normalizedFrom, to: normalizedTo }
|
|
7316
7290
|
};
|
|
7317
7291
|
}
|
|
7318
|
-
const
|
|
7319
|
-
|
|
7320
|
-
|
|
7321
|
-
|
|
7322
|
-
|
|
7323
|
-
|
|
7324
|
-
|
|
7325
|
-
|
|
7326
|
-
|
|
7327
|
-
|
|
7328
|
-
|
|
7329
|
-
|
|
7330
|
-
|
|
7331
|
-
|
|
7332
|
-
|
|
7333
|
-
|
|
7334
|
-
|
|
7335
|
-
|
|
7336
|
-
|
|
7337
|
-
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7292
|
+
const startChildren = injectMarkersIntoInlineList(
|
|
7293
|
+
startSlot.paragraph.children,
|
|
7294
|
+
scopeId,
|
|
7295
|
+
normalizedFrom - startSlot.from,
|
|
7296
|
+
Number.POSITIVE_INFINITY,
|
|
7297
|
+
"start-only"
|
|
7298
|
+
);
|
|
7299
|
+
const endChildren = injectMarkersIntoInlineList(
|
|
7300
|
+
endSlot.paragraph.children,
|
|
7301
|
+
scopeId,
|
|
7302
|
+
Number.NEGATIVE_INFINITY,
|
|
7303
|
+
normalizedTo - endSlot.from,
|
|
7304
|
+
"end-only"
|
|
7305
|
+
);
|
|
7306
|
+
const rootWithStart = replaceParagraphChildrenAtPath(
|
|
7307
|
+
root,
|
|
7308
|
+
startSlot.path,
|
|
7309
|
+
startChildren
|
|
7310
|
+
);
|
|
7311
|
+
const rootWithBoth = replaceParagraphChildrenAtPath(
|
|
7312
|
+
rootWithStart,
|
|
7313
|
+
endSlot.path,
|
|
7314
|
+
endChildren
|
|
7315
|
+
);
|
|
7341
7316
|
return {
|
|
7342
7317
|
status: "planted",
|
|
7343
|
-
document: { ...document, content:
|
|
7318
|
+
document: { ...document, content: rootWithBoth },
|
|
7344
7319
|
scopeId,
|
|
7345
7320
|
plantedRange: { from: normalizedFrom, to: normalizedTo }
|
|
7346
7321
|
};
|
|
@@ -7348,43 +7323,15 @@ function insertScopeMarkers(document, params) {
|
|
|
7348
7323
|
function removeScopeMarkers(document, scopeId) {
|
|
7349
7324
|
const root = document.content;
|
|
7350
7325
|
if (!root || root.type !== "doc") return document;
|
|
7351
|
-
|
|
7352
|
-
|
|
7353
|
-
if (block.type !== "paragraph") return block;
|
|
7354
|
-
const kept = block.children.filter((child) => {
|
|
7355
|
-
if ((child.type === "scope_marker_start" || child.type === "scope_marker_end") && child.scopeId === scopeId) {
|
|
7356
|
-
mutated = true;
|
|
7357
|
-
return false;
|
|
7358
|
-
}
|
|
7359
|
-
return true;
|
|
7360
|
-
});
|
|
7361
|
-
if (kept.length === block.children.length) return block;
|
|
7362
|
-
return { ...block, children: kept };
|
|
7363
|
-
});
|
|
7364
|
-
if (!mutated) return document;
|
|
7326
|
+
const result = removeScopeMarkersFromBlockList(root.children, scopeId);
|
|
7327
|
+
if (!result.mutated) return document;
|
|
7365
7328
|
return {
|
|
7366
7329
|
...document,
|
|
7367
|
-
content: { ...root, children }
|
|
7330
|
+
content: { ...root, children: result.blocks }
|
|
7368
7331
|
};
|
|
7369
7332
|
}
|
|
7370
7333
|
function inlineLength(node) {
|
|
7371
|
-
|
|
7372
|
-
case "text":
|
|
7373
|
-
return Array.from(node.text).length;
|
|
7374
|
-
case "hyperlink":
|
|
7375
|
-
case "field":
|
|
7376
|
-
return node.children.reduce(
|
|
7377
|
-
(total, child) => total + inlineLength(child),
|
|
7378
|
-
0
|
|
7379
|
-
);
|
|
7380
|
-
case "bookmark_start":
|
|
7381
|
-
case "bookmark_end":
|
|
7382
|
-
case "scope_marker_start":
|
|
7383
|
-
case "scope_marker_end":
|
|
7384
|
-
return 0;
|
|
7385
|
-
default:
|
|
7386
|
-
return 1;
|
|
7387
|
-
}
|
|
7334
|
+
return inlineLengthForScopeCoordinates(node);
|
|
7388
7335
|
}
|
|
7389
7336
|
function injectMarkersIntoInlineList(inlines, scopeId, startOffset, endOffset, mode) {
|
|
7390
7337
|
const start = { type: "scope_marker_start", scopeId };
|
|
@@ -12592,6 +12539,14 @@ function createDocumentRuntime(options) {
|
|
|
12592
12539
|
let effectiveMarkupModeProvider;
|
|
12593
12540
|
const perfCounters = new PerfCounters();
|
|
12594
12541
|
const hotEditTraces = new HotEditTraceRecorder();
|
|
12542
|
+
const scopeSurfaceTelemetry = {
|
|
12543
|
+
onPrecomputedSurfaceHit: () => {
|
|
12544
|
+
perfCounters.increment("surface.scope.precomputedSurfaceHit");
|
|
12545
|
+
},
|
|
12546
|
+
onScopeSurfaceBuild: () => {
|
|
12547
|
+
perfCounters.increment("surface.scope.builds");
|
|
12548
|
+
}
|
|
12549
|
+
};
|
|
12595
12550
|
let cachedHotEditPolicy = null;
|
|
12596
12551
|
function getHotEditPolicy() {
|
|
12597
12552
|
if (cachedHotEditPolicy?.document === state.document) {
|
|
@@ -13040,7 +12995,7 @@ function createDocumentRuntime(options) {
|
|
|
13040
12995
|
viewportRangesKey: rangesKey,
|
|
13041
12996
|
snapshot: surface
|
|
13042
12997
|
};
|
|
13043
|
-
const fullSurface = fullSurfaceForCache
|
|
12998
|
+
const fullSurface = fullSurfaceForCache?.viewportBlockRanges === null ? fullSurfaceForCache : surface.viewportBlockRanges === null ? surface : void 0;
|
|
13044
12999
|
if (fullSurface) {
|
|
13045
13000
|
cachedFullSurface = {
|
|
13046
13001
|
content: state.document.content,
|
|
@@ -14603,6 +14558,7 @@ function createDocumentRuntime(options) {
|
|
|
14603
14558
|
documentMode: workflowCoordinator.getEffectiveDocumentMode(commandSelection),
|
|
14604
14559
|
defaultAuthorId: defaultAuthorId ?? void 0,
|
|
14605
14560
|
renderSnapshot: cachedRenderSnapshot,
|
|
14561
|
+
surfaceTelemetry: scopeSurfaceTelemetry,
|
|
14606
14562
|
activeStoryKey: canonicalEditableTargetStoryKey(activeStory),
|
|
14607
14563
|
editableTargetCache: editableTargetBlockCache,
|
|
14608
14564
|
...resolvedFragmentTextTarget ? { textTarget: resolvedFragmentTextTarget } : {}
|
|
@@ -16875,7 +16831,8 @@ function createDocumentRuntime(options) {
|
|
|
16875
16831
|
applyViewportRanges(getSelectionCorridorViewportRanges(cachedRenderSnapshot.surface));
|
|
16876
16832
|
}
|
|
16877
16833
|
const tValidation0 = performance.now();
|
|
16878
|
-
const
|
|
16834
|
+
const patchSourceSurface = getReusableCachedFullSurface(previous.document, activeStory) ?? cachedRenderSnapshot.surface;
|
|
16835
|
+
const patchedFullLocalTextSurface = useLocalTextCommitSnapshot ? tryPatchLocalTextSurface(patchSourceSurface, transaction.mapping) : null;
|
|
16879
16836
|
const patchedLocalTextSurface = patchedFullLocalTextSurface ? createLocalTextCorridorSurfaceFromFullSurface(patchedFullLocalTextSurface) : null;
|
|
16880
16837
|
if (patchedLocalTextSurface) {
|
|
16881
16838
|
cachePatchedLocalTextSurface(
|
|
@@ -17219,11 +17176,14 @@ function createDocumentRuntime(options) {
|
|
|
17219
17176
|
}
|
|
17220
17177
|
const listBoundaryDeleteUsesStoryText = targetResolution?.kind === "accepted" && editableTarget?.listAddress?.operationScope === "list-text" && isTopLevelMainStoryBlockPath(editableTarget.blockPath) && selection.isCollapsed && (commandForDispatch.type === "text.delete-backward" && selection.anchor === targetResolution.range.from || commandForDispatch.type === "text.delete-forward" && selection.anchor === targetResolution.range.to);
|
|
17221
17178
|
const textTarget = targetResolution?.kind === "accepted" && !listBoundaryDeleteUsesStoryText ? targetResolution.textTarget : legacyTextTarget;
|
|
17179
|
+
const fullScopeSurface = cachedFullSurface?.snapshot;
|
|
17222
17180
|
const context = {
|
|
17223
17181
|
timestamp,
|
|
17224
17182
|
documentMode: textOptions.documentModeOverride ?? workflowCoordinator.getEffectiveDocumentMode(selection),
|
|
17225
17183
|
defaultAuthorId: defaultAuthorId ?? void 0,
|
|
17226
17184
|
renderSnapshot: cachedRenderSnapshot,
|
|
17185
|
+
surfaceTelemetry: scopeSurfaceTelemetry,
|
|
17186
|
+
...fullScopeSurface ? { precomputedSurface: fullScopeSurface } : {},
|
|
17227
17187
|
activeStoryKey: canonicalEditableTargetStoryKey(activeStory),
|
|
17228
17188
|
editableTargetCache: editableTargetBlockCache,
|
|
17229
17189
|
activeStorySize: cachedRenderSnapshot.surface?.storySize,
|
|
@@ -17549,6 +17509,7 @@ function createDocumentRuntime(options) {
|
|
|
17549
17509
|
documentMode: workflowCoordinator.getEffectiveDocumentMode(state.selection),
|
|
17550
17510
|
defaultAuthorId: defaultAuthorId ?? void 0,
|
|
17551
17511
|
renderSnapshot: cachedRenderSnapshot,
|
|
17512
|
+
surfaceTelemetry: scopeSurfaceTelemetry,
|
|
17552
17513
|
activeStoryKey: canonicalEditableTargetStoryKey(activeStory),
|
|
17553
17514
|
editableTargetCache: editableTargetBlockCache
|
|
17554
17515
|
};
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import {
|
|
2
2
|
PAGE_STACK_GAP_PX,
|
|
3
3
|
resolveDefaultZoom
|
|
4
|
-
} from "./chunk-
|
|
4
|
+
} from "./chunk-CVSD3UNK.js";
|
|
5
5
|
import {
|
|
6
6
|
MAIN_STORY_KEY,
|
|
7
7
|
collectCanonicalLayoutInputs,
|
|
8
8
|
collectStoryBlockContexts,
|
|
9
9
|
createHeaderFooterStoryKey,
|
|
10
10
|
createNoteStoryKey
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5KTJKTNE.js";
|
|
12
12
|
|
|
13
13
|
// src/runtime/geometry/geometry-index-queries.ts
|
|
14
14
|
function resolveHitTestFromGeometryIndex(index, point) {
|
|
@@ -1134,9 +1134,13 @@ function appendFragmentLayoutObjectSemanticEntries(input) {
|
|
|
1134
1134
|
numberingCanonicalAddressKey: numbering.canonicalAddressKey,
|
|
1135
1135
|
numberingListAddressKey: numbering.listAddressKey,
|
|
1136
1136
|
numberingMarkerText: numbering.markerText,
|
|
1137
|
+
numberingMarkerTextPosture: numbering.markerTextPosture,
|
|
1137
1138
|
numberingMarkerSuffix: numbering.markerSuffix,
|
|
1138
1139
|
numberingFormat: numbering.format,
|
|
1139
1140
|
numberingFormatPosture: numbering.formatPosture,
|
|
1141
|
+
numberingPicBulletId: numbering.picBulletId,
|
|
1142
|
+
numberingPicBulletMediaId: numbering.picBulletMediaId,
|
|
1143
|
+
numberingPictureBulletPosture: numbering.pictureBulletPosture,
|
|
1140
1144
|
numberingUnavailableReasons: numbering.unavailableReasons,
|
|
1141
1145
|
markerGlyphRect: markerProjection.rect,
|
|
1142
1146
|
markerLaneRect: markerProjection.markerLaneRect,
|
|
@@ -1967,7 +1967,20 @@ function sourceJoinHash(refs) {
|
|
|
1967
1967
|
if (sourceIds.length === 0) return void 0;
|
|
1968
1968
|
return hashText(sourceIds.join("\0"));
|
|
1969
1969
|
}
|
|
1970
|
+
var numberingCatalogHashCache = /* @__PURE__ */ new WeakMap();
|
|
1971
|
+
var numberingTargetHashCache = /* @__PURE__ */ new WeakMap();
|
|
1970
1972
|
function createNumberingCatalogRevisionHash(doc) {
|
|
1973
|
+
const numbering = doc.numbering;
|
|
1974
|
+
if (numbering !== void 0) {
|
|
1975
|
+
const cached = numberingCatalogHashCache.get(numbering);
|
|
1976
|
+
if (cached !== void 0) return cached;
|
|
1977
|
+
const fresh = computeNumberingCatalogRevisionHash(doc);
|
|
1978
|
+
numberingCatalogHashCache.set(numbering, fresh);
|
|
1979
|
+
return fresh;
|
|
1980
|
+
}
|
|
1981
|
+
return computeNumberingCatalogRevisionHash(doc);
|
|
1982
|
+
}
|
|
1983
|
+
function computeNumberingCatalogRevisionHash(doc) {
|
|
1971
1984
|
const catalog = doc.numbering ?? { abstractDefinitions: {}, instances: {} };
|
|
1972
1985
|
const abstractDefinitions = catalog.abstractDefinitions ?? {};
|
|
1973
1986
|
const instances = catalog.instances ?? {};
|
|
@@ -2018,8 +2031,27 @@ function createNumberingCatalogRevisionHash(doc) {
|
|
|
2018
2031
|
}));
|
|
2019
2032
|
}
|
|
2020
2033
|
function createNumberingTargetRevisionHash(doc) {
|
|
2034
|
+
const numbering = doc.numbering;
|
|
2035
|
+
const styles = doc.styles;
|
|
2036
|
+
if (numbering !== void 0 && styles !== void 0) {
|
|
2037
|
+
let inner = numberingTargetHashCache.get(numbering);
|
|
2038
|
+
if (inner === void 0) {
|
|
2039
|
+
inner = /* @__PURE__ */ new WeakMap();
|
|
2040
|
+
numberingTargetHashCache.set(numbering, inner);
|
|
2041
|
+
}
|
|
2042
|
+
const cached = inner.get(styles);
|
|
2043
|
+
if (cached !== void 0) return cached;
|
|
2044
|
+
const fresh = computeNumberingTargetRevisionHash(doc);
|
|
2045
|
+
inner.set(styles, fresh);
|
|
2046
|
+
return fresh;
|
|
2047
|
+
}
|
|
2048
|
+
return computeNumberingTargetRevisionHash(doc);
|
|
2049
|
+
}
|
|
2050
|
+
function computeNumberingTargetRevisionHash(doc) {
|
|
2021
2051
|
const paragraphStyles = doc.styles?.paragraphs ?? {};
|
|
2022
2052
|
return hashText(JSON.stringify({
|
|
2053
|
+
// Reuses the memoized catalog hash on the hot path so a typing edit
|
|
2054
|
+
// pays for the catalog hash at most once across both helpers.
|
|
2023
2055
|
numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
|
|
2024
2056
|
paragraphStyleNumbering: Object.keys(paragraphStyles).sort().map((styleId) => {
|
|
2025
2057
|
const style = paragraphStyles[styleId];
|