@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
@@ -859,11 +859,14 @@ function collectEditableTargetRefs(doc, cache) {
859
859
  collectEditableTargetsInBlocks(
860
860
  context.blocks,
861
861
  {
862
+ doc,
862
863
  storyKey: context.storyKey,
863
864
  basePath: context.basePath,
864
865
  insideSdt: false,
865
866
  insideTextBox: false,
866
- tableDepth: 0
867
+ tableDepth: 0,
868
+ numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
869
+ numberingTargetRevisionHash: createNumberingTargetRevisionHash(doc)
867
870
  },
868
871
  targets,
869
872
  cache
@@ -880,6 +883,7 @@ function buildBlockCacheSignature(context, blockIndex) {
880
883
  const owner = tt?.editableOwnersByChildIndex?.get(blockIndex);
881
884
  return [
882
885
  context.storyKey,
886
+ context.numberingTargetRevisionHash,
883
887
  context.insideSdt ? "1" : "0",
884
888
  context.insideTextBox ? "1" : "0",
885
889
  String(context.tableDepth),
@@ -925,7 +929,8 @@ function collectEditableTargetsInBlocks(blocks, context, targets, cache, blockIn
925
929
  editableParagraphTargetPosture(targetKind),
926
930
  context.contentControl,
927
931
  context.tableTarget,
928
- context.tableTarget?.editableOwnersByChildIndex?.get(blockIndex)
932
+ context.tableTarget?.editableOwnersByChildIndex?.get(blockIndex),
933
+ resolveEditableParagraphListIdentity(block, context)
929
934
  )
930
935
  );
931
936
  }
@@ -1454,7 +1459,7 @@ function collectEditableTargetsInInlines(inlines, basePath, context, targets) {
1454
1459
  }
1455
1460
  }
1456
1461
  }
1457
- function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, targetPosture = { editability: "editable", posture: { blockers: [] } }, contentControl, tableTarget, editableOwner) {
1462
+ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, targetPosture = { editability: "editable", posture: { blockers: [] } }, contentControl, tableTarget, editableOwner, listIdentity) {
1458
1463
  const paragraphText = collectParagraphText(paragraph);
1459
1464
  const paragraphTextHash = hashText(paragraphText);
1460
1465
  const sourceRef = paragraph.sourceRef;
@@ -1465,19 +1470,39 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
1465
1470
  context: { storyKey, insideSdt: contentControl !== void 0 },
1466
1471
  ...tableTarget
1467
1472
  }) : void 0;
1468
- const listAddress = paragraph.numbering !== void 0 ? createCanonicalAddress({
1473
+ const listAddress = listIdentity !== void 0 ? createCanonicalAddress({
1469
1474
  addressKind: "list-item-text",
1470
1475
  storyKey,
1471
1476
  staleCheckKind: "paragraph",
1472
1477
  operationScope: "list-text",
1473
- sourceRefs: [sourceRef],
1478
+ sourceRefs: [
1479
+ sourceRef,
1480
+ listIdentity.paragraphNumberingSourceRef,
1481
+ listIdentity.instanceSourceRef,
1482
+ listIdentity.abstractSourceRef
1483
+ ],
1474
1484
  staleHash: paragraphTextHash,
1475
1485
  rangeBoundary: { boundaryKind: "list-item-text" },
1486
+ list: {
1487
+ numberingOrigin: listIdentity.numberingOrigin,
1488
+ numberingInstanceId: listIdentity.numberingInstanceId,
1489
+ ...listIdentity.abstractNumberingId !== void 0 ? { abstractNumberingId: listIdentity.abstractNumberingId } : {},
1490
+ level: listIdentity.level,
1491
+ ...listIdentity.overrideHash !== void 0 ? { overrideHash: listIdentity.overrideHash } : {},
1492
+ numberingCatalogHash: listIdentity.numberingCatalogHash
1493
+ },
1476
1494
  discriminator: {
1477
1495
  blockPath,
1478
- numberingInstanceId: paragraph.numbering.numberingInstanceId,
1479
- level: paragraph.numbering.level,
1496
+ numberingOrigin: listIdentity.numberingOrigin,
1497
+ numberingInstanceId: listIdentity.numberingInstanceId,
1498
+ abstractNumberingId: listIdentity.abstractNumberingId ?? null,
1499
+ level: listIdentity.level,
1500
+ overrideHash: listIdentity.overrideHash ?? null,
1501
+ numberingCatalogHash: listIdentity.numberingCatalogHash,
1480
1502
  sourceId: sourceRef?.sourceId ?? null,
1503
+ numberingSourceId: listIdentity.paragraphNumberingSourceRef?.sourceId ?? null,
1504
+ numberingInstanceSourceId: listIdentity.instanceSourceRef?.sourceId ?? null,
1505
+ abstractNumberingSourceId: listIdentity.abstractSourceRef?.sourceId ?? null,
1481
1506
  paraId: paragraph.wordExtensionIds?.paraId ?? null,
1482
1507
  textId: paragraph.wordExtensionIds?.textId ?? null
1483
1508
  }
@@ -1518,11 +1543,62 @@ function createParagraphEditableTarget(paragraph, kind, storyKey, blockPath, tar
1518
1543
  blockType: "paragraph",
1519
1544
  ...paragraph.wordExtensionIds?.paraId !== void 0 ? { wordParaId: paragraph.wordExtensionIds.paraId } : {},
1520
1545
  ...paragraph.wordExtensionIds?.textId !== void 0 ? { wordTextId: paragraph.wordExtensionIds.textId } : {},
1521
- ...sourceRef !== void 0 ? { sourceRef } : {}
1546
+ ...sourceRef !== void 0 ? { sourceRef } : {},
1547
+ ...listIdentity !== void 0 ? {
1548
+ listNumberingOrigin: listIdentity.numberingOrigin,
1549
+ listNumberingInstanceId: listIdentity.numberingInstanceId,
1550
+ ...listIdentity.abstractNumberingId !== void 0 ? { listAbstractNumberingId: listIdentity.abstractNumberingId } : {},
1551
+ listLevel: listIdentity.level,
1552
+ ...listIdentity.overrideHash !== void 0 ? { listOverrideHash: listIdentity.overrideHash } : {},
1553
+ numberingCatalogHash: listIdentity.numberingCatalogHash
1554
+ } : {}
1522
1555
  },
1523
1556
  posture
1524
1557
  };
1525
1558
  }
1559
+ function resolveEditableParagraphListIdentity(paragraph, context) {
1560
+ const directNumbering = paragraph.numbering;
1561
+ const styleNumbering = directNumbering === void 0 && paragraph.styleId !== void 0 ? resolveParagraphStyleNumbering(context.doc, paragraph.styleId) : void 0;
1562
+ const numbering = directNumbering ?? styleNumbering;
1563
+ if (numbering === void 0) return void 0;
1564
+ const numberingCatalog = context.doc.numbering ?? { abstractDefinitions: {}, instances: {} };
1565
+ const instances = numberingCatalog.instances ?? {};
1566
+ const abstractDefinitions = numberingCatalog.abstractDefinitions ?? {};
1567
+ const instance = instances[numbering.numberingInstanceId];
1568
+ const abstractDefinition = instance !== void 0 ? abstractDefinitions[instance.abstractNumberingId] : void 0;
1569
+ const level = numbering.level ?? 0;
1570
+ const override = instance?.overrides.find((entry) => entry.level === level);
1571
+ const overrideHash = override !== void 0 ? hashText(JSON.stringify(numberingOverrideDiscriminator(override))) : void 0;
1572
+ return {
1573
+ numberingOrigin: directNumbering !== void 0 ? "paragraph" : "paragraph-style",
1574
+ numberingInstanceId: numbering.numberingInstanceId,
1575
+ ...instance?.abstractNumberingId !== void 0 ? { abstractNumberingId: instance.abstractNumberingId } : {},
1576
+ level,
1577
+ ...overrideHash !== void 0 ? { overrideHash } : {},
1578
+ numberingCatalogHash: context.numberingCatalogHash,
1579
+ ...directNumbering?.sourceRef !== void 0 ? { paragraphNumberingSourceRef: directNumbering.sourceRef } : {},
1580
+ ...instance?.sourceRef !== void 0 ? { instanceSourceRef: instance.sourceRef } : {},
1581
+ ...abstractDefinition?.sourceRef !== void 0 ? { abstractSourceRef: abstractDefinition.sourceRef } : {}
1582
+ };
1583
+ }
1584
+ function numberingOverrideDiscriminator(override) {
1585
+ return {
1586
+ level: override.level,
1587
+ startAt: override.startAt ?? null,
1588
+ sourceId: override.sourceRef?.sourceId ?? null,
1589
+ levelDefinition: override.levelDefinition === void 0 ? null : {
1590
+ sourceId: override.levelDefinition.sourceRef?.sourceId ?? null,
1591
+ format: override.levelDefinition.format ?? null,
1592
+ text: override.levelDefinition.text ?? null,
1593
+ startAt: override.levelDefinition.startAt ?? null,
1594
+ paragraphStyleId: override.levelDefinition.paragraphStyleId ?? null,
1595
+ isLegalNumbering: override.levelDefinition.isLegalNumbering ?? null,
1596
+ suffix: override.levelDefinition.suffix ?? null,
1597
+ restartAfterLevel: override.levelDefinition.restartAfterLevel ?? null,
1598
+ picBulletId: override.levelDefinition.picBulletId ?? null
1599
+ }
1600
+ };
1601
+ }
1526
1602
  function contentControlLocksContent(contentControl) {
1527
1603
  return contentControl?.lock !== void 0 && contentControl.lock !== "unlocked" && contentControl.lock !== "none";
1528
1604
  }
@@ -2291,6 +2367,7 @@ function createCanonicalAddress(input) {
2291
2367
  ...input.rowRange !== void 0 ? { rowRange: input.rowRange } : {},
2292
2368
  ...input.columnRange !== void 0 ? { columnRange: input.columnRange } : {},
2293
2369
  ...sourceHash !== void 0 ? { sourceJoinHash: sourceHash } : {},
2370
+ ...input.list !== void 0 ? { list: input.list } : {},
2294
2371
  ...input.secondaryStory === true ? { secondaryStory: true } : {},
2295
2372
  ...input.nestedTable === true ? { nestedTable: true } : {},
2296
2373
  ...input.insideSdt === true ? { insideSdt: true } : {},
@@ -2325,6 +2402,119 @@ function sourceJoinHash(refs) {
2325
2402
  if (sourceIds.length === 0) return void 0;
2326
2403
  return hashText(sourceIds.join("\0"));
2327
2404
  }
2405
+ var numberingCatalogHashCache = /* @__PURE__ */ new WeakMap();
2406
+ var numberingTargetHashCache = /* @__PURE__ */ new WeakMap();
2407
+ function createNumberingCatalogRevisionHash(doc) {
2408
+ const numbering = doc.numbering;
2409
+ if (numbering !== void 0) {
2410
+ const cached = numberingCatalogHashCache.get(numbering);
2411
+ if (cached !== void 0) return cached;
2412
+ const fresh = computeNumberingCatalogRevisionHash(doc);
2413
+ numberingCatalogHashCache.set(numbering, fresh);
2414
+ return fresh;
2415
+ }
2416
+ return computeNumberingCatalogRevisionHash(doc);
2417
+ }
2418
+ function computeNumberingCatalogRevisionHash(doc) {
2419
+ const catalog = doc.numbering ?? { abstractDefinitions: {}, instances: {} };
2420
+ const abstractDefinitions = catalog.abstractDefinitions ?? {};
2421
+ const instances = catalog.instances ?? {};
2422
+ const numPicBullets = catalog.numPicBullets ?? {};
2423
+ return hashText(JSON.stringify({
2424
+ abstractDefinitions: Object.keys(abstractDefinitions).sort().map((abstractNumberingId) => {
2425
+ const definition = abstractDefinitions[abstractNumberingId];
2426
+ return {
2427
+ abstractNumberingId,
2428
+ sourceId: definition.sourceRef?.sourceId ?? null,
2429
+ nsid: definition.nsid ?? null,
2430
+ tplc: definition.tplc ?? null,
2431
+ styleLink: definition.styleLink ?? null,
2432
+ numStyleLink: definition.numStyleLink ?? null,
2433
+ levels: definition.levels.map((level) => ({
2434
+ sourceId: level.sourceRef?.sourceId ?? null,
2435
+ level: level.level,
2436
+ format: level.format,
2437
+ text: level.text,
2438
+ startAt: level.startAt ?? null,
2439
+ paragraphStyleId: level.paragraphStyleId ?? null,
2440
+ isLegalNumbering: level.isLegalNumbering ?? null,
2441
+ suffix: level.suffix ?? null,
2442
+ restartAfterLevel: level.restartAfterLevel ?? null,
2443
+ picBulletId: level.picBulletId ?? null
2444
+ }))
2445
+ };
2446
+ }),
2447
+ instances: Object.keys(instances).sort().map((numberingInstanceId) => {
2448
+ const instance = instances[numberingInstanceId];
2449
+ return {
2450
+ numberingInstanceId,
2451
+ sourceId: instance.sourceRef?.sourceId ?? null,
2452
+ abstractNumberingId: instance.abstractNumberingId,
2453
+ overrides: instance.overrides.map(numberingOverrideDiscriminator)
2454
+ };
2455
+ }),
2456
+ numPicBullets: Object.keys(numPicBullets).sort().map((numPicBulletId) => {
2457
+ const picBullet = numPicBullets[numPicBulletId];
2458
+ return {
2459
+ numPicBulletId,
2460
+ sourceId: picBullet.sourceRef?.sourceId ?? null,
2461
+ mediaId: picBullet.mediaId ?? null,
2462
+ widthEmu: picBullet.widthEmu ?? null,
2463
+ heightEmu: picBullet.heightEmu ?? null
2464
+ };
2465
+ })
2466
+ }));
2467
+ }
2468
+ function createNumberingTargetRevisionHash(doc) {
2469
+ const numbering = doc.numbering;
2470
+ const styles = doc.styles;
2471
+ if (numbering !== void 0 && styles !== void 0) {
2472
+ let inner = numberingTargetHashCache.get(numbering);
2473
+ if (inner === void 0) {
2474
+ inner = /* @__PURE__ */ new WeakMap();
2475
+ numberingTargetHashCache.set(numbering, inner);
2476
+ }
2477
+ const cached = inner.get(styles);
2478
+ if (cached !== void 0) return cached;
2479
+ const fresh = computeNumberingTargetRevisionHash(doc);
2480
+ inner.set(styles, fresh);
2481
+ return fresh;
2482
+ }
2483
+ return computeNumberingTargetRevisionHash(doc);
2484
+ }
2485
+ function computeNumberingTargetRevisionHash(doc) {
2486
+ const paragraphStyles = doc.styles?.paragraphs ?? {};
2487
+ return hashText(JSON.stringify({
2488
+ // Reuses the memoized catalog hash on the hot path so a typing edit
2489
+ // pays for the catalog hash at most once across both helpers.
2490
+ numberingCatalogHash: createNumberingCatalogRevisionHash(doc),
2491
+ paragraphStyleNumbering: Object.keys(paragraphStyles).sort().map((styleId) => {
2492
+ const style = paragraphStyles[styleId];
2493
+ return {
2494
+ styleId,
2495
+ basedOn: style.basedOn ?? null,
2496
+ numberingInstanceId: style.numbering?.numberingInstanceId ?? null,
2497
+ level: style.numbering?.level ?? null
2498
+ };
2499
+ })
2500
+ }));
2501
+ }
2502
+ function resolveParagraphStyleNumbering(doc, styleId) {
2503
+ const visited = /* @__PURE__ */ new Set();
2504
+ let currentStyleId = styleId;
2505
+ while (currentStyleId !== void 0 && !visited.has(currentStyleId)) {
2506
+ visited.add(currentStyleId);
2507
+ const style = doc.styles?.paragraphs?.[currentStyleId];
2508
+ if (style === void 0) {
2509
+ return void 0;
2510
+ }
2511
+ if (style.numbering !== void 0) {
2512
+ return style.numbering;
2513
+ }
2514
+ currentStyleId = style.basedOn;
2515
+ }
2516
+ return void 0;
2517
+ }
2328
2518
  function collectCanonicalFieldRegionIdentities(doc) {
2329
2519
  const registry = doc.fieldRegistry;
2330
2520
  const byFieldIndex = new Map(
@@ -3771,6 +3961,10 @@ function createNumberingPrefixResolver(catalog) {
3771
3961
  ])
3772
3962
  ) : resolved.effectiveLevels;
3773
3963
  const picBulletId = resolved.effectiveLevel.picBulletId;
3964
+ const pictureBulletPosture = resolvePictureBulletRenderPosture(
3965
+ picBulletId,
3966
+ picBulletId != null ? catalog.numPicBullets?.[picBulletId] : void 0
3967
+ );
3774
3968
  const text = renderLevelText(
3775
3969
  resolved.effectiveLevel.text,
3776
3970
  workingState.counters,
@@ -3779,14 +3973,20 @@ function createNumberingPrefixResolver(catalog) {
3779
3973
  if (picBulletId == null && resolved.effectiveLevel.format !== "none" && text === null) {
3780
3974
  return null;
3781
3975
  }
3782
- const visibleText = resolved.effectiveLevel.format === "none" ? null : text;
3976
+ const visibleText = resolved.effectiveLevel.format === "none" ? null : text ?? pictureBulletPosture?.fallbackGlyph ?? null;
3977
+ const normalizedMarkerText = normalizeMarkerText(
3978
+ visibleText,
3979
+ resolved.effectiveLevel.format,
3980
+ resolved.geometry.markerRunProperties
3981
+ );
3783
3982
  const formatPosture = getNumberingFormatPosture(
3784
3983
  resolved.effectiveLevel.format,
3785
3984
  currentCounter
3786
3985
  );
3787
- const picBulletMediaId = picBulletId != null ? catalog.numPicBullets?.[picBulletId]?.mediaId : void 0;
3986
+ const picBulletMediaId = pictureBulletPosture?.mediaId;
3788
3987
  return {
3789
- text: visibleText,
3988
+ text: normalizedMarkerText.text,
3989
+ ...normalizedMarkerText.posture !== void 0 ? { markerTextPosture: normalizedMarkerText.posture } : {},
3790
3990
  level: resolved.effectiveLevel.level,
3791
3991
  format: resolved.effectiveLevel.format,
3792
3992
  ...formatPosture !== void 0 ? { formatPosture } : {},
@@ -3796,7 +3996,9 @@ function createNumberingPrefixResolver(catalog) {
3796
3996
  ...resolved.effectiveLevel.isLegalNumbering ? { isLegalNumbering: true } : {},
3797
3997
  ...resolved.geometry.markerRunProperties ? { markerRunProperties: resolved.geometry.markerRunProperties } : {},
3798
3998
  geometry: resolved.geometry,
3799
- ...picBulletMediaId != null ? { picBulletMediaId } : {}
3999
+ ...picBulletId != null ? { picBulletId } : {},
4000
+ ...picBulletMediaId != null ? { picBulletMediaId } : {},
4001
+ ...pictureBulletPosture !== void 0 ? { pictureBulletPosture } : {}
3800
4002
  };
3801
4003
  }
3802
4004
  return {
@@ -3812,6 +4014,69 @@ function createNumberingPrefixResolver(catalog) {
3812
4014
  }
3813
4015
  };
3814
4016
  }
4017
+ function normalizeMarkerText(text, format, markerRunProperties) {
4018
+ if (text === null || format !== "bullet") {
4019
+ return { text };
4020
+ }
4021
+ const fontFamily = getMarkerFontFamily(markerRunProperties);
4022
+ if (!isKnownSymbolBulletFont(fontFamily)) {
4023
+ return { text };
4024
+ }
4025
+ const renderedText = Array.from(text, (char) => SYMBOL_BULLET_GLYPH_MAP.get(char) ?? char).join("");
4026
+ if (renderedText === text) {
4027
+ return { text };
4028
+ }
4029
+ return {
4030
+ text: renderedText,
4031
+ posture: {
4032
+ status: "normalized",
4033
+ sourceText: text,
4034
+ renderedText,
4035
+ reason: "symbol-font-bullet-normalized",
4036
+ ...fontFamily ? { fontFamily } : {}
4037
+ }
4038
+ };
4039
+ }
4040
+ function getMarkerFontFamily(markerRunProperties) {
4041
+ return markerRunProperties?.fontFamilyAscii ?? markerRunProperties?.fontFamilyHAnsi ?? markerRunProperties?.fontFamilyEastAsia ?? markerRunProperties?.fontFamilyCs ?? markerRunProperties?.fontFamily;
4042
+ }
4043
+ function isKnownSymbolBulletFont(fontFamily) {
4044
+ return fontFamily !== void 0 && /^(?:symbol|wingdings|wingdings 2|wingdings 3|webdings)$/iu.test(
4045
+ fontFamily.trim()
4046
+ );
4047
+ }
4048
+ var SYMBOL_BULLET_GLYPH_MAP = /* @__PURE__ */ new Map([
4049
+ ["\uF0B7", "\u2022"],
4050
+ ["\uF0A7", "\u25AA"],
4051
+ ["\uF0FC", "\u2713"]
4052
+ ]);
4053
+ function resolvePictureBulletRenderPosture(picBulletId, picBullet) {
4054
+ if (picBulletId == null) return void 0;
4055
+ if (!picBullet) {
4056
+ return {
4057
+ status: "preserve-only",
4058
+ picBulletId,
4059
+ fallbackGlyph: "\u2022",
4060
+ reason: "picture-bullet-catalog-entry-missing"
4061
+ };
4062
+ }
4063
+ if (picBullet.mediaId) {
4064
+ return {
4065
+ status: "media-rendered",
4066
+ picBulletId,
4067
+ mediaId: picBullet.mediaId,
4068
+ ...picBullet.sourceRef ? { sourceRef: picBullet.sourceRef } : {},
4069
+ reason: "picture-bullet-media-rendered"
4070
+ };
4071
+ }
4072
+ return {
4073
+ status: "glyph-fallback",
4074
+ picBulletId,
4075
+ fallbackGlyph: "\u2022",
4076
+ ...picBullet.sourceRef ? { sourceRef: picBullet.sourceRef } : {},
4077
+ reason: "picture-bullet-media-unavailable"
4078
+ };
4079
+ }
3815
4080
  function getSequenceState(states, numberingInstanceId, options = { create: true }) {
3816
4081
  const existing = states.get(numberingInstanceId);
3817
4082
  if (existing) {
@@ -3874,7 +4139,7 @@ function getNumberingFormatPosture(format, value) {
3874
4139
  reason: registryEntry?.fallbackReason ?? "unsupported-numbering-format-decimal-fallback"
3875
4140
  };
3876
4141
  }
3877
- 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)) {
4142
+ 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)) {
3878
4143
  return {
3879
4144
  status: "approximated",
3880
4145
  requestedFormat: format,
@@ -3968,6 +4233,37 @@ var exactNumberingFormatEntries = [
3968
4233
  supportsMutation: true,
3969
4234
  render: toOrdinal2
3970
4235
  },
4236
+ {
4237
+ format: "decimalFullWidth",
4238
+ renderSupport: "supported",
4239
+ renderedFormat: "decimalFullWidth",
4240
+ supportsMutation: false,
4241
+ render: toFullWidthDecimal
4242
+ },
4243
+ {
4244
+ format: "decimalEnclosedCircle",
4245
+ renderSupport: "supported",
4246
+ renderedFormat: "decimalEnclosedCircle",
4247
+ supportsMutation: false,
4248
+ render: toCircledDecimal,
4249
+ isInRange: (value) => Number.isInteger(value) && value >= 0 && value <= 50
4250
+ },
4251
+ {
4252
+ format: "decimalEnclosedParen",
4253
+ renderSupport: "supported",
4254
+ renderedFormat: "decimalEnclosedParen",
4255
+ supportsMutation: false,
4256
+ render: (value) => Number.isInteger(value) && value > 0 ? `(${value})` : String(value),
4257
+ isInRange: (value) => Number.isInteger(value) && value > 0
4258
+ },
4259
+ {
4260
+ format: "decimalEnclosedFullstop",
4261
+ renderSupport: "supported",
4262
+ renderedFormat: "decimalEnclosedFullstop",
4263
+ supportsMutation: false,
4264
+ render: (value) => Number.isInteger(value) && value > 0 ? `${value}.` : String(value),
4265
+ isInRange: (value) => Number.isInteger(value) && value > 0
4266
+ },
3971
4267
  {
3972
4268
  format: "cardinalText",
3973
4269
  renderSupport: "supported",
@@ -4005,10 +4301,6 @@ var exactNumberingFormatEntries = [
4005
4301
  }
4006
4302
  ];
4007
4303
  var approximatedDecimalFormats = [
4008
- "decimalEnclosedCircle",
4009
- "decimalEnclosedFullstop",
4010
- "decimalEnclosedParen",
4011
- "decimalFullWidth",
4012
4304
  "decimalHalfWidth",
4013
4305
  "aiueo",
4014
4306
  "iroha",
@@ -4060,6 +4352,30 @@ function toOrdinal2(value) {
4060
4352
  return `${value}th`;
4061
4353
  }
4062
4354
  }
4355
+ function toFullWidthDecimal(value) {
4356
+ return String(value).replace(
4357
+ /[0-9]/g,
4358
+ (digit) => String.fromCharCode(65296 + Number.parseInt(digit, 10))
4359
+ );
4360
+ }
4361
+ var CIRCLED_DECIMAL_BY_VALUE = new Map([
4362
+ [0, "\u24EA"],
4363
+ ...Array.from({ length: 20 }, (_, index) => [
4364
+ index + 1,
4365
+ String.fromCodePoint(9312 + index)
4366
+ ]),
4367
+ ...Array.from({ length: 15 }, (_, index) => [
4368
+ index + 21,
4369
+ String.fromCodePoint(12881 + index)
4370
+ ]),
4371
+ ...Array.from({ length: 15 }, (_, index) => [
4372
+ index + 36,
4373
+ String.fromCodePoint(12977 + index)
4374
+ ])
4375
+ ]);
4376
+ function toCircledDecimal(value) {
4377
+ return CIRCLED_DECIMAL_BY_VALUE.get(value) ?? String(value);
4378
+ }
4063
4379
  function toAlphabetic2(value) {
4064
4380
  if (value <= 0) {
4065
4381
  return String(value);
@@ -4833,6 +5149,7 @@ function toNumberingLayoutInput(numbering) {
4833
5149
  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);
4834
5150
  return {
4835
5151
  markerText: numbering.text,
5152
+ ...numbering.markerTextPosture ? { markerTextPosture: { ...numbering.markerTextPosture } } : {},
4836
5153
  ...numbering.markerRunProperties ? { markerRunFormatting: numbering.markerRunProperties } : {},
4837
5154
  markerSuffix: normalizeNumberingMarkerSuffix(numbering.suffix),
4838
5155
  ...markerLane ? { markerLaneStartTwips: markerLane.start } : {},
@@ -4845,7 +5162,9 @@ function toNumberingLayoutInput(numbering) {
4845
5162
  ...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
4846
5163
  startAt: numbering.startAt,
4847
5164
  ...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
4848
- ...numbering.picBulletMediaId ? { pictureBulletMediaId: numbering.picBulletMediaId } : {}
5165
+ ...numbering.picBulletId ? { pictureBulletId: numbering.picBulletId } : {},
5166
+ ...numbering.picBulletMediaId ? { pictureBulletMediaId: numbering.picBulletMediaId } : {},
5167
+ ...numbering.pictureBulletPosture ? { pictureBulletPosture: { ...numbering.pictureBulletPosture } } : {}
4849
5168
  };
4850
5169
  }
4851
5170
  function toFieldLayoutInput(entry, resolved, region) {
@@ -5357,6 +5676,7 @@ function buildEffectiveNumbering(detail) {
5357
5676
  const result = {
5358
5677
  level: detail.level,
5359
5678
  ...detail.text !== null ? { marker: detail.text } : {},
5679
+ ...detail.markerTextPosture ? { markerTextPosture: { ...detail.markerTextPosture } } : {},
5360
5680
  ...detail.markerRunProperties ? { markerRunFormatting: detail.markerRunProperties } : {},
5361
5681
  ...detail.geometry ? {
5362
5682
  indentation: {
@@ -5366,7 +5686,8 @@ function buildEffectiveNumbering(detail) {
5366
5686
  ...detail.geometry.tabStops && detail.geometry.tabStops.length > 0 ? { tab: detail.geometry.tabStops[0].position } : {}
5367
5687
  }
5368
5688
  } : {},
5369
- ...detail.picBulletMediaId ? { pictureBulletRef: detail.picBulletMediaId } : {}
5689
+ ...detail.picBulletMediaId ? { pictureBulletRef: detail.picBulletMediaId } : {},
5690
+ ...detail.pictureBulletPosture ? { pictureBulletPosture: { ...detail.pictureBulletPosture } } : {}
5370
5691
  };
5371
5692
  return result;
5372
5693
  }
@@ -7283,6 +7604,7 @@ function toSurfaceResolvedNumbering(numbering) {
7283
7604
  format: numbering.format,
7284
7605
  ...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
7285
7606
  ...numbering.text !== null ? { text: numbering.text } : {},
7607
+ ...numbering.markerTextPosture !== void 0 ? { markerTextPosture: { ...numbering.markerTextPosture } } : {},
7286
7608
  startAt: numbering.startAt,
7287
7609
  ...numbering.paragraphStyleId ? { paragraphStyleId: numbering.paragraphStyleId } : {},
7288
7610
  ...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
@@ -7295,7 +7617,9 @@ function toSurfaceResolvedNumbering(numbering) {
7295
7617
  ...numbering.geometry.markerLane ? { markerLane: { ...numbering.geometry.markerLane } } : {},
7296
7618
  ...numbering.geometry.textColumn ? { textColumn: { ...numbering.geometry.textColumn } } : {}
7297
7619
  },
7298
- ...numbering.picBulletMediaId ? { picBulletMediaId: numbering.picBulletMediaId } : {}
7620
+ ...numbering.picBulletId ? { picBulletId: numbering.picBulletId } : {},
7621
+ ...numbering.picBulletMediaId ? { picBulletMediaId: numbering.picBulletMediaId } : {},
7622
+ ...numbering.pictureBulletPosture ? { pictureBulletPosture: { ...numbering.pictureBulletPosture } } : {}
7299
7623
  };
7300
7624
  }
7301
7625
  function describePreservedInlinePreview(payloadReference) {
@@ -1,8 +1,8 @@
1
- import { C as CanonicalDocumentEnvelope, S as SelectionSnapshot, g as TransactionMapping } from '../../public-types-gvubspUI.cjs';
1
+ import { C as CanonicalDocumentEnvelope, e as SelectionSnapshot, i as TransactionMapping } from '../../public-types-S8gTYwKo.cjs';
2
2
  import 'react';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
- import '../../canonical-document-BMtONpgf.cjs';
5
+ import '../../canonical-document-CfZIc-fC.cjs';
6
6
  import 'prosemirror-state';
7
7
  import 'prosemirror-model';
8
8
 
@@ -1,8 +1,8 @@
1
- import { C as CanonicalDocumentEnvelope, S as SelectionSnapshot, g as TransactionMapping } from '../../public-types-DyqnxxO9.js';
1
+ import { C as CanonicalDocumentEnvelope, e as SelectionSnapshot, i as TransactionMapping } from '../../public-types-B5lOUIrP.js';
2
2
  import 'react';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
- import '../../canonical-document-BMtONpgf.js';
5
+ import '../../canonical-document-CfZIc-fC.js';
6
6
  import 'prosemirror-state';
7
7
  import 'prosemirror-model';
8
8
 
@@ -2,13 +2,13 @@ import {
2
2
  insertImage,
3
3
  repositionFloatingImage,
4
4
  resizeImage
5
- } from "../../chunk-KNHMXKC6.js";
6
- import "../../chunk-T5YYFDZB.js";
7
- import "../../chunk-PHMWH23E.js";
5
+ } from "../../chunk-INLRCC4N.js";
6
+ import "../../chunk-MQ5GAJ54.js";
7
+ import "../../chunk-QTRJLKR2.js";
8
8
  import "../../chunk-QIO6V46H.js";
9
- import "../../chunk-A3GSNB4G.js";
9
+ import "../../chunk-XBQFDBXE.js";
10
10
  import "../../chunk-OYGMRRR7.js";
11
- import "../../chunk-A66ZVUAT.js";
11
+ import "../../chunk-5KTJKTNE.js";
12
12
  import "../../chunk-UFVDIR2C.js";
13
13
  import "../../chunk-PGGPPZ65.js";
14
14
  import "../../chunk-DNXYUIIS.js";
@@ -1,5 +1,5 @@
1
- import { h as SelectionSnapshot, M as MarginPresetDefinition, i as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-gvubspUI.cjs';
2
- import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-BMtONpgf.cjs';
1
+ import { j as SelectionSnapshot, M as MarginPresetDefinition, k as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-S8gTYwKo.cjs';
2
+ import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-CfZIc-fC.cjs';
3
3
  import 'react';
4
4
  import 'yjs';
5
5
  import 'y-protocols/awareness';
@@ -1,5 +1,5 @@
1
- import { h as SelectionSnapshot, M as MarginPresetDefinition, i as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-DyqnxxO9.js';
2
- import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-BMtONpgf.js';
1
+ import { j as SelectionSnapshot, M as MarginPresetDefinition, k as PageFormatDefinition, R as RuntimeRenderSnapshot } from '../../public-types-B5lOUIrP.js';
2
+ import { C as CanonicalDocument, P as PageSize, a as PageMargins, b as ColumnProperties, c as PageNumbering } from '../../canonical-document-CfZIc-fC.js';
3
3
  import 'react';
4
4
  import 'yjs';
5
5
  import 'y-protocols/awareness';
@@ -1,8 +1,8 @@
1
- import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-gvubspUI.cjs';
1
+ import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-S8gTYwKo.cjs';
2
2
  import 'react';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
- import '../../canonical-document-BMtONpgf.cjs';
5
+ import '../../canonical-document-CfZIc-fC.cjs';
6
6
  import 'prosemirror-state';
7
7
  import 'prosemirror-model';
8
8
 
@@ -1,8 +1,8 @@
1
- import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-DyqnxxO9.js';
1
+ import { P as PersistedEditorSnapshot, R as RuntimeRenderSnapshot } from '../../public-types-B5lOUIrP.js';
2
2
  import 'react';
3
3
  import 'yjs';
4
4
  import 'y-protocols/awareness';
5
- import '../../canonical-document-BMtONpgf.js';
5
+ import '../../canonical-document-CfZIc-fC.js';
6
6
  import 'prosemirror-state';
7
7
  import 'prosemirror-model';
8
8