@superdoc-dev/cli 0.8.0-next.84 → 0.8.0-next.86

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/index.js +1160 -236
  2. package/package.json +9 -9
package/dist/index.js CHANGED
@@ -1362,7 +1362,81 @@ More content with **bold** and *italic*.`
1362
1362
  }
1363
1363
  ]
1364
1364
  },
1365
- table: { toolName: "superdoc_table", description: "Table structure and cell operations" },
1365
+ table: {
1366
+ toolName: "superdoc_table",
1367
+ description: `Create and modify table structure, content, and styling. Find table/row/cell nodeIds via superdoc_get_content({action:"blocks"}) or superdoc_search.
1368
+ ` + `
1369
+ ` + `ACTIONS:
1370
+ ` + `• Structure: delete, insert_row, delete_row, insert_column, delete_column, merge_cells, unmerge_cells.
1371
+ ` + `• Cell content: set_cell_text (text). set_cell (vAlign / wrap / fit / preferred width).
1372
+ ` + `• Row / column: set_row (height + rule), set_row_options (repeat-header, allow-break), set_column (widthPt).
1373
+ ` + `• Table styling: set_borders, set_shading, set_style_options (headerRow / bandedRows / firstColumn / lastColumn / lastRow / bandedColumns), set_layout (autofit / alignment / direction / preferredWidth), set_options (default cell margins + cell spacing).
1374
+ ` + `
1375
+ ` + `LOCATORS (the shapes ops accept):
1376
+ ` + `• insert_row append shorthand: { nodeId: "<tableId>" } with no rowIndex/position appends at the end. Three other forms: target a row + position, table + rowIndex + position, or any of the above with count:N for multiple.
1377
+ ` + `• insert_column shorthand: position:"first"|"last" with no columnIndex. Otherwise columnIndex + position:"left"|"right".
1378
+ ` + `• merge_cells: table target + start:{rowIndex, columnIndex} + end:{rowIndex, columnIndex}.
1379
+ ` + `• set_cell_text: table target + rowIndex + columnIndex (preferred) OR cell target.
1380
+ ` + `• set_cell: cell target only. Does NOT accept table+rowIndex+columnIndex.
1381
+ ` + `• set_borders / set_shading: table OR cell target. NOT a row target.
1382
+ ` + `
1383
+ ` + `COLOR FORMAT:
1384
+ ` + 'Hex strings accept #RRGGBB, RRGGBB, #RGB, or 3-digit RGB; also "auto"; also null to clear (where supported). Stored canonically as uppercase RRGGBB. Always pass a concrete color when one is implied. Never call set_borders with `auto` for a "make it look [X]" ask.\n' + `
1385
+ ` + `STYLING (TWO MODES):
1386
+ ` + `
1387
+ ` + `A. STRUCTURAL CHANGE → re-apply the existing styling.
1388
+ ` + ` Triggers: insert_row / insert_column / delete_row / delete_column / merge_cells / unmerge_cells. (NOT set_cell_text or set_cell: those don't disturb borders/shading.)
1389
+ ` + ` Recipe: read the current borders/shading/cnf flags via superdoc_get_content({action:"blocks"}) before the change, then re-apply the SAME values after with set_borders + set_shading + set_style_options. The goal is consistency, not a redesign.
1390
+ ` + ` Skip on a freshly created table. A new table starts un-styled.
1391
+ ` + `
1392
+ ` + `B. STYLE-CHANGE REQUEST ("make it look [X]" / "style the whole table") → apply the FULL set with concrete colors.
1393
+ ` + ` Touch every axis: borders, shading, text alignment, font color/weight, cnf flags, spacing. A single set_borders call without shading and font tweaks always looks half-finished. That's the #1 cause of "no visual change" complaints.
1394
+ ` + ` Color palette: discover the document's palette by reading superdoc_get_content({action:"blocks"}) and reusing the colors on existing tables/headings. When no palette is obvious, default to corporate blue "1F3864" or dark grey "444444" for accents and "F2F2F2" / "E7E6E6" for banding.
1395
+ ` + ` Recipe (call ALL of these):
1396
+ ` + ` 1. set_borders applyTo:"all" with an explicit color and weight.
1397
+ ` + ` 2. set_shading on the header row cells with the accent color. Add banding on alternate body rows if appropriate.
1398
+ ` + ` 3. set_style_options { headerRow: true, bandedRows?: true } so cnf regions are recognized.
1399
+ ` + ` 4. Cell-text alignment via superdoc_format action:"set_alignment". Center the header, left-align body, right-align numeric columns. Paragraph-level: target the paragraph inside each cell.
1400
+ ` + ` 5. Font color + weight via superdoc_format action:"inline". Header gets a contrasting color (white on dark fill, accent on light fill) plus bold:true.
1401
+ ` + ` 6. set_options if the user asks for tighter or looser spacing.
1402
+ ` + ` Steps 4–5 cross to superdoc_format. Use superdoc_mutations to batch many format.apply steps in one call.
1403
+ ` + `
1404
+ ` + `AFTER set_cell_text, match the new cell to its siblings:
1405
+ ` + `set_cell_text writes plain text with the document's default font/size/color and no weight. Always follow up with one superdoc_format inline call copying fontFamily/fontSize/color/bold from a sibling cell (or any non-empty body paragraph if the table is fresh and has no sibling content). If sibling cells show a bold-prefix pattern like "Label: value", replicate it on the new cell via superdoc_search + superdoc_format inline (or one superdoc_mutations batch with format.apply steps).
1406
+ ` + `
1407
+ ` + `LIST-TO-TABLE:
1408
+ ` + `(1) superdoc_create action:"table" with the desired rows/columns. (2) Populate cells with set_cell_text using rowIndex/columnIndex (one call per cell). (3) DELETE THE WHOLE LIST in one call: superdoc_list({action:"delete", target:{kind:"block", nodeType:"listItem", nodeId:"<any-item-id>"}}). The op walks the contiguous list and removes all items.
1409
+ ` + 'Wrong paths for list deletion (all leave bullets/empty paragraphs behind): text.delete, superdoc_edit action:"delete" on text refs, lists.detach, lists.convertToText.',
1410
+ inputExamples: [
1411
+ { action: "insert_row", nodeId: "<tableNodeId>" },
1412
+ { action: "insert_column", nodeId: "<tableNodeId>", position: "last" },
1413
+ {
1414
+ action: "merge_cells",
1415
+ nodeId: "<tableNodeId>",
1416
+ start: { rowIndex: 0, columnIndex: 0 },
1417
+ end: { rowIndex: 1, columnIndex: 1 }
1418
+ },
1419
+ { action: "set_cell_text", nodeId: "<tableNodeId>", rowIndex: 0, columnIndex: 0, text: "Q1 Revenue" },
1420
+ { action: "set_row", nodeId: "<tableNodeId>", rowIndex: 0, heightPt: 24, rule: "atLeast" },
1421
+ {
1422
+ action: "set_borders",
1423
+ nodeId: "<tableNodeId>",
1424
+ mode: "applyTo",
1425
+ applyTo: "all",
1426
+ border: { lineStyle: "single", lineWeightPt: 1, color: "#000000" }
1427
+ },
1428
+ {
1429
+ action: "set_shading",
1430
+ target: { kind: "block", nodeType: "tableCell", nodeId: "<cellNodeId>" },
1431
+ color: "#E3F2FD"
1432
+ },
1433
+ {
1434
+ action: "set_style_options",
1435
+ nodeId: "<tableNodeId>",
1436
+ styleOptions: { headerRow: true, bandedRows: true }
1437
+ }
1438
+ ]
1439
+ },
1366
1440
  list: {
1367
1441
  toolName: "superdoc_list",
1368
1442
  description: "Create and manipulate bullet and numbered lists. " + 'Most actions require a list-item target: {kind:"block", nodeType:"listItem", nodeId:"<id>"}. ' + 'Exceptions: "create" and "attach" operate on paragraph targets (they turn paragraphs into list items). ' + `Find nodeIds via superdoc_get_content({action:"blocks"}): pick listItem blocks for most actions, paragraph blocks for create/attach.
@@ -2664,6 +2738,23 @@ More content with **bold** and *italic*.`
2664
2738
  intentGroup: "list",
2665
2739
  intentAction: "detach"
2666
2740
  },
2741
+ "lists.delete": {
2742
+ memberPath: "lists.delete",
2743
+ description: "Delete the entire list that contains the targeted list item. Removes ALL items in the same numbered sequence (the contiguous run of list items sharing the target's numbering) AND their text content from the document. " + "Pass any single list item from the list as `target`; the op walks adjacent siblings to find the full list. " + 'Use this for "remove the list" / "delete this list" intents and for the cleanup step of a list-to-table conversion.',
2744
+ expectedResult: "Returns a ListsDeleteResult with `deletedCount` (number of items removed). Reports failure (INVALID_TARGET) if the target is not a list item.",
2745
+ requiresDocumentContext: true,
2746
+ metadata: mutationOperation({
2747
+ idempotency: "conditional",
2748
+ supportsDryRun: true,
2749
+ supportsTrackedMode: false,
2750
+ possibleFailureCodes: ["INVALID_TARGET"],
2751
+ throws: [...T_NOT_FOUND_CAPABLE, "INVALID_TARGET"]
2752
+ }),
2753
+ referenceDocPath: "lists/delete.mdx",
2754
+ referenceGroup: "lists",
2755
+ intentGroup: "list",
2756
+ intentAction: "delete"
2757
+ },
2667
2758
  "lists.indent": {
2668
2759
  memberPath: "lists.indent",
2669
2760
  description: "Increase the indentation level of a list item.",
@@ -3422,7 +3513,9 @@ More content with **bold** and *italic*.`
3422
3513
  throws: [...T_NOT_FOUND_COMMAND, "INVALID_TARGET"]
3423
3514
  }),
3424
3515
  referenceDocPath: "tables/delete.mdx",
3425
- referenceGroup: "tables"
3516
+ referenceGroup: "tables",
3517
+ intentGroup: "table",
3518
+ intentAction: "delete"
3426
3519
  },
3427
3520
  "tables.clearContents": {
3428
3521
  memberPath: "tables.clearContents",
@@ -3497,11 +3590,13 @@ More content with **bold** and *italic*.`
3497
3590
  throws: T_NOT_FOUND_COMMAND
3498
3591
  }),
3499
3592
  referenceDocPath: "tables/set-layout.mdx",
3500
- referenceGroup: "tables"
3593
+ referenceGroup: "tables",
3594
+ intentGroup: "table",
3595
+ intentAction: "set_layout"
3501
3596
  },
3502
3597
  "tables.insertRow": {
3503
3598
  memberPath: "tables.insertRow",
3504
- description: "Insert a new row into the target table.",
3599
+ description: "Insert a new row into the target table. The new row is cloned from an adjacent row, so it inherits the existing cell shading, borders, alignment, and padding. No follow-up styling call is needed unless the new row should look different from the rest of the table.",
3505
3600
  expectedResult: "Returns a TableMutationResult receipt confirming a row was inserted.",
3506
3601
  requiresDocumentContext: true,
3507
3602
  metadata: mutationOperation({
@@ -3512,7 +3607,9 @@ More content with **bold** and *italic*.`
3512
3607
  throws: [...T_NOT_FOUND_COMMAND, "INVALID_TARGET"]
3513
3608
  }),
3514
3609
  referenceDocPath: "tables/insert-row.mdx",
3515
- referenceGroup: "tables"
3610
+ referenceGroup: "tables",
3611
+ intentGroup: "table",
3612
+ intentAction: "insert_row"
3516
3613
  },
3517
3614
  "tables.deleteRow": {
3518
3615
  memberPath: "tables.deleteRow",
@@ -3527,7 +3624,9 @@ More content with **bold** and *italic*.`
3527
3624
  throws: [...T_NOT_FOUND_COMMAND, "INVALID_TARGET"]
3528
3625
  }),
3529
3626
  referenceDocPath: "tables/delete-row.mdx",
3530
- referenceGroup: "tables"
3627
+ referenceGroup: "tables",
3628
+ intentGroup: "table",
3629
+ intentAction: "delete_row"
3531
3630
  },
3532
3631
  "tables.setRowHeight": {
3533
3632
  memberPath: "tables.setRowHeight",
@@ -3542,7 +3641,9 @@ More content with **bold** and *italic*.`
3542
3641
  throws: T_NOT_FOUND_COMMAND
3543
3642
  }),
3544
3643
  referenceDocPath: "tables/set-row-height.mdx",
3545
- referenceGroup: "tables"
3644
+ referenceGroup: "tables",
3645
+ intentGroup: "table",
3646
+ intentAction: "set_row"
3546
3647
  },
3547
3648
  "tables.distributeRows": {
3548
3649
  memberPath: "tables.distributeRows",
@@ -3572,11 +3673,13 @@ More content with **bold** and *italic*.`
3572
3673
  throws: T_NOT_FOUND_COMMAND
3573
3674
  }),
3574
3675
  referenceDocPath: "tables/set-row-options.mdx",
3575
- referenceGroup: "tables"
3676
+ referenceGroup: "tables",
3677
+ intentGroup: "table",
3678
+ intentAction: "set_row_options"
3576
3679
  },
3577
3680
  "tables.insertColumn": {
3578
3681
  memberPath: "tables.insertColumn",
3579
- description: "Insert a new column into the target table.",
3682
+ description: "Insert a new column into the target table. The new column is cloned from an adjacent column, so it inherits the existing cell shading, borders, alignment, and width. No follow-up styling call is needed unless the new column should look different from the rest of the table.",
3580
3683
  expectedResult: "Returns a TableMutationResult receipt confirming a column was inserted.",
3581
3684
  requiresDocumentContext: true,
3582
3685
  metadata: mutationOperation({
@@ -3587,7 +3690,9 @@ More content with **bold** and *italic*.`
3587
3690
  throws: [...T_NOT_FOUND_COMMAND, "INVALID_TARGET"]
3588
3691
  }),
3589
3692
  referenceDocPath: "tables/insert-column.mdx",
3590
- referenceGroup: "tables"
3693
+ referenceGroup: "tables",
3694
+ intentGroup: "table",
3695
+ intentAction: "insert_column"
3591
3696
  },
3592
3697
  "tables.deleteColumn": {
3593
3698
  memberPath: "tables.deleteColumn",
@@ -3602,7 +3707,9 @@ More content with **bold** and *italic*.`
3602
3707
  throws: [...T_NOT_FOUND_COMMAND, "INVALID_TARGET"]
3603
3708
  }),
3604
3709
  referenceDocPath: "tables/delete-column.mdx",
3605
- referenceGroup: "tables"
3710
+ referenceGroup: "tables",
3711
+ intentGroup: "table",
3712
+ intentAction: "delete_column"
3606
3713
  },
3607
3714
  "tables.setColumnWidth": {
3608
3715
  memberPath: "tables.setColumnWidth",
@@ -3617,7 +3724,9 @@ More content with **bold** and *italic*.`
3617
3724
  throws: T_NOT_FOUND_COMMAND
3618
3725
  }),
3619
3726
  referenceDocPath: "tables/set-column-width.mdx",
3620
- referenceGroup: "tables"
3727
+ referenceGroup: "tables",
3728
+ intentGroup: "table",
3729
+ intentAction: "set_column"
3621
3730
  },
3622
3731
  "tables.distributeColumns": {
3623
3732
  memberPath: "tables.distributeColumns",
@@ -3677,7 +3786,9 @@ More content with **bold** and *italic*.`
3677
3786
  throws: T_NOT_FOUND_COMMAND
3678
3787
  }),
3679
3788
  referenceDocPath: "tables/merge-cells.mdx",
3680
- referenceGroup: "tables"
3789
+ referenceGroup: "tables",
3790
+ intentGroup: "table",
3791
+ intentAction: "merge_cells"
3681
3792
  },
3682
3793
  "tables.unmergeCells": {
3683
3794
  memberPath: "tables.unmergeCells",
@@ -3692,7 +3803,9 @@ More content with **bold** and *italic*.`
3692
3803
  throws: T_NOT_FOUND_COMMAND
3693
3804
  }),
3694
3805
  referenceDocPath: "tables/unmerge-cells.mdx",
3695
- referenceGroup: "tables"
3806
+ referenceGroup: "tables",
3807
+ intentGroup: "table",
3808
+ intentAction: "unmerge_cells"
3696
3809
  },
3697
3810
  "tables.splitCell": {
3698
3811
  memberPath: "tables.splitCell",
@@ -3711,7 +3824,7 @@ More content with **bold** and *italic*.`
3711
3824
  },
3712
3825
  "tables.setCellProperties": {
3713
3826
  memberPath: "tables.setCellProperties",
3714
- description: "Set properties on a table cell such as vertical alignment or text direction.",
3827
+ description: "Set non-text properties on a single table cell: vertical alignment, text wrapping, fit-text, or preferred width. " + "Requires a cell-level target (a tableCell block address with kind, nodeType, nodeId). Does NOT accept a table target with rowIndex/columnIndex. " + 'To set the text content of a cell, use action "set_cell_text" instead.',
3715
3828
  expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if cell properties already match.",
3716
3829
  requiresDocumentContext: true,
3717
3830
  metadata: mutationOperation({
@@ -3722,7 +3835,26 @@ More content with **bold** and *italic*.`
3722
3835
  throws: T_NOT_FOUND_COMMAND
3723
3836
  }),
3724
3837
  referenceDocPath: "tables/set-cell-properties.mdx",
3725
- referenceGroup: "tables"
3838
+ referenceGroup: "tables",
3839
+ intentGroup: "table",
3840
+ intentAction: "set_cell"
3841
+ },
3842
+ "tables.setCellText": {
3843
+ memberPath: "tables.setCellText",
3844
+ description: "Replace the text content of a single table cell with plain text (one paragraph). " + "Accepts either a direct cell locator (a tableCell block address with kind, nodeType, nodeId) OR a table target with rowIndex + columnIndex. " + "Cell properties (vertical alignment, shading, borders, colspan/rowspan) are preserved. " + "Use this for filling cells with values, replacing cell text, or populating empty tables. Much simpler than walking paragraphs and runs through superdoc_edit.",
3845
+ expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the cell already contains exactly this text.",
3846
+ requiresDocumentContext: true,
3847
+ metadata: mutationOperation({
3848
+ idempotency: "idempotent",
3849
+ supportsDryRun: true,
3850
+ supportsTrackedMode: false,
3851
+ possibleFailureCodes: ["INVALID_TARGET", "NO_OP"],
3852
+ throws: T_NOT_FOUND_COMMAND
3853
+ }),
3854
+ referenceDocPath: "tables/set-cell-text.mdx",
3855
+ referenceGroup: "tables",
3856
+ intentGroup: "table",
3857
+ intentAction: "set_cell_text"
3726
3858
  },
3727
3859
  "tables.sort": {
3728
3860
  memberPath: "tables.sort",
@@ -3857,7 +3989,9 @@ More content with **bold** and *italic*.`
3857
3989
  throws: T_NOT_FOUND_COMMAND
3858
3990
  }),
3859
3991
  referenceDocPath: "tables/set-shading.mdx",
3860
- referenceGroup: "tables"
3992
+ referenceGroup: "tables",
3993
+ intentGroup: "table",
3994
+ intentAction: "set_shading"
3861
3995
  },
3862
3996
  "tables.clearShading": {
3863
3997
  memberPath: "tables.clearShading",
@@ -3936,7 +4070,7 @@ More content with **bold** and *italic*.`
3936
4070
  },
3937
4071
  "tables.applyStyle": {
3938
4072
  memberPath: "tables.applyStyle",
3939
- description: "Apply a table style and/or style options in one call.",
4073
+ description: "Toggle conditional-format flags (header row, banded rows/columns, first/last column, last row) on a table. " + "Pass `styleOptions` with the flags you want to set or clear (omitted flags stay unchanged). " + 'For "format the first row as a header" use `styleOptions: { headerRow: true }`. ' + "Optional `styleId` applies a named table style. Leave it unset unless you have a styleId from `superdoc_get_content` (no need to invent one).",
3940
4074
  expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the style and all provided options already match.",
3941
4075
  requiresDocumentContext: true,
3942
4076
  metadata: mutationOperation({
@@ -3947,7 +4081,9 @@ More content with **bold** and *italic*.`
3947
4081
  throws: T_NOT_FOUND_COMMAND
3948
4082
  }),
3949
4083
  referenceDocPath: "tables/apply-style.mdx",
3950
- referenceGroup: "tables"
4084
+ referenceGroup: "tables",
4085
+ intentGroup: "table",
4086
+ intentAction: "set_style_options"
3951
4087
  },
3952
4088
  "tables.setBorders": {
3953
4089
  memberPath: "tables.setBorders",
@@ -3962,7 +4098,9 @@ More content with **bold** and *italic*.`
3962
4098
  throws: T_NOT_FOUND_COMMAND
3963
4099
  }),
3964
4100
  referenceDocPath: "tables/set-borders.mdx",
3965
- referenceGroup: "tables"
4101
+ referenceGroup: "tables",
4102
+ intentGroup: "table",
4103
+ intentAction: "set_borders"
3966
4104
  },
3967
4105
  "tables.setTableOptions": {
3968
4106
  memberPath: "tables.setTableOptions",
@@ -3977,6 +4115,23 @@ More content with **bold** and *italic*.`
3977
4115
  throws: T_NOT_FOUND_COMMAND
3978
4116
  }),
3979
4117
  referenceDocPath: "tables/set-table-options.mdx",
4118
+ referenceGroup: "tables",
4119
+ intentGroup: "table",
4120
+ intentAction: "set_options"
4121
+ },
4122
+ "tables.applyPreset": {
4123
+ memberPath: "tables.applyPreset",
4124
+ description: 'Apply a named visual preset to a table. Presets: "grid" (1pt black borders all around), "minimal" (no outer borders, hairline grey row separators + thicker bottom), "striped" (banded rows on, 0.5pt grey borders), "accent" (filled header row + thick accent top/bottom; defaults to dark blue, override with `accentColor`). ' + "Composes set_borders + set_style_options + header-row shading in one call. Available via the document API and `superdoc_mutations` (intentionally NOT exposed as a top-level action on `superdoc_table`. Agents should compose explicit set_borders / set_shading / set_style_options calls so they always pick concrete colors that match the document context).",
4125
+ expectedResult: "Returns a TableMutationResult receipt.",
4126
+ requiresDocumentContext: true,
4127
+ metadata: mutationOperation({
4128
+ idempotency: "idempotent",
4129
+ supportsDryRun: true,
4130
+ supportsTrackedMode: false,
4131
+ possibleFailureCodes: ["INVALID_TARGET"],
4132
+ throws: T_NOT_FOUND_COMMAND
4133
+ }),
4134
+ referenceDocPath: "tables/apply-preset.mdx",
3980
4135
  referenceGroup: "tables"
3981
4136
  },
3982
4137
  "tables.get": {
@@ -6675,6 +6830,12 @@ var init_command_catalog = __esm(() => {
6675
6830
  OPERATION_EXPECTED_RESULT_MAP = projectFromDefinitions((_id, entry) => entry.expectedResult);
6676
6831
  });
6677
6832
 
6833
+ // ../../packages/document-api/src/tables/color-formats.ts
6834
+ var TABLE_COLOR_PATTERN_SOURCE = "^(#?([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})|auto)$", TABLE_COLOR_PATTERN;
6835
+ var init_color_formats = __esm(() => {
6836
+ TABLE_COLOR_PATTERN = new RegExp(TABLE_COLOR_PATTERN_SOURCE, "u");
6837
+ });
6838
+
6678
6839
  // ../../packages/document-api/src/write/write.ts
6679
6840
  function normalizeMutationOptions(options) {
6680
6841
  return {
@@ -8401,13 +8562,14 @@ function buildInternalContractSchemas() {
8401
8562
  operations
8402
8563
  };
8403
8564
  }
8404
- var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, tableAddressSchema, tableRowAddressSchema, tableCellAddressSchema, tableOrCellAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, storyLocatorSchema, 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, documentStyleInfoSchema, documentStylesSchema, documentDefaultsSchema, 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, trackChangeWordRevisionIdsSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, tableBorderColorPattern = "^([0-9A-Fa-f]{6}|auto)$", tableBorderSpecSchema, nullableTableBorderSpecSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, cellLocatorSchema, cellOrTableScopedCellLocatorSchema, tableOrCellLocatorSchema, mergeRangeLocatorSchema, 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, refListQueryProperties, 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, diffCoverageSchema, diffSummarySchema, diffSnapshotSchema, diffPayloadSchema, diffApplyResultSchema, operationSchemas;
8565
+ var nodeTypeValues, blockNodeTypeValues, deletableBlockNodeTypeValues, inlineNodeTypeValues, knownTargetKindValues, SHARED_DEFS, rangeSchema, positionSchema, inlineAnchorSchema, targetKindSchema, textAddressSchema, textTargetSchema, blockNodeAddressSchema, deletableBlockNodeAddressSchema, tableAddressSchema, tableRowAddressSchema, tableCellAddressSchema, tableOrCellAddressSchema, paragraphAddressSchema, headingAddressSchema, listItemAddressSchema, paragraphTargetSchema, sectionAddressSchema, inlineNodeAddressSchema, nodeAddressSchema, commentAddressSchema, trackedChangeAddressSchema, entityAddressSchema, selectionTargetSchema, targetLocatorSchema, deleteBehaviorSchema, resolvedHandleSchema, pageInfoSchema, receiptSuccessSchema, textMutationRangeSchema, textMutationResolutionSchema, textMutationSuccessSchema, matchRunSchema, matchBlockSchema, storyLocatorSchema, 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, documentStyleInfoSchema, documentStylesSchema, documentDefaultsSchema, 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, trackChangeWordRevisionIdsSchema, trackChangeInfoSchema, trackChangeDomainItemSchema, trackChangesListResultSchema, capabilityReasonCodeSchema, capabilityReasonsSchema, capabilityFlagSchema, operationRuntimeCapabilitySchema, operationCapabilitiesSchema, inlinePropertyCapabilitySchema, inlinePropertyCapabilitiesByKeySchema, formatCapabilitiesSchema, planEngineCapabilitiesSchema, capabilitiesOutputSchema, strictEmptyObjectSchema, tableBorderColorPattern, tableBorderSpecSchema, nullableTableBorderSpecSchema, sdFragmentSchema, placementSchema, nestingPolicySchema, insertInputSchema, tableLocatorSchema, cellLocatorSchema, cellOrTableScopedCellLocatorSchema, tableOrCellLocatorSchema, mergeRangeLocatorSchema, 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, refListQueryProperties, 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, diffCoverageSchema, diffSummarySchema, diffSnapshotSchema, diffPayloadSchema, diffApplyResultSchema, operationSchemas;
8405
8566
  var init_schemas = __esm(() => {
8406
8567
  init_command_catalog();
8407
8568
  init_types2();
8408
8569
  init_base();
8409
8570
  init_address();
8410
8571
  init_inline_run_patch();
8572
+ init_color_formats();
8411
8573
  init_style_policy_types();
8412
8574
  init_paragraphs();
8413
8575
  init_styles();
@@ -9211,6 +9373,7 @@ var init_schemas = __esm(() => {
9211
9373
  planEngine: planEngineCapabilitiesSchema
9212
9374
  }, ["global", "format", "operations", "planEngine"]);
9213
9375
  strictEmptyObjectSchema = objectSchema({});
9376
+ tableBorderColorPattern = TABLE_COLOR_PATTERN_SOURCE;
9214
9377
  tableBorderSpecSchema = objectSchema({
9215
9378
  lineStyle: { type: "string" },
9216
9379
  lineWeightPt: { type: "number", exclusiveMinimum: 0 },
@@ -10749,6 +10912,25 @@ var init_schemas = __esm(() => {
10749
10912
  success: objectSchema({ success: { const: true }, paragraph: ref("ParagraphAddress") }, ["success", "paragraph"]),
10750
10913
  failure: listsFailureSchemaFor("lists.detach")
10751
10914
  },
10915
+ "lists.delete": {
10916
+ input: objectSchema({
10917
+ target: listItemAddressSchema
10918
+ }, ["target"]),
10919
+ output: {
10920
+ oneOf: [
10921
+ objectSchema({ success: { const: true }, deletedCount: { type: "integer", minimum: 0 } }, [
10922
+ "success",
10923
+ "deletedCount"
10924
+ ]),
10925
+ listsFailureSchemaFor("lists.delete")
10926
+ ]
10927
+ },
10928
+ success: objectSchema({ success: { const: true }, deletedCount: { type: "integer", minimum: 0 } }, [
10929
+ "success",
10930
+ "deletedCount"
10931
+ ]),
10932
+ failure: listsFailureSchemaFor("lists.delete")
10933
+ },
10752
10934
  "lists.indent": {
10753
10935
  input: objectSchema({
10754
10936
  target: listItemAddressSchema
@@ -11708,10 +11890,36 @@ var init_schemas = __esm(() => {
11708
11890
  failure: tableMutationFailureSchema
11709
11891
  },
11710
11892
  "tables.insertRow": {
11711
- input: rowOperationInputSchema({
11712
- position: { enum: ["above", "below"] },
11713
- count: { type: "integer", minimum: 1 }
11714
- }, ["position"]),
11893
+ input: {
11894
+ oneOf: [
11895
+ objectSchema({
11896
+ target: tableRowAddressSchema,
11897
+ position: { enum: ["above", "below"] },
11898
+ count: { type: "integer", minimum: 1 }
11899
+ }, ["target", "position"]),
11900
+ objectSchema({
11901
+ target: tableAddressSchema,
11902
+ rowIndex: { type: "integer", minimum: 0 },
11903
+ position: { enum: ["above", "below"] },
11904
+ count: { type: "integer", minimum: 1 }
11905
+ }, ["target", "rowIndex", "position"]),
11906
+ objectSchema({
11907
+ nodeId: { type: "string" },
11908
+ rowIndex: { type: "integer", minimum: 0 },
11909
+ position: { enum: ["above", "below"] },
11910
+ count: { type: "integer", minimum: 1 }
11911
+ }, ["nodeId", "rowIndex", "position"]),
11912
+ {
11913
+ ...objectSchema({
11914
+ target: tableAddressSchema,
11915
+ nodeId: { type: "string" },
11916
+ count: { type: "integer", minimum: 1 }
11917
+ }, []),
11918
+ oneOf: [{ required: ["target"] }, { required: ["nodeId"] }],
11919
+ not: { anyOf: [{ required: ["rowIndex"] }, { required: ["position"] }] }
11920
+ }
11921
+ ]
11922
+ },
11715
11923
  output: tableMutationResultSchema,
11716
11924
  success: tableMutationSuccessSchema,
11717
11925
  failure: tableMutationFailureSchema
@@ -11752,9 +11960,9 @@ var init_schemas = __esm(() => {
11752
11960
  target: tableAddressSchema,
11753
11961
  nodeId: { type: "string" },
11754
11962
  columnIndex: { type: "integer", minimum: 0 },
11755
- position: { enum: ["left", "right"] },
11963
+ position: { enum: ["left", "right", "first", "last"] },
11756
11964
  count: { type: "integer", minimum: 1 }
11757
- }, ["columnIndex", "position"]),
11965
+ }, ["position"]),
11758
11966
  oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
11759
11967
  },
11760
11968
  output: tableMutationResultSchema,
@@ -11872,6 +12080,35 @@ var init_schemas = __esm(() => {
11872
12080
  success: tableMutationSuccessSchema,
11873
12081
  failure: tableMutationFailureSchema
11874
12082
  },
12083
+ "tables.setCellText": {
12084
+ input: {
12085
+ oneOf: [
12086
+ objectSchema({
12087
+ target: tableCellAddressSchema,
12088
+ text: { type: "string" }
12089
+ }, ["target", "text"]),
12090
+ objectSchema({
12091
+ nodeId: { type: "string" },
12092
+ text: { type: "string" }
12093
+ }, ["nodeId", "text"]),
12094
+ objectSchema({
12095
+ target: tableAddressSchema,
12096
+ rowIndex: { type: "integer", minimum: 0 },
12097
+ columnIndex: { type: "integer", minimum: 0 },
12098
+ text: { type: "string" }
12099
+ }, ["target", "rowIndex", "columnIndex", "text"]),
12100
+ objectSchema({
12101
+ nodeId: { type: "string" },
12102
+ rowIndex: { type: "integer", minimum: 0 },
12103
+ columnIndex: { type: "integer", minimum: 0 },
12104
+ text: { type: "string" }
12105
+ }, ["nodeId", "rowIndex", "columnIndex", "text"])
12106
+ ]
12107
+ },
12108
+ output: tableMutationResultSchema,
12109
+ success: tableMutationSuccessSchema,
12110
+ failure: tableMutationFailureSchema
12111
+ },
11875
12112
  "tables.sort": {
11876
12113
  input: {
11877
12114
  ...objectSchema({
@@ -11946,7 +12183,7 @@ var init_schemas = __esm(() => {
11946
12183
  edge: { enum: ["top", "bottom", "left", "right", "insideH", "insideV", "diagonalDown", "diagonalUp"] },
11947
12184
  lineStyle: { type: "string" },
11948
12185
  lineWeightPt: { type: "number", exclusiveMinimum: 0 },
11949
- color: { type: "string", pattern: "^([0-9A-Fa-f]{6}|auto)$" }
12186
+ color: { type: "string", pattern: tableBorderColorPattern }
11950
12187
  }, ["edge", "lineStyle", "lineWeightPt", "color"]),
11951
12188
  oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
11952
12189
  },
@@ -11985,7 +12222,9 @@ var init_schemas = __esm(() => {
11985
12222
  ...objectSchema({
11986
12223
  target: tableOrCellAddressSchema,
11987
12224
  nodeId: { type: "string" },
11988
- color: { type: "string", pattern: "^([0-9A-Fa-f]{6}|auto)$" }
12225
+ color: {
12226
+ oneOf: [{ type: "string", pattern: tableBorderColorPattern }, { type: "null" }]
12227
+ }
11989
12228
  }, ["color"]),
11990
12229
  oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
11991
12230
  },
@@ -12128,6 +12367,20 @@ var init_schemas = __esm(() => {
12128
12367
  success: tableMutationSuccessSchema,
12129
12368
  failure: tableMutationFailureSchema
12130
12369
  },
12370
+ "tables.applyPreset": {
12371
+ input: {
12372
+ ...objectSchema({
12373
+ target: tableAddressSchema,
12374
+ nodeId: { type: "string" },
12375
+ preset: { enum: ["grid", "minimal", "striped", "accent"] },
12376
+ accentColor: { type: "string", pattern: tableBorderColorPattern }
12377
+ }, ["preset"]),
12378
+ oneOf: [{ required: ["target"] }, { required: ["nodeId"] }]
12379
+ },
12380
+ output: tableMutationResultSchema,
12381
+ success: tableMutationSuccessSchema,
12382
+ failure: tableMutationFailureSchema
12383
+ },
12131
12384
  "tables.get": {
12132
12385
  input: tableLocatorSchema,
12133
12386
  output: objectSchema({
@@ -15190,6 +15443,10 @@ function executeListsDetach(adapter, input, options) {
15190
15443
  validateListItemTarget(input, "lists.detach");
15191
15444
  return adapter.detach(input, normalizeMutationOptions(options));
15192
15445
  }
15446
+ function executeListsDelete(adapter, input, options) {
15447
+ validateListItemTarget(input, "lists.delete");
15448
+ return adapter.delete(input, normalizeMutationOptions(options));
15449
+ }
15193
15450
  function executeListsJoin(adapter, input, options) {
15194
15451
  validateListItemTarget(input, "lists.join");
15195
15452
  requireEnum(input.direction, "direction", VALID_JOIN_DIRECTIONS, "lists.join");
@@ -15934,6 +16191,7 @@ function buildDispatchTable(api) {
15934
16191
  "lists.create": (input, options) => api.lists.create(input, options),
15935
16192
  "lists.attach": (input, options) => api.lists.attach(input, options),
15936
16193
  "lists.detach": (input, options) => api.lists.detach(input, options),
16194
+ "lists.delete": (input, options) => api.lists.delete(input, options),
15937
16195
  "lists.indent": (input, options) => api.lists.indent(input, options),
15938
16196
  "lists.outdent": (input, options) => api.lists.outdent(input, options),
15939
16197
  "lists.join": (input, options) => api.lists.join(input, options),
@@ -16024,6 +16282,7 @@ function buildDispatchTable(api) {
16024
16282
  "tables.unmergeCells": (input, options) => api.tables.unmergeCells(input, options),
16025
16283
  "tables.splitCell": (input, options) => api.tables.splitCell(input, options),
16026
16284
  "tables.setCellProperties": (input, options) => api.tables.setCellProperties(input, options),
16285
+ "tables.setCellText": (input, options) => api.tables.setCellText(input, options),
16027
16286
  "tables.sort": (input, options) => api.tables.sort(input, options),
16028
16287
  "tables.setAltText": (input, options) => api.tables.setAltText(input, options),
16029
16288
  "tables.setStyle": (input, options) => api.tables.setStyle(input, options),
@@ -16041,6 +16300,7 @@ function buildDispatchTable(api) {
16041
16300
  "tables.applyStyle": (input, options) => api.tables.applyStyle(input, options),
16042
16301
  "tables.setBorders": (input, options) => api.tables.setBorders(input, options),
16043
16302
  "tables.setTableOptions": (input, options) => api.tables.setTableOptions(input, options),
16303
+ "tables.applyPreset": (input, options) => api.tables.applyPreset(input, options),
16044
16304
  "tables.get": (input) => api.tables.get(input),
16045
16305
  "tables.getCells": (input) => api.tables.getCells(input),
16046
16306
  "tables.getProperties": (input) => api.tables.getProperties(input),
@@ -16336,20 +16596,23 @@ function validateTableLocator(input, operationName) {
16336
16596
  });
16337
16597
  }
16338
16598
  }
16339
- function validateRowLocator(input, operationName) {
16599
+ function validateRowLocator(input, operationName, options = {}) {
16340
16600
  validateTableLocator(input, operationName);
16601
+ const hasPosition = input.position != null;
16602
+ const hasRowIndex = input.rowIndex != null;
16603
+ const isAppendShorthand = !!options.allowAppendShorthand && !hasRowIndex && !hasPosition;
16341
16604
  if (input.nodeId != null) {
16342
- if (input.rowIndex == null) {
16605
+ if (!hasRowIndex && !isAppendShorthand) {
16343
16606
  throw new DocumentApiValidationError("INVALID_TARGET", `${operationName}: rowIndex is required when using nodeId for row operations. ` + `Use target to address a row directly, or pass nodeId + rowIndex to address a row within a table.`);
16344
16607
  }
16345
16608
  return;
16346
16609
  }
16347
16610
  if (!isObjectRecord2(input.target) || input.target.kind !== "block")
16348
16611
  return;
16349
- if (input.target.nodeType === "table" && input.rowIndex == null) {
16612
+ if (input.target.nodeType === "table" && !hasRowIndex && !isAppendShorthand) {
16350
16613
  throw new DocumentApiValidationError("INVALID_TARGET", `${operationName}: rowIndex is required when target is a table.`);
16351
16614
  }
16352
- if (input.target.nodeType === "tableRow" && input.rowIndex != null) {
16615
+ if (input.target.nodeType === "tableRow" && hasRowIndex) {
16353
16616
  throw new DocumentApiValidationError("INVALID_TARGET", `${operationName}: rowIndex must not be provided when target is a row node. ` + `Either pass a table target with rowIndex, or pass a row target without rowIndex.`);
16354
16617
  }
16355
16618
  }
@@ -16387,8 +16650,8 @@ function executeTableLocatorOp(operationName, adapter, input, options) {
16387
16650
  validateTableLocator(input, operationName);
16388
16651
  return adapter(input, normalizeMutationOptions(options));
16389
16652
  }
16390
- function executeRowLocatorOp(operationName, adapter, input, options) {
16391
- validateRowLocator(input, operationName);
16653
+ function executeRowLocatorOp(operationName, adapter, input, options, rowLocatorOptions) {
16654
+ validateRowLocator(input, operationName, rowLocatorOptions);
16392
16655
  return adapter(input, normalizeMutationOptions(options));
16393
16656
  }
16394
16657
  function executeCellOrTableScopedCellLocatorOp(operationName, adapter, input, options) {
@@ -16426,7 +16689,7 @@ function validateBorderSpec(spec, fieldPath, operationName) {
16426
16689
  field: `${fieldPath}.color`
16427
16690
  });
16428
16691
  }
16429
- if (!TABLE_BORDER_COLOR_PATTERN.test(spec.color)) {
16692
+ if (!TABLE_COLOR_PATTERN.test(spec.color)) {
16430
16693
  throw new DocumentApiValidationError("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a 6-digit hex color without "#" or "auto".`, {
16431
16694
  field: `${fieldPath}.color`
16432
16695
  });
@@ -16532,9 +16795,10 @@ function executeTablesSetTableOptions(operationName, adapter, input, options) {
16532
16795
  }
16533
16796
  return adapter(input, normalizeMutationOptions(options));
16534
16797
  }
16535
- var VALID_STYLE_OPTION_FLAGS, TABLE_BORDER_COLOR_PATTERN, VALID_APPLY_TO_VALUES, VALID_BORDER_EDGE_KEYS;
16798
+ var VALID_STYLE_OPTION_FLAGS, VALID_APPLY_TO_VALUES, VALID_BORDER_EDGE_KEYS;
16536
16799
  var init_tables = __esm(() => {
16537
16800
  init_errors2();
16801
+ init_color_formats();
16538
16802
  VALID_STYLE_OPTION_FLAGS = new Set([
16539
16803
  "headerRow",
16540
16804
  "lastRow",
@@ -16544,7 +16808,6 @@ var init_tables = __esm(() => {
16544
16808
  "bandedRows",
16545
16809
  "bandedColumns"
16546
16810
  ]);
16547
- TABLE_BORDER_COLOR_PATTERN = /^([0-9A-Fa-f]{6}|auto)$/u;
16548
16811
  VALID_APPLY_TO_VALUES = new Set([
16549
16812
  "all",
16550
16813
  "outside",
@@ -18895,6 +19158,9 @@ function createDocumentApi(adapters) {
18895
19158
  detach(input, options) {
18896
19159
  return executeListsDetach(adapters.lists, input, options);
18897
19160
  },
19161
+ delete(input, options) {
19162
+ return executeListsDelete(adapters.lists, input, options);
19163
+ },
18898
19164
  indent(input, options) {
18899
19165
  return executeListsIndent(adapters.lists, input, options);
18900
19166
  },
@@ -19072,7 +19338,7 @@ function createDocumentApi(adapters) {
19072
19338
  return executeTableLocatorOp("tables.setLayout", adapters.tables.setLayout.bind(adapters.tables), input, options);
19073
19339
  },
19074
19340
  insertRow(input, options) {
19075
- return executeRowLocatorOp("tables.insertRow", adapters.tables.insertRow.bind(adapters.tables), input, options);
19341
+ return executeRowLocatorOp("tables.insertRow", adapters.tables.insertRow.bind(adapters.tables), input, options, { allowAppendShorthand: true });
19076
19342
  },
19077
19343
  deleteRow(input, options) {
19078
19344
  return executeRowLocatorOp("tables.deleteRow", adapters.tables.deleteRow.bind(adapters.tables), input, options);
@@ -19116,6 +19382,9 @@ function createDocumentApi(adapters) {
19116
19382
  setCellProperties(input, options) {
19117
19383
  return executeTableLocatorOp("tables.setCellProperties", adapters.tables.setCellProperties.bind(adapters.tables), input, options);
19118
19384
  },
19385
+ setCellText(input, options) {
19386
+ return executeCellOrTableScopedCellLocatorOp("tables.setCellText", adapters.tables.setCellText.bind(adapters.tables), input, options);
19387
+ },
19119
19388
  sort(input, options) {
19120
19389
  return executeTableLocatorOp("tables.sort", adapters.tables.sort.bind(adapters.tables), input, options);
19121
19390
  },
@@ -19167,6 +19436,9 @@ function createDocumentApi(adapters) {
19167
19436
  setTableOptions(input, options) {
19168
19437
  return executeTablesSetTableOptions("tables.setTableOptions", adapters.tables.setTableOptions.bind(adapters.tables), input, options);
19169
19438
  },
19439
+ applyPreset(input, options) {
19440
+ return executeTableLocatorOp("tables.applyPreset", adapters.tables.applyPreset.bind(adapters.tables), input, options);
19441
+ },
19170
19442
  get(input) {
19171
19443
  return adapters.tables.get(input);
19172
19444
  },
@@ -65823,7 +66095,7 @@ var init_remark_gfm_BhnWr3yf_es = __esm(() => {
65823
66095
  emptyOptions2 = {};
65824
66096
  });
65825
66097
 
65826
- // ../../packages/superdoc/dist/chunks/SuperConverter-CzqEoFT1.es.js
66098
+ // ../../packages/superdoc/dist/chunks/SuperConverter-CjDkqrj8.es.js
65827
66099
  function getExtensionConfigField(extension$1, field, context = { name: "" }) {
65828
66100
  const fieldValue = extension$1.config[field];
65829
66101
  if (typeof fieldValue === "function")
@@ -69690,6 +69962,10 @@ function executeListsDetach2(adapter, input, options) {
69690
69962
  validateListItemTarget2(input, "lists.detach");
69691
69963
  return adapter.detach(input, normalizeMutationOptions2(options));
69692
69964
  }
69965
+ function executeListsDelete2(adapter, input, options) {
69966
+ validateListItemTarget2(input, "lists.delete");
69967
+ return adapter.delete(input, normalizeMutationOptions2(options));
69968
+ }
69693
69969
  function executeListsJoin2(adapter, input, options) {
69694
69970
  validateListItemTarget2(input, "lists.join");
69695
69971
  requireEnum2(input.direction, "direction", VALID_JOIN_DIRECTIONS2, "lists.join");
@@ -70334,6 +70610,7 @@ function buildDispatchTable2(api) {
70334
70610
  "lists.create": (input, options) => api.lists.create(input, options),
70335
70611
  "lists.attach": (input, options) => api.lists.attach(input, options),
70336
70612
  "lists.detach": (input, options) => api.lists.detach(input, options),
70613
+ "lists.delete": (input, options) => api.lists.delete(input, options),
70337
70614
  "lists.indent": (input, options) => api.lists.indent(input, options),
70338
70615
  "lists.outdent": (input, options) => api.lists.outdent(input, options),
70339
70616
  "lists.join": (input, options) => api.lists.join(input, options),
@@ -70424,6 +70701,7 @@ function buildDispatchTable2(api) {
70424
70701
  "tables.unmergeCells": (input, options) => api.tables.unmergeCells(input, options),
70425
70702
  "tables.splitCell": (input, options) => api.tables.splitCell(input, options),
70426
70703
  "tables.setCellProperties": (input, options) => api.tables.setCellProperties(input, options),
70704
+ "tables.setCellText": (input, options) => api.tables.setCellText(input, options),
70427
70705
  "tables.sort": (input, options) => api.tables.sort(input, options),
70428
70706
  "tables.setAltText": (input, options) => api.tables.setAltText(input, options),
70429
70707
  "tables.setStyle": (input, options) => api.tables.setStyle(input, options),
@@ -70441,6 +70719,7 @@ function buildDispatchTable2(api) {
70441
70719
  "tables.applyStyle": (input, options) => api.tables.applyStyle(input, options),
70442
70720
  "tables.setBorders": (input, options) => api.tables.setBorders(input, options),
70443
70721
  "tables.setTableOptions": (input, options) => api.tables.setTableOptions(input, options),
70722
+ "tables.applyPreset": (input, options) => api.tables.applyPreset(input, options),
70444
70723
  "tables.get": (input) => api.tables.get(input),
70445
70724
  "tables.getCells": (input) => api.tables.getCells(input),
70446
70725
  "tables.getProperties": (input) => api.tables.getProperties(input),
@@ -70704,18 +70983,21 @@ function validateTableLocator2(input, operationName) {
70704
70983
  value: input.nodeId
70705
70984
  });
70706
70985
  }
70707
- function validateRowLocator2(input, operationName) {
70986
+ function validateRowLocator2(input, operationName, options = {}) {
70708
70987
  validateTableLocator2(input, operationName);
70988
+ const hasPosition = input.position != null;
70989
+ const hasRowIndex = input.rowIndex != null;
70990
+ const isAppendShorthand = !!options.allowAppendShorthand && !hasRowIndex && !hasPosition;
70709
70991
  if (input.nodeId != null) {
70710
- if (input.rowIndex == null)
70992
+ if (!hasRowIndex && !isAppendShorthand)
70711
70993
  throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName}: rowIndex is required when using nodeId for row operations. Use target to address a row directly, or pass nodeId + rowIndex to address a row within a table.`);
70712
70994
  return;
70713
70995
  }
70714
70996
  if (!isObjectRecord3(input.target) || input.target.kind !== "block")
70715
70997
  return;
70716
- if (input.target.nodeType === "table" && input.rowIndex == null)
70998
+ if (input.target.nodeType === "table" && !hasRowIndex && !isAppendShorthand)
70717
70999
  throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName}: rowIndex is required when target is a table.`);
70718
- if (input.target.nodeType === "tableRow" && input.rowIndex != null)
71000
+ if (input.target.nodeType === "tableRow" && hasRowIndex)
70719
71001
  throw new DocumentApiValidationError2("INVALID_TARGET", `${operationName}: rowIndex must not be provided when target is a row node. Either pass a table target with rowIndex, or pass a row target without rowIndex.`);
70720
71002
  }
70721
71003
  function hasTableScopedCellCoordinates2(input) {
@@ -70749,8 +71031,8 @@ function executeTableLocatorOp2(operationName, adapter, input, options) {
70749
71031
  validateTableLocator2(input, operationName);
70750
71032
  return adapter(input, normalizeMutationOptions2(options));
70751
71033
  }
70752
- function executeRowLocatorOp2(operationName, adapter, input, options) {
70753
- validateRowLocator2(input, operationName);
71034
+ function executeRowLocatorOp2(operationName, adapter, input, options, rowLocatorOptions) {
71035
+ validateRowLocator2(input, operationName, rowLocatorOptions);
70754
71036
  return adapter(input, normalizeMutationOptions2(options));
70755
71037
  }
70756
71038
  function executeCellOrTableScopedCellLocatorOp2(operationName, adapter, input, options) {
@@ -70781,7 +71063,7 @@ function validateBorderSpec$1(spec, fieldPath, operationName) {
70781
71063
  throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.lineWeightPt must be a positive number.`, { field: `${fieldPath}.lineWeightPt` });
70782
71064
  if (typeof spec.color !== "string" || spec.color.length === 0)
70783
71065
  throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a non-empty string.`, { field: `${fieldPath}.color` });
70784
- if (!TABLE_BORDER_COLOR_PATTERN2.test(spec.color))
71066
+ if (!TABLE_COLOR_PATTERN2.test(spec.color))
70785
71067
  throw new DocumentApiValidationError2("INVALID_INPUT", `${operationName}: ${fieldPath}.color must be a 6-digit hex color without "#" or "auto".`, { field: `${fieldPath}.color` });
70786
71068
  }
70787
71069
  function validateBorderPatchEdge2(value, edgeName, operationName) {
@@ -72941,6 +73223,9 @@ function createDocumentApi2(adapters) {
72941
73223
  detach(input, options) {
72942
73224
  return executeListsDetach2(adapters.lists, input, options);
72943
73225
  },
73226
+ delete(input, options) {
73227
+ return executeListsDelete2(adapters.lists, input, options);
73228
+ },
72944
73229
  indent(input, options) {
72945
73230
  return executeListsIndent2(adapters.lists, input, options);
72946
73231
  },
@@ -73118,7 +73403,7 @@ function createDocumentApi2(adapters) {
73118
73403
  return executeTableLocatorOp2("tables.setLayout", adapters.tables.setLayout.bind(adapters.tables), input, options);
73119
73404
  },
73120
73405
  insertRow(input, options) {
73121
- return executeRowLocatorOp2("tables.insertRow", adapters.tables.insertRow.bind(adapters.tables), input, options);
73406
+ return executeRowLocatorOp2("tables.insertRow", adapters.tables.insertRow.bind(adapters.tables), input, options, { allowAppendShorthand: true });
73122
73407
  },
73123
73408
  deleteRow(input, options) {
73124
73409
  return executeRowLocatorOp2("tables.deleteRow", adapters.tables.deleteRow.bind(adapters.tables), input, options);
@@ -73162,6 +73447,9 @@ function createDocumentApi2(adapters) {
73162
73447
  setCellProperties(input, options) {
73163
73448
  return executeTableLocatorOp2("tables.setCellProperties", adapters.tables.setCellProperties.bind(adapters.tables), input, options);
73164
73449
  },
73450
+ setCellText(input, options) {
73451
+ return executeCellOrTableScopedCellLocatorOp2("tables.setCellText", adapters.tables.setCellText.bind(adapters.tables), input, options);
73452
+ },
73165
73453
  sort(input, options) {
73166
73454
  return executeTableLocatorOp2("tables.sort", adapters.tables.sort.bind(adapters.tables), input, options);
73167
73455
  },
@@ -73213,6 +73501,9 @@ function createDocumentApi2(adapters) {
73213
73501
  setTableOptions(input, options) {
73214
73502
  return executeTablesSetTableOptions2("tables.setTableOptions", adapters.tables.setTableOptions.bind(adapters.tables), input, options);
73215
73503
  },
73504
+ applyPreset(input, options) {
73505
+ return executeTableLocatorOp2("tables.applyPreset", adapters.tables.applyPreset.bind(adapters.tables), input, options);
73506
+ },
73216
73507
  get(input) {
73217
73508
  return adapters.tables.get(input);
73218
73509
  },
@@ -76722,6 +77013,18 @@ function handleDocPartObj(params3) {
76722
77013
  const sdtPr = node3.elements.find((el) => el.name === "w:sdtPr");
76723
77014
  const docPartGalleryType = sdtPr?.elements.find((el) => el.name === "w:docPartObj")?.elements.find((el) => el.name === "w:docPartGallery")?.attributes?.["w:val"] ?? null;
76724
77015
  const content$2 = node3?.elements.find((el) => el.name === "w:sdtContent");
77016
+ const isInsideParagraph = (params3.path || []).some((p) => p?.name === "w:p");
77017
+ const hasBlockChild = !!content$2?.elements?.some((el) => el?.name === "w:p" || el?.name === "w:tbl");
77018
+ if (isInsideParagraph && !hasBlockChild)
77019
+ return inlineDocPartHandler({
77020
+ ...params3,
77021
+ nodes: [content$2],
77022
+ extraParams: {
77023
+ ...params3.extraParams || {},
77024
+ sdtPr,
77025
+ docPartGalleryType
77026
+ }
77027
+ });
76725
77028
  return (validGalleryTypeMap[docPartGalleryType] || genericDocPartHandler)({
76726
77029
  ...params3,
76727
77030
  nodes: [content$2],
@@ -104184,7 +104487,7 @@ var isRegExp = (value) => {
104184
104487
  tracked: false,
104185
104488
  carrier: runAttributeCarrier2(runPropertyKey ?? key),
104186
104489
  schema
104187
- }), 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, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, 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_STORY2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, T_PROTECTION_READ2, T_PROTECTION_MUTATION2, T_PERM_RANGE_READ2, T_PERM_RANGE_MUTATION2, 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_DIRECTIONS2, ALIGNMENT_POLICIES2, 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, SET_DIRECTION_KEYS2, CLEAR_DIRECTION_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_REGISTRY2, 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, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, storyLocatorSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, documentStylesSchema2, documentDefaultsSchema2, 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, trackChangeWordRevisionIdsSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, nullableTableBorderSpecSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refListQueryProperties2, 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, diffCoverageSchema2, diffSummarySchema2, diffSnapshotSchema2, diffPayloadSchema2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, SELECTION_CURRENT_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, TEXT_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, LIST_KINDS2, LIST_INSERT_POSITIONS2, JOIN_DIRECTIONS2, MUTATION_SCOPES2, LEVEL_ALIGNMENTS2, TRAILING_CHARACTERS2, LIST_PRESET_IDS2, VALID_BLOCK_NODE_TYPES$1, VALID_LIST_KINDS2, VALID_INSERT_POSITIONS2, VALID_JOIN_DIRECTIONS2, VALID_MUTATION_SCOPES2, VALID_LEVEL_ALIGNMENTS2, VALID_TRAILING_CHARACTERS2, VALID_LIST_PRESETS2, VALID_CONTINUITY_VALUES2, VALID_SEQUENCE_MODES2, VALID_LIST_CREATE_MODES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, VALID_HEADING_LEVELS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES3, SNAPSHOT_VERSIONS2, PAYLOAD_VERSIONS2, VALID_STYLE_OPTION_FLAGS2, TABLE_BORDER_COLOR_PATTERN2, VALID_APPLY_TO_VALUES2, VALID_BORDER_EDGE_KEYS2, 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, VALID_TOC_UPDATE_MODES2, EDIT_ENTRY_PATCH_ALLOWED_KEYS2, PATCH_FIELDS2, CONTENT_CONTROL_TYPES2, LOCK_MODES2, CONTENT_CONTROL_APPEARANCES2, VALID_NODE_KINDS2, VALID_LOCK_MODES$1, VALID_CC_TYPES2, VALID_CC_APPEARANCES2, VALID_CONTENT_FORMATS2, VALID_RAW_PATCH_OPS2, VALID_SET_MODES2, VALID_CREATE_LOCATION_KINDS2, DEFAULT_PROTECTION_STATE, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$218) => ({
104490
+ }), 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, PROPERTY_VALIDATOR_MAP2, NONE_FAILURES2, NONE_THROWS2, T_NOT_FOUND2, T_NOT_FOUND_CAPABLE2, T_PLAN_ENGINE2, T_NOT_FOUND_COMMAND2, 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_STORY2, T_REF_READ_LIST2, T_REF_MUTATION2, T_REF_MUTATION_REMOVE2, T_REF_INSERT2, T_PROTECTION_READ2, T_PROTECTION_MUTATION2, T_PERM_RANGE_READ2, T_PERM_RANGE_MUTATION2, FORMAT_INLINE_ALIAS_OPERATION_DEFINITIONS2, OPERATION_DEFINITIONS2, OPERATION_IDS2, COMMAND_CATALOG3, TABLE_COLOR_PATTERN_SOURCE2 = "^(#?([0-9A-Fa-f]{6}|[0-9A-Fa-f]{3})|auto)$", TABLE_COLOR_PATTERN2, PARAGRAPH_ALIGNMENTS2, TAB_STOP_ALIGNMENTS2, TAB_STOP_LEADERS2, BORDER_SIDES2, CLEAR_BORDER_SIDES2, LINE_RULES2, PARAGRAPH_DIRECTIONS2, ALIGNMENT_POLICIES2, 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, SET_DIRECTION_KEYS2, CLEAR_DIRECTION_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_REGISTRY2, 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, tableAddressSchema2, tableRowAddressSchema2, tableCellAddressSchema2, tableOrCellAddressSchema2, paragraphAddressSchema2, headingAddressSchema2, listItemAddressSchema2, paragraphTargetSchema2, sectionAddressSchema2, nodeAddressSchema2, commentAddressSchema2, trackedChangeAddressSchema2, entityAddressSchema2, selectionTargetSchema2, deleteBehaviorSchema2, resolvedHandleSchema2, pageInfoSchema2, receiptSuccessSchema2, textMutationRangeSchema2, textMutationResolutionSchema2, textMutationSuccessSchema2, matchBlockSchema2, storyLocatorSchema2, trackChangeRefSchema2, createParagraphSuccessSchema2, createHeadingSuccessSchema2, headingLevelSchema2, listsInsertSuccessSchema2, listsMutateItemSuccessSchema2, textSelectorSchema2, nodeSelectorSchema2, sdMutationResolutionSchema2, sdMutationSuccessSchema2, documentInfoCountsSchema2, documentInfoOutlineItemSchema2, documentInfoCapabilitiesSchema2, documentStylesSchema2, documentDefaultsSchema2, 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, trackChangeWordRevisionIdsSchema2, capabilityReasonsSchema2, capabilityFlagSchema2, operationRuntimeCapabilitySchema2, operationCapabilitiesSchema2, inlinePropertyCapabilitySchema2, formatCapabilitiesSchema2, planEngineCapabilitiesSchema2, tableBorderColorPattern2, nullableTableBorderSpecSchema2, sdFragmentSchema2, placementSchema2, nestingPolicySchema2, tableCreateLocationSchema2, formatInlineAliasOperationSchemas2, tocMutationFailureSchema2, tocMutationSuccessSchema2, tocEntryMutationFailureSchema2, tocEntryMutationSuccessSchema2, hyperlinkTargetSchema2, hyperlinkReadPropertiesSchema2, hyperlinkSpecSchema2, hyperlinkPatchSchema2, hyperlinkDomainSchema2, hyperlinkMutationSuccessSchema2, hyperlinkMutationFailureSchema2, contentControlTargetSchema2, contentControlMutationSuccessSchema2, contentControlMutationFailureSchema2, ccListResultSchema2, ccInfoSchema2, refListQueryProperties2, 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, diffCoverageSchema2, diffSummarySchema2, diffSnapshotSchema2, diffPayloadSchema2, GROUP_METADATA2, STEP_OP_CATALOG_UNFROZEN2, PUBLIC_STEP_OP_CATALOG_UNFROZEN2, PUBLIC_MUTATION_STEP_OP_IDS2, PUBLIC_MUTATION_STEP_OP_SET2, CAPABILITY_REASON_CODES, VALID_EDGE_VALUES2, VALID_EDGE_NODE_TYPES2, VALID_DOCUMENT_EDGES2, VALID_REF_BOUNDARIES2, VALID_ANCHOR_KINDS2, RESOLVE_RANGE_ALLOWED_KEYS2, SELECTION_CURRENT_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, TEXT_INSERT_ALLOWED_KEYS2, STRUCTURAL_INSERT_ALLOWED_KEYS2, VALID_INSERT_TYPES2, LIST_KINDS2, LIST_INSERT_POSITIONS2, JOIN_DIRECTIONS2, MUTATION_SCOPES2, LEVEL_ALIGNMENTS2, TRAILING_CHARACTERS2, LIST_PRESET_IDS2, VALID_BLOCK_NODE_TYPES$1, VALID_LIST_KINDS2, VALID_INSERT_POSITIONS2, VALID_JOIN_DIRECTIONS2, VALID_MUTATION_SCOPES2, VALID_LEVEL_ALIGNMENTS2, VALID_TRAILING_CHARACTERS2, VALID_LIST_PRESETS2, VALID_CONTINUITY_VALUES2, VALID_SEQUENCE_MODES2, VALID_LIST_CREATE_MODES2, TEXT_REPLACE_ALLOWED_KEYS2, STRUCTURAL_REPLACE_ALLOWED_KEYS2, VALID_HEADING_LEVELS2, SECTION_BREAK_TYPES$1, SUPPORTED_DELETE_NODE_TYPES2, REJECTED_DELETE_NODE_TYPES2, VALID_BLOCK_NODE_TYPES3, SNAPSHOT_VERSIONS2, PAYLOAD_VERSIONS2, VALID_STYLE_OPTION_FLAGS2, VALID_APPLY_TO_VALUES2, VALID_BORDER_EDGE_KEYS2, 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, VALID_TOC_UPDATE_MODES2, EDIT_ENTRY_PATCH_ALLOWED_KEYS2, PATCH_FIELDS2, CONTENT_CONTROL_TYPES2, LOCK_MODES2, CONTENT_CONTROL_APPEARANCES2, VALID_NODE_KINDS2, VALID_LOCK_MODES$1, VALID_CC_TYPES2, VALID_CC_APPEARANCES2, VALID_CONTENT_FORMATS2, VALID_RAW_PATCH_OPS2, VALID_SET_MODES2, VALID_CREATE_LOCATION_KINDS2, DEFAULT_PROTECTION_STATE, ADAPTER_GATED_PREFIXES2, _buffers, _defaultCollectionId = null, _nextCollectionId = 1, generateV2HandlerEntity = (handlerName, translator$218) => ({
104188
104491
  handlerName,
104189
104492
  handler: (params3) => {
104190
104493
  const { nodes } = params3;
@@ -105519,6 +105822,27 @@ var isRegExp = (value) => {
105519
105822
  attrs,
105520
105823
  marks
105521
105824
  };
105825
+ }, inlineDocPartHandler = (params3) => {
105826
+ const node3 = params3.nodes[0];
105827
+ const translatedContent = params3.nodeListHandler.handler({
105828
+ ...params3,
105829
+ nodes: node3?.elements || [],
105830
+ path: [...params3.path || [], node3]
105831
+ });
105832
+ const sdtPr = params3.extraParams.sdtPr;
105833
+ const docPartGalleryType = params3.extraParams.docPartGalleryType;
105834
+ const id2 = sdtPr?.elements?.find((el) => el.name === "w:id")?.attributes?.["w:val"] || null;
105835
+ const docPartObj = sdtPr?.elements.find((el) => el.name === "w:docPartObj");
105836
+ return {
105837
+ type: "structuredContent",
105838
+ content: translatedContent,
105839
+ attrs: {
105840
+ id: id2,
105841
+ docPartGallery: docPartGalleryType ?? docPartObj?.elements?.find((el) => el.name === "w:docPartGallery")?.attributes?.["w:val"] ?? null,
105842
+ docPartUnique: docPartObj?.elements?.some((el) => el.name === "w:docPartUnique") ?? false,
105843
+ sdtPr
105844
+ }
105845
+ };
105522
105846
  }, tableOfContentsHandler = (params3) => {
105523
105847
  const node3 = params3.nodes[0];
105524
105848
  const normalizedContent = normalizeDocPartContent(translateTocSdtContent(node3, params3));
@@ -118806,7 +119130,7 @@ var isRegExp = (value) => {
118806
119130
  state.kern = kernNode.attributes["w:val"];
118807
119131
  }
118808
119132
  }, SuperConverter;
118809
- var init_SuperConverter_CzqEoFT1_es = __esm(() => {
119133
+ var init_SuperConverter_CjDkqrj8_es = __esm(() => {
118810
119134
  init_rolldown_runtime_Bg48TavK_es();
118811
119135
  init_jszip_C49i9kUs_es();
118812
119136
  init_xml_js_CqGKpaft_es();
@@ -123008,6 +123332,23 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
123008
123332
  intentGroup: "list",
123009
123333
  intentAction: "detach"
123010
123334
  },
123335
+ "lists.delete": {
123336
+ memberPath: "lists.delete",
123337
+ description: 'Delete the entire list that contains the targeted list item. Removes ALL items in the same numbered sequence (the contiguous run of list items sharing the target\'s numbering) AND their text content from the document. Pass any single list item from the list as `target`; the op walks adjacent siblings to find the full list. Use this for "remove the list" / "delete this list" intents and for the cleanup step of a list-to-table conversion.',
123338
+ expectedResult: "Returns a ListsDeleteResult with `deletedCount` (number of items removed). Reports failure (INVALID_TARGET) if the target is not a list item.",
123339
+ requiresDocumentContext: true,
123340
+ metadata: mutationOperation2({
123341
+ idempotency: "conditional",
123342
+ supportsDryRun: true,
123343
+ supportsTrackedMode: false,
123344
+ possibleFailureCodes: ["INVALID_TARGET"],
123345
+ throws: [...T_NOT_FOUND_CAPABLE2, "INVALID_TARGET"]
123346
+ }),
123347
+ referenceDocPath: "lists/delete.mdx",
123348
+ referenceGroup: "lists",
123349
+ intentGroup: "list",
123350
+ intentAction: "delete"
123351
+ },
123011
123352
  "lists.indent": {
123012
123353
  memberPath: "lists.indent",
123013
123354
  description: "Increase the indentation level of a list item.",
@@ -123950,7 +124291,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
123950
124291
  throws: [...T_NOT_FOUND_COMMAND2, "INVALID_TARGET"]
123951
124292
  }),
123952
124293
  referenceDocPath: "tables/delete.mdx",
123953
- referenceGroup: "tables"
124294
+ referenceGroup: "tables",
124295
+ intentGroup: "table",
124296
+ intentAction: "delete"
123954
124297
  },
123955
124298
  "tables.clearContents": {
123956
124299
  memberPath: "tables.clearContents",
@@ -124025,11 +124368,13 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124025
124368
  throws: T_NOT_FOUND_COMMAND2
124026
124369
  }),
124027
124370
  referenceDocPath: "tables/set-layout.mdx",
124028
- referenceGroup: "tables"
124371
+ referenceGroup: "tables",
124372
+ intentGroup: "table",
124373
+ intentAction: "set_layout"
124029
124374
  },
124030
124375
  "tables.insertRow": {
124031
124376
  memberPath: "tables.insertRow",
124032
- description: "Insert a new row into the target table.",
124377
+ description: "Insert a new row into the target table. The new row is cloned from an adjacent row, so it inherits the existing cell shading, borders, alignment, and padding. No follow-up styling call is needed unless the new row should look different from the rest of the table.",
124033
124378
  expectedResult: "Returns a TableMutationResult receipt confirming a row was inserted.",
124034
124379
  requiresDocumentContext: true,
124035
124380
  metadata: mutationOperation2({
@@ -124040,7 +124385,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124040
124385
  throws: [...T_NOT_FOUND_COMMAND2, "INVALID_TARGET"]
124041
124386
  }),
124042
124387
  referenceDocPath: "tables/insert-row.mdx",
124043
- referenceGroup: "tables"
124388
+ referenceGroup: "tables",
124389
+ intentGroup: "table",
124390
+ intentAction: "insert_row"
124044
124391
  },
124045
124392
  "tables.deleteRow": {
124046
124393
  memberPath: "tables.deleteRow",
@@ -124055,7 +124402,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124055
124402
  throws: [...T_NOT_FOUND_COMMAND2, "INVALID_TARGET"]
124056
124403
  }),
124057
124404
  referenceDocPath: "tables/delete-row.mdx",
124058
- referenceGroup: "tables"
124405
+ referenceGroup: "tables",
124406
+ intentGroup: "table",
124407
+ intentAction: "delete_row"
124059
124408
  },
124060
124409
  "tables.setRowHeight": {
124061
124410
  memberPath: "tables.setRowHeight",
@@ -124070,7 +124419,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124070
124419
  throws: T_NOT_FOUND_COMMAND2
124071
124420
  }),
124072
124421
  referenceDocPath: "tables/set-row-height.mdx",
124073
- referenceGroup: "tables"
124422
+ referenceGroup: "tables",
124423
+ intentGroup: "table",
124424
+ intentAction: "set_row"
124074
124425
  },
124075
124426
  "tables.distributeRows": {
124076
124427
  memberPath: "tables.distributeRows",
@@ -124100,11 +124451,13 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124100
124451
  throws: T_NOT_FOUND_COMMAND2
124101
124452
  }),
124102
124453
  referenceDocPath: "tables/set-row-options.mdx",
124103
- referenceGroup: "tables"
124454
+ referenceGroup: "tables",
124455
+ intentGroup: "table",
124456
+ intentAction: "set_row_options"
124104
124457
  },
124105
124458
  "tables.insertColumn": {
124106
124459
  memberPath: "tables.insertColumn",
124107
- description: "Insert a new column into the target table.",
124460
+ description: "Insert a new column into the target table. The new column is cloned from an adjacent column, so it inherits the existing cell shading, borders, alignment, and width. No follow-up styling call is needed unless the new column should look different from the rest of the table.",
124108
124461
  expectedResult: "Returns a TableMutationResult receipt confirming a column was inserted.",
124109
124462
  requiresDocumentContext: true,
124110
124463
  metadata: mutationOperation2({
@@ -124115,7 +124468,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124115
124468
  throws: [...T_NOT_FOUND_COMMAND2, "INVALID_TARGET"]
124116
124469
  }),
124117
124470
  referenceDocPath: "tables/insert-column.mdx",
124118
- referenceGroup: "tables"
124471
+ referenceGroup: "tables",
124472
+ intentGroup: "table",
124473
+ intentAction: "insert_column"
124119
124474
  },
124120
124475
  "tables.deleteColumn": {
124121
124476
  memberPath: "tables.deleteColumn",
@@ -124130,7 +124485,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124130
124485
  throws: [...T_NOT_FOUND_COMMAND2, "INVALID_TARGET"]
124131
124486
  }),
124132
124487
  referenceDocPath: "tables/delete-column.mdx",
124133
- referenceGroup: "tables"
124488
+ referenceGroup: "tables",
124489
+ intentGroup: "table",
124490
+ intentAction: "delete_column"
124134
124491
  },
124135
124492
  "tables.setColumnWidth": {
124136
124493
  memberPath: "tables.setColumnWidth",
@@ -124145,7 +124502,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124145
124502
  throws: T_NOT_FOUND_COMMAND2
124146
124503
  }),
124147
124504
  referenceDocPath: "tables/set-column-width.mdx",
124148
- referenceGroup: "tables"
124505
+ referenceGroup: "tables",
124506
+ intentGroup: "table",
124507
+ intentAction: "set_column"
124149
124508
  },
124150
124509
  "tables.distributeColumns": {
124151
124510
  memberPath: "tables.distributeColumns",
@@ -124205,7 +124564,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124205
124564
  throws: T_NOT_FOUND_COMMAND2
124206
124565
  }),
124207
124566
  referenceDocPath: "tables/merge-cells.mdx",
124208
- referenceGroup: "tables"
124567
+ referenceGroup: "tables",
124568
+ intentGroup: "table",
124569
+ intentAction: "merge_cells"
124209
124570
  },
124210
124571
  "tables.unmergeCells": {
124211
124572
  memberPath: "tables.unmergeCells",
@@ -124220,7 +124581,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124220
124581
  throws: T_NOT_FOUND_COMMAND2
124221
124582
  }),
124222
124583
  referenceDocPath: "tables/unmerge-cells.mdx",
124223
- referenceGroup: "tables"
124584
+ referenceGroup: "tables",
124585
+ intentGroup: "table",
124586
+ intentAction: "unmerge_cells"
124224
124587
  },
124225
124588
  "tables.splitCell": {
124226
124589
  memberPath: "tables.splitCell",
@@ -124239,7 +124602,7 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124239
124602
  },
124240
124603
  "tables.setCellProperties": {
124241
124604
  memberPath: "tables.setCellProperties",
124242
- description: "Set properties on a table cell such as vertical alignment or text direction.",
124605
+ description: 'Set non-text properties on a single table cell: vertical alignment, text wrapping, fit-text, or preferred width. Requires a cell-level target (a tableCell block address with kind, nodeType, nodeId). Does NOT accept a table target with rowIndex/columnIndex. To set the text content of a cell, use action "set_cell_text" instead.',
124243
124606
  expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if cell properties already match.",
124244
124607
  requiresDocumentContext: true,
124245
124608
  metadata: mutationOperation2({
@@ -124250,7 +124613,26 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124250
124613
  throws: T_NOT_FOUND_COMMAND2
124251
124614
  }),
124252
124615
  referenceDocPath: "tables/set-cell-properties.mdx",
124253
- referenceGroup: "tables"
124616
+ referenceGroup: "tables",
124617
+ intentGroup: "table",
124618
+ intentAction: "set_cell"
124619
+ },
124620
+ "tables.setCellText": {
124621
+ memberPath: "tables.setCellText",
124622
+ description: "Replace the text content of a single table cell with plain text (one paragraph). Accepts either a direct cell locator (a tableCell block address with kind, nodeType, nodeId) OR a table target with rowIndex + columnIndex. Cell properties (vertical alignment, shading, borders, colspan/rowspan) are preserved. Use this for filling cells with values, replacing cell text, or populating empty tables. Much simpler than walking paragraphs and runs through superdoc_edit.",
124623
+ expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the cell already contains exactly this text.",
124624
+ requiresDocumentContext: true,
124625
+ metadata: mutationOperation2({
124626
+ idempotency: "idempotent",
124627
+ supportsDryRun: true,
124628
+ supportsTrackedMode: false,
124629
+ possibleFailureCodes: ["INVALID_TARGET", "NO_OP"],
124630
+ throws: T_NOT_FOUND_COMMAND2
124631
+ }),
124632
+ referenceDocPath: "tables/set-cell-text.mdx",
124633
+ referenceGroup: "tables",
124634
+ intentGroup: "table",
124635
+ intentAction: "set_cell_text"
124254
124636
  },
124255
124637
  "tables.sort": {
124256
124638
  memberPath: "tables.sort",
@@ -124385,7 +124767,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124385
124767
  throws: T_NOT_FOUND_COMMAND2
124386
124768
  }),
124387
124769
  referenceDocPath: "tables/set-shading.mdx",
124388
- referenceGroup: "tables"
124770
+ referenceGroup: "tables",
124771
+ intentGroup: "table",
124772
+ intentAction: "set_shading"
124389
124773
  },
124390
124774
  "tables.clearShading": {
124391
124775
  memberPath: "tables.clearShading",
@@ -124464,7 +124848,7 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124464
124848
  },
124465
124849
  "tables.applyStyle": {
124466
124850
  memberPath: "tables.applyStyle",
124467
- description: "Apply a table style and/or style options in one call.",
124851
+ description: 'Toggle conditional-format flags (header row, banded rows/columns, first/last column, last row) on a table. Pass `styleOptions` with the flags you want to set or clear (omitted flags stay unchanged). For "format the first row as a header" use `styleOptions: { headerRow: true }`. Optional `styleId` applies a named table style. Leave it unset unless you have a styleId from `superdoc_get_content` (no need to invent one).',
124468
124852
  expectedResult: "Returns a TableMutationResult receipt; reports NO_OP if the style and all provided options already match.",
124469
124853
  requiresDocumentContext: true,
124470
124854
  metadata: mutationOperation2({
@@ -124479,7 +124863,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124479
124863
  throws: T_NOT_FOUND_COMMAND2
124480
124864
  }),
124481
124865
  referenceDocPath: "tables/apply-style.mdx",
124482
- referenceGroup: "tables"
124866
+ referenceGroup: "tables",
124867
+ intentGroup: "table",
124868
+ intentAction: "set_style_options"
124483
124869
  },
124484
124870
  "tables.setBorders": {
124485
124871
  memberPath: "tables.setBorders",
@@ -124494,7 +124880,9 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124494
124880
  throws: T_NOT_FOUND_COMMAND2
124495
124881
  }),
124496
124882
  referenceDocPath: "tables/set-borders.mdx",
124497
- referenceGroup: "tables"
124883
+ referenceGroup: "tables",
124884
+ intentGroup: "table",
124885
+ intentAction: "set_borders"
124498
124886
  },
124499
124887
  "tables.setTableOptions": {
124500
124888
  memberPath: "tables.setTableOptions",
@@ -124513,6 +124901,23 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
124513
124901
  throws: T_NOT_FOUND_COMMAND2
124514
124902
  }),
124515
124903
  referenceDocPath: "tables/set-table-options.mdx",
124904
+ referenceGroup: "tables",
124905
+ intentGroup: "table",
124906
+ intentAction: "set_options"
124907
+ },
124908
+ "tables.applyPreset": {
124909
+ memberPath: "tables.applyPreset",
124910
+ description: 'Apply a named visual preset to a table. Presets: "grid" (1pt black borders all around), "minimal" (no outer borders, hairline grey row separators + thicker bottom), "striped" (banded rows on, 0.5pt grey borders), "accent" (filled header row + thick accent top/bottom; defaults to dark blue, override with `accentColor`). Composes set_borders + set_style_options + header-row shading in one call. Available via the document API and `superdoc_mutations` (intentionally NOT exposed as a top-level action on `superdoc_table`. Agents should compose explicit set_borders / set_shading / set_style_options calls so they always pick concrete colors that match the document context).',
124911
+ expectedResult: "Returns a TableMutationResult receipt.",
124912
+ requiresDocumentContext: true,
124913
+ metadata: mutationOperation2({
124914
+ idempotency: "idempotent",
124915
+ supportsDryRun: true,
124916
+ supportsTrackedMode: false,
124917
+ possibleFailureCodes: ["INVALID_TARGET"],
124918
+ throws: T_NOT_FOUND_COMMAND2
124919
+ }),
124920
+ referenceDocPath: "tables/apply-preset.mdx",
124516
124921
  referenceGroup: "tables"
124517
124922
  },
124518
124923
  "tables.get": {
@@ -127241,6 +127646,7 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
127241
127646
  projectFromDefinitions2((_id, entry) => entry.description);
127242
127647
  projectFromDefinitions2((_id, entry) => entry.requiresDocumentContext);
127243
127648
  projectFromDefinitions2((_id, entry) => entry.expectedResult);
127649
+ TABLE_COLOR_PATTERN2 = new RegExp(TABLE_COLOR_PATTERN_SOURCE2, "u");
127244
127650
  PARAGRAPH_ALIGNMENTS2 = [
127245
127651
  "left",
127246
127652
  "center",
@@ -129133,6 +129539,7 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
129133
129539
  "planEngine"
129134
129540
  ]);
129135
129541
  objectSchema2({});
129542
+ tableBorderColorPattern2 = TABLE_COLOR_PATTERN_SOURCE2;
129136
129543
  nullableTableBorderSpecSchema2 = { oneOf: [objectSchema2({
129137
129544
  lineStyle: { type: "string" },
129138
129545
  lineWeightPt: {
@@ -129141,7 +129548,7 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
129141
129548
  },
129142
129549
  color: {
129143
129550
  type: "string",
129144
- pattern: "^([0-9A-Fa-f]{6}|auto)$"
129551
+ pattern: tableBorderColorPattern2
129145
129552
  }
129146
129553
  }, [
129147
129554
  "lineStyle",
@@ -130756,7 +131163,19 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
130756
131163
  }, ["success", "paragraph"]), listsFailureSchemaFor2("lists.detach"), objectSchema2({
130757
131164
  success: { const: true },
130758
131165
  paragraph: ref2("ParagraphAddress")
130759
- }, ["success", "paragraph"]), listsFailureSchemaFor2("lists.detach"), objectSchema2({ target: listItemAddressSchema2 }, ["target"]), listsMutateItemResultSchemaFor2("lists.indent"), listsFailureSchemaFor2("lists.indent"), objectSchema2({ target: listItemAddressSchema2 }, ["target"]), listsMutateItemResultSchemaFor2("lists.outdent"), listsFailureSchemaFor2("lists.outdent"), objectSchema2({
131166
+ }, ["success", "paragraph"]), listsFailureSchemaFor2("lists.detach"), objectSchema2({ target: listItemAddressSchema2 }, ["target"]), objectSchema2({
131167
+ success: { const: true },
131168
+ deletedCount: {
131169
+ type: "integer",
131170
+ minimum: 0
131171
+ }
131172
+ }, ["success", "deletedCount"]), listsFailureSchemaFor2("lists.delete"), objectSchema2({
131173
+ success: { const: true },
131174
+ deletedCount: {
131175
+ type: "integer",
131176
+ minimum: 0
131177
+ }
131178
+ }, ["success", "deletedCount"]), listsFailureSchemaFor2("lists.delete"), objectSchema2({ target: listItemAddressSchema2 }, ["target"]), listsMutateItemResultSchemaFor2("lists.indent"), listsFailureSchemaFor2("lists.indent"), objectSchema2({ target: listItemAddressSchema2 }, ["target"]), listsMutateItemResultSchemaFor2("lists.outdent"), listsFailureSchemaFor2("lists.outdent"), objectSchema2({
130760
131179
  target: listItemAddressSchema2,
130761
131180
  direction: { enum: ["withPrevious", "withNext"] }
130762
131181
  }, ["target", "direction"]), objectSchema2({
@@ -131819,13 +132238,51 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
131819
132238
  "fitWindow"
131820
132239
  ] },
131821
132240
  tableDirection: { enum: ["ltr", "rtl"] }
131822
- }) }, rowOperationInputSchema2({
132241
+ }) }, objectSchema2({
132242
+ target: tableRowAddressSchema2,
132243
+ position: { enum: ["above", "below"] },
132244
+ count: {
132245
+ type: "integer",
132246
+ minimum: 1
132247
+ }
132248
+ }, ["target", "position"]), objectSchema2({
132249
+ target: tableAddressSchema2,
132250
+ rowIndex: {
132251
+ type: "integer",
132252
+ minimum: 0
132253
+ },
132254
+ position: { enum: ["above", "below"] },
132255
+ count: {
132256
+ type: "integer",
132257
+ minimum: 1
132258
+ }
132259
+ }, [
132260
+ "target",
132261
+ "rowIndex",
132262
+ "position"
132263
+ ]), objectSchema2({
132264
+ nodeId: { type: "string" },
132265
+ rowIndex: {
132266
+ type: "integer",
132267
+ minimum: 0
132268
+ },
131823
132269
  position: { enum: ["above", "below"] },
131824
132270
  count: {
131825
132271
  type: "integer",
131826
132272
  minimum: 1
131827
132273
  }
131828
- }, ["position"]), rowOperationInputSchema2({}), rowOperationInputSchema2({
132274
+ }, [
132275
+ "nodeId",
132276
+ "rowIndex",
132277
+ "position"
132278
+ ]), { ...objectSchema2({
132279
+ target: tableAddressSchema2,
132280
+ nodeId: { type: "string" },
132281
+ count: {
132282
+ type: "integer",
132283
+ minimum: 1
132284
+ }
132285
+ }, []) }, rowOperationInputSchema2({}), rowOperationInputSchema2({
131829
132286
  heightPt: {
131830
132287
  type: "number",
131831
132288
  exclusiveMinimum: 0
@@ -131845,12 +132302,17 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
131845
132302
  type: "integer",
131846
132303
  minimum: 0
131847
132304
  },
131848
- position: { enum: ["left", "right"] },
132305
+ position: { enum: [
132306
+ "left",
132307
+ "right",
132308
+ "first",
132309
+ "last"
132310
+ ] },
131849
132311
  count: {
131850
132312
  type: "integer",
131851
132313
  minimum: 1
131852
132314
  }
131853
- }, ["columnIndex", "position"]) }, { ...objectSchema2({
132315
+ }, ["position"]) }, { ...objectSchema2({
131854
132316
  target: tableAddressSchema2,
131855
132317
  nodeId: { type: "string" },
131856
132318
  columnIndex: {
@@ -131911,7 +132373,45 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
131911
132373
  ] },
131912
132374
  wrapText: { type: "boolean" },
131913
132375
  fitText: { type: "boolean" }
131914
- }) }, { ...objectSchema2({
132376
+ }) }, objectSchema2({
132377
+ target: tableCellAddressSchema2,
132378
+ text: { type: "string" }
132379
+ }, ["target", "text"]), objectSchema2({
132380
+ nodeId: { type: "string" },
132381
+ text: { type: "string" }
132382
+ }, ["nodeId", "text"]), objectSchema2({
132383
+ target: tableAddressSchema2,
132384
+ rowIndex: {
132385
+ type: "integer",
132386
+ minimum: 0
132387
+ },
132388
+ columnIndex: {
132389
+ type: "integer",
132390
+ minimum: 0
132391
+ },
132392
+ text: { type: "string" }
132393
+ }, [
132394
+ "target",
132395
+ "rowIndex",
132396
+ "columnIndex",
132397
+ "text"
132398
+ ]), objectSchema2({
132399
+ nodeId: { type: "string" },
132400
+ rowIndex: {
132401
+ type: "integer",
132402
+ minimum: 0
132403
+ },
132404
+ columnIndex: {
132405
+ type: "integer",
132406
+ minimum: 0
132407
+ },
132408
+ text: { type: "string" }
132409
+ }, [
132410
+ "nodeId",
132411
+ "rowIndex",
132412
+ "columnIndex",
132413
+ "text"
132414
+ ]), { ...objectSchema2({
131915
132415
  target: tableAddressSchema2,
131916
132416
  nodeId: { type: "string" },
131917
132417
  keys: arraySchema2(objectSchema2({
@@ -131972,7 +132472,7 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
131972
132472
  },
131973
132473
  color: {
131974
132474
  type: "string",
131975
- pattern: "^([0-9A-Fa-f]{6}|auto)$"
132475
+ pattern: tableBorderColorPattern2
131976
132476
  }
131977
132477
  }, [
131978
132478
  "edge",
@@ -132005,10 +132505,10 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
132005
132505
  }, ["preset"]) }, { ...objectSchema2({
132006
132506
  target: tableOrCellAddressSchema2,
132007
132507
  nodeId: { type: "string" },
132008
- color: {
132508
+ color: { oneOf: [{
132009
132509
  type: "string",
132010
- pattern: "^([0-9A-Fa-f]{6}|auto)$"
132011
- }
132510
+ pattern: tableBorderColorPattern2
132511
+ }, { type: "null" }] }
132012
132512
  }, ["color"]) }, { ...objectSchema2({
132013
132513
  target: tableAddressSchema2,
132014
132514
  nodeId: { type: "string" },
@@ -132139,7 +132639,20 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
132139
132639
  type: "number",
132140
132640
  minimum: 0
132141
132641
  }, { type: "null" }] }
132142
- }) }, objectSchema2({
132642
+ }) }, { ...objectSchema2({
132643
+ target: tableAddressSchema2,
132644
+ nodeId: { type: "string" },
132645
+ preset: { enum: [
132646
+ "grid",
132647
+ "minimal",
132648
+ "striped",
132649
+ "accent"
132650
+ ] },
132651
+ accentColor: {
132652
+ type: "string",
132653
+ pattern: tableBorderColorPattern2
132654
+ }
132655
+ }, ["preset"]) }, objectSchema2({
132143
132656
  nodeId: { type: "string" },
132144
132657
  address: tableAddressSchema2,
132145
132658
  rows: {
@@ -133685,7 +134198,6 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
133685
134198
  "bandedRows",
133686
134199
  "bandedColumns"
133687
134200
  ]);
133688
- TABLE_BORDER_COLOR_PATTERN2 = /^([0-9A-Fa-f]{6}|auto)$/u;
133689
134201
  VALID_APPLY_TO_VALUES2 = new Set([
133690
134202
  "all",
133691
134203
  "outside",
@@ -156478,7 +156990,7 @@ var init_SuperConverter_CzqEoFT1_es = __esm(() => {
156478
156990
  };
156479
156991
  });
156480
156992
 
156481
- // ../../packages/superdoc/dist/chunks/create-headless-toolbar-Cv2MmPXX.es.js
156993
+ // ../../packages/superdoc/dist/chunks/create-headless-toolbar-pGestihw.es.js
156482
156994
  function parseSizeUnit(val = "0") {
156483
156995
  const length3 = val.toString() || "0";
156484
156996
  const value = Number.parseFloat(length3);
@@ -159145,8 +159657,8 @@ var CSS_DIMENSION_REGEX, DOM_SIZE_UNITS, Extension = class Extension2 {
159145
159657
  }
159146
159658
  };
159147
159659
  };
159148
- var init_create_headless_toolbar_Cv2MmPXX_es = __esm(() => {
159149
- init_SuperConverter_CzqEoFT1_es();
159660
+ var init_create_headless_toolbar_pGestihw_es = __esm(() => {
159661
+ init_SuperConverter_CjDkqrj8_es();
159150
159662
  init_constants_DrU4EASo_es();
159151
159663
  init_dist_B8HfvhaK_es();
159152
159664
  CSS_DIMENSION_REGEX = /[\d-.]+(\w+)$/;
@@ -207843,7 +208355,7 @@ var init_remark_gfm_eZN6yzWQ_es = __esm(() => {
207843
208355
  init_remark_gfm_BhnWr3yf_es();
207844
208356
  });
207845
208357
 
207846
- // ../../packages/superdoc/dist/chunks/src-BBPU9hdN.es.js
208358
+ // ../../packages/superdoc/dist/chunks/src-tOywM1hR.es.js
207847
208359
  function deleteProps(obj, propOrProps) {
207848
208360
  const props = typeof propOrProps === "string" ? [propOrProps] : propOrProps;
207849
208361
  const removeNested = (target, pathParts, index2 = 0) => {
@@ -233639,6 +234151,37 @@ function listsDetachWrapper(editor, input2, options) {
233639
234151
  }
233640
234152
  };
233641
234153
  }
234154
+ function listsDeleteWrapper(editor, input2, options) {
234155
+ rejectTrackedMode("lists.delete", options);
234156
+ const sequence = getContiguousSequence(editor, resolveListItem(editor, input2.target));
234157
+ if (sequence.length === 0)
234158
+ return toListsFailure$1("INVALID_TARGET", "List sequence could not be resolved.", { target: input2.target });
234159
+ if (options?.dryRun)
234160
+ return {
234161
+ success: true,
234162
+ deletedCount: sequence.length
234163
+ };
234164
+ if (executeDomainCommand(editor, () => {
234165
+ const { tr } = editor.state;
234166
+ const sortedDesc = [...sequence].sort((a2, b$1) => b$1.candidate.pos - a2.candidate.pos);
234167
+ for (const item of sortedDesc) {
234168
+ const start$1 = item.candidate.pos;
234169
+ const end$1 = start$1 + item.candidate.node.nodeSize;
234170
+ const mappedStart = tr.mapping.map(start$1, -1);
234171
+ const mappedEnd = tr.mapping.map(end$1, 1);
234172
+ if (mappedEnd > mappedStart)
234173
+ tr.delete(mappedStart, mappedEnd);
234174
+ }
234175
+ dispatchEditorTransaction$2(editor, tr);
234176
+ clearIndexCache(editor);
234177
+ return true;
234178
+ }, { expectedRevision: options?.expectedRevision }).steps[0]?.effect !== "changed")
234179
+ return toListsFailure$1("INVALID_TARGET", "List deletion could not be applied.", { target: input2.target });
234180
+ return {
234181
+ success: true,
234182
+ deletedCount: sequence.length
234183
+ };
234184
+ }
233642
234185
  function listsJoinWrapper(editor, input2, options) {
233643
234186
  rejectTrackedMode("lists.join", options);
233644
234187
  const target = resolveListItem(editor, input2.target);
@@ -235761,6 +236304,13 @@ function normalizeCellAttrsForSingleCell(attrs) {
235761
236304
  tableCellProperties
235762
236305
  };
235763
236306
  }
236307
+ function stripMergeMetadataFromTableCellProperties(attrs) {
236308
+ const { gridSpan: _g, vMerge: _v, ...cleanedTcp } = attrs.tableCellProperties ?? {};
236309
+ return {
236310
+ ...attrs,
236311
+ tableCellProperties: cleanedTcp
236312
+ };
236313
+ }
235764
236314
  function normalizeClonedRowInsertCellAttrs(sourceAttrs, fromHeaderToBody) {
235765
236315
  const normalizedAttrs = {
235766
236316
  ...sourceAttrs,
@@ -235770,6 +236320,16 @@ function normalizeClonedRowInsertCellAttrs(sourceAttrs, fromHeaderToBody) {
235770
236320
  delete normalizedAttrs.borders;
235771
236321
  return normalizedAttrs;
235772
236322
  }
236323
+ function normalizeClonedColumnInsertCellAttrs(sourceAttrs) {
236324
+ const normalizedAttrs = {
236325
+ ...stripMergeMetadataFromTableCellProperties(sourceAttrs),
236326
+ colspan: 1,
236327
+ rowspan: 1
236328
+ };
236329
+ if (Array.isArray(normalizedAttrs.colwidth))
236330
+ delete normalizedAttrs.colwidth;
236331
+ return normalizedAttrs;
236332
+ }
235773
236333
  function expandMergedCellIntoSingles({ tr, tablePos, tableNode, cellPos, cellNode, rowIndex, columnIndex, rowspan, colspan, schema }) {
235774
236334
  const tableStart = tablePos + 1;
235775
236335
  const map$12 = TableMap.get(tableNode);
@@ -235909,6 +236469,66 @@ function applyTableBorderPresetToCellBorders(tr, tablePos, tableNode, preset) {
235909
236469
  });
235910
236470
  }
235911
236471
  }
236472
+ function buildPresetSpec(preset, accentColorInput) {
236473
+ if (preset === "accent") {
236474
+ const accentColor = normalizeColorInput(accentColorInput ?? "1F3864");
236475
+ return {
236476
+ borders: {
236477
+ top: {
236478
+ lineStyle: "single",
236479
+ lineWeightPt: 2,
236480
+ color: accentColor
236481
+ },
236482
+ bottom: {
236483
+ lineStyle: "single",
236484
+ lineWeightPt: 2,
236485
+ color: accentColor
236486
+ },
236487
+ left: null,
236488
+ right: null,
236489
+ insideV: null,
236490
+ insideH: {
236491
+ lineStyle: "single",
236492
+ lineWeightPt: 0.5,
236493
+ color: PRESET_GREY
236494
+ }
236495
+ },
236496
+ styleOptions: { headerRow: true },
236497
+ headerRowFill: accentColor
236498
+ };
236499
+ }
236500
+ return STATIC_PRESETS[preset] ?? null;
236501
+ }
236502
+ function applyShadingToCells(tr, tableNode, tableStart, fill, cellPositions) {
236503
+ const map$12 = TableMap.get(tableNode);
236504
+ const positions = cellPositions ?? map$12.map;
236505
+ const seen = /* @__PURE__ */ new Set;
236506
+ const mapFrom = tr.mapping.maps.length;
236507
+ for (const relPos of positions) {
236508
+ if (seen.has(relPos))
236509
+ continue;
236510
+ seen.add(relPos);
236511
+ const cellNode = tableNode.nodeAt(relPos);
236512
+ if (!cellNode)
236513
+ continue;
236514
+ const cellAttrs = cellNode.attrs;
236515
+ const cellProps = { ...cellAttrs.tableCellProperties ?? {} };
236516
+ cellProps.shading = {
236517
+ fill,
236518
+ val: "clear",
236519
+ color: "auto"
236520
+ };
236521
+ const nextCellAttrs = {
236522
+ ...cellAttrs,
236523
+ tableCellProperties: cellProps
236524
+ };
236525
+ if (fill === "auto")
236526
+ delete nextCellAttrs.background;
236527
+ else
236528
+ nextCellAttrs.background = { color: fill };
236529
+ tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(tableStart + relPos), null, nextCellAttrs);
236530
+ }
236531
+ }
235912
236532
  function removeColSpan2(attrs, pos, n = 1) {
235913
236533
  const result = {
235914
236534
  ...attrs,
@@ -235958,6 +236578,7 @@ function addColumnToTable(tr, tablePos, col) {
235958
236578
  const map$12 = TableMap.get(tableNode);
235959
236579
  const tableStart = tablePos + 1;
235960
236580
  const mapStart = tr.mapping.maps.length;
236581
+ const sourceCol = col > 0 ? col - 1 : map$12.width > 0 ? 0 : -1;
235961
236582
  for (let row2 = 0;row2 < map$12.height; row2++) {
235962
236583
  const index2 = row2 * map$12.width + col;
235963
236584
  if (col > 0 && col < map$12.width && map$12.map[index2 - 1] === map$12.map[index2]) {
@@ -235971,8 +236592,21 @@ function addColumnToTable(tr, tablePos, col) {
235971
236592
  const refType = resolveInsertedColumnCellType(tableNode, map$12, index2, col);
235972
236593
  if (!refType)
235973
236594
  continue;
236595
+ let clonedAttrs = null;
236596
+ if (sourceCol >= 0) {
236597
+ const sourceIdx = row2 * map$12.width + sourceCol;
236598
+ const sourcePos = map$12.map[sourceIdx];
236599
+ if (sourcePos != null) {
236600
+ const sourceCell = tableNode.nodeAt(sourcePos);
236601
+ if (sourceCell)
236602
+ clonedAttrs = normalizeClonedColumnInsertCellAttrs(sourceCell.attrs);
236603
+ }
236604
+ }
235974
236605
  const cellPos = map$12.positionAt(row2, col, tableNode);
235975
- tr.insert(tr.mapping.slice(mapStart).map(tableStart + cellPos), refType.createAndFill());
236606
+ const newCell = refType.createAndFill(clonedAttrs ?? undefined);
236607
+ if (!newCell)
236608
+ continue;
236609
+ tr.insert(tr.mapping.slice(mapStart).map(tableStart + cellPos), newCell);
235976
236610
  }
235977
236611
  }
235978
236612
  }
@@ -236346,20 +236980,32 @@ function tablesInsertRowAdapter(editor, input2, options) {
236346
236980
  const mode = options?.changeMode ?? "direct";
236347
236981
  if (mode === "tracked")
236348
236982
  ensureTrackedCapability(editor, { operation: "tables.insertRow" });
236349
- const { table: table2, rowIndex } = resolveRowLocator(editor, input2, "tables.insertRow");
236983
+ let normalizedInput = input2;
236984
+ const inputAny = input2;
236985
+ if (inputAny.rowIndex == null && inputAny.position == null) {
236986
+ const lastIndex = resolveTableLocator(editor, input2, "tables.insertRow").candidate.node.childCount - 1;
236987
+ normalizedInput = {
236988
+ ...input2,
236989
+ rowIndex: lastIndex,
236990
+ position: "below"
236991
+ };
236992
+ }
236993
+ const { table: table2, rowIndex } = resolveRowLocator(editor, normalizedInput, "tables.insertRow");
236350
236994
  if (options?.dryRun)
236351
236995
  return buildTableSuccess(table2.address);
236352
236996
  try {
236353
236997
  const tr = editor.state.tr;
236354
236998
  const tablePos = table2.candidate.pos;
236355
- const count2 = input2.count ?? 1;
236999
+ const normalizedAny = normalizedInput;
237000
+ const count2 = normalizedAny.count ?? 1;
237001
+ const position4 = normalizedAny.position ?? "below";
236356
237002
  const schema = editor.state.schema;
236357
237003
  for (let i4 = 0;i4 < count2; i4++) {
236358
237004
  const currentTableNode = tr.doc.nodeAt(tablePos);
236359
237005
  if (!currentTableNode || currentTableNode.type.name !== "table")
236360
237006
  break;
236361
- const insertIdx = input2.position === "above" ? rowIndex + i4 : rowIndex + 1 + i4;
236362
- const sourceIdx = input2.position === "above" ? rowIndex + i4 : rowIndex;
237007
+ const insertIdx = position4 === "above" ? rowIndex + i4 : rowIndex + 1 + i4;
237008
+ const sourceIdx = position4 === "above" ? rowIndex + i4 : rowIndex;
236363
237009
  if (!insertRowInTable(tr, tablePos, Math.min(sourceIdx, currentTableNode.childCount - 1), Math.min(insertIdx, currentTableNode.childCount), schema))
236364
237010
  return toTableFailure("INVALID_TARGET", "Row insertion could not be applied.");
236365
237011
  }
@@ -236548,16 +237194,30 @@ function tablesInsertColumnAdapter(editor, input2, options) {
236548
237194
  const mode = options?.changeMode ?? "direct";
236549
237195
  if (mode === "tracked")
236550
237196
  ensureTrackedCapability(editor, { operation: "tables.insertColumn" });
236551
- const { table: table2, columnIndex } = resolveColumnLocator(editor, input2, "tables.insertColumn");
237197
+ let normalizedInput = input2;
237198
+ const inputAny = input2;
237199
+ if (inputAny.position === "first" || inputAny.position === "last" || (inputAny.position === "left" || inputAny.position === "right") && inputAny.columnIndex == null) {
237200
+ const tableResolved = resolveTableLocator(editor, input2, "tables.insertColumn");
237201
+ const lastColumnIndex = Math.max(0, getTableColumnCount(tableResolved.candidate.node) - 1);
237202
+ const insertAtStart = inputAny.position === "first" || inputAny.position === "left";
237203
+ normalizedInput = {
237204
+ ...input2,
237205
+ columnIndex: insertAtStart ? 0 : lastColumnIndex,
237206
+ position: insertAtStart ? "left" : "right"
237207
+ };
237208
+ }
237209
+ const { table: table2, columnIndex } = resolveColumnLocator(editor, normalizedInput, "tables.insertColumn");
236552
237210
  if (options?.dryRun)
236553
237211
  return buildTableSuccess(table2.address);
236554
237212
  try {
236555
237213
  const tr = editor.state.tr;
236556
237214
  const tablePos = table2.candidate.pos;
236557
- const count2 = input2.count ?? 1;
237215
+ const normalizedAny = normalizedInput;
237216
+ const count2 = normalizedAny.count ?? 1;
237217
+ const position4 = normalizedAny.position ?? "right";
236558
237218
  let updatedGrid = table2.candidate.node.attrs.grid;
236559
237219
  for (let c = 0;c < count2; c++) {
236560
- const insertCol = input2.position === "left" ? columnIndex + c : columnIndex + 1 + c;
237220
+ const insertCol = position4 === "left" ? columnIndex + c : columnIndex + 1 + c;
236561
237221
  addColumnToTable(tr, tablePos, insertCol);
236562
237222
  updatedGrid = insertGridColumnWidth(updatedGrid, insertCol) ?? updatedGrid;
236563
237223
  }
@@ -237164,32 +237824,28 @@ function tablesMergeCellsAdapter(editor, input2, options) {
237164
237824
  return toTableFailure("INVALID_TARGET", "Cell merge could not be applied.");
237165
237825
  }
237166
237826
  }
237167
- function hasDefinedUnmergeCoordinates(input2) {
237168
- const inputRecord = input2;
237169
- return inputRecord.rowIndex != null && inputRecord.columnIndex != null;
237170
- }
237171
- function resolveUnmergeInput(editor, input2) {
237172
- if (!hasDefinedUnmergeCoordinates(input2))
237173
- return resolveCellLocator(editor, input2, "tables.unmergeCells");
237827
+ function resolveCellOrTableScopedInput(editor, input2, operationName) {
237828
+ if (!(input2.rowIndex != null && input2.columnIndex != null))
237829
+ return resolveCellLocator(editor, input2, operationName);
237174
237830
  const target = input2.target;
237175
237831
  if (target && typeof target === "object" && !Array.isArray(target)) {
237176
237832
  const blockTarget = target;
237177
237833
  if (blockTarget.kind === "block" && blockTarget.nodeType === "table")
237178
- return resolveTableScopedCellLocator(editor, input2, "tables.unmergeCells");
237179
- return resolveCellLocator(editor, { target }, "tables.unmergeCells");
237834
+ return resolveTableScopedCellLocator(editor, input2, operationName);
237835
+ return resolveCellLocator(editor, { target }, operationName);
237180
237836
  }
237181
237837
  const nodeId = input2.nodeId;
237182
237838
  if (typeof nodeId === "string") {
237183
237839
  const candidate = findBlockByNodeIdOnly(getBlockIndex(editor), nodeId);
237184
237840
  if (!candidate)
237185
- throw new DocumentApiAdapterError("TARGET_NOT_FOUND", "tables.unmergeCells: target was not found.", { target: nodeId });
237186
- return candidate.nodeType === "table" ? resolveTableScopedCellLocator(editor, input2, "tables.unmergeCells") : resolveCellLocator(editor, { nodeId }, "tables.unmergeCells");
237841
+ throw new DocumentApiAdapterError("TARGET_NOT_FOUND", `${operationName}: target was not found.`, { target: nodeId });
237842
+ return candidate.nodeType === "table" ? resolveTableScopedCellLocator(editor, input2, operationName) : resolveCellLocator(editor, { nodeId }, operationName);
237187
237843
  }
237188
- return resolveCellLocator(editor, {}, "tables.unmergeCells");
237844
+ return resolveCellLocator(editor, {}, operationName);
237189
237845
  }
237190
237846
  function tablesUnmergeCellsAdapter(editor, input2, options) {
237191
237847
  rejectTrackedMode("tables.unmergeCells", options);
237192
- const { table: table2, cellPos, cellNode, rowIndex, columnIndex } = resolveUnmergeInput(editor, input2);
237848
+ const { table: table2, cellPos, cellNode, rowIndex, columnIndex } = resolveCellOrTableScopedInput(editor, input2, "tables.unmergeCells");
237193
237849
  const attrs = cellNode.attrs;
237194
237850
  const colspan = attrs.colspan || 1;
237195
237851
  const rowspan = attrs.rowspan || 1;
@@ -237355,6 +238011,65 @@ function tablesSetCellPropertiesAdapter(editor, input2, options) {
237355
238011
  return toTableFailure("INVALID_TARGET", "Cell properties update could not be applied.");
237356
238012
  }
237357
238013
  }
238014
+ function buildSetCellTextParagraph(schema, text5) {
238015
+ const paragraphType = schema.nodes.paragraph;
238016
+ if (!paragraphType)
238017
+ return null;
238018
+ return text5.length === 0 ? paragraphType.createAndFill() : paragraphType.createAndFill(null, schema.text(text5));
238019
+ }
238020
+ function cellContentEqualsIgnoringIdentity(a2, b$1) {
238021
+ if (a2.type !== b$1.type)
238022
+ return false;
238023
+ if (a2.text !== b$1.text)
238024
+ return false;
238025
+ if (a2.marks.length !== b$1.marks.length)
238026
+ return false;
238027
+ for (let i4 = 0;i4 < a2.marks.length; i4++)
238028
+ if (!a2.marks[i4].eq(b$1.marks[i4]))
238029
+ return false;
238030
+ const aAttrs = a2.attrs;
238031
+ const bAttrs = b$1.attrs;
238032
+ const keys$1 = new Set([...Object.keys(aAttrs), ...Object.keys(bAttrs)]);
238033
+ for (const key2 of keys$1) {
238034
+ if (IDENTITY_BLOCK_ATTRS.has(key2))
238035
+ continue;
238036
+ if (JSON.stringify(aAttrs[key2]) !== JSON.stringify(bAttrs[key2]))
238037
+ return false;
238038
+ }
238039
+ if (a2.childCount !== b$1.childCount)
238040
+ return false;
238041
+ for (let i4 = 0;i4 < a2.childCount; i4++)
238042
+ if (!cellContentEqualsIgnoringIdentity(a2.child(i4), b$1.child(i4)))
238043
+ return false;
238044
+ return true;
238045
+ }
238046
+ function tablesSetCellTextAdapter(editor, input2, options) {
238047
+ rejectTrackedMode("tables.setCellText", options);
238048
+ const { table: table2, cellPos, cellNode } = resolveCellOrTableScopedInput(editor, input2, "tables.setCellText");
238049
+ const candidateParagraph = buildSetCellTextParagraph(editor.state.schema, input2.text);
238050
+ if (!candidateParagraph)
238051
+ return toTableFailure("INVALID_TARGET", "tables.setCellText: paragraph node type is unavailable.");
238052
+ try {
238053
+ const tr = editor.state.tr;
238054
+ const cellStart = cellPos + 1;
238055
+ const cellEnd = cellStart + cellNode.content.size;
238056
+ tr.replaceWith(cellStart, cellEnd, candidateParagraph);
238057
+ const stateApply = editor.state.apply;
238058
+ if (typeof stateApply === "function") {
238059
+ const projectedCell = stateApply.call(editor.state, tr).doc.nodeAt(cellPos);
238060
+ if (projectedCell && cellContentEqualsIgnoringIdentity(cellNode, projectedCell))
238061
+ return toTableFailure("NO_OP", "tables.setCellText: cell already contains this text.");
238062
+ }
238063
+ if (options?.dryRun)
238064
+ return buildTableSuccess(table2.address);
238065
+ applyDirectMutationMeta(tr);
238066
+ editor.dispatch(tr);
238067
+ clearIndexCache(editor);
238068
+ return buildTableSuccess(resolvePostMutationTableAddress(editor, table2.candidate.pos, table2.address.nodeId, tr));
238069
+ } catch {
238070
+ return toTableFailure("INVALID_TARGET", "Cell text update could not be applied.");
238071
+ }
238072
+ }
237358
238073
  function tablesSortAdapter(editor, input2, options) {
237359
238074
  rejectTrackedMode("tables.sort", options);
237360
238075
  const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.sort");
@@ -237547,7 +238262,7 @@ function tablesSetBorderAdapter(editor, input2, options) {
237547
238262
  currentBorders[input2.edge] = {
237548
238263
  val: input2.lineStyle,
237549
238264
  size: Math.round(input2.lineWeightPt * 8),
237550
- color: input2.color
238265
+ color: normalizeColorInput(input2.color)
237551
238266
  };
237552
238267
  currentProps.borders = currentBorders;
237553
238268
  const syncAttrs = resolved.scope === "table" ? syncExtractedTableAttrs(currentProps) : {};
@@ -237680,19 +238395,27 @@ function tablesApplyBorderPresetAdapter(editor, input2, options) {
237680
238395
  }
237681
238396
  }
237682
238397
  function tablesSetShadingAdapter(editor, input2, options) {
238398
+ if (input2.color === null)
238399
+ return tablesClearShadingAdapter(editor, {
238400
+ target: input2.target,
238401
+ nodeId: input2.nodeId
238402
+ }, options);
238403
+ if (typeof input2.color !== "string")
238404
+ return toTableFailure("INVALID_INPUT", 'tables.setShading: color is required (hex string, "auto", or null to clear).');
237683
238405
  rejectTrackedMode("tables.setShading", options);
237684
238406
  const resolved = resolveTableOrCellTarget(editor, input2, "tables.setShading");
237685
238407
  if (resolved.scope === "invalid")
237686
238408
  return toTableFailure("INVALID_TARGET", "tables.setShading: target must be a table or tableCell.");
237687
238409
  if (options?.dryRun)
237688
238410
  return buildTableSuccess(resolved.address);
238411
+ const normalizedColor = normalizeColorInput(input2.color);
237689
238412
  try {
237690
238413
  const tr = editor.state.tr;
237691
238414
  const currentAttrs = resolved.node.attrs;
237692
238415
  const propsKey = resolved.scope === "table" ? "tableProperties" : "tableCellProperties";
237693
238416
  const currentProps = { ...currentAttrs[propsKey] ?? {} };
237694
238417
  currentProps.shading = {
237695
- fill: input2.color,
238418
+ fill: normalizedColor,
237696
238419
  val: "clear",
237697
238420
  color: "auto"
237698
238421
  };
@@ -237702,38 +238425,8 @@ function tablesSetShadingAdapter(editor, input2, options) {
237702
238425
  [propsKey]: currentProps,
237703
238426
  ...syncAttrs
237704
238427
  });
237705
- if (resolved.scope === "table") {
237706
- const tableNode = resolved.node;
237707
- const tableStart = resolved.pos + 1;
237708
- const map$12 = TableMap.get(tableNode);
237709
- const seen = /* @__PURE__ */ new Set;
237710
- const mapFrom = tr.mapping.maps.length;
237711
- for (let i4 = 0;i4 < map$12.map.length; i4++) {
237712
- const relPos = map$12.map[i4];
237713
- if (seen.has(relPos))
237714
- continue;
237715
- seen.add(relPos);
237716
- const cellNode = tableNode.nodeAt(relPos);
237717
- if (!cellNode)
237718
- continue;
237719
- const cellAttrs = cellNode.attrs;
237720
- const cellProps = { ...cellAttrs.tableCellProperties ?? {} };
237721
- cellProps.shading = {
237722
- fill: input2.color,
237723
- val: "clear",
237724
- color: "auto"
237725
- };
237726
- const nextCellAttrs = {
237727
- ...cellAttrs,
237728
- tableCellProperties: cellProps
237729
- };
237730
- if (input2.color === "auto")
237731
- delete nextCellAttrs.background;
237732
- else
237733
- nextCellAttrs.background = { color: input2.color };
237734
- tr.setNodeMarkup(tr.mapping.slice(mapFrom).map(tableStart + relPos), null, nextCellAttrs);
237735
- }
237736
- }
238428
+ if (resolved.scope === "table")
238429
+ applyShadingToCells(tr, resolved.node, resolved.pos + 1, normalizedColor);
237737
238430
  applyDirectMutationMeta(tr);
237738
238431
  editor.dispatch(tr);
237739
238432
  clearIndexCache(editor);
@@ -237959,11 +238652,17 @@ function writeTableLook(currentLook, patch3) {
237959
238652
  delete result.val;
237960
238653
  return result;
237961
238654
  }
238655
+ function normalizeColorInput(color2) {
238656
+ if (color2 === "auto")
238657
+ return "auto";
238658
+ const stripped = color2.startsWith("#") ? color2.slice(1) : color2;
238659
+ return (stripped.length === 3 ? stripped[0] + stripped[0] + stripped[1] + stripped[1] + stripped[2] + stripped[2] : stripped).toUpperCase();
238660
+ }
237962
238661
  function normalizeBorderSpecFromApi(spec) {
237963
238662
  return {
237964
238663
  val: spec.lineStyle,
237965
238664
  size: Math.round(spec.lineWeightPt * 8),
237966
- color: spec.color
238665
+ color: normalizeColorInput(spec.color)
237967
238666
  };
237968
238667
  }
237969
238668
  function normalizeBorderSpecToApi(border) {
@@ -238244,6 +238943,57 @@ function tablesSetTableOptionsAdapter(editor, input2, options) {
238244
238943
  return toTableFailure("INVALID_TARGET", "Table options could not be applied.");
238245
238944
  }
238246
238945
  }
238946
+ function tablesApplyPresetAdapter(editor, input2, options) {
238947
+ rejectTrackedMode("tables.applyPreset", options);
238948
+ const { candidate, address: address2 } = resolveTableLocator(editor, input2, "tables.applyPreset");
238949
+ if (options?.dryRun)
238950
+ return buildTableSuccess(address2);
238951
+ const spec = buildPresetSpec(input2.preset, input2.accentColor);
238952
+ if (!spec)
238953
+ return toTableFailure("INVALID_TARGET", `tables.applyPreset: unknown preset "${input2.preset}".`);
238954
+ try {
238955
+ const tr = editor.state.tr;
238956
+ const tableNode = candidate.node;
238957
+ const tablePos = candidate.pos;
238958
+ const currentAttrs = tableNode.attrs;
238959
+ const currentTableProps = { ...currentAttrs.tableProperties ?? {} };
238960
+ currentTableProps.borders = buildOoxmlBorderPatch(currentTableProps.borders ?? {}, spec.borders);
238961
+ if (Object.keys(spec.styleOptions).length > 0) {
238962
+ const updatedLook = { ...currentTableProps.tblLook ?? { ...WORD_DEFAULT_TBL_LOOK } };
238963
+ for (const [flag, value] of Object.entries(spec.styleOptions)) {
238964
+ if (value === undefined)
238965
+ continue;
238966
+ const ooxmlKey = resolveStyleOptionFlag(flag);
238967
+ updatedLook[ooxmlKey] = INVERTED_FLAGS.has(flag) ? !value : value;
238968
+ }
238969
+ currentTableProps.tblLook = updatedLook;
238970
+ }
238971
+ tr.setNodeMarkup(tablePos, null, {
238972
+ ...currentAttrs,
238973
+ tableProperties: currentTableProps,
238974
+ ...syncExtractedTableAttrs(currentTableProps)
238975
+ });
238976
+ const patchEntries = Object.entries(spec.borders);
238977
+ for (const [edge, value] of patchEntries) {
238978
+ if (value === undefined)
238979
+ continue;
238980
+ if (!isBoundaryEdge(edge))
238981
+ continue;
238982
+ applyTableEdgeToCellBorders(tr, tablePos, tableNode, edge, value === null ? { ...CLEARED_BORDER_OOXML } : normalizeBorderSpecFromApi(value));
238983
+ }
238984
+ if (spec.headerRowFill && tableNode.childCount > 0) {
238985
+ const map$12 = TableMap.get(tableNode);
238986
+ const headerCellPositions = map$12.map.slice(0, map$12.width);
238987
+ applyShadingToCells(tr, tableNode, tablePos + 1, spec.headerRowFill, headerCellPositions);
238988
+ }
238989
+ applyDirectMutationMeta(tr);
238990
+ editor.dispatch(tr);
238991
+ clearIndexCache(editor);
238992
+ return buildTableSuccess(resolvePostMutationTableAddress(editor, tablePos, address2.nodeId, tr));
238993
+ } catch {
238994
+ return toTableFailure("INVALID_TARGET", "Table preset could not be applied.");
238995
+ }
238996
+ }
238247
238997
  function resolveCreatedTable(editor, tableId) {
238248
238998
  const index2 = getBlockIndex(editor);
238249
238999
  const resolved = index2.byId.get(`table:${tableId}`);
@@ -239496,6 +240246,9 @@ function tablesSplitCellWrapper(editor, input2, options) {
239496
240246
  function tablesSetCellPropertiesWrapper(editor, input2, options) {
239497
240247
  return executeTableCommand(editor, "tables.setCellProperties", tablesSetCellPropertiesAdapter, input2, options);
239498
240248
  }
240249
+ function tablesSetCellTextWrapper(editor, input2, options) {
240250
+ return executeTableCommand(editor, "tables.setCellText", tablesSetCellTextAdapter, input2, options);
240251
+ }
239499
240252
  function tablesSortWrapper(editor, input2, options) {
239500
240253
  return executeTableCommand(editor, "tables.sort", tablesSortAdapter, input2, options);
239501
240254
  }
@@ -239547,6 +240300,9 @@ function tablesSetBordersWrapper(editor, input2, options) {
239547
240300
  function tablesSetTableOptionsWrapper(editor, input2, options) {
239548
240301
  return executeTableCommand(editor, "tables.setTableOptions", tablesSetTableOptionsAdapter, input2, options);
239549
240302
  }
240303
+ function tablesApplyPresetWrapper(editor, input2, options) {
240304
+ return executeTableCommand(editor, "tables.applyPreset", tablesApplyPresetAdapter, input2, options);
240305
+ }
239550
240306
  function getRootPresentationHistoryOwner(editor) {
239551
240307
  const withPresentation = editor;
239552
240308
  const presentationEditor = withPresentation.presentationEditor ?? withPresentation._presentationEditor ?? null;
@@ -248327,6 +249083,7 @@ function assembleDocumentApiAdapters(editor) {
248327
249083
  create: (input2, options) => listsCreateWrapper(editor, input2, options),
248328
249084
  attach: (input2, options) => listsAttachWrapper(editor, input2, options),
248329
249085
  detach: (input2, options) => listsDetachWrapper(editor, input2, options),
249086
+ delete: (input2, options) => listsDeleteWrapper(editor, input2, options),
248330
249087
  indent: (input2, options) => listsIndentWrapper(editor, input2, options),
248331
249088
  outdent: (input2, options) => listsOutdentWrapper(editor, input2, options),
248332
249089
  join: (input2, options) => listsJoinWrapper(editor, input2, options),
@@ -248403,6 +249160,7 @@ function assembleDocumentApiAdapters(editor) {
248403
249160
  unmergeCells: (input2, options) => tablesUnmergeCellsWrapper(editor, input2, options),
248404
249161
  splitCell: (input2, options) => tablesSplitCellWrapper(editor, input2, options),
248405
249162
  setCellProperties: (input2, options) => tablesSetCellPropertiesWrapper(editor, input2, options),
249163
+ setCellText: (input2, options) => tablesSetCellTextWrapper(editor, input2, options),
248406
249164
  sort: (input2, options) => tablesSortWrapper(editor, input2, options),
248407
249165
  setAltText: (input2, options) => tablesSetAltTextWrapper(editor, input2, options),
248408
249166
  setStyle: (input2, options) => tablesSetStyleWrapper(editor, input2, options),
@@ -248420,6 +249178,7 @@ function assembleDocumentApiAdapters(editor) {
248420
249178
  applyStyle: (input2, options) => tablesApplyStyleWrapper(editor, input2, options),
248421
249179
  setBorders: (input2, options) => tablesSetBordersWrapper(editor, input2, options),
248422
249180
  setTableOptions: (input2, options) => tablesSetTableOptionsWrapper(editor, input2, options),
249181
+ applyPreset: (input2, options) => tablesApplyPresetWrapper(editor, input2, options),
248423
249182
  get: (input2) => tablesGetAdapter(editor, input2),
248424
249183
  getCells: (input2) => tablesGetCellsAdapter(editor, input2),
248425
249184
  getProperties: (input2) => tablesGetPropertiesAdapter(editor, input2),
@@ -255257,26 +256016,26 @@ function resolvePageNumberTokens(layout, blocks2, measures, numberingCtx) {
255257
256016
  continue;
255258
256017
  }
255259
256018
  const displayPageText = displayPageInfo.displayText;
255260
- for (const fragment2 of page.fragments) {
255261
- if (fragment2.kind !== "para")
255262
- continue;
255263
- const blockId = fragment2.blockId;
255264
- if (processedBlocks.has(blockId))
255265
- continue;
255266
- if (blockHasTokensFlags.get(blockId) === false)
255267
- continue;
255268
- const block = blockMap.get(blockId);
255269
- if (!block || block.kind !== "paragraph")
255270
- continue;
255271
- if (!hasPageTokens$1(block)) {
256019
+ for (const fragment2 of page.fragments)
256020
+ if (fragment2.kind === "para") {
256021
+ const blockId = fragment2.blockId;
256022
+ if (processedBlocks.has(blockId))
256023
+ continue;
256024
+ if (blockHasTokensFlags.get(blockId) === false)
256025
+ continue;
256026
+ const block = blockMap.get(blockId);
256027
+ if (!block || block.kind !== "paragraph")
256028
+ continue;
256029
+ if (!hasPageTokens$1(block)) {
256030
+ processedBlocks.add(blockId);
256031
+ continue;
256032
+ }
256033
+ const clonedBlock = cloneBlockWithResolvedTokens(block, displayPageText, totalPagesStr);
256034
+ updatedBlocks.set(blockId, clonedBlock);
256035
+ affectedBlockIds.add(blockId);
255272
256036
  processedBlocks.add(blockId);
255273
256037
  continue;
255274
256038
  }
255275
- const clonedBlock = cloneBlockWithResolvedTokens(block, displayPageText, totalPagesStr);
255276
- updatedBlocks.set(blockId, clonedBlock);
255277
- affectedBlockIds.add(blockId);
255278
- processedBlocks.add(blockId);
255279
- }
255280
256039
  }
255281
256040
  return {
255282
256041
  affectedBlockIds,
@@ -257373,6 +258132,20 @@ function isBorderSpec(value) {
257373
258132
  function hasComments$1(run2) {
257374
258133
  return "comments" in run2 && Array.isArray(run2.comments) && run2.comments.length > 0;
257375
258134
  }
258135
+ function forEachParagraphBlock(blocks2, visit2) {
258136
+ for (const block of blocks2)
258137
+ if (block.kind === "paragraph")
258138
+ visit2(block);
258139
+ else if (block.kind === "table") {
258140
+ const table2 = block;
258141
+ for (const row2 of table2.rows ?? [])
258142
+ for (const cell2 of row2.cells ?? [])
258143
+ if (cell2.blocks && cell2.blocks.length > 0)
258144
+ forEachParagraphBlock(cell2.blocks, visit2);
258145
+ else if (cell2.paragraph)
258146
+ forEachParagraphBlock([cell2.paragraph], visit2);
258147
+ }
258148
+ }
257376
258149
  function resolveHeaderFooterTokens(blocks2, pageNumber, totalPages, pageNumberText) {
257377
258150
  if (!blocks2 || blocks2.length === 0)
257378
258151
  return;
@@ -257386,10 +258159,7 @@ function resolveHeaderFooterTokens(blocks2, pageNumber, totalPages, pageNumberTe
257386
258159
  }
257387
258160
  const pageNumberStr = pageNumberText ?? String(pageNumber);
257388
258161
  const totalPagesStr = String(totalPages);
257389
- for (const block of blocks2) {
257390
- if (block.kind !== "paragraph")
257391
- continue;
257392
- const paraBlock = block;
258162
+ forEachParagraphBlock(blocks2, (paraBlock) => {
257393
258163
  for (const run2 of paraBlock.runs)
257394
258164
  if ("token" in run2 && run2.token) {
257395
258165
  if (run2.token === "pageNumber")
@@ -257397,22 +258167,37 @@ function resolveHeaderFooterTokens(blocks2, pageNumber, totalPages, pageNumberTe
257397
258167
  else if (run2.token === "totalPageCount")
257398
258168
  run2.text = totalPagesStr;
257399
258169
  }
257400
- }
258170
+ });
257401
258171
  }
257402
258172
  function cloneHeaderFooterBlocks(blocks2) {
257403
258173
  if (!blocks2 || blocks2.length === 0)
257404
258174
  return [];
257405
- return blocks2.map((block) => {
257406
- if (block.kind === "paragraph") {
257407
- const paraBlock = block;
257408
- return {
257409
- ...paraBlock,
257410
- runs: paraBlock.runs.map((run2) => ({ ...run2 })),
257411
- attrs: paraBlock.attrs ? { ...paraBlock.attrs } : undefined
257412
- };
257413
- }
257414
- return { ...block };
257415
- });
258175
+ return blocks2.map(cloneHeaderFooterBlock);
258176
+ }
258177
+ function cloneHeaderFooterBlock(block) {
258178
+ if (block.kind === "paragraph") {
258179
+ const paraBlock = block;
258180
+ return {
258181
+ ...paraBlock,
258182
+ runs: paraBlock.runs.map((run2) => ({ ...run2 })),
258183
+ attrs: paraBlock.attrs ? { ...paraBlock.attrs } : undefined
258184
+ };
258185
+ }
258186
+ if (block.kind === "table") {
258187
+ const table2 = block;
258188
+ return {
258189
+ ...table2,
258190
+ rows: (table2.rows ?? []).map((row2) => ({
258191
+ ...row2,
258192
+ cells: (row2.cells ?? []).map((cell2) => ({
258193
+ ...cell2,
258194
+ paragraph: cell2.paragraph ? cloneHeaderFooterBlock(cell2.paragraph) : cell2.paragraph,
258195
+ blocks: cell2.blocks ? cell2.blocks.map(cloneHeaderFooterBlock) : cell2.blocks
258196
+ }))
258197
+ }))
258198
+ };
258199
+ }
258200
+ return { ...block };
257416
258201
  }
257417
258202
  function isEnabled(envVar, defaultValue) {
257418
258203
  if (typeof process$1 === "undefined" || typeof process$1.env === "undefined")
@@ -257445,14 +258230,24 @@ function getBucketRepresentative(bucket) {
257445
258230
  return 5000;
257446
258231
  }
257447
258232
  }
258233
+ function paragraphHasPageToken(para) {
258234
+ for (const run2 of para.runs)
258235
+ if ("token" in run2 && (run2.token === "pageNumber" || run2.token === "totalPageCount"))
258236
+ return true;
258237
+ return false;
258238
+ }
257448
258239
  function hasPageTokens(blocks2) {
257449
- for (const block of blocks2) {
257450
- if (block.kind !== "paragraph")
257451
- continue;
257452
- for (const run2 of block.runs)
257453
- if ("token" in run2 && (run2.token === "pageNumber" || run2.token === "totalPageCount"))
258240
+ for (const block of blocks2)
258241
+ if (block.kind === "paragraph") {
258242
+ if (paragraphHasPageToken(block))
257454
258243
  return true;
257455
- }
258244
+ } else if (block.kind === "table") {
258245
+ const table2 = block;
258246
+ for (const row2 of table2.rows ?? [])
258247
+ for (const cell2 of row2.cells ?? [])
258248
+ if (hasPageTokens(cell2.blocks ? cell2.blocks : cell2.paragraph ? [cell2.paragraph] : []))
258249
+ return true;
258250
+ }
257456
258251
  return false;
257457
258252
  }
257458
258253
  async function layoutHeaderFooterWithCache(sections, constraints, measureBlock$1, cache$2 = sharedHeaderFooterCache, totalPages, pageResolver, kind) {
@@ -262530,7 +263325,7 @@ function handleStructuredContentBlockNode(node3, context) {
262530
263325
  const { blocks: blocks2, recordBlockKind, nextBlockId, positions, trackedChangesConfig, bookmarks, hyperlinkConfig, converters: converters$1, converterContext, enableComments, themeColors } = context;
262531
263326
  const structuredContentMetadata = resolveNodeSdtMetadata(node3, "structuredContentBlock");
262532
263327
  const paragraphToFlowBlocks$1 = converters$1.paragraphToFlowBlocks;
262533
- node3.content.forEach((child) => {
263328
+ const visitChild = (child) => {
262534
263329
  if (child.type === "paragraph") {
262535
263330
  const paragraphBlocks = paragraphToFlowBlocks$1({
262536
263331
  para: child,
@@ -262549,7 +263344,9 @@ function handleStructuredContentBlockNode(node3, context) {
262549
263344
  blocks2.push(block);
262550
263345
  recordBlockKind?.(block.kind);
262551
263346
  });
262552
- } else if (child.type === "table") {
263347
+ return;
263348
+ }
263349
+ if (child.type === "table") {
262553
263350
  const tableNodeToBlock$1 = converters$1?.tableNodeToBlock;
262554
263351
  if (tableNodeToBlock$1) {
262555
263352
  const tableBlock = tableNodeToBlock$1(child, {
@@ -262569,8 +263366,12 @@ function handleStructuredContentBlockNode(node3, context) {
262569
263366
  recordBlockKind?.(tableBlock.kind);
262570
263367
  }
262571
263368
  }
263369
+ return;
262572
263370
  }
262573
- });
263371
+ if (child.type === "documentPartObject" && Array.isArray(child.content))
263372
+ child.content.forEach(visitChild);
263373
+ };
263374
+ node3.content.forEach(visitChild);
262574
263375
  }
262575
263376
  function processParagraphChild(child, sectionMetadata, context, output, converters$1) {
262576
263377
  const paragraphBlocks = converters$1.paragraphToFlowBlocks({
@@ -284508,7 +285309,7 @@ var Node$13 = class Node$14 {
284508
285309
  listener(snapshot2);
284509
285310
  } catch {}
284510
285311
  }
284511
- }, TRACK_MARK_TYPE_BY_NAME, EMITTABLE_BLOCK_TYPES, SDT_BLOCK_NODE_NAMES, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL2, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, HEADING_PATTERN, OOXML_DEFAULT_FONT_SIZE_PT = 10, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, SYMBOL_FONT_NAMES, RFONTS_FAMILY_ATTRS, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, COMMENT_MARK_NAME2 = "commentMark", TRACK_CHANGE_MARK_NAMES, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART$1 = "word/settings.xml", WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", RELS_XMLNS2 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, BatchHistoryAdapter = class {
285312
+ }, TRACK_MARK_TYPE_BY_NAME, EMITTABLE_BLOCK_TYPES, SDT_BLOCK_NODE_NAMES, REQUIRED_COMMANDS, VALID_CAPABILITY_REASON_CODES, REQUIRED_HELPERS, SCHEMA_NODE_GATES, schemaGatedIds, SUPPORTED_NON_UNIFORM_STRATEGIES, SUPPORTED_SET_MARKS, REGEX_MAX_PATTERN_LENGTH = 1024, STYLES_PART = "word/styles.xml", PROPERTIES_KEY_BY_CHANNEL, XML_PATH_BY_CHANNEL2, UNDERLINE_API_TO_STORAGE, UNDERLINE_STORAGE_TO_API, HEX_SUBKEYS_BY_PROPERTY, SUPPORTED_DELETE_NODE_TYPES3, REJECTED_DELETE_NODE_TYPES3, TEXT_PREVIEW_MAX_LENGTH = 80, RANGE_DELETE_SAFE_NODE_TYPES, HEADING_PATTERN, OOXML_DEFAULT_FONT_SIZE_PT = 10, INDENT_PER_LEVEL_TWIPS = 720, HANGING_INDENT_TWIPS = 360, SYMBOL_FONT_NAMES, RFONTS_FAMILY_ATTRS, ORDERED_PRESET_CONFIG, BULLET_PRESET_CONFIG, PRESET_TEMPLATES, LevelFormattingHelpers, PRESET_KIND_MAP, NUMBERING_PART = "word/numbering.xml", DEFAULT_PRESET_FOR_KIND, _setValueDelegate, PREVIEW_TEXT_MAX_LENGTH = 2000, BLOCK_PREVIEW_MAX_LENGTH = 200, EDGE_NODE_TYPES$1, COMMENT_MARK_NAME2 = "commentMark", TRACK_CHANGE_MARK_NAMES, POINTS_TO_PIXELS, POINTS_TO_TWIPS = 20, PIXELS_TO_TWIPS, DEFAULT_TABLE_GRID_WIDTH_TWIPS = 1500, SETTINGS_PART$1 = "word/settings.xml", PRESET_GREY = "999999", PRESET_BLACK = "000000", STATIC_PRESETS, IDENTITY_BLOCK_ATTRS, WORD_DEFAULT_TBL_LOOK, FLAG_TO_OOXML_KEY, INVERTED_FLAGS, XML_KEY_TO_STYLE_OPTION, CLEARED_BORDER_OOXML, TABLE_MARGIN_KEY_GROUPS, TABLE_ADAPTER_DISPATCH, ROW_TARGETED_TABLE_OPS, registered = false, STYLES_PART_ID = "word/styles.xml", stylesPartDescriptor, settingsPartDescriptor, RELS_PART_ID2 = "word/_rels/document.xml.rels", RELS_XMLNS2 = "http://schemas.openxmlformats.org/package/2006/relationships", HEADER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/header", FOOTER_RELATIONSHIP_TYPE$1 = "http://schemas.openxmlformats.org/officeDocument/2006/relationships/footer", relsPartDescriptor, BatchHistoryAdapter = class {
284512
285313
  #done = [];
284513
285314
  #redone = [];
284514
285315
  #listeners = /* @__PURE__ */ new Set;
@@ -295335,6 +296136,58 @@ menclose::after {
295335
296136
  blocks2.push(block);
295336
296137
  });
295337
296138
  };
296139
+ const flattenSdtWrappersIntoCell = (wrapperNode, inheritedSdtMetadata) => {
296140
+ if (!Array.isArray(wrapperNode.content))
296141
+ return;
296142
+ for (const nestedNode of wrapperNode.content) {
296143
+ if (nestedNode.type === "paragraph") {
296144
+ if (!paragraphToFlowBlocks$1)
296145
+ continue;
296146
+ appendParagraphBlocks(paragraphToFlowBlocks$1({
296147
+ para: nestedNode,
296148
+ nextBlockId: context.nextBlockId,
296149
+ positions: context.positions,
296150
+ storyKey: context.storyKey,
296151
+ trackedChangesConfig: context.trackedChangesConfig,
296152
+ bookmarks: context.bookmarks,
296153
+ hyperlinkConfig: context.hyperlinkConfig,
296154
+ themeColors: context.themeColors,
296155
+ converterContext: cellConverterContext,
296156
+ converters: context.converters,
296157
+ enableComments: context.enableComments
296158
+ }), inheritedSdtMetadata);
296159
+ continue;
296160
+ }
296161
+ if (nestedNode.type === "table" && tableNodeToBlock$1) {
296162
+ const tableBlock = tableNodeToBlock$1(nestedNode, {
296163
+ nextBlockId: context.nextBlockId,
296164
+ positions: context.positions,
296165
+ storyKey: context.storyKey,
296166
+ trackedChangesConfig: context.trackedChangesConfig,
296167
+ bookmarks: context.bookmarks,
296168
+ hyperlinkConfig: context.hyperlinkConfig,
296169
+ themeColors: context.themeColors,
296170
+ converterContext: context.converterContext,
296171
+ converters: context.converters,
296172
+ enableComments: context.enableComments
296173
+ });
296174
+ if (tableBlock && tableBlock.kind === "table") {
296175
+ if (inheritedSdtMetadata)
296176
+ applySdtMetadataToTableBlock(tableBlock, inheritedSdtMetadata);
296177
+ blocks2.push(tableBlock);
296178
+ }
296179
+ continue;
296180
+ }
296181
+ if (nestedNode.type === "documentPartObject") {
296182
+ flattenSdtWrappersIntoCell(nestedNode, inheritedSdtMetadata);
296183
+ continue;
296184
+ }
296185
+ if (nestedNode.type === "structuredContentBlock") {
296186
+ flattenSdtWrappersIntoCell(nestedNode, inheritedSdtMetadata ?? resolveNodeSdtMetadata(nestedNode, "structuredContentBlock"));
296187
+ continue;
296188
+ }
296189
+ }
296190
+ };
295338
296191
  for (const childNode of cellNode.content) {
295339
296192
  if (childNode.type === "paragraph") {
295340
296193
  if (!paragraphToFlowBlocks$1)
@@ -295355,46 +296208,7 @@ menclose::after {
295355
296208
  continue;
295356
296209
  }
295357
296210
  if (childNode.type === "structuredContentBlock" && Array.isArray(childNode.content)) {
295358
- const structuredContentMetadata = resolveNodeSdtMetadata(childNode, "structuredContentBlock");
295359
- for (const nestedNode of childNode.content) {
295360
- if (nestedNode.type === "paragraph") {
295361
- if (!paragraphToFlowBlocks$1)
295362
- continue;
295363
- appendParagraphBlocks(paragraphToFlowBlocks$1({
295364
- para: nestedNode,
295365
- nextBlockId: context.nextBlockId,
295366
- positions: context.positions,
295367
- storyKey: context.storyKey,
295368
- trackedChangesConfig: context.trackedChangesConfig,
295369
- bookmarks: context.bookmarks,
295370
- hyperlinkConfig: context.hyperlinkConfig,
295371
- themeColors: context.themeColors,
295372
- converterContext: cellConverterContext,
295373
- converters: context.converters,
295374
- enableComments: context.enableComments
295375
- }), structuredContentMetadata);
295376
- continue;
295377
- }
295378
- if (nestedNode.type === "table" && tableNodeToBlock$1) {
295379
- const tableBlock = tableNodeToBlock$1(nestedNode, {
295380
- nextBlockId: context.nextBlockId,
295381
- positions: context.positions,
295382
- storyKey: context.storyKey,
295383
- trackedChangesConfig: context.trackedChangesConfig,
295384
- bookmarks: context.bookmarks,
295385
- hyperlinkConfig: context.hyperlinkConfig,
295386
- themeColors: context.themeColors,
295387
- converterContext: context.converterContext,
295388
- converters: context.converters,
295389
- enableComments: context.enableComments
295390
- });
295391
- if (tableBlock && tableBlock.kind === "table") {
295392
- applySdtMetadataToTableBlock(tableBlock, structuredContentMetadata);
295393
- blocks2.push(tableBlock);
295394
- }
295395
- continue;
295396
- }
295397
- }
296211
+ flattenSdtWrappersIntoCell(childNode, resolveNodeSdtMetadata(childNode, "structuredContentBlock"));
295398
296212
  continue;
295399
296213
  }
295400
296214
  if (childNode.type === "table" && tableNodeToBlock$1) {
@@ -295414,6 +296228,10 @@ menclose::after {
295414
296228
  blocks2.push(tableBlock);
295415
296229
  continue;
295416
296230
  }
296231
+ if (childNode.type === "documentPartObject" && Array.isArray(childNode.content)) {
296232
+ flattenSdtWrappersIntoCell(childNode, undefined);
296233
+ continue;
296234
+ }
295417
296235
  if (childNode.type === "image" && context.converters?.imageNodeToBlock) {
295418
296236
  const mergedMarks = [...childNode.marks ?? []];
295419
296237
  const trackedMeta = context.trackedChangesConfig ? collectTrackedChangeFromMarks(mergedMarks, context.storyKey) : undefined;
@@ -300629,12 +301447,12 @@ menclose::after {
300629
301447
  return;
300630
301448
  console.log(...args$1);
300631
301449
  }, HEADER_FOOTER_INIT_BUDGET_MS = 200, MAX_ZOOM_WARNING_THRESHOLD = 10, MAX_SELECTION_RECTS_PER_USER = 100, SEMANTIC_RESIZE_DEBOUNCE_MS = 120, MIN_SEMANTIC_CONTENT_WIDTH_PX = 1, GLOBAL_PERFORMANCE, PresentationEditor, ICONS, TEXTS, tableActionsOptions;
300632
- var init_src_BBPU9hdN_es = __esm(() => {
301450
+ var init_src_tOywM1hR_es = __esm(() => {
300633
301451
  init_rolldown_runtime_Bg48TavK_es();
300634
- init_SuperConverter_CzqEoFT1_es();
301452
+ init_SuperConverter_CjDkqrj8_es();
300635
301453
  init_jszip_C49i9kUs_es();
300636
301454
  init_uuid_qzgm05fK_es();
300637
- init_create_headless_toolbar_Cv2MmPXX_es();
301455
+ init_create_headless_toolbar_pGestihw_es();
300638
301456
  init_constants_DrU4EASo_es();
300639
301457
  init_dist_B8HfvhaK_es();
300640
301458
  init_unified_Dsuw2be5_es();
@@ -323716,6 +324534,7 @@ function print() { __p += __j.call(arguments, '') }
323716
324534
  "lists.create": [],
323717
324535
  "lists.attach": [],
323718
324536
  "lists.detach": [],
324537
+ "lists.delete": [],
323719
324538
  "lists.join": [],
323720
324539
  "lists.separate": [],
323721
324540
  "lists.setLevel": [],
@@ -324117,6 +324936,111 @@ function print() { __p += __j.call(arguments, '') }
324117
324936
  ]);
324118
324937
  POINTS_TO_PIXELS = 96 / 72;
324119
324938
  PIXELS_TO_TWIPS = 1440 / 96;
324939
+ STATIC_PRESETS = {
324940
+ grid: {
324941
+ borders: {
324942
+ top: {
324943
+ lineStyle: "single",
324944
+ lineWeightPt: 1,
324945
+ color: PRESET_BLACK
324946
+ },
324947
+ bottom: {
324948
+ lineStyle: "single",
324949
+ lineWeightPt: 1,
324950
+ color: PRESET_BLACK
324951
+ },
324952
+ left: {
324953
+ lineStyle: "single",
324954
+ lineWeightPt: 1,
324955
+ color: PRESET_BLACK
324956
+ },
324957
+ right: {
324958
+ lineStyle: "single",
324959
+ lineWeightPt: 1,
324960
+ color: PRESET_BLACK
324961
+ },
324962
+ insideH: {
324963
+ lineStyle: "single",
324964
+ lineWeightPt: 1,
324965
+ color: PRESET_BLACK
324966
+ },
324967
+ insideV: {
324968
+ lineStyle: "single",
324969
+ lineWeightPt: 1,
324970
+ color: PRESET_BLACK
324971
+ }
324972
+ },
324973
+ styleOptions: {},
324974
+ headerRowFill: null
324975
+ },
324976
+ minimal: {
324977
+ borders: {
324978
+ top: null,
324979
+ left: null,
324980
+ right: null,
324981
+ insideV: null,
324982
+ insideH: {
324983
+ lineStyle: "single",
324984
+ lineWeightPt: 0.25,
324985
+ color: PRESET_GREY
324986
+ },
324987
+ bottom: {
324988
+ lineStyle: "single",
324989
+ lineWeightPt: 1,
324990
+ color: PRESET_BLACK
324991
+ }
324992
+ },
324993
+ styleOptions: {},
324994
+ headerRowFill: null
324995
+ },
324996
+ striped: {
324997
+ borders: {
324998
+ top: {
324999
+ lineStyle: "single",
325000
+ lineWeightPt: 0.5,
325001
+ color: PRESET_GREY
325002
+ },
325003
+ bottom: {
325004
+ lineStyle: "single",
325005
+ lineWeightPt: 0.5,
325006
+ color: PRESET_GREY
325007
+ },
325008
+ left: {
325009
+ lineStyle: "single",
325010
+ lineWeightPt: 0.5,
325011
+ color: PRESET_GREY
325012
+ },
325013
+ right: {
325014
+ lineStyle: "single",
325015
+ lineWeightPt: 0.5,
325016
+ color: PRESET_GREY
325017
+ },
325018
+ insideH: {
325019
+ lineStyle: "single",
325020
+ lineWeightPt: 0.5,
325021
+ color: PRESET_GREY
325022
+ },
325023
+ insideV: {
325024
+ lineStyle: "single",
325025
+ lineWeightPt: 0.5,
325026
+ color: PRESET_GREY
325027
+ }
325028
+ },
325029
+ styleOptions: { bandedRows: true },
325030
+ headerRowFill: null
325031
+ }
325032
+ };
325033
+ IDENTITY_BLOCK_ATTRS = new Set([
325034
+ "sdBlockId",
325035
+ "sdBlockRev",
325036
+ "paraId",
325037
+ "textId",
325038
+ "rsidR",
325039
+ "rsidRDefault",
325040
+ "rsidP",
325041
+ "rsidRPr",
325042
+ "rsidDel"
325043
+ ]);
324120
325044
  WORD_DEFAULT_TBL_LOOK = {
324121
325045
  firstRow: true,
324122
325046
  lastRow: false,
@@ -338272,11 +339196,11 @@ function print() { __p += __j.call(arguments, '') }
338272
339196
  ];
338273
339197
  });
338274
339198
 
338275
- // ../../packages/superdoc/dist/chunks/create-super-doc-ui-E5TLljuQ.es.js
339199
+ // ../../packages/superdoc/dist/chunks/create-super-doc-ui-Cj3mqS9_.es.js
338276
339200
  var MOD_ALIASES, ALT_ALIASES, CTRL_ALIASES, SHIFT_ALIASES, BUILTIN_CONTEXT_MENU_GROUPS, BUILTIN_GROUP_ORDER, RESERVED_PROXY_PROPERTY_NAMES, ALL_TOOLBAR_COMMAND_IDS, EMPTY_ACTIVE_IDS;
338277
- var init_create_super_doc_ui_E5TLljuQ_es = __esm(() => {
338278
- init_SuperConverter_CzqEoFT1_es();
338279
- init_create_headless_toolbar_Cv2MmPXX_es();
339201
+ var init_create_super_doc_ui_Cj3mqS9__es = __esm(() => {
339202
+ init_SuperConverter_CjDkqrj8_es();
339203
+ init_create_headless_toolbar_pGestihw_es();
338280
339204
  MOD_ALIASES = new Set([
338281
339205
  "Mod",
338282
339206
  "Meta",
@@ -338318,16 +339242,16 @@ var init_zipper_BxRAi0_5_es = __esm(() => {
338318
339242
 
338319
339243
  // ../../packages/superdoc/dist/super-editor.es.js
338320
339244
  var init_super_editor_es = __esm(() => {
338321
- init_src_BBPU9hdN_es();
338322
- init_SuperConverter_CzqEoFT1_es();
339245
+ init_src_tOywM1hR_es();
339246
+ init_SuperConverter_CjDkqrj8_es();
338323
339247
  init_jszip_C49i9kUs_es();
338324
339248
  init_xml_js_CqGKpaft_es();
338325
- init_create_headless_toolbar_Cv2MmPXX_es();
339249
+ init_create_headless_toolbar_pGestihw_es();
338326
339250
  init_constants_DrU4EASo_es();
338327
339251
  init_dist_B8HfvhaK_es();
338328
339252
  init_unified_Dsuw2be5_es();
338329
339253
  init_DocxZipper_Dh4RtvcE_es();
338330
- init_create_super_doc_ui_E5TLljuQ_es();
339254
+ init_create_super_doc_ui_Cj3mqS9__es();
338331
339255
  init_ui_CGB3qmy3_es();
338332
339256
  init_eventemitter3_UwU_CLPU_es();
338333
339257
  init_errors_C_DoKMoN_es();