@beyondwork/docx-react-component 1.0.131 → 1.0.132
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 +679 -157
- package/dist/api/public-types.d.cts +2 -2
- package/dist/api/public-types.d.ts +2 -2
- package/dist/api/public-types.js +5 -3
- package/dist/api/v3.cjs +371 -32
- package/dist/api/v3.d.cts +3 -3
- package/dist/api/v3.d.ts +3 -3
- package/dist/api/v3.js +10 -10
- package/dist/{canonical-document-BMtONpgf.d.cts → canonical-document-CfZIc-fC.d.cts} +1 -1
- package/dist/{canonical-document-BMtONpgf.d.ts → canonical-document-CfZIc-fC.d.ts} +1 -1
- package/dist/{chunk-YLL7MF5C.js → chunk-43JAPM2F.js} +24 -17
- package/dist/{chunk-4YCWECLZ.js → chunk-4HGFJ6Z2.js} +1 -1
- package/dist/{chunk-HYHCRMR7.js → chunk-6736GA6J.js} +1 -1
- package/dist/{chunk-Q7Y57KOK.js → chunk-6TLZ6CMP.js} +2 -2
- package/dist/{chunk-DGA7M77X.js → chunk-ALWXYGXP.js} +2 -2
- package/dist/{chunk-PHMWH23E.js → chunk-C5LXKR54.js} +1 -1
- package/dist/{chunk-6TBLDBCL.js → chunk-CDEZGLQ3.js} +1 -1
- package/dist/{chunk-VRKK2CSZ.js → chunk-JVTDBX67.js} +2 -2
- package/dist/{chunk-THVM6EP5.js → chunk-LPLJZJT2.js} +1196 -35
- package/dist/{chunk-T5YYFDZB.js → chunk-N5FTU4HZ.js} +1 -1
- package/dist/{chunk-3YCQM2RV.js → chunk-QUTVR72L.js} +8 -7
- package/dist/{chunk-M7YRJX6V.js → chunk-RBWJHRNP.js} +1 -1
- package/dist/{chunk-A66ZVUAT.js → chunk-RYMMKOFI.js} +204 -10
- package/dist/{chunk-QXKQPUOM.js → chunk-SZ6BJA4Q.js} +3 -3
- package/dist/{chunk-A3GSNB4G.js → chunk-U3UMKA7B.js} +147 -13
- package/dist/{chunk-KNHMXKC6.js → chunk-UFPBYJMA.js} +2 -2
- package/dist/{chunk-35RHOE6I.js → chunk-UP2KDOYE.js} +6 -1162
- package/dist/{chunk-CI2TD3T4.js → chunk-W2I47J2Q.js} +1 -1
- package/dist/{chunk-7G5GR3VV.js → chunk-XYTWOJII.js} +5 -5
- package/dist/{chunk-WZDKNF37.js → chunk-YUHNDEV5.js} +7 -7
- package/dist/{chunk-ZVC23LKV.js → chunk-ZDYGRO2Z.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 +312 -20
- 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 +5 -5
- 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 +312 -20
- 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 +4 -4
- package/dist/core/commands/text-commands.cjs +312 -20
- 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 +5 -5
- 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 +3015 -2213
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +554 -99
- package/dist/io/docx-session.d.cts +4 -4
- package/dist/io/docx-session.d.ts +4 -4
- package/dist/io/docx-session.js +4 -4
- package/dist/legal.d.cts +1 -1
- package/dist/legal.d.ts +1 -1
- package/dist/legal.js +3 -3
- package/dist/{loader-B-aL5HGD.d.ts → loader-CfpeEPAa.d.ts} +3 -3
- package/dist/{loader-DiY_ZgKl.d.cts → loader-MAa8VpzW.d.cts} +3 -3
- package/dist/{public-types-gvubspUI.d.cts → public-types-Cjs8glST.d.ts} +137 -2
- package/dist/{public-types-DyqnxxO9.d.ts → public-types-KBS6JnOs.d.cts} +137 -2
- package/dist/public-types.cjs +679 -157
- package/dist/public-types.d.cts +2 -2
- package/dist/public-types.d.ts +2 -2
- package/dist/public-types.js +5 -3
- package/dist/runtime/collab.d.cts +3 -3
- package/dist/runtime/collab.d.ts +3 -3
- package/dist/runtime/document-runtime.cjs +371 -22
- package/dist/runtime/document-runtime.d.cts +2 -2
- package/dist/runtime/document-runtime.d.ts +2 -2
- package/dist/runtime/document-runtime.js +14 -14
- package/dist/{session-CDB0hohT.d.ts → session-CkoH8FoY.d.ts} +3 -3
- package/dist/{session-BUN6B-Vj.d.cts → session-wwe0Gib-.d.cts} +3 -3
- package/dist/session.d.cts +5 -5
- package/dist/session.d.ts +5 -5
- package/dist/session.js +5 -5
- package/dist/tailwind.cjs +492 -202
- package/dist/tailwind.d.cts +2 -2
- package/dist/tailwind.d.ts +2 -2
- package/dist/tailwind.js +7 -7
- package/dist/{types-C4bz3kDU.d.cts → types-B3SGRW0w.d.cts} +2 -2
- package/dist/{types-VWH6CRvG.d.ts → types-CH7NWqVL.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 +4 -4
- package/dist/ui-tailwind.cjs +492 -202
- package/dist/ui-tailwind.d.cts +3 -3
- package/dist/ui-tailwind.d.ts +3 -3
- package/dist/ui-tailwind.js +7 -7
- package/package.json +1 -1
package/dist/ui-tailwind.cjs
CHANGED
|
@@ -6486,6 +6486,187 @@ function createNodeAnchor(at, assoc = 1) {
|
|
|
6486
6486
|
}
|
|
6487
6487
|
var MAIN_STORY_TARGET = { kind: "main" };
|
|
6488
6488
|
|
|
6489
|
+
// src/runtime/telemetry/perf-probe.ts
|
|
6490
|
+
function recordPerfSample(kind, durationMs = 0) {
|
|
6491
|
+
const state = getEnabledState();
|
|
6492
|
+
if (!state) {
|
|
6493
|
+
return null;
|
|
6494
|
+
}
|
|
6495
|
+
const token = `${kind}-${state.nextToken ?? 0}`;
|
|
6496
|
+
state.nextToken = (state.nextToken ?? 0) + 1;
|
|
6497
|
+
const sample = {
|
|
6498
|
+
token,
|
|
6499
|
+
kind,
|
|
6500
|
+
durationMs,
|
|
6501
|
+
recordedAt: Date.now()
|
|
6502
|
+
};
|
|
6503
|
+
pushSample(state, sample);
|
|
6504
|
+
return sample;
|
|
6505
|
+
}
|
|
6506
|
+
function incrementInvalidationCounter(counter, amount = 1) {
|
|
6507
|
+
const state = getEnabledState();
|
|
6508
|
+
if (!state) {
|
|
6509
|
+
return 0;
|
|
6510
|
+
}
|
|
6511
|
+
state.invalidationCounts ??= {};
|
|
6512
|
+
state.invalidationCounts[counter] = (state.invalidationCounts[counter] ?? 0) + amount;
|
|
6513
|
+
return state.invalidationCounts[counter];
|
|
6514
|
+
}
|
|
6515
|
+
function getEnabledState() {
|
|
6516
|
+
if (typeof window === "undefined") {
|
|
6517
|
+
return null;
|
|
6518
|
+
}
|
|
6519
|
+
const state = window.__DOCX_REACT_PERF_PROBE__;
|
|
6520
|
+
if (!state?.enabled) {
|
|
6521
|
+
return null;
|
|
6522
|
+
}
|
|
6523
|
+
return state;
|
|
6524
|
+
}
|
|
6525
|
+
function pushSample(state, sample) {
|
|
6526
|
+
state.samples ??= [];
|
|
6527
|
+
state.samples.push(sample);
|
|
6528
|
+
const maxSamples = state.maxSamples ?? 20;
|
|
6529
|
+
if (state.samples.length > maxSamples) {
|
|
6530
|
+
state.samples.splice(0, state.samples.length - maxSamples);
|
|
6531
|
+
}
|
|
6532
|
+
}
|
|
6533
|
+
|
|
6534
|
+
// src/runtime/story-context.ts
|
|
6535
|
+
function collectSectionContexts(document2) {
|
|
6536
|
+
const sections = [];
|
|
6537
|
+
let sectionIndex = 0;
|
|
6538
|
+
for (const block of document2.content.children) {
|
|
6539
|
+
if (block.type !== "section_break") {
|
|
6540
|
+
continue;
|
|
6541
|
+
}
|
|
6542
|
+
sections.push({
|
|
6543
|
+
index: sectionIndex,
|
|
6544
|
+
properties: block.sectionProperties
|
|
6545
|
+
});
|
|
6546
|
+
sectionIndex += 1;
|
|
6547
|
+
}
|
|
6548
|
+
sections.push({
|
|
6549
|
+
index: sectionIndex,
|
|
6550
|
+
properties: document2.subParts?.finalSectionProperties
|
|
6551
|
+
});
|
|
6552
|
+
return sections;
|
|
6553
|
+
}
|
|
6554
|
+
function resolveSectionVariants(kind, sectionIndex, explicitReferences, documents) {
|
|
6555
|
+
if (explicitReferences && explicitReferences.length > 0) {
|
|
6556
|
+
return explicitReferences.map((ref) => ({
|
|
6557
|
+
variant: ref.variant,
|
|
6558
|
+
relationshipId: ref.relationshipId
|
|
6559
|
+
}));
|
|
6560
|
+
}
|
|
6561
|
+
return documents.filter(
|
|
6562
|
+
(entry) => entry.sectionIndex === void 0 || entry.sectionIndex === sectionIndex
|
|
6563
|
+
).map((entry) => ({
|
|
6564
|
+
variant: entry.variant,
|
|
6565
|
+
relationshipId: entry.relationshipId
|
|
6566
|
+
}));
|
|
6567
|
+
}
|
|
6568
|
+
function findHeaderFooterDocumentEntry(document2, target) {
|
|
6569
|
+
const documents = target.kind === "header" ? document2.subParts?.headers ?? [] : document2.subParts?.footers ?? [];
|
|
6570
|
+
const matches = documents.filter(
|
|
6571
|
+
(entry) => entry.relationshipId === target.relationshipId && entry.variant === target.variant
|
|
6572
|
+
);
|
|
6573
|
+
if (matches.length === 0) {
|
|
6574
|
+
return void 0;
|
|
6575
|
+
}
|
|
6576
|
+
if (target.sectionIndex !== void 0) {
|
|
6577
|
+
return matches.find((entry) => entry.sectionIndex === target.sectionIndex) ?? matches.find((entry) => entry.sectionIndex === void 0) ?? matches[0];
|
|
6578
|
+
}
|
|
6579
|
+
return matches[0];
|
|
6580
|
+
}
|
|
6581
|
+
function sectionSupportsStoryTarget(document2, sectionIndex, target) {
|
|
6582
|
+
if (!findHeaderFooterDocumentEntry(document2, target)) {
|
|
6583
|
+
return false;
|
|
6584
|
+
}
|
|
6585
|
+
const section = collectSectionContexts(document2).find(
|
|
6586
|
+
(candidate) => candidate.index === sectionIndex
|
|
6587
|
+
);
|
|
6588
|
+
if (!section) {
|
|
6589
|
+
return false;
|
|
6590
|
+
}
|
|
6591
|
+
const variants = resolveSectionVariants(
|
|
6592
|
+
target.kind,
|
|
6593
|
+
sectionIndex,
|
|
6594
|
+
target.kind === "header" ? section.properties?.headerReferences : section.properties?.footerReferences,
|
|
6595
|
+
target.kind === "header" ? document2.subParts?.headers ?? [] : document2.subParts?.footers ?? []
|
|
6596
|
+
);
|
|
6597
|
+
return variants.some(
|
|
6598
|
+
(variant) => variant.relationshipId === target.relationshipId && variant.variant === target.variant
|
|
6599
|
+
);
|
|
6600
|
+
}
|
|
6601
|
+
function normalizeHeaderFooterTarget(document2, target, preferredSectionIndex) {
|
|
6602
|
+
if (!findHeaderFooterDocumentEntry(document2, target)) {
|
|
6603
|
+
return void 0;
|
|
6604
|
+
}
|
|
6605
|
+
if (target.sectionIndex !== void 0) {
|
|
6606
|
+
return sectionSupportsStoryTarget(document2, target.sectionIndex, target) ? target : void 0;
|
|
6607
|
+
}
|
|
6608
|
+
const candidateIndexes = collectSectionContexts(document2).map((section) => section.index).filter(
|
|
6609
|
+
(sectionIndex) => sectionSupportsStoryTarget(document2, sectionIndex, target)
|
|
6610
|
+
);
|
|
6611
|
+
if (candidateIndexes.length === 0) {
|
|
6612
|
+
return void 0;
|
|
6613
|
+
}
|
|
6614
|
+
const resolvedSectionIndex = preferredSectionIndex !== void 0 && candidateIndexes.includes(preferredSectionIndex) ? preferredSectionIndex : candidateIndexes[0];
|
|
6615
|
+
return {
|
|
6616
|
+
...target,
|
|
6617
|
+
sectionIndex: resolvedSectionIndex
|
|
6618
|
+
};
|
|
6619
|
+
}
|
|
6620
|
+
|
|
6621
|
+
// src/runtime/story-targeting.ts
|
|
6622
|
+
function storyTargetKey(target) {
|
|
6623
|
+
switch (target.kind) {
|
|
6624
|
+
case "main":
|
|
6625
|
+
return "main";
|
|
6626
|
+
case "header":
|
|
6627
|
+
return `header:${target.relationshipId}:${target.variant}:${target.sectionIndex ?? "*"}`;
|
|
6628
|
+
case "footer":
|
|
6629
|
+
return `footer:${target.relationshipId}:${target.variant}:${target.sectionIndex ?? "*"}`;
|
|
6630
|
+
case "footnote":
|
|
6631
|
+
return `footnote:${target.noteId}`;
|
|
6632
|
+
case "endnote":
|
|
6633
|
+
return `endnote:${target.noteId}`;
|
|
6634
|
+
}
|
|
6635
|
+
}
|
|
6636
|
+
function getStoryBlocks(document2, target) {
|
|
6637
|
+
if (target.kind === "main") {
|
|
6638
|
+
return document2.content.children;
|
|
6639
|
+
}
|
|
6640
|
+
const subParts = document2.subParts;
|
|
6641
|
+
if (!subParts) {
|
|
6642
|
+
return [];
|
|
6643
|
+
}
|
|
6644
|
+
switch (target.kind) {
|
|
6645
|
+
case "header": {
|
|
6646
|
+
const resolvedTarget = normalizeHeaderFooterTarget(document2, target);
|
|
6647
|
+
return (resolvedTarget && findHeaderFooterDocumentEntry(document2, resolvedTarget)?.blocks) ?? [];
|
|
6648
|
+
}
|
|
6649
|
+
case "footer": {
|
|
6650
|
+
const resolvedTarget = normalizeHeaderFooterTarget(document2, target);
|
|
6651
|
+
return (resolvedTarget && findHeaderFooterDocumentEntry(document2, resolvedTarget)?.blocks) ?? [];
|
|
6652
|
+
}
|
|
6653
|
+
case "footnote":
|
|
6654
|
+
return subParts.footnoteCollection?.footnotes[target.noteId]?.blocks ?? [];
|
|
6655
|
+
case "endnote":
|
|
6656
|
+
return subParts.footnoteCollection?.endnotes[target.noteId]?.blocks ?? [];
|
|
6657
|
+
}
|
|
6658
|
+
}
|
|
6659
|
+
|
|
6660
|
+
// src/runtime/render/render-frame-types.ts
|
|
6661
|
+
var DEFAULT_PX_PER_TWIP = 96 / 1440;
|
|
6662
|
+
var EMPTY_DECORATION_INDEX = Object.freeze({
|
|
6663
|
+
workflow: Object.freeze([]),
|
|
6664
|
+
comments: Object.freeze([]),
|
|
6665
|
+
revisions: Object.freeze([]),
|
|
6666
|
+
search: Object.freeze([]),
|
|
6667
|
+
locked: Object.freeze([])
|
|
6668
|
+
});
|
|
6669
|
+
|
|
6489
6670
|
// src/core/schema/text-schema.ts
|
|
6490
6671
|
function parseTextStory(content) {
|
|
6491
6672
|
const root = normalizeDocumentRoot(content);
|
|
@@ -6912,132 +7093,6 @@ function toRuntimeAnchor(anchor) {
|
|
|
6912
7093
|
// src/api/public-types.ts
|
|
6913
7094
|
init_measurement_backend_canvas();
|
|
6914
7095
|
|
|
6915
|
-
// src/runtime/story-context.ts
|
|
6916
|
-
function collectSectionContexts(document2) {
|
|
6917
|
-
const sections = [];
|
|
6918
|
-
let sectionIndex = 0;
|
|
6919
|
-
for (const block of document2.content.children) {
|
|
6920
|
-
if (block.type !== "section_break") {
|
|
6921
|
-
continue;
|
|
6922
|
-
}
|
|
6923
|
-
sections.push({
|
|
6924
|
-
index: sectionIndex,
|
|
6925
|
-
properties: block.sectionProperties
|
|
6926
|
-
});
|
|
6927
|
-
sectionIndex += 1;
|
|
6928
|
-
}
|
|
6929
|
-
sections.push({
|
|
6930
|
-
index: sectionIndex,
|
|
6931
|
-
properties: document2.subParts?.finalSectionProperties
|
|
6932
|
-
});
|
|
6933
|
-
return sections;
|
|
6934
|
-
}
|
|
6935
|
-
function resolveSectionVariants(kind, sectionIndex, explicitReferences, documents) {
|
|
6936
|
-
if (explicitReferences && explicitReferences.length > 0) {
|
|
6937
|
-
return explicitReferences.map((ref) => ({
|
|
6938
|
-
variant: ref.variant,
|
|
6939
|
-
relationshipId: ref.relationshipId
|
|
6940
|
-
}));
|
|
6941
|
-
}
|
|
6942
|
-
return documents.filter(
|
|
6943
|
-
(entry) => entry.sectionIndex === void 0 || entry.sectionIndex === sectionIndex
|
|
6944
|
-
).map((entry) => ({
|
|
6945
|
-
variant: entry.variant,
|
|
6946
|
-
relationshipId: entry.relationshipId
|
|
6947
|
-
}));
|
|
6948
|
-
}
|
|
6949
|
-
function findHeaderFooterDocumentEntry(document2, target) {
|
|
6950
|
-
const documents = target.kind === "header" ? document2.subParts?.headers ?? [] : document2.subParts?.footers ?? [];
|
|
6951
|
-
const matches = documents.filter(
|
|
6952
|
-
(entry) => entry.relationshipId === target.relationshipId && entry.variant === target.variant
|
|
6953
|
-
);
|
|
6954
|
-
if (matches.length === 0) {
|
|
6955
|
-
return void 0;
|
|
6956
|
-
}
|
|
6957
|
-
if (target.sectionIndex !== void 0) {
|
|
6958
|
-
return matches.find((entry) => entry.sectionIndex === target.sectionIndex) ?? matches.find((entry) => entry.sectionIndex === void 0) ?? matches[0];
|
|
6959
|
-
}
|
|
6960
|
-
return matches[0];
|
|
6961
|
-
}
|
|
6962
|
-
function sectionSupportsStoryTarget(document2, sectionIndex, target) {
|
|
6963
|
-
if (!findHeaderFooterDocumentEntry(document2, target)) {
|
|
6964
|
-
return false;
|
|
6965
|
-
}
|
|
6966
|
-
const section = collectSectionContexts(document2).find(
|
|
6967
|
-
(candidate) => candidate.index === sectionIndex
|
|
6968
|
-
);
|
|
6969
|
-
if (!section) {
|
|
6970
|
-
return false;
|
|
6971
|
-
}
|
|
6972
|
-
const variants = resolveSectionVariants(
|
|
6973
|
-
target.kind,
|
|
6974
|
-
sectionIndex,
|
|
6975
|
-
target.kind === "header" ? section.properties?.headerReferences : section.properties?.footerReferences,
|
|
6976
|
-
target.kind === "header" ? document2.subParts?.headers ?? [] : document2.subParts?.footers ?? []
|
|
6977
|
-
);
|
|
6978
|
-
return variants.some(
|
|
6979
|
-
(variant) => variant.relationshipId === target.relationshipId && variant.variant === target.variant
|
|
6980
|
-
);
|
|
6981
|
-
}
|
|
6982
|
-
function normalizeHeaderFooterTarget(document2, target, preferredSectionIndex) {
|
|
6983
|
-
if (!findHeaderFooterDocumentEntry(document2, target)) {
|
|
6984
|
-
return void 0;
|
|
6985
|
-
}
|
|
6986
|
-
if (target.sectionIndex !== void 0) {
|
|
6987
|
-
return sectionSupportsStoryTarget(document2, target.sectionIndex, target) ? target : void 0;
|
|
6988
|
-
}
|
|
6989
|
-
const candidateIndexes = collectSectionContexts(document2).map((section) => section.index).filter(
|
|
6990
|
-
(sectionIndex) => sectionSupportsStoryTarget(document2, sectionIndex, target)
|
|
6991
|
-
);
|
|
6992
|
-
if (candidateIndexes.length === 0) {
|
|
6993
|
-
return void 0;
|
|
6994
|
-
}
|
|
6995
|
-
const resolvedSectionIndex = preferredSectionIndex !== void 0 && candidateIndexes.includes(preferredSectionIndex) ? preferredSectionIndex : candidateIndexes[0];
|
|
6996
|
-
return {
|
|
6997
|
-
...target,
|
|
6998
|
-
sectionIndex: resolvedSectionIndex
|
|
6999
|
-
};
|
|
7000
|
-
}
|
|
7001
|
-
|
|
7002
|
-
// src/runtime/story-targeting.ts
|
|
7003
|
-
function storyTargetKey(target) {
|
|
7004
|
-
switch (target.kind) {
|
|
7005
|
-
case "main":
|
|
7006
|
-
return "main";
|
|
7007
|
-
case "header":
|
|
7008
|
-
return `header:${target.relationshipId}:${target.variant}:${target.sectionIndex ?? "*"}`;
|
|
7009
|
-
case "footer":
|
|
7010
|
-
return `footer:${target.relationshipId}:${target.variant}:${target.sectionIndex ?? "*"}`;
|
|
7011
|
-
case "footnote":
|
|
7012
|
-
return `footnote:${target.noteId}`;
|
|
7013
|
-
case "endnote":
|
|
7014
|
-
return `endnote:${target.noteId}`;
|
|
7015
|
-
}
|
|
7016
|
-
}
|
|
7017
|
-
function getStoryBlocks(document2, target) {
|
|
7018
|
-
if (target.kind === "main") {
|
|
7019
|
-
return document2.content.children;
|
|
7020
|
-
}
|
|
7021
|
-
const subParts = document2.subParts;
|
|
7022
|
-
if (!subParts) {
|
|
7023
|
-
return [];
|
|
7024
|
-
}
|
|
7025
|
-
switch (target.kind) {
|
|
7026
|
-
case "header": {
|
|
7027
|
-
const resolvedTarget = normalizeHeaderFooterTarget(document2, target);
|
|
7028
|
-
return (resolvedTarget && findHeaderFooterDocumentEntry(document2, resolvedTarget)?.blocks) ?? [];
|
|
7029
|
-
}
|
|
7030
|
-
case "footer": {
|
|
7031
|
-
const resolvedTarget = normalizeHeaderFooterTarget(document2, target);
|
|
7032
|
-
return (resolvedTarget && findHeaderFooterDocumentEntry(document2, resolvedTarget)?.blocks) ?? [];
|
|
7033
|
-
}
|
|
7034
|
-
case "footnote":
|
|
7035
|
-
return subParts.footnoteCollection?.footnotes[target.noteId]?.blocks ?? [];
|
|
7036
|
-
case "endnote":
|
|
7037
|
-
return subParts.footnoteCollection?.endnotes[target.noteId]?.blocks ?? [];
|
|
7038
|
-
}
|
|
7039
|
-
}
|
|
7040
|
-
|
|
7041
7096
|
// src/core/selection/anchor-conversion.ts
|
|
7042
7097
|
var DEFAULT_PUBLIC_ASSOC = {
|
|
7043
7098
|
start: -1,
|
|
@@ -7533,11 +7588,14 @@ function collectEditableTargetRefs(doc, cache) {
|
|
|
7533
7588
|
collectEditableTargetsInBlocks(
|
|
7534
7589
|
context.blocks,
|
|
7535
7590
|
{
|
|
7591
|
+
doc,
|
|
7536
7592
|
storyKey: context.storyKey,
|
|
7537
7593
|
basePath: context.basePath,
|
|
7538
7594
|
insideSdt: false,
|
|
7539
7595
|
insideTextBox: false,
|
|
7540
|
-
tableDepth: 0
|
|
7596
|
+
tableDepth: 0,
|
|
7597
|
+
numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
|
|
7598
|
+
numberingTargetRevisionHash: createNumberingTargetRevisionHash(doc)
|
|
7541
7599
|
},
|
|
7542
7600
|
targets,
|
|
7543
7601
|
cache
|
|
@@ -7554,6 +7612,7 @@ function buildBlockCacheSignature(context, blockIndex) {
|
|
|
7554
7612
|
const owner = tt?.editableOwnersByChildIndex?.get(blockIndex);
|
|
7555
7613
|
return [
|
|
7556
7614
|
context.storyKey,
|
|
7615
|
+
context.numberingTargetRevisionHash,
|
|
7557
7616
|
context.insideSdt ? "1" : "0",
|
|
7558
7617
|
context.insideTextBox ? "1" : "0",
|
|
7559
7618
|
String(context.tableDepth),
|
|
@@ -7599,7 +7658,8 @@ function collectEditableTargetsInBlocks(blocks, context, targets, cache, blockIn
|
|
|
7599
7658
|
editableParagraphTargetPosture(targetKind),
|
|
7600
7659
|
context.contentControl,
|
|
7601
7660
|
context.tableTarget,
|
|
7602
|
-
context.tableTarget?.editableOwnersByChildIndex?.get(blockIndex)
|
|
7661
|
+
context.tableTarget?.editableOwnersByChildIndex?.get(blockIndex),
|
|
7662
|
+
resolveEditableParagraphListIdentity(block, context)
|
|
7603
7663
|
)
|
|
7604
7664
|
);
|
|
7605
7665
|
}
|
|
@@ -8128,7 +8188,7 @@ function collectEditableTargetsInInlines(inlines, basePath, context, targets) {
|
|
|
8128
8188
|
}
|
|
8129
8189
|
}
|
|
8130
8190
|
}
|
|
8131
|
-
function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, targetPosture = { editability: "editable", posture: { blockers: [] } }, contentControl, tableTarget, editableOwner) {
|
|
8191
|
+
function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, targetPosture = { editability: "editable", posture: { blockers: [] } }, contentControl, tableTarget, editableOwner, listIdentity) {
|
|
8132
8192
|
const paragraphText = collectParagraphText(paragraph);
|
|
8133
8193
|
const paragraphTextHash = hashText(paragraphText);
|
|
8134
8194
|
const sourceRef = paragraph.sourceRef;
|
|
@@ -8139,19 +8199,39 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
|
|
|
8139
8199
|
context: { storyKey, insideSdt: contentControl !== void 0 },
|
|
8140
8200
|
...tableTarget
|
|
8141
8201
|
}) : void 0;
|
|
8142
|
-
const listAddress =
|
|
8202
|
+
const listAddress = listIdentity !== void 0 ? createCanonicalAddress({
|
|
8143
8203
|
addressKind: "list-item-text",
|
|
8144
8204
|
storyKey,
|
|
8145
8205
|
staleCheckKind: "paragraph",
|
|
8146
8206
|
operationScope: "list-text",
|
|
8147
|
-
sourceRefs: [
|
|
8207
|
+
sourceRefs: [
|
|
8208
|
+
sourceRef,
|
|
8209
|
+
listIdentity.paragraphNumberingSourceRef,
|
|
8210
|
+
listIdentity.instanceSourceRef,
|
|
8211
|
+
listIdentity.abstractSourceRef
|
|
8212
|
+
],
|
|
8148
8213
|
staleHash: paragraphTextHash,
|
|
8149
8214
|
rangeBoundary: { boundaryKind: "list-item-text" },
|
|
8215
|
+
list: {
|
|
8216
|
+
numberingOrigin: listIdentity.numberingOrigin,
|
|
8217
|
+
numberingInstanceId: listIdentity.numberingInstanceId,
|
|
8218
|
+
...listIdentity.abstractNumberingId !== void 0 ? { abstractNumberingId: listIdentity.abstractNumberingId } : {},
|
|
8219
|
+
level: listIdentity.level,
|
|
8220
|
+
...listIdentity.overrideHash !== void 0 ? { overrideHash: listIdentity.overrideHash } : {},
|
|
8221
|
+
numberingCatalogHash: listIdentity.numberingCatalogHash
|
|
8222
|
+
},
|
|
8150
8223
|
discriminator: {
|
|
8151
8224
|
blockPath,
|
|
8152
|
-
|
|
8153
|
-
|
|
8225
|
+
numberingOrigin: listIdentity.numberingOrigin,
|
|
8226
|
+
numberingInstanceId: listIdentity.numberingInstanceId,
|
|
8227
|
+
abstractNumberingId: listIdentity.abstractNumberingId ?? null,
|
|
8228
|
+
level: listIdentity.level,
|
|
8229
|
+
overrideHash: listIdentity.overrideHash ?? null,
|
|
8230
|
+
numberingCatalogHash: listIdentity.numberingCatalogHash,
|
|
8154
8231
|
sourceId: sourceRef?.sourceId ?? null,
|
|
8232
|
+
numberingSourceId: listIdentity.paragraphNumberingSourceRef?.sourceId ?? null,
|
|
8233
|
+
numberingInstanceSourceId: listIdentity.instanceSourceRef?.sourceId ?? null,
|
|
8234
|
+
abstractNumberingSourceId: listIdentity.abstractSourceRef?.sourceId ?? null,
|
|
8155
8235
|
paraId: paragraph.wordExtensionIds?.paraId ?? null,
|
|
8156
8236
|
textId: paragraph.wordExtensionIds?.textId ?? null
|
|
8157
8237
|
}
|
|
@@ -8192,11 +8272,62 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
|
|
|
8192
8272
|
blockType: "paragraph",
|
|
8193
8273
|
...paragraph.wordExtensionIds?.paraId !== void 0 ? { wordParaId: paragraph.wordExtensionIds.paraId } : {},
|
|
8194
8274
|
...paragraph.wordExtensionIds?.textId !== void 0 ? { wordTextId: paragraph.wordExtensionIds.textId } : {},
|
|
8195
|
-
...sourceRef !== void 0 ? { sourceRef } : {}
|
|
8275
|
+
...sourceRef !== void 0 ? { sourceRef } : {},
|
|
8276
|
+
...listIdentity !== void 0 ? {
|
|
8277
|
+
listNumberingOrigin: listIdentity.numberingOrigin,
|
|
8278
|
+
listNumberingInstanceId: listIdentity.numberingInstanceId,
|
|
8279
|
+
...listIdentity.abstractNumberingId !== void 0 ? { listAbstractNumberingId: listIdentity.abstractNumberingId } : {},
|
|
8280
|
+
listLevel: listIdentity.level,
|
|
8281
|
+
...listIdentity.overrideHash !== void 0 ? { listOverrideHash: listIdentity.overrideHash } : {},
|
|
8282
|
+
numberingCatalogHash: listIdentity.numberingCatalogHash
|
|
8283
|
+
} : {}
|
|
8196
8284
|
},
|
|
8197
8285
|
posture
|
|
8198
8286
|
};
|
|
8199
8287
|
}
|
|
8288
|
+
function resolveEditableParagraphListIdentity(paragraph, context) {
|
|
8289
|
+
const directNumbering = paragraph.numbering;
|
|
8290
|
+
const styleNumbering = directNumbering === void 0 && paragraph.styleId !== void 0 ? resolveParagraphStyleNumbering(context.doc, paragraph.styleId) : void 0;
|
|
8291
|
+
const numbering = directNumbering ?? styleNumbering;
|
|
8292
|
+
if (numbering === void 0) return void 0;
|
|
8293
|
+
const numberingCatalog = context.doc.numbering ?? { abstractDefinitions: {}, instances: {} };
|
|
8294
|
+
const instances = numberingCatalog.instances ?? {};
|
|
8295
|
+
const abstractDefinitions = numberingCatalog.abstractDefinitions ?? {};
|
|
8296
|
+
const instance = instances[numbering.numberingInstanceId];
|
|
8297
|
+
const abstractDefinition = instance !== void 0 ? abstractDefinitions[instance.abstractNumberingId] : void 0;
|
|
8298
|
+
const level = numbering.level ?? 0;
|
|
8299
|
+
const override = instance?.overrides.find((entry) => entry.level === level);
|
|
8300
|
+
const overrideHash = override !== void 0 ? hashText(JSON.stringify(numberingOverrideDiscriminator(override))) : void 0;
|
|
8301
|
+
return {
|
|
8302
|
+
numberingOrigin: directNumbering !== void 0 ? "paragraph" : "paragraph-style",
|
|
8303
|
+
numberingInstanceId: numbering.numberingInstanceId,
|
|
8304
|
+
...instance?.abstractNumberingId !== void 0 ? { abstractNumberingId: instance.abstractNumberingId } : {},
|
|
8305
|
+
level,
|
|
8306
|
+
...overrideHash !== void 0 ? { overrideHash } : {},
|
|
8307
|
+
numberingCatalogHash: context.numberingCatalogHash,
|
|
8308
|
+
...directNumbering?.sourceRef !== void 0 ? { paragraphNumberingSourceRef: directNumbering.sourceRef } : {},
|
|
8309
|
+
...instance?.sourceRef !== void 0 ? { instanceSourceRef: instance.sourceRef } : {},
|
|
8310
|
+
...abstractDefinition?.sourceRef !== void 0 ? { abstractSourceRef: abstractDefinition.sourceRef } : {}
|
|
8311
|
+
};
|
|
8312
|
+
}
|
|
8313
|
+
function numberingOverrideDiscriminator(override) {
|
|
8314
|
+
return {
|
|
8315
|
+
level: override.level,
|
|
8316
|
+
startAt: override.startAt ?? null,
|
|
8317
|
+
sourceId: override.sourceRef?.sourceId ?? null,
|
|
8318
|
+
levelDefinition: override.levelDefinition === void 0 ? null : {
|
|
8319
|
+
sourceId: override.levelDefinition.sourceRef?.sourceId ?? null,
|
|
8320
|
+
format: override.levelDefinition.format ?? null,
|
|
8321
|
+
text: override.levelDefinition.text ?? null,
|
|
8322
|
+
startAt: override.levelDefinition.startAt ?? null,
|
|
8323
|
+
paragraphStyleId: override.levelDefinition.paragraphStyleId ?? null,
|
|
8324
|
+
isLegalNumbering: override.levelDefinition.isLegalNumbering ?? null,
|
|
8325
|
+
suffix: override.levelDefinition.suffix ?? null,
|
|
8326
|
+
restartAfterLevel: override.levelDefinition.restartAfterLevel ?? null,
|
|
8327
|
+
picBulletId: override.levelDefinition.picBulletId ?? null
|
|
8328
|
+
}
|
|
8329
|
+
};
|
|
8330
|
+
}
|
|
8200
8331
|
function contentControlLocksContent(contentControl) {
|
|
8201
8332
|
return contentControl?.lock !== void 0 && contentControl.lock !== "unlocked" && contentControl.lock !== "none";
|
|
8202
8333
|
}
|
|
@@ -8965,6 +9096,7 @@ function createCanonicalAddress(input) {
|
|
|
8965
9096
|
...input.rowRange !== void 0 ? { rowRange: input.rowRange } : {},
|
|
8966
9097
|
...input.columnRange !== void 0 ? { columnRange: input.columnRange } : {},
|
|
8967
9098
|
...sourceHash !== void 0 ? { sourceJoinHash: sourceHash } : {},
|
|
9099
|
+
...input.list !== void 0 ? { list: input.list } : {},
|
|
8968
9100
|
...input.secondaryStory === true ? { secondaryStory: true } : {},
|
|
8969
9101
|
...input.nestedTable === true ? { nestedTable: true } : {},
|
|
8970
9102
|
...input.insideSdt === true ? { insideSdt: true } : {},
|
|
@@ -8999,6 +9131,71 @@ function sourceJoinHash(refs) {
|
|
|
8999
9131
|
if (sourceIds.length === 0) return void 0;
|
|
9000
9132
|
return hashText(sourceIds.join("\0"));
|
|
9001
9133
|
}
|
|
9134
|
+
function createNumberingCatalogRevisionHash(doc) {
|
|
9135
|
+
const catalog = doc.numbering ?? { abstractDefinitions: {}, instances: {} };
|
|
9136
|
+
const abstractDefinitions = catalog.abstractDefinitions ?? {};
|
|
9137
|
+
const instances = catalog.instances ?? {};
|
|
9138
|
+
const numPicBullets = catalog.numPicBullets ?? {};
|
|
9139
|
+
return hashText(JSON.stringify({
|
|
9140
|
+
abstractDefinitions: Object.keys(abstractDefinitions).sort().map((abstractNumberingId) => {
|
|
9141
|
+
const definition = abstractDefinitions[abstractNumberingId];
|
|
9142
|
+
return {
|
|
9143
|
+
abstractNumberingId,
|
|
9144
|
+
sourceId: definition.sourceRef?.sourceId ?? null,
|
|
9145
|
+
nsid: definition.nsid ?? null,
|
|
9146
|
+
tplc: definition.tplc ?? null,
|
|
9147
|
+
styleLink: definition.styleLink ?? null,
|
|
9148
|
+
numStyleLink: definition.numStyleLink ?? null,
|
|
9149
|
+
levels: definition.levels.map((level) => ({
|
|
9150
|
+
sourceId: level.sourceRef?.sourceId ?? null,
|
|
9151
|
+
level: level.level,
|
|
9152
|
+
format: level.format,
|
|
9153
|
+
text: level.text,
|
|
9154
|
+
startAt: level.startAt ?? null,
|
|
9155
|
+
paragraphStyleId: level.paragraphStyleId ?? null,
|
|
9156
|
+
isLegalNumbering: level.isLegalNumbering ?? null,
|
|
9157
|
+
suffix: level.suffix ?? null,
|
|
9158
|
+
restartAfterLevel: level.restartAfterLevel ?? null,
|
|
9159
|
+
picBulletId: level.picBulletId ?? null
|
|
9160
|
+
}))
|
|
9161
|
+
};
|
|
9162
|
+
}),
|
|
9163
|
+
instances: Object.keys(instances).sort().map((numberingInstanceId) => {
|
|
9164
|
+
const instance = instances[numberingInstanceId];
|
|
9165
|
+
return {
|
|
9166
|
+
numberingInstanceId,
|
|
9167
|
+
sourceId: instance.sourceRef?.sourceId ?? null,
|
|
9168
|
+
abstractNumberingId: instance.abstractNumberingId,
|
|
9169
|
+
overrides: instance.overrides.map(numberingOverrideDiscriminator)
|
|
9170
|
+
};
|
|
9171
|
+
}),
|
|
9172
|
+
numPicBullets: Object.keys(numPicBullets).sort().map((numPicBulletId) => {
|
|
9173
|
+
const picBullet = numPicBullets[numPicBulletId];
|
|
9174
|
+
return {
|
|
9175
|
+
numPicBulletId,
|
|
9176
|
+
sourceId: picBullet.sourceRef?.sourceId ?? null,
|
|
9177
|
+
mediaId: picBullet.mediaId ?? null,
|
|
9178
|
+
widthEmu: picBullet.widthEmu ?? null,
|
|
9179
|
+
heightEmu: picBullet.heightEmu ?? null
|
|
9180
|
+
};
|
|
9181
|
+
})
|
|
9182
|
+
}));
|
|
9183
|
+
}
|
|
9184
|
+
function createNumberingTargetRevisionHash(doc) {
|
|
9185
|
+
const paragraphStyles = doc.styles?.paragraphs ?? {};
|
|
9186
|
+
return hashText(JSON.stringify({
|
|
9187
|
+
numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
|
|
9188
|
+
paragraphStyleNumbering: Object.keys(paragraphStyles).sort().map((styleId) => {
|
|
9189
|
+
const style = paragraphStyles[styleId];
|
|
9190
|
+
return {
|
|
9191
|
+
styleId,
|
|
9192
|
+
basedOn: style.basedOn ?? null,
|
|
9193
|
+
numberingInstanceId: style.numbering?.numberingInstanceId ?? null,
|
|
9194
|
+
level: style.numbering?.level ?? null
|
|
9195
|
+
};
|
|
9196
|
+
})
|
|
9197
|
+
}));
|
|
9198
|
+
}
|
|
9002
9199
|
function collectCanonicalStoryIdentities(doc) {
|
|
9003
9200
|
const stories = [
|
|
9004
9201
|
{
|
|
@@ -9130,7 +9327,7 @@ function resolveParagraphStyleNumbering(doc, styleId) {
|
|
|
9130
9327
|
let currentStyleId = styleId;
|
|
9131
9328
|
while (currentStyleId !== void 0 && !visited.has(currentStyleId)) {
|
|
9132
9329
|
visited.add(currentStyleId);
|
|
9133
|
-
const style = doc.styles
|
|
9330
|
+
const style = doc.styles?.paragraphs?.[currentStyleId];
|
|
9134
9331
|
if (style === void 0) {
|
|
9135
9332
|
return void 0;
|
|
9136
9333
|
}
|
|
@@ -10686,6 +10883,10 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
10686
10883
|
])
|
|
10687
10884
|
) : resolved.effectiveLevels;
|
|
10688
10885
|
const picBulletId = resolved.effectiveLevel.picBulletId;
|
|
10886
|
+
const pictureBulletPosture = resolvePictureBulletRenderPosture(
|
|
10887
|
+
picBulletId,
|
|
10888
|
+
picBulletId != null ? catalog.numPicBullets?.[picBulletId] : void 0
|
|
10889
|
+
);
|
|
10689
10890
|
const text = renderLevelText(
|
|
10690
10891
|
resolved.effectiveLevel.text,
|
|
10691
10892
|
workingState.counters,
|
|
@@ -10694,14 +10895,20 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
10694
10895
|
if (picBulletId == null && resolved.effectiveLevel.format !== "none" && text === null) {
|
|
10695
10896
|
return null;
|
|
10696
10897
|
}
|
|
10697
|
-
const visibleText = resolved.effectiveLevel.format === "none" ? null : text;
|
|
10898
|
+
const visibleText = resolved.effectiveLevel.format === "none" ? null : text ?? pictureBulletPosture?.fallbackGlyph ?? null;
|
|
10899
|
+
const normalizedMarkerText = normalizeMarkerText(
|
|
10900
|
+
visibleText,
|
|
10901
|
+
resolved.effectiveLevel.format,
|
|
10902
|
+
resolved.geometry.markerRunProperties
|
|
10903
|
+
);
|
|
10698
10904
|
const formatPosture = getNumberingFormatPosture(
|
|
10699
10905
|
resolved.effectiveLevel.format,
|
|
10700
10906
|
currentCounter
|
|
10701
10907
|
);
|
|
10702
|
-
const picBulletMediaId =
|
|
10908
|
+
const picBulletMediaId = pictureBulletPosture?.mediaId;
|
|
10703
10909
|
return {
|
|
10704
|
-
text:
|
|
10910
|
+
text: normalizedMarkerText.text,
|
|
10911
|
+
...normalizedMarkerText.posture !== void 0 ? { markerTextPosture: normalizedMarkerText.posture } : {},
|
|
10705
10912
|
level: resolved.effectiveLevel.level,
|
|
10706
10913
|
format: resolved.effectiveLevel.format,
|
|
10707
10914
|
...formatPosture !== void 0 ? { formatPosture } : {},
|
|
@@ -10711,7 +10918,9 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
10711
10918
|
...resolved.effectiveLevel.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
10712
10919
|
...resolved.geometry.markerRunProperties ? { markerRunProperties: resolved.geometry.markerRunProperties } : {},
|
|
10713
10920
|
geometry: resolved.geometry,
|
|
10714
|
-
...
|
|
10921
|
+
...picBulletId != null ? { picBulletId } : {},
|
|
10922
|
+
...picBulletMediaId != null ? { picBulletMediaId } : {},
|
|
10923
|
+
...pictureBulletPosture !== void 0 ? { pictureBulletPosture } : {}
|
|
10715
10924
|
};
|
|
10716
10925
|
}
|
|
10717
10926
|
return {
|
|
@@ -10727,6 +10936,69 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
10727
10936
|
}
|
|
10728
10937
|
};
|
|
10729
10938
|
}
|
|
10939
|
+
function normalizeMarkerText(text, format, markerRunProperties) {
|
|
10940
|
+
if (text === null || format !== "bullet") {
|
|
10941
|
+
return { text };
|
|
10942
|
+
}
|
|
10943
|
+
const fontFamily = getMarkerFontFamily(markerRunProperties);
|
|
10944
|
+
if (!isKnownSymbolBulletFont(fontFamily)) {
|
|
10945
|
+
return { text };
|
|
10946
|
+
}
|
|
10947
|
+
const renderedText = Array.from(text, (char) => SYMBOL_BULLET_GLYPH_MAP.get(char) ?? char).join("");
|
|
10948
|
+
if (renderedText === text) {
|
|
10949
|
+
return { text };
|
|
10950
|
+
}
|
|
10951
|
+
return {
|
|
10952
|
+
text: renderedText,
|
|
10953
|
+
posture: {
|
|
10954
|
+
status: "normalized",
|
|
10955
|
+
sourceText: text,
|
|
10956
|
+
renderedText,
|
|
10957
|
+
reason: "symbol-font-bullet-normalized",
|
|
10958
|
+
...fontFamily ? { fontFamily } : {}
|
|
10959
|
+
}
|
|
10960
|
+
};
|
|
10961
|
+
}
|
|
10962
|
+
function getMarkerFontFamily(markerRunProperties) {
|
|
10963
|
+
return markerRunProperties?.fontFamilyAscii ?? markerRunProperties?.fontFamilyHAnsi ?? markerRunProperties?.fontFamilyEastAsia ?? markerRunProperties?.fontFamilyCs ?? markerRunProperties?.fontFamily;
|
|
10964
|
+
}
|
|
10965
|
+
function isKnownSymbolBulletFont(fontFamily) {
|
|
10966
|
+
return fontFamily !== void 0 && /^(?:symbol|wingdings|wingdings 2|wingdings 3|webdings)$/iu.test(
|
|
10967
|
+
fontFamily.trim()
|
|
10968
|
+
);
|
|
10969
|
+
}
|
|
10970
|
+
var SYMBOL_BULLET_GLYPH_MAP = /* @__PURE__ */ new Map([
|
|
10971
|
+
["\uF0B7", "\u2022"],
|
|
10972
|
+
["\uF0A7", "\u25AA"],
|
|
10973
|
+
["\uF0FC", "\u2713"]
|
|
10974
|
+
]);
|
|
10975
|
+
function resolvePictureBulletRenderPosture(picBulletId, picBullet) {
|
|
10976
|
+
if (picBulletId == null) return void 0;
|
|
10977
|
+
if (!picBullet) {
|
|
10978
|
+
return {
|
|
10979
|
+
status: "preserve-only",
|
|
10980
|
+
picBulletId,
|
|
10981
|
+
fallbackGlyph: "\u2022",
|
|
10982
|
+
reason: "picture-bullet-catalog-entry-missing"
|
|
10983
|
+
};
|
|
10984
|
+
}
|
|
10985
|
+
if (picBullet.mediaId) {
|
|
10986
|
+
return {
|
|
10987
|
+
status: "media-rendered",
|
|
10988
|
+
picBulletId,
|
|
10989
|
+
mediaId: picBullet.mediaId,
|
|
10990
|
+
...picBullet.sourceRef ? { sourceRef: picBullet.sourceRef } : {},
|
|
10991
|
+
reason: "picture-bullet-media-rendered"
|
|
10992
|
+
};
|
|
10993
|
+
}
|
|
10994
|
+
return {
|
|
10995
|
+
status: "glyph-fallback",
|
|
10996
|
+
picBulletId,
|
|
10997
|
+
fallbackGlyph: "\u2022",
|
|
10998
|
+
...picBullet.sourceRef ? { sourceRef: picBullet.sourceRef } : {},
|
|
10999
|
+
reason: "picture-bullet-media-unavailable"
|
|
11000
|
+
};
|
|
11001
|
+
}
|
|
10730
11002
|
function getSequenceState(states, numberingInstanceId, options = { create: true }) {
|
|
10731
11003
|
const existing = states.get(numberingInstanceId);
|
|
10732
11004
|
if (existing) {
|
|
@@ -10789,7 +11061,7 @@ function getNumberingFormatPosture(format, value) {
|
|
|
10789
11061
|
reason: registryEntry?.fallbackReason ?? "unsupported-numbering-format-decimal-fallback"
|
|
10790
11062
|
};
|
|
10791
11063
|
}
|
|
10792
|
-
if (value !== void 0 && ((format === "upperRoman" || format === "lowerRoman") && (value <= 0 || value >= 4e3) || (format === "cardinalText" || format === "ordinalText") && (!Number.isInteger(value) || value < 1 || value > 999) || (format === "upperLetter" || format === "lowerLetter" || format === "chicago") && value < 1)) {
|
|
11064
|
+
if (value !== void 0 && (registryEntry.isInRange !== void 0 && !registryEntry.isInRange(value) || (format === "upperRoman" || format === "lowerRoman") && (value <= 0 || value >= 4e3) || (format === "cardinalText" || format === "ordinalText") && (!Number.isInteger(value) || value < 1 || value > 999) || (format === "upperLetter" || format === "lowerLetter" || format === "chicago") && value < 1)) {
|
|
10793
11065
|
return {
|
|
10794
11066
|
status: "approximated",
|
|
10795
11067
|
requestedFormat: format,
|
|
@@ -10883,6 +11155,37 @@ var exactNumberingFormatEntries = [
|
|
|
10883
11155
|
supportsMutation: true,
|
|
10884
11156
|
render: toOrdinal2
|
|
10885
11157
|
},
|
|
11158
|
+
{
|
|
11159
|
+
format: "decimalFullWidth",
|
|
11160
|
+
renderSupport: "supported",
|
|
11161
|
+
renderedFormat: "decimalFullWidth",
|
|
11162
|
+
supportsMutation: false,
|
|
11163
|
+
render: toFullWidthDecimal
|
|
11164
|
+
},
|
|
11165
|
+
{
|
|
11166
|
+
format: "decimalEnclosedCircle",
|
|
11167
|
+
renderSupport: "supported",
|
|
11168
|
+
renderedFormat: "decimalEnclosedCircle",
|
|
11169
|
+
supportsMutation: false,
|
|
11170
|
+
render: toCircledDecimal,
|
|
11171
|
+
isInRange: (value) => Number.isInteger(value) && value >= 0 && value <= 50
|
|
11172
|
+
},
|
|
11173
|
+
{
|
|
11174
|
+
format: "decimalEnclosedParen",
|
|
11175
|
+
renderSupport: "supported",
|
|
11176
|
+
renderedFormat: "decimalEnclosedParen",
|
|
11177
|
+
supportsMutation: false,
|
|
11178
|
+
render: (value) => Number.isInteger(value) && value > 0 ? `(${value})` : String(value),
|
|
11179
|
+
isInRange: (value) => Number.isInteger(value) && value > 0
|
|
11180
|
+
},
|
|
11181
|
+
{
|
|
11182
|
+
format: "decimalEnclosedFullstop",
|
|
11183
|
+
renderSupport: "supported",
|
|
11184
|
+
renderedFormat: "decimalEnclosedFullstop",
|
|
11185
|
+
supportsMutation: false,
|
|
11186
|
+
render: (value) => Number.isInteger(value) && value > 0 ? `${value}.` : String(value),
|
|
11187
|
+
isInRange: (value) => Number.isInteger(value) && value > 0
|
|
11188
|
+
},
|
|
10886
11189
|
{
|
|
10887
11190
|
format: "cardinalText",
|
|
10888
11191
|
renderSupport: "supported",
|
|
@@ -10920,10 +11223,6 @@ var exactNumberingFormatEntries = [
|
|
|
10920
11223
|
}
|
|
10921
11224
|
];
|
|
10922
11225
|
var approximatedDecimalFormats = [
|
|
10923
|
-
"decimalEnclosedCircle",
|
|
10924
|
-
"decimalEnclosedFullstop",
|
|
10925
|
-
"decimalEnclosedParen",
|
|
10926
|
-
"decimalFullWidth",
|
|
10927
11226
|
"decimalHalfWidth",
|
|
10928
11227
|
"aiueo",
|
|
10929
11228
|
"iroha",
|
|
@@ -10975,6 +11274,30 @@ function toOrdinal2(value) {
|
|
|
10975
11274
|
return `${value}th`;
|
|
10976
11275
|
}
|
|
10977
11276
|
}
|
|
11277
|
+
function toFullWidthDecimal(value) {
|
|
11278
|
+
return String(value).replace(
|
|
11279
|
+
/[0-9]/g,
|
|
11280
|
+
(digit) => String.fromCharCode(65296 + Number.parseInt(digit, 10))
|
|
11281
|
+
);
|
|
11282
|
+
}
|
|
11283
|
+
var CIRCLED_DECIMAL_BY_VALUE = new Map([
|
|
11284
|
+
[0, "\u24EA"],
|
|
11285
|
+
...Array.from({ length: 20 }, (_, index) => [
|
|
11286
|
+
index + 1,
|
|
11287
|
+
String.fromCodePoint(9312 + index)
|
|
11288
|
+
]),
|
|
11289
|
+
...Array.from({ length: 15 }, (_, index) => [
|
|
11290
|
+
index + 21,
|
|
11291
|
+
String.fromCodePoint(12881 + index)
|
|
11292
|
+
]),
|
|
11293
|
+
...Array.from({ length: 15 }, (_, index) => [
|
|
11294
|
+
index + 36,
|
|
11295
|
+
String.fromCodePoint(12977 + index)
|
|
11296
|
+
])
|
|
11297
|
+
]);
|
|
11298
|
+
function toCircledDecimal(value) {
|
|
11299
|
+
return CIRCLED_DECIMAL_BY_VALUE.get(value) ?? String(value);
|
|
11300
|
+
}
|
|
10978
11301
|
function toAlphabetic2(value) {
|
|
10979
11302
|
if (value <= 0) {
|
|
10980
11303
|
return String(value);
|
|
@@ -11748,6 +12071,7 @@ function toNumberingLayoutInput(numbering) {
|
|
|
11748
12071
|
const hangingTwips = textColumn?.hanging ?? numbering.geometry.indentation?.hanging ?? (typeof numbering.geometry.indentation?.firstLine === "number" && numbering.geometry.indentation.firstLine < 0 ? Math.abs(numbering.geometry.indentation.firstLine) : void 0);
|
|
11749
12072
|
return {
|
|
11750
12073
|
markerText: numbering.text,
|
|
12074
|
+
...numbering.markerTextPosture ? { markerTextPosture: { ...numbering.markerTextPosture } } : {},
|
|
11751
12075
|
...numbering.markerRunProperties ? { markerRunFormatting: numbering.markerRunProperties } : {},
|
|
11752
12076
|
markerSuffix: normalizeNumberingMarkerSuffix(numbering.suffix),
|
|
11753
12077
|
...markerLane ? { markerLaneStartTwips: markerLane.start } : {},
|
|
@@ -11760,7 +12084,9 @@ function toNumberingLayoutInput(numbering) {
|
|
|
11760
12084
|
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
11761
12085
|
startAt: numbering.startAt,
|
|
11762
12086
|
...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
11763
|
-
...numbering.
|
|
12087
|
+
...numbering.picBulletId ? { pictureBulletId: numbering.picBulletId } : {},
|
|
12088
|
+
...numbering.picBulletMediaId ? { pictureBulletMediaId: numbering.picBulletMediaId } : {},
|
|
12089
|
+
...numbering.pictureBulletPosture ? { pictureBulletPosture: { ...numbering.pictureBulletPosture } } : {}
|
|
11764
12090
|
};
|
|
11765
12091
|
}
|
|
11766
12092
|
function toFieldLayoutInput(entry, resolved, region) {
|
|
@@ -12272,6 +12598,7 @@ function buildEffectiveNumbering(detail) {
|
|
|
12272
12598
|
const result = {
|
|
12273
12599
|
level: detail.level,
|
|
12274
12600
|
...detail.text !== null ? { marker: detail.text } : {},
|
|
12601
|
+
...detail.markerTextPosture ? { markerTextPosture: { ...detail.markerTextPosture } } : {},
|
|
12275
12602
|
...detail.markerRunProperties ? { markerRunFormatting: detail.markerRunProperties } : {},
|
|
12276
12603
|
...detail.geometry ? {
|
|
12277
12604
|
indentation: {
|
|
@@ -12281,7 +12608,8 @@ function buildEffectiveNumbering(detail) {
|
|
|
12281
12608
|
...detail.geometry.tabStops && detail.geometry.tabStops.length > 0 ? { tab: detail.geometry.tabStops[0].position } : {}
|
|
12282
12609
|
}
|
|
12283
12610
|
} : {},
|
|
12284
|
-
...detail.picBulletMediaId ? { pictureBulletRef: detail.picBulletMediaId } : {}
|
|
12611
|
+
...detail.picBulletMediaId ? { pictureBulletRef: detail.picBulletMediaId } : {},
|
|
12612
|
+
...detail.pictureBulletPosture ? { pictureBulletPosture: { ...detail.pictureBulletPosture } } : {}
|
|
12285
12613
|
};
|
|
12286
12614
|
return result;
|
|
12287
12615
|
}
|
|
@@ -14197,6 +14525,7 @@ function toSurfaceResolvedNumbering(numbering) {
|
|
|
14197
14525
|
format: numbering.format,
|
|
14198
14526
|
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
14199
14527
|
...numbering.text !== null ? { text: numbering.text } : {},
|
|
14528
|
+
...numbering.markerTextPosture !== void 0 ? { markerTextPosture: { ...numbering.markerTextPosture } } : {},
|
|
14200
14529
|
startAt: numbering.startAt,
|
|
14201
14530
|
...numbering.paragraphStyleId ? { paragraphStyleId: numbering.paragraphStyleId } : {},
|
|
14202
14531
|
...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
@@ -14209,7 +14538,9 @@ function toSurfaceResolvedNumbering(numbering) {
|
|
|
14209
14538
|
...numbering.geometry.markerLane ? { markerLane: { ...numbering.geometry.markerLane } } : {},
|
|
14210
14539
|
...numbering.geometry.textColumn ? { textColumn: { ...numbering.geometry.textColumn } } : {}
|
|
14211
14540
|
},
|
|
14212
|
-
...numbering.
|
|
14541
|
+
...numbering.picBulletId ? { picBulletId: numbering.picBulletId } : {},
|
|
14542
|
+
...numbering.picBulletMediaId ? { picBulletMediaId: numbering.picBulletMediaId } : {},
|
|
14543
|
+
...numbering.pictureBulletPosture ? { pictureBulletPosture: { ...numbering.pictureBulletPosture } } : {}
|
|
14213
14544
|
};
|
|
14214
14545
|
}
|
|
14215
14546
|
function describePreservedInlinePreview(payloadReference) {
|
|
@@ -18281,6 +18612,11 @@ function freezeNumberingLayoutFacts(numbering) {
|
|
|
18281
18612
|
if (numbering.numberingSourceRef) Object.freeze(numbering.numberingSourceRef);
|
|
18282
18613
|
if (numbering.numberingInstanceSourceRef) Object.freeze(numbering.numberingInstanceSourceRef);
|
|
18283
18614
|
if (numbering.abstractNumberingSourceRef) Object.freeze(numbering.abstractNumberingSourceRef);
|
|
18615
|
+
if (numbering.markerTextPosture) Object.freeze(numbering.markerTextPosture);
|
|
18616
|
+
if (numbering.pictureBulletPosture) {
|
|
18617
|
+
if (numbering.pictureBulletPosture.sourceRef) Object.freeze(numbering.pictureBulletPosture.sourceRef);
|
|
18618
|
+
Object.freeze(numbering.pictureBulletPosture);
|
|
18619
|
+
}
|
|
18284
18620
|
if (numbering.markerLane) Object.freeze(numbering.markerLane);
|
|
18285
18621
|
if (numbering.textColumn) Object.freeze(numbering.textColumn);
|
|
18286
18622
|
if (numbering.tabStops) {
|
|
@@ -19233,8 +19569,17 @@ function collectNumberingLayoutFacts(block) {
|
|
|
19233
19569
|
...block.resolvedNumbering?.format !== void 0 ? { format: block.resolvedNumbering.format } : {},
|
|
19234
19570
|
...block.resolvedNumbering?.formatPosture !== void 0 ? { formatPosture: { ...block.resolvedNumbering.formatPosture } } : {},
|
|
19235
19571
|
...block.numberingPrefix !== void 0 ? { markerText: block.numberingPrefix } : {},
|
|
19572
|
+
...block.resolvedNumbering?.markerTextPosture !== void 0 ? { markerTextPosture: { ...block.resolvedNumbering.markerTextPosture } } : {},
|
|
19236
19573
|
...block.numberingSuffix !== void 0 ? { markerSuffix: block.numberingSuffix } : {},
|
|
19237
19574
|
...block.resolvedNumbering?.geometry.markerJustification !== void 0 ? { markerJustification: block.resolvedNumbering.geometry.markerJustification } : {},
|
|
19575
|
+
...block.resolvedNumbering?.picBulletId !== void 0 ? { picBulletId: block.resolvedNumbering.picBulletId } : {},
|
|
19576
|
+
...block.resolvedNumbering?.picBulletMediaId !== void 0 ? { picBulletMediaId: block.resolvedNumbering.picBulletMediaId } : {},
|
|
19577
|
+
...block.resolvedNumbering?.pictureBulletPosture !== void 0 ? {
|
|
19578
|
+
pictureBulletPosture: {
|
|
19579
|
+
...block.resolvedNumbering.pictureBulletPosture,
|
|
19580
|
+
...block.resolvedNumbering.pictureBulletPosture.sourceRef !== void 0 ? { sourceRef: { ...block.resolvedNumbering.pictureBulletPosture.sourceRef } } : {}
|
|
19581
|
+
}
|
|
19582
|
+
} : {},
|
|
19238
19583
|
...markerLane ? {
|
|
19239
19584
|
markerLane: {
|
|
19240
19585
|
startTwips: markerLane.start,
|
|
@@ -20848,16 +21193,6 @@ function findPageForOffset3(pages, offset) {
|
|
|
20848
21193
|
return Math.max(0, pages.length - 1);
|
|
20849
21194
|
}
|
|
20850
21195
|
|
|
20851
|
-
// src/runtime/render/render-frame-types.ts
|
|
20852
|
-
var DEFAULT_PX_PER_TWIP = 96 / 1440;
|
|
20853
|
-
var EMPTY_DECORATION_INDEX = Object.freeze({
|
|
20854
|
-
workflow: Object.freeze([]),
|
|
20855
|
-
comments: Object.freeze([]),
|
|
20856
|
-
revisions: Object.freeze([]),
|
|
20857
|
-
search: Object.freeze([]),
|
|
20858
|
-
locked: Object.freeze([])
|
|
20859
|
-
});
|
|
20860
|
-
|
|
20861
21196
|
// src/runtime/markdown-sanitizer.ts
|
|
20862
21197
|
function sanitizeMarkdown(raw) {
|
|
20863
21198
|
let sanitized = false;
|
|
@@ -25772,51 +26107,6 @@ function noopDismiss() {
|
|
|
25772
26107
|
// src/ui-tailwind/chrome-overlay/tw-scope-card-layer.tsx
|
|
25773
26108
|
var React20 = __toESM(require("react"), 1);
|
|
25774
26109
|
|
|
25775
|
-
// src/runtime/telemetry/perf-probe.ts
|
|
25776
|
-
function recordPerfSample(kind, durationMs = 0) {
|
|
25777
|
-
const state = getEnabledState();
|
|
25778
|
-
if (!state) {
|
|
25779
|
-
return null;
|
|
25780
|
-
}
|
|
25781
|
-
const token = `${kind}-${state.nextToken ?? 0}`;
|
|
25782
|
-
state.nextToken = (state.nextToken ?? 0) + 1;
|
|
25783
|
-
const sample = {
|
|
25784
|
-
token,
|
|
25785
|
-
kind,
|
|
25786
|
-
durationMs,
|
|
25787
|
-
recordedAt: Date.now()
|
|
25788
|
-
};
|
|
25789
|
-
pushSample(state, sample);
|
|
25790
|
-
return sample;
|
|
25791
|
-
}
|
|
25792
|
-
function incrementInvalidationCounter(counter, amount = 1) {
|
|
25793
|
-
const state = getEnabledState();
|
|
25794
|
-
if (!state) {
|
|
25795
|
-
return 0;
|
|
25796
|
-
}
|
|
25797
|
-
state.invalidationCounts ??= {};
|
|
25798
|
-
state.invalidationCounts[counter] = (state.invalidationCounts[counter] ?? 0) + amount;
|
|
25799
|
-
return state.invalidationCounts[counter];
|
|
25800
|
-
}
|
|
25801
|
-
function getEnabledState() {
|
|
25802
|
-
if (typeof window === "undefined") {
|
|
25803
|
-
return null;
|
|
25804
|
-
}
|
|
25805
|
-
const state = window.__DOCX_REACT_PERF_PROBE__;
|
|
25806
|
-
if (!state?.enabled) {
|
|
25807
|
-
return null;
|
|
25808
|
-
}
|
|
25809
|
-
return state;
|
|
25810
|
-
}
|
|
25811
|
-
function pushSample(state, sample) {
|
|
25812
|
-
state.samples ??= [];
|
|
25813
|
-
state.samples.push(sample);
|
|
25814
|
-
const maxSamples = state.maxSamples ?? 20;
|
|
25815
|
-
if (state.samples.length > maxSamples) {
|
|
25816
|
-
state.samples.splice(0, state.samples.length - maxSamples);
|
|
25817
|
-
}
|
|
25818
|
-
}
|
|
25819
|
-
|
|
25820
26110
|
// src/ui-tailwind/chrome-overlay/chrome-overlay-projector.ts
|
|
25821
26111
|
function projectRectToOverlay(rect2, space = { originLeftPx: 0, originTopPx: 0 }) {
|
|
25822
26112
|
const t0 = typeof performance !== "undefined" ? performance.now() : 0;
|