@beyondwork/docx-react-component 1.0.127 → 1.0.129
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 +215 -61
- package/dist/api/public-types.d.cts +2 -2
- package/dist/api/public-types.d.ts +2 -2
- package/dist/api/public-types.js +2 -2
- package/dist/api/v3.cjs +1324 -71
- package/dist/api/v3.d.cts +3 -3
- package/dist/api/v3.d.ts +3 -3
- package/dist/api/v3.js +8 -8
- package/dist/{canonical-document-CXCFCbAz.d.cts → canonical-document-BMtONpgf.d.cts} +6 -0
- package/dist/{canonical-document-CXCFCbAz.d.ts → canonical-document-BMtONpgf.d.ts} +6 -0
- package/dist/{chunk-KV435YXO.js → chunk-5DSHUYSY.js} +1 -1
- package/dist/{chunk-TQDQU2E3.js → chunk-63FYIGCT.js} +2 -2
- package/dist/{chunk-ZDOAUP3V.js → chunk-DDN2AIGE.js} +1 -1
- package/dist/{chunk-6F5QW44A.js → chunk-DJU2W4E4.js} +2 -2
- package/dist/{chunk-4EENH4FG.js → chunk-EZKJXIPH.js} +1 -1
- package/dist/{chunk-CXSYRB37.js → chunk-HUIHBBAQ.js} +166 -49
- package/dist/{chunk-ESJ2MES5.js → chunk-JJGVE5J7.js} +1 -1
- package/dist/{chunk-LZVBNDGU.js → chunk-LJH64PV3.js} +3 -3
- package/dist/{chunk-MWSBGJQO.js → chunk-OTQIW2TC.js} +2 -2
- package/dist/{chunk-2QL5DAKF.js → chunk-PGKUJZXV.js} +3 -3
- package/dist/{chunk-PUMZWE2D.js → chunk-PRAZBHNF.js} +460 -136
- package/dist/{chunk-4YJVRIUB.js → chunk-Q3QYGKFE.js} +51 -8
- package/dist/{chunk-YHZHPXDB.js → chunk-RMRTQGW3.js} +50 -13
- package/dist/{chunk-XRACP43Q.js → chunk-SKPTKQHF.js} +351 -13
- package/dist/{chunk-D5HYZQTG.js → chunk-VNLDQJ47.js} +1 -1
- package/dist/{chunk-BYSRJ4FE.js → chunk-W34X3KBR.js} +1 -1
- package/dist/{chunk-V6XVZFFH.js → chunk-XMHSGPLN.js} +2 -2
- package/dist/{chunk-46KNRA4C.js → chunk-XQCAMKIQ.js} +849 -6
- package/dist/{chunk-YD2JE54B.js → chunk-YZDZ4FGR.js} +1 -1
- package/dist/compare.d.cts +1 -1
- package/dist/compare.d.ts +1 -1
- package/dist/core/commands/formatting-commands.d.cts +2 -2
- package/dist/core/commands/formatting-commands.d.ts +2 -2
- package/dist/core/commands/image-commands.cjs +166 -49
- package/dist/core/commands/image-commands.d.cts +2 -2
- package/dist/core/commands/image-commands.d.ts +2 -2
- package/dist/core/commands/image-commands.js +4 -4
- package/dist/core/commands/section-layout-commands.d.cts +2 -2
- package/dist/core/commands/section-layout-commands.d.ts +2 -2
- package/dist/core/commands/style-commands.d.cts +2 -2
- package/dist/core/commands/style-commands.d.ts +2 -2
- package/dist/core/commands/table-structure-commands.cjs +166 -49
- package/dist/core/commands/table-structure-commands.d.cts +2 -2
- package/dist/core/commands/table-structure-commands.d.ts +2 -2
- package/dist/core/commands/table-structure-commands.js +3 -3
- package/dist/core/commands/text-commands.cjs +166 -49
- package/dist/core/commands/text-commands.d.cts +2 -2
- package/dist/core/commands/text-commands.d.ts +2 -2
- package/dist/core/commands/text-commands.js +4 -4
- package/dist/core/selection/mapping.d.cts +2 -2
- package/dist/core/selection/mapping.d.ts +2 -2
- package/dist/core/state/editor-state.d.cts +2 -2
- package/dist/core/state/editor-state.d.ts +2 -2
- package/dist/index.cjs +1943 -219
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +56 -22
- package/dist/io/docx-session.cjs +51 -8
- package/dist/io/docx-session.d.cts +4 -4
- package/dist/io/docx-session.d.ts +4 -4
- package/dist/io/docx-session.js +3 -3
- package/dist/legal.d.cts +1 -1
- package/dist/legal.d.ts +1 -1
- package/dist/legal.js +2 -2
- package/dist/{loader-CFICtb9m.d.ts → loader-4qsw4eIU.d.ts} +3 -3
- package/dist/{loader-DveZOVuC.d.cts → loader-B8TKhmQi.d.cts} +3 -3
- package/dist/{public-types-beSYFJRR.d.cts → public-types-B5CRoR6f.d.cts} +220 -1
- package/dist/{public-types-Cgl3efbO.d.ts → public-types-p9b8rfy8.d.ts} +220 -1
- package/dist/public-types.cjs +215 -61
- package/dist/public-types.d.cts +2 -2
- package/dist/public-types.d.ts +2 -2
- package/dist/public-types.js +2 -2
- package/dist/runtime/collab.d.cts +3 -3
- package/dist/runtime/collab.d.ts +3 -3
- package/dist/runtime/document-runtime.cjs +999 -193
- package/dist/runtime/document-runtime.d.cts +2 -2
- package/dist/runtime/document-runtime.d.ts +2 -2
- package/dist/runtime/document-runtime.js +13 -13
- package/dist/{session-B7u82EJF.d.cts → session-BnGIjaex.d.cts} +3 -3
- package/dist/{session-BWMJ9jm4.d.ts → session-vEYKf-w3.d.ts} +3 -3
- package/dist/session.cjs +51 -8
- package/dist/session.d.cts +5 -5
- package/dist/session.d.ts +5 -5
- package/dist/session.js +4 -4
- package/dist/tailwind.cjs +215 -61
- package/dist/tailwind.d.cts +2 -2
- package/dist/tailwind.d.ts +2 -2
- package/dist/tailwind.js +5 -5
- package/dist/{types-BQjdVZsh.d.cts → types-BLuvZ6cQ.d.cts} +2 -2
- package/dist/{types-DvvmS5A7.d.ts → types-Dutlyj0T.d.ts} +2 -2
- package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +3 -3
- package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +3 -3
- package/dist/ui-tailwind/editor-surface/search-plugin.js +3 -3
- package/dist/ui-tailwind.cjs +215 -61
- package/dist/ui-tailwind.d.cts +3 -3
- package/dist/ui-tailwind.d.ts +3 -3
- package/dist/ui-tailwind.js +5 -5
- package/package.json +1 -1
|
@@ -7,23 +7,23 @@ import {
|
|
|
7
7
|
resolveSectionForStoryTarget,
|
|
8
8
|
searchSecondaryStories,
|
|
9
9
|
searchSurfaceBlocks
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RMRTQGW3.js";
|
|
11
11
|
import {
|
|
12
12
|
createEditorSurfaceSnapshot,
|
|
13
13
|
createFormattingContext,
|
|
14
14
|
resolveTableStyleResolution
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-HUIHBBAQ.js";
|
|
16
16
|
import {
|
|
17
17
|
createSelectionSnapshot
|
|
18
18
|
} from "./chunk-OYGMRRR7.js";
|
|
19
19
|
import {
|
|
20
20
|
normalizeParsedTextDocument
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-JJGVE5J7.js";
|
|
22
22
|
import {
|
|
23
23
|
buildFieldRegistry,
|
|
24
24
|
parseMainDocumentXml,
|
|
25
25
|
parseTocLevelRange
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-Q3QYGKFE.js";
|
|
27
27
|
import {
|
|
28
28
|
collectEditableTargetRefs,
|
|
29
29
|
validateEditableTargetRef
|
|
@@ -858,6 +858,12 @@ function resolveScopeRange(entry, handle, positionMap) {
|
|
|
858
858
|
if (inlineRange) return inlineRange;
|
|
859
859
|
return positionMap.blocks.get(entry.blockIndex) ?? null;
|
|
860
860
|
}
|
|
861
|
+
case "image": {
|
|
862
|
+
const key = `${entry.blockIndex}:${entry.inlineIndex}`;
|
|
863
|
+
const inlineRange = positionMap.inlines.get(key);
|
|
864
|
+
if (inlineRange) return inlineRange;
|
|
865
|
+
return positionMap.blocks.get(entry.blockIndex) ?? null;
|
|
866
|
+
}
|
|
861
867
|
case "comment-thread":
|
|
862
868
|
return anchorToRange(entry.thread.anchor);
|
|
863
869
|
case "revision":
|
|
@@ -996,6 +1002,11 @@ function deriveReplaceability(kind, provenance) {
|
|
|
996
1002
|
level: "preserve-only",
|
|
997
1003
|
reason: "field-result-is-computed-preserve-only"
|
|
998
1004
|
};
|
|
1005
|
+
case "image":
|
|
1006
|
+
return {
|
|
1007
|
+
level: "preserve-only",
|
|
1008
|
+
reason: "image-object-command-required"
|
|
1009
|
+
};
|
|
999
1010
|
case "comment-thread":
|
|
1000
1011
|
return {
|
|
1001
1012
|
level: "preserve-only",
|
|
@@ -1700,6 +1711,55 @@ function compileHeadingScope(entry, options = {}) {
|
|
|
1700
1711
|
};
|
|
1701
1712
|
}
|
|
1702
1713
|
|
|
1714
|
+
// src/runtime/scopes/scope-kinds/image.ts
|
|
1715
|
+
function imageAltText(image) {
|
|
1716
|
+
if (image.type === "image") return image.altText ?? "";
|
|
1717
|
+
return image.anchor.docPr?.descr ?? image.anchor.docPr?.name ?? "";
|
|
1718
|
+
}
|
|
1719
|
+
function imageMediaId(image) {
|
|
1720
|
+
if (image.type === "image") return image.mediaId;
|
|
1721
|
+
return image.content.type === "picture" ? image.content.mediaId : void 0;
|
|
1722
|
+
}
|
|
1723
|
+
function imageDisplay(image) {
|
|
1724
|
+
if (image.type === "image") return image.display;
|
|
1725
|
+
return image.anchor.display;
|
|
1726
|
+
}
|
|
1727
|
+
function imageSourceKind(image) {
|
|
1728
|
+
return image.type === "image" ? "legacy-image" : "drawing-picture";
|
|
1729
|
+
}
|
|
1730
|
+
function compileImageScope(entry) {
|
|
1731
|
+
const { handle, image } = entry;
|
|
1732
|
+
const altText = imageAltText(image);
|
|
1733
|
+
const mediaId = imageMediaId(image);
|
|
1734
|
+
const display = imageDisplay(image);
|
|
1735
|
+
const sourceKind = imageSourceKind(image);
|
|
1736
|
+
return {
|
|
1737
|
+
handle,
|
|
1738
|
+
kind: "image",
|
|
1739
|
+
classifications: entry.classifications,
|
|
1740
|
+
content: {
|
|
1741
|
+
text: altText,
|
|
1742
|
+
excerpt: buildExcerpt(altText),
|
|
1743
|
+
authority: "structural-summary"
|
|
1744
|
+
},
|
|
1745
|
+
formatting: {},
|
|
1746
|
+
layout: display ? { flowKind: display } : {},
|
|
1747
|
+
geometry: {},
|
|
1748
|
+
workflow: { scopeIds: [], effectiveMode: "edit" },
|
|
1749
|
+
replaceability: deriveReplaceability("image", handle.provenance),
|
|
1750
|
+
audit: {
|
|
1751
|
+
source: "runtime",
|
|
1752
|
+
derivedFrom: [
|
|
1753
|
+
"canonical",
|
|
1754
|
+
`image-source:${sourceKind}`,
|
|
1755
|
+
...mediaId ? [`media-id:${mediaId}`] : []
|
|
1756
|
+
],
|
|
1757
|
+
confidence: "medium"
|
|
1758
|
+
},
|
|
1759
|
+
partial: true
|
|
1760
|
+
};
|
|
1761
|
+
}
|
|
1762
|
+
|
|
1703
1763
|
// src/runtime/scopes/scope-kinds/list-item.ts
|
|
1704
1764
|
function compileListItemScope(entry, options = {}) {
|
|
1705
1765
|
const { handle, paragraph } = entry;
|
|
@@ -2288,6 +2348,8 @@ function compileScope(entry, optionsOrCatalog) {
|
|
|
2288
2348
|
});
|
|
2289
2349
|
case "field":
|
|
2290
2350
|
return compileFieldScope(entry);
|
|
2351
|
+
case "image":
|
|
2352
|
+
return compileImageScope(entry);
|
|
2291
2353
|
case "comment-thread":
|
|
2292
2354
|
return compileCommentThreadScope(entry);
|
|
2293
2355
|
case "revision":
|
|
@@ -2476,6 +2538,44 @@ function enumerateFieldsInParagraph(paragraph, blockIndex, documentId, parentSco
|
|
|
2476
2538
|
}
|
|
2477
2539
|
return out;
|
|
2478
2540
|
}
|
|
2541
|
+
function isImageInline(child) {
|
|
2542
|
+
return child.type === "image" || child.type === "drawing_frame" && child.content.type === "picture";
|
|
2543
|
+
}
|
|
2544
|
+
function enumerateImagesInParagraph(paragraph, blockIndex, documentId, parentScopeId) {
|
|
2545
|
+
const out = [];
|
|
2546
|
+
for (let i = 0; i < paragraph.children.length; i += 1) {
|
|
2547
|
+
const child = paragraph.children[i];
|
|
2548
|
+
if (!isImageInline(child)) continue;
|
|
2549
|
+
const semanticPath = [
|
|
2550
|
+
"body",
|
|
2551
|
+
"paragraph",
|
|
2552
|
+
String(blockIndex),
|
|
2553
|
+
"image",
|
|
2554
|
+
String(i)
|
|
2555
|
+
];
|
|
2556
|
+
const scopeId = `image:${blockIndex}:${i}`;
|
|
2557
|
+
const handle = {
|
|
2558
|
+
scopeId,
|
|
2559
|
+
documentId,
|
|
2560
|
+
storyTarget: MAIN_STORY,
|
|
2561
|
+
semanticPath,
|
|
2562
|
+
parentScopeId,
|
|
2563
|
+
stableRef: { kind: "semantic-path", value: semanticPath.join("/") },
|
|
2564
|
+
provenance: "derived",
|
|
2565
|
+
rangePrecision: "canonical"
|
|
2566
|
+
};
|
|
2567
|
+
out.push({
|
|
2568
|
+
kind: "image",
|
|
2569
|
+
handle,
|
|
2570
|
+
image: child,
|
|
2571
|
+
paragraph,
|
|
2572
|
+
blockIndex,
|
|
2573
|
+
inlineIndex: i,
|
|
2574
|
+
classifications: Object.freeze([])
|
|
2575
|
+
});
|
|
2576
|
+
}
|
|
2577
|
+
return out;
|
|
2578
|
+
}
|
|
2479
2579
|
function enumerateCommentThreads(document, documentId) {
|
|
2480
2580
|
const review = document.review;
|
|
2481
2581
|
const comments = review?.comments;
|
|
@@ -2606,6 +2706,8 @@ function enumerateScopes(document, inputs = {}) {
|
|
|
2606
2706
|
});
|
|
2607
2707
|
const fields = enumerateFieldsInParagraph(block, index, documentId, scopeId);
|
|
2608
2708
|
for (const field of fields) results.push(field);
|
|
2709
|
+
const images = enumerateImagesInParagraph(block, index, documentId, scopeId);
|
|
2710
|
+
for (const image of images) results.push(image);
|
|
2609
2711
|
continue;
|
|
2610
2712
|
}
|
|
2611
2713
|
if (block.type === "table") {
|
|
@@ -2995,6 +3097,15 @@ var LIST_TEXT_TARGET_KINDS = /* @__PURE__ */ new Set([
|
|
|
2995
3097
|
"sdt-paragraph-text",
|
|
2996
3098
|
"secondary-story-paragraph-text"
|
|
2997
3099
|
]);
|
|
3100
|
+
var OBJECT_COMMAND_INTENTS = /* @__PURE__ */ new Set([
|
|
3101
|
+
"image-layout",
|
|
3102
|
+
"image-frame",
|
|
3103
|
+
"chart-edit",
|
|
3104
|
+
"custom-xml-update",
|
|
3105
|
+
"embedded-content-update",
|
|
3106
|
+
"opaque-content-preserve",
|
|
3107
|
+
"object-edit"
|
|
3108
|
+
]);
|
|
2998
3109
|
function freezeList(values) {
|
|
2999
3110
|
return Object.freeze([...values]);
|
|
3000
3111
|
}
|
|
@@ -3539,6 +3650,35 @@ function listStructureCapability(scope, context) {
|
|
|
3539
3650
|
]
|
|
3540
3651
|
);
|
|
3541
3652
|
}
|
|
3653
|
+
function objectEditCapability(context) {
|
|
3654
|
+
const objectTargets = (context?.editableTargets?.entries ?? []).filter(
|
|
3655
|
+
(entry) => entry.kind === "object-anchor" || entry.kind === "custom-xml-content" || entry.kind === "opaque-content" || entry.commandFamily === "object" || entry.commandFamily === "preserve-only-refusal" || entry.runtimeCommand.intents.some((intent) => OBJECT_COMMAND_INTENTS.has(intent))
|
|
3656
|
+
);
|
|
3657
|
+
const supportedTargets = objectTargets.filter(
|
|
3658
|
+
(entry) => entry.runtimeCommand.status === "supported" && entry.runtimeCommand.intents.some((intent) => OBJECT_COMMAND_INTENTS.has(intent))
|
|
3659
|
+
);
|
|
3660
|
+
if (supportedTargets.length > 0) {
|
|
3661
|
+
return supportedCommand(
|
|
3662
|
+
"compile-supported:object-edit:editable-target",
|
|
3663
|
+
supportedTargets
|
|
3664
|
+
);
|
|
3665
|
+
}
|
|
3666
|
+
if (objectTargets.length > 0) {
|
|
3667
|
+
const blockers = commandTargetBlockers(objectTargets);
|
|
3668
|
+
return blocked(
|
|
3669
|
+
"compile-blocked:object-edit:target-ref-blocked",
|
|
3670
|
+
blockers.length > 0 ? blockers : ["compile-blocked:object-edit:target-ref-blocked"]
|
|
3671
|
+
);
|
|
3672
|
+
}
|
|
3673
|
+
return unsupported(
|
|
3674
|
+
"compile-unsupported:object-edit:no-target-family",
|
|
3675
|
+
[
|
|
3676
|
+
"compile-unsupported:object-edit:no-target-family",
|
|
3677
|
+
"capability:object-edit:l02-object-target-required",
|
|
3678
|
+
"capability:object-edit:l07-command-support-required"
|
|
3679
|
+
]
|
|
3680
|
+
);
|
|
3681
|
+
}
|
|
3542
3682
|
function deriveScopeCapabilities(scope, context = {}) {
|
|
3543
3683
|
return {
|
|
3544
3684
|
canReplaceText: replaceTextCapability(scope, context),
|
|
@@ -3555,7 +3695,8 @@ function deriveScopeCapabilities(scope, context = {}) {
|
|
|
3555
3695
|
canEditTableStructure: tableStructureCapability(scope, context),
|
|
3556
3696
|
canUseTableContinuationEvidence: tableContinuationEvidenceCapability(scope, context),
|
|
3557
3697
|
canEditListText: listTextCapability(scope, context),
|
|
3558
|
-
canEditListStructure: listStructureCapability(scope, context)
|
|
3698
|
+
canEditListStructure: listStructureCapability(scope, context),
|
|
3699
|
+
canEditObject: objectEditCapability(context)
|
|
3559
3700
|
};
|
|
3560
3701
|
}
|
|
3561
3702
|
|
|
@@ -3827,6 +3968,11 @@ function tokensForScope(entry) {
|
|
|
3827
3968
|
{ kind: "row", index: entry.rowIndex },
|
|
3828
3969
|
{ kind: "cell", index: entry.cellIndex }
|
|
3829
3970
|
]);
|
|
3971
|
+
case "image":
|
|
3972
|
+
return Object.freeze([
|
|
3973
|
+
{ kind: "block", index: entry.blockIndex },
|
|
3974
|
+
{ kind: "inline", index: entry.inlineIndex }
|
|
3975
|
+
]);
|
|
3830
3976
|
default:
|
|
3831
3977
|
return null;
|
|
3832
3978
|
}
|
|
@@ -4574,6 +4720,64 @@ function deriveScopeEditableTargetEvidence(document, scope, entry, options = {})
|
|
|
4574
4720
|
};
|
|
4575
4721
|
}
|
|
4576
4722
|
|
|
4723
|
+
// src/runtime/scopes/object-evidence.ts
|
|
4724
|
+
var OBJECT_INTENTS = /* @__PURE__ */ new Set([
|
|
4725
|
+
"image-layout",
|
|
4726
|
+
"image-frame",
|
|
4727
|
+
"chart-edit",
|
|
4728
|
+
"custom-xml-update",
|
|
4729
|
+
"embedded-content-update",
|
|
4730
|
+
"opaque-content-preserve",
|
|
4731
|
+
"object-edit",
|
|
4732
|
+
"preserve-only-refusal"
|
|
4733
|
+
]);
|
|
4734
|
+
function unique(values) {
|
|
4735
|
+
return Object.freeze([...new Set(values.filter((value) => value.length > 0))]);
|
|
4736
|
+
}
|
|
4737
|
+
function isObjectTarget(entry) {
|
|
4738
|
+
return entry.object !== void 0 || entry.kind === "object-anchor" || entry.kind === "custom-xml-content" || entry.kind === "opaque-content" || entry.commandFamily === "object" || entry.runtimeCommand.intents.some((intent) => OBJECT_INTENTS.has(intent));
|
|
4739
|
+
}
|
|
4740
|
+
function blockersFor(entry) {
|
|
4741
|
+
return unique([
|
|
4742
|
+
...entry.posture.blockers,
|
|
4743
|
+
...entry.runtimeCommand.blockers ?? [],
|
|
4744
|
+
...entry.runtimeTextCommand.blockers ?? [],
|
|
4745
|
+
...(entry.workflowBlockers ?? []).flatMap((blocker) => [
|
|
4746
|
+
blocker.blocker,
|
|
4747
|
+
blocker.refusalId
|
|
4748
|
+
]),
|
|
4749
|
+
entry.runtimeCommand.status === "blocked" ? entry.runtimeCommand.reason : ""
|
|
4750
|
+
]);
|
|
4751
|
+
}
|
|
4752
|
+
function projectEntry2(entry) {
|
|
4753
|
+
const blockers = blockersFor(entry);
|
|
4754
|
+
return {
|
|
4755
|
+
targetKey: entry.targetKey,
|
|
4756
|
+
kind: entry.kind,
|
|
4757
|
+
...entry.object?.objectKind ? { objectKind: entry.object.objectKind } : {},
|
|
4758
|
+
relation: entry.relation,
|
|
4759
|
+
commandFamily: entry.commandFamily,
|
|
4760
|
+
editability: entry.editability,
|
|
4761
|
+
...entry.sourceRef ? { sourceRef: entry.sourceRef } : {},
|
|
4762
|
+
...entry.object ? { object: entry.object } : {},
|
|
4763
|
+
runtimeCommand: entry.runtimeCommand,
|
|
4764
|
+
blockers,
|
|
4765
|
+
...entry.posture.preserveOnly ? { preserveOnly: true } : {}
|
|
4766
|
+
};
|
|
4767
|
+
}
|
|
4768
|
+
function deriveScopeObjectEvidence(editableTargets) {
|
|
4769
|
+
const entries = Object.freeze(
|
|
4770
|
+
[...editableTargets?.entries ?? []].filter(isObjectTarget).map(projectEntry2).sort((left, right) => left.targetKey.localeCompare(right.targetKey))
|
|
4771
|
+
);
|
|
4772
|
+
const blockers = unique(entries.flatMap((entry) => [...entry.blockers]));
|
|
4773
|
+
return {
|
|
4774
|
+
status: entries.length > 0 ? "present" : "none",
|
|
4775
|
+
count: entries.length,
|
|
4776
|
+
blockers,
|
|
4777
|
+
entries
|
|
4778
|
+
};
|
|
4779
|
+
}
|
|
4780
|
+
|
|
4577
4781
|
// src/runtime/scopes/table-evidence.ts
|
|
4578
4782
|
function isTableFamilyEntry(entry) {
|
|
4579
4783
|
return entry?.kind === "table" || entry?.kind === "table-row" || entry?.kind === "table-cell";
|
|
@@ -5143,7 +5347,7 @@ function deriveScopeGeometryEvidence(scopeId, provider, context) {
|
|
|
5143
5347
|
function freezeList2(values) {
|
|
5144
5348
|
return values ? Object.freeze([...values]) : void 0;
|
|
5145
5349
|
}
|
|
5146
|
-
function
|
|
5350
|
+
function unique2(values) {
|
|
5147
5351
|
return Object.freeze([...new Set(values)]);
|
|
5148
5352
|
}
|
|
5149
5353
|
function parseTableFamilyScopeId2(scopeId) {
|
|
@@ -5173,7 +5377,7 @@ function candidateTableBlockIds(blockIndex, mapped) {
|
|
|
5173
5377
|
const mappedId = mapped?.get(blockIndex);
|
|
5174
5378
|
if (mappedId) ids.push(mappedId);
|
|
5175
5379
|
ids.push(`table-${blockIndex}`, `table:${blockIndex}`, `block-${blockIndex}`);
|
|
5176
|
-
return
|
|
5380
|
+
return unique2(ids);
|
|
5177
5381
|
}
|
|
5178
5382
|
function rowInFragment(fragment, rowIndex) {
|
|
5179
5383
|
const range = fragment.tableRowRange;
|
|
@@ -5210,19 +5414,19 @@ function projectTableFramePage(fragment) {
|
|
|
5210
5414
|
...fragment.tableRowRange ? { rowRange: { ...fragment.tableRowRange } } : {},
|
|
5211
5415
|
...fragment.continuation?.continuesFromPreviousPage !== void 0 ? { continuesFromPreviousPage: fragment.continuation.continuesFromPreviousPage } : {},
|
|
5212
5416
|
...fragment.continuation?.continuesToNextPage !== void 0 ? { continuesToNextPage: fragment.continuation.continuesToNextPage } : {},
|
|
5213
|
-
...repeated ? { repeatedHeaderRowIndexes:
|
|
5417
|
+
...repeated ? { repeatedHeaderRowIndexes: unique2(repeated) } : {},
|
|
5214
5418
|
...splitRowCarry ? { splitRowCarry: Object.freeze(splitRowCarry.map((item) => ({ ...item }))) } : {},
|
|
5215
5419
|
...carry ? { verticalMergeCarry: Object.freeze(carry.map((item) => ({ ...item }))) } : {}
|
|
5216
5420
|
};
|
|
5217
5421
|
}
|
|
5218
5422
|
function projectTableFrame(blockId, parsed, fragments) {
|
|
5219
|
-
const pageIds =
|
|
5220
|
-
const pageSliceIds =
|
|
5221
|
-
const layoutObjectIds =
|
|
5423
|
+
const pageIds = unique2(fragments.map((fragment) => fragment.pageId));
|
|
5424
|
+
const pageSliceIds = unique2(fragments.map((fragment) => fragment.fragmentId));
|
|
5425
|
+
const layoutObjectIds = unique2(
|
|
5222
5426
|
fragments.map((fragment) => fragment.layoutObject?.objectId).filter((objectId) => typeof objectId === "string" && objectId.length > 0)
|
|
5223
5427
|
);
|
|
5224
5428
|
const rowRangesByPage = Object.freeze(fragments.map(projectTableFramePage));
|
|
5225
|
-
const repeatedHeaderRowIndexes =
|
|
5429
|
+
const repeatedHeaderRowIndexes = unique2(
|
|
5226
5430
|
fragments.flatMap((fragment) => fragment.continuation?.repeatedHeaderRowIndexes ?? [])
|
|
5227
5431
|
);
|
|
5228
5432
|
const verticalMergeCarry = Object.freeze(
|
|
@@ -5247,7 +5451,7 @@ function projectTableFrame(blockId, parsed, fragments) {
|
|
|
5247
5451
|
};
|
|
5248
5452
|
}
|
|
5249
5453
|
function continuationFromTableFrame(fragments) {
|
|
5250
|
-
const pageIds =
|
|
5454
|
+
const pageIds = unique2(fragments.map((fragment) => fragment.pageId));
|
|
5251
5455
|
return {
|
|
5252
5456
|
...pageIds.length > 0 ? { pageIds } : {},
|
|
5253
5457
|
pageCount: pageIds.length,
|
|
@@ -5545,6 +5749,7 @@ function composeEvidence(inputs) {
|
|
|
5545
5749
|
...editableTargets ? { editableTargets } : {},
|
|
5546
5750
|
layout
|
|
5547
5751
|
});
|
|
5752
|
+
const objects = deriveScopeObjectEvidence(editableTargets);
|
|
5548
5753
|
return {
|
|
5549
5754
|
formattingSummary: formattingSummaryOf(scope),
|
|
5550
5755
|
reviewItemIds,
|
|
@@ -5555,6 +5760,7 @@ function composeEvidence(inputs) {
|
|
|
5555
5760
|
...adjacentGeometry ? { adjacentGeometry } : {},
|
|
5556
5761
|
visualization: deriveScopeVisualization(scope),
|
|
5557
5762
|
...editableTargets ? { editableTargets } : {},
|
|
5763
|
+
objects,
|
|
5558
5764
|
...table ? { table } : {},
|
|
5559
5765
|
contentControls,
|
|
5560
5766
|
capabilities,
|
|
@@ -8599,6 +8805,133 @@ function sortJson(value) {
|
|
|
8599
8805
|
return value;
|
|
8600
8806
|
}
|
|
8601
8807
|
|
|
8808
|
+
// src/io/ooxml/numbering-catalog-mutation.ts
|
|
8809
|
+
function cloneNumberingCatalog(catalog) {
|
|
8810
|
+
return structuredClone(catalog);
|
|
8811
|
+
}
|
|
8812
|
+
function getListKind(catalog, numberingInstanceId) {
|
|
8813
|
+
const instance = catalog.instances[numberingInstanceId];
|
|
8814
|
+
const definition = instance ? catalog.abstractDefinitions[instance.abstractNumberingId] : void 0;
|
|
8815
|
+
const levelZero = definition?.levels.find((level) => level.level === 0);
|
|
8816
|
+
if (!levelZero) return void 0;
|
|
8817
|
+
return levelZero.format === "bullet" ? "bulleted" : "numbered";
|
|
8818
|
+
}
|
|
8819
|
+
function ensureDefaultListInstance(catalog, kind) {
|
|
8820
|
+
const existing = Object.values(catalog.instances).find(
|
|
8821
|
+
(instance) => getListKind(catalog, instance.numberingInstanceId) === kind
|
|
8822
|
+
);
|
|
8823
|
+
if (existing) return existing.numberingInstanceId;
|
|
8824
|
+
const abstractNumberingId = allocateAbstractDefinition(catalog, {
|
|
8825
|
+
levels: defaultLevels(kind),
|
|
8826
|
+
multiLevelType: "hybridMultilevel"
|
|
8827
|
+
});
|
|
8828
|
+
return allocateNumberingInstance(catalog, abstractNumberingId);
|
|
8829
|
+
}
|
|
8830
|
+
function allocateNumberingInstance(catalog, abstractNumberingId, overrides = []) {
|
|
8831
|
+
const numberingInstanceId = nextCanonicalNumericId(
|
|
8832
|
+
"num:",
|
|
8833
|
+
Object.keys(catalog.instances)
|
|
8834
|
+
);
|
|
8835
|
+
catalog.instances[numberingInstanceId] = {
|
|
8836
|
+
numberingInstanceId,
|
|
8837
|
+
abstractNumberingId,
|
|
8838
|
+
overrides: cloneOverrides(overrides)
|
|
8839
|
+
};
|
|
8840
|
+
return numberingInstanceId;
|
|
8841
|
+
}
|
|
8842
|
+
function allocateAbstractDefinition(catalog, input) {
|
|
8843
|
+
const abstractNumberingId = input.abstractNumberingId && !catalog.abstractDefinitions[input.abstractNumberingId] ? input.abstractNumberingId : nextCanonicalNumericId("abstract-num:", Object.keys(catalog.abstractDefinitions));
|
|
8844
|
+
catalog.abstractDefinitions[abstractNumberingId] = {
|
|
8845
|
+
abstractNumberingId,
|
|
8846
|
+
levels: structuredClone(input.levels),
|
|
8847
|
+
...input.nsid ? { nsid: input.nsid } : { nsid: freshLongHex(catalog, abstractNumberingId, "nsid") },
|
|
8848
|
+
...input.multiLevelType ? { multiLevelType: input.multiLevelType } : {},
|
|
8849
|
+
...input.tplc ? { tplc: input.tplc } : { tplc: freshLongHex(catalog, abstractNumberingId, "tmpl") },
|
|
8850
|
+
...input.styleLink ? { styleLink: input.styleLink } : {},
|
|
8851
|
+
...input.numStyleLink ? { numStyleLink: input.numStyleLink } : {}
|
|
8852
|
+
};
|
|
8853
|
+
return abstractNumberingId;
|
|
8854
|
+
}
|
|
8855
|
+
function setStartOverride(catalog, numberingInstanceId, level, startAt) {
|
|
8856
|
+
const instance = catalog.instances[numberingInstanceId];
|
|
8857
|
+
if (!instance) return;
|
|
8858
|
+
catalog.instances[numberingInstanceId] = {
|
|
8859
|
+
...instance,
|
|
8860
|
+
overrides: mergeOverride(instance.overrides, { level, startAt })
|
|
8861
|
+
};
|
|
8862
|
+
}
|
|
8863
|
+
function mergeOverride(overrides, nextOverride) {
|
|
8864
|
+
return [
|
|
8865
|
+
...overrides.filter((override) => override.level !== nextOverride.level),
|
|
8866
|
+
structuredClone(nextOverride)
|
|
8867
|
+
].sort((left, right) => left.level - right.level);
|
|
8868
|
+
}
|
|
8869
|
+
function cloneOverrides(overrides) {
|
|
8870
|
+
return overrides.map((override) => structuredClone(override));
|
|
8871
|
+
}
|
|
8872
|
+
function defaultLevels(kind) {
|
|
8873
|
+
if (kind === "bulleted") {
|
|
8874
|
+
return [
|
|
8875
|
+
{ level: 0, format: "bullet", text: "\u2022" },
|
|
8876
|
+
{ level: 1, format: "bullet", text: "o" },
|
|
8877
|
+
{ level: 2, format: "bullet", text: "\u25A0" },
|
|
8878
|
+
{ level: 3, format: "bullet", text: "\u2022" },
|
|
8879
|
+
{ level: 4, format: "bullet", text: "o" },
|
|
8880
|
+
{ level: 5, format: "bullet", text: "\u25A0" },
|
|
8881
|
+
{ level: 6, format: "bullet", text: "\u2022" },
|
|
8882
|
+
{ level: 7, format: "bullet", text: "o" },
|
|
8883
|
+
{ level: 8, format: "bullet", text: "\u25A0" }
|
|
8884
|
+
];
|
|
8885
|
+
}
|
|
8886
|
+
return [
|
|
8887
|
+
{ level: 0, format: "decimal", text: "%1." },
|
|
8888
|
+
{ level: 1, format: "decimal", text: "%1.%2." },
|
|
8889
|
+
{ level: 2, format: "lowerLetter", text: "(%3)" },
|
|
8890
|
+
{ level: 3, format: "lowerRoman", text: "(%4)" },
|
|
8891
|
+
{ level: 4, format: "decimal", text: "%5." },
|
|
8892
|
+
{ level: 5, format: "lowerLetter", text: "(%6)" },
|
|
8893
|
+
{ level: 6, format: "lowerRoman", text: "(%7)" },
|
|
8894
|
+
{ level: 7, format: "decimal", text: "%8." },
|
|
8895
|
+
{ level: 8, format: "lowerLetter", text: "(%9)" }
|
|
8896
|
+
];
|
|
8897
|
+
}
|
|
8898
|
+
function nextCanonicalNumericId(prefix, ids) {
|
|
8899
|
+
return `${prefix}${nextNumericString(ids.map((id) => stripPrefix(id, prefix)))}`;
|
|
8900
|
+
}
|
|
8901
|
+
function nextNumericString(ids) {
|
|
8902
|
+
const used = new Set(ids);
|
|
8903
|
+
let next = 1;
|
|
8904
|
+
for (const id of ids) {
|
|
8905
|
+
const parsed = Number.parseInt(id, 10);
|
|
8906
|
+
if (Number.isFinite(parsed) && parsed >= next) next = parsed + 1;
|
|
8907
|
+
}
|
|
8908
|
+
while (used.has(String(next))) next += 1;
|
|
8909
|
+
return String(next);
|
|
8910
|
+
}
|
|
8911
|
+
function stripPrefix(value, prefix) {
|
|
8912
|
+
return value.startsWith(prefix) ? value.slice(prefix.length) : value;
|
|
8913
|
+
}
|
|
8914
|
+
function freshLongHex(catalog, abstractNumberingId, salt) {
|
|
8915
|
+
const existing = new Set(
|
|
8916
|
+
Object.values(catalog.abstractDefinitions).map((definition) => salt === "nsid" ? definition.nsid : definition.tplc).filter((value) => Boolean(value))
|
|
8917
|
+
);
|
|
8918
|
+
let attempt = 0;
|
|
8919
|
+
while (attempt < 1e3) {
|
|
8920
|
+
const candidate = hashLongHex(`${salt}:${abstractNumberingId}:${attempt}`);
|
|
8921
|
+
if (!existing.has(candidate)) return candidate;
|
|
8922
|
+
attempt += 1;
|
|
8923
|
+
}
|
|
8924
|
+
return hashLongHex(`${salt}:${abstractNumberingId}:${Date.now()}`);
|
|
8925
|
+
}
|
|
8926
|
+
function hashLongHex(input) {
|
|
8927
|
+
let hash = 2166136261;
|
|
8928
|
+
for (let index = 0; index < input.length; index += 1) {
|
|
8929
|
+
hash ^= input.charCodeAt(index);
|
|
8930
|
+
hash = Math.imul(hash, 16777619) >>> 0;
|
|
8931
|
+
}
|
|
8932
|
+
return hash.toString(16).toUpperCase().padStart(8, "0").slice(-8);
|
|
8933
|
+
}
|
|
8934
|
+
|
|
8602
8935
|
// src/runtime/formatting/projector.ts
|
|
8603
8936
|
function buildFormattingDebugEntry(inputs) {
|
|
8604
8937
|
const { doc, revisionMarkupMode, recentSamples } = inputs;
|
|
@@ -8620,6 +8953,11 @@ function buildFormattingDebugEntry(inputs) {
|
|
|
8620
8953
|
}
|
|
8621
8954
|
|
|
8622
8955
|
export {
|
|
8956
|
+
cloneNumberingCatalog,
|
|
8957
|
+
getListKind,
|
|
8958
|
+
ensureDefaultListInstance,
|
|
8959
|
+
allocateNumberingInstance,
|
|
8960
|
+
setStartOverride,
|
|
8623
8961
|
collectScopeLocations,
|
|
8624
8962
|
resolveScope,
|
|
8625
8963
|
findAllScopesAt,
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
getRevisionActionability,
|
|
9
9
|
normalizeParsedTextDocument,
|
|
10
10
|
normalizeParsedTextDocumentAsync
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-JJGVE5J7.js";
|
|
12
12
|
import {
|
|
13
13
|
OLE_RELATIONSHIP_TYPES,
|
|
14
14
|
buildFieldRegistry,
|
|
@@ -59,7 +59,7 @@ import {
|
|
|
59
59
|
resolveHighlightColor,
|
|
60
60
|
setActiveParseTelemetryBus,
|
|
61
61
|
toCanonicalNumberingInstanceId
|
|
62
|
-
} from "./chunk-
|
|
62
|
+
} from "./chunk-Q3QYGKFE.js";
|
|
63
63
|
import {
|
|
64
64
|
createPersistedSourcePackage,
|
|
65
65
|
decodeBytesBase64,
|