@superdoc-dev/cli 0.2.0-next.142 → 0.2.0-next.144
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/index.js +779 -582
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -660,18 +660,17 @@ function isTextAddress(value) {
|
|
|
660
660
|
return false;
|
|
661
661
|
return range.start <= range.end;
|
|
662
662
|
}
|
|
663
|
-
function
|
|
663
|
+
function isBlockNodeAddress(value) {
|
|
664
664
|
if (!isRecord(value))
|
|
665
665
|
return false;
|
|
666
|
-
if (
|
|
666
|
+
if (value.kind !== "block")
|
|
667
|
+
return false;
|
|
668
|
+
if (typeof value.nodeType !== "string" || !BLOCK_NODE_TYPES_SET.has(value.nodeType))
|
|
667
669
|
return false;
|
|
668
|
-
if (typeof value.
|
|
670
|
+
if (typeof value.nodeId !== "string")
|
|
669
671
|
return false;
|
|
670
672
|
return true;
|
|
671
673
|
}
|
|
672
|
-
function isValidTarget(value) {
|
|
673
|
-
return isTextAddress(value) || isSDAddress(value);
|
|
674
|
-
}
|
|
675
674
|
function assertNoUnknownFields(input, allowlist, operationName) {
|
|
676
675
|
for (const key of Object.keys(input)) {
|
|
677
676
|
if (!allowlist.has(key)) {
|
|
@@ -697,12 +696,12 @@ function validateNestingPolicyValue(value) {
|
|
|
697
696
|
throw new DocumentApiValidationError("INVALID_INPUT", `nestingPolicy.tables must be one of: forbid, allow. Got "${String(value.tables)}".`, { field: "nestingPolicy.tables", value: value.tables });
|
|
698
697
|
}
|
|
699
698
|
}
|
|
700
|
-
var
|
|
699
|
+
var BLOCK_NODE_TYPES_SET, NESTING_POLICY_ALLOWED_KEYS;
|
|
701
700
|
var init_validation_primitives = __esm(() => {
|
|
701
|
+
init_base();
|
|
702
702
|
init_placement();
|
|
703
703
|
init_errors2();
|
|
704
|
-
|
|
705
|
-
SD_ADDRESS_STABILITIES = new Set(["stable", "ephemeral"]);
|
|
704
|
+
BLOCK_NODE_TYPES_SET = new Set(BLOCK_NODE_TYPES);
|
|
706
705
|
NESTING_POLICY_ALLOWED_KEYS = new Set(["tables"]);
|
|
707
706
|
});
|
|
708
707
|
|
|
@@ -1353,8 +1352,7 @@ var init_operation_definitions = __esm(() => {
|
|
|
1353
1352
|
throws: T_NOT_FOUND
|
|
1354
1353
|
}),
|
|
1355
1354
|
referenceDocPath: "get-node-by-id.mdx",
|
|
1356
|
-
referenceGroup: "core"
|
|
1357
|
-
essential: true
|
|
1355
|
+
referenceGroup: "core"
|
|
1358
1356
|
},
|
|
1359
1357
|
getText: {
|
|
1360
1358
|
memberPath: "getText",
|
|
@@ -1364,7 +1362,8 @@ var init_operation_definitions = __esm(() => {
|
|
|
1364
1362
|
metadata: readOperation(),
|
|
1365
1363
|
referenceDocPath: "get-text.mdx",
|
|
1366
1364
|
referenceGroup: "core",
|
|
1367
|
-
|
|
1365
|
+
intentGroup: "get_content",
|
|
1366
|
+
intentAction: "text"
|
|
1368
1367
|
},
|
|
1369
1368
|
getMarkdown: {
|
|
1370
1369
|
memberPath: "getMarkdown",
|
|
@@ -1373,7 +1372,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1373
1372
|
requiresDocumentContext: true,
|
|
1374
1373
|
metadata: readOperation(),
|
|
1375
1374
|
referenceDocPath: "get-markdown.mdx",
|
|
1376
|
-
referenceGroup: "core"
|
|
1375
|
+
referenceGroup: "core",
|
|
1376
|
+
intentGroup: "get_content",
|
|
1377
|
+
intentAction: "markdown"
|
|
1377
1378
|
},
|
|
1378
1379
|
getHtml: {
|
|
1379
1380
|
memberPath: "getHtml",
|
|
@@ -1382,7 +1383,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1382
1383
|
requiresDocumentContext: true,
|
|
1383
1384
|
metadata: readOperation(),
|
|
1384
1385
|
referenceDocPath: "get-html.mdx",
|
|
1385
|
-
referenceGroup: "core"
|
|
1386
|
+
referenceGroup: "core",
|
|
1387
|
+
intentGroup: "get_content",
|
|
1388
|
+
intentAction: "html"
|
|
1386
1389
|
},
|
|
1387
1390
|
markdownToFragment: {
|
|
1388
1391
|
memberPath: "markdownToFragment",
|
|
@@ -1400,7 +1403,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1400
1403
|
requiresDocumentContext: true,
|
|
1401
1404
|
metadata: readOperation(),
|
|
1402
1405
|
referenceDocPath: "info.mdx",
|
|
1403
|
-
referenceGroup: "core"
|
|
1406
|
+
referenceGroup: "core",
|
|
1407
|
+
intentGroup: "get_content",
|
|
1408
|
+
intentAction: "info"
|
|
1404
1409
|
},
|
|
1405
1410
|
clearContent: {
|
|
1406
1411
|
memberPath: "clearContent",
|
|
@@ -1419,8 +1424,8 @@ var init_operation_definitions = __esm(() => {
|
|
|
1419
1424
|
},
|
|
1420
1425
|
insert: {
|
|
1421
1426
|
memberPath: "insert",
|
|
1422
|
-
description: "Insert
|
|
1423
|
-
expectedResult: "Returns
|
|
1427
|
+
description: "Insert content into the document. Two input shapes: " + "legacy string-based (value + type) inserts inline content at a text position within an existing block; " + "structural SDFragment (content) inserts one or more blocks as siblings relative to a BlockNodeAddress target. " + "When target is omitted, content appends at the end of the document. " + "Legacy mode supports text (default), markdown, and html content types via the `type` field. " + "Structural mode uses `placement` (before/after/insideStart/insideEnd) to position relative to the target block.",
|
|
1428
|
+
expectedResult: "Returns an SDMutationReceipt with applied status; resolution reports a TextAddress for legacy text insertion or a BlockNodeAddress for structural insertion. Receipt reports NO_OP if the insertion point is invalid or content is empty.",
|
|
1424
1429
|
requiresDocumentContext: true,
|
|
1425
1430
|
metadata: mutationOperation({
|
|
1426
1431
|
idempotency: "non-idempotent",
|
|
@@ -1454,11 +1459,13 @@ var init_operation_definitions = __esm(() => {
|
|
|
1454
1459
|
]
|
|
1455
1460
|
}),
|
|
1456
1461
|
referenceDocPath: "insert.mdx",
|
|
1457
|
-
referenceGroup: "core"
|
|
1462
|
+
referenceGroup: "core",
|
|
1463
|
+
intentGroup: "edit",
|
|
1464
|
+
intentAction: "insert"
|
|
1458
1465
|
},
|
|
1459
1466
|
replace: {
|
|
1460
1467
|
memberPath: "replace",
|
|
1461
|
-
description: "Replace content at a contiguous document selection. " + "Text path accepts a SelectionTarget or ref plus replacement text. " + "Structural path accepts
|
|
1468
|
+
description: "Replace content at a contiguous document selection. " + "Text path accepts a SelectionTarget or ref plus replacement text. " + "Structural path accepts a BlockNodeAddress (replaces whole block), SelectionTarget (expands to full covered block boundaries), or ref plus SDFragment content.",
|
|
1462
1469
|
expectedResult: "Returns an SDMutationReceipt with applied status; receipt reports NO_OP if the target range already contains identical content.",
|
|
1463
1470
|
requiresDocumentContext: true,
|
|
1464
1471
|
metadata: mutationOperation({
|
|
@@ -1491,7 +1498,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1491
1498
|
]
|
|
1492
1499
|
}),
|
|
1493
1500
|
referenceDocPath: "replace.mdx",
|
|
1494
|
-
referenceGroup: "core"
|
|
1501
|
+
referenceGroup: "core",
|
|
1502
|
+
intentGroup: "edit",
|
|
1503
|
+
intentAction: "replace"
|
|
1495
1504
|
},
|
|
1496
1505
|
delete: {
|
|
1497
1506
|
memberPath: "delete",
|
|
@@ -1506,7 +1515,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1506
1515
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET", "INVALID_INPUT"]
|
|
1507
1516
|
}),
|
|
1508
1517
|
referenceDocPath: "delete.mdx",
|
|
1509
|
-
referenceGroup: "core"
|
|
1518
|
+
referenceGroup: "core",
|
|
1519
|
+
intentGroup: "edit",
|
|
1520
|
+
intentAction: "delete"
|
|
1510
1521
|
},
|
|
1511
1522
|
"blocks.list": {
|
|
1512
1523
|
memberPath: "blocks.list",
|
|
@@ -1517,8 +1528,7 @@ var init_operation_definitions = __esm(() => {
|
|
|
1517
1528
|
throws: ["INVALID_INPUT"]
|
|
1518
1529
|
}),
|
|
1519
1530
|
referenceDocPath: "blocks/list.mdx",
|
|
1520
|
-
referenceGroup: "blocks"
|
|
1521
|
-
essential: true
|
|
1531
|
+
referenceGroup: "blocks"
|
|
1522
1532
|
},
|
|
1523
1533
|
"blocks.delete": {
|
|
1524
1534
|
memberPath: "blocks.delete",
|
|
@@ -1577,7 +1587,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1577
1587
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET", "INVALID_INPUT"]
|
|
1578
1588
|
}),
|
|
1579
1589
|
referenceDocPath: "format/apply.mdx",
|
|
1580
|
-
referenceGroup: "format"
|
|
1590
|
+
referenceGroup: "format",
|
|
1591
|
+
intentGroup: "format",
|
|
1592
|
+
intentAction: "inline"
|
|
1581
1593
|
},
|
|
1582
1594
|
...FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS,
|
|
1583
1595
|
"styles.apply": {
|
|
@@ -1609,7 +1621,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1609
1621
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET", "AMBIGUOUS_TARGET"]
|
|
1610
1622
|
}),
|
|
1611
1623
|
referenceDocPath: "create/paragraph.mdx",
|
|
1612
|
-
referenceGroup: "create"
|
|
1624
|
+
referenceGroup: "create",
|
|
1625
|
+
intentGroup: "create",
|
|
1626
|
+
intentAction: "paragraph"
|
|
1613
1627
|
},
|
|
1614
1628
|
"create.heading": {
|
|
1615
1629
|
memberPath: "create.heading",
|
|
@@ -1624,7 +1638,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1624
1638
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET", "AMBIGUOUS_TARGET"]
|
|
1625
1639
|
}),
|
|
1626
1640
|
referenceDocPath: "create/heading.mdx",
|
|
1627
|
-
referenceGroup: "create"
|
|
1641
|
+
referenceGroup: "create",
|
|
1642
|
+
intentGroup: "create",
|
|
1643
|
+
intentAction: "heading"
|
|
1628
1644
|
},
|
|
1629
1645
|
"create.sectionBreak": {
|
|
1630
1646
|
memberPath: "create.sectionBreak",
|
|
@@ -1934,7 +1950,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1934
1950
|
throws: T_PARAGRAPH_MUTATION
|
|
1935
1951
|
}),
|
|
1936
1952
|
referenceDocPath: "styles/paragraph/set-style.mdx",
|
|
1937
|
-
referenceGroup: "styles.paragraph"
|
|
1953
|
+
referenceGroup: "styles.paragraph",
|
|
1954
|
+
intentGroup: "format",
|
|
1955
|
+
intentAction: "set_style"
|
|
1938
1956
|
},
|
|
1939
1957
|
"styles.paragraph.clearStyle": {
|
|
1940
1958
|
memberPath: "styles.paragraph.clearStyle",
|
|
@@ -1979,7 +1997,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
1979
1997
|
throws: T_PARAGRAPH_MUTATION
|
|
1980
1998
|
}),
|
|
1981
1999
|
referenceDocPath: "format/paragraph/set-alignment.mdx",
|
|
1982
|
-
referenceGroup: "format.paragraph"
|
|
2000
|
+
referenceGroup: "format.paragraph",
|
|
2001
|
+
intentGroup: "format",
|
|
2002
|
+
intentAction: "set_alignment"
|
|
1983
2003
|
},
|
|
1984
2004
|
"format.paragraph.clearAlignment": {
|
|
1985
2005
|
memberPath: "format.paragraph.clearAlignment",
|
|
@@ -2009,7 +2029,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2009
2029
|
throws: T_PARAGRAPH_MUTATION
|
|
2010
2030
|
}),
|
|
2011
2031
|
referenceDocPath: "format/paragraph/set-indentation.mdx",
|
|
2012
|
-
referenceGroup: "format.paragraph"
|
|
2032
|
+
referenceGroup: "format.paragraph",
|
|
2033
|
+
intentGroup: "format",
|
|
2034
|
+
intentAction: "set_indentation"
|
|
2013
2035
|
},
|
|
2014
2036
|
"format.paragraph.clearIndentation": {
|
|
2015
2037
|
memberPath: "format.paragraph.clearIndentation",
|
|
@@ -2039,7 +2061,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2039
2061
|
throws: T_PARAGRAPH_MUTATION
|
|
2040
2062
|
}),
|
|
2041
2063
|
referenceDocPath: "format/paragraph/set-spacing.mdx",
|
|
2042
|
-
referenceGroup: "format.paragraph"
|
|
2064
|
+
referenceGroup: "format.paragraph",
|
|
2065
|
+
intentGroup: "format",
|
|
2066
|
+
intentAction: "set_spacing"
|
|
2043
2067
|
},
|
|
2044
2068
|
"format.paragraph.clearSpacing": {
|
|
2045
2069
|
memberPath: "format.paragraph.clearSpacing",
|
|
@@ -2243,7 +2267,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2243
2267
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET"]
|
|
2244
2268
|
}),
|
|
2245
2269
|
referenceDocPath: "lists/insert.mdx",
|
|
2246
|
-
referenceGroup: "lists"
|
|
2270
|
+
referenceGroup: "lists",
|
|
2271
|
+
intentGroup: "list",
|
|
2272
|
+
intentAction: "insert"
|
|
2247
2273
|
},
|
|
2248
2274
|
"lists.create": {
|
|
2249
2275
|
memberPath: "lists.create",
|
|
@@ -2258,7 +2284,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2258
2284
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET"]
|
|
2259
2285
|
}),
|
|
2260
2286
|
referenceDocPath: "lists/create.mdx",
|
|
2261
|
-
referenceGroup: "lists"
|
|
2287
|
+
referenceGroup: "lists",
|
|
2288
|
+
intentGroup: "list",
|
|
2289
|
+
intentAction: "create"
|
|
2262
2290
|
},
|
|
2263
2291
|
"lists.attach": {
|
|
2264
2292
|
memberPath: "lists.attach",
|
|
@@ -2288,7 +2316,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2288
2316
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET"]
|
|
2289
2317
|
}),
|
|
2290
2318
|
referenceDocPath: "lists/detach.mdx",
|
|
2291
|
-
referenceGroup: "lists"
|
|
2319
|
+
referenceGroup: "lists",
|
|
2320
|
+
intentGroup: "list",
|
|
2321
|
+
intentAction: "detach"
|
|
2292
2322
|
},
|
|
2293
2323
|
"lists.indent": {
|
|
2294
2324
|
memberPath: "lists.indent",
|
|
@@ -2303,7 +2333,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2303
2333
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET"]
|
|
2304
2334
|
}),
|
|
2305
2335
|
referenceDocPath: "lists/indent.mdx",
|
|
2306
|
-
referenceGroup: "lists"
|
|
2336
|
+
referenceGroup: "lists",
|
|
2337
|
+
intentGroup: "list",
|
|
2338
|
+
intentAction: "indent"
|
|
2307
2339
|
},
|
|
2308
2340
|
"lists.outdent": {
|
|
2309
2341
|
memberPath: "lists.outdent",
|
|
@@ -2318,7 +2350,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2318
2350
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET"]
|
|
2319
2351
|
}),
|
|
2320
2352
|
referenceDocPath: "lists/outdent.mdx",
|
|
2321
|
-
referenceGroup: "lists"
|
|
2353
|
+
referenceGroup: "lists",
|
|
2354
|
+
intentGroup: "list",
|
|
2355
|
+
intentAction: "outdent"
|
|
2322
2356
|
},
|
|
2323
2357
|
"lists.join": {
|
|
2324
2358
|
memberPath: "lists.join",
|
|
@@ -2380,7 +2414,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2380
2414
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET"]
|
|
2381
2415
|
}),
|
|
2382
2416
|
referenceDocPath: "lists/set-level.mdx",
|
|
2383
|
-
referenceGroup: "lists"
|
|
2417
|
+
referenceGroup: "lists",
|
|
2418
|
+
intentGroup: "list",
|
|
2419
|
+
intentAction: "set_level"
|
|
2384
2420
|
},
|
|
2385
2421
|
"lists.setValue": {
|
|
2386
2422
|
memberPath: "lists.setValue",
|
|
@@ -2497,7 +2533,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2497
2533
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET", "INVALID_INPUT"]
|
|
2498
2534
|
}),
|
|
2499
2535
|
referenceDocPath: "lists/set-type.mdx",
|
|
2500
|
-
referenceGroup: "lists"
|
|
2536
|
+
referenceGroup: "lists",
|
|
2537
|
+
intentGroup: "list",
|
|
2538
|
+
intentAction: "set_type"
|
|
2501
2539
|
},
|
|
2502
2540
|
"lists.captureTemplate": {
|
|
2503
2541
|
memberPath: "lists.captureTemplate",
|
|
@@ -2652,7 +2690,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2652
2690
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET"]
|
|
2653
2691
|
}),
|
|
2654
2692
|
referenceDocPath: "comments/create.mdx",
|
|
2655
|
-
referenceGroup: "comments"
|
|
2693
|
+
referenceGroup: "comments",
|
|
2694
|
+
intentGroup: "comment",
|
|
2695
|
+
intentAction: "create"
|
|
2656
2696
|
},
|
|
2657
2697
|
"comments.patch": {
|
|
2658
2698
|
memberPath: "comments.patch",
|
|
@@ -2667,7 +2707,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2667
2707
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET", "INVALID_INPUT"]
|
|
2668
2708
|
}),
|
|
2669
2709
|
referenceDocPath: "comments/patch.mdx",
|
|
2670
|
-
referenceGroup: "comments"
|
|
2710
|
+
referenceGroup: "comments",
|
|
2711
|
+
intentGroup: "comment",
|
|
2712
|
+
intentAction: "update"
|
|
2671
2713
|
},
|
|
2672
2714
|
"comments.delete": {
|
|
2673
2715
|
memberPath: "comments.delete",
|
|
@@ -2682,7 +2724,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2682
2724
|
throws: T_NOT_FOUND_CAPABLE
|
|
2683
2725
|
}),
|
|
2684
2726
|
referenceDocPath: "comments/delete.mdx",
|
|
2685
|
-
referenceGroup: "comments"
|
|
2727
|
+
referenceGroup: "comments",
|
|
2728
|
+
intentGroup: "comment",
|
|
2729
|
+
intentAction: "delete"
|
|
2686
2730
|
},
|
|
2687
2731
|
"comments.get": {
|
|
2688
2732
|
memberPath: "comments.get",
|
|
@@ -2694,7 +2738,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2694
2738
|
throws: T_NOT_FOUND
|
|
2695
2739
|
}),
|
|
2696
2740
|
referenceDocPath: "comments/get.mdx",
|
|
2697
|
-
referenceGroup: "comments"
|
|
2741
|
+
referenceGroup: "comments",
|
|
2742
|
+
intentGroup: "comment",
|
|
2743
|
+
intentAction: "get"
|
|
2698
2744
|
},
|
|
2699
2745
|
"comments.list": {
|
|
2700
2746
|
memberPath: "comments.list",
|
|
@@ -2706,7 +2752,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2706
2752
|
throws: ["INVALID_INPUT"]
|
|
2707
2753
|
}),
|
|
2708
2754
|
referenceDocPath: "comments/list.mdx",
|
|
2709
|
-
referenceGroup: "comments"
|
|
2755
|
+
referenceGroup: "comments",
|
|
2756
|
+
intentGroup: "comment",
|
|
2757
|
+
intentAction: "list"
|
|
2710
2758
|
},
|
|
2711
2759
|
"trackChanges.list": {
|
|
2712
2760
|
memberPath: "trackChanges.list",
|
|
@@ -2718,7 +2766,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2718
2766
|
throws: ["INVALID_INPUT"]
|
|
2719
2767
|
}),
|
|
2720
2768
|
referenceDocPath: "track-changes/list.mdx",
|
|
2721
|
-
referenceGroup: "trackChanges"
|
|
2769
|
+
referenceGroup: "trackChanges",
|
|
2770
|
+
intentGroup: "track_changes",
|
|
2771
|
+
intentAction: "list"
|
|
2722
2772
|
},
|
|
2723
2773
|
"trackChanges.get": {
|
|
2724
2774
|
memberPath: "trackChanges.get",
|
|
@@ -2745,7 +2795,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2745
2795
|
throws: [...T_NOT_FOUND_CAPABLE, "INVALID_INPUT", "INVALID_TARGET"]
|
|
2746
2796
|
}),
|
|
2747
2797
|
referenceDocPath: "track-changes/decide.mdx",
|
|
2748
|
-
referenceGroup: "trackChanges"
|
|
2798
|
+
referenceGroup: "trackChanges",
|
|
2799
|
+
intentGroup: "track_changes",
|
|
2800
|
+
intentAction: "decide"
|
|
2749
2801
|
},
|
|
2750
2802
|
"query.match": {
|
|
2751
2803
|
memberPath: "query.match",
|
|
@@ -2759,7 +2811,8 @@ var init_operation_definitions = __esm(() => {
|
|
|
2759
2811
|
}),
|
|
2760
2812
|
referenceDocPath: "query/match.mdx",
|
|
2761
2813
|
referenceGroup: "query",
|
|
2762
|
-
|
|
2814
|
+
intentGroup: "search",
|
|
2815
|
+
intentAction: "match"
|
|
2763
2816
|
},
|
|
2764
2817
|
"ranges.resolve": {
|
|
2765
2818
|
memberPath: "ranges.resolve",
|
|
@@ -2772,8 +2825,7 @@ var init_operation_definitions = __esm(() => {
|
|
|
2772
2825
|
deterministicTargetResolution: true
|
|
2773
2826
|
}),
|
|
2774
2827
|
referenceDocPath: "ranges/resolve.mdx",
|
|
2775
|
-
referenceGroup: "ranges"
|
|
2776
|
-
essential: true
|
|
2828
|
+
referenceGroup: "ranges"
|
|
2777
2829
|
},
|
|
2778
2830
|
"mutations.preview": {
|
|
2779
2831
|
memberPath: "mutations.preview",
|
|
@@ -2786,7 +2838,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
2786
2838
|
deterministicTargetResolution: true
|
|
2787
2839
|
}),
|
|
2788
2840
|
referenceDocPath: "mutations/preview.mdx",
|
|
2789
|
-
referenceGroup: "mutations"
|
|
2841
|
+
referenceGroup: "mutations",
|
|
2842
|
+
intentGroup: "mutations",
|
|
2843
|
+
intentAction: "preview"
|
|
2790
2844
|
},
|
|
2791
2845
|
"mutations.apply": {
|
|
2792
2846
|
memberPath: "mutations.apply",
|
|
@@ -2809,7 +2863,8 @@ var init_operation_definitions = __esm(() => {
|
|
|
2809
2863
|
}),
|
|
2810
2864
|
referenceDocPath: "mutations/apply.mdx",
|
|
2811
2865
|
referenceGroup: "mutations",
|
|
2812
|
-
|
|
2866
|
+
intentGroup: "mutations",
|
|
2867
|
+
intentAction: "apply"
|
|
2813
2868
|
},
|
|
2814
2869
|
"capabilities.get": {
|
|
2815
2870
|
memberPath: "capabilities",
|
|
@@ -3631,7 +3686,8 @@ var init_operation_definitions = __esm(() => {
|
|
|
3631
3686
|
}),
|
|
3632
3687
|
referenceDocPath: "history/undo.mdx",
|
|
3633
3688
|
referenceGroup: "history",
|
|
3634
|
-
|
|
3689
|
+
intentGroup: "edit",
|
|
3690
|
+
intentAction: "undo"
|
|
3635
3691
|
},
|
|
3636
3692
|
"history.redo": {
|
|
3637
3693
|
memberPath: "history.redo",
|
|
@@ -3646,7 +3702,9 @@ var init_operation_definitions = __esm(() => {
|
|
|
3646
3702
|
throws: ["CAPABILITY_UNAVAILABLE"]
|
|
3647
3703
|
}),
|
|
3648
3704
|
referenceDocPath: "history/redo.mdx",
|
|
3649
|
-
referenceGroup: "history"
|
|
3705
|
+
referenceGroup: "history",
|
|
3706
|
+
intentGroup: "edit",
|
|
3707
|
+
intentAction: "redo"
|
|
3650
3708
|
},
|
|
3651
3709
|
"create.image": {
|
|
3652
3710
|
memberPath: "create.image",
|
|
@@ -7552,7 +7610,7 @@ function buildInternalContractSchemas() {
|
|
|
7552
7610
|
operations
|
|
7553
7611
|
};
|
|
7554
7612
|
}
|
|
7555
|
-
var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema,
|
|
7613
|
+
var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, trackChangeRefSchema, createParagraphSuccessSchema, createHeadingSuccessSchema, headingLevelSchema, listsInsertSuccessSchema, listsMutateItemSuccessSchema, listsExitSuccessSchema, nodeSummarySchema, nodeInfoSchema, matchContextSchema, unknownNodeDiagnosticSchema, textSelectorSchema, nodeSelectorSchema, selectorShorthandSchema, sdTextSelectorSchema, sdNodeSelectorSchema, sdSelectorSchema, sdReadOptionsSchema, sdFindInputSchema, sdNodeResultSchema, sdFindResultSchema, sdMutationResolutionSchema, sdMutationSuccessSchema, documentInfoCountsSchema, documentInfoOutlineItemSchema, documentInfoCapabilitiesSchema, documentInfoSchema, listKindSchema, listInsertPositionSchema, listItemInfoSchema, listItemDomainItemSchema, listsListResultSchema, sectionBreakTypeSchema, sectionOrientationSchema, sectionVerticalAlignSchema, sectionDirectionSchema, sectionHeaderFooterKindSchema, sectionHeaderFooterVariantSchema, sectionLineNumberRestartSchema, sectionPageNumberFormatSchema, sectionRangeDomainSchema, sectionPageMarginsSchema, sectionHeaderFooterMarginsSchema, sectionPageSetupSchema, sectionColumnsSchema, sectionLineNumberingSchema, sectionPageNumberingSchema, sectionHeaderFooterRefsSchema, sectionBorderSpecSchema, sectionPageBordersSchema, sectionInfoSchema, sectionResolvedHandleSchema, sectionDomainItemSchema, sectionsListResultSchema, sectionMutationSuccessSchema, documentMutationSuccessSchema, paragraphMutationTargetSchema, paragraphMutationSuccessSchema, createSectionBreakSuccessSchema, commentInfoSchema, commentDomainItemSchema, commentsListResultSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, _tableScopedRowLocatorSchema, _tableScopedColumnLocatorSchema, mergeRangeLocatorSchema, mixedRowLocatorOneOf, tableCreateLocationSchema, tableMutationSuccessSchema, createTableSuccessSchema, tableMutationFailureCodes, tableMutationFailureSchema, tableMutationResultSchema, createTableResultSchema, historyActionSuccessSchema, historyActionFailureSchema, formatInlineAliasOperationSchemas, tocMutationFailureCodes, tocMutationFailureSchema, tocMutationSuccessSchema, tocEntryMutationFailureCodes, tocEntryMutationFailureSchema, tocEntryMutationSuccessSchema, hyperlinkTargetSchema, hyperlinkReadPropertiesSchema, hyperlinkDestinationSchema, hyperlinkSpecSchema, hyperlinkPatchSchema, hyperlinkDomainSchema, hyperlinkMutationSuccessSchema, hyperlinkMutationFailureCodes, hyperlinkMutationFailureSchema, hyperlinkInfoSchema, contentControlTargetSchema, contentControlMutationSuccessSchema, contentControlMutationFailureSchema, ccListResultSchema, ccInfoSchema, refListQuerySchema, discoveryOutputSchema, receiptFailureSchema, refFailureSchema, bookmarkAddressSchema, bookmarkMutation, footnoteAddressSchema, footnoteConfigScopeSchema, footnoteNumberingSchema, footnoteMutation, footnoteConfig, crossRefAddressSchema, crossRefTargetSchema, crossRefDisplaySchema, crossRefMutation, indexAddressSchema, indexEntryAddressSchema, indexConfigSchema, indexEntryDataSchema, indexEntryPatchSchema, indexMutation, indexEntryMutation, captionAddressSchema, captionMutation, captionConfig, fieldAddressSchema, fieldMutation, citationAddressSchema, citationSourceAddressSchema, bibliographyAddressSchema, citationMutation, citationSourceMutation, bibliographyMutation, citationPersonSchema, citationSourceFieldsSchema, tocCreateLocationSchema, authoritiesAddressSchema, authorityEntryAddressSchema, authoritiesConfigSchema, authorityEntryDataSchema, authorityEntryPatchSchema, authoritiesMutation, authorityEntryMutation, operationSchemas;
|
|
7556
7614
|
var init_schemas = __esm(() => {
|
|
7557
7615
|
init_command_catalog();
|
|
7558
7616
|
init_types2();
|
|
@@ -7890,23 +7948,12 @@ var init_schemas = __esm(() => {
|
|
|
7890
7948
|
}, ["type", "pattern"]);
|
|
7891
7949
|
sdNodeSelectorSchema = objectSchema({
|
|
7892
7950
|
type: { const: "node" },
|
|
7893
|
-
kind: { enum: ["
|
|
7894
|
-
|
|
7951
|
+
kind: { enum: ["block", "inline"] },
|
|
7952
|
+
nodeType: { type: "string" }
|
|
7895
7953
|
}, ["type"]);
|
|
7896
7954
|
sdSelectorSchema = {
|
|
7897
7955
|
oneOf: [sdTextSelectorSchema, sdNodeSelectorSchema]
|
|
7898
7956
|
};
|
|
7899
|
-
sdAddressSchema = objectSchema({
|
|
7900
|
-
kind: { enum: ["content", "inline", "annotation", "section"] },
|
|
7901
|
-
stability: { enum: ["stable", "ephemeral"] },
|
|
7902
|
-
nodeId: { type: "string" },
|
|
7903
|
-
anchor: objectSchema({
|
|
7904
|
-
start: objectSchema({ blockId: { type: "string" }, offset: { type: "integer" } }, ["blockId", "offset"]),
|
|
7905
|
-
end: objectSchema({ blockId: { type: "string" }, offset: { type: "integer" } }, ["blockId", "offset"])
|
|
7906
|
-
}),
|
|
7907
|
-
evaluatedRevision: { type: "string" },
|
|
7908
|
-
path: arraySchema({ oneOf: [{ type: "string" }, { type: "integer" }] })
|
|
7909
|
-
}, ["kind", "stability"]);
|
|
7910
7957
|
sdReadOptionsSchema = objectSchema({
|
|
7911
7958
|
includeResolved: { type: "boolean" },
|
|
7912
7959
|
includeProvenance: { type: "boolean" },
|
|
@@ -7914,14 +7961,14 @@ var init_schemas = __esm(() => {
|
|
|
7914
7961
|
});
|
|
7915
7962
|
sdFindInputSchema = objectSchema({
|
|
7916
7963
|
select: sdSelectorSchema,
|
|
7917
|
-
within:
|
|
7964
|
+
within: blockNodeAddressSchema,
|
|
7918
7965
|
limit: { type: "integer" },
|
|
7919
7966
|
offset: { type: "integer" },
|
|
7920
7967
|
options: sdReadOptionsSchema
|
|
7921
7968
|
}, ["select"]);
|
|
7922
7969
|
sdNodeResultSchema = objectSchema({
|
|
7923
7970
|
node: { type: "object" },
|
|
7924
|
-
address:
|
|
7971
|
+
address: nodeAddressSchema,
|
|
7925
7972
|
context: { type: "object" }
|
|
7926
7973
|
}, ["node", "address"]);
|
|
7927
7974
|
sdFindResultSchema = objectSchema({
|
|
@@ -7931,10 +7978,10 @@ var init_schemas = __esm(() => {
|
|
|
7931
7978
|
items: arraySchema(sdNodeResultSchema)
|
|
7932
7979
|
}, ["total", "limit", "offset", "items"]);
|
|
7933
7980
|
sdMutationResolutionSchema = objectSchema({
|
|
7934
|
-
|
|
7935
|
-
|
|
7981
|
+
target: { oneOf: [textAddressSchema, blockNodeAddressSchema] },
|
|
7982
|
+
range: textMutationRangeSchema,
|
|
7936
7983
|
selectionTarget: selectionTargetSchema
|
|
7937
|
-
}, ["target"]);
|
|
7984
|
+
}, ["target", "range"]);
|
|
7938
7985
|
sdMutationSuccessSchema = objectSchema({
|
|
7939
7986
|
success: { const: true },
|
|
7940
7987
|
resolution: sdMutationResolutionSchema,
|
|
@@ -8241,11 +8288,28 @@ var init_schemas = __esm(() => {
|
|
|
8241
8288
|
planEngine: planEngineCapabilitiesSchema
|
|
8242
8289
|
}, ["global", "format", "operations", "planEngine"]);
|
|
8243
8290
|
strictEmptyObjectSchema = objectSchema({});
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8291
|
+
sdFragmentSchema = {
|
|
8292
|
+
oneOf: [{ type: "object" }, { type: "array", items: { type: "object" } }]
|
|
8293
|
+
};
|
|
8294
|
+
placementSchema = { enum: ["before", "after", "insideStart", "insideEnd"] };
|
|
8295
|
+
nestingPolicySchema = objectSchema({
|
|
8296
|
+
tables: { enum: ["forbid", "allow"] }
|
|
8297
|
+
});
|
|
8298
|
+
insertInputSchema = {
|
|
8299
|
+
oneOf: [
|
|
8300
|
+
objectSchema({
|
|
8301
|
+
target: textAddressSchema,
|
|
8302
|
+
value: { type: "string" },
|
|
8303
|
+
type: { type: "string", enum: ["text", "markdown", "html"] }
|
|
8304
|
+
}, ["value"]),
|
|
8305
|
+
objectSchema({
|
|
8306
|
+
target: blockNodeAddressSchema,
|
|
8307
|
+
content: sdFragmentSchema,
|
|
8308
|
+
placement: placementSchema,
|
|
8309
|
+
nestingPolicy: nestingPolicySchema
|
|
8310
|
+
}, ["content"])
|
|
8311
|
+
]
|
|
8312
|
+
};
|
|
8249
8313
|
tableLocatorSchema = {
|
|
8250
8314
|
...objectSchema({
|
|
8251
8315
|
target: blockNodeAddressSchema,
|
|
@@ -8710,14 +8774,14 @@ var init_schemas = __esm(() => {
|
|
|
8710
8774
|
{
|
|
8711
8775
|
oneOf: [
|
|
8712
8776
|
objectSchema({
|
|
8713
|
-
target: { oneOf: [
|
|
8714
|
-
content:
|
|
8715
|
-
nestingPolicy:
|
|
8777
|
+
target: { oneOf: [blockNodeAddressSchema, selectionTargetSchema] },
|
|
8778
|
+
content: sdFragmentSchema,
|
|
8779
|
+
nestingPolicy: nestingPolicySchema
|
|
8716
8780
|
}, ["target", "content"]),
|
|
8717
8781
|
objectSchema({
|
|
8718
8782
|
ref: { type: "string" },
|
|
8719
|
-
content:
|
|
8720
|
-
nestingPolicy:
|
|
8783
|
+
content: sdFragmentSchema,
|
|
8784
|
+
nestingPolicy: nestingPolicySchema
|
|
8721
8785
|
}, ["ref", "content"])
|
|
8722
8786
|
]
|
|
8723
8787
|
}
|
|
@@ -9786,7 +9850,7 @@ var init_schemas = __esm(() => {
|
|
|
9786
9850
|
"query.match": {
|
|
9787
9851
|
input: objectSchema({
|
|
9788
9852
|
select: { oneOf: [textSelectorSchema, nodeSelectorSchema] },
|
|
9789
|
-
within:
|
|
9853
|
+
within: blockNodeAddressSchema,
|
|
9790
9854
|
require: { enum: ["any", "first", "exactlyOne", "all"] },
|
|
9791
9855
|
mode: { enum: ["strict", "candidates"] },
|
|
9792
9856
|
includeNodes: { type: "boolean" },
|
|
@@ -9796,7 +9860,7 @@ var init_schemas = __esm(() => {
|
|
|
9796
9860
|
output: (() => {
|
|
9797
9861
|
const textMatchItemSchema = discoveryItemSchema({
|
|
9798
9862
|
matchKind: { const: "text" },
|
|
9799
|
-
address:
|
|
9863
|
+
address: blockNodeAddressSchema,
|
|
9800
9864
|
target: selectionTargetSchema,
|
|
9801
9865
|
snippet: { type: "string" },
|
|
9802
9866
|
highlightRange: rangeSchema,
|
|
@@ -9815,13 +9879,13 @@ var init_schemas = __esm(() => {
|
|
|
9815
9879
|
const selectWhereSchema = objectSchema({
|
|
9816
9880
|
by: { const: "select", type: "string" },
|
|
9817
9881
|
select: { oneOf: [textSelectorSchema, nodeSelectorSchema] },
|
|
9818
|
-
within:
|
|
9882
|
+
within: blockNodeAddressSchema,
|
|
9819
9883
|
require: { enum: ["first", "exactlyOne", "all"] }
|
|
9820
9884
|
}, ["by", "select", "require"]);
|
|
9821
9885
|
const refWhereSchema = objectSchema({
|
|
9822
9886
|
by: { const: "ref", type: "string" },
|
|
9823
9887
|
ref: { type: "string" },
|
|
9824
|
-
within:
|
|
9888
|
+
within: blockNodeAddressSchema
|
|
9825
9889
|
}, ["by", "ref"]);
|
|
9826
9890
|
const targetWhereSchema = objectSchema({
|
|
9827
9891
|
by: { const: "target", type: "string" },
|
|
@@ -9831,13 +9895,13 @@ var init_schemas = __esm(() => {
|
|
|
9831
9895
|
const insertWhereSchema = objectSchema({
|
|
9832
9896
|
by: { const: "select", type: "string" },
|
|
9833
9897
|
select: { oneOf: [textSelectorSchema, nodeSelectorSchema] },
|
|
9834
|
-
within:
|
|
9898
|
+
within: blockNodeAddressSchema,
|
|
9835
9899
|
require: { enum: ["first", "exactlyOne"] }
|
|
9836
9900
|
}, ["by", "select", "require"]);
|
|
9837
9901
|
const assertWhereSchema = objectSchema({
|
|
9838
9902
|
by: { const: "select", type: "string" },
|
|
9839
9903
|
select: { oneOf: [textSelectorSchema, nodeSelectorSchema] },
|
|
9840
|
-
within:
|
|
9904
|
+
within: blockNodeAddressSchema
|
|
9841
9905
|
}, ["by", "select"]);
|
|
9842
9906
|
const replacementBlockSchema = objectSchema({ text: { type: "string" } }, ["text"]);
|
|
9843
9907
|
const replacementPayloadSchema = {
|
|
@@ -10983,7 +11047,7 @@ var init_schemas = __esm(() => {
|
|
|
10983
11047
|
"images.removeCaption": imagesMutationSchemaSet(objectSchema({ imageId: { type: "string" } }, ["imageId"])),
|
|
10984
11048
|
"hyperlinks.list": {
|
|
10985
11049
|
input: objectSchema({
|
|
10986
|
-
within:
|
|
11050
|
+
within: blockNodeAddressSchema,
|
|
10987
11051
|
hrefPattern: { type: "string" },
|
|
10988
11052
|
anchor: { type: "string" },
|
|
10989
11053
|
textPattern: { type: "string" },
|
|
@@ -11868,6 +11932,7 @@ var init_step_op_catalog = __esm(() => {
|
|
|
11868
11932
|
|
|
11869
11933
|
// ../../packages/document-api/src/contract/index.ts
|
|
11870
11934
|
var init_contract = __esm(() => {
|
|
11935
|
+
init_operation_definitions();
|
|
11871
11936
|
init_types2();
|
|
11872
11937
|
init_command_catalog();
|
|
11873
11938
|
init_schemas();
|
|
@@ -12161,6 +12226,9 @@ var init_comments = __esm(() => {
|
|
|
12161
12226
|
function executeFind(adapter, input) {
|
|
12162
12227
|
return adapter.find(input);
|
|
12163
12228
|
}
|
|
12229
|
+
var init_find = __esm(() => {
|
|
12230
|
+
init_errors2();
|
|
12231
|
+
});
|
|
12164
12232
|
|
|
12165
12233
|
// ../../packages/document-api/src/format/format.ts
|
|
12166
12234
|
function validateTargetLocator(input, operation) {
|
|
@@ -12850,29 +12918,18 @@ var init_fragment_validator = __esm(() => {
|
|
|
12850
12918
|
});
|
|
12851
12919
|
|
|
12852
12920
|
// ../../packages/document-api/src/receipt-bridge.ts
|
|
12853
|
-
function
|
|
12921
|
+
function buildResolution(resolution) {
|
|
12854
12922
|
return {
|
|
12855
|
-
|
|
12856
|
-
|
|
12857
|
-
|
|
12858
|
-
anchor: {
|
|
12859
|
-
start: { blockId: textAddr.blockId, offset: textAddr.range.start },
|
|
12860
|
-
end: { blockId: textAddr.blockId, offset: textAddr.range.end }
|
|
12861
|
-
}
|
|
12862
|
-
};
|
|
12863
|
-
}
|
|
12864
|
-
function buildSDResolution(resolution) {
|
|
12865
|
-
return {
|
|
12866
|
-
...resolution.requestedTarget ? { requestedTarget: textAddressToSDAddress(resolution.requestedTarget) } : {},
|
|
12867
|
-
target: textAddressToSDAddress(resolution.target),
|
|
12868
|
-
...resolution.selectionTarget ? { selectionTarget: resolution.selectionTarget } : undefined
|
|
12923
|
+
target: resolution.target,
|
|
12924
|
+
range: resolution.range,
|
|
12925
|
+
...resolution.selectionTarget ? { selectionTarget: resolution.selectionTarget } : {}
|
|
12869
12926
|
};
|
|
12870
12927
|
}
|
|
12871
12928
|
function textReceiptToSDReceipt(receipt2) {
|
|
12872
12929
|
if (receipt2.success) {
|
|
12873
12930
|
return {
|
|
12874
12931
|
success: true,
|
|
12875
|
-
resolution: receipt2.resolution ?
|
|
12932
|
+
resolution: receipt2.resolution ? buildResolution(receipt2.resolution) : undefined
|
|
12876
12933
|
};
|
|
12877
12934
|
}
|
|
12878
12935
|
const failure = {
|
|
@@ -12897,7 +12954,22 @@ function textReceiptToSDReceipt(receipt2) {
|
|
|
12897
12954
|
return {
|
|
12898
12955
|
success: false,
|
|
12899
12956
|
failure,
|
|
12900
|
-
resolution: receipt2.resolution ?
|
|
12957
|
+
resolution: receipt2.resolution ? buildResolution(receipt2.resolution) : undefined
|
|
12958
|
+
};
|
|
12959
|
+
}
|
|
12960
|
+
function buildStructuralReceipt(success, params, failure) {
|
|
12961
|
+
const resolution = {
|
|
12962
|
+
target: params.target,
|
|
12963
|
+
range: params.range,
|
|
12964
|
+
...params.selectionTarget ? { selectionTarget: params.selectionTarget } : {}
|
|
12965
|
+
};
|
|
12966
|
+
if (success) {
|
|
12967
|
+
return { success: true, resolution };
|
|
12968
|
+
}
|
|
12969
|
+
return {
|
|
12970
|
+
success: false,
|
|
12971
|
+
failure: { code: failure?.code ?? "INTERNAL_ERROR", message: failure?.message ?? "" },
|
|
12972
|
+
resolution
|
|
12901
12973
|
};
|
|
12902
12974
|
}
|
|
12903
12975
|
|
|
@@ -12954,8 +13026,8 @@ function validateStructuralInsertInput(input) {
|
|
|
12954
13026
|
}
|
|
12955
13027
|
assertNoUnknownFields(input, STRUCTURAL_INSERT_ALLOWED_KEYS, "insert");
|
|
12956
13028
|
const { target, content, placement: placement2, nestingPolicy } = input;
|
|
12957
|
-
if (target !== undefined && !
|
|
12958
|
-
throw new DocumentApiValidationError("INVALID_TARGET",
|
|
13029
|
+
if (target !== undefined && !isBlockNodeAddress(target)) {
|
|
13030
|
+
throw new DocumentApiValidationError("INVALID_TARGET", 'target must be a BlockNodeAddress ({ kind: "block", nodeType, nodeId }).', {
|
|
12959
13031
|
field: "target",
|
|
12960
13032
|
value: target
|
|
12961
13033
|
});
|
|
@@ -13188,8 +13260,11 @@ function validateStructuralReplaceInput(input) {
|
|
|
13188
13260
|
fields: ["target", "ref"]
|
|
13189
13261
|
});
|
|
13190
13262
|
}
|
|
13191
|
-
if (hasTarget && !
|
|
13192
|
-
throw new DocumentApiValidationError("INVALID_TARGET", "target must be a
|
|
13263
|
+
if (hasTarget && !isBlockNodeAddress(target) && !isSelectionTarget(target)) {
|
|
13264
|
+
throw new DocumentApiValidationError("INVALID_TARGET", "target must be a BlockNodeAddress or SelectionTarget.", {
|
|
13265
|
+
field: "target",
|
|
13266
|
+
value: target
|
|
13267
|
+
});
|
|
13193
13268
|
}
|
|
13194
13269
|
if (hasRef && typeof refValue !== "string") {
|
|
13195
13270
|
throw new DocumentApiValidationError("INVALID_TARGET", "ref must be a string.", {
|
|
@@ -16409,7 +16484,11 @@ function createDocumentApi(adapters) {
|
|
|
16409
16484
|
},
|
|
16410
16485
|
query: {
|
|
16411
16486
|
match(input) {
|
|
16412
|
-
|
|
16487
|
+
if (!input || typeof input !== "object") {
|
|
16488
|
+
throw new DocumentApiValidationError("INVALID_INPUT", "query.match requires a QueryMatchInput or selector object.", { value: input });
|
|
16489
|
+
}
|
|
16490
|
+
const normalized = "select" in input ? input : { select: input };
|
|
16491
|
+
return adapters.query.match(normalized);
|
|
16413
16492
|
}
|
|
16414
16493
|
},
|
|
16415
16494
|
ranges: {
|
|
@@ -16452,6 +16531,7 @@ var init_src = __esm(() => {
|
|
|
16452
16531
|
init_errors2();
|
|
16453
16532
|
init_ranges();
|
|
16454
16533
|
init_comments();
|
|
16534
|
+
init_find();
|
|
16455
16535
|
init_format();
|
|
16456
16536
|
init_inline_run_patch();
|
|
16457
16537
|
init_styles();
|
|
@@ -23434,9 +23514,9 @@ var init_jszip_ChlR43oI_es = __esm(() => {
|
|
|
23434
23514
|
});
|
|
23435
23515
|
});
|
|
23436
23516
|
|
|
23437
|
-
// ../../packages/superdoc/dist/chunks/xml-js-
|
|
23517
|
+
// ../../packages/superdoc/dist/chunks/xml-js-BtmJ6bNs.es.js
|
|
23438
23518
|
var require_events, require_inherits_browser, require_stream_browser, require_dist, require_shams$1, require_shams, require_es_object_atoms, require_es_errors, require_eval, require_range, require_ref, require_syntax, require_type, require_uri, require_abs, require_floor, require_max, require_min, require_pow, require_round, require_isNaN, require_sign, require_gOPD, require_gopd, require_es_define_property, require_has_symbols, require_Reflect_getPrototypeOf, require_Object_getPrototypeOf, require_implementation, require_function_bind, require_functionCall, require_functionApply, require_reflectApply, require_actualApply, require_call_bind_apply_helpers, require_get, require_get_proto, require_hasown, require_get_intrinsic, require_call_bound, require_is_arguments, require_is_regex, require_safe_regex_test, require_generator_function, require_is_generator_function, require_is_callable, require_for_each, require_possible_typed_array_names, require_available_typed_arrays, require_define_data_property, require_has_property_descriptors, require_set_function_length, require_applyBind, require_call_bind, require_which_typed_array, require_is_typed_array, require_types, require_isBufferBrowser, require_util, require_buffer_list, require_destroy, require_errors_browser, require_state, require_browser, require__stream_writable, require__stream_duplex, require_safe_buffer, require_string_decoder, require_end_of_stream, require_async_iterator, require_from_browser, require__stream_readable, require__stream_transform, require__stream_passthrough, require_pipeline, require_stream_browserify, require_sax, require_array_helper, require_options_helper, require_xml2js, require_xml2json, require_js2xml, require_json2xml, require_lib;
|
|
23439
|
-
var
|
|
23519
|
+
var init_xml_js_BtmJ6bNs_es = __esm(() => {
|
|
23440
23520
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
23441
23521
|
init_jszip_ChlR43oI_es();
|
|
23442
23522
|
require_events = /* @__PURE__ */ __commonJSMin((exports, module) => {
|
|
@@ -29987,6 +30067,9 @@ var init_xml_js_DLE8mr0n_es = __esm(() => {
|
|
|
29987
30067
|
parser.opt = opt || {};
|
|
29988
30068
|
parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
|
|
29989
30069
|
parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase";
|
|
30070
|
+
parser.opt.maxEntityCount = parser.opt.maxEntityCount || 512;
|
|
30071
|
+
parser.opt.maxEntityDepth = parser.opt.maxEntityDepth || 4;
|
|
30072
|
+
parser.entityCount = parser.entityDepth = 0;
|
|
29990
30073
|
parser.tags = [];
|
|
29991
30074
|
parser.closed = parser.closedRoot = parser.sawRoot = false;
|
|
29992
30075
|
parser.tag = parser.error = null;
|
|
@@ -31235,9 +31318,14 @@ Actual: ` + parser.attribValue);
|
|
|
31235
31318
|
if (c === ";") {
|
|
31236
31319
|
var parsedEntity = parseEntity(parser);
|
|
31237
31320
|
if (parser.opt.unparsedEntities && !Object.values(sax$1.XML_ENTITIES).includes(parsedEntity)) {
|
|
31321
|
+
if ((parser.entityCount += 1) > parser.opt.maxEntityCount)
|
|
31322
|
+
error(parser, "Parsed entity count exceeds max entity count");
|
|
31323
|
+
if ((parser.entityDepth += 1) > parser.opt.maxEntityDepth)
|
|
31324
|
+
error(parser, "Parsed entity depth exceeds max entity depth");
|
|
31238
31325
|
parser.entity = "";
|
|
31239
31326
|
parser.state = returnState;
|
|
31240
31327
|
parser.write(parsedEntity);
|
|
31328
|
+
parser.entityDepth -= 1;
|
|
31241
31329
|
} else {
|
|
31242
31330
|
parser[buffer$2] += parsedEntity;
|
|
31243
31331
|
parser.entity = "";
|
|
@@ -32180,7 +32268,7 @@ var init_uuid_qzgm05fK_es = __esm(() => {
|
|
|
32180
32268
|
v5_default = v35("v5", 80, sha1);
|
|
32181
32269
|
});
|
|
32182
32270
|
|
|
32183
|
-
// ../../packages/superdoc/dist/chunks/constants-
|
|
32271
|
+
// ../../packages/superdoc/dist/chunks/constants-ep1_Gwqi.es.js
|
|
32184
32272
|
function computeCrc32Hex(data) {
|
|
32185
32273
|
let crc = 4294967295;
|
|
32186
32274
|
for (let i2 = 0;i2 < data.length; i2++)
|
|
@@ -32572,8 +32660,8 @@ var import_lib, CRC32_TABLE, REMOTE_RESOURCE_PATTERN, DATA_URI_PATTERN, getArray
|
|
|
32572
32660
|
return "webp";
|
|
32573
32661
|
return null;
|
|
32574
32662
|
}, COMMENT_FILE_BASENAMES, COMMENT_RELATIONSHIP_TYPES;
|
|
32575
|
-
var
|
|
32576
|
-
|
|
32663
|
+
var init_constants_ep1_Gwqi_es = __esm(() => {
|
|
32664
|
+
init_xml_js_BtmJ6bNs_es();
|
|
32577
32665
|
import_lib = require_lib();
|
|
32578
32666
|
CRC32_TABLE = new Uint32Array(256);
|
|
32579
32667
|
for (let i2 = 0;i2 < 256; i2++) {
|
|
@@ -38780,7 +38868,7 @@ var init_remark_gfm_z_sDF4ss_es = __esm(() => {
|
|
|
38780
38868
|
emptyOptions2 = {};
|
|
38781
38869
|
});
|
|
38782
38870
|
|
|
38783
|
-
// ../../packages/superdoc/dist/chunks/SuperConverter-
|
|
38871
|
+
// ../../packages/superdoc/dist/chunks/SuperConverter-DBTvnSJQ.es.js
|
|
38784
38872
|
function getExtensionConfigField(extension$1, field, context = { name: "" }) {
|
|
38785
38873
|
const fieldValue = extension$1.config[field];
|
|
38786
38874
|
if (typeof fieldValue === "function")
|
|
@@ -39594,18 +39682,17 @@ function isTextAddress2(value) {
|
|
|
39594
39682
|
return false;
|
|
39595
39683
|
return range.start <= range.end;
|
|
39596
39684
|
}
|
|
39597
|
-
function
|
|
39685
|
+
function isBlockNodeAddress2(value) {
|
|
39598
39686
|
if (!isRecord3(value))
|
|
39599
39687
|
return false;
|
|
39600
|
-
if (
|
|
39688
|
+
if (value.kind !== "block")
|
|
39689
|
+
return false;
|
|
39690
|
+
if (typeof value.nodeType !== "string" || !BLOCK_NODE_TYPES_SET2.has(value.nodeType))
|
|
39601
39691
|
return false;
|
|
39602
|
-
if (typeof value.
|
|
39692
|
+
if (typeof value.nodeId !== "string")
|
|
39603
39693
|
return false;
|
|
39604
39694
|
return true;
|
|
39605
39695
|
}
|
|
39606
|
-
function isValidTarget2(value) {
|
|
39607
|
-
return isTextAddress2(value) || isSDAddress2(value);
|
|
39608
|
-
}
|
|
39609
39696
|
function assertNoUnknownFields3(input, allowlist, operationName) {
|
|
39610
39697
|
for (const key of Object.keys(input))
|
|
39611
39698
|
if (!allowlist.has(key))
|
|
@@ -42005,35 +42092,18 @@ function validateLegacyInlineContent2(item, parentType) {
|
|
|
42005
42092
|
throw new DocumentApiValidationError2("INVALID_PAYLOAD", `Inline image content in ${parentType} requires a non-empty "src" string field.`, { field: "src" });
|
|
42006
42093
|
}
|
|
42007
42094
|
}
|
|
42008
|
-
function
|
|
42095
|
+
function buildResolution2(resolution) {
|
|
42009
42096
|
return {
|
|
42010
|
-
|
|
42011
|
-
|
|
42012
|
-
|
|
42013
|
-
anchor: {
|
|
42014
|
-
start: {
|
|
42015
|
-
blockId: textAddr.blockId,
|
|
42016
|
-
offset: textAddr.range.start
|
|
42017
|
-
},
|
|
42018
|
-
end: {
|
|
42019
|
-
blockId: textAddr.blockId,
|
|
42020
|
-
offset: textAddr.range.end
|
|
42021
|
-
}
|
|
42022
|
-
}
|
|
42023
|
-
};
|
|
42024
|
-
}
|
|
42025
|
-
function buildSDResolution2(resolution) {
|
|
42026
|
-
return {
|
|
42027
|
-
...resolution.requestedTarget ? { requestedTarget: textAddressToSDAddress2(resolution.requestedTarget) } : {},
|
|
42028
|
-
target: textAddressToSDAddress2(resolution.target),
|
|
42029
|
-
...resolution.selectionTarget ? { selectionTarget: resolution.selectionTarget } : undefined
|
|
42097
|
+
target: resolution.target,
|
|
42098
|
+
range: resolution.range,
|
|
42099
|
+
...resolution.selectionTarget ? { selectionTarget: resolution.selectionTarget } : {}
|
|
42030
42100
|
};
|
|
42031
42101
|
}
|
|
42032
42102
|
function textReceiptToSDReceipt2(receipt2) {
|
|
42033
42103
|
if (receipt2.success)
|
|
42034
42104
|
return {
|
|
42035
42105
|
success: true,
|
|
42036
|
-
resolution: receipt2.resolution ?
|
|
42106
|
+
resolution: receipt2.resolution ? buildResolution2(receipt2.resolution) : undefined
|
|
42037
42107
|
};
|
|
42038
42108
|
const failure = {
|
|
42039
42109
|
code: "INTERNAL_ERROR",
|
|
@@ -42056,7 +42126,27 @@ function textReceiptToSDReceipt2(receipt2) {
|
|
|
42056
42126
|
return {
|
|
42057
42127
|
success: false,
|
|
42058
42128
|
failure,
|
|
42059
|
-
resolution: receipt2.resolution ?
|
|
42129
|
+
resolution: receipt2.resolution ? buildResolution2(receipt2.resolution) : undefined
|
|
42130
|
+
};
|
|
42131
|
+
}
|
|
42132
|
+
function buildStructuralReceipt2(success, params, failure) {
|
|
42133
|
+
const resolution = {
|
|
42134
|
+
target: params.target,
|
|
42135
|
+
range: params.range,
|
|
42136
|
+
...params.selectionTarget ? { selectionTarget: params.selectionTarget } : {}
|
|
42137
|
+
};
|
|
42138
|
+
if (success)
|
|
42139
|
+
return {
|
|
42140
|
+
success: true,
|
|
42141
|
+
resolution
|
|
42142
|
+
};
|
|
42143
|
+
return {
|
|
42144
|
+
success: false,
|
|
42145
|
+
failure: {
|
|
42146
|
+
code: failure?.code ?? "INTERNAL_ERROR",
|
|
42147
|
+
message: failure?.message ?? ""
|
|
42148
|
+
},
|
|
42149
|
+
resolution
|
|
42060
42150
|
};
|
|
42061
42151
|
}
|
|
42062
42152
|
function isStructuralInsertInput2(input) {
|
|
@@ -42104,8 +42194,8 @@ function validateStructuralInsertInput2(input) {
|
|
|
42104
42194
|
throw new DocumentApiValidationError2("INVALID_INPUT", '"type" field is only valid with legacy string input ("value"), not with structural "content".', { field: "type" });
|
|
42105
42195
|
assertNoUnknownFields3(input, STRUCTURAL_INSERT_ALLOWED_KEYS2, "insert");
|
|
42106
42196
|
const { target, content: content$2, placement: placement2, nestingPolicy } = input;
|
|
42107
|
-
if (target !== undefined && !
|
|
42108
|
-
throw new DocumentApiValidationError2("INVALID_TARGET",
|
|
42197
|
+
if (target !== undefined && !isBlockNodeAddress2(target))
|
|
42198
|
+
throw new DocumentApiValidationError2("INVALID_TARGET", 'target must be a BlockNodeAddress ({ kind: "block", nodeType, nodeId }).', {
|
|
42109
42199
|
field: "target",
|
|
42110
42200
|
value: target
|
|
42111
42201
|
});
|
|
@@ -42305,8 +42395,8 @@ function validateStructuralReplaceInput2(input) {
|
|
|
42305
42395
|
throw new DocumentApiValidationError2("INVALID_INPUT", 'Structural replace must provide either "target" or "ref", not both.', { fields: ["target", "ref"] });
|
|
42306
42396
|
if (!hasTarget && !hasRef)
|
|
42307
42397
|
throw new DocumentApiValidationError2("INVALID_TARGET", "Structural replace requires a target or ref.", { fields: ["target", "ref"] });
|
|
42308
|
-
if (hasTarget && !
|
|
42309
|
-
throw new DocumentApiValidationError2("INVALID_TARGET", "target must be a
|
|
42398
|
+
if (hasTarget && !isBlockNodeAddress2(target) && !isSelectionTarget2(target))
|
|
42399
|
+
throw new DocumentApiValidationError2("INVALID_TARGET", "target must be a BlockNodeAddress or SelectionTarget.", {
|
|
42310
42400
|
field: "target",
|
|
42311
42401
|
value: target
|
|
42312
42402
|
});
|
|
@@ -45167,7 +45257,10 @@ function createDocumentApi2(adapters) {
|
|
|
45167
45257
|
}
|
|
45168
45258
|
},
|
|
45169
45259
|
query: { match(input) {
|
|
45170
|
-
|
|
45260
|
+
if (!input || typeof input !== "object")
|
|
45261
|
+
throw new DocumentApiValidationError2("INVALID_INPUT", "query.match requires a QueryMatchInput or selector object.", { value: input });
|
|
45262
|
+
const normalized = "select" in input ? input : { select: input };
|
|
45263
|
+
return adapters.query.match(normalized);
|
|
45171
45264
|
} },
|
|
45172
45265
|
ranges: { resolve(input) {
|
|
45173
45266
|
return executeResolveRange2(adapters.ranges, input);
|
|
@@ -63483,7 +63576,7 @@ var isRegExp = (value) => {
|
|
|
63483
63576
|
}, decode$72 = (attrs) => {
|
|
63484
63577
|
const { pos } = attrs || {};
|
|
63485
63578
|
return pos?.toString();
|
|
63486
|
-
}, attributes_default$6, DocumentApiValidationError2, NODE_TYPES2, BLOCK_NODE_TYPES2, DELETABLE_BLOCK_NODE_TYPES2, INLINE_NODE_TYPES2, SELECTION_EDGE_NODE_TYPES2, MARK_KEYS2, INLINE_DIRECTIVES2, SD_CONTENT_NODE_KINDS2, SD_INLINE_NODE_KINDS2, PLACEMENT_VALUES2, TABLE_NESTING_POLICY_VALUES2, DEFAULT_NESTING_POLICY2,
|
|
63579
|
+
}, attributes_default$6, DocumentApiValidationError2, NODE_TYPES2, BLOCK_NODE_TYPES2, DELETABLE_BLOCK_NODE_TYPES2, INLINE_NODE_TYPES2, SELECTION_EDGE_NODE_TYPES2, MARK_KEYS2, INLINE_DIRECTIVES2, SD_CONTENT_NODE_KINDS2, SD_INLINE_NODE_KINDS2, PLACEMENT_VALUES2, TABLE_NESTING_POLICY_VALUES2, DEFAULT_NESTING_POLICY2, BLOCK_NODE_TYPES_SET2, NESTING_POLICY_ALLOWED_KEYS2, schemaBooleanOrNull2 = () => ({ oneOf: [{ type: "boolean" }, { type: "null" }] }), schemaStringOrNull2 = () => ({ oneOf: [{
|
|
63487
63580
|
type: "string",
|
|
63488
63581
|
minLength: 1
|
|
63489
63582
|
}, { type: "null" }] }), schemaNumberOrNull2 = () => ({ oneOf: [{ type: "number" }, { type: "null" }] }), schemaObjectOrNull2 = (properties) => ({ oneOf: [{
|
|
@@ -63523,7 +63616,7 @@ var isRegExp = (value) => {
|
|
|
63523
63616
|
tracked: false,
|
|
63524
63617
|
carrier: runAttributeCarrier2(runPropertyKey ?? key),
|
|
63525
63618
|
schema
|
|
63526
|
-
}), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_NOT_FOUND_COMMAND_TRACKED2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY3, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2,
|
|
63619
|
+
}), INLINE_PROPERTY_REGISTRY2, INLINE_PROPERTY_KEY_SET2, INLINE_PROPERTY_BY_KEY2, UNDERLINE_OBJECT_ALLOWED_KEYS2, SHADING_ALLOWED_KEYS2, BORDER_ALLOWED_KEYS2, FIT_TEXT_ALLOWED_KEYS2, LANG_ALLOWED_KEYS2, RFONTS_ALLOWED_KEYS2, EAST_ASIAN_LAYOUT_ALLOWED_KEYS2, STYLISTIC_SET_ALLOWED_KEYS2, VERT_ALIGN_VALUES2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, T_NOT_FOUND_COMMAND_TRACKED2, T_IMAGE_COMMAND2, T_CC_READ2, T_CC_MUTATION2, T_CC_TYPED2, T_CC_TYPED_READ2, T_CC_RAW2, T_QUERY_MATCH2, T_SECTION_CREATE2, T_SECTION_READ2, T_PARAGRAPH_MUTATION2, T_SECTION_MUTATION2, T_SECTION_SETTINGS_MUTATION2, T_HEADER_FOOTER_MUTATION2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_BLOCK_TYPES2, SET_STYLE_KEYS2, CLEAR_STYLE_KEYS2, RESET_DIRECT_FORMATTING_KEYS2, SET_ALIGNMENT_KEYS2, CLEAR_ALIGNMENT_KEYS2, SET_INDENTATION_KEYS2, CLEAR_INDENTATION_KEYS2, SET_SPACING_KEYS2, CLEAR_SPACING_KEYS2, SET_KEEP_OPTIONS_KEYS2, SET_OUTLINE_LEVEL_KEYS2, SET_FLOW_OPTIONS_KEYS2, SET_TAB_STOP_KEYS2, CLEAR_TAB_STOP_KEYS2, CLEAR_ALL_TAB_STOPS_KEYS2, SET_BORDER_KEYS2, CLEAR_BORDER_KEYS2, SET_SHADING_KEYS2, CLEAR_SHADING_KEYS2, ST_ON_OFF_ON_VALUES2, ST_ON_OFF_OFF_VALUES2, ST_UNDERLINE_VALUES2, ST_UNDERLINE_VALUE_SET2, ST_VERTICAL_ALIGN_RUN2, ST_EM2, ST_TEXT_ALIGNMENT2, ST_TEXT_DIRECTION2, ST_TEXTBOX_TIGHT_WRAP2, ST_TEXT_TRANSFORM2, ST_JUSTIFICATION2, FONT_FAMILY_SCHEMA2, COLOR_SCHEMA2, SPACING_SCHEMA2, INDENT_SCHEMA2, UNDERLINE_SCHEMA2, BORDER_PROPERTIES_SCHEMA2, SHADING_SCHEMA2, LANG_SCHEMA2, EAST_ASIAN_LAYOUT_SCHEMA2, FIT_TEXT_SCHEMA2, NUMBERING_PROPERTIES_SCHEMA2, FRAME_PR_SCHEMA2, PARAGRAPH_BORDERS_SCHEMA2, TAB_STOP_SCHEMA2, PROPERTY_REGISTRY3, ALLOWED_KEYS_BY_CHANNEL2, PROPERTY_INDEX2, EXCLUDED_KEYS2, INPUT_ALLOWED_KEYS2, TARGET_ALLOWED_KEYS2, OPTIONS_ALLOWED_KEYS2, VALID_CHANNELS2, Z_ORDER_RELATIVE_HEIGHT_MAX2 = 4294967295, nodeTypeValues2, blockNodeTypeValues2, deletableBlockNodeTypeValues2, inlineNodeTypeValues2, rangeSchema2, textAddressSchema2, textTargetSchema2, blockNodeAddressSchema2, deletableBlockNodeAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, listKindSchema2, listInsertPositionSchema2, sectionBreakTypeSchema2, sectionOrientationSchema2, sectionVerticalAlignSchema2, sectionDirectionSchema2, sectionHeaderFooterKindSchema2, sectionHeaderFooterVariantSchema2, sectionLineNumberRestartSchema2, sectionPageNumberFormatSchema2, sectionRangeDomainSchema2, sectionPageMarginsSchema2, sectionHeaderFooterMarginsSchema2, sectionPageSetupSchema2, sectionColumnsSchema2, sectionLineNumberingSchema2, sectionPageNumberingSchema2, sectionHeaderFooterRefsSchema2, sectionBorderSpecSchema2, sectionPageBordersSchema2, sectionMutationSuccessSchema2, documentMutationSuccessSchema2, paragraphMutationTargetSchema2, paragraphMutationSuccessSchema2, createSectionBreakSuccessSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refFailureSchema2, bookmarkAddressSchema2, bookmarkMutation2, footnoteAddressSchema2, footnoteConfigScopeSchema2, footnoteNumberingSchema2, footnoteMutation2, footnoteConfig2, crossRefAddressSchema2, crossRefTargetSchema2, crossRefDisplaySchema2, crossRefMutation2, indexAddressSchema2, indexEntryAddressSchema2, indexConfigSchema2, indexEntryDataSchema2, indexEntryPatchSchema2, indexMutation2, indexEntryMutation2, captionAddressSchema2, captionMutation2, captionConfig2, fieldAddressSchema2, fieldMutation2, citationAddressSchema2, citationSourceAddressSchema2, bibliographyAddressSchema2, citationMutation2, citationSourceMutation2, bibliographyMutation2, citationPersonSchema2, citationSourceFieldsSchema2, tocCreateLocationSchema2, authoritiesAddressSchema2, authorityEntryAddressSchema2, authoritiesConfigSchema2, authorityEntryDataSchema2, authorityEntryPatchSchema2, authoritiesMutation2, authorityEntryMutation2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES2, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, CREATE_COMMENT_ALLOWED_KEYS2, PATCH_COMMENT_ALLOWED_KEYS2, STYLE_APPLY_INPUT_ALLOWED_KEYS2, INLINE_ALIAS_INPUT_ALLOWED_KEYS2, DELETE_INPUT_ALLOWED_KEYS2, VALID_BEHAVIORS2, CONTENT_KIND_SET2, INLINE_KIND_SET2, LEGACY_TOP_LEVEL_TYPES2, LEGACY_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES2, TABLE_LOCATOR_OPS2, ROW_LOCATOR_OPS2, COLUMN_LOCATOR_OPS2, MERGE_RANGE_LOCATOR_OPS2, HEADER_FOOTER_KINDS$1, HEADER_FOOTER_VARIANTS$1, DEFAULT_SECTIONS_LIST_LIMIT2 = 250, SECTION_BREAK_TYPES3, SECTION_ORIENTATIONS2, SECTION_VERTICAL_ALIGNS2, SECTION_DIRECTIONS2, HEADER_FOOTER_KINDS3, HEADER_FOOTER_VARIANTS3, LINE_NUMBER_RESTARTS2, PAGE_NUMBER_FORMATS2, PAGE_BORDER_DISPLAYS2, PAGE_BORDER_OFFSET_FROM_VALUES2, PAGE_BORDER_Z_ORDER_VALUES2, VALID_WRAP_TYPES2, VALID_WRAP_SIDES2, VALID_IMAGE_SIZE_UNITS2, PATCH_FIELDS2, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$215) => ({
|
|
63527
63620
|
handlerName,
|
|
63528
63621
|
handler: (params) => {
|
|
63529
63622
|
const { nodes } = params;
|
|
@@ -75603,12 +75696,12 @@ var isRegExp = (value) => {
|
|
|
75603
75696
|
state.kern = kernNode.attributes["w:val"];
|
|
75604
75697
|
}
|
|
75605
75698
|
}, SuperConverter;
|
|
75606
|
-
var
|
|
75699
|
+
var init_SuperConverter_DBTvnSJQ_es = __esm(() => {
|
|
75607
75700
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
75608
75701
|
init_jszip_ChlR43oI_es();
|
|
75609
|
-
|
|
75702
|
+
init_xml_js_BtmJ6bNs_es();
|
|
75610
75703
|
init_uuid_qzgm05fK_es();
|
|
75611
|
-
|
|
75704
|
+
init_constants_ep1_Gwqi_es();
|
|
75612
75705
|
init_unified_BRHLwnjP_es();
|
|
75613
75706
|
init_lib_HnbxUP96_es();
|
|
75614
75707
|
init_lib_DAB30bX1_es();
|
|
@@ -78149,13 +78242,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78149
78242
|
]);
|
|
78150
78243
|
TABLE_NESTING_POLICY_VALUES2 = new Set(["forbid", "allow"]);
|
|
78151
78244
|
DEFAULT_NESTING_POLICY2 = Object.freeze({ tables: "forbid" });
|
|
78152
|
-
|
|
78153
|
-
"content",
|
|
78154
|
-
"inline",
|
|
78155
|
-
"annotation",
|
|
78156
|
-
"section"
|
|
78157
|
-
]);
|
|
78158
|
-
SD_ADDRESS_STABILITIES2 = new Set(["stable", "ephemeral"]);
|
|
78245
|
+
BLOCK_NODE_TYPES_SET2 = new Set(BLOCK_NODE_TYPES2);
|
|
78159
78246
|
NESTING_POLICY_ALLOWED_KEYS2 = new Set(["tables"]);
|
|
78160
78247
|
UNDERLINE_OBJECT_SCHEMA2 = {
|
|
78161
78248
|
type: "object",
|
|
@@ -78581,8 +78668,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78581
78668
|
throws: T_NOT_FOUND2
|
|
78582
78669
|
}),
|
|
78583
78670
|
referenceDocPath: "get-node-by-id.mdx",
|
|
78584
|
-
referenceGroup: "core"
|
|
78585
|
-
essential: true
|
|
78671
|
+
referenceGroup: "core"
|
|
78586
78672
|
},
|
|
78587
78673
|
getText: {
|
|
78588
78674
|
memberPath: "getText",
|
|
@@ -78592,7 +78678,8 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78592
78678
|
metadata: readOperation2(),
|
|
78593
78679
|
referenceDocPath: "get-text.mdx",
|
|
78594
78680
|
referenceGroup: "core",
|
|
78595
|
-
|
|
78681
|
+
intentGroup: "get_content",
|
|
78682
|
+
intentAction: "text"
|
|
78596
78683
|
},
|
|
78597
78684
|
getMarkdown: {
|
|
78598
78685
|
memberPath: "getMarkdown",
|
|
@@ -78601,7 +78688,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78601
78688
|
requiresDocumentContext: true,
|
|
78602
78689
|
metadata: readOperation2(),
|
|
78603
78690
|
referenceDocPath: "get-markdown.mdx",
|
|
78604
|
-
referenceGroup: "core"
|
|
78691
|
+
referenceGroup: "core",
|
|
78692
|
+
intentGroup: "get_content",
|
|
78693
|
+
intentAction: "markdown"
|
|
78605
78694
|
},
|
|
78606
78695
|
getHtml: {
|
|
78607
78696
|
memberPath: "getHtml",
|
|
@@ -78610,7 +78699,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78610
78699
|
requiresDocumentContext: true,
|
|
78611
78700
|
metadata: readOperation2(),
|
|
78612
78701
|
referenceDocPath: "get-html.mdx",
|
|
78613
|
-
referenceGroup: "core"
|
|
78702
|
+
referenceGroup: "core",
|
|
78703
|
+
intentGroup: "get_content",
|
|
78704
|
+
intentAction: "html"
|
|
78614
78705
|
},
|
|
78615
78706
|
markdownToFragment: {
|
|
78616
78707
|
memberPath: "markdownToFragment",
|
|
@@ -78628,7 +78719,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78628
78719
|
requiresDocumentContext: true,
|
|
78629
78720
|
metadata: readOperation2(),
|
|
78630
78721
|
referenceDocPath: "info.mdx",
|
|
78631
|
-
referenceGroup: "core"
|
|
78722
|
+
referenceGroup: "core",
|
|
78723
|
+
intentGroup: "get_content",
|
|
78724
|
+
intentAction: "info"
|
|
78632
78725
|
},
|
|
78633
78726
|
clearContent: {
|
|
78634
78727
|
memberPath: "clearContent",
|
|
@@ -78647,8 +78740,8 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78647
78740
|
},
|
|
78648
78741
|
insert: {
|
|
78649
78742
|
memberPath: "insert",
|
|
78650
|
-
description: "Insert inline content at a text position within an existing block
|
|
78651
|
-
expectedResult: "Returns
|
|
78743
|
+
description: "Insert content into the document. Two input shapes: legacy string-based (value + type) inserts inline content at a text position within an existing block; structural SDFragment (content) inserts one or more blocks as siblings relative to a BlockNodeAddress target. When target is omitted, content appends at the end of the document. Legacy mode supports text (default), markdown, and html content types via the `type` field. Structural mode uses `placement` (before/after/insideStart/insideEnd) to position relative to the target block.",
|
|
78744
|
+
expectedResult: "Returns an SDMutationReceipt with applied status; resolution reports a TextAddress for legacy text insertion or a BlockNodeAddress for structural insertion. Receipt reports NO_OP if the insertion point is invalid or content is empty.",
|
|
78652
78745
|
requiresDocumentContext: true,
|
|
78653
78746
|
metadata: mutationOperation2({
|
|
78654
78747
|
idempotency: "non-idempotent",
|
|
@@ -78682,11 +78775,13 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78682
78775
|
]
|
|
78683
78776
|
}),
|
|
78684
78777
|
referenceDocPath: "insert.mdx",
|
|
78685
|
-
referenceGroup: "core"
|
|
78778
|
+
referenceGroup: "core",
|
|
78779
|
+
intentGroup: "edit",
|
|
78780
|
+
intentAction: "insert"
|
|
78686
78781
|
},
|
|
78687
78782
|
replace: {
|
|
78688
78783
|
memberPath: "replace",
|
|
78689
|
-
description: "Replace content at a contiguous document selection. Text path accepts a SelectionTarget or ref plus replacement text. Structural path accepts
|
|
78784
|
+
description: "Replace content at a contiguous document selection. Text path accepts a SelectionTarget or ref plus replacement text. Structural path accepts a BlockNodeAddress (replaces whole block), SelectionTarget (expands to full covered block boundaries), or ref plus SDFragment content.",
|
|
78690
78785
|
expectedResult: "Returns an SDMutationReceipt with applied status; receipt reports NO_OP if the target range already contains identical content.",
|
|
78691
78786
|
requiresDocumentContext: true,
|
|
78692
78787
|
metadata: mutationOperation2({
|
|
@@ -78719,7 +78814,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78719
78814
|
]
|
|
78720
78815
|
}),
|
|
78721
78816
|
referenceDocPath: "replace.mdx",
|
|
78722
|
-
referenceGroup: "core"
|
|
78817
|
+
referenceGroup: "core",
|
|
78818
|
+
intentGroup: "edit",
|
|
78819
|
+
intentAction: "replace"
|
|
78723
78820
|
},
|
|
78724
78821
|
delete: {
|
|
78725
78822
|
memberPath: "delete",
|
|
@@ -78738,7 +78835,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78738
78835
|
]
|
|
78739
78836
|
}),
|
|
78740
78837
|
referenceDocPath: "delete.mdx",
|
|
78741
|
-
referenceGroup: "core"
|
|
78838
|
+
referenceGroup: "core",
|
|
78839
|
+
intentGroup: "edit",
|
|
78840
|
+
intentAction: "delete"
|
|
78742
78841
|
},
|
|
78743
78842
|
"blocks.list": {
|
|
78744
78843
|
memberPath: "blocks.list",
|
|
@@ -78747,8 +78846,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78747
78846
|
requiresDocumentContext: true,
|
|
78748
78847
|
metadata: readOperation2({ throws: ["INVALID_INPUT"] }),
|
|
78749
78848
|
referenceDocPath: "blocks/list.mdx",
|
|
78750
|
-
referenceGroup: "blocks"
|
|
78751
|
-
essential: true
|
|
78849
|
+
referenceGroup: "blocks"
|
|
78752
78850
|
},
|
|
78753
78851
|
"blocks.delete": {
|
|
78754
78852
|
memberPath: "blocks.delete",
|
|
@@ -78811,7 +78909,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78811
78909
|
]
|
|
78812
78910
|
}),
|
|
78813
78911
|
referenceDocPath: "format/apply.mdx",
|
|
78814
|
-
referenceGroup: "format"
|
|
78912
|
+
referenceGroup: "format",
|
|
78913
|
+
intentGroup: "format",
|
|
78914
|
+
intentAction: "inline"
|
|
78815
78915
|
},
|
|
78816
78916
|
...FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2,
|
|
78817
78917
|
"styles.apply": {
|
|
@@ -78852,7 +78952,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78852
78952
|
]
|
|
78853
78953
|
}),
|
|
78854
78954
|
referenceDocPath: "create/paragraph.mdx",
|
|
78855
|
-
referenceGroup: "create"
|
|
78955
|
+
referenceGroup: "create",
|
|
78956
|
+
intentGroup: "create",
|
|
78957
|
+
intentAction: "paragraph"
|
|
78856
78958
|
},
|
|
78857
78959
|
"create.heading": {
|
|
78858
78960
|
memberPath: "create.heading",
|
|
@@ -78871,7 +78973,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
78871
78973
|
]
|
|
78872
78974
|
}),
|
|
78873
78975
|
referenceDocPath: "create/heading.mdx",
|
|
78874
|
-
referenceGroup: "create"
|
|
78976
|
+
referenceGroup: "create",
|
|
78977
|
+
intentGroup: "create",
|
|
78978
|
+
intentAction: "heading"
|
|
78875
78979
|
},
|
|
78876
78980
|
"create.sectionBreak": {
|
|
78877
78981
|
memberPath: "create.sectionBreak",
|
|
@@ -79241,7 +79345,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79241
79345
|
throws: T_PARAGRAPH_MUTATION2
|
|
79242
79346
|
}),
|
|
79243
79347
|
referenceDocPath: "styles/paragraph/set-style.mdx",
|
|
79244
|
-
referenceGroup: "styles.paragraph"
|
|
79348
|
+
referenceGroup: "styles.paragraph",
|
|
79349
|
+
intentGroup: "format",
|
|
79350
|
+
intentAction: "set_style"
|
|
79245
79351
|
},
|
|
79246
79352
|
"styles.paragraph.clearStyle": {
|
|
79247
79353
|
memberPath: "styles.paragraph.clearStyle",
|
|
@@ -79286,7 +79392,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79286
79392
|
throws: T_PARAGRAPH_MUTATION2
|
|
79287
79393
|
}),
|
|
79288
79394
|
referenceDocPath: "format/paragraph/set-alignment.mdx",
|
|
79289
|
-
referenceGroup: "format.paragraph"
|
|
79395
|
+
referenceGroup: "format.paragraph",
|
|
79396
|
+
intentGroup: "format",
|
|
79397
|
+
intentAction: "set_alignment"
|
|
79290
79398
|
},
|
|
79291
79399
|
"format.paragraph.clearAlignment": {
|
|
79292
79400
|
memberPath: "format.paragraph.clearAlignment",
|
|
@@ -79316,7 +79424,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79316
79424
|
throws: T_PARAGRAPH_MUTATION2
|
|
79317
79425
|
}),
|
|
79318
79426
|
referenceDocPath: "format/paragraph/set-indentation.mdx",
|
|
79319
|
-
referenceGroup: "format.paragraph"
|
|
79427
|
+
referenceGroup: "format.paragraph",
|
|
79428
|
+
intentGroup: "format",
|
|
79429
|
+
intentAction: "set_indentation"
|
|
79320
79430
|
},
|
|
79321
79431
|
"format.paragraph.clearIndentation": {
|
|
79322
79432
|
memberPath: "format.paragraph.clearIndentation",
|
|
@@ -79346,7 +79456,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79346
79456
|
throws: T_PARAGRAPH_MUTATION2
|
|
79347
79457
|
}),
|
|
79348
79458
|
referenceDocPath: "format/paragraph/set-spacing.mdx",
|
|
79349
|
-
referenceGroup: "format.paragraph"
|
|
79459
|
+
referenceGroup: "format.paragraph",
|
|
79460
|
+
intentGroup: "format",
|
|
79461
|
+
intentAction: "set_spacing"
|
|
79350
79462
|
},
|
|
79351
79463
|
"format.paragraph.clearSpacing": {
|
|
79352
79464
|
memberPath: "format.paragraph.clearSpacing",
|
|
@@ -79554,7 +79666,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79554
79666
|
throws: [...T_NOT_FOUND_CAPABLE2, "INVALID_TARGET"]
|
|
79555
79667
|
}),
|
|
79556
79668
|
referenceDocPath: "lists/insert.mdx",
|
|
79557
|
-
referenceGroup: "lists"
|
|
79669
|
+
referenceGroup: "lists",
|
|
79670
|
+
intentGroup: "list",
|
|
79671
|
+
intentAction: "insert"
|
|
79558
79672
|
},
|
|
79559
79673
|
"lists.create": {
|
|
79560
79674
|
memberPath: "lists.create",
|
|
@@ -79569,7 +79683,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79569
79683
|
throws: [...T_NOT_FOUND_CAPABLE2, "INVALID_TARGET"]
|
|
79570
79684
|
}),
|
|
79571
79685
|
referenceDocPath: "lists/create.mdx",
|
|
79572
|
-
referenceGroup: "lists"
|
|
79686
|
+
referenceGroup: "lists",
|
|
79687
|
+
intentGroup: "list",
|
|
79688
|
+
intentAction: "create"
|
|
79573
79689
|
},
|
|
79574
79690
|
"lists.attach": {
|
|
79575
79691
|
memberPath: "lists.attach",
|
|
@@ -79599,7 +79715,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79599
79715
|
throws: [...T_NOT_FOUND_CAPABLE2, "INVALID_TARGET"]
|
|
79600
79716
|
}),
|
|
79601
79717
|
referenceDocPath: "lists/detach.mdx",
|
|
79602
|
-
referenceGroup: "lists"
|
|
79718
|
+
referenceGroup: "lists",
|
|
79719
|
+
intentGroup: "list",
|
|
79720
|
+
intentAction: "detach"
|
|
79603
79721
|
},
|
|
79604
79722
|
"lists.indent": {
|
|
79605
79723
|
memberPath: "lists.indent",
|
|
@@ -79618,7 +79736,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79618
79736
|
throws: [...T_NOT_FOUND_CAPABLE2, "INVALID_TARGET"]
|
|
79619
79737
|
}),
|
|
79620
79738
|
referenceDocPath: "lists/indent.mdx",
|
|
79621
|
-
referenceGroup: "lists"
|
|
79739
|
+
referenceGroup: "lists",
|
|
79740
|
+
intentGroup: "list",
|
|
79741
|
+
intentAction: "indent"
|
|
79622
79742
|
},
|
|
79623
79743
|
"lists.outdent": {
|
|
79624
79744
|
memberPath: "lists.outdent",
|
|
@@ -79637,7 +79757,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79637
79757
|
throws: [...T_NOT_FOUND_CAPABLE2, "INVALID_TARGET"]
|
|
79638
79758
|
}),
|
|
79639
79759
|
referenceDocPath: "lists/outdent.mdx",
|
|
79640
|
-
referenceGroup: "lists"
|
|
79760
|
+
referenceGroup: "lists",
|
|
79761
|
+
intentGroup: "list",
|
|
79762
|
+
intentAction: "outdent"
|
|
79641
79763
|
},
|
|
79642
79764
|
"lists.join": {
|
|
79643
79765
|
memberPath: "lists.join",
|
|
@@ -79707,7 +79829,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79707
79829
|
throws: [...T_NOT_FOUND_CAPABLE2, "INVALID_TARGET"]
|
|
79708
79830
|
}),
|
|
79709
79831
|
referenceDocPath: "lists/set-level.mdx",
|
|
79710
|
-
referenceGroup: "lists"
|
|
79832
|
+
referenceGroup: "lists",
|
|
79833
|
+
intentGroup: "list",
|
|
79834
|
+
intentAction: "set_level"
|
|
79711
79835
|
},
|
|
79712
79836
|
"lists.setValue": {
|
|
79713
79837
|
memberPath: "lists.setValue",
|
|
@@ -79858,7 +79982,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
79858
79982
|
]
|
|
79859
79983
|
}),
|
|
79860
79984
|
referenceDocPath: "lists/set-type.mdx",
|
|
79861
|
-
referenceGroup: "lists"
|
|
79985
|
+
referenceGroup: "lists",
|
|
79986
|
+
intentGroup: "list",
|
|
79987
|
+
intentAction: "set_type"
|
|
79862
79988
|
},
|
|
79863
79989
|
"lists.captureTemplate": {
|
|
79864
79990
|
memberPath: "lists.captureTemplate",
|
|
@@ -80064,7 +80190,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80064
80190
|
throws: [...T_NOT_FOUND_CAPABLE2, "INVALID_TARGET"]
|
|
80065
80191
|
}),
|
|
80066
80192
|
referenceDocPath: "comments/create.mdx",
|
|
80067
|
-
referenceGroup: "comments"
|
|
80193
|
+
referenceGroup: "comments",
|
|
80194
|
+
intentGroup: "comment",
|
|
80195
|
+
intentAction: "create"
|
|
80068
80196
|
},
|
|
80069
80197
|
"comments.patch": {
|
|
80070
80198
|
memberPath: "comments.patch",
|
|
@@ -80083,7 +80211,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80083
80211
|
]
|
|
80084
80212
|
}),
|
|
80085
80213
|
referenceDocPath: "comments/patch.mdx",
|
|
80086
|
-
referenceGroup: "comments"
|
|
80214
|
+
referenceGroup: "comments",
|
|
80215
|
+
intentGroup: "comment",
|
|
80216
|
+
intentAction: "update"
|
|
80087
80217
|
},
|
|
80088
80218
|
"comments.delete": {
|
|
80089
80219
|
memberPath: "comments.delete",
|
|
@@ -80098,7 +80228,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80098
80228
|
throws: T_NOT_FOUND_CAPABLE2
|
|
80099
80229
|
}),
|
|
80100
80230
|
referenceDocPath: "comments/delete.mdx",
|
|
80101
|
-
referenceGroup: "comments"
|
|
80231
|
+
referenceGroup: "comments",
|
|
80232
|
+
intentGroup: "comment",
|
|
80233
|
+
intentAction: "delete"
|
|
80102
80234
|
},
|
|
80103
80235
|
"comments.get": {
|
|
80104
80236
|
memberPath: "comments.get",
|
|
@@ -80110,7 +80242,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80110
80242
|
throws: T_NOT_FOUND2
|
|
80111
80243
|
}),
|
|
80112
80244
|
referenceDocPath: "comments/get.mdx",
|
|
80113
|
-
referenceGroup: "comments"
|
|
80245
|
+
referenceGroup: "comments",
|
|
80246
|
+
intentGroup: "comment",
|
|
80247
|
+
intentAction: "get"
|
|
80114
80248
|
},
|
|
80115
80249
|
"comments.list": {
|
|
80116
80250
|
memberPath: "comments.list",
|
|
@@ -80122,7 +80256,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80122
80256
|
throws: ["INVALID_INPUT"]
|
|
80123
80257
|
}),
|
|
80124
80258
|
referenceDocPath: "comments/list.mdx",
|
|
80125
|
-
referenceGroup: "comments"
|
|
80259
|
+
referenceGroup: "comments",
|
|
80260
|
+
intentGroup: "comment",
|
|
80261
|
+
intentAction: "list"
|
|
80126
80262
|
},
|
|
80127
80263
|
"trackChanges.list": {
|
|
80128
80264
|
memberPath: "trackChanges.list",
|
|
@@ -80134,7 +80270,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80134
80270
|
throws: ["INVALID_INPUT"]
|
|
80135
80271
|
}),
|
|
80136
80272
|
referenceDocPath: "track-changes/list.mdx",
|
|
80137
|
-
referenceGroup: "trackChanges"
|
|
80273
|
+
referenceGroup: "trackChanges",
|
|
80274
|
+
intentGroup: "track_changes",
|
|
80275
|
+
intentAction: "list"
|
|
80138
80276
|
},
|
|
80139
80277
|
"trackChanges.get": {
|
|
80140
80278
|
memberPath: "trackChanges.get",
|
|
@@ -80165,7 +80303,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80165
80303
|
]
|
|
80166
80304
|
}),
|
|
80167
80305
|
referenceDocPath: "track-changes/decide.mdx",
|
|
80168
|
-
referenceGroup: "trackChanges"
|
|
80306
|
+
referenceGroup: "trackChanges",
|
|
80307
|
+
intentGroup: "track_changes",
|
|
80308
|
+
intentAction: "decide"
|
|
80169
80309
|
},
|
|
80170
80310
|
"query.match": {
|
|
80171
80311
|
memberPath: "query.match",
|
|
@@ -80179,7 +80319,8 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80179
80319
|
}),
|
|
80180
80320
|
referenceDocPath: "query/match.mdx",
|
|
80181
80321
|
referenceGroup: "query",
|
|
80182
|
-
|
|
80322
|
+
intentGroup: "search",
|
|
80323
|
+
intentAction: "match"
|
|
80183
80324
|
},
|
|
80184
80325
|
"ranges.resolve": {
|
|
80185
80326
|
memberPath: "ranges.resolve",
|
|
@@ -80198,8 +80339,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80198
80339
|
deterministicTargetResolution: true
|
|
80199
80340
|
}),
|
|
80200
80341
|
referenceDocPath: "ranges/resolve.mdx",
|
|
80201
|
-
referenceGroup: "ranges"
|
|
80202
|
-
essential: true
|
|
80342
|
+
referenceGroup: "ranges"
|
|
80203
80343
|
},
|
|
80204
80344
|
"mutations.preview": {
|
|
80205
80345
|
memberPath: "mutations.preview",
|
|
@@ -80212,7 +80352,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80212
80352
|
deterministicTargetResolution: true
|
|
80213
80353
|
}),
|
|
80214
80354
|
referenceDocPath: "mutations/preview.mdx",
|
|
80215
|
-
referenceGroup: "mutations"
|
|
80355
|
+
referenceGroup: "mutations",
|
|
80356
|
+
intentGroup: "mutations",
|
|
80357
|
+
intentAction: "preview"
|
|
80216
80358
|
},
|
|
80217
80359
|
"mutations.apply": {
|
|
80218
80360
|
memberPath: "mutations.apply",
|
|
@@ -80235,7 +80377,8 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
80235
80377
|
}),
|
|
80236
80378
|
referenceDocPath: "mutations/apply.mdx",
|
|
80237
80379
|
referenceGroup: "mutations",
|
|
80238
|
-
|
|
80380
|
+
intentGroup: "mutations",
|
|
80381
|
+
intentAction: "apply"
|
|
80239
80382
|
},
|
|
80240
80383
|
"capabilities.get": {
|
|
80241
80384
|
memberPath: "capabilities",
|
|
@@ -81091,7 +81234,8 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
81091
81234
|
}),
|
|
81092
81235
|
referenceDocPath: "history/undo.mdx",
|
|
81093
81236
|
referenceGroup: "history",
|
|
81094
|
-
|
|
81237
|
+
intentGroup: "edit",
|
|
81238
|
+
intentAction: "undo"
|
|
81095
81239
|
},
|
|
81096
81240
|
"history.redo": {
|
|
81097
81241
|
memberPath: "history.redo",
|
|
@@ -81106,7 +81250,9 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
81106
81250
|
throws: ["CAPABILITY_UNAVAILABLE"]
|
|
81107
81251
|
}),
|
|
81108
81252
|
referenceDocPath: "history/redo.mdx",
|
|
81109
|
-
referenceGroup: "history"
|
|
81253
|
+
referenceGroup: "history",
|
|
81254
|
+
intentGroup: "edit",
|
|
81255
|
+
intentAction: "redo"
|
|
81110
81256
|
},
|
|
81111
81257
|
"create.image": {
|
|
81112
81258
|
memberPath: "create.image",
|
|
@@ -84458,7 +84604,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
84458
84604
|
resolvedHandleSchema2 = ref2("ResolvedHandle");
|
|
84459
84605
|
pageInfoSchema2 = ref2("PageInfo");
|
|
84460
84606
|
receiptSuccessSchema2 = ref2("ReceiptSuccess");
|
|
84461
|
-
ref2("TextMutationRange");
|
|
84607
|
+
textMutationRangeSchema2 = ref2("TextMutationRange");
|
|
84462
84608
|
textMutationResolutionSchema2 = ref2("TextMutationResolution");
|
|
84463
84609
|
textMutationSuccessSchema2 = ref2("TextMutationSuccess");
|
|
84464
84610
|
ref2("MatchRun");
|
|
@@ -84540,41 +84686,18 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
84540
84686
|
kind: { enum: ["block", "inline"] }
|
|
84541
84687
|
}, ["type"]);
|
|
84542
84688
|
objectSchema2({ nodeType: { enum: [...nodeTypeValues2] } }, ["nodeType"]);
|
|
84543
|
-
sdSelectorSchema2 = { oneOf: [objectSchema2({
|
|
84544
|
-
type: { const: "text" },
|
|
84545
|
-
pattern: { type: "string" },
|
|
84546
|
-
mode: { enum: ["contains", "regex"] },
|
|
84547
|
-
caseSensitive: { type: "boolean" }
|
|
84548
|
-
}, ["type", "pattern"]), objectSchema2({
|
|
84549
|
-
type: { const: "node" },
|
|
84550
|
-
kind: { enum: ["content", "inline"] },
|
|
84551
|
-
nodeKind: { type: "string" }
|
|
84552
|
-
}, ["type"])] };
|
|
84553
|
-
sdAddressSchema2 = objectSchema2({
|
|
84554
|
-
kind: { enum: [
|
|
84555
|
-
"content",
|
|
84556
|
-
"inline",
|
|
84557
|
-
"annotation",
|
|
84558
|
-
"section"
|
|
84559
|
-
] },
|
|
84560
|
-
stability: { enum: ["stable", "ephemeral"] },
|
|
84561
|
-
nodeId: { type: "string" },
|
|
84562
|
-
anchor: objectSchema2({
|
|
84563
|
-
start: objectSchema2({
|
|
84564
|
-
blockId: { type: "string" },
|
|
84565
|
-
offset: { type: "integer" }
|
|
84566
|
-
}, ["blockId", "offset"]),
|
|
84567
|
-
end: objectSchema2({
|
|
84568
|
-
blockId: { type: "string" },
|
|
84569
|
-
offset: { type: "integer" }
|
|
84570
|
-
}, ["blockId", "offset"])
|
|
84571
|
-
}),
|
|
84572
|
-
evaluatedRevision: { type: "string" },
|
|
84573
|
-
path: arraySchema2({ oneOf: [{ type: "string" }, { type: "integer" }] })
|
|
84574
|
-
}, ["kind", "stability"]);
|
|
84575
84689
|
objectSchema2({
|
|
84576
|
-
select:
|
|
84577
|
-
|
|
84690
|
+
select: { oneOf: [objectSchema2({
|
|
84691
|
+
type: { const: "text" },
|
|
84692
|
+
pattern: { type: "string" },
|
|
84693
|
+
mode: { enum: ["contains", "regex"] },
|
|
84694
|
+
caseSensitive: { type: "boolean" }
|
|
84695
|
+
}, ["type", "pattern"]), objectSchema2({
|
|
84696
|
+
type: { const: "node" },
|
|
84697
|
+
kind: { enum: ["block", "inline"] },
|
|
84698
|
+
nodeType: { type: "string" }
|
|
84699
|
+
}, ["type"])] },
|
|
84700
|
+
within: blockNodeAddressSchema2,
|
|
84578
84701
|
limit: { type: "integer" },
|
|
84579
84702
|
offset: { type: "integer" },
|
|
84580
84703
|
options: objectSchema2({
|
|
@@ -84598,7 +84721,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
84598
84721
|
},
|
|
84599
84722
|
items: arraySchema2(objectSchema2({
|
|
84600
84723
|
node: { type: "object" },
|
|
84601
|
-
address:
|
|
84724
|
+
address: nodeAddressSchema2,
|
|
84602
84725
|
context: { type: "object" }
|
|
84603
84726
|
}, ["node", "address"]))
|
|
84604
84727
|
}, [
|
|
@@ -84608,10 +84731,10 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
84608
84731
|
"items"
|
|
84609
84732
|
]);
|
|
84610
84733
|
sdMutationResolutionSchema2 = objectSchema2({
|
|
84611
|
-
|
|
84612
|
-
|
|
84734
|
+
target: { oneOf: [textAddressSchema2, blockNodeAddressSchema2] },
|
|
84735
|
+
range: textMutationRangeSchema2,
|
|
84613
84736
|
selectionTarget: selectionTargetSchema2
|
|
84614
|
-
}, ["target"]);
|
|
84737
|
+
}, ["target", "range"]);
|
|
84615
84738
|
sdMutationSuccessSchema2 = objectSchema2({
|
|
84616
84739
|
success: { const: true },
|
|
84617
84740
|
resolution: sdMutationResolutionSchema2,
|
|
@@ -85082,6 +85205,17 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
85082
85205
|
"planEngine"
|
|
85083
85206
|
]);
|
|
85084
85207
|
objectSchema2({});
|
|
85208
|
+
sdFragmentSchema2 = { oneOf: [{ type: "object" }, {
|
|
85209
|
+
type: "array",
|
|
85210
|
+
items: { type: "object" }
|
|
85211
|
+
}] };
|
|
85212
|
+
placementSchema2 = { enum: [
|
|
85213
|
+
"before",
|
|
85214
|
+
"after",
|
|
85215
|
+
"insideStart",
|
|
85216
|
+
"insideEnd"
|
|
85217
|
+
] };
|
|
85218
|
+
nestingPolicySchema2 = objectSchema2({ tables: { enum: ["forbid", "allow"] } });
|
|
85085
85219
|
objectSchema2({
|
|
85086
85220
|
target: textAddressSchema2,
|
|
85087
85221
|
value: { type: "string" },
|
|
@@ -85093,7 +85227,12 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
85093
85227
|
"html"
|
|
85094
85228
|
]
|
|
85095
85229
|
}
|
|
85096
|
-
}, ["value"])
|
|
85230
|
+
}, ["value"]), objectSchema2({
|
|
85231
|
+
target: blockNodeAddressSchema2,
|
|
85232
|
+
content: sdFragmentSchema2,
|
|
85233
|
+
placement: placementSchema2,
|
|
85234
|
+
nestingPolicy: nestingPolicySchema2
|
|
85235
|
+
}, ["content"]);
|
|
85097
85236
|
({ ...objectSchema2({
|
|
85098
85237
|
target: blockNodeAddressSchema2,
|
|
85099
85238
|
nodeId: { type: "string" }
|
|
@@ -85668,17 +85807,13 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
85668
85807
|
"lossy",
|
|
85669
85808
|
"diagnostics"
|
|
85670
85809
|
]), receiptResultSchemaFor2("clearContent"), receiptFailureResultSchemaFor2("clearContent"), sdMutationResultSchemaFor2("insert"), sdMutationFailureSchemaFor2("insert"), { ...targetLocatorWithPayload2({ text: { type: "string" } }, ["text"]) }, objectSchema2({
|
|
85671
|
-
target: { oneOf: [
|
|
85672
|
-
|
|
85673
|
-
|
|
85674
|
-
selectionTargetSchema2
|
|
85675
|
-
] },
|
|
85676
|
-
content: { type: "object" },
|
|
85677
|
-
nestingPolicy: { type: "object" }
|
|
85810
|
+
target: { oneOf: [blockNodeAddressSchema2, selectionTargetSchema2] },
|
|
85811
|
+
content: sdFragmentSchema2,
|
|
85812
|
+
nestingPolicy: nestingPolicySchema2
|
|
85678
85813
|
}, ["target", "content"]), objectSchema2({
|
|
85679
85814
|
ref: { type: "string" },
|
|
85680
|
-
content:
|
|
85681
|
-
nestingPolicy:
|
|
85815
|
+
content: sdFragmentSchema2,
|
|
85816
|
+
nestingPolicy: nestingPolicySchema2
|
|
85682
85817
|
}, ["ref", "content"]), sdMutationResultSchemaFor2("replace"), sdMutationFailureSchemaFor2("replace"), { ...targetLocatorWithPayload2({ behavior: deleteBehaviorSchema2 }) }, textMutationResultSchemaFor2("delete"), textMutationFailureSchemaFor2("delete"), { ...targetLocatorWithPayload2({ inline: buildInlineRunPatchSchema2() }, ["inline"]) }, textMutationResultSchemaFor2("format.apply"), textMutationFailureSchemaFor2("format.apply"), { ...formatInlineAliasOperationSchemas2 }, objectSchema2({
|
|
85683
85818
|
offset: {
|
|
85684
85819
|
type: "number",
|
|
@@ -86479,7 +86614,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
86479
86614
|
] }
|
|
86480
86615
|
}), objectSchema2({ id: { type: "string" } }, ["id"]), objectSchema2({ id: { type: "string" } }, ["id"]), objectSchema2({ scope: { enum: ["all"] } }, ["scope"]), receiptResultSchemaFor2("trackChanges.decide"), receiptFailureResultSchemaFor2("trackChanges.decide"), objectSchema2({
|
|
86481
86616
|
select: { oneOf: [textSelectorSchema2, nodeSelectorSchema2] },
|
|
86482
|
-
within:
|
|
86617
|
+
within: blockNodeAddressSchema2,
|
|
86483
86618
|
require: { enum: [
|
|
86484
86619
|
"any",
|
|
86485
86620
|
"first",
|
|
@@ -86499,7 +86634,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
86499
86634
|
}, ["select"]), (() => {
|
|
86500
86635
|
const textMatchItemSchema = discoveryItemSchema2({
|
|
86501
86636
|
matchKind: { const: "text" },
|
|
86502
|
-
address:
|
|
86637
|
+
address: blockNodeAddressSchema2,
|
|
86503
86638
|
target: selectionTargetSchema2,
|
|
86504
86639
|
snippet: { type: "string" },
|
|
86505
86640
|
highlightRange: rangeSchema2,
|
|
@@ -86539,7 +86674,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
86539
86674
|
type: "string"
|
|
86540
86675
|
},
|
|
86541
86676
|
select: { oneOf: [textSelectorSchema2, nodeSelectorSchema2] },
|
|
86542
|
-
within:
|
|
86677
|
+
within: blockNodeAddressSchema2,
|
|
86543
86678
|
require: { enum: [
|
|
86544
86679
|
"first",
|
|
86545
86680
|
"exactlyOne",
|
|
@@ -86556,7 +86691,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
86556
86691
|
type: "string"
|
|
86557
86692
|
},
|
|
86558
86693
|
ref: { type: "string" },
|
|
86559
|
-
within:
|
|
86694
|
+
within: blockNodeAddressSchema2
|
|
86560
86695
|
}, ["by", "ref"]),
|
|
86561
86696
|
objectSchema2({
|
|
86562
86697
|
by: {
|
|
@@ -86572,7 +86707,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
86572
86707
|
type: "string"
|
|
86573
86708
|
},
|
|
86574
86709
|
select: { oneOf: [textSelectorSchema2, nodeSelectorSchema2] },
|
|
86575
|
-
within:
|
|
86710
|
+
within: blockNodeAddressSchema2,
|
|
86576
86711
|
require: { enum: ["first", "exactlyOne"] }
|
|
86577
86712
|
}, [
|
|
86578
86713
|
"by",
|
|
@@ -86585,7 +86720,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
86585
86720
|
type: "string"
|
|
86586
86721
|
},
|
|
86587
86722
|
select: { oneOf: [textSelectorSchema2, nodeSelectorSchema2] },
|
|
86588
|
-
within:
|
|
86723
|
+
within: blockNodeAddressSchema2
|
|
86589
86724
|
}, ["by", "select"]);
|
|
86590
86725
|
const replacementBlockSchema = objectSchema2({ text: { type: "string" } }, ["text"]);
|
|
86591
86726
|
const replacementPayloadSchema = { oneOf: [objectSchema2({ text: { type: "string" } }, ["text"]), objectSchema2({ blocks: arraySchema2(replacementBlockSchema) }, ["blocks"])] };
|
|
@@ -87844,7 +87979,7 @@ var init_SuperConverter_BParsWaS_es = __esm(() => {
|
|
|
87844
87979
|
imageId: { type: "string" },
|
|
87845
87980
|
text: { type: "string" }
|
|
87846
87981
|
}, ["imageId", "text"])), imagesMutationSchemaSet2(objectSchema2({ imageId: { type: "string" } }, ["imageId"])), objectSchema2({
|
|
87847
|
-
within:
|
|
87982
|
+
within: blockNodeAddressSchema2,
|
|
87848
87983
|
hrefPattern: { type: "string" },
|
|
87849
87984
|
anchor: { type: "string" },
|
|
87850
87985
|
textPattern: { type: "string" },
|
|
@@ -110306,7 +110441,7 @@ var init_remark_stringify_D8vxv_XI_es = __esm(() => {
|
|
|
110306
110441
|
eol = /\r?\n|\r/g;
|
|
110307
110442
|
});
|
|
110308
110443
|
|
|
110309
|
-
// ../../packages/superdoc/dist/chunks/DocxZipper-
|
|
110444
|
+
// ../../packages/superdoc/dist/chunks/DocxZipper-DTP6a0rR.es.js
|
|
110310
110445
|
function getLens2(b64) {
|
|
110311
110446
|
var len$1 = b64.length;
|
|
110312
110447
|
if (len$1 % 4 > 0)
|
|
@@ -110942,11 +111077,11 @@ var DOCX = "application/vnd.openxmlformats-officedocument.wordprocessingml.docum
|
|
|
110942
111077
|
return `image/${MIME_TYPE_FOR_EXT[detectedType] || detectedType}`;
|
|
110943
111078
|
}
|
|
110944
111079
|
}, DocxZipper_default;
|
|
110945
|
-
var
|
|
111080
|
+
var init_DocxZipper_DTP6a0rR_es = __esm(() => {
|
|
110946
111081
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
110947
111082
|
init_jszip_ChlR43oI_es();
|
|
110948
|
-
|
|
110949
|
-
|
|
111083
|
+
init_xml_js_BtmJ6bNs_es();
|
|
111084
|
+
init_constants_ep1_Gwqi_es();
|
|
110950
111085
|
buffer2 = {};
|
|
110951
111086
|
base64Js2 = {};
|
|
110952
111087
|
base64Js2.byteLength = byteLength2;
|
|
@@ -136045,7 +136180,7 @@ var init_remark_gfm_CjV8kaUy_es = __esm(() => {
|
|
|
136045
136180
|
init_remark_gfm_z_sDF4ss_es();
|
|
136046
136181
|
});
|
|
136047
136182
|
|
|
136048
|
-
// ../../packages/superdoc/dist/chunks/src-
|
|
136183
|
+
// ../../packages/superdoc/dist/chunks/src-DUt8-PYY.es.js
|
|
136049
136184
|
function deleteProps(obj, propOrProps) {
|
|
136050
136185
|
const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
|
|
136051
136186
|
const removeNested = (target, pathParts, index2 = 0) => {
|
|
@@ -144647,11 +144782,6 @@ function assertUnambiguous(matches2, blockId) {
|
|
|
144647
144782
|
matchCount: matches2.length
|
|
144648
144783
|
});
|
|
144649
144784
|
}
|
|
144650
|
-
function findInlineWithinTextBlock(index2, blockId) {
|
|
144651
|
-
const matches2 = findTextBlockCandidates(index2, blockId);
|
|
144652
|
-
assertUnambiguous(matches2, blockId);
|
|
144653
|
-
return matches2[0];
|
|
144654
|
-
}
|
|
144655
144785
|
function resolveTextTarget(editor, target) {
|
|
144656
144786
|
const matches2 = findTextBlockCandidates(getBlockIndex(editor), target.blockId);
|
|
144657
144787
|
assertUnambiguous(matches2, target.blockId);
|
|
@@ -144835,42 +144965,20 @@ function resolveWithinScope(index2, query2, diagnostics) {
|
|
|
144835
144965
|
ok: true,
|
|
144836
144966
|
range: undefined
|
|
144837
144967
|
};
|
|
144838
|
-
|
|
144839
|
-
|
|
144840
|
-
|
|
144841
|
-
|
|
144842
|
-
|
|
144843
|
-
|
|
144844
|
-
|
|
144845
|
-
ok: true,
|
|
144846
|
-
range: {
|
|
144847
|
-
start: within$1.pos,
|
|
144848
|
-
end: within$1.end
|
|
144849
|
-
}
|
|
144850
|
-
};
|
|
144851
|
-
}
|
|
144852
|
-
if (query2.within.anchor.start.blockId !== query2.within.anchor.end.blockId) {
|
|
144853
|
-
addDiagnostic2(diagnostics, "Inline within anchors that span multiple blocks are not supported.");
|
|
144854
|
-
return { ok: false };
|
|
144855
|
-
}
|
|
144856
|
-
const block = findInlineWithinTextBlock(index2, query2.within.anchor.start.blockId);
|
|
144857
|
-
if (!block) {
|
|
144858
|
-
addDiagnostic2(diagnostics, `Within inline anchor block "${query2.within.anchor.start.blockId}" was not found in the document.`);
|
|
144859
|
-
return { ok: false };
|
|
144860
|
-
}
|
|
144861
|
-
const resolved = resolveTextRangeInBlock(block.node, block.pos, {
|
|
144862
|
-
start: query2.within.anchor.start.offset,
|
|
144863
|
-
end: query2.within.anchor.end.offset
|
|
144864
|
-
});
|
|
144865
|
-
if (!resolved) {
|
|
144866
|
-
addDiagnostic2(diagnostics, "Inline within anchor offsets could not be resolved in the target block.");
|
|
144968
|
+
let within$1 = findBlockById(index2, query2.within);
|
|
144969
|
+
if (!within$1 && query2.within.kind === "block")
|
|
144970
|
+
try {
|
|
144971
|
+
within$1 = findBlockByNodeIdOnly(index2, query2.within.nodeId);
|
|
144972
|
+
} catch {}
|
|
144973
|
+
if (!within$1) {
|
|
144974
|
+
addDiagnostic2(diagnostics, `Within block "${query2.within.nodeType}" with id "${query2.within.nodeId}" was not found in the document.`);
|
|
144867
144975
|
return { ok: false };
|
|
144868
144976
|
}
|
|
144869
144977
|
return {
|
|
144870
144978
|
ok: true,
|
|
144871
144979
|
range: {
|
|
144872
|
-
start:
|
|
144873
|
-
end:
|
|
144980
|
+
start: within$1.pos,
|
|
144981
|
+
end: within$1.end
|
|
144874
144982
|
}
|
|
144875
144983
|
};
|
|
144876
144984
|
}
|
|
@@ -147336,7 +147444,7 @@ function buildTextContext(editor, address2, matchFrom, matchTo, textRanges) {
|
|
|
147336
147444
|
textRanges: textRanges?.length ? textRanges : undefined
|
|
147337
147445
|
};
|
|
147338
147446
|
}
|
|
147339
|
-
function toTextAddress$
|
|
147447
|
+
function toTextAddress$2(editor, block, range) {
|
|
147340
147448
|
const blockStart = block.pos + 1;
|
|
147341
147449
|
const blockEnd = block.end - 1;
|
|
147342
147450
|
if (range.from < blockStart || range.to > blockEnd)
|
|
@@ -147603,7 +147711,7 @@ function executeTextSelector(editor, index2, query2, diagnostics) {
|
|
|
147603
147711
|
return;
|
|
147604
147712
|
if (!source)
|
|
147605
147713
|
source = block;
|
|
147606
|
-
return toTextAddress$
|
|
147714
|
+
return toTextAddress$2(editor, block, range);
|
|
147607
147715
|
}).filter((range) => Boolean(range));
|
|
147608
147716
|
if (!source)
|
|
147609
147717
|
source = findCandidateByPos(textBlocks, match$1.from) ?? findBlockByPos(index2, match$1.from);
|
|
@@ -148600,39 +148708,50 @@ function translateToInternalQuery(input2) {
|
|
|
148600
148708
|
const { select: select2, within: within$1, limit, offset: offset$1 } = input2;
|
|
148601
148709
|
if (within$1)
|
|
148602
148710
|
validateWithinAddress(within$1);
|
|
148603
|
-
if (select2.type === "
|
|
148604
|
-
|
|
148605
|
-
|
|
148606
|
-
|
|
148607
|
-
|
|
148608
|
-
|
|
148609
|
-
|
|
148610
|
-
|
|
148611
|
-
|
|
148612
|
-
|
|
148613
|
-
|
|
148614
|
-
|
|
148711
|
+
if (select2.type === "node") {
|
|
148712
|
+
const raw = select2;
|
|
148713
|
+
if ("nodeKind" in raw && raw.nodeKind != null)
|
|
148714
|
+
throw new DocumentApiAdapterError("INVALID_INPUT", `"nodeKind" is no longer supported on node selectors. Use "nodeType" instead: { type: 'node', nodeType: '${String(raw.nodeKind)}' }.`, {
|
|
148715
|
+
field: "select.nodeKind",
|
|
148716
|
+
value: raw.nodeKind
|
|
148717
|
+
});
|
|
148718
|
+
if (raw.kind === "content")
|
|
148719
|
+
throw new DocumentApiAdapterError("INVALID_INPUT", `kind: 'content' is no longer supported on node selectors. Use kind: 'block' instead.`, {
|
|
148720
|
+
field: "select.kind",
|
|
148721
|
+
value: raw.kind
|
|
148722
|
+
});
|
|
148723
|
+
}
|
|
148615
148724
|
return {
|
|
148616
|
-
select:
|
|
148617
|
-
type: "node",
|
|
148618
|
-
...select2.nodeKind != null && { nodeType: select2.nodeKind },
|
|
148619
|
-
...select2.kind === "content" && { kind: "block" },
|
|
148620
|
-
...select2.kind === "inline" && { kind: "inline" }
|
|
148621
|
-
},
|
|
148725
|
+
select: select2,
|
|
148622
148726
|
limit,
|
|
148623
148727
|
offset: offset$1,
|
|
148624
148728
|
includeNodes: true
|
|
148625
148729
|
};
|
|
148626
148730
|
}
|
|
148627
|
-
function validateWithinAddress(
|
|
148628
|
-
if (
|
|
148629
|
-
return {
|
|
148630
|
-
|
|
148731
|
+
function validateWithinAddress(address2) {
|
|
148732
|
+
if (address2.kind === "block" && "nodeId" in address2 && typeof address2.nodeId === "string")
|
|
148733
|
+
return {
|
|
148734
|
+
nodeId: address2.nodeId,
|
|
148735
|
+
nodeType: address2.nodeType
|
|
148736
|
+
};
|
|
148737
|
+
throw new DocumentApiAdapterError("INVALID_TARGET", '"within" scope requires a BlockNodeAddress with a nodeId.', {
|
|
148631
148738
|
field: "within",
|
|
148632
|
-
value:
|
|
148739
|
+
value: address2
|
|
148633
148740
|
});
|
|
148634
148741
|
}
|
|
148635
|
-
function
|
|
148742
|
+
function resolveWithinAddress(index2, nodeId, expectedNodeType) {
|
|
148743
|
+
if (expectedNodeType) {
|
|
148744
|
+
const match$2 = findBlockByIdStrict(index2, {
|
|
148745
|
+
kind: "block",
|
|
148746
|
+
nodeType: expectedNodeType,
|
|
148747
|
+
nodeId
|
|
148748
|
+
});
|
|
148749
|
+
return {
|
|
148750
|
+
kind: "block",
|
|
148751
|
+
nodeType: match$2.nodeType,
|
|
148752
|
+
nodeId: match$2.nodeId
|
|
148753
|
+
};
|
|
148754
|
+
}
|
|
148636
148755
|
const match$1 = findBlockByNodeIdOnly(index2, nodeId);
|
|
148637
148756
|
return {
|
|
148638
148757
|
kind: "block",
|
|
@@ -148640,28 +148759,6 @@ function resolveWithinNodeType(index2, nodeId) {
|
|
|
148640
148759
|
nodeId: match$1.nodeId
|
|
148641
148760
|
};
|
|
148642
148761
|
}
|
|
148643
|
-
function toSDAddress(address2) {
|
|
148644
|
-
if (address2.kind === "block")
|
|
148645
|
-
return {
|
|
148646
|
-
kind: "content",
|
|
148647
|
-
stability: "stable",
|
|
148648
|
-
nodeId: address2.nodeId
|
|
148649
|
-
};
|
|
148650
|
-
return {
|
|
148651
|
-
kind: "inline",
|
|
148652
|
-
stability: "ephemeral",
|
|
148653
|
-
anchor: {
|
|
148654
|
-
start: {
|
|
148655
|
-
blockId: address2.anchor.start.blockId,
|
|
148656
|
-
offset: address2.anchor.start.offset
|
|
148657
|
-
},
|
|
148658
|
-
end: {
|
|
148659
|
-
blockId: address2.anchor.end.blockId,
|
|
148660
|
-
offset: address2.anchor.end.offset
|
|
148661
|
-
}
|
|
148662
|
-
}
|
|
148663
|
-
};
|
|
148664
|
-
}
|
|
148665
148762
|
function projectMatchToSDNodeResult(editor, address2, blockIndex) {
|
|
148666
148763
|
if (address2.kind === "block") {
|
|
148667
148764
|
const candidate = blockIndex.byId.get(`${address2.nodeType}:${address2.nodeId}`);
|
|
@@ -148671,12 +148768,12 @@ function projectMatchToSDNodeResult(editor, address2, blockIndex) {
|
|
|
148671
148768
|
return null;
|
|
148672
148769
|
return {
|
|
148673
148770
|
node: projectContentNode(found2.node),
|
|
148674
|
-
address:
|
|
148771
|
+
address: address2
|
|
148675
148772
|
};
|
|
148676
148773
|
}
|
|
148677
148774
|
return {
|
|
148678
148775
|
node: projectContentNode(candidate.node),
|
|
148679
|
-
address:
|
|
148776
|
+
address: address2
|
|
148680
148777
|
};
|
|
148681
148778
|
}
|
|
148682
148779
|
const inlineCandidate = findInlineByAnchor(getInlineIndex(editor), address2);
|
|
@@ -148684,13 +148781,13 @@ function projectMatchToSDNodeResult(editor, address2, blockIndex) {
|
|
|
148684
148781
|
if (inlineCandidate.node)
|
|
148685
148782
|
return {
|
|
148686
148783
|
node: projectInlineNode(inlineCandidate.node),
|
|
148687
|
-
address:
|
|
148784
|
+
address: address2
|
|
148688
148785
|
};
|
|
148689
148786
|
const markProjected = projectMarkBasedInline(editor, inlineCandidate);
|
|
148690
148787
|
if (markProjected)
|
|
148691
148788
|
return {
|
|
148692
148789
|
node: markProjected,
|
|
148693
|
-
address:
|
|
148790
|
+
address: address2
|
|
148694
148791
|
};
|
|
148695
148792
|
}
|
|
148696
148793
|
return {
|
|
@@ -148698,15 +148795,15 @@ function projectMatchToSDNodeResult(editor, address2, blockIndex) {
|
|
|
148698
148795
|
kind: "run",
|
|
148699
148796
|
run: { text: resolveTextByBlockId(editor, address2.anchor) }
|
|
148700
148797
|
},
|
|
148701
|
-
address:
|
|
148798
|
+
address: address2
|
|
148702
148799
|
};
|
|
148703
148800
|
}
|
|
148704
148801
|
function sdFindAdapter(editor, input2) {
|
|
148705
148802
|
const query2 = translateToInternalQuery(input2);
|
|
148706
148803
|
const index2 = getBlockIndex(editor);
|
|
148707
148804
|
if (input2.within) {
|
|
148708
|
-
const { nodeId } = validateWithinAddress(input2.within);
|
|
148709
|
-
query2.within =
|
|
148805
|
+
const { nodeId, nodeType } = validateWithinAddress(input2.within);
|
|
148806
|
+
query2.within = resolveWithinAddress(index2, nodeId, nodeType);
|
|
148710
148807
|
}
|
|
148711
148808
|
const diagnostics = [];
|
|
148712
148809
|
const isInlineSelector = query2.select.type !== "text" && isInlineQuery(query2.select);
|
|
@@ -148731,41 +148828,29 @@ function findBlocksByTypeAndId(blockIndex, nodeType, nodeId) {
|
|
|
148731
148828
|
return [byIdMatch];
|
|
148732
148829
|
return blockIndex.candidates.filter((candidate) => candidate.nodeType === nodeType && candidate.nodeId === nodeId);
|
|
148733
148830
|
}
|
|
148734
|
-
function buildBlockAddress(nodeId) {
|
|
148735
|
-
return {
|
|
148736
|
-
kind: "content",
|
|
148737
|
-
stability: "stable",
|
|
148738
|
-
nodeId
|
|
148739
|
-
};
|
|
148740
|
-
}
|
|
148741
148831
|
function buildInlineAddress(address2) {
|
|
148742
|
-
return
|
|
148743
|
-
kind: "inline",
|
|
148744
|
-
stability: "ephemeral",
|
|
148745
|
-
anchor: {
|
|
148746
|
-
start: {
|
|
148747
|
-
blockId: address2.anchor.start.blockId,
|
|
148748
|
-
offset: address2.anchor.start.offset
|
|
148749
|
-
},
|
|
148750
|
-
end: {
|
|
148751
|
-
blockId: address2.anchor.end.blockId,
|
|
148752
|
-
offset: address2.anchor.end.offset
|
|
148753
|
-
}
|
|
148754
|
-
}
|
|
148755
|
-
};
|
|
148832
|
+
return address2;
|
|
148756
148833
|
}
|
|
148757
148834
|
function getNodeAdapter(editor, address2) {
|
|
148758
148835
|
const blockIndex = getBlockIndex(editor);
|
|
148759
148836
|
if (address2.kind === "block") {
|
|
148760
148837
|
const matches2 = findBlocksByTypeAndId(blockIndex, address2.nodeType, address2.nodeId);
|
|
148761
|
-
if (matches2.length === 0)
|
|
148762
|
-
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Node "${address2.nodeType}" not found for id "${address2.nodeId}".`);
|
|
148763
148838
|
if (matches2.length > 1)
|
|
148764
148839
|
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Multiple nodes share ${address2.nodeType} id "${address2.nodeId}".`);
|
|
148765
|
-
|
|
148840
|
+
let candidate$1 = matches2[0];
|
|
148841
|
+
if (!candidate$1)
|
|
148842
|
+
try {
|
|
148843
|
+
candidate$1 = findBlockByNodeIdOnly(blockIndex, address2.nodeId);
|
|
148844
|
+
} catch {}
|
|
148845
|
+
if (!candidate$1)
|
|
148846
|
+
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Node "${address2.nodeType}" not found for id "${address2.nodeId}".`);
|
|
148766
148847
|
return {
|
|
148767
148848
|
node: projectContentNode(candidate$1.node),
|
|
148768
|
-
address:
|
|
148849
|
+
address: {
|
|
148850
|
+
kind: "block",
|
|
148851
|
+
nodeType: candidate$1.nodeType,
|
|
148852
|
+
nodeId: candidate$1.nodeId
|
|
148853
|
+
}
|
|
148769
148854
|
};
|
|
148770
148855
|
}
|
|
148771
148856
|
const candidate = findInlineByAnchor(getInlineIndex(editor), address2);
|
|
@@ -148815,10 +148900,14 @@ function resolveBlockById(editor, nodeId, nodeType) {
|
|
|
148815
148900
|
}
|
|
148816
148901
|
function getNodeByIdAdapter(editor, input2) {
|
|
148817
148902
|
const { nodeId, nodeType } = input2;
|
|
148818
|
-
const { candidate } = resolveBlockById(editor, nodeId, nodeType);
|
|
148903
|
+
const { candidate, resolvedType } = resolveBlockById(editor, nodeId, nodeType);
|
|
148819
148904
|
return {
|
|
148820
148905
|
node: projectContentNode(candidate.node),
|
|
148821
|
-
address:
|
|
148906
|
+
address: {
|
|
148907
|
+
kind: "block",
|
|
148908
|
+
nodeType: resolvedType,
|
|
148909
|
+
nodeId: candidate.nodeId
|
|
148910
|
+
}
|
|
148822
148911
|
};
|
|
148823
148912
|
}
|
|
148824
148913
|
function getTextAdapter(editor, _input) {
|
|
@@ -152047,36 +152136,52 @@ function buildMarksFromLegacyRun(schema, run2) {
|
|
|
152047
152136
|
marks.push(schema.marks.highlight.create({ color: run2.highlight }));
|
|
152048
152137
|
return marks;
|
|
152049
152138
|
}
|
|
152050
|
-
function
|
|
152051
|
-
|
|
152052
|
-
return resolveDocumentEndTarget(editor);
|
|
152053
|
-
const index2 = getBlockIndex(editor);
|
|
152054
|
-
let candidate;
|
|
152139
|
+
function findBlockByTarget(index2, target, operationName) {
|
|
152140
|
+
const nodeId = target.kind === "block" ? target.nodeId : target.blockId;
|
|
152055
152141
|
try {
|
|
152056
|
-
|
|
152142
|
+
if (target.kind === "block") {
|
|
152143
|
+
const typed = findBlockById(index2, target);
|
|
152144
|
+
if (typed)
|
|
152145
|
+
return typed;
|
|
152146
|
+
return findBlockByNodeIdOnly(index2, nodeId);
|
|
152147
|
+
}
|
|
152148
|
+
return findBlockByNodeIdOnly(index2, nodeId);
|
|
152057
152149
|
} catch {
|
|
152058
|
-
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Cannot resolve
|
|
152150
|
+
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Cannot resolve ${operationName} target for block "${nodeId}".`);
|
|
152059
152151
|
}
|
|
152152
|
+
}
|
|
152153
|
+
function resolveInsertTarget(editor, target) {
|
|
152154
|
+
if (!target)
|
|
152155
|
+
return resolveDocumentEndTarget(editor);
|
|
152156
|
+
const candidate = findBlockByTarget(getBlockIndex(editor), target, "insert");
|
|
152060
152157
|
return {
|
|
152061
152158
|
insertPos: candidate.end,
|
|
152062
152159
|
structuralEnd: false,
|
|
152063
|
-
effectiveTarget: target
|
|
152160
|
+
effectiveTarget: target.kind === "block" ? {
|
|
152161
|
+
kind: "text",
|
|
152162
|
+
blockId: target.nodeId,
|
|
152163
|
+
range: {
|
|
152164
|
+
start: 0,
|
|
152165
|
+
end: 0
|
|
152166
|
+
}
|
|
152167
|
+
} : target,
|
|
152064
152168
|
targetNode: candidate.node,
|
|
152065
152169
|
targetNodePos: candidate.pos
|
|
152066
152170
|
};
|
|
152067
152171
|
}
|
|
152068
152172
|
function resolveReplaceTarget(editor, target) {
|
|
152069
|
-
const
|
|
152070
|
-
let candidate;
|
|
152071
|
-
try {
|
|
152072
|
-
candidate = findBlockByNodeIdOnly(index2, target.blockId);
|
|
152073
|
-
} catch {
|
|
152074
|
-
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Cannot resolve replace target for block "${target.blockId}".`);
|
|
152075
|
-
}
|
|
152173
|
+
const candidate = findBlockByTarget(getBlockIndex(editor), target, "replace");
|
|
152076
152174
|
return {
|
|
152077
152175
|
from: candidate.pos,
|
|
152078
152176
|
to: candidate.end,
|
|
152079
|
-
effectiveTarget: target
|
|
152177
|
+
effectiveTarget: target.kind === "block" ? {
|
|
152178
|
+
kind: "text",
|
|
152179
|
+
blockId: target.nodeId,
|
|
152180
|
+
range: {
|
|
152181
|
+
start: 0,
|
|
152182
|
+
end: 0
|
|
152183
|
+
}
|
|
152184
|
+
} : target
|
|
152080
152185
|
};
|
|
152081
152186
|
}
|
|
152082
152187
|
function resolveDocumentEndTarget(editor) {
|
|
@@ -152317,17 +152422,16 @@ function ensureTableSeparators(jsonNodes) {
|
|
|
152317
152422
|
if (jsonNodes[i$1].type === "table" && jsonNodes[i$1 + 1].type === "table")
|
|
152318
152423
|
jsonNodes.splice(i$1 + 1, 0, { type: "paragraph" });
|
|
152319
152424
|
}
|
|
152320
|
-
function
|
|
152425
|
+
function targetBlockId$1(target) {
|
|
152426
|
+
return target.kind === "block" ? target.nodeId : target.blockId;
|
|
152427
|
+
}
|
|
152428
|
+
function toTextAddress$1(target) {
|
|
152321
152429
|
if (target.kind === "text")
|
|
152322
152430
|
return target;
|
|
152323
|
-
const sd = target;
|
|
152324
152431
|
return {
|
|
152325
152432
|
kind: "text",
|
|
152326
|
-
blockId:
|
|
152327
|
-
range:
|
|
152328
|
-
start: sd.anchor.start.offset,
|
|
152329
|
-
end: sd.anchor.end.offset
|
|
152330
|
-
} : {
|
|
152433
|
+
blockId: target.nodeId,
|
|
152434
|
+
range: {
|
|
152331
152435
|
start: 0,
|
|
152332
152436
|
end: 0
|
|
152333
152437
|
}
|
|
@@ -152668,6 +152772,8 @@ function buildSelectionResolutionFromOutcome(stepOutcome, compiled, stepId) {
|
|
|
152668
152772
|
return buildSelectionResolutionFromCompiled(compiled, stepId);
|
|
152669
152773
|
}
|
|
152670
152774
|
function insertStructuredWrapper(editor, input2, options) {
|
|
152775
|
+
if (isStructuralInsertInput2(input2) && input2.target)
|
|
152776
|
+
return executeStructuralInsertDirect(editor, input2, options);
|
|
152671
152777
|
return textReceiptToSDReceipt2(insertStructuredInner(editor, input2, options));
|
|
152672
152778
|
}
|
|
152673
152779
|
function insertStructuredInner(editor, input2, options) {
|
|
@@ -152856,14 +152962,13 @@ function insertStructuredInner(editor, input2, options) {
|
|
|
152856
152962
|
function executeStructuralInsertWrapper(editor, input2, options) {
|
|
152857
152963
|
const { content: content3, target, placement: placement2, nestingPolicy } = input2;
|
|
152858
152964
|
const mode = options?.changeMode ?? "direct";
|
|
152859
|
-
const textTarget = target ? narrowToTextAddress(target) : undefined;
|
|
152860
152965
|
let resolved;
|
|
152861
152966
|
try {
|
|
152862
|
-
resolved = resolveInsertTarget(editor,
|
|
152967
|
+
resolved = resolveInsertTarget(editor, target);
|
|
152863
152968
|
} catch (err) {
|
|
152864
152969
|
if (err instanceof DocumentApiAdapterError)
|
|
152865
152970
|
throw err;
|
|
152866
|
-
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Cannot resolve insert target${
|
|
152971
|
+
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Cannot resolve insert target${target ? ` for block "${target.nodeId}"` : ""}.`);
|
|
152867
152972
|
}
|
|
152868
152973
|
const effectiveTarget = resolved.effectiveTarget ?? {
|
|
152869
152974
|
kind: "text",
|
|
@@ -152879,7 +152984,6 @@ function executeStructuralInsertWrapper(editor, input2, options) {
|
|
|
152879
152984
|
else
|
|
152880
152985
|
insertPos = resolved.insertPos;
|
|
152881
152986
|
const resolution = buildTextMutationResolution({
|
|
152882
|
-
requestedTarget: textTarget,
|
|
152883
152987
|
target: effectiveTarget,
|
|
152884
152988
|
range: {
|
|
152885
152989
|
from: insertPos,
|
|
@@ -152890,7 +152994,7 @@ function executeStructuralInsertWrapper(editor, input2, options) {
|
|
|
152890
152994
|
try {
|
|
152891
152995
|
if (options?.dryRun) {
|
|
152892
152996
|
executeStructuralInsert(editor, {
|
|
152893
|
-
target
|
|
152997
|
+
target,
|
|
152894
152998
|
content: content3,
|
|
152895
152999
|
placement: placement2,
|
|
152896
153000
|
nestingPolicy,
|
|
@@ -152904,7 +153008,7 @@ function executeStructuralInsertWrapper(editor, input2, options) {
|
|
|
152904
153008
|
}
|
|
152905
153009
|
if (!(executeDomainCommand(editor, () => {
|
|
152906
153010
|
return executeStructuralInsert(editor, {
|
|
152907
|
-
target
|
|
153011
|
+
target,
|
|
152908
153012
|
content: content3,
|
|
152909
153013
|
placement: placement2,
|
|
152910
153014
|
nestingPolicy,
|
|
@@ -152939,10 +153043,78 @@ function executeStructuralInsertWrapper(editor, input2, options) {
|
|
|
152939
153043
|
};
|
|
152940
153044
|
}
|
|
152941
153045
|
}
|
|
153046
|
+
function executeStructuralInsertDirect(editor, input2, options) {
|
|
153047
|
+
const { content: content3, target, placement: placement2, nestingPolicy } = input2;
|
|
153048
|
+
const mode = options?.changeMode ?? "direct";
|
|
153049
|
+
let resolved;
|
|
153050
|
+
try {
|
|
153051
|
+
resolved = resolveInsertTarget(editor, target);
|
|
153052
|
+
} catch (err) {
|
|
153053
|
+
if (err instanceof DocumentApiAdapterError)
|
|
153054
|
+
throw err;
|
|
153055
|
+
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Cannot resolve insert target for block "${target.nodeId}".`);
|
|
153056
|
+
}
|
|
153057
|
+
let insertPos;
|
|
153058
|
+
if (resolved.targetNode && resolved.targetNodePos !== undefined)
|
|
153059
|
+
insertPos = resolvePlacement(editor.state.doc, resolved.targetNodePos, resolved.targetNode, placement2);
|
|
153060
|
+
else
|
|
153061
|
+
insertPos = resolved.insertPos;
|
|
153062
|
+
const receiptParams = {
|
|
153063
|
+
target,
|
|
153064
|
+
range: {
|
|
153065
|
+
from: insertPos,
|
|
153066
|
+
to: insertPos
|
|
153067
|
+
}
|
|
153068
|
+
};
|
|
153069
|
+
try {
|
|
153070
|
+
if (options?.dryRun) {
|
|
153071
|
+
executeStructuralInsert(editor, {
|
|
153072
|
+
target,
|
|
153073
|
+
content: content3,
|
|
153074
|
+
placement: placement2,
|
|
153075
|
+
nestingPolicy,
|
|
153076
|
+
changeMode: mode,
|
|
153077
|
+
dryRun: true
|
|
153078
|
+
});
|
|
153079
|
+
return buildStructuralReceipt2(true, receiptParams);
|
|
153080
|
+
}
|
|
153081
|
+
if (executeDomainCommand(editor, () => {
|
|
153082
|
+
return executeStructuralInsert(editor, {
|
|
153083
|
+
target,
|
|
153084
|
+
content: content3,
|
|
153085
|
+
placement: placement2,
|
|
153086
|
+
nestingPolicy,
|
|
153087
|
+
changeMode: mode
|
|
153088
|
+
}).success;
|
|
153089
|
+
}, {
|
|
153090
|
+
expectedRevision: options?.expectedRevision,
|
|
153091
|
+
changeMode: mode
|
|
153092
|
+
}).steps[0]?.effect !== "changed")
|
|
153093
|
+
return buildStructuralReceipt2(false, receiptParams, {
|
|
153094
|
+
code: "INVALID_TARGET",
|
|
153095
|
+
message: "Structural insert failed."
|
|
153096
|
+
});
|
|
153097
|
+
return buildStructuralReceipt2(true, receiptParams);
|
|
153098
|
+
} catch (err) {
|
|
153099
|
+
if (err instanceof DocumentApiAdapterError)
|
|
153100
|
+
throw err;
|
|
153101
|
+
return buildStructuralReceipt2(false, receiptParams, {
|
|
153102
|
+
code: "INVALID_TARGET",
|
|
153103
|
+
message: `Structural insert failed: ${err instanceof Error ? err.message : String(err)}`
|
|
153104
|
+
});
|
|
153105
|
+
}
|
|
153106
|
+
}
|
|
152942
153107
|
function replaceStructuredWrapper(editor, input2, options) {
|
|
152943
153108
|
if (!isStructuralReplaceInput2(input2))
|
|
152944
153109
|
throw new DocumentApiAdapterError("INVALID_INPUT", 'replaceStructured requires structural content input with a "content" field.');
|
|
152945
|
-
|
|
153110
|
+
const blockTarget = input2.target && "kind" in input2.target && input2.target.kind === "block" ? input2.target : undefined;
|
|
153111
|
+
const textReceipt = executeStructuralReplaceWrapper(editor, input2, options);
|
|
153112
|
+
if (!blockTarget)
|
|
153113
|
+
return textReceiptToSDReceipt2(textReceipt);
|
|
153114
|
+
const sdReceipt = textReceiptToSDReceipt2(textReceipt);
|
|
153115
|
+
if (sdReceipt.resolution)
|
|
153116
|
+
sdReceipt.resolution.target = blockTarget;
|
|
153117
|
+
return sdReceipt;
|
|
152946
153118
|
}
|
|
152947
153119
|
function resolveStructuralLocator(editor, input2) {
|
|
152948
153120
|
const { target, ref: ref$1 } = input2;
|
|
@@ -152971,7 +153143,7 @@ function resolveStructuralLocator(editor, input2) {
|
|
|
152971
153143
|
effectiveSelectionTarget: buildEffectiveSelectionTarget(expanded)
|
|
152972
153144
|
};
|
|
152973
153145
|
}
|
|
152974
|
-
return { textTarget:
|
|
153146
|
+
return { textTarget: target };
|
|
152975
153147
|
}
|
|
152976
153148
|
if (ref$1 !== undefined) {
|
|
152977
153149
|
if (ref$1.startsWith("text:"))
|
|
@@ -153141,7 +153313,7 @@ function executeStructuralReplaceWrapper(editor, input2, options) {
|
|
|
153141
153313
|
} catch (err) {
|
|
153142
153314
|
if (err instanceof DocumentApiAdapterError)
|
|
153143
153315
|
throw err;
|
|
153144
|
-
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Cannot resolve replace target for block "${textTarget
|
|
153316
|
+
throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `Cannot resolve replace target for block "${targetBlockId$1(textTarget)}".`);
|
|
153145
153317
|
}
|
|
153146
153318
|
effectiveRange = {
|
|
153147
153319
|
from: resolvedBlock.from,
|
|
@@ -153150,13 +153322,13 @@ function executeStructuralReplaceWrapper(editor, input2, options) {
|
|
|
153150
153322
|
}
|
|
153151
153323
|
const coveredText = editor.state.doc.textBetween(effectiveRange.from, effectiveRange.to, `
|
|
153152
153324
|
`, "");
|
|
153325
|
+
const textAddr = toTextAddress$1(textTarget);
|
|
153153
153326
|
let resolution;
|
|
153154
153327
|
if (effectiveSelectionTarget)
|
|
153155
153328
|
resolution = selectionTargetToResolution(effectiveSelectionTarget, effectiveRange, coveredText);
|
|
153156
153329
|
else
|
|
153157
153330
|
resolution = buildTextMutationResolution({
|
|
153158
|
-
|
|
153159
|
-
target: textTarget,
|
|
153331
|
+
target: textAddr,
|
|
153160
153332
|
range: effectiveRange,
|
|
153161
153333
|
text: coveredText
|
|
153162
153334
|
});
|
|
@@ -221875,16 +222047,16 @@ var Node$13 = class Node$14 {
|
|
|
221875
222047
|
return false;
|
|
221876
222048
|
return Boolean(checker(attrs));
|
|
221877
222049
|
}, SuperToolbar, ICONS, TEXTS, tableActionsOptions;
|
|
221878
|
-
var
|
|
222050
|
+
var init_src_DUt8_PYY_es = __esm(() => {
|
|
221879
222051
|
init_rolldown_runtime_B2q5OVn9_es();
|
|
221880
|
-
|
|
222052
|
+
init_SuperConverter_DBTvnSJQ_es();
|
|
221881
222053
|
init_jszip_ChlR43oI_es();
|
|
221882
222054
|
init_uuid_qzgm05fK_es();
|
|
221883
|
-
|
|
222055
|
+
init_constants_ep1_Gwqi_es();
|
|
221884
222056
|
init_unified_BRHLwnjP_es();
|
|
221885
222057
|
init_remark_gfm_z_sDF4ss_es();
|
|
221886
222058
|
init_remark_stringify_D8vxv_XI_es();
|
|
221887
|
-
|
|
222059
|
+
init_DocxZipper_DTP6a0rR_es();
|
|
221888
222060
|
init_vue_DQHWm9lq_es();
|
|
221889
222061
|
init__plugin_vue_export_helper_HmhZBO0u_es();
|
|
221890
222062
|
init_eventemitter3_DGBTyUUP_es();
|
|
@@ -255725,13 +255897,13 @@ var init_zipper_DqXT7uTa_es = __esm(() => {
|
|
|
255725
255897
|
|
|
255726
255898
|
// ../../packages/superdoc/dist/super-editor.es.js
|
|
255727
255899
|
var init_super_editor_es = __esm(() => {
|
|
255728
|
-
|
|
255729
|
-
|
|
255900
|
+
init_src_DUt8_PYY_es();
|
|
255901
|
+
init_SuperConverter_DBTvnSJQ_es();
|
|
255730
255902
|
init_jszip_ChlR43oI_es();
|
|
255731
|
-
|
|
255732
|
-
|
|
255903
|
+
init_xml_js_BtmJ6bNs_es();
|
|
255904
|
+
init_constants_ep1_Gwqi_es();
|
|
255733
255905
|
init_unified_BRHLwnjP_es();
|
|
255734
|
-
|
|
255906
|
+
init_DocxZipper_DTP6a0rR_es();
|
|
255735
255907
|
init_vue_DQHWm9lq_es();
|
|
255736
255908
|
init_eventemitter3_DGBTyUUP_es();
|
|
255737
255909
|
init_zipper_DqXT7uTa_es();
|
|
@@ -257196,11 +257368,6 @@ function assertUnambiguous2(matches2, blockId) {
|
|
|
257196
257368
|
});
|
|
257197
257369
|
}
|
|
257198
257370
|
}
|
|
257199
|
-
function findInlineWithinTextBlock2(index2, blockId) {
|
|
257200
|
-
const matches2 = findTextBlockCandidates2(index2, blockId);
|
|
257201
|
-
assertUnambiguous2(matches2, blockId);
|
|
257202
|
-
return matches2[0];
|
|
257203
|
-
}
|
|
257204
257371
|
function resolveTextTarget2(editor, target) {
|
|
257205
257372
|
const index2 = getBlockIndex2(editor);
|
|
257206
257373
|
const matches2 = findTextBlockCandidates2(index2, target.blockId);
|
|
@@ -257367,32 +257534,17 @@ function dedupeDiagnostics2(diagnostics) {
|
|
|
257367
257534
|
function resolveWithinScope2(index2, query2, diagnostics) {
|
|
257368
257535
|
if (!query2.within)
|
|
257369
257536
|
return { ok: true, range: undefined };
|
|
257370
|
-
|
|
257371
|
-
|
|
257372
|
-
|
|
257373
|
-
|
|
257374
|
-
|
|
257375
|
-
}
|
|
257376
|
-
return { ok: true, range: { start: within2.pos, end: within2.end } };
|
|
257377
|
-
}
|
|
257378
|
-
if (query2.within.anchor.start.blockId !== query2.within.anchor.end.blockId) {
|
|
257379
|
-
addDiagnostic3(diagnostics, "Inline within anchors that span multiple blocks are not supported.");
|
|
257380
|
-
return { ok: false };
|
|
257537
|
+
let within2 = findBlockById2(index2, query2.within);
|
|
257538
|
+
if (!within2 && query2.within.kind === "block") {
|
|
257539
|
+
try {
|
|
257540
|
+
within2 = findBlockByNodeIdOnly2(index2, query2.within.nodeId);
|
|
257541
|
+
} catch {}
|
|
257381
257542
|
}
|
|
257382
|
-
|
|
257383
|
-
|
|
257384
|
-
addDiagnostic3(diagnostics, `Within inline anchor block "${query2.within.anchor.start.blockId}" was not found in the document.`);
|
|
257543
|
+
if (!within2) {
|
|
257544
|
+
addDiagnostic3(diagnostics, `Within block "${query2.within.nodeType}" with id "${query2.within.nodeId}" was not found in the document.`);
|
|
257385
257545
|
return { ok: false };
|
|
257386
257546
|
}
|
|
257387
|
-
|
|
257388
|
-
start: query2.within.anchor.start.offset,
|
|
257389
|
-
end: query2.within.anchor.end.offset
|
|
257390
|
-
});
|
|
257391
|
-
if (!resolved) {
|
|
257392
|
-
addDiagnostic3(diagnostics, "Inline within anchor offsets could not be resolved in the target block.");
|
|
257393
|
-
return { ok: false };
|
|
257394
|
-
}
|
|
257395
|
-
return { ok: true, range: { start: resolved.from, end: resolved.to } };
|
|
257547
|
+
return { ok: true, range: { start: within2.pos, end: within2.end } };
|
|
257396
257548
|
}
|
|
257397
257549
|
function scopeByRange2(candidates, range) {
|
|
257398
257550
|
if (!range)
|
|
@@ -259500,7 +259652,7 @@ var init_utilities = __esm(() => {
|
|
|
259500
259652
|
init_clipboardUtils();
|
|
259501
259653
|
});
|
|
259502
259654
|
|
|
259503
|
-
// ../../node_modules/.pnpm/sax@1.
|
|
259655
|
+
// ../../node_modules/.pnpm/sax@1.5.0/node_modules/sax/lib/sax.js
|
|
259504
259656
|
var require_sax2 = __commonJS((exports) => {
|
|
259505
259657
|
(function(sax) {
|
|
259506
259658
|
sax.parser = function(strict, opt) {
|
|
@@ -259555,6 +259707,9 @@ var require_sax2 = __commonJS((exports) => {
|
|
|
259555
259707
|
parser.opt = opt || {};
|
|
259556
259708
|
parser.opt.lowercase = parser.opt.lowercase || parser.opt.lowercasetags;
|
|
259557
259709
|
parser.looseCase = parser.opt.lowercase ? "toLowerCase" : "toUpperCase";
|
|
259710
|
+
parser.opt.maxEntityCount = parser.opt.maxEntityCount || 512;
|
|
259711
|
+
parser.opt.maxEntityDepth = parser.opt.maxEntityDepth || 4;
|
|
259712
|
+
parser.entityCount = parser.entityDepth = 0;
|
|
259558
259713
|
parser.tags = [];
|
|
259559
259714
|
parser.closed = parser.closedRoot = parser.sawRoot = false;
|
|
259560
259715
|
parser.tag = parser.error = null;
|
|
@@ -260865,9 +261020,16 @@ Char: ` + parser.c;
|
|
|
260865
261020
|
if (c === ";") {
|
|
260866
261021
|
var parsedEntity = parseEntity(parser);
|
|
260867
261022
|
if (parser.opt.unparsedEntities && !Object.values(sax.XML_ENTITIES).includes(parsedEntity)) {
|
|
261023
|
+
if ((parser.entityCount += 1) > parser.opt.maxEntityCount) {
|
|
261024
|
+
error(parser, "Parsed entity count exceeds max entity count");
|
|
261025
|
+
}
|
|
261026
|
+
if ((parser.entityDepth += 1) > parser.opt.maxEntityDepth) {
|
|
261027
|
+
error(parser, "Parsed entity depth exceeds max entity depth");
|
|
261028
|
+
}
|
|
260868
261029
|
parser.entity = "";
|
|
260869
261030
|
parser.state = returnState;
|
|
260870
261031
|
parser.write(parsedEntity);
|
|
261032
|
+
parser.entityDepth -= 1;
|
|
260871
261033
|
} else {
|
|
260872
261034
|
parser[buffer4] += parsedEntity;
|
|
260873
261035
|
parser.entity = "";
|
|
@@ -266654,62 +266816,38 @@ function translateToInternalQuery2(input2) {
|
|
|
266654
266816
|
const { select: select2, within: within2, limit, offset: offset2 } = input2;
|
|
266655
266817
|
if (within2)
|
|
266656
266818
|
validateWithinAddress2(within2);
|
|
266657
|
-
if (select2.type === "
|
|
266658
|
-
|
|
266659
|
-
|
|
266660
|
-
|
|
266661
|
-
|
|
266662
|
-
|
|
266663
|
-
|
|
266664
|
-
|
|
266665
|
-
limit,
|
|
266666
|
-
offset: offset2,
|
|
266667
|
-
includeNodes: true
|
|
266668
|
-
};
|
|
266819
|
+
if (select2.type === "node") {
|
|
266820
|
+
const raw = select2;
|
|
266821
|
+
if ("nodeKind" in raw && raw.nodeKind != null) {
|
|
266822
|
+
throw new DocumentApiAdapterError3("INVALID_INPUT", `"nodeKind" is no longer supported on node selectors. Use "nodeType" instead: ` + `{ type: 'node', nodeType: '${String(raw.nodeKind)}' }.`, { field: "select.nodeKind", value: raw.nodeKind });
|
|
266823
|
+
}
|
|
266824
|
+
if (raw.kind === "content") {
|
|
266825
|
+
throw new DocumentApiAdapterError3("INVALID_INPUT", `kind: 'content' is no longer supported on node selectors. Use kind: 'block' instead.`, { field: "select.kind", value: raw.kind });
|
|
266826
|
+
}
|
|
266669
266827
|
}
|
|
266670
|
-
const nodeSelect = {
|
|
266671
|
-
type: "node",
|
|
266672
|
-
...select2.nodeKind != null && { nodeType: select2.nodeKind },
|
|
266673
|
-
...select2.kind === "content" && { kind: "block" },
|
|
266674
|
-
...select2.kind === "inline" && { kind: "inline" }
|
|
266675
|
-
};
|
|
266676
266828
|
return {
|
|
266677
|
-
select:
|
|
266829
|
+
select: select2,
|
|
266678
266830
|
limit,
|
|
266679
266831
|
offset: offset2,
|
|
266680
266832
|
includeNodes: true
|
|
266681
266833
|
};
|
|
266682
266834
|
}
|
|
266683
|
-
function validateWithinAddress2(
|
|
266684
|
-
if (
|
|
266685
|
-
return { nodeId:
|
|
266835
|
+
function validateWithinAddress2(address2) {
|
|
266836
|
+
if (address2.kind === "block" && "nodeId" in address2 && typeof address2.nodeId === "string") {
|
|
266837
|
+
return { nodeId: address2.nodeId, nodeType: address2.nodeType };
|
|
266686
266838
|
}
|
|
266687
|
-
throw new DocumentApiAdapterError3("INVALID_TARGET",
|
|
266688
|
-
|
|
266689
|
-
|
|
266690
|
-
|
|
266691
|
-
return {
|
|
266692
|
-
kind: "block",
|
|
266693
|
-
nodeType: match2.nodeType,
|
|
266694
|
-
nodeId: match2.nodeId
|
|
266695
|
-
};
|
|
266839
|
+
throw new DocumentApiAdapterError3("INVALID_TARGET", '"within" scope requires a BlockNodeAddress with a nodeId.', {
|
|
266840
|
+
field: "within",
|
|
266841
|
+
value: address2
|
|
266842
|
+
});
|
|
266696
266843
|
}
|
|
266697
|
-
function
|
|
266698
|
-
if (
|
|
266699
|
-
|
|
266700
|
-
|
|
266701
|
-
stability: "stable",
|
|
266702
|
-
nodeId: address2.nodeId
|
|
266703
|
-
};
|
|
266844
|
+
function resolveWithinAddress2(index2, nodeId, expectedNodeType) {
|
|
266845
|
+
if (expectedNodeType) {
|
|
266846
|
+
const match3 = findBlockByIdStrict2(index2, { kind: "block", nodeType: expectedNodeType, nodeId });
|
|
266847
|
+
return { kind: "block", nodeType: match3.nodeType, nodeId: match3.nodeId };
|
|
266704
266848
|
}
|
|
266705
|
-
|
|
266706
|
-
|
|
266707
|
-
stability: "ephemeral",
|
|
266708
|
-
anchor: {
|
|
266709
|
-
start: { blockId: address2.anchor.start.blockId, offset: address2.anchor.start.offset },
|
|
266710
|
-
end: { blockId: address2.anchor.end.blockId, offset: address2.anchor.end.offset }
|
|
266711
|
-
}
|
|
266712
|
-
};
|
|
266849
|
+
const match2 = findBlockByNodeIdOnly2(index2, nodeId);
|
|
266850
|
+
return { kind: "block", nodeType: match2.nodeType, nodeId: match2.nodeId };
|
|
266713
266851
|
}
|
|
266714
266852
|
function projectMatchToSDNodeResult2(editor, address2, blockIndex) {
|
|
266715
266853
|
if (address2.kind === "block") {
|
|
@@ -266720,12 +266858,12 @@ function projectMatchToSDNodeResult2(editor, address2, blockIndex) {
|
|
|
266720
266858
|
return null;
|
|
266721
266859
|
return {
|
|
266722
266860
|
node: projectContentNode2(found3.node),
|
|
266723
|
-
address:
|
|
266861
|
+
address: address2
|
|
266724
266862
|
};
|
|
266725
266863
|
}
|
|
266726
266864
|
return {
|
|
266727
266865
|
node: projectContentNode2(candidate.node),
|
|
266728
|
-
address:
|
|
266866
|
+
address: address2
|
|
266729
266867
|
};
|
|
266730
266868
|
}
|
|
266731
266869
|
const inlineIndex = getInlineIndex2(editor);
|
|
@@ -266734,26 +266872,26 @@ function projectMatchToSDNodeResult2(editor, address2, blockIndex) {
|
|
|
266734
266872
|
if (inlineCandidate.node) {
|
|
266735
266873
|
return {
|
|
266736
266874
|
node: projectInlineNode2(inlineCandidate.node),
|
|
266737
|
-
address:
|
|
266875
|
+
address: address2
|
|
266738
266876
|
};
|
|
266739
266877
|
}
|
|
266740
266878
|
const markProjected = projectMarkBasedInline2(editor, inlineCandidate);
|
|
266741
266879
|
if (markProjected) {
|
|
266742
|
-
return { node: markProjected, address:
|
|
266880
|
+
return { node: markProjected, address: address2 };
|
|
266743
266881
|
}
|
|
266744
266882
|
}
|
|
266745
266883
|
const resolvedText = resolveTextByBlockId2(editor, address2.anchor);
|
|
266746
266884
|
return {
|
|
266747
266885
|
node: { kind: "run", run: { text: resolvedText } },
|
|
266748
|
-
address:
|
|
266886
|
+
address: address2
|
|
266749
266887
|
};
|
|
266750
266888
|
}
|
|
266751
266889
|
function sdFindAdapter2(editor, input2) {
|
|
266752
266890
|
const query2 = translateToInternalQuery2(input2);
|
|
266753
266891
|
const index2 = getBlockIndex2(editor);
|
|
266754
266892
|
if (input2.within) {
|
|
266755
|
-
const { nodeId } = validateWithinAddress2(input2.within);
|
|
266756
|
-
query2.within =
|
|
266893
|
+
const { nodeId, nodeType } = validateWithinAddress2(input2.within);
|
|
266894
|
+
query2.within = resolveWithinAddress2(index2, nodeId, nodeType);
|
|
266757
266895
|
}
|
|
266758
266896
|
const diagnostics = [];
|
|
266759
266897
|
const isInlineSelector = query2.select.type !== "text" && isInlineQuery2(query2.select);
|
|
@@ -266797,37 +266935,28 @@ function findBlocksByTypeAndId2(blockIndex, nodeType, nodeId) {
|
|
|
266797
266935
|
return [byIdMatch];
|
|
266798
266936
|
return blockIndex.candidates.filter((candidate) => candidate.nodeType === nodeType && candidate.nodeId === nodeId);
|
|
266799
266937
|
}
|
|
266800
|
-
function buildBlockAddress2(nodeId) {
|
|
266801
|
-
return {
|
|
266802
|
-
kind: "content",
|
|
266803
|
-
stability: "stable",
|
|
266804
|
-
nodeId
|
|
266805
|
-
};
|
|
266806
|
-
}
|
|
266807
266938
|
function buildInlineAddress2(address2) {
|
|
266808
|
-
return
|
|
266809
|
-
kind: "inline",
|
|
266810
|
-
stability: "ephemeral",
|
|
266811
|
-
anchor: {
|
|
266812
|
-
start: { blockId: address2.anchor.start.blockId, offset: address2.anchor.start.offset },
|
|
266813
|
-
end: { blockId: address2.anchor.end.blockId, offset: address2.anchor.end.offset }
|
|
266814
|
-
}
|
|
266815
|
-
};
|
|
266939
|
+
return address2;
|
|
266816
266940
|
}
|
|
266817
266941
|
function getNodeAdapter2(editor, address2) {
|
|
266818
266942
|
const blockIndex = getBlockIndex2(editor);
|
|
266819
266943
|
if (address2.kind === "block") {
|
|
266820
266944
|
const matches3 = findBlocksByTypeAndId2(blockIndex, address2.nodeType, address2.nodeId);
|
|
266821
|
-
if (matches3.length === 0) {
|
|
266822
|
-
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Node "${address2.nodeType}" not found for id "${address2.nodeId}".`);
|
|
266823
|
-
}
|
|
266824
266945
|
if (matches3.length > 1) {
|
|
266825
266946
|
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Multiple nodes share ${address2.nodeType} id "${address2.nodeId}".`);
|
|
266826
266947
|
}
|
|
266827
|
-
|
|
266948
|
+
let candidate2 = matches3[0];
|
|
266949
|
+
if (!candidate2) {
|
|
266950
|
+
try {
|
|
266951
|
+
candidate2 = findBlockByNodeIdOnly2(blockIndex, address2.nodeId);
|
|
266952
|
+
} catch {}
|
|
266953
|
+
}
|
|
266954
|
+
if (!candidate2) {
|
|
266955
|
+
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Node "${address2.nodeType}" not found for id "${address2.nodeId}".`);
|
|
266956
|
+
}
|
|
266828
266957
|
return {
|
|
266829
266958
|
node: projectContentNode2(candidate2.node),
|
|
266830
|
-
address:
|
|
266959
|
+
address: { kind: "block", nodeType: candidate2.nodeType, nodeId: candidate2.nodeId }
|
|
266831
266960
|
};
|
|
266832
266961
|
}
|
|
266833
266962
|
const inlineIndex = getInlineIndex2(editor);
|
|
@@ -266875,13 +267004,14 @@ function resolveBlockById2(editor, nodeId, nodeType) {
|
|
|
266875
267004
|
}
|
|
266876
267005
|
function getNodeByIdAdapter2(editor, input2) {
|
|
266877
267006
|
const { nodeId, nodeType } = input2;
|
|
266878
|
-
const { candidate } = resolveBlockById2(editor, nodeId, nodeType);
|
|
267007
|
+
const { candidate, resolvedType } = resolveBlockById2(editor, nodeId, nodeType);
|
|
266879
267008
|
return {
|
|
266880
267009
|
node: projectContentNode2(candidate.node),
|
|
266881
|
-
address:
|
|
267010
|
+
address: { kind: "block", nodeType: resolvedType, nodeId: candidate.nodeId }
|
|
266882
267011
|
};
|
|
266883
267012
|
}
|
|
266884
267013
|
var init_get_node_adapter = __esm(() => {
|
|
267014
|
+
init_node_address_resolver();
|
|
266885
267015
|
init_index_cache();
|
|
266886
267016
|
init_inline_address_resolver();
|
|
266887
267017
|
init_sd_projection();
|
|
@@ -327933,37 +328063,41 @@ var init_node_materializer = __esm(() => {
|
|
|
327933
328063
|
});
|
|
327934
328064
|
|
|
327935
328065
|
// ../../packages/super-editor/src/document-api-adapters/structural-write-engine/target-resolver.ts
|
|
328066
|
+
function findBlockByTarget2(index3, target, operationName) {
|
|
328067
|
+
const nodeId = target.kind === "block" ? target.nodeId : target.blockId;
|
|
328068
|
+
try {
|
|
328069
|
+
if (target.kind === "block") {
|
|
328070
|
+
const typed = findBlockById2(index3, target);
|
|
328071
|
+
if (typed)
|
|
328072
|
+
return typed;
|
|
328073
|
+
return findBlockByNodeIdOnly2(index3, nodeId);
|
|
328074
|
+
}
|
|
328075
|
+
return findBlockByNodeIdOnly2(index3, nodeId);
|
|
328076
|
+
} catch {
|
|
328077
|
+
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Cannot resolve ${operationName} target for block "${nodeId}".`);
|
|
328078
|
+
}
|
|
328079
|
+
}
|
|
327936
328080
|
function resolveInsertTarget2(editor, target) {
|
|
327937
328081
|
if (!target) {
|
|
327938
328082
|
return resolveDocumentEndTarget2(editor);
|
|
327939
328083
|
}
|
|
327940
328084
|
const index3 = getBlockIndex2(editor);
|
|
327941
|
-
|
|
327942
|
-
try {
|
|
327943
|
-
candidate = findBlockByNodeIdOnly2(index3, target.blockId);
|
|
327944
|
-
} catch {
|
|
327945
|
-
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Cannot resolve insert target for block "${target.blockId}".`);
|
|
327946
|
-
}
|
|
328085
|
+
const candidate = findBlockByTarget2(index3, target, "insert");
|
|
327947
328086
|
return {
|
|
327948
328087
|
insertPos: candidate.end,
|
|
327949
328088
|
structuralEnd: false,
|
|
327950
|
-
effectiveTarget: target,
|
|
328089
|
+
effectiveTarget: target.kind === "block" ? { kind: "text", blockId: target.nodeId, range: { start: 0, end: 0 } } : target,
|
|
327951
328090
|
targetNode: candidate.node,
|
|
327952
328091
|
targetNodePos: candidate.pos
|
|
327953
328092
|
};
|
|
327954
328093
|
}
|
|
327955
328094
|
function resolveReplaceTarget2(editor, target) {
|
|
327956
328095
|
const index3 = getBlockIndex2(editor);
|
|
327957
|
-
|
|
327958
|
-
try {
|
|
327959
|
-
candidate = findBlockByNodeIdOnly2(index3, target.blockId);
|
|
327960
|
-
} catch {
|
|
327961
|
-
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Cannot resolve replace target for block "${target.blockId}".`);
|
|
327962
|
-
}
|
|
328096
|
+
const candidate = findBlockByTarget2(index3, target, "replace");
|
|
327963
328097
|
return {
|
|
327964
328098
|
from: candidate.pos,
|
|
327965
328099
|
to: candidate.end,
|
|
327966
|
-
effectiveTarget: target
|
|
328100
|
+
effectiveTarget: target.kind === "block" ? { kind: "text", blockId: target.nodeId, range: { start: 0, end: 0 } } : target
|
|
327967
328101
|
};
|
|
327968
328102
|
}
|
|
327969
328103
|
function resolveDocumentEndTarget2(editor) {
|
|
@@ -328261,15 +328395,13 @@ function ensureTableSeparators2(jsonNodes) {
|
|
|
328261
328395
|
}
|
|
328262
328396
|
}
|
|
328263
328397
|
}
|
|
328264
|
-
function
|
|
328398
|
+
function targetBlockId2(target) {
|
|
328399
|
+
return target.kind === "block" ? target.nodeId : target.blockId;
|
|
328400
|
+
}
|
|
328401
|
+
function toTextAddress3(target) {
|
|
328265
328402
|
if (target.kind === "text")
|
|
328266
328403
|
return target;
|
|
328267
|
-
|
|
328268
|
-
return {
|
|
328269
|
-
kind: "text",
|
|
328270
|
-
blockId: sd.nodeId ?? "",
|
|
328271
|
-
range: sd.anchor ? { start: sd.anchor.start.offset, end: sd.anchor.end.offset } : { start: 0, end: 0 }
|
|
328272
|
-
};
|
|
328404
|
+
return { kind: "text", blockId: target.nodeId, range: { start: 0, end: 0 } };
|
|
328273
328405
|
}
|
|
328274
328406
|
function normalizeWriteLocator2(request) {
|
|
328275
328407
|
const hasBlockId = request.blockId !== undefined;
|
|
@@ -328560,6 +328692,9 @@ function buildSelectionResolutionFromOutcome2(stepOutcome, compiled, stepId) {
|
|
|
328560
328692
|
return buildSelectionResolutionFromCompiled2(compiled, stepId);
|
|
328561
328693
|
}
|
|
328562
328694
|
function insertStructuredWrapper2(editor, input2, options) {
|
|
328695
|
+
if (isStructuralInsertInput(input2) && input2.target) {
|
|
328696
|
+
return executeStructuralInsertDirect2(editor, input2, options);
|
|
328697
|
+
}
|
|
328563
328698
|
return textReceiptToSDReceipt(insertStructuredInner2(editor, input2, options));
|
|
328564
328699
|
}
|
|
328565
328700
|
function insertStructuredInner2(editor, input2, options) {
|
|
@@ -328730,14 +328865,13 @@ function insertStructuredInner2(editor, input2, options) {
|
|
|
328730
328865
|
function executeStructuralInsertWrapper2(editor, input2, options) {
|
|
328731
328866
|
const { content: content5, target, placement: placement2, nestingPolicy } = input2;
|
|
328732
328867
|
const mode = options?.changeMode ?? "direct";
|
|
328733
|
-
const textTarget = target ? narrowToTextAddress2(target) : undefined;
|
|
328734
328868
|
let resolved;
|
|
328735
328869
|
try {
|
|
328736
|
-
resolved = resolveInsertTarget2(editor,
|
|
328870
|
+
resolved = resolveInsertTarget2(editor, target);
|
|
328737
328871
|
} catch (err) {
|
|
328738
328872
|
if (err instanceof DocumentApiAdapterError3)
|
|
328739
328873
|
throw err;
|
|
328740
|
-
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Cannot resolve insert target${
|
|
328874
|
+
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Cannot resolve insert target${target ? ` for block "${target.nodeId}"` : ""}.`);
|
|
328741
328875
|
}
|
|
328742
328876
|
const effectiveTarget = resolved.effectiveTarget ?? {
|
|
328743
328877
|
kind: "text",
|
|
@@ -328752,7 +328886,6 @@ function executeStructuralInsertWrapper2(editor, input2, options) {
|
|
|
328752
328886
|
}
|
|
328753
328887
|
const resolvedRange = { from: insertPos, to: insertPos };
|
|
328754
328888
|
const resolution = buildTextMutationResolution2({
|
|
328755
|
-
requestedTarget: textTarget,
|
|
328756
328889
|
target: effectiveTarget,
|
|
328757
328890
|
range: resolvedRange,
|
|
328758
328891
|
text: ""
|
|
@@ -328760,7 +328893,7 @@ function executeStructuralInsertWrapper2(editor, input2, options) {
|
|
|
328760
328893
|
try {
|
|
328761
328894
|
if (options?.dryRun) {
|
|
328762
328895
|
executeStructuralInsert2(editor, {
|
|
328763
|
-
target
|
|
328896
|
+
target,
|
|
328764
328897
|
content: content5,
|
|
328765
328898
|
placement: placement2,
|
|
328766
328899
|
nestingPolicy,
|
|
@@ -328771,7 +328904,7 @@ function executeStructuralInsertWrapper2(editor, input2, options) {
|
|
|
328771
328904
|
}
|
|
328772
328905
|
const receipt2 = executeDomainCommand2(editor, () => {
|
|
328773
328906
|
const result = executeStructuralInsert2(editor, {
|
|
328774
|
-
target
|
|
328907
|
+
target,
|
|
328775
328908
|
content: content5,
|
|
328776
328909
|
placement: placement2,
|
|
328777
328910
|
nestingPolicy,
|
|
@@ -328799,11 +328932,77 @@ function executeStructuralInsertWrapper2(editor, input2, options) {
|
|
|
328799
328932
|
};
|
|
328800
328933
|
}
|
|
328801
328934
|
}
|
|
328935
|
+
function executeStructuralInsertDirect2(editor, input2, options) {
|
|
328936
|
+
const { content: content5, target, placement: placement2, nestingPolicy } = input2;
|
|
328937
|
+
const mode = options?.changeMode ?? "direct";
|
|
328938
|
+
let resolved;
|
|
328939
|
+
try {
|
|
328940
|
+
resolved = resolveInsertTarget2(editor, target);
|
|
328941
|
+
} catch (err) {
|
|
328942
|
+
if (err instanceof DocumentApiAdapterError3)
|
|
328943
|
+
throw err;
|
|
328944
|
+
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Cannot resolve insert target for block "${target.nodeId}".`);
|
|
328945
|
+
}
|
|
328946
|
+
let insertPos;
|
|
328947
|
+
if (resolved.targetNode && resolved.targetNodePos !== undefined) {
|
|
328948
|
+
insertPos = resolvePlacement2(editor.state.doc, resolved.targetNodePos, resolved.targetNode, placement2);
|
|
328949
|
+
} else {
|
|
328950
|
+
insertPos = resolved.insertPos;
|
|
328951
|
+
}
|
|
328952
|
+
const range = { from: insertPos, to: insertPos };
|
|
328953
|
+
const receiptParams = { target, range };
|
|
328954
|
+
try {
|
|
328955
|
+
if (options?.dryRun) {
|
|
328956
|
+
executeStructuralInsert2(editor, {
|
|
328957
|
+
target,
|
|
328958
|
+
content: content5,
|
|
328959
|
+
placement: placement2,
|
|
328960
|
+
nestingPolicy,
|
|
328961
|
+
changeMode: mode,
|
|
328962
|
+
dryRun: true
|
|
328963
|
+
});
|
|
328964
|
+
return buildStructuralReceipt(true, receiptParams);
|
|
328965
|
+
}
|
|
328966
|
+
const receipt2 = executeDomainCommand2(editor, () => {
|
|
328967
|
+
const result = executeStructuralInsert2(editor, {
|
|
328968
|
+
target,
|
|
328969
|
+
content: content5,
|
|
328970
|
+
placement: placement2,
|
|
328971
|
+
nestingPolicy,
|
|
328972
|
+
changeMode: mode
|
|
328973
|
+
});
|
|
328974
|
+
return result.success;
|
|
328975
|
+
}, { expectedRevision: options?.expectedRevision, changeMode: mode });
|
|
328976
|
+
if (receipt2.steps[0]?.effect !== "changed") {
|
|
328977
|
+
return buildStructuralReceipt(false, receiptParams, {
|
|
328978
|
+
code: "INVALID_TARGET",
|
|
328979
|
+
message: "Structural insert failed."
|
|
328980
|
+
});
|
|
328981
|
+
}
|
|
328982
|
+
return buildStructuralReceipt(true, receiptParams);
|
|
328983
|
+
} catch (err) {
|
|
328984
|
+
if (err instanceof DocumentApiAdapterError3)
|
|
328985
|
+
throw err;
|
|
328986
|
+
const message = err instanceof Error ? err.message : String(err);
|
|
328987
|
+
return buildStructuralReceipt(false, receiptParams, {
|
|
328988
|
+
code: "INVALID_TARGET",
|
|
328989
|
+
message: `Structural insert failed: ${message}`
|
|
328990
|
+
});
|
|
328991
|
+
}
|
|
328992
|
+
}
|
|
328802
328993
|
function replaceStructuredWrapper2(editor, input2, options) {
|
|
328803
328994
|
if (!isStructuralReplaceInput(input2)) {
|
|
328804
328995
|
throw new DocumentApiAdapterError3("INVALID_INPUT", 'replaceStructured requires structural content input with a "content" field.');
|
|
328805
328996
|
}
|
|
328806
|
-
|
|
328997
|
+
const blockTarget = input2.target && "kind" in input2.target && input2.target.kind === "block" ? input2.target : undefined;
|
|
328998
|
+
const textReceipt = executeStructuralReplaceWrapper2(editor, input2, options);
|
|
328999
|
+
if (!blockTarget)
|
|
329000
|
+
return textReceiptToSDReceipt(textReceipt);
|
|
329001
|
+
const sdReceipt = textReceiptToSDReceipt(textReceipt);
|
|
329002
|
+
if (sdReceipt.resolution) {
|
|
329003
|
+
sdReceipt.resolution.target = blockTarget;
|
|
329004
|
+
}
|
|
329005
|
+
return sdReceipt;
|
|
328807
329006
|
}
|
|
328808
329007
|
function resolveStructuralLocator2(editor, input2) {
|
|
328809
329008
|
const { target, ref: ref4 } = input2;
|
|
@@ -328827,7 +329026,7 @@ function resolveStructuralLocator2(editor, input2) {
|
|
|
328827
329026
|
effectiveSelectionTarget: buildEffectiveSelectionTarget2(expanded)
|
|
328828
329027
|
};
|
|
328829
329028
|
}
|
|
328830
|
-
return { textTarget:
|
|
329029
|
+
return { textTarget: target };
|
|
328831
329030
|
}
|
|
328832
329031
|
if (ref4 !== undefined) {
|
|
328833
329032
|
if (ref4.startsWith("text:")) {
|
|
@@ -328976,19 +329175,19 @@ function executeStructuralReplaceWrapper2(editor, input2, options) {
|
|
|
328976
329175
|
} catch (err) {
|
|
328977
329176
|
if (err instanceof DocumentApiAdapterError3)
|
|
328978
329177
|
throw err;
|
|
328979
|
-
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Cannot resolve replace target for block "${textTarget
|
|
329178
|
+
throw new DocumentApiAdapterError3("TARGET_NOT_FOUND", `Cannot resolve replace target for block "${targetBlockId2(textTarget)}".`);
|
|
328980
329179
|
}
|
|
328981
329180
|
effectiveRange = { from: resolvedBlock.from, to: resolvedBlock.to };
|
|
328982
329181
|
}
|
|
328983
329182
|
const coveredText = editor.state.doc.textBetween(effectiveRange.from, effectiveRange.to, `
|
|
328984
329183
|
`, "");
|
|
329184
|
+
const textAddr = toTextAddress3(textTarget);
|
|
328985
329185
|
let resolution;
|
|
328986
329186
|
if (effectiveSelectionTarget) {
|
|
328987
329187
|
resolution = selectionTargetToResolution2(effectiveSelectionTarget, effectiveRange, coveredText);
|
|
328988
329188
|
} else {
|
|
328989
329189
|
resolution = buildTextMutationResolution2({
|
|
328990
|
-
|
|
328991
|
-
target: textTarget,
|
|
329190
|
+
target: textAddr,
|
|
328992
329191
|
range: effectiveRange,
|
|
328993
329192
|
text: coveredText
|
|
328994
329193
|
});
|
|
@@ -329230,7 +329429,7 @@ function resolveImportedId2(candidate) {
|
|
|
329230
329429
|
const attrs = candidate.attrs ?? {};
|
|
329231
329430
|
return toNonEmptyString2(attrs.importedId);
|
|
329232
329431
|
}
|
|
329233
|
-
function
|
|
329432
|
+
function toTextAddress4(candidate) {
|
|
329234
329433
|
const { start: start2, end } = candidate.anchor;
|
|
329235
329434
|
if (start2.blockId !== end.blockId)
|
|
329236
329435
|
return null;
|
|
@@ -329252,7 +329451,7 @@ function listCommentAnchors2(editor) {
|
|
|
329252
329451
|
const commentId = resolveCommentId2(candidate);
|
|
329253
329452
|
if (!commentId)
|
|
329254
329453
|
continue;
|
|
329255
|
-
const target =
|
|
329454
|
+
const target = toTextAddress4(candidate);
|
|
329256
329455
|
if (!target)
|
|
329257
329456
|
continue;
|
|
329258
329457
|
const dedupeKey = `${commentId}|${target.blockId}:${target.range.start}:${target.range.end}`;
|
|
@@ -337227,7 +337426,7 @@ var init_tables_adapter = __esm(() => {
|
|
|
337227
337426
|
});
|
|
337228
337427
|
|
|
337229
337428
|
// ../../packages/super-editor/src/document-api-adapters/plan-engine/register-executors.ts
|
|
337230
|
-
function
|
|
337429
|
+
function targetBlockId3(t) {
|
|
337231
337430
|
return t?.kind === "range" ? t.blockId : "";
|
|
337232
337431
|
}
|
|
337233
337432
|
function selectionTargetToRange2(t) {
|
|
@@ -337408,7 +337607,7 @@ function registerBuiltInExecutors2() {
|
|
|
337408
337607
|
op: step3.op,
|
|
337409
337608
|
effect: "noop",
|
|
337410
337609
|
matchCount: targets.length,
|
|
337411
|
-
data: { domain: "table", tableId:
|
|
337610
|
+
data: { domain: "table", tableId: targetBlockId3(targets[0]) }
|
|
337412
337611
|
};
|
|
337413
337612
|
}
|
|
337414
337613
|
const handler3 = step3._handler;
|
|
@@ -337434,7 +337633,7 @@ function registerBuiltInExecutors2() {
|
|
|
337434
337633
|
data: { domain: "table", tableId: "" }
|
|
337435
337634
|
};
|
|
337436
337635
|
}
|
|
337437
|
-
const input2 = buildTableInput2(step3.op,
|
|
337636
|
+
const input2 = buildTableInput2(step3.op, targetBlockId3(targets[0]), step3.args);
|
|
337438
337637
|
const result = adapterFn(ctx2.editor, input2, { changeMode: ctx2.changeMode });
|
|
337439
337638
|
if (result.success)
|
|
337440
337639
|
ctx2.commandDispatched = true;
|
|
@@ -337443,7 +337642,7 @@ function registerBuiltInExecutors2() {
|
|
|
337443
337642
|
op: step3.op,
|
|
337444
337643
|
effect: result.success ? "changed" : "noop",
|
|
337445
337644
|
matchCount: result.success ? 1 : 0,
|
|
337446
|
-
data: { domain: "table", tableId:
|
|
337645
|
+
data: { domain: "table", tableId: targetBlockId3(targets[0]) }
|
|
337447
337646
|
};
|
|
337448
337647
|
}
|
|
337449
337648
|
});
|
|
@@ -337552,7 +337751,7 @@ function registerBuiltInExecutors2() {
|
|
|
337552
337751
|
op: step3.op,
|
|
337553
337752
|
effect: "noop",
|
|
337554
337753
|
matchCount: _targets.length,
|
|
337555
|
-
data: { domain: "table", tableId:
|
|
337754
|
+
data: { domain: "table", tableId: targetBlockId3(_targets[0]) }
|
|
337556
337755
|
};
|
|
337557
337756
|
}
|
|
337558
337757
|
const handler3 = step3._handler;
|
|
@@ -401145,15 +401344,14 @@ function validateQuerySelect(value2, path3) {
|
|
|
401145
401344
|
};
|
|
401146
401345
|
}
|
|
401147
401346
|
if (type2 === "node") {
|
|
401148
|
-
expectOnlyKeys(obj, ["type", "
|
|
401149
|
-
const
|
|
401150
|
-
|
|
401151
|
-
|
|
401152
|
-
throw new CliError("VALIDATION_ERROR", `${path3}.kind must be "content", "inline", "block", or "inline".`);
|
|
401347
|
+
expectOnlyKeys(obj, ["type", "nodeType", "kind"], path3);
|
|
401348
|
+
const nodeType2 = obj.nodeType != null ? String(obj.nodeType) : undefined;
|
|
401349
|
+
if (obj.kind != null && !NODE_KINDS2.has(obj.kind)) {
|
|
401350
|
+
throw new CliError("VALIDATION_ERROR", `${path3}.kind must be "block" or "inline".`);
|
|
401153
401351
|
}
|
|
401154
401352
|
return {
|
|
401155
401353
|
type: "node",
|
|
401156
|
-
|
|
401354
|
+
nodeType: nodeType2,
|
|
401157
401355
|
kind: obj.kind
|
|
401158
401356
|
};
|
|
401159
401357
|
}
|
|
@@ -401163,7 +401361,7 @@ function validateQuerySelect(value2, path3) {
|
|
|
401163
401361
|
expectOnlyKeys(obj, ["type"], path3);
|
|
401164
401362
|
return {
|
|
401165
401363
|
type: "node",
|
|
401166
|
-
|
|
401364
|
+
nodeType: type2
|
|
401167
401365
|
};
|
|
401168
401366
|
}
|
|
401169
401367
|
function validateQuery(value2, path3 = "query") {
|
|
@@ -401173,12 +401371,11 @@ function validateQuery(value2, path3 = "query") {
|
|
|
401173
401371
|
select: validateQuerySelect(obj.select, `${path3}.select`)
|
|
401174
401372
|
};
|
|
401175
401373
|
if (obj.within != null) {
|
|
401176
|
-
const within2 =
|
|
401177
|
-
if (within2.kind
|
|
401178
|
-
|
|
401179
|
-
} else {
|
|
401180
|
-
query3.within = validateNodeAddress(obj.within, `${path3}.within`);
|
|
401374
|
+
const within2 = validateNodeAddress(obj.within, `${path3}.within`);
|
|
401375
|
+
if (within2.kind !== "block") {
|
|
401376
|
+
throw new CliError("VALIDATION_ERROR", `${path3}.within must be a BlockNodeAddress (kind: "block").`);
|
|
401181
401377
|
}
|
|
401378
|
+
query3.within = within2;
|
|
401182
401379
|
}
|
|
401183
401380
|
if (obj.limit != null) {
|
|
401184
401381
|
query3.limit = expectNonNegativeInteger(obj.limit, `${path3}.limit`);
|
|
@@ -401226,7 +401423,7 @@ function buildFlatFindQueryDraft(parsed) {
|
|
|
401226
401423
|
return {
|
|
401227
401424
|
select: {
|
|
401228
401425
|
type: "node",
|
|
401229
|
-
|
|
401426
|
+
nodeType: getStringOption(parsed, "node-type"),
|
|
401230
401427
|
kind: getStringOption(parsed, "kind")
|
|
401231
401428
|
},
|
|
401232
401429
|
limit: getNumberOption(parsed, "limit"),
|
|
@@ -401236,7 +401433,7 @@ function buildFlatFindQueryDraft(parsed) {
|
|
|
401236
401433
|
const kind2 = getStringOption(parsed, "kind");
|
|
401237
401434
|
const select2 = kind2 ? {
|
|
401238
401435
|
type: "node",
|
|
401239
|
-
|
|
401436
|
+
nodeType: selectorType,
|
|
401240
401437
|
kind: kind2
|
|
401241
401438
|
} : {
|
|
401242
401439
|
type: selectorType
|