@beyondwork/docx-react-component 1.0.124 → 1.0.125

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 (101) hide show
  1. package/dist/api/public-types.cjs +147 -35
  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 +3 -3
  5. package/dist/api/v3.cjs +791 -101
  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-CG2TgAzj.d.cts → canonical-document-CXCFCbAz.d.cts} +2 -0
  10. package/dist/{canonical-document-CG2TgAzj.d.ts → canonical-document-CXCFCbAz.d.ts} +2 -0
  11. package/dist/{chunk-PFYUJU3Q.js → chunk-2QL5DAKF.js} +98 -43
  12. package/dist/{chunk-4IPEZYQX.js → chunk-4EENH4FG.js} +1 -1
  13. package/dist/{chunk-BOHHIVQ2.js → chunk-4G3OS2H6.js} +3 -3
  14. package/dist/{chunk-A74Y5NE4.js → chunk-4YJVRIUB.js} +52 -21
  15. package/dist/{chunk-FNWKE74J.js → chunk-5DGKFNQT.js} +5 -1
  16. package/dist/{chunk-RSYN6FTS.js → chunk-6F5QW44A.js} +2 -2
  17. package/dist/{chunk-KOHQFZMM.js → chunk-BYSRJ4FE.js} +1 -1
  18. package/dist/{chunk-H6IL5ABU.js → chunk-CXSYRB37.js} +64 -20
  19. package/dist/{chunk-32ZAOQ54.js → chunk-D5HYZQTG.js} +1 -1
  20. package/dist/{chunk-TY4DIJO3.js → chunk-ESJ2MES5.js} +1 -1
  21. package/dist/{chunk-ZMRO6P3A.js → chunk-JN444Z5S.js} +505 -44
  22. package/dist/{chunk-IR7QV2BX.js → chunk-KV435YXO.js} +2 -2
  23. package/dist/{chunk-N4VIXI2Z.js → chunk-MWSBGJQO.js} +137 -18
  24. package/dist/{chunk-Q76XPPTA.js → chunk-OHTK7F3F.js} +96 -13
  25. package/dist/{chunk-MPH4ZQS4.js → chunk-QT3LX4FA.js} +321 -51
  26. package/dist/{chunk-7PC6XUNO.js → chunk-TQDQU2E3.js} +2 -2
  27. package/dist/{chunk-4B74ETJI.js → chunk-V6XVZFFH.js} +2 -2
  28. package/dist/{chunk-NAMAWCXN.js → chunk-YD2JE54B.js} +1 -1
  29. package/dist/{chunk-ZRHLLPSJ.js → chunk-YHZHPXDB.js} +85 -18
  30. package/dist/{chunk-HXHQA4BU.js → chunk-YIYM4ZAP.js} +1 -1
  31. package/dist/{chunk-LGWNN3L2.js → chunk-ZDOAUP3V.js} +2 -2
  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 +65 -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 +65 -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 +66 -21
  49. package/dist/core/commands/text-commands.d.cts +2 -2
  50. package/dist/core/commands/text-commands.d.ts +2 -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 +1341 -193
  57. package/dist/index.d.cts +5 -5
  58. package/dist/index.d.ts +5 -5
  59. package/dist/index.js +39 -21
  60. package/dist/io/docx-session.cjs +51 -20
  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.cjs +36 -12
  65. package/dist/legal.d.cts +1 -1
  66. package/dist/legal.d.ts +1 -1
  67. package/dist/legal.js +3 -3
  68. package/dist/{loader-D9y4ZRjj.d.ts → loader-B1MxvbeV.d.ts} +3 -3
  69. package/dist/{loader-D9KCtj4m.d.cts → loader-CJXsswcd.d.cts} +3 -3
  70. package/dist/{public-types-CNnMHZM9.d.ts → public-types-BEGhv2YR.d.ts} +108 -6
  71. package/dist/{public-types-DajNGKV4.d.cts → public-types-DrhlQ5Zy.d.cts} +108 -6
  72. package/dist/public-types.cjs +147 -35
  73. package/dist/public-types.d.cts +2 -2
  74. package/dist/public-types.d.ts +2 -2
  75. package/dist/public-types.js +3 -3
  76. package/dist/runtime/collab.d.cts +3 -3
  77. package/dist/runtime/collab.d.ts +3 -3
  78. package/dist/runtime/document-runtime.cjs +685 -98
  79. package/dist/runtime/document-runtime.d.cts +2 -2
  80. package/dist/runtime/document-runtime.d.ts +2 -2
  81. package/dist/runtime/document-runtime.js +14 -14
  82. package/dist/{session-DyQGlryH.d.cts → session-Bp3zqnkS.d.cts} +3 -3
  83. package/dist/{session-DEmaOEjA.d.ts → session-xMOU_NtL.d.ts} +3 -3
  84. package/dist/session.cjs +51 -20
  85. package/dist/session.d.cts +5 -5
  86. package/dist/session.d.ts +5 -5
  87. package/dist/session.js +5 -5
  88. package/dist/tailwind.cjs +238 -73
  89. package/dist/tailwind.d.cts +2 -2
  90. package/dist/tailwind.d.ts +2 -2
  91. package/dist/tailwind.js +7 -7
  92. package/dist/{types-DjJNaE9c.d.ts → types-BFT8536T.d.ts} +2 -2
  93. package/dist/{types-CxE1aZiv.d.cts → types-DDPxEygX.d.cts} +2 -2
  94. package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +3 -3
  95. package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +3 -3
  96. package/dist/ui-tailwind/editor-surface/search-plugin.js +4 -4
  97. package/dist/ui-tailwind.cjs +238 -73
  98. package/dist/ui-tailwind.d.cts +3 -3
  99. package/dist/ui-tailwind.d.ts +3 -3
  100. package/dist/ui-tailwind.js +7 -7
  101. package/package.json +1 -1
@@ -10,7 +10,7 @@ import {
10
10
  import {
11
11
  NO_EDITABLE_TARGETS_INDEX,
12
12
  createEditorSurfaceSnapshot
13
- } from "./chunk-H6IL5ABU.js";
13
+ } from "./chunk-CXSYRB37.js";
14
14
  import {
15
15
  createSelectionSnapshot
16
16
  } from "./chunk-OYGMRRR7.js";
@@ -803,7 +803,7 @@ function parseCanonicalTextLeafPath(path) {
803
803
  if (normalized[offset] !== "/") return null;
804
804
  offset += 1;
805
805
  }
806
- return tokens.some((token) => token.kind === "txbx") ? tokens : null;
806
+ return tokens.length > 0 ? tokens : null;
807
807
  }
808
808
  function parseCanonicalHyperlinkPath(path) {
809
809
  const blockStart = path.indexOf("/block[");
@@ -3,17 +3,17 @@ import {
3
3
  PAGE_STACK_GAP_PX,
4
4
  defaultChromeReservations,
5
5
  resolveDefaultZoom
6
- } from "./chunk-ZRHLLPSJ.js";
6
+ } from "./chunk-YHZHPXDB.js";
7
7
  import {
8
8
  storyTargetKey
9
- } from "./chunk-H6IL5ABU.js";
9
+ } from "./chunk-CXSYRB37.js";
10
10
  import {
11
11
  MAIN_STORY_KEY,
12
12
  collectCanonicalLayoutInputs,
13
13
  collectStoryBlockContexts,
14
14
  createHeaderFooterStoryKey,
15
15
  createNoteStoryKey
16
- } from "./chunk-FNWKE74J.js";
16
+ } from "./chunk-5DGKFNQT.js";
17
17
  import {
18
18
  MAIN_STORY_TARGET
19
19
  } from "./chunk-M2HUK3KF.js";
@@ -1198,6 +1198,27 @@ function hitTestRegion(index, region, point) {
1198
1198
  (target2) => target2.regionId === region.regionId
1199
1199
  );
1200
1200
  const containing = targets.filter((target2) => containsPoint(target2.rect, point));
1201
+ const generatedTarget = containing.find(
1202
+ (target2) => target2.generatedContentKind === "numbering-marker"
1203
+ );
1204
+ if (generatedTarget) {
1205
+ const anchorHit2 = firstLineAnchor(index, generatedTarget)?.runtimeOffset !== void 0 ? {
1206
+ runtimeOffset: firstLineAnchor(index, generatedTarget).runtimeOffset,
1207
+ assoc: "before"
1208
+ } : resolveLineAnchorHit(index, generatedTarget, point);
1209
+ return {
1210
+ pageIndex: generatedTarget.pageIndex,
1211
+ regionKind: generatedTarget.regionKind,
1212
+ blockId: generatedTarget.blockId,
1213
+ fragmentId: generatedTarget.fragmentId,
1214
+ lineIndex: generatedTarget.lineIndex,
1215
+ runtimeOffset: anchorHit2?.runtimeOffset ?? 0,
1216
+ assoc: "before",
1217
+ generatedContentKind: generatedTarget.generatedContentKind,
1218
+ generatedContentBoundary: generatedTarget.generatedContentBoundary?.policy,
1219
+ semanticEntryId: generatedTarget.targetId.startsWith("hit:") ? generatedTarget.targetId.slice("hit:".length) : generatedTarget.targetId
1220
+ };
1221
+ }
1201
1222
  const target = nearestTarget(containing, point) ?? nearestTarget(targets, point);
1202
1223
  if (!target) return null;
1203
1224
  const anchorHit = resolveLineAnchorHit(index, target, point);
@@ -1574,6 +1595,7 @@ function projectGeometryIndexFromFrame(frame, options) {
1574
1595
  identities,
1575
1596
  storyKey: storyKey2,
1576
1597
  entries: semanticEntries,
1598
+ hitTargets,
1577
1599
  projectedBlocksByStory,
1578
1600
  projectedCommandTargetsByKey,
1579
1601
  precision,
@@ -1844,6 +1866,7 @@ function appendBlockSemanticEntries(input) {
1844
1866
  identities,
1845
1867
  storyKey: storyKey2,
1846
1868
  entries,
1869
+ hitTargets,
1847
1870
  projectedBlocksByStory,
1848
1871
  projectedCommandTargetsByKey,
1849
1872
  precision,
@@ -1873,6 +1896,7 @@ function appendBlockSemanticEntries(input) {
1873
1896
  block,
1874
1897
  sourceIdentity: sliceIdentity,
1875
1898
  entries,
1899
+ hitTargets,
1876
1900
  projectedCommandTargetsByKey,
1877
1901
  precision,
1878
1902
  frameCompleteness,
@@ -2054,6 +2078,7 @@ function appendFragmentLayoutObjectSemanticEntries(input) {
2054
2078
  block,
2055
2079
  sourceIdentity,
2056
2080
  entries,
2081
+ hitTargets,
2057
2082
  projectedCommandTargetsByKey,
2058
2083
  precision,
2059
2084
  frameCompleteness,
@@ -2138,18 +2163,57 @@ function appendFragmentLayoutObjectSemanticEntries(input) {
2138
2163
  }
2139
2164
  return;
2140
2165
  }
2141
- if (layoutObject.kind === "numbered-paragraph") {
2142
- const markerProjection = resolveNumberingMarkerProjection(block);
2166
+ const numberingRows = layoutObject.numberingRows && layoutObject.numberingRows.length > 0 ? layoutObject.numberingRows : layoutObject.kind === "numbered-paragraph" && layoutObject.numbering ? [layoutObject.numbering] : [];
2167
+ for (let index = 0; index < numberingRows.length; index += 1) {
2168
+ const numbering = numberingRows[index];
2169
+ const markerProjection = resolveNumberingMarkerProjection(block, numbering);
2170
+ const entryId = layoutObject.kind === "numbered-paragraph" && index === 0 ? `semantic:numbering-marker:${base.sliceId}` : `semantic:numbering-marker:${base.sliceId}:${stableGeometryId(
2171
+ numbering.numberingLayoutId ?? numbering.numberingKey ?? String(index)
2172
+ )}`;
2173
+ const source = numberingSourceIdentity(numbering, sourceIdentity);
2143
2174
  entries.push({
2144
2175
  ...base,
2145
- entryId: `semantic:numbering-marker:${base.sliceId}`,
2176
+ entryId,
2146
2177
  kind: "numbering-marker",
2147
2178
  layoutObjectId: layoutObject.objectId,
2179
+ numberingLayoutId: numbering.numberingLayoutId,
2180
+ numberingKey: numbering.numberingKey,
2181
+ numberingTargetKey: numbering.targetKey,
2182
+ numberingTargetKind: numbering.targetKind,
2183
+ numberingCanonicalAddressKey: numbering.canonicalAddressKey,
2184
+ numberingListAddressKey: numbering.listAddressKey,
2185
+ numberingMarkerText: numbering.markerText,
2186
+ numberingMarkerSuffix: numbering.markerSuffix,
2187
+ numberingFormat: numbering.format,
2188
+ numberingFormatPosture: numbering.formatPosture,
2189
+ numberingUnavailableReasons: numbering.unavailableReasons,
2190
+ markerGlyphRect: markerProjection.rect,
2191
+ markerLaneRect: markerProjection.markerLaneRect,
2192
+ textColumnRect: markerProjection.textColumnRect,
2193
+ markerBoundary: markerProjection.markerBoundary,
2148
2194
  rect: markerProjection.rect,
2149
2195
  status: markerProjection.status,
2150
2196
  precision: markerProjection.precision,
2151
2197
  frameCompleteness,
2152
- ...sourceIdentity ? { sourceIdentity } : {}
2198
+ ...source ? { sourceIdentity: source } : {}
2199
+ });
2200
+ hitTargets.push({
2201
+ targetId: `hit:${entryId}`,
2202
+ pageId: base.pageId,
2203
+ pageIndex: base.pageIndex,
2204
+ regionId: base.regionId,
2205
+ regionKind: base.regionKind,
2206
+ blockId: base.blockId,
2207
+ fragmentId: base.fragmentId,
2208
+ lineIndex: firstLineIndex(block),
2209
+ rect: markerProjection.rect,
2210
+ precision: markerProjection.precision,
2211
+ generatedContentKind: "numbering-marker",
2212
+ generatedContentBoundary: {
2213
+ policy: "snap-to-authored-text",
2214
+ authoredTextStartsAtPx: markerProjection.markerBoundary.authoredTextStartsAtPx,
2215
+ selectionPolicy: "exclude-generated-marker"
2216
+ }
2153
2217
  });
2154
2218
  recordPrecision(precision, markerProjection.precision);
2155
2219
  }
@@ -2240,8 +2304,8 @@ function bookmarkRangeSourceIdentity(fact, fallback) {
2240
2304
  joinKind: "block-scoped"
2241
2305
  };
2242
2306
  }
2243
- function resolveNumberingMarkerProjection(block) {
2244
- const metadata = resolveNumberingMarkerProjectionMetadata(block);
2307
+ function resolveNumberingMarkerProjection(block, numbering) {
2308
+ const metadata = resolveNumberingMarkerProjectionMetadata(block, numbering);
2245
2309
  const blockFrame = block.frame;
2246
2310
  if (metadata.markerLane && metadata.measuredWidthTwips !== void 0) {
2247
2311
  const markerLane = metadata.markerLane;
@@ -2252,14 +2316,25 @@ function resolveNumberingMarkerProjection(block) {
2252
2316
  const rawRightPx = rawLeftPx + markerLane.widthTwips * pxPerTwip;
2253
2317
  const leftPx = clamp(rawLeftPx, blockLeftPx, blockRightPx);
2254
2318
  const rightPx = clamp(rawRightPx, leftPx, blockRightPx);
2319
+ const markerLaneRect = {
2320
+ leftPx,
2321
+ topPx: blockFrame.topPx,
2322
+ widthPx: rightPx - leftPx,
2323
+ heightPx: blockFrame.heightPx,
2324
+ space: "frame",
2325
+ precision: metadata.precision
2326
+ };
2327
+ const textColumnRect = metadata.textColumn ? projectTextColumnRect(blockFrame, metadata.measuredWidthTwips, metadata.textColumn) : void 0;
2255
2328
  return {
2256
- rect: {
2257
- leftPx,
2258
- topPx: blockFrame.topPx,
2259
- widthPx: rightPx - leftPx,
2260
- heightPx: blockFrame.heightPx,
2261
- space: "frame",
2262
- precision: metadata.precision
2329
+ rect: markerLaneRect,
2330
+ markerLaneRect,
2331
+ ...textColumnRect ? { textColumnRect } : {},
2332
+ markerBoundary: {
2333
+ generatedContent: "numbering-marker",
2334
+ caretPolicy: "snap-to-authored-text",
2335
+ selectionPolicy: "exclude-marker-unless-list-item-action",
2336
+ coordinateSpace: "frame-px",
2337
+ ...textColumnRect ? { authoredTextStartsAtPx: textColumnRect.leftPx } : {}
2263
2338
  },
2264
2339
  precision: metadata.precision,
2265
2340
  status: metadata.status
@@ -2278,20 +2353,28 @@ function resolveNumberingMarkerProjection(block) {
2278
2353
  space: "frame",
2279
2354
  precision: metadata.precision
2280
2355
  },
2356
+ markerBoundary: {
2357
+ generatedContent: "numbering-marker",
2358
+ caretPolicy: "snap-to-authored-text",
2359
+ selectionPolicy: "exclude-marker-unless-list-item-action",
2360
+ coordinateSpace: "frame-px"
2361
+ },
2281
2362
  precision: metadata.precision,
2282
2363
  status: metadata.status
2283
2364
  };
2284
2365
  }
2285
- function resolveNumberingMarkerProjectionMetadata(block) {
2366
+ function resolveNumberingMarkerProjectionMetadata(block, numbering) {
2286
2367
  const blockFrame = block.frame;
2287
2368
  const layoutObject = block.fragment.layoutObject;
2288
- const markerLane = layoutObject?.kind === "numbered-paragraph" ? layoutObject.numbering?.markerLane : void 0;
2369
+ const markerLane = numbering?.markerLane ?? (layoutObject?.kind === "numbered-paragraph" ? layoutObject.numbering?.markerLane : void 0);
2370
+ const textColumn = numbering?.textColumn ?? (layoutObject?.kind === "numbered-paragraph" ? layoutObject.numbering?.textColumn : void 0);
2289
2371
  const measuredWidthTwips = layoutObject?.measuredExtentTwips.widthTwips;
2290
2372
  if (markerLane && markerLane.widthTwips > 0 && measuredWidthTwips !== void 0 && measuredWidthTwips > 0 && Number.isFinite(blockFrame.widthPx)) {
2291
2373
  return {
2292
2374
  precision: "within-tolerance",
2293
2375
  status: "realized",
2294
2376
  markerLane,
2377
+ ...textColumn ? { textColumn } : {},
2295
2378
  measuredWidthTwips
2296
2379
  };
2297
2380
  }
@@ -2300,6 +2383,42 @@ function resolveNumberingMarkerProjectionMetadata(block) {
2300
2383
  status: "requires-rehydration"
2301
2384
  };
2302
2385
  }
2386
+ function projectTextColumnRect(blockFrame, measuredWidthTwips, textColumn) {
2387
+ if (measuredWidthTwips <= 0 || !Number.isFinite(blockFrame.widthPx)) {
2388
+ return void 0;
2389
+ }
2390
+ const pxPerTwip = blockFrame.widthPx / measuredWidthTwips;
2391
+ const leftPx = blockFrame.leftPx + textColumn.startTwips * pxPerTwip;
2392
+ const rightInsetPx = (textColumn.rightTwips ?? 0) * pxPerTwip;
2393
+ const rightPx = blockFrame.leftPx + blockFrame.widthPx - rightInsetPx;
2394
+ if (rightPx < leftPx) return void 0;
2395
+ return {
2396
+ leftPx,
2397
+ topPx: blockFrame.topPx,
2398
+ widthPx: rightPx - leftPx,
2399
+ heightPx: blockFrame.heightPx,
2400
+ space: "frame",
2401
+ precision: "within-tolerance"
2402
+ };
2403
+ }
2404
+ function numberingSourceIdentity(numbering, fallback) {
2405
+ const storyKey2 = numbering.storyKey ?? fallback?.storyKey;
2406
+ if (!storyKey2) return fallback;
2407
+ return {
2408
+ storyKey: storyKey2,
2409
+ ...numbering.sourceBlockPath ?? fallback?.blockPath ? { blockPath: numbering.sourceBlockPath ?? fallback?.blockPath } : {},
2410
+ ...numbering.numberingKey ?? fallback?.scopeKey ? { scopeKey: numbering.numberingKey ?? fallback?.scopeKey } : {},
2411
+ ...numbering.numberingInstanceId ?? fallback?.scopeId ? { scopeId: numbering.numberingInstanceId ?? fallback?.scopeId } : {},
2412
+ ...numbering.numberingSourceRef ?? numbering.sourceRef ?? fallback?.sourceRef ? { sourceRef: numbering.numberingSourceRef ?? numbering.sourceRef ?? fallback?.sourceRef } : {},
2413
+ joinKind: "block-scoped"
2414
+ };
2415
+ }
2416
+ function stableGeometryId(value) {
2417
+ return value.replace(/[^A-Za-z0-9_.:-]+/gu, "_");
2418
+ }
2419
+ function firstLineIndex(block) {
2420
+ return block.lines[0]?.line.lineIndex ?? 0;
2421
+ }
2303
2422
  function countBlockSemanticEntries(block) {
2304
2423
  const counts = createPrecisionCounts();
2305
2424
  const layoutObject = block.fragment.layoutObject;
@@ -7,27 +7,27 @@ import {
7
7
  resolveSectionForStoryTarget,
8
8
  searchSecondaryStories,
9
9
  searchSurfaceBlocks
10
- } from "./chunk-ZRHLLPSJ.js";
10
+ } from "./chunk-YHZHPXDB.js";
11
11
  import {
12
12
  createEditorSurfaceSnapshot,
13
13
  createFormattingContext,
14
14
  resolveTableStyleResolution
15
- } from "./chunk-H6IL5ABU.js";
15
+ } from "./chunk-CXSYRB37.js";
16
16
  import {
17
17
  createSelectionSnapshot
18
18
  } from "./chunk-OYGMRRR7.js";
19
19
  import {
20
20
  normalizeParsedTextDocument
21
- } from "./chunk-TY4DIJO3.js";
21
+ } from "./chunk-ESJ2MES5.js";
22
22
  import {
23
23
  buildFieldRegistry,
24
24
  parseMainDocumentXml,
25
25
  parseTocLevelRange
26
- } from "./chunk-A74Y5NE4.js";
26
+ } from "./chunk-4YJVRIUB.js";
27
27
  import {
28
28
  collectEditableTargetRefs,
29
29
  validateEditableTargetRef
30
- } from "./chunk-FNWKE74J.js";
30
+ } from "./chunk-5DGKFNQT.js";
31
31
  import {
32
32
  serializeMainDocument
33
33
  } from "./chunk-EB6M3GE6.js";
@@ -530,6 +530,24 @@ function refusalIdForPostureBlocker(target, blocker) {
530
530
  return "editable_target_opaque_content";
531
531
  case "synthetic-layout-cell":
532
532
  return "editable_target_synthetic_layout_cell";
533
+ case "list-text-readback-missing":
534
+ return "list_text_readback_missing";
535
+ case "list-structure-command-missing":
536
+ return "list_structure_command_missing";
537
+ case "list-target-stale":
538
+ return "list_target_stale";
539
+ case "list-secondary-story-unsupported":
540
+ return "list_secondary_story_unsupported";
541
+ case "list-table-target-missing":
542
+ return "list_table_target_missing";
543
+ case "list-export-persistence-missing":
544
+ return "list_export_persistence_missing";
545
+ case "numbering-format-unsupported":
546
+ return "numbering_format_unsupported";
547
+ case "picture-bullet-preserve-only":
548
+ return "picture_bullet_preserve_only";
549
+ case "marker-geometry-unavailable":
550
+ return "marker_geometry_unavailable";
533
551
  case "unmodeled-target":
534
552
  return target.commandFamily === "link-bookmark" ? "editable_target_linked_content_unmodeled" : "editable_target_unmodeled";
535
553
  }
@@ -552,12 +570,42 @@ function auditCategoryForPostureBlocker(target, blocker) {
552
570
  return target.commandFamily === "link-bookmark" ? "linked-content" : "unsupported-command";
553
571
  case "synthetic-layout-cell":
554
572
  return "synthetic-cell";
573
+ case "list-target-stale":
574
+ return "stale-ref";
575
+ case "picture-bullet-preserve-only":
576
+ case "list-export-persistence-missing":
577
+ return "preserve-only";
578
+ case "list-text-readback-missing":
579
+ case "list-structure-command-missing":
580
+ case "list-secondary-story-unsupported":
581
+ case "list-table-target-missing":
582
+ case "numbering-format-unsupported":
583
+ case "marker-geometry-unavailable":
584
+ return "unsupported-command";
555
585
  }
556
586
  }
557
587
  function messageForPostureBlocker(blocker) {
558
588
  switch (blocker) {
559
589
  case "synthetic-layout-cell":
560
590
  return "Hidden vertical-merge continuation or synthetic layout cells are not editable targets.";
591
+ case "list-text-readback-missing":
592
+ return "List text edits need an authoritative list-item text target before mutation.";
593
+ case "list-structure-command-missing":
594
+ return "List structure changes need a supported list command envelope before mutation.";
595
+ case "list-target-stale":
596
+ return "List target identity is stale for the current canonical document.";
597
+ case "list-secondary-story-unsupported":
598
+ return "List edits in this secondary story are not yet supported.";
599
+ case "list-table-target-missing":
600
+ return "Table-contained list item is missing a command-safe list target.";
601
+ case "list-export-persistence-missing":
602
+ return "List mutation is blocked until export/reopen persistence is available.";
603
+ case "numbering-format-unsupported":
604
+ return "Numbering format is unsupported for this list command.";
605
+ case "picture-bullet-preserve-only":
606
+ return "Picture bullet lists are preserve-only until picture bullet mutation is supported.";
607
+ case "marker-geometry-unavailable":
608
+ return "List marker geometry is unavailable for this target.";
561
609
  default:
562
610
  return void 0;
563
611
  }
@@ -1841,6 +1889,21 @@ function compileParagraphScope(entry, options = {}) {
1841
1889
  partial: true
1842
1890
  };
1843
1891
  }
1892
+ function storyKeyFromHandle(handle) {
1893
+ const target = handle.storyTarget;
1894
+ if (target.kind === "main") return "main";
1895
+ return null;
1896
+ }
1897
+ function textLeafEditableTargetHint(entry, semanticBlockRange) {
1898
+ const storyKey = storyKeyFromHandle(entry.handle);
1899
+ if (!storyKey) return void 0;
1900
+ return {
1901
+ kind: "text-leaf",
1902
+ storyKey,
1903
+ blockPath: `${storyKey}/block[${entry.blockIndex}]`,
1904
+ semanticBlockRange
1905
+ };
1906
+ }
1844
1907
  function compileParagraphReplacement(entry, proposed, options) {
1845
1908
  if (proposed.operation !== "replace" && proposed.operation !== "insert-before" && proposed.operation !== "insert-after") {
1846
1909
  return null;
@@ -1896,6 +1959,7 @@ function compileParagraphReplacement(entry, proposed, options) {
1896
1959
  {
1897
1960
  kind: stepKind,
1898
1961
  summary: stepKind === "text-replace" ? actionSummary : `suggest-mode ${actionSummary}`,
1962
+ ...textLeafEditableTargetHint(entry, blockRange) ? { editableTargetHint: textLeafEditableTargetHint(entry, blockRange) } : {},
1899
1963
  range: { from: operationRange.from, to: operationRange.to },
1900
1964
  text,
1901
1965
  ...proposed.formatting ? { formatting: proposed.formatting } : {}
@@ -1923,6 +1987,7 @@ function compileParagraphReplacement(entry, proposed, options) {
1923
1987
  {
1924
1988
  kind: "fragment-replace",
1925
1989
  summary: actionSummary,
1990
+ ...textLeafEditableTargetHint(entry, blockRange) ? { editableTargetHint: textLeafEditableTargetHint(entry, blockRange) } : {},
1926
1991
  range: { from: operationRange.from, to: operationRange.to },
1927
1992
  fragment
1928
1993
  }
@@ -3845,14 +3910,17 @@ function paragraphHasBookmarkId(paragraph, bookmarkId) {
3845
3910
  function commandActionHandleForAddress(commandFamily, address) {
3846
3911
  return address ? `scope-command:${commandFamily}:${address.addressKey}` : void 0;
3847
3912
  }
3848
- function withCommandAction(evidence, target) {
3849
- if (evidence.status !== "supported" || !target.canonicalAddress) return evidence;
3913
+ function withCommandAction(evidence, target, canonicalAddress = target.canonicalAddress) {
3914
+ if (evidence.status !== "supported" || !canonicalAddress) return evidence;
3850
3915
  return {
3851
3916
  ...evidence,
3852
- actionHandle: commandActionHandleForAddress(target.commandFamily, target.canonicalAddress),
3853
- canonicalAddress: target.canonicalAddress
3917
+ actionHandle: commandActionHandleForAddress(target.commandFamily, canonicalAddress),
3918
+ canonicalAddress
3854
3919
  };
3855
3920
  }
3921
+ function commandAddressForTarget(target, scopeKind) {
3922
+ return scopeKind === "list-item" && target.listAddress !== void 0 ? target.listAddress : target.canonicalAddress;
3923
+ }
3856
3924
  function runtimeTextCommandEvidence(target, workflowBlockers) {
3857
3925
  const shapeIssues = validateEditableTargetRef(target);
3858
3926
  if (shapeIssues.length > 0) {
@@ -3905,6 +3973,9 @@ var TABLE_TEXT_TARGET_KINDS2 = /* @__PURE__ */ new Set([
3905
3973
  var LIST_TEXT_TARGET_KINDS2 = /* @__PURE__ */ new Set([
3906
3974
  "paragraph-text",
3907
3975
  "sdt-paragraph-text",
3976
+ "table-cell-paragraph-text",
3977
+ "nested-table-cell-paragraph-text",
3978
+ "sdt-table-cell-paragraph-text",
3908
3979
  "secondary-story-paragraph-text"
3909
3980
  ]);
3910
3981
  function tableTextScopeReplacementPosture(target) {
@@ -3955,7 +4026,7 @@ function runtimeCommandEvidence(target, workflowBlockers, textCommand, scopeKind
3955
4026
  intents: commandIntentsForTarget(target, scopeKind),
3956
4027
  reason: textCommand.reason,
3957
4028
  ...textCommand.blockers ? { blockers: textCommand.blockers } : {}
3958
- }, target);
4029
+ }, target, commandAddressForTarget(target, scopeKind));
3959
4030
  }
3960
4031
  if (target.commandFamily === "comment-revision") {
3961
4032
  const isOpen = target.review?.status === "open";
@@ -8061,19 +8132,19 @@ function locateTargetRange(document, surface, target) {
8061
8132
  if (!sdt || sdt.kind !== "sdt_block") return null;
8062
8133
  const paragraph = sdt.children[sdtPath.childIndex];
8063
8134
  if (!paragraph || paragraph.kind !== "paragraph") return null;
8064
- return { from: paragraph.from, to: paragraph.to };
8135
+ return textLeafTargetRange(target, paragraph.from, paragraph.to);
8065
8136
  }
8066
8137
  const paragraphPath = parseTopLevelParagraphPath(target.blockPath);
8067
8138
  if (paragraphPath) {
8068
8139
  const paragraph = surface[paragraphPath.blockIndex];
8069
8140
  if (!paragraph || paragraph.kind !== "paragraph") return null;
8070
- return { from: paragraph.from, to: paragraph.to };
8141
+ return textLeafTargetRange(target, paragraph.from, paragraph.to);
8071
8142
  }
8072
8143
  const secondaryParagraphPath = parseSecondaryStoryParagraphPath(target.blockPath);
8073
8144
  if (secondaryParagraphPath) {
8074
8145
  const paragraph = surface[secondaryParagraphPath.blockIndex];
8075
8146
  if (!paragraph || paragraph.kind !== "paragraph") return null;
8076
- return { from: paragraph.from, to: paragraph.to };
8147
+ return textLeafTargetRange(target, paragraph.from, paragraph.to);
8077
8148
  }
8078
8149
  if (target.kind === "textbox-paragraph-text") {
8079
8150
  return {
@@ -8089,6 +8160,18 @@ function locateTargetRange(document, surface, target) {
8089
8160
  }
8090
8161
  return null;
8091
8162
  }
8163
+ function textLeafTargetRange(target, from, to) {
8164
+ return {
8165
+ from,
8166
+ to,
8167
+ textTarget: {
8168
+ kind: "text-leaf",
8169
+ blockPath: target.blockPath,
8170
+ paragraphStart: from,
8171
+ paragraphEnd: to
8172
+ }
8173
+ };
8174
+ }
8092
8175
  function locateHyperlinkDisplayRange(document, surface, target) {
8093
8176
  const canonical = resolveHyperlinkDisplayPath(document, target.blockPath);
8094
8177
  if (!canonical) return null;