@beyondwork/docx-react-component 1.0.131 → 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 +837 -224
- 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 +9679 -7492
- 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-7G5GR3VV.js → chunk-224TSMEB.js} +635 -89
- package/dist/{chunk-YLL7MF5C.js → chunk-3JEE5RJU.js} +103 -135
- package/dist/{chunk-35RHOE6I.js → chunk-57HTKX3P.js} +10 -1162
- package/dist/{chunk-A66ZVUAT.js → chunk-5KTJKTNE.js} +236 -10
- package/dist/{chunk-THVM6EP5.js → chunk-CVSD3UNK.js} +1322 -102
- package/dist/{chunk-VRKK2CSZ.js → chunk-EFEW7BTT.js} +2 -2
- package/dist/{chunk-KNHMXKC6.js → chunk-INLRCC4N.js} +2 -2
- package/dist/{chunk-HYHCRMR7.js → chunk-KL4TZSZV.js} +1 -1
- package/dist/{chunk-T5YYFDZB.js → chunk-MQ5GAJ54.js} +68 -39
- package/dist/{chunk-CI2TD3T4.js → chunk-NJFKPDNG.js} +216 -2
- package/dist/{chunk-WZDKNF37.js → chunk-OTRVGNZQ.js} +2934 -1815
- package/dist/{chunk-4YCWECLZ.js → chunk-PZIEOEJZ.js} +1 -1
- package/dist/{chunk-PHMWH23E.js → chunk-QTRJLKR2.js} +1 -1
- package/dist/{chunk-QXKQPUOM.js → chunk-REFHJ2FN.js} +3 -3
- package/dist/{chunk-ZVC23LKV.js → chunk-RP76USJE.js} +1 -1
- package/dist/{chunk-3YCQM2RV.js → chunk-S3PEKX6H.js} +249 -45
- package/dist/{chunk-M7YRJX6V.js → chunk-T66OS7MN.js} +8 -3
- package/dist/{chunk-DGA7M77X.js → chunk-V2JF42SI.js} +2 -2
- package/dist/{chunk-Q7Y57KOK.js → chunk-WDDFU2N2.js} +2 -2
- package/dist/{chunk-A3GSNB4G.js → chunk-XBQFDBXE.js} +147 -13
- package/dist/{chunk-6TBLDBCL.js → chunk-ZFCZ7XXH.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 +344 -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 +344 -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 +411 -58
- package/dist/core/commands/text-commands.d.cts +13 -2
- package/dist/core/commands/text-commands.d.ts +13 -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 +7199 -4004
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +814 -120
- package/dist/io/docx-session.cjs +7 -2
- 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-DiY_ZgKl.d.cts → loader-B2H99237.d.cts} +3 -3
- package/dist/{loader-B-aL5HGD.d.ts → loader-DfTjqVwn.d.ts} +3 -3
- package/dist/{public-types-gvubspUI.d.cts → public-types-B5lOUIrP.d.ts} +930 -338
- package/dist/{public-types-DyqnxxO9.d.ts → public-types-S8gTYwKo.d.cts} +930 -338
- package/dist/public-types.cjs +837 -224
- 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 +1403 -438
- 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-CBDIOYXA.d.ts} +3 -3
- package/dist/{session-BUN6B-Vj.d.cts → session-CR2A1hGZ.d.cts} +3 -3
- package/dist/session.cjs +7 -2
- package/dist/session.d.cts +5 -5
- package/dist/session.d.ts +5 -5
- package/dist/session.js +5 -5
- package/dist/tailwind.cjs +905 -322
- package/dist/tailwind.d.cts +2 -2
- package/dist/tailwind.d.ts +2 -2
- package/dist/tailwind.js +7 -7
- package/dist/{types-VWH6CRvG.d.ts → types-B-90ywjU.d.ts} +2 -2
- package/dist/{types-C4bz3kDU.d.cts → types-yty2K-hk.d.cts} +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 +905 -322
- package/dist/ui-tailwind.d.cts +4 -3
- package/dist/ui-tailwind.d.ts +4 -3
- package/dist/ui-tailwind.js +7 -7
- package/package.json +1 -1
|
@@ -264,11 +264,14 @@ function collectEditableTargetRefs(doc, cache) {
|
|
|
264
264
|
collectEditableTargetsInBlocks(
|
|
265
265
|
context.blocks,
|
|
266
266
|
{
|
|
267
|
+
doc,
|
|
267
268
|
storyKey: context.storyKey,
|
|
268
269
|
basePath: context.basePath,
|
|
269
270
|
insideSdt: false,
|
|
270
271
|
insideTextBox: false,
|
|
271
|
-
tableDepth: 0
|
|
272
|
+
tableDepth: 0,
|
|
273
|
+
numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
|
|
274
|
+
numberingTargetRevisionHash: createNumberingTargetRevisionHash(doc)
|
|
272
275
|
},
|
|
273
276
|
targets,
|
|
274
277
|
cache
|
|
@@ -285,6 +288,7 @@ function buildBlockCacheSignature(context, blockIndex) {
|
|
|
285
288
|
const owner = tt?.editableOwnersByChildIndex?.get(blockIndex);
|
|
286
289
|
return [
|
|
287
290
|
context.storyKey,
|
|
291
|
+
context.numberingTargetRevisionHash,
|
|
288
292
|
context.insideSdt ? "1" : "0",
|
|
289
293
|
context.insideTextBox ? "1" : "0",
|
|
290
294
|
String(context.tableDepth),
|
|
@@ -330,7 +334,8 @@ function collectEditableTargetsInBlocks(blocks, context, targets, cache, blockIn
|
|
|
330
334
|
editableParagraphTargetPosture(targetKind),
|
|
331
335
|
context.contentControl,
|
|
332
336
|
context.tableTarget,
|
|
333
|
-
context.tableTarget?.editableOwnersByChildIndex?.get(blockIndex)
|
|
337
|
+
context.tableTarget?.editableOwnersByChildIndex?.get(blockIndex),
|
|
338
|
+
resolveEditableParagraphListIdentity(block, context)
|
|
334
339
|
)
|
|
335
340
|
);
|
|
336
341
|
}
|
|
@@ -859,7 +864,7 @@ function collectEditableTargetsInInlines(inlines, basePath, context, targets) {
|
|
|
859
864
|
}
|
|
860
865
|
}
|
|
861
866
|
}
|
|
862
|
-
function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, targetPosture = { editability: "editable", posture: { blockers: [] } }, contentControl, tableTarget, editableOwner) {
|
|
867
|
+
function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, targetPosture = { editability: "editable", posture: { blockers: [] } }, contentControl, tableTarget, editableOwner, listIdentity) {
|
|
863
868
|
const paragraphText = collectParagraphText(paragraph);
|
|
864
869
|
const paragraphTextHash = hashText(paragraphText);
|
|
865
870
|
const sourceRef = paragraph.sourceRef;
|
|
@@ -870,19 +875,39 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
|
|
|
870
875
|
context: { storyKey, insideSdt: contentControl !== void 0 },
|
|
871
876
|
...tableTarget
|
|
872
877
|
}) : void 0;
|
|
873
|
-
const listAddress =
|
|
878
|
+
const listAddress = listIdentity !== void 0 ? createCanonicalAddress({
|
|
874
879
|
addressKind: "list-item-text",
|
|
875
880
|
storyKey,
|
|
876
881
|
staleCheckKind: "paragraph",
|
|
877
882
|
operationScope: "list-text",
|
|
878
|
-
sourceRefs: [
|
|
883
|
+
sourceRefs: [
|
|
884
|
+
sourceRef,
|
|
885
|
+
listIdentity.paragraphNumberingSourceRef,
|
|
886
|
+
listIdentity.instanceSourceRef,
|
|
887
|
+
listIdentity.abstractSourceRef
|
|
888
|
+
],
|
|
879
889
|
staleHash: paragraphTextHash,
|
|
880
890
|
rangeBoundary: { boundaryKind: "list-item-text" },
|
|
891
|
+
list: {
|
|
892
|
+
numberingOrigin: listIdentity.numberingOrigin,
|
|
893
|
+
numberingInstanceId: listIdentity.numberingInstanceId,
|
|
894
|
+
...listIdentity.abstractNumberingId !== void 0 ? { abstractNumberingId: listIdentity.abstractNumberingId } : {},
|
|
895
|
+
level: listIdentity.level,
|
|
896
|
+
...listIdentity.overrideHash !== void 0 ? { overrideHash: listIdentity.overrideHash } : {},
|
|
897
|
+
numberingCatalogHash: listIdentity.numberingCatalogHash
|
|
898
|
+
},
|
|
881
899
|
discriminator: {
|
|
882
900
|
blockPath,
|
|
883
|
-
|
|
884
|
-
|
|
901
|
+
numberingOrigin: listIdentity.numberingOrigin,
|
|
902
|
+
numberingInstanceId: listIdentity.numberingInstanceId,
|
|
903
|
+
abstractNumberingId: listIdentity.abstractNumberingId ?? null,
|
|
904
|
+
level: listIdentity.level,
|
|
905
|
+
overrideHash: listIdentity.overrideHash ?? null,
|
|
906
|
+
numberingCatalogHash: listIdentity.numberingCatalogHash,
|
|
885
907
|
sourceId: sourceRef?.sourceId ?? null,
|
|
908
|
+
numberingSourceId: listIdentity.paragraphNumberingSourceRef?.sourceId ?? null,
|
|
909
|
+
numberingInstanceSourceId: listIdentity.instanceSourceRef?.sourceId ?? null,
|
|
910
|
+
abstractNumberingSourceId: listIdentity.abstractSourceRef?.sourceId ?? null,
|
|
886
911
|
paraId: paragraph.wordExtensionIds?.paraId ?? null,
|
|
887
912
|
textId: paragraph.wordExtensionIds?.textId ?? null
|
|
888
913
|
}
|
|
@@ -923,11 +948,62 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
|
|
|
923
948
|
blockType: "paragraph",
|
|
924
949
|
...paragraph.wordExtensionIds?.paraId !== void 0 ? { wordParaId: paragraph.wordExtensionIds.paraId } : {},
|
|
925
950
|
...paragraph.wordExtensionIds?.textId !== void 0 ? { wordTextId: paragraph.wordExtensionIds.textId } : {},
|
|
926
|
-
...sourceRef !== void 0 ? { sourceRef } : {}
|
|
951
|
+
...sourceRef !== void 0 ? { sourceRef } : {},
|
|
952
|
+
...listIdentity !== void 0 ? {
|
|
953
|
+
listNumberingOrigin: listIdentity.numberingOrigin,
|
|
954
|
+
listNumberingInstanceId: listIdentity.numberingInstanceId,
|
|
955
|
+
...listIdentity.abstractNumberingId !== void 0 ? { listAbstractNumberingId: listIdentity.abstractNumberingId } : {},
|
|
956
|
+
listLevel: listIdentity.level,
|
|
957
|
+
...listIdentity.overrideHash !== void 0 ? { listOverrideHash: listIdentity.overrideHash } : {},
|
|
958
|
+
numberingCatalogHash: listIdentity.numberingCatalogHash
|
|
959
|
+
} : {}
|
|
927
960
|
},
|
|
928
961
|
posture
|
|
929
962
|
};
|
|
930
963
|
}
|
|
964
|
+
function resolveEditableParagraphListIdentity(paragraph, context) {
|
|
965
|
+
const directNumbering = paragraph.numbering;
|
|
966
|
+
const styleNumbering = directNumbering === void 0 && paragraph.styleId !== void 0 ? resolveParagraphStyleNumbering(context.doc, paragraph.styleId) : void 0;
|
|
967
|
+
const numbering = directNumbering ?? styleNumbering;
|
|
968
|
+
if (numbering === void 0) return void 0;
|
|
969
|
+
const numberingCatalog = context.doc.numbering ?? { abstractDefinitions: {}, instances: {} };
|
|
970
|
+
const instances = numberingCatalog.instances ?? {};
|
|
971
|
+
const abstractDefinitions = numberingCatalog.abstractDefinitions ?? {};
|
|
972
|
+
const instance = instances[numbering.numberingInstanceId];
|
|
973
|
+
const abstractDefinition = instance !== void 0 ? abstractDefinitions[instance.abstractNumberingId] : void 0;
|
|
974
|
+
const level = numbering.level ?? 0;
|
|
975
|
+
const override = instance?.overrides.find((entry) => entry.level === level);
|
|
976
|
+
const overrideHash = override !== void 0 ? hashText(JSON.stringify(numberingOverrideDiscriminator(override))) : void 0;
|
|
977
|
+
return {
|
|
978
|
+
numberingOrigin: directNumbering !== void 0 ? "paragraph" : "paragraph-style",
|
|
979
|
+
numberingInstanceId: numbering.numberingInstanceId,
|
|
980
|
+
...instance?.abstractNumberingId !== void 0 ? { abstractNumberingId: instance.abstractNumberingId } : {},
|
|
981
|
+
level,
|
|
982
|
+
...overrideHash !== void 0 ? { overrideHash } : {},
|
|
983
|
+
numberingCatalogHash: context.numberingCatalogHash,
|
|
984
|
+
...directNumbering?.sourceRef !== void 0 ? { paragraphNumberingSourceRef: directNumbering.sourceRef } : {},
|
|
985
|
+
...instance?.sourceRef !== void 0 ? { instanceSourceRef: instance.sourceRef } : {},
|
|
986
|
+
...abstractDefinition?.sourceRef !== void 0 ? { abstractSourceRef: abstractDefinition.sourceRef } : {}
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
function numberingOverrideDiscriminator(override) {
|
|
990
|
+
return {
|
|
991
|
+
level: override.level,
|
|
992
|
+
startAt: override.startAt ?? null,
|
|
993
|
+
sourceId: override.sourceRef?.sourceId ?? null,
|
|
994
|
+
levelDefinition: override.levelDefinition === void 0 ? null : {
|
|
995
|
+
sourceId: override.levelDefinition.sourceRef?.sourceId ?? null,
|
|
996
|
+
format: override.levelDefinition.format ?? null,
|
|
997
|
+
text: override.levelDefinition.text ?? null,
|
|
998
|
+
startAt: override.levelDefinition.startAt ?? null,
|
|
999
|
+
paragraphStyleId: override.levelDefinition.paragraphStyleId ?? null,
|
|
1000
|
+
isLegalNumbering: override.levelDefinition.isLegalNumbering ?? null,
|
|
1001
|
+
suffix: override.levelDefinition.suffix ?? null,
|
|
1002
|
+
restartAfterLevel: override.levelDefinition.restartAfterLevel ?? null,
|
|
1003
|
+
picBulletId: override.levelDefinition.picBulletId ?? null
|
|
1004
|
+
}
|
|
1005
|
+
};
|
|
1006
|
+
}
|
|
931
1007
|
function contentControlLocksContent(contentControl) {
|
|
932
1008
|
return contentControl?.lock !== void 0 && contentControl.lock !== "unlocked" && contentControl.lock !== "none";
|
|
933
1009
|
}
|
|
@@ -1696,6 +1772,7 @@ function createCanonicalAddress(input) {
|
|
|
1696
1772
|
...input.rowRange !== void 0 ? { rowRange: input.rowRange } : {},
|
|
1697
1773
|
...input.columnRange !== void 0 ? { columnRange: input.columnRange } : {},
|
|
1698
1774
|
...sourceHash !== void 0 ? { sourceJoinHash: sourceHash } : {},
|
|
1775
|
+
...input.list !== void 0 ? { list: input.list } : {},
|
|
1699
1776
|
...input.secondaryStory === true ? { secondaryStory: true } : {},
|
|
1700
1777
|
...input.nestedTable === true ? { nestedTable: true } : {},
|
|
1701
1778
|
...input.insideSdt === true ? { insideSdt: true } : {},
|
|
@@ -1730,6 +1807,119 @@ function sourceJoinHash(refs) {
|
|
|
1730
1807
|
if (sourceIds.length === 0) return void 0;
|
|
1731
1808
|
return hashText(sourceIds.join("\0"));
|
|
1732
1809
|
}
|
|
1810
|
+
var numberingCatalogHashCache = /* @__PURE__ */ new WeakMap();
|
|
1811
|
+
var numberingTargetHashCache = /* @__PURE__ */ new WeakMap();
|
|
1812
|
+
function createNumberingCatalogRevisionHash(doc) {
|
|
1813
|
+
const numbering = doc.numbering;
|
|
1814
|
+
if (numbering !== void 0) {
|
|
1815
|
+
const cached = numberingCatalogHashCache.get(numbering);
|
|
1816
|
+
if (cached !== void 0) return cached;
|
|
1817
|
+
const fresh = computeNumberingCatalogRevisionHash(doc);
|
|
1818
|
+
numberingCatalogHashCache.set(numbering, fresh);
|
|
1819
|
+
return fresh;
|
|
1820
|
+
}
|
|
1821
|
+
return computeNumberingCatalogRevisionHash(doc);
|
|
1822
|
+
}
|
|
1823
|
+
function computeNumberingCatalogRevisionHash(doc) {
|
|
1824
|
+
const catalog = doc.numbering ?? { abstractDefinitions: {}, instances: {} };
|
|
1825
|
+
const abstractDefinitions = catalog.abstractDefinitions ?? {};
|
|
1826
|
+
const instances = catalog.instances ?? {};
|
|
1827
|
+
const numPicBullets = catalog.numPicBullets ?? {};
|
|
1828
|
+
return hashText(JSON.stringify({
|
|
1829
|
+
abstractDefinitions: Object.keys(abstractDefinitions).sort().map((abstractNumberingId) => {
|
|
1830
|
+
const definition = abstractDefinitions[abstractNumberingId];
|
|
1831
|
+
return {
|
|
1832
|
+
abstractNumberingId,
|
|
1833
|
+
sourceId: definition.sourceRef?.sourceId ?? null,
|
|
1834
|
+
nsid: definition.nsid ?? null,
|
|
1835
|
+
tplc: definition.tplc ?? null,
|
|
1836
|
+
styleLink: definition.styleLink ?? null,
|
|
1837
|
+
numStyleLink: definition.numStyleLink ?? null,
|
|
1838
|
+
levels: definition.levels.map((level) => ({
|
|
1839
|
+
sourceId: level.sourceRef?.sourceId ?? null,
|
|
1840
|
+
level: level.level,
|
|
1841
|
+
format: level.format,
|
|
1842
|
+
text: level.text,
|
|
1843
|
+
startAt: level.startAt ?? null,
|
|
1844
|
+
paragraphStyleId: level.paragraphStyleId ?? null,
|
|
1845
|
+
isLegalNumbering: level.isLegalNumbering ?? null,
|
|
1846
|
+
suffix: level.suffix ?? null,
|
|
1847
|
+
restartAfterLevel: level.restartAfterLevel ?? null,
|
|
1848
|
+
picBulletId: level.picBulletId ?? null
|
|
1849
|
+
}))
|
|
1850
|
+
};
|
|
1851
|
+
}),
|
|
1852
|
+
instances: Object.keys(instances).sort().map((numberingInstanceId) => {
|
|
1853
|
+
const instance = instances[numberingInstanceId];
|
|
1854
|
+
return {
|
|
1855
|
+
numberingInstanceId,
|
|
1856
|
+
sourceId: instance.sourceRef?.sourceId ?? null,
|
|
1857
|
+
abstractNumberingId: instance.abstractNumberingId,
|
|
1858
|
+
overrides: instance.overrides.map(numberingOverrideDiscriminator)
|
|
1859
|
+
};
|
|
1860
|
+
}),
|
|
1861
|
+
numPicBullets: Object.keys(numPicBullets).sort().map((numPicBulletId) => {
|
|
1862
|
+
const picBullet = numPicBullets[numPicBulletId];
|
|
1863
|
+
return {
|
|
1864
|
+
numPicBulletId,
|
|
1865
|
+
sourceId: picBullet.sourceRef?.sourceId ?? null,
|
|
1866
|
+
mediaId: picBullet.mediaId ?? null,
|
|
1867
|
+
widthEmu: picBullet.widthEmu ?? null,
|
|
1868
|
+
heightEmu: picBullet.heightEmu ?? null
|
|
1869
|
+
};
|
|
1870
|
+
})
|
|
1871
|
+
}));
|
|
1872
|
+
}
|
|
1873
|
+
function createNumberingTargetRevisionHash(doc) {
|
|
1874
|
+
const numbering = doc.numbering;
|
|
1875
|
+
const styles = doc.styles;
|
|
1876
|
+
if (numbering !== void 0 && styles !== void 0) {
|
|
1877
|
+
let inner = numberingTargetHashCache.get(numbering);
|
|
1878
|
+
if (inner === void 0) {
|
|
1879
|
+
inner = /* @__PURE__ */ new WeakMap();
|
|
1880
|
+
numberingTargetHashCache.set(numbering, inner);
|
|
1881
|
+
}
|
|
1882
|
+
const cached = inner.get(styles);
|
|
1883
|
+
if (cached !== void 0) return cached;
|
|
1884
|
+
const fresh = computeNumberingTargetRevisionHash(doc);
|
|
1885
|
+
inner.set(styles, fresh);
|
|
1886
|
+
return fresh;
|
|
1887
|
+
}
|
|
1888
|
+
return computeNumberingTargetRevisionHash(doc);
|
|
1889
|
+
}
|
|
1890
|
+
function computeNumberingTargetRevisionHash(doc) {
|
|
1891
|
+
const paragraphStyles = doc.styles?.paragraphs ?? {};
|
|
1892
|
+
return hashText(JSON.stringify({
|
|
1893
|
+
// Reuses the memoized catalog hash on the hot path so a typing edit
|
|
1894
|
+
// pays for the catalog hash at most once across both helpers.
|
|
1895
|
+
numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
|
|
1896
|
+
paragraphStyleNumbering: Object.keys(paragraphStyles).sort().map((styleId) => {
|
|
1897
|
+
const style = paragraphStyles[styleId];
|
|
1898
|
+
return {
|
|
1899
|
+
styleId,
|
|
1900
|
+
basedOn: style.basedOn ?? null,
|
|
1901
|
+
numberingInstanceId: style.numbering?.numberingInstanceId ?? null,
|
|
1902
|
+
level: style.numbering?.level ?? null
|
|
1903
|
+
};
|
|
1904
|
+
})
|
|
1905
|
+
}));
|
|
1906
|
+
}
|
|
1907
|
+
function resolveParagraphStyleNumbering(doc, styleId) {
|
|
1908
|
+
const visited = /* @__PURE__ */ new Set();
|
|
1909
|
+
let currentStyleId = styleId;
|
|
1910
|
+
while (currentStyleId !== void 0 && !visited.has(currentStyleId)) {
|
|
1911
|
+
visited.add(currentStyleId);
|
|
1912
|
+
const style = doc.styles?.paragraphs?.[currentStyleId];
|
|
1913
|
+
if (style === void 0) {
|
|
1914
|
+
return void 0;
|
|
1915
|
+
}
|
|
1916
|
+
if (style.numbering !== void 0) {
|
|
1917
|
+
return style.numbering;
|
|
1918
|
+
}
|
|
1919
|
+
currentStyleId = style.basedOn;
|
|
1920
|
+
}
|
|
1921
|
+
return void 0;
|
|
1922
|
+
}
|
|
1733
1923
|
function collectCanonicalFieldRegionIdentities(doc) {
|
|
1734
1924
|
const registry = doc.fieldRegistry;
|
|
1735
1925
|
const byFieldIndex = new Map(
|
|
@@ -3336,6 +3526,10 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
3336
3526
|
])
|
|
3337
3527
|
) : resolved.effectiveLevels;
|
|
3338
3528
|
const picBulletId = resolved.effectiveLevel.picBulletId;
|
|
3529
|
+
const pictureBulletPosture = resolvePictureBulletRenderPosture(
|
|
3530
|
+
picBulletId,
|
|
3531
|
+
picBulletId != null ? catalog.numPicBullets?.[picBulletId] : void 0
|
|
3532
|
+
);
|
|
3339
3533
|
const text = renderLevelText(
|
|
3340
3534
|
resolved.effectiveLevel.text,
|
|
3341
3535
|
workingState.counters,
|
|
@@ -3344,14 +3538,20 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
3344
3538
|
if (picBulletId == null && resolved.effectiveLevel.format !== "none" && text === null) {
|
|
3345
3539
|
return null;
|
|
3346
3540
|
}
|
|
3347
|
-
const visibleText = resolved.effectiveLevel.format === "none" ? null : text;
|
|
3541
|
+
const visibleText = resolved.effectiveLevel.format === "none" ? null : text ?? pictureBulletPosture?.fallbackGlyph ?? null;
|
|
3542
|
+
const normalizedMarkerText = normalizeMarkerText(
|
|
3543
|
+
visibleText,
|
|
3544
|
+
resolved.effectiveLevel.format,
|
|
3545
|
+
resolved.geometry.markerRunProperties
|
|
3546
|
+
);
|
|
3348
3547
|
const formatPosture = getNumberingFormatPosture(
|
|
3349
3548
|
resolved.effectiveLevel.format,
|
|
3350
3549
|
currentCounter
|
|
3351
3550
|
);
|
|
3352
|
-
const picBulletMediaId =
|
|
3551
|
+
const picBulletMediaId = pictureBulletPosture?.mediaId;
|
|
3353
3552
|
return {
|
|
3354
|
-
text:
|
|
3553
|
+
text: normalizedMarkerText.text,
|
|
3554
|
+
...normalizedMarkerText.posture !== void 0 ? { markerTextPosture: normalizedMarkerText.posture } : {},
|
|
3355
3555
|
level: resolved.effectiveLevel.level,
|
|
3356
3556
|
format: resolved.effectiveLevel.format,
|
|
3357
3557
|
...formatPosture !== void 0 ? { formatPosture } : {},
|
|
@@ -3361,7 +3561,9 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
3361
3561
|
...resolved.effectiveLevel.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
3362
3562
|
...resolved.geometry.markerRunProperties ? { markerRunProperties: resolved.geometry.markerRunProperties } : {},
|
|
3363
3563
|
geometry: resolved.geometry,
|
|
3364
|
-
...
|
|
3564
|
+
...picBulletId != null ? { picBulletId } : {},
|
|
3565
|
+
...picBulletMediaId != null ? { picBulletMediaId } : {},
|
|
3566
|
+
...pictureBulletPosture !== void 0 ? { pictureBulletPosture } : {}
|
|
3365
3567
|
};
|
|
3366
3568
|
}
|
|
3367
3569
|
return {
|
|
@@ -3377,6 +3579,69 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
3377
3579
|
}
|
|
3378
3580
|
};
|
|
3379
3581
|
}
|
|
3582
|
+
function normalizeMarkerText(text, format, markerRunProperties) {
|
|
3583
|
+
if (text === null || format !== "bullet") {
|
|
3584
|
+
return { text };
|
|
3585
|
+
}
|
|
3586
|
+
const fontFamily = getMarkerFontFamily(markerRunProperties);
|
|
3587
|
+
if (!isKnownSymbolBulletFont(fontFamily)) {
|
|
3588
|
+
return { text };
|
|
3589
|
+
}
|
|
3590
|
+
const renderedText = Array.from(text, (char) => SYMBOL_BULLET_GLYPH_MAP.get(char) ?? char).join("");
|
|
3591
|
+
if (renderedText === text) {
|
|
3592
|
+
return { text };
|
|
3593
|
+
}
|
|
3594
|
+
return {
|
|
3595
|
+
text: renderedText,
|
|
3596
|
+
posture: {
|
|
3597
|
+
status: "normalized",
|
|
3598
|
+
sourceText: text,
|
|
3599
|
+
renderedText,
|
|
3600
|
+
reason: "symbol-font-bullet-normalized",
|
|
3601
|
+
...fontFamily ? { fontFamily } : {}
|
|
3602
|
+
}
|
|
3603
|
+
};
|
|
3604
|
+
}
|
|
3605
|
+
function getMarkerFontFamily(markerRunProperties) {
|
|
3606
|
+
return markerRunProperties?.fontFamilyAscii ?? markerRunProperties?.fontFamilyHAnsi ?? markerRunProperties?.fontFamilyEastAsia ?? markerRunProperties?.fontFamilyCs ?? markerRunProperties?.fontFamily;
|
|
3607
|
+
}
|
|
3608
|
+
function isKnownSymbolBulletFont(fontFamily) {
|
|
3609
|
+
return fontFamily !== void 0 && /^(?:symbol|wingdings|wingdings 2|wingdings 3|webdings)$/iu.test(
|
|
3610
|
+
fontFamily.trim()
|
|
3611
|
+
);
|
|
3612
|
+
}
|
|
3613
|
+
var SYMBOL_BULLET_GLYPH_MAP = /* @__PURE__ */ new Map([
|
|
3614
|
+
["\uF0B7", "\u2022"],
|
|
3615
|
+
["\uF0A7", "\u25AA"],
|
|
3616
|
+
["\uF0FC", "\u2713"]
|
|
3617
|
+
]);
|
|
3618
|
+
function resolvePictureBulletRenderPosture(picBulletId, picBullet) {
|
|
3619
|
+
if (picBulletId == null) return void 0;
|
|
3620
|
+
if (!picBullet) {
|
|
3621
|
+
return {
|
|
3622
|
+
status: "preserve-only",
|
|
3623
|
+
picBulletId,
|
|
3624
|
+
fallbackGlyph: "\u2022",
|
|
3625
|
+
reason: "picture-bullet-catalog-entry-missing"
|
|
3626
|
+
};
|
|
3627
|
+
}
|
|
3628
|
+
if (picBullet.mediaId) {
|
|
3629
|
+
return {
|
|
3630
|
+
status: "media-rendered",
|
|
3631
|
+
picBulletId,
|
|
3632
|
+
mediaId: picBullet.mediaId,
|
|
3633
|
+
...picBullet.sourceRef ? { sourceRef: picBullet.sourceRef } : {},
|
|
3634
|
+
reason: "picture-bullet-media-rendered"
|
|
3635
|
+
};
|
|
3636
|
+
}
|
|
3637
|
+
return {
|
|
3638
|
+
status: "glyph-fallback",
|
|
3639
|
+
picBulletId,
|
|
3640
|
+
fallbackGlyph: "\u2022",
|
|
3641
|
+
...picBullet.sourceRef ? { sourceRef: picBullet.sourceRef } : {},
|
|
3642
|
+
reason: "picture-bullet-media-unavailable"
|
|
3643
|
+
};
|
|
3644
|
+
}
|
|
3380
3645
|
function getSequenceState(states, numberingInstanceId, options = { create: true }) {
|
|
3381
3646
|
const existing = states.get(numberingInstanceId);
|
|
3382
3647
|
if (existing) {
|
|
@@ -3439,7 +3704,7 @@ function getNumberingFormatPosture(format, value) {
|
|
|
3439
3704
|
reason: registryEntry?.fallbackReason ?? "unsupported-numbering-format-decimal-fallback"
|
|
3440
3705
|
};
|
|
3441
3706
|
}
|
|
3442
|
-
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)) {
|
|
3707
|
+
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)) {
|
|
3443
3708
|
return {
|
|
3444
3709
|
status: "approximated",
|
|
3445
3710
|
requestedFormat: format,
|
|
@@ -3533,6 +3798,37 @@ var exactNumberingFormatEntries = [
|
|
|
3533
3798
|
supportsMutation: true,
|
|
3534
3799
|
render: toOrdinal2
|
|
3535
3800
|
},
|
|
3801
|
+
{
|
|
3802
|
+
format: "decimalFullWidth",
|
|
3803
|
+
renderSupport: "supported",
|
|
3804
|
+
renderedFormat: "decimalFullWidth",
|
|
3805
|
+
supportsMutation: false,
|
|
3806
|
+
render: toFullWidthDecimal
|
|
3807
|
+
},
|
|
3808
|
+
{
|
|
3809
|
+
format: "decimalEnclosedCircle",
|
|
3810
|
+
renderSupport: "supported",
|
|
3811
|
+
renderedFormat: "decimalEnclosedCircle",
|
|
3812
|
+
supportsMutation: false,
|
|
3813
|
+
render: toCircledDecimal,
|
|
3814
|
+
isInRange: (value) => Number.isInteger(value) && value >= 0 && value <= 50
|
|
3815
|
+
},
|
|
3816
|
+
{
|
|
3817
|
+
format: "decimalEnclosedParen",
|
|
3818
|
+
renderSupport: "supported",
|
|
3819
|
+
renderedFormat: "decimalEnclosedParen",
|
|
3820
|
+
supportsMutation: false,
|
|
3821
|
+
render: (value) => Number.isInteger(value) && value > 0 ? `(${value})` : String(value),
|
|
3822
|
+
isInRange: (value) => Number.isInteger(value) && value > 0
|
|
3823
|
+
},
|
|
3824
|
+
{
|
|
3825
|
+
format: "decimalEnclosedFullstop",
|
|
3826
|
+
renderSupport: "supported",
|
|
3827
|
+
renderedFormat: "decimalEnclosedFullstop",
|
|
3828
|
+
supportsMutation: false,
|
|
3829
|
+
render: (value) => Number.isInteger(value) && value > 0 ? `${value}.` : String(value),
|
|
3830
|
+
isInRange: (value) => Number.isInteger(value) && value > 0
|
|
3831
|
+
},
|
|
3536
3832
|
{
|
|
3537
3833
|
format: "cardinalText",
|
|
3538
3834
|
renderSupport: "supported",
|
|
@@ -3570,10 +3866,6 @@ var exactNumberingFormatEntries = [
|
|
|
3570
3866
|
}
|
|
3571
3867
|
];
|
|
3572
3868
|
var approximatedDecimalFormats = [
|
|
3573
|
-
"decimalEnclosedCircle",
|
|
3574
|
-
"decimalEnclosedFullstop",
|
|
3575
|
-
"decimalEnclosedParen",
|
|
3576
|
-
"decimalFullWidth",
|
|
3577
3869
|
"decimalHalfWidth",
|
|
3578
3870
|
"aiueo",
|
|
3579
3871
|
"iroha",
|
|
@@ -3625,6 +3917,30 @@ function toOrdinal2(value) {
|
|
|
3625
3917
|
return `${value}th`;
|
|
3626
3918
|
}
|
|
3627
3919
|
}
|
|
3920
|
+
function toFullWidthDecimal(value) {
|
|
3921
|
+
return String(value).replace(
|
|
3922
|
+
/[0-9]/g,
|
|
3923
|
+
(digit) => String.fromCharCode(65296 + Number.parseInt(digit, 10))
|
|
3924
|
+
);
|
|
3925
|
+
}
|
|
3926
|
+
var CIRCLED_DECIMAL_BY_VALUE = new Map([
|
|
3927
|
+
[0, "\u24EA"],
|
|
3928
|
+
...Array.from({ length: 20 }, (_, index) => [
|
|
3929
|
+
index + 1,
|
|
3930
|
+
String.fromCodePoint(9312 + index)
|
|
3931
|
+
]),
|
|
3932
|
+
...Array.from({ length: 15 }, (_, index) => [
|
|
3933
|
+
index + 21,
|
|
3934
|
+
String.fromCodePoint(12881 + index)
|
|
3935
|
+
]),
|
|
3936
|
+
...Array.from({ length: 15 }, (_, index) => [
|
|
3937
|
+
index + 36,
|
|
3938
|
+
String.fromCodePoint(12977 + index)
|
|
3939
|
+
])
|
|
3940
|
+
]);
|
|
3941
|
+
function toCircledDecimal(value) {
|
|
3942
|
+
return CIRCLED_DECIMAL_BY_VALUE.get(value) ?? String(value);
|
|
3943
|
+
}
|
|
3628
3944
|
function toAlphabetic2(value) {
|
|
3629
3945
|
if (value <= 0) {
|
|
3630
3946
|
return String(value);
|
|
@@ -4398,6 +4714,7 @@ function toNumberingLayoutInput(numbering) {
|
|
|
4398
4714
|
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);
|
|
4399
4715
|
return {
|
|
4400
4716
|
markerText: numbering.text,
|
|
4717
|
+
...numbering.markerTextPosture ? { markerTextPosture: { ...numbering.markerTextPosture } } : {},
|
|
4401
4718
|
...numbering.markerRunProperties ? { markerRunFormatting: numbering.markerRunProperties } : {},
|
|
4402
4719
|
markerSuffix: normalizeNumberingMarkerSuffix(numbering.suffix),
|
|
4403
4720
|
...markerLane ? { markerLaneStartTwips: markerLane.start } : {},
|
|
@@ -4410,7 +4727,9 @@ function toNumberingLayoutInput(numbering) {
|
|
|
4410
4727
|
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
4411
4728
|
startAt: numbering.startAt,
|
|
4412
4729
|
...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
4413
|
-
...numbering.
|
|
4730
|
+
...numbering.picBulletId ? { pictureBulletId: numbering.picBulletId } : {},
|
|
4731
|
+
...numbering.picBulletMediaId ? { pictureBulletMediaId: numbering.picBulletMediaId } : {},
|
|
4732
|
+
...numbering.pictureBulletPosture ? { pictureBulletPosture: { ...numbering.pictureBulletPosture } } : {}
|
|
4414
4733
|
};
|
|
4415
4734
|
}
|
|
4416
4735
|
function toFieldLayoutInput(entry, resolved, region) {
|
|
@@ -4922,6 +5241,7 @@ function buildEffectiveNumbering(detail) {
|
|
|
4922
5241
|
const result = {
|
|
4923
5242
|
level: detail.level,
|
|
4924
5243
|
...detail.text !== null ? { marker: detail.text } : {},
|
|
5244
|
+
...detail.markerTextPosture ? { markerTextPosture: { ...detail.markerTextPosture } } : {},
|
|
4925
5245
|
...detail.markerRunProperties ? { markerRunFormatting: detail.markerRunProperties } : {},
|
|
4926
5246
|
...detail.geometry ? {
|
|
4927
5247
|
indentation: {
|
|
@@ -4931,7 +5251,8 @@ function buildEffectiveNumbering(detail) {
|
|
|
4931
5251
|
...detail.geometry.tabStops && detail.geometry.tabStops.length > 0 ? { tab: detail.geometry.tabStops[0].position } : {}
|
|
4932
5252
|
}
|
|
4933
5253
|
} : {},
|
|
4934
|
-
...detail.picBulletMediaId ? { pictureBulletRef: detail.picBulletMediaId } : {}
|
|
5254
|
+
...detail.picBulletMediaId ? { pictureBulletRef: detail.picBulletMediaId } : {},
|
|
5255
|
+
...detail.pictureBulletPosture ? { pictureBulletPosture: { ...detail.pictureBulletPosture } } : {}
|
|
4935
5256
|
};
|
|
4936
5257
|
return result;
|
|
4937
5258
|
}
|
|
@@ -6847,6 +7168,7 @@ function toSurfaceResolvedNumbering(numbering) {
|
|
|
6847
7168
|
format: numbering.format,
|
|
6848
7169
|
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
6849
7170
|
...numbering.text !== null ? { text: numbering.text } : {},
|
|
7171
|
+
...numbering.markerTextPosture !== void 0 ? { markerTextPosture: { ...numbering.markerTextPosture } } : {},
|
|
6850
7172
|
startAt: numbering.startAt,
|
|
6851
7173
|
...numbering.paragraphStyleId ? { paragraphStyleId: numbering.paragraphStyleId } : {},
|
|
6852
7174
|
...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
@@ -6859,7 +7181,9 @@ function toSurfaceResolvedNumbering(numbering) {
|
|
|
6859
7181
|
...numbering.geometry.markerLane ? { markerLane: { ...numbering.geometry.markerLane } } : {},
|
|
6860
7182
|
...numbering.geometry.textColumn ? { textColumn: { ...numbering.geometry.textColumn } } : {}
|
|
6861
7183
|
},
|
|
6862
|
-
...numbering.
|
|
7184
|
+
...numbering.picBulletId ? { picBulletId: numbering.picBulletId } : {},
|
|
7185
|
+
...numbering.picBulletMediaId ? { picBulletMediaId: numbering.picBulletMediaId } : {},
|
|
7186
|
+
...numbering.pictureBulletPosture ? { pictureBulletPosture: { ...numbering.pictureBulletPosture } } : {}
|
|
6863
7187
|
};
|
|
6864
7188
|
}
|
|
6865
7189
|
function describePreservedInlinePreview(payloadReference) {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../../canonical-document-
|
|
1
|
+
export { gz as CellLocator, gA as TableStructureOperation, gB as applyTableStructureOperation, gC as applyTableStructureOperationForEditableTarget, gD as getTableStructureContext, gE as removeCellFromRow, gF as removeTableRowPure, gG as tableStructureActionHandleForTarget } from '../../public-types-S8gTYwKo.cjs';
|
|
2
|
+
import '../../canonical-document-CfZIc-fC.cjs';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export {
|
|
2
|
-
import '../../canonical-document-
|
|
1
|
+
export { gz as CellLocator, gA as TableStructureOperation, gB as applyTableStructureOperation, gC as applyTableStructureOperationForEditableTarget, gD as getTableStructureContext, gE as removeCellFromRow, gF as removeTableRowPure, gG as tableStructureActionHandleForTarget } from '../../public-types-B5lOUIrP.js';
|
|
2
|
+
import '../../canonical-document-CfZIc-fC.js';
|
|
3
3
|
import 'react';
|
|
4
4
|
import 'yjs';
|
|
5
5
|
import 'y-protocols/awareness';
|
|
@@ -5,11 +5,11 @@ import {
|
|
|
5
5
|
removeCellFromRow,
|
|
6
6
|
removeTableRowPure,
|
|
7
7
|
tableStructureActionHandleForTarget
|
|
8
|
-
} from "../../chunk-
|
|
9
|
-
import "../../chunk-
|
|
10
|
-
import "../../chunk-
|
|
8
|
+
} from "../../chunk-WDDFU2N2.js";
|
|
9
|
+
import "../../chunk-QTRJLKR2.js";
|
|
10
|
+
import "../../chunk-XBQFDBXE.js";
|
|
11
11
|
import "../../chunk-OYGMRRR7.js";
|
|
12
|
-
import "../../chunk-
|
|
12
|
+
import "../../chunk-5KTJKTNE.js";
|
|
13
13
|
import "../../chunk-UFVDIR2C.js";
|
|
14
14
|
import "../../chunk-PGGPPZ65.js";
|
|
15
15
|
import "../../chunk-DNXYUIIS.js";
|