@beyondwork/docx-react-component 1.0.124 → 1.0.126
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 +147 -35
- package/dist/api/public-types.d.cts +2 -2
- package/dist/api/public-types.d.ts +2 -2
- package/dist/api/public-types.js +3 -3
- package/dist/api/v3.cjs +796 -102
- 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-CG2TgAzj.d.cts → canonical-document-CXCFCbAz.d.cts} +2 -0
- package/dist/{canonical-document-CG2TgAzj.d.ts → canonical-document-CXCFCbAz.d.ts} +2 -0
- package/dist/{chunk-PFYUJU3Q.js → chunk-2QL5DAKF.js} +98 -43
- package/dist/{chunk-4IPEZYQX.js → chunk-4EENH4FG.js} +1 -1
- package/dist/{chunk-BOHHIVQ2.js → chunk-4G3OS2H6.js} +3 -3
- package/dist/{chunk-A74Y5NE4.js → chunk-4YJVRIUB.js} +52 -21
- package/dist/{chunk-FNWKE74J.js → chunk-5DGKFNQT.js} +5 -1
- package/dist/{chunk-RSYN6FTS.js → chunk-6F5QW44A.js} +2 -2
- package/dist/{chunk-ZMRO6P3A.js → chunk-6IGWPAR4.js} +505 -44
- package/dist/{chunk-KOHQFZMM.js → chunk-BYSRJ4FE.js} +1 -1
- package/dist/{chunk-H6IL5ABU.js → chunk-CXSYRB37.js} +64 -20
- package/dist/{chunk-32ZAOQ54.js → chunk-D5HYZQTG.js} +1 -1
- package/dist/{chunk-TY4DIJO3.js → chunk-ESJ2MES5.js} +1 -1
- package/dist/{chunk-Q76XPPTA.js → chunk-FPRWV54X.js} +101 -14
- package/dist/{chunk-MPH4ZQS4.js → chunk-GL7XRYBY.js} +624 -87
- package/dist/{chunk-IR7QV2BX.js → chunk-KV435YXO.js} +2 -2
- package/dist/{chunk-N4VIXI2Z.js → chunk-MWSBGJQO.js} +137 -18
- package/dist/{chunk-7PC6XUNO.js → chunk-TQDQU2E3.js} +2 -2
- package/dist/{chunk-4B74ETJI.js → chunk-V6XVZFFH.js} +2 -2
- package/dist/{chunk-NAMAWCXN.js → chunk-YD2JE54B.js} +1 -1
- package/dist/{chunk-ZRHLLPSJ.js → chunk-YHZHPXDB.js} +85 -18
- package/dist/{chunk-HXHQA4BU.js → chunk-YIYM4ZAP.js} +1 -1
- package/dist/{chunk-LGWNN3L2.js → chunk-ZDOAUP3V.js} +2 -2
- 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 +65 -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 +65 -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 +66 -21
- package/dist/core/commands/text-commands.d.cts +2 -2
- package/dist/core/commands/text-commands.d.ts +2 -2
- package/dist/core/commands/text-commands.js +5 -5
- package/dist/core/selection/mapping.d.cts +2 -2
- package/dist/core/selection/mapping.d.ts +2 -2
- package/dist/core/state/editor-state.d.cts +2 -2
- package/dist/core/state/editor-state.d.ts +2 -2
- package/dist/index.cjs +1677 -240
- package/dist/index.d.cts +5 -5
- package/dist/index.d.ts +5 -5
- package/dist/index.js +62 -25
- package/dist/io/docx-session.cjs +51 -20
- 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.cjs +36 -12
- package/dist/legal.d.cts +1 -1
- package/dist/legal.d.ts +1 -1
- package/dist/legal.js +3 -3
- package/dist/{loader-D9y4ZRjj.d.ts → loader-CS9-9KFa.d.ts} +3 -3
- package/dist/{loader-D9KCtj4m.d.cts → loader-OoWJ1_17.d.cts} +3 -3
- package/dist/{public-types-CNnMHZM9.d.ts → public-types-BP3vqJR5.d.cts} +157 -11
- package/dist/{public-types-DajNGKV4.d.cts → public-types-DdcHqcow.d.ts} +157 -11
- package/dist/public-types.cjs +147 -35
- package/dist/public-types.d.cts +2 -2
- package/dist/public-types.d.ts +2 -2
- package/dist/public-types.js +3 -3
- package/dist/runtime/collab.d.cts +3 -3
- package/dist/runtime/collab.d.ts +3 -3
- package/dist/runtime/document-runtime.cjs +945 -134
- 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-DyQGlryH.d.cts → session-Cq-fzx3B.d.cts} +3 -3
- package/dist/{session-DEmaOEjA.d.ts → session-DyFQt8Ph.d.ts} +3 -3
- package/dist/session.cjs +51 -20
- package/dist/session.d.cts +5 -5
- package/dist/session.d.ts +5 -5
- package/dist/session.js +5 -5
- package/dist/tailwind.cjs +238 -73
- package/dist/tailwind.d.cts +2 -2
- package/dist/tailwind.d.ts +2 -2
- package/dist/tailwind.js +7 -7
- package/dist/{types-CxE1aZiv.d.cts → types-Bg7D-GD3.d.cts} +2 -2
- package/dist/{types-DjJNaE9c.d.ts → types-bJAgMq1M.d.ts} +2 -2
- package/dist/ui-tailwind/editor-surface/search-plugin.d.cts +3 -3
- package/dist/ui-tailwind/editor-surface/search-plugin.d.ts +3 -3
- package/dist/ui-tailwind/editor-surface/search-plugin.js +4 -4
- package/dist/ui-tailwind.cjs +238 -73
- package/dist/ui-tailwind.d.cts +3 -3
- package/dist/ui-tailwind.d.ts +3 -3
- package/dist/ui-tailwind.js +7 -7
- package/package.json +1 -1
|
@@ -4,7 +4,7 @@ import {
|
|
|
4
4
|
MAIN_STORY_KEY,
|
|
5
5
|
collectCanonicalFieldRegionIdentities,
|
|
6
6
|
collectEditableTargetRefs
|
|
7
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-5DGKFNQT.js";
|
|
8
8
|
import {
|
|
9
9
|
describeOpaqueFragment,
|
|
10
10
|
describeStructuredWrapperBlock,
|
|
@@ -1100,6 +1100,7 @@ function mergeLevelDefinition(base, override, startOverride, fallbackLevel) {
|
|
|
1100
1100
|
);
|
|
1101
1101
|
const runProperties = override?.runProperties ?? base?.runProperties;
|
|
1102
1102
|
const restartAfterLevel = override?.restartAfterLevel ?? base?.restartAfterLevel;
|
|
1103
|
+
const picBulletId = override?.picBulletId ?? base?.picBulletId;
|
|
1103
1104
|
return {
|
|
1104
1105
|
level,
|
|
1105
1106
|
format,
|
|
@@ -1110,7 +1111,8 @@ function mergeLevelDefinition(base, override, startOverride, fallbackLevel) {
|
|
|
1110
1111
|
...override?.suffix ?? base?.suffix ? { suffix: override?.suffix ?? base?.suffix } : {},
|
|
1111
1112
|
...paragraphGeometry ? { paragraphGeometry } : {},
|
|
1112
1113
|
...runProperties ? { runProperties } : {},
|
|
1113
|
-
...restartAfterLevel !== void 0 ? { restartAfterLevel } : {}
|
|
1114
|
+
...restartAfterLevel !== void 0 ? { restartAfterLevel } : {},
|
|
1115
|
+
...picBulletId !== void 0 ? { picBulletId } : {}
|
|
1114
1116
|
};
|
|
1115
1117
|
}
|
|
1116
1118
|
function withDefaultStartAt(level) {
|
|
@@ -1238,7 +1240,7 @@ function resolveHangingWidth(indentation) {
|
|
|
1238
1240
|
// src/runtime/formatting/numbering/prefix.ts
|
|
1239
1241
|
function createNumberingPrefixResolver(catalog) {
|
|
1240
1242
|
const sequenceStates = /* @__PURE__ */ new Map();
|
|
1241
|
-
function resolveInternal(numbering, paragraph) {
|
|
1243
|
+
function resolveInternal(numbering, paragraph, options = {}) {
|
|
1242
1244
|
const resolved = resolveNumberingDefinitionSet(
|
|
1243
1245
|
catalog,
|
|
1244
1246
|
paragraph?.numbering ?? numbering,
|
|
@@ -1251,29 +1253,44 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
1251
1253
|
if (!resolvedNumbering) {
|
|
1252
1254
|
return null;
|
|
1253
1255
|
}
|
|
1254
|
-
const
|
|
1255
|
-
|
|
1256
|
+
const advance = options.advance !== false;
|
|
1257
|
+
const sequenceState = getSequenceState(
|
|
1258
|
+
sequenceStates,
|
|
1259
|
+
resolvedNumbering.numberingInstanceId,
|
|
1260
|
+
{ create: advance }
|
|
1261
|
+
);
|
|
1262
|
+
if (!sequenceState) {
|
|
1263
|
+
return null;
|
|
1264
|
+
}
|
|
1265
|
+
const workingState = advance ? sequenceState : cloneSequenceState(sequenceState);
|
|
1266
|
+
advanceSequence(workingState, resolved.effectiveLevel.level, resolved.effectiveLevels);
|
|
1267
|
+
const currentCounter = workingState.counters[resolved.effectiveLevel.level];
|
|
1256
1268
|
const effectiveLevelDefs = resolved.effectiveLevel.isLegalNumbering ? new Map(
|
|
1257
1269
|
Array.from(resolved.effectiveLevels.entries()).map(([level, definition]) => [
|
|
1258
1270
|
level,
|
|
1259
1271
|
{ ...definition, format: "decimal" }
|
|
1260
1272
|
])
|
|
1261
1273
|
) : resolved.effectiveLevels;
|
|
1274
|
+
const picBulletId = resolved.effectiveLevel.picBulletId;
|
|
1262
1275
|
const text = renderLevelText(
|
|
1263
1276
|
resolved.effectiveLevel.text,
|
|
1264
|
-
|
|
1277
|
+
workingState.counters,
|
|
1265
1278
|
effectiveLevelDefs
|
|
1266
1279
|
);
|
|
1267
|
-
if (resolved.effectiveLevel.format !== "none" && text === null) {
|
|
1280
|
+
if (picBulletId == null && resolved.effectiveLevel.format !== "none" && text === null) {
|
|
1268
1281
|
return null;
|
|
1269
1282
|
}
|
|
1270
1283
|
const visibleText = resolved.effectiveLevel.format === "none" ? null : text;
|
|
1271
|
-
const
|
|
1284
|
+
const formatPosture = getNumberingFormatPosture(
|
|
1285
|
+
resolved.effectiveLevel.format,
|
|
1286
|
+
currentCounter
|
|
1287
|
+
);
|
|
1272
1288
|
const picBulletMediaId = picBulletId != null ? catalog.numPicBullets?.[picBulletId]?.mediaId : void 0;
|
|
1273
1289
|
return {
|
|
1274
1290
|
text: visibleText,
|
|
1275
1291
|
level: resolved.effectiveLevel.level,
|
|
1276
1292
|
format: resolved.effectiveLevel.format,
|
|
1293
|
+
...formatPosture !== void 0 ? { formatPosture } : {},
|
|
1277
1294
|
startAt: resolved.effectiveLevel.startAt ?? DEFAULT_NUMBERING_START_AT,
|
|
1278
1295
|
...resolved.effectiveLevel.suffix ? { suffix: resolved.effectiveLevel.suffix } : {},
|
|
1279
1296
|
...resolved.effectiveLevel.paragraphStyleId ? { paragraphStyleId: resolved.effectiveLevel.paragraphStyleId } : {},
|
|
@@ -1284,23 +1301,26 @@ function createNumberingPrefixResolver(catalog) {
|
|
|
1284
1301
|
};
|
|
1285
1302
|
}
|
|
1286
1303
|
return {
|
|
1287
|
-
resolve(numbering) {
|
|
1288
|
-
const result = resolveInternal(numbering);
|
|
1304
|
+
resolve(numbering, options) {
|
|
1305
|
+
const result = resolveInternal(numbering, void 0, options);
|
|
1289
1306
|
return result?.text ?? null;
|
|
1290
1307
|
},
|
|
1291
|
-
resolveDetailed(numbering, paragraph) {
|
|
1292
|
-
return resolveInternal(numbering, paragraph);
|
|
1308
|
+
resolveDetailed(numbering, paragraph, options) {
|
|
1309
|
+
return resolveInternal(numbering, paragraph, options);
|
|
1293
1310
|
},
|
|
1294
|
-
resolveParagraph(paragraph) {
|
|
1295
|
-
return resolveInternal(paragraph.numbering, paragraph);
|
|
1311
|
+
resolveParagraph(paragraph, options) {
|
|
1312
|
+
return resolveInternal(paragraph.numbering, paragraph, options);
|
|
1296
1313
|
}
|
|
1297
1314
|
};
|
|
1298
1315
|
}
|
|
1299
|
-
function getSequenceState(states, numberingInstanceId) {
|
|
1316
|
+
function getSequenceState(states, numberingInstanceId, options = { create: true }) {
|
|
1300
1317
|
const existing = states.get(numberingInstanceId);
|
|
1301
1318
|
if (existing) {
|
|
1302
1319
|
return existing;
|
|
1303
1320
|
}
|
|
1321
|
+
if (options.create === false) {
|
|
1322
|
+
return { counters: [], lastLevel: null };
|
|
1323
|
+
}
|
|
1304
1324
|
const created = {
|
|
1305
1325
|
counters: [],
|
|
1306
1326
|
lastLevel: null
|
|
@@ -1308,6 +1328,12 @@ function getSequenceState(states, numberingInstanceId) {
|
|
|
1308
1328
|
states.set(numberingInstanceId, created);
|
|
1309
1329
|
return created;
|
|
1310
1330
|
}
|
|
1331
|
+
function cloneSequenceState(state) {
|
|
1332
|
+
return {
|
|
1333
|
+
counters: [...state.counters],
|
|
1334
|
+
lastLevel: state.lastLevel
|
|
1335
|
+
};
|
|
1336
|
+
}
|
|
1311
1337
|
function advanceSequence(state, currentLevel, levelDefinitions) {
|
|
1312
1338
|
for (let level = currentLevel + 1; level < state.counters.length; level += 1) {
|
|
1313
1339
|
if (shouldResetDeeperLevel(level, currentLevel, levelDefinitions)) {
|
|
@@ -1339,6 +1365,25 @@ function shouldResetDeeperLevel(level, triggeringLevel, levelDefinitions) {
|
|
|
1339
1365
|
function getLevelStartAt(level, levelDefinitions) {
|
|
1340
1366
|
return levelDefinitions.get(level)?.startAt ?? DEFAULT_NUMBERING_START_AT;
|
|
1341
1367
|
}
|
|
1368
|
+
function getNumberingFormatPosture(format, value) {
|
|
1369
|
+
if (!isSupportedNumberingFormat(format)) {
|
|
1370
|
+
return {
|
|
1371
|
+
status: "approximated",
|
|
1372
|
+
requestedFormat: format,
|
|
1373
|
+
renderedFormat: "decimal",
|
|
1374
|
+
reason: "unsupported-numbering-format-decimal-fallback"
|
|
1375
|
+
};
|
|
1376
|
+
}
|
|
1377
|
+
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)) {
|
|
1378
|
+
return {
|
|
1379
|
+
status: "approximated",
|
|
1380
|
+
requestedFormat: format,
|
|
1381
|
+
renderedFormat: "decimal",
|
|
1382
|
+
reason: "numbering-format-range-decimal-fallback"
|
|
1383
|
+
};
|
|
1384
|
+
}
|
|
1385
|
+
return void 0;
|
|
1386
|
+
}
|
|
1342
1387
|
function renderLevelText(text, counters, levelDefinitions) {
|
|
1343
1388
|
if (!text) {
|
|
1344
1389
|
return null;
|
|
@@ -2181,6 +2226,7 @@ function toNumberingLayoutInput(numbering) {
|
|
|
2181
2226
|
associatedTabStops: toLayoutTabStops(numbering.geometry.tabStops, "numbering"),
|
|
2182
2227
|
level: numbering.level,
|
|
2183
2228
|
format: numbering.format,
|
|
2229
|
+
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
2184
2230
|
startAt: numbering.startAt,
|
|
2185
2231
|
...numbering.isLegalNumbering ? { isLegalNumbering: true } : {},
|
|
2186
2232
|
...numbering.picBulletMediaId ? { pictureBulletMediaId: numbering.picBulletMediaId } : {}
|
|
@@ -2410,13 +2456,10 @@ var FormattingContextImpl = class {
|
|
|
2410
2456
|
const effectiveNumbering = this.resolveEffectiveParagraphNumbering(para);
|
|
2411
2457
|
if (!effectiveNumbering) return null;
|
|
2412
2458
|
if (!emitGeometry) {
|
|
2413
|
-
|
|
2459
|
+
this.numbering.resolve(effectiveNumbering, { advance });
|
|
2414
2460
|
return null;
|
|
2415
2461
|
}
|
|
2416
|
-
|
|
2417
|
-
console.warn("[formatting-context] resolveParagraphNumbering({advance:false}) is not supported; counter always advances");
|
|
2418
|
-
}
|
|
2419
|
-
return this.numbering.resolveDetailed(effectiveNumbering, para);
|
|
2462
|
+
return this.numbering.resolveDetailed(effectiveNumbering, para, { advance });
|
|
2420
2463
|
}
|
|
2421
2464
|
resolveNumberingLayoutInput(para, options = {}) {
|
|
2422
2465
|
return toNumberingLayoutInput(this.resolveParagraphNumbering(para, options));
|
|
@@ -4692,6 +4735,7 @@ function toSurfaceResolvedNumbering(numbering) {
|
|
|
4692
4735
|
return {
|
|
4693
4736
|
level: numbering.level,
|
|
4694
4737
|
format: numbering.format,
|
|
4738
|
+
...numbering.formatPosture !== void 0 ? { formatPosture: { ...numbering.formatPosture } } : {},
|
|
4695
4739
|
...numbering.text !== null ? { text: numbering.text } : {},
|
|
4696
4740
|
startAt: numbering.startAt,
|
|
4697
4741
|
...numbering.paragraphStyleId ? { paragraphStyleId: numbering.paragraphStyleId } : {},
|
|
@@ -7,27 +7,27 @@ import {
|
|
|
7
7
|
resolveSectionForStoryTarget,
|
|
8
8
|
searchSecondaryStories,
|
|
9
9
|
searchSurfaceBlocks
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-YHZHPXDB.js";
|
|
11
11
|
import {
|
|
12
12
|
createEditorSurfaceSnapshot,
|
|
13
13
|
createFormattingContext,
|
|
14
14
|
resolveTableStyleResolution
|
|
15
|
-
} from "./chunk-
|
|
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-
|
|
21
|
+
} from "./chunk-ESJ2MES5.js";
|
|
22
22
|
import {
|
|
23
23
|
buildFieldRegistry,
|
|
24
24
|
parseMainDocumentXml,
|
|
25
25
|
parseTocLevelRange
|
|
26
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-4YJVRIUB.js";
|
|
27
27
|
import {
|
|
28
28
|
collectEditableTargetRefs,
|
|
29
29
|
validateEditableTargetRef
|
|
30
|
-
} from "./chunk-
|
|
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" || !
|
|
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,
|
|
3853
|
-
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";
|
|
@@ -8023,7 +8094,8 @@ function rejectCommand(code, message) {
|
|
|
8023
8094
|
};
|
|
8024
8095
|
}
|
|
8025
8096
|
function sameResolvedTarget2(left, right) {
|
|
8026
|
-
|
|
8097
|
+
const textTargetLengthDrift = hasTextTargetLengthDrift(left, right);
|
|
8098
|
+
return left.kind === right.kind && left.storyKey === right.storyKey && left.blockPath === right.blockPath && left.leafPath === right.leafPath && left.commandFamily === right.commandFamily && left.editability === right.editability && sameTextTargetStaleCheck(left, right) && left.staleCheck.inlineCount === right.staleCheck.inlineCount && left.staleCheck.targetHash === right.staleCheck.targetHash && left.staleCheck.targetTextLength === right.staleCheck.targetTextLength && left.staleCheck.childCount === right.staleCheck.childCount && left.staleCheck.blockType === right.staleCheck.blockType && left.staleCheck.wordParaId === right.staleCheck.wordParaId && left.staleCheck.wordTextId === right.staleCheck.wordTextId && (textTargetLengthDrift || jsonStable(left.staleCheck.sourceRef) === jsonStable(right.staleCheck.sourceRef)) && (textTargetLengthDrift || jsonStable(left.sourceRef) === jsonStable(right.sourceRef)) && jsonStable(left.table) === jsonStable(right.table) && jsonStable(left.editableOwner) === jsonStable(right.editableOwner);
|
|
8027
8099
|
}
|
|
8028
8100
|
function sameTextTargetStaleCheck(left, right) {
|
|
8029
8101
|
if (left.staleCheck.paragraphTextHash === right.staleCheck.paragraphTextHash && left.staleCheck.paragraphTextLength === right.staleCheck.paragraphTextLength) {
|
|
@@ -8031,6 +8103,9 @@ function sameTextTargetStaleCheck(left, right) {
|
|
|
8031
8103
|
}
|
|
8032
8104
|
return left.commandFamily === "text-leaf" && left.staleCheck.paragraphTextLength !== void 0 && right.staleCheck.paragraphTextLength !== void 0 && left.staleCheck.paragraphTextLength !== right.staleCheck.paragraphTextLength;
|
|
8033
8105
|
}
|
|
8106
|
+
function hasTextTargetLengthDrift(left, right) {
|
|
8107
|
+
return left.commandFamily === "text-leaf" && left.staleCheck.paragraphTextLength !== void 0 && right.staleCheck.paragraphTextLength !== void 0 && left.staleCheck.paragraphTextLength !== right.staleCheck.paragraphTextLength;
|
|
8108
|
+
}
|
|
8034
8109
|
function locateTargetRange(document, surface, target) {
|
|
8035
8110
|
if (target.kind === "hyperlink-text") {
|
|
8036
8111
|
return locateHyperlinkDisplayRange(document, surface, target);
|
|
@@ -8061,19 +8136,19 @@ function locateTargetRange(document, surface, target) {
|
|
|
8061
8136
|
if (!sdt || sdt.kind !== "sdt_block") return null;
|
|
8062
8137
|
const paragraph = sdt.children[sdtPath.childIndex];
|
|
8063
8138
|
if (!paragraph || paragraph.kind !== "paragraph") return null;
|
|
8064
|
-
return
|
|
8139
|
+
return textLeafTargetRange(target, paragraph.from, paragraph.to);
|
|
8065
8140
|
}
|
|
8066
8141
|
const paragraphPath = parseTopLevelParagraphPath(target.blockPath);
|
|
8067
8142
|
if (paragraphPath) {
|
|
8068
8143
|
const paragraph = surface[paragraphPath.blockIndex];
|
|
8069
8144
|
if (!paragraph || paragraph.kind !== "paragraph") return null;
|
|
8070
|
-
return
|
|
8145
|
+
return textLeafTargetRange(target, paragraph.from, paragraph.to);
|
|
8071
8146
|
}
|
|
8072
8147
|
const secondaryParagraphPath = parseSecondaryStoryParagraphPath(target.blockPath);
|
|
8073
8148
|
if (secondaryParagraphPath) {
|
|
8074
8149
|
const paragraph = surface[secondaryParagraphPath.blockIndex];
|
|
8075
8150
|
if (!paragraph || paragraph.kind !== "paragraph") return null;
|
|
8076
|
-
return
|
|
8151
|
+
return textLeafTargetRange(target, paragraph.from, paragraph.to);
|
|
8077
8152
|
}
|
|
8078
8153
|
if (target.kind === "textbox-paragraph-text") {
|
|
8079
8154
|
return {
|
|
@@ -8089,6 +8164,18 @@ function locateTargetRange(document, surface, target) {
|
|
|
8089
8164
|
}
|
|
8090
8165
|
return null;
|
|
8091
8166
|
}
|
|
8167
|
+
function textLeafTargetRange(target, from, to) {
|
|
8168
|
+
return {
|
|
8169
|
+
from,
|
|
8170
|
+
to,
|
|
8171
|
+
textTarget: {
|
|
8172
|
+
kind: "text-leaf",
|
|
8173
|
+
blockPath: target.blockPath,
|
|
8174
|
+
paragraphStart: from,
|
|
8175
|
+
paragraphEnd: to
|
|
8176
|
+
}
|
|
8177
|
+
};
|
|
8178
|
+
}
|
|
8092
8179
|
function locateHyperlinkDisplayRange(document, surface, target) {
|
|
8093
8180
|
const canonical = resolveHyperlinkDisplayPath(document, target.blockPath);
|
|
8094
8181
|
if (!canonical) return null;
|