@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.
Files changed (100) hide show
  1. package/dist/api/public-types.cjs +837 -224
  2. package/dist/api/public-types.d.cts +2 -2
  3. package/dist/api/public-types.d.ts +2 -2
  4. package/dist/api/public-types.js +5 -3
  5. package/dist/api/v3.cjs +9679 -7492
  6. package/dist/api/v3.d.cts +3 -3
  7. package/dist/api/v3.d.ts +3 -3
  8. package/dist/api/v3.js +10 -10
  9. package/dist/{canonical-document-BMtONpgf.d.cts → canonical-document-CfZIc-fC.d.cts} +1 -1
  10. package/dist/{canonical-document-BMtONpgf.d.ts → canonical-document-CfZIc-fC.d.ts} +1 -1
  11. package/dist/{chunk-7G5GR3VV.js → chunk-224TSMEB.js} +635 -89
  12. package/dist/{chunk-YLL7MF5C.js → chunk-3JEE5RJU.js} +103 -135
  13. package/dist/{chunk-35RHOE6I.js → chunk-57HTKX3P.js} +10 -1162
  14. package/dist/{chunk-A66ZVUAT.js → chunk-5KTJKTNE.js} +236 -10
  15. package/dist/{chunk-THVM6EP5.js → chunk-CVSD3UNK.js} +1322 -102
  16. package/dist/{chunk-VRKK2CSZ.js → chunk-EFEW7BTT.js} +2 -2
  17. package/dist/{chunk-KNHMXKC6.js → chunk-INLRCC4N.js} +2 -2
  18. package/dist/{chunk-HYHCRMR7.js → chunk-KL4TZSZV.js} +1 -1
  19. package/dist/{chunk-T5YYFDZB.js → chunk-MQ5GAJ54.js} +68 -39
  20. package/dist/{chunk-CI2TD3T4.js → chunk-NJFKPDNG.js} +216 -2
  21. package/dist/{chunk-WZDKNF37.js → chunk-OTRVGNZQ.js} +2934 -1815
  22. package/dist/{chunk-4YCWECLZ.js → chunk-PZIEOEJZ.js} +1 -1
  23. package/dist/{chunk-PHMWH23E.js → chunk-QTRJLKR2.js} +1 -1
  24. package/dist/{chunk-QXKQPUOM.js → chunk-REFHJ2FN.js} +3 -3
  25. package/dist/{chunk-ZVC23LKV.js → chunk-RP76USJE.js} +1 -1
  26. package/dist/{chunk-3YCQM2RV.js → chunk-S3PEKX6H.js} +249 -45
  27. package/dist/{chunk-M7YRJX6V.js → chunk-T66OS7MN.js} +8 -3
  28. package/dist/{chunk-DGA7M77X.js → chunk-V2JF42SI.js} +2 -2
  29. package/dist/{chunk-Q7Y57KOK.js → chunk-WDDFU2N2.js} +2 -2
  30. package/dist/{chunk-A3GSNB4G.js → chunk-XBQFDBXE.js} +147 -13
  31. package/dist/{chunk-6TBLDBCL.js → chunk-ZFCZ7XXH.js} +1 -1
  32. package/dist/compare.d.cts +1 -1
  33. package/dist/compare.d.ts +1 -1
  34. package/dist/core/commands/formatting-commands.d.cts +2 -2
  35. package/dist/core/commands/formatting-commands.d.ts +2 -2
  36. package/dist/core/commands/image-commands.cjs +344 -20
  37. package/dist/core/commands/image-commands.d.cts +2 -2
  38. package/dist/core/commands/image-commands.d.ts +2 -2
  39. package/dist/core/commands/image-commands.js +5 -5
  40. package/dist/core/commands/section-layout-commands.d.cts +2 -2
  41. package/dist/core/commands/section-layout-commands.d.ts +2 -2
  42. package/dist/core/commands/style-commands.d.cts +2 -2
  43. package/dist/core/commands/style-commands.d.ts +2 -2
  44. package/dist/core/commands/table-structure-commands.cjs +344 -20
  45. package/dist/core/commands/table-structure-commands.d.cts +2 -2
  46. package/dist/core/commands/table-structure-commands.d.ts +2 -2
  47. package/dist/core/commands/table-structure-commands.js +4 -4
  48. package/dist/core/commands/text-commands.cjs +411 -58
  49. package/dist/core/commands/text-commands.d.cts +13 -2
  50. package/dist/core/commands/text-commands.d.ts +13 -2
  51. package/dist/core/commands/text-commands.js +5 -5
  52. package/dist/core/selection/mapping.d.cts +2 -2
  53. package/dist/core/selection/mapping.d.ts +2 -2
  54. package/dist/core/state/editor-state.d.cts +2 -2
  55. package/dist/core/state/editor-state.d.ts +2 -2
  56. package/dist/index.cjs +7199 -4004
  57. package/dist/index.d.cts +5 -5
  58. package/dist/index.d.ts +5 -5
  59. package/dist/index.js +814 -120
  60. package/dist/io/docx-session.cjs +7 -2
  61. package/dist/io/docx-session.d.cts +4 -4
  62. package/dist/io/docx-session.d.ts +4 -4
  63. package/dist/io/docx-session.js +4 -4
  64. package/dist/legal.d.cts +1 -1
  65. package/dist/legal.d.ts +1 -1
  66. package/dist/legal.js +3 -3
  67. package/dist/{loader-DiY_ZgKl.d.cts → loader-B2H99237.d.cts} +3 -3
  68. package/dist/{loader-B-aL5HGD.d.ts → loader-DfTjqVwn.d.ts} +3 -3
  69. package/dist/{public-types-gvubspUI.d.cts → public-types-B5lOUIrP.d.ts} +930 -338
  70. package/dist/{public-types-DyqnxxO9.d.ts → public-types-S8gTYwKo.d.cts} +930 -338
  71. package/dist/public-types.cjs +837 -224
  72. package/dist/public-types.d.cts +2 -2
  73. package/dist/public-types.d.ts +2 -2
  74. package/dist/public-types.js +5 -3
  75. package/dist/runtime/collab.d.cts +3 -3
  76. package/dist/runtime/collab.d.ts +3 -3
  77. package/dist/runtime/document-runtime.cjs +1403 -438
  78. package/dist/runtime/document-runtime.d.cts +2 -2
  79. package/dist/runtime/document-runtime.d.ts +2 -2
  80. package/dist/runtime/document-runtime.js +14 -14
  81. package/dist/{session-CDB0hohT.d.ts → session-CBDIOYXA.d.ts} +3 -3
  82. package/dist/{session-BUN6B-Vj.d.cts → session-CR2A1hGZ.d.cts} +3 -3
  83. package/dist/session.cjs +7 -2
  84. package/dist/session.d.cts +5 -5
  85. package/dist/session.d.ts +5 -5
  86. package/dist/session.js +5 -5
  87. package/dist/tailwind.cjs +905 -322
  88. package/dist/tailwind.d.cts +2 -2
  89. package/dist/tailwind.d.ts +2 -2
  90. package/dist/tailwind.js +7 -7
  91. package/dist/{types-VWH6CRvG.d.ts → types-B-90ywjU.d.ts} +2 -2
  92. package/dist/{types-C4bz3kDU.d.cts → types-yty2K-hk.d.cts} +2 -2
  93. package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +3 -3
  94. package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +3 -3
  95. package/dist/ui-tailwind/editor-surface/search-plugin.js +4 -4
  96. package/dist/ui-tailwind.cjs +905 -322
  97. package/dist/ui-tailwind.d.cts +4 -3
  98. package/dist/ui-tailwind.d.ts +4 -3
  99. package/dist/ui-tailwind.js +7 -7
  100. package/package.json +1 -1
@@ -372,11 +372,14 @@ function collectEditableTargetRefs(doc, cache) {
372
372
  collectEditableTargetsInBlocks(
373
373
  context.blocks,
374
374
  {
375
+ doc,
375
376
  storyKey: context.storyKey,
376
377
  basePath: context.basePath,
377
378
  insideSdt: false,
378
379
  insideTextBox: false,
379
- tableDepth: 0
380
+ tableDepth: 0,
381
+ numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
382
+ numberingTargetRevisionHash: createNumberingTargetRevisionHash(doc)
380
383
  },
381
384
  targets,
382
385
  cache
@@ -396,11 +399,14 @@ function collectEditableTargetRefsForStoryBlockRanges(doc, storyKey, ranges, cac
396
399
  collectEditableTargetsInBlocks(
397
400
  context.blocks.slice(range.start, range.end),
398
401
  {
402
+ doc,
399
403
  storyKey: context.storyKey,
400
404
  basePath: context.basePath,
401
405
  insideSdt: false,
402
406
  insideTextBox: false,
403
- tableDepth: 0
407
+ tableDepth: 0,
408
+ numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
409
+ numberingTargetRevisionHash: createNumberingTargetRevisionHash(doc)
404
410
  },
405
411
  targets,
406
412
  cache,
@@ -426,6 +432,7 @@ function buildBlockCacheSignature(context, blockIndex) {
426
432
  const owner = tt?.editableOwnersByChildIndex?.get(blockIndex);
427
433
  return [
428
434
  context.storyKey,
435
+ context.numberingTargetRevisionHash,
429
436
  context.insideSdt ? "1" : "0",
430
437
  context.insideTextBox ? "1" : "0",
431
438
  String(context.tableDepth),
@@ -471,7 +478,8 @@ function collectEditableTargetsInBlocks(blocks, context, targets, cache, blockIn
471
478
  editableParagraphTargetPosture(targetKind),
472
479
  context.contentControl,
473
480
  context.tableTarget,
474
- context.tableTarget?.editableOwnersByChildIndex?.get(blockIndex)
481
+ context.tableTarget?.editableOwnersByChildIndex?.get(blockIndex),
482
+ resolveEditableParagraphListIdentity(block, context)
475
483
  )
476
484
  );
477
485
  }
@@ -1016,7 +1024,7 @@ function collectEditableTargetsInInlines(inlines, basePath, context, targets) {
1016
1024
  }
1017
1025
  }
1018
1026
  }
1019
- function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, targetPosture = { editability: "editable", posture: { blockers: [] } }, contentControl, tableTarget, editableOwner) {
1027
+ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, targetPosture = { editability: "editable", posture: { blockers: [] } }, contentControl, tableTarget, editableOwner, listIdentity) {
1020
1028
  const paragraphText = collectParagraphText(paragraph);
1021
1029
  const paragraphTextHash = hashText(paragraphText);
1022
1030
  const sourceRef = paragraph.sourceRef;
@@ -1027,19 +1035,39 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
1027
1035
  context: { storyKey, insideSdt: contentControl !== void 0 },
1028
1036
  ...tableTarget
1029
1037
  }) : void 0;
1030
- const listAddress = paragraph.numbering !== void 0 ? createCanonicalAddress({
1038
+ const listAddress = listIdentity !== void 0 ? createCanonicalAddress({
1031
1039
  addressKind: "list-item-text",
1032
1040
  storyKey,
1033
1041
  staleCheckKind: "paragraph",
1034
1042
  operationScope: "list-text",
1035
- sourceRefs: [sourceRef],
1043
+ sourceRefs: [
1044
+ sourceRef,
1045
+ listIdentity.paragraphNumberingSourceRef,
1046
+ listIdentity.instanceSourceRef,
1047
+ listIdentity.abstractSourceRef
1048
+ ],
1036
1049
  staleHash: paragraphTextHash,
1037
1050
  rangeBoundary: { boundaryKind: "list-item-text" },
1051
+ list: {
1052
+ numberingOrigin: listIdentity.numberingOrigin,
1053
+ numberingInstanceId: listIdentity.numberingInstanceId,
1054
+ ...listIdentity.abstractNumberingId !== void 0 ? { abstractNumberingId: listIdentity.abstractNumberingId } : {},
1055
+ level: listIdentity.level,
1056
+ ...listIdentity.overrideHash !== void 0 ? { overrideHash: listIdentity.overrideHash } : {},
1057
+ numberingCatalogHash: listIdentity.numberingCatalogHash
1058
+ },
1038
1059
  discriminator: {
1039
1060
  blockPath,
1040
- numberingInstanceId: paragraph.numbering.numberingInstanceId,
1041
- level: paragraph.numbering.level,
1061
+ numberingOrigin: listIdentity.numberingOrigin,
1062
+ numberingInstanceId: listIdentity.numberingInstanceId,
1063
+ abstractNumberingId: listIdentity.abstractNumberingId ?? null,
1064
+ level: listIdentity.level,
1065
+ overrideHash: listIdentity.overrideHash ?? null,
1066
+ numberingCatalogHash: listIdentity.numberingCatalogHash,
1042
1067
  sourceId: sourceRef?.sourceId ?? null,
1068
+ numberingSourceId: listIdentity.paragraphNumberingSourceRef?.sourceId ?? null,
1069
+ numberingInstanceSourceId: listIdentity.instanceSourceRef?.sourceId ?? null,
1070
+ abstractNumberingSourceId: listIdentity.abstractSourceRef?.sourceId ?? null,
1043
1071
  paraId: paragraph.wordExtensionIds?.paraId ?? null,
1044
1072
  textId: paragraph.wordExtensionIds?.textId ?? null
1045
1073
  }
@@ -1080,11 +1108,62 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
1080
1108
  blockType: "paragraph",
1081
1109
  ...paragraph.wordExtensionIds?.paraId !== void 0 ? { wordParaId: paragraph.wordExtensionIds.paraId } : {},
1082
1110
  ...paragraph.wordExtensionIds?.textId !== void 0 ? { wordTextId: paragraph.wordExtensionIds.textId } : {},
1083
- ...sourceRef !== void 0 ? { sourceRef } : {}
1111
+ ...sourceRef !== void 0 ? { sourceRef } : {},
1112
+ ...listIdentity !== void 0 ? {
1113
+ listNumberingOrigin: listIdentity.numberingOrigin,
1114
+ listNumberingInstanceId: listIdentity.numberingInstanceId,
1115
+ ...listIdentity.abstractNumberingId !== void 0 ? { listAbstractNumberingId: listIdentity.abstractNumberingId } : {},
1116
+ listLevel: listIdentity.level,
1117
+ ...listIdentity.overrideHash !== void 0 ? { listOverrideHash: listIdentity.overrideHash } : {},
1118
+ numberingCatalogHash: listIdentity.numberingCatalogHash
1119
+ } : {}
1084
1120
  },
1085
1121
  posture
1086
1122
  };
1087
1123
  }
1124
+ function resolveEditableParagraphListIdentity(paragraph, context) {
1125
+ const directNumbering = paragraph.numbering;
1126
+ const styleNumbering = directNumbering === void 0 && paragraph.styleId !== void 0 ? resolveParagraphStyleNumbering(context.doc, paragraph.styleId) : void 0;
1127
+ const numbering = directNumbering ?? styleNumbering;
1128
+ if (numbering === void 0) return void 0;
1129
+ const numberingCatalog = context.doc.numbering ?? { abstractDefinitions: {}, instances: {} };
1130
+ const instances = numberingCatalog.instances ?? {};
1131
+ const abstractDefinitions = numberingCatalog.abstractDefinitions ?? {};
1132
+ const instance = instances[numbering.numberingInstanceId];
1133
+ const abstractDefinition = instance !== void 0 ? abstractDefinitions[instance.abstractNumberingId] : void 0;
1134
+ const level = numbering.level ?? 0;
1135
+ const override = instance?.overrides.find((entry) => entry.level === level);
1136
+ const overrideHash = override !== void 0 ? hashText(JSON.stringify(numberingOverrideDiscriminator(override))) : void 0;
1137
+ return {
1138
+ numberingOrigin: directNumbering !== void 0 ? "paragraph" : "paragraph-style",
1139
+ numberingInstanceId: numbering.numberingInstanceId,
1140
+ ...instance?.abstractNumberingId !== void 0 ? { abstractNumberingId: instance.abstractNumberingId } : {},
1141
+ level,
1142
+ ...overrideHash !== void 0 ? { overrideHash } : {},
1143
+ numberingCatalogHash: context.numberingCatalogHash,
1144
+ ...directNumbering?.sourceRef !== void 0 ? { paragraphNumberingSourceRef: directNumbering.sourceRef } : {},
1145
+ ...instance?.sourceRef !== void 0 ? { instanceSourceRef: instance.sourceRef } : {},
1146
+ ...abstractDefinition?.sourceRef !== void 0 ? { abstractSourceRef: abstractDefinition.sourceRef } : {}
1147
+ };
1148
+ }
1149
+ function numberingOverrideDiscriminator(override) {
1150
+ return {
1151
+ level: override.level,
1152
+ startAt: override.startAt ?? null,
1153
+ sourceId: override.sourceRef?.sourceId ?? null,
1154
+ levelDefinition: override.levelDefinition === void 0 ? null : {
1155
+ sourceId: override.levelDefinition.sourceRef?.sourceId ?? null,
1156
+ format: override.levelDefinition.format ?? null,
1157
+ text: override.levelDefinition.text ?? null,
1158
+ startAt: override.levelDefinition.startAt ?? null,
1159
+ paragraphStyleId: override.levelDefinition.paragraphStyleId ?? null,
1160
+ isLegalNumbering: override.levelDefinition.isLegalNumbering ?? null,
1161
+ suffix: override.levelDefinition.suffix ?? null,
1162
+ restartAfterLevel: override.levelDefinition.restartAfterLevel ?? null,
1163
+ picBulletId: override.levelDefinition.picBulletId ?? null
1164
+ }
1165
+ };
1166
+ }
1088
1167
  function contentControlLocksContent(contentControl) {
1089
1168
  return contentControl?.lock !== void 0 && contentControl.lock !== "unlocked" && contentControl.lock !== "none";
1090
1169
  }
@@ -1853,6 +1932,7 @@ function createCanonicalAddress(input) {
1853
1932
  ...input.rowRange !== void 0 ? { rowRange: input.rowRange } : {},
1854
1933
  ...input.columnRange !== void 0 ? { columnRange: input.columnRange } : {},
1855
1934
  ...sourceHash !== void 0 ? { sourceJoinHash: sourceHash } : {},
1935
+ ...input.list !== void 0 ? { list: input.list } : {},
1856
1936
  ...input.secondaryStory === true ? { secondaryStory: true } : {},
1857
1937
  ...input.nestedTable === true ? { nestedTable: true } : {},
1858
1938
  ...input.insideSdt === true ? { insideSdt: true } : {},
@@ -1887,6 +1967,103 @@ function sourceJoinHash(refs) {
1887
1967
  if (sourceIds.length === 0) return void 0;
1888
1968
  return hashText(sourceIds.join("\0"));
1889
1969
  }
1970
+ var numberingCatalogHashCache = /* @__PURE__ */ new WeakMap();
1971
+ var numberingTargetHashCache = /* @__PURE__ */ new WeakMap();
1972
+ function createNumberingCatalogRevisionHash(doc) {
1973
+ const numbering = doc.numbering;
1974
+ if (numbering !== void 0) {
1975
+ const cached = numberingCatalogHashCache.get(numbering);
1976
+ if (cached !== void 0) return cached;
1977
+ const fresh = computeNumberingCatalogRevisionHash(doc);
1978
+ numberingCatalogHashCache.set(numbering, fresh);
1979
+ return fresh;
1980
+ }
1981
+ return computeNumberingCatalogRevisionHash(doc);
1982
+ }
1983
+ function computeNumberingCatalogRevisionHash(doc) {
1984
+ const catalog = doc.numbering ?? { abstractDefinitions: {}, instances: {} };
1985
+ const abstractDefinitions = catalog.abstractDefinitions ?? {};
1986
+ const instances = catalog.instances ?? {};
1987
+ const numPicBullets = catalog.numPicBullets ?? {};
1988
+ return hashText(JSON.stringify({
1989
+ abstractDefinitions: Object.keys(abstractDefinitions).sort().map((abstractNumberingId) => {
1990
+ const definition = abstractDefinitions[abstractNumberingId];
1991
+ return {
1992
+ abstractNumberingId,
1993
+ sourceId: definition.sourceRef?.sourceId ?? null,
1994
+ nsid: definition.nsid ?? null,
1995
+ tplc: definition.tplc ?? null,
1996
+ styleLink: definition.styleLink ?? null,
1997
+ numStyleLink: definition.numStyleLink ?? null,
1998
+ levels: definition.levels.map((level) => ({
1999
+ sourceId: level.sourceRef?.sourceId ?? null,
2000
+ level: level.level,
2001
+ format: level.format,
2002
+ text: level.text,
2003
+ startAt: level.startAt ?? null,
2004
+ paragraphStyleId: level.paragraphStyleId ?? null,
2005
+ isLegalNumbering: level.isLegalNumbering ?? null,
2006
+ suffix: level.suffix ?? null,
2007
+ restartAfterLevel: level.restartAfterLevel ?? null,
2008
+ picBulletId: level.picBulletId ?? null
2009
+ }))
2010
+ };
2011
+ }),
2012
+ instances: Object.keys(instances).sort().map((numberingInstanceId) => {
2013
+ const instance = instances[numberingInstanceId];
2014
+ return {
2015
+ numberingInstanceId,
2016
+ sourceId: instance.sourceRef?.sourceId ?? null,
2017
+ abstractNumberingId: instance.abstractNumberingId,
2018
+ overrides: instance.overrides.map(numberingOverrideDiscriminator)
2019
+ };
2020
+ }),
2021
+ numPicBullets: Object.keys(numPicBullets).sort().map((numPicBulletId) => {
2022
+ const picBullet = numPicBullets[numPicBulletId];
2023
+ return {
2024
+ numPicBulletId,
2025
+ sourceId: picBullet.sourceRef?.sourceId ?? null,
2026
+ mediaId: picBullet.mediaId ?? null,
2027
+ widthEmu: picBullet.widthEmu ?? null,
2028
+ heightEmu: picBullet.heightEmu ?? null
2029
+ };
2030
+ })
2031
+ }));
2032
+ }
2033
+ function createNumberingTargetRevisionHash(doc) {
2034
+ const numbering = doc.numbering;
2035
+ const styles = doc.styles;
2036
+ if (numbering !== void 0 && styles !== void 0) {
2037
+ let inner = numberingTargetHashCache.get(numbering);
2038
+ if (inner === void 0) {
2039
+ inner = /* @__PURE__ */ new WeakMap();
2040
+ numberingTargetHashCache.set(numbering, inner);
2041
+ }
2042
+ const cached = inner.get(styles);
2043
+ if (cached !== void 0) return cached;
2044
+ const fresh = computeNumberingTargetRevisionHash(doc);
2045
+ inner.set(styles, fresh);
2046
+ return fresh;
2047
+ }
2048
+ return computeNumberingTargetRevisionHash(doc);
2049
+ }
2050
+ function computeNumberingTargetRevisionHash(doc) {
2051
+ const paragraphStyles = doc.styles?.paragraphs ?? {};
2052
+ return hashText(JSON.stringify({
2053
+ // Reuses the memoized catalog hash on the hot path so a typing edit
2054
+ // pays for the catalog hash at most once across both helpers.
2055
+ numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
2056
+ paragraphStyleNumbering: Object.keys(paragraphStyles).sort().map((styleId) => {
2057
+ const style = paragraphStyles[styleId];
2058
+ return {
2059
+ styleId,
2060
+ basedOn: style.basedOn ?? null,
2061
+ numberingInstanceId: style.numbering?.numberingInstanceId ?? null,
2062
+ level: style.numbering?.level ?? null
2063
+ };
2064
+ })
2065
+ }));
2066
+ }
1890
2067
  function validateEditableTargetRef(value, path = "$") {
1891
2068
  const issues = [];
1892
2069
  const record = asPlainObject(value, path, issues);
@@ -1986,6 +2163,32 @@ function validateEditableTargetRef(value, path = "$") {
1986
2163
  if (staleCheck.sourceRef !== void 0) {
1987
2164
  validateTargetSourceRef(staleCheck.sourceRef, `${path}.staleCheck.sourceRef`, issues);
1988
2165
  }
2166
+ if (staleCheck.listNumberingOrigin !== void 0) {
2167
+ validateEnum(
2168
+ staleCheck.listNumberingOrigin,
2169
+ EDITABLE_TARGET_LIST_NUMBERING_ORIGINS,
2170
+ `${path}.staleCheck.listNumberingOrigin`,
2171
+ issues
2172
+ );
2173
+ }
2174
+ if (staleCheck.listNumberingInstanceId !== void 0) {
2175
+ expectString(staleCheck.listNumberingInstanceId, `${path}.staleCheck.listNumberingInstanceId`, issues);
2176
+ }
2177
+ if (staleCheck.listAbstractNumberingId !== void 0) {
2178
+ expectString(staleCheck.listAbstractNumberingId, `${path}.staleCheck.listAbstractNumberingId`, issues);
2179
+ }
2180
+ if (staleCheck.listLevel !== void 0 && (typeof staleCheck.listLevel !== "number" || !Number.isInteger(staleCheck.listLevel) || staleCheck.listLevel < 0)) {
2181
+ issues.push({
2182
+ path: `${path}.staleCheck.listLevel`,
2183
+ message: "listLevel must be a non-negative integer when present."
2184
+ });
2185
+ }
2186
+ if (staleCheck.listOverrideHash !== void 0) {
2187
+ validateSha256(staleCheck.listOverrideHash, `${path}.staleCheck.listOverrideHash`, issues);
2188
+ }
2189
+ if (staleCheck.numberingCatalogHash !== void 0) {
2190
+ validateSha256(staleCheck.numberingCatalogHash, `${path}.staleCheck.numberingCatalogHash`, issues);
2191
+ }
1989
2192
  }
1990
2193
  const posture = asPlainObject(record.posture, `${path}.posture`, issues);
1991
2194
  if (posture) {
@@ -2203,6 +2406,9 @@ function validateTargetCanonicalAddress(value, path, issues) {
2203
2406
  if (record.sourceJoinHash !== void 0) {
2204
2407
  validateSha256(record.sourceJoinHash, `${path}.sourceJoinHash`, issues);
2205
2408
  }
2409
+ if (record.list !== void 0) {
2410
+ validateTargetListAddressIdentity(record.list, `${path}.list`, issues);
2411
+ }
2206
2412
  if (record.resolver !== void 0) {
2207
2413
  validateTargetCanonicalAddressResolver(record.resolver, `${path}.resolver`, issues);
2208
2414
  }
@@ -2212,6 +2418,22 @@ function validateTargetCanonicalAddress(value, path, issues) {
2212
2418
  }
2213
2419
  }
2214
2420
  }
2421
+ function validateTargetListAddressIdentity(value, path, issues) {
2422
+ const record = asPlainObject(value, path, issues);
2423
+ if (!record) return;
2424
+ validateEnum(record.numberingOrigin, EDITABLE_TARGET_LIST_NUMBERING_ORIGINS, `${path}.numberingOrigin`, issues);
2425
+ expectString(record.numberingInstanceId, `${path}.numberingInstanceId`, issues);
2426
+ if (record.abstractNumberingId !== void 0) {
2427
+ expectString(record.abstractNumberingId, `${path}.abstractNumberingId`, issues);
2428
+ }
2429
+ if (typeof record.level !== "number" || !Number.isInteger(record.level) || record.level < 0) {
2430
+ issues.push({ path: `${path}.level`, message: "level must be a non-negative integer." });
2431
+ }
2432
+ if (record.overrideHash !== void 0) {
2433
+ validateSha256(record.overrideHash, `${path}.overrideHash`, issues);
2434
+ }
2435
+ validateSha256(record.numberingCatalogHash, `${path}.numberingCatalogHash`, issues);
2436
+ }
2215
2437
  function validateTargetCanonicalAddressResolver(value, path, issues) {
2216
2438
  const record = asPlainObject(value, path, issues);
2217
2439
  if (!record) return;
@@ -2349,6 +2571,10 @@ var EDITABLE_TARGET_COMMAND_FAMILIES = /* @__PURE__ */ new Set([
2349
2571
  "preserve-only-refusal"
2350
2572
  ]);
2351
2573
  var EDITABLE_TARGET_EDITABILITY = /* @__PURE__ */ new Set(["editable", "non-editable"]);
2574
+ var EDITABLE_TARGET_LIST_NUMBERING_ORIGINS = /* @__PURE__ */ new Set([
2575
+ "paragraph",
2576
+ "paragraph-style"
2577
+ ]);
2352
2578
  var EDITABLE_TARGET_BLOCKERS = /* @__PURE__ */ new Set([
2353
2579
  "protected-section",
2354
2580
  "protected-range",
@@ -2548,7 +2774,7 @@ function resolveParagraphStyleNumbering(doc, styleId) {
2548
2774
  let currentStyleId = styleId;
2549
2775
  while (currentStyleId !== void 0 && !visited.has(currentStyleId)) {
2550
2776
  visited.add(currentStyleId);
2551
- const style = doc.styles.paragraphs[currentStyleId];
2777
+ const style = doc.styles?.paragraphs?.[currentStyleId];
2552
2778
  if (style === void 0) {
2553
2779
  return void 0;
2554
2780
  }