Skip to content

Commit 137b1d9

Browse files
authored
feat(document-api): add table convenience ops and sync reference doc (#2471)
* feat(document-api): add table convenience ops and sync reference doc * fix(document-api): correct table convenience style, margin, and border validation behavior
1 parent a14004d commit 137b1d9

115 files changed

Lines changed: 3946 additions & 164 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

apps/docs/document-api/available-operations.mdx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Use the tables below to see what operations are available and where each one is
4343
| Styles | 1 | 0 | 1 | [Reference](/document-api/reference/styles/index) |
4444
| Table of Authorities | 11 | 0 | 11 | [Reference](/document-api/reference/authorities/index) |
4545
| Table of Contents | 10 | 0 | 10 | [Reference](/document-api/reference/toc/index) |
46-
| Tables | 42 | 0 | 42 | [Reference](/document-api/reference/tables/index) |
46+
| Tables | 45 | 0 | 45 | [Reference](/document-api/reference/tables/index) |
4747
| Track Changes | 3 | 0 | 3 | [Reference](/document-api/reference/track-changes/index) |
4848

4949
| Editor method | Operation |
@@ -412,6 +412,9 @@ Use the tables below to see what operations are available and where each one is
412412
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.setCellPadding(...)</code></span> | [`tables.setCellPadding`](/document-api/reference/tables/set-cell-padding) |
413413
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.setCellSpacing(...)</code></span> | [`tables.setCellSpacing`](/document-api/reference/tables/set-cell-spacing) |
414414
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.clearCellSpacing(...)</code></span> | [`tables.clearCellSpacing`](/document-api/reference/tables/clear-cell-spacing) |
415+
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.applyStyle(...)</code></span> | [`tables.applyStyle`](/document-api/reference/tables/apply-style) |
416+
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.setBorders(...)</code></span> | [`tables.setBorders`](/document-api/reference/tables/set-borders) |
417+
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.setTableOptions(...)</code></span> | [`tables.setTableOptions`](/document-api/reference/tables/set-table-options) |
415418
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.get(...)</code></span> | [`tables.get`](/document-api/reference/tables/get) |
416419
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.getCells(...)</code></span> | [`tables.getCells`](/document-api/reference/tables/get-cells) |
417420
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.getProperties(...)</code></span> | [`tables.getProperties`](/document-api/reference/tables/get-properties) |

apps/docs/document-api/reference/_generated-manifest.json

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -348,6 +348,7 @@
348348
"apps/docs/document-api/reference/styles/paragraph/index.mdx",
349349
"apps/docs/document-api/reference/styles/paragraph/set-style.mdx",
350350
"apps/docs/document-api/reference/tables/apply-border-preset.mdx",
351+
"apps/docs/document-api/reference/tables/apply-style.mdx",
351352
"apps/docs/document-api/reference/tables/clear-border.mdx",
352353
"apps/docs/document-api/reference/tables/clear-cell-spacing.mdx",
353354
"apps/docs/document-api/reference/tables/clear-contents.mdx",
@@ -374,6 +375,7 @@
374375
"apps/docs/document-api/reference/tables/move.mdx",
375376
"apps/docs/document-api/reference/tables/set-alt-text.mdx",
376377
"apps/docs/document-api/reference/tables/set-border.mdx",
378+
"apps/docs/document-api/reference/tables/set-borders.mdx",
377379
"apps/docs/document-api/reference/tables/set-cell-padding.mdx",
378380
"apps/docs/document-api/reference/tables/set-cell-properties.mdx",
379381
"apps/docs/document-api/reference/tables/set-cell-spacing.mdx",
@@ -385,6 +387,7 @@
385387
"apps/docs/document-api/reference/tables/set-shading.mdx",
386388
"apps/docs/document-api/reference/tables/set-style-option.mdx",
387389
"apps/docs/document-api/reference/tables/set-style.mdx",
390+
"apps/docs/document-api/reference/tables/set-table-options.mdx",
388391
"apps/docs/document-api/reference/tables/set-table-padding.mdx",
389392
"apps/docs/document-api/reference/tables/sort.mdx",
390393
"apps/docs/document-api/reference/tables/split-cell.mdx",
@@ -686,6 +689,9 @@
686689
"tables.setCellPadding",
687690
"tables.setCellSpacing",
688691
"tables.clearCellSpacing",
692+
"tables.applyStyle",
693+
"tables.setBorders",
694+
"tables.setTableOptions",
689695
"tables.get",
690696
"tables.getCells",
691697
"tables.getProperties",
@@ -976,5 +982,5 @@
976982
}
977983
],
978984
"marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}",
979-
"sourceHash": "5eb339719530fd6ff1e69c9c90c36637fedce9fc426b3aba84f973c73facf3e0"
985+
"sourceHash": "31ad98dfc8659ebef07fbe3070add1c26fbbc8e0fbfa284e52d0b17e9fdd6b0f"
980986
}

apps/docs/document-api/reference/capabilities/get.mdx

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,6 +1862,11 @@ _No fields._
18621862
| `operations.tables.applyBorderPreset.dryRun` | boolean | yes | |
18631863
| `operations.tables.applyBorderPreset.reasons` | enum[] | no | |
18641864
| `operations.tables.applyBorderPreset.tracked` | boolean | yes | |
1865+
| `operations.tables.applyStyle` | object | yes | |
1866+
| `operations.tables.applyStyle.available` | boolean | yes | |
1867+
| `operations.tables.applyStyle.dryRun` | boolean | yes | |
1868+
| `operations.tables.applyStyle.reasons` | enum[] | no | |
1869+
| `operations.tables.applyStyle.tracked` | boolean | yes | |
18651870
| `operations.tables.clearBorder` | object | yes | |
18661871
| `operations.tables.clearBorder.available` | boolean | yes | |
18671872
| `operations.tables.clearBorder.dryRun` | boolean | yes | |
@@ -1987,6 +1992,11 @@ _No fields._
19871992
| `operations.tables.setBorder.dryRun` | boolean | yes | |
19881993
| `operations.tables.setBorder.reasons` | enum[] | no | |
19891994
| `operations.tables.setBorder.tracked` | boolean | yes | |
1995+
| `operations.tables.setBorders` | object | yes | |
1996+
| `operations.tables.setBorders.available` | boolean | yes | |
1997+
| `operations.tables.setBorders.dryRun` | boolean | yes | |
1998+
| `operations.tables.setBorders.reasons` | enum[] | no | |
1999+
| `operations.tables.setBorders.tracked` | boolean | yes | |
19902000
| `operations.tables.setCellPadding` | object | yes | |
19912001
| `operations.tables.setCellPadding.available` | boolean | yes | |
19922002
| `operations.tables.setCellPadding.dryRun` | boolean | yes | |
@@ -2042,6 +2052,11 @@ _No fields._
20422052
| `operations.tables.setStyleOption.dryRun` | boolean | yes | |
20432053
| `operations.tables.setStyleOption.reasons` | enum[] | no | |
20442054
| `operations.tables.setStyleOption.tracked` | boolean | yes | |
2055+
| `operations.tables.setTableOptions` | object | yes | |
2056+
| `operations.tables.setTableOptions.available` | boolean | yes | |
2057+
| `operations.tables.setTableOptions.dryRun` | boolean | yes | |
2058+
| `operations.tables.setTableOptions.reasons` | enum[] | no | |
2059+
| `operations.tables.setTableOptions.tracked` | boolean | yes | |
20452060
| `operations.tables.setTablePadding` | object | yes | |
20462061
| `operations.tables.setTablePadding.available` | boolean | yes | |
20472062
| `operations.tables.setTablePadding.dryRun` | boolean | yes | |
@@ -4013,6 +4028,11 @@ _No fields._
40134028
"dryRun": true,
40144029
"tracked": false
40154030
},
4031+
"tables.applyStyle": {
4032+
"available": true,
4033+
"dryRun": true,
4034+
"tracked": false
4035+
},
40164036
"tables.clearBorder": {
40174037
"available": true,
40184038
"dryRun": true,
@@ -4138,6 +4158,11 @@ _No fields._
41384158
"dryRun": true,
41394159
"tracked": false
41404160
},
4161+
"tables.setBorders": {
4162+
"available": true,
4163+
"dryRun": true,
4164+
"tracked": false
4165+
},
41414166
"tables.setCellPadding": {
41424167
"available": true,
41434168
"dryRun": true,
@@ -4193,6 +4218,11 @@ _No fields._
41934218
"dryRun": true,
41944219
"tracked": false
41954220
},
4221+
"tables.setTableOptions": {
4222+
"available": true,
4223+
"dryRun": true,
4224+
"tracked": false
4225+
},
41964226
"tables.setTablePadding": {
41974227
"available": true,
41984228
"dryRun": true,
@@ -17086,6 +17116,41 @@ _No fields._
1708617116
],
1708717117
"type": "object"
1708817118
},
17119+
"tables.applyStyle": {
17120+
"additionalProperties": false,
17121+
"properties": {
17122+
"available": {
17123+
"type": "boolean"
17124+
},
17125+
"dryRun": {
17126+
"type": "boolean"
17127+
},
17128+
"reasons": {
17129+
"items": {
17130+
"enum": [
17131+
"COMMAND_UNAVAILABLE",
17132+
"HELPER_UNAVAILABLE",
17133+
"OPERATION_UNAVAILABLE",
17134+
"TRACKED_MODE_UNAVAILABLE",
17135+
"DRY_RUN_UNAVAILABLE",
17136+
"NAMESPACE_UNAVAILABLE",
17137+
"STYLES_PART_MISSING",
17138+
"COLLABORATION_ACTIVE"
17139+
]
17140+
},
17141+
"type": "array"
17142+
},
17143+
"tracked": {
17144+
"type": "boolean"
17145+
}
17146+
},
17147+
"required": [
17148+
"available",
17149+
"tracked",
17150+
"dryRun"
17151+
],
17152+
"type": "object"
17153+
},
1708917154
"tables.clearBorder": {
1709017155
"additionalProperties": false,
1709117156
"properties": {
@@ -17961,6 +18026,41 @@ _No fields._
1796118026
],
1796218027
"type": "object"
1796318028
},
18029+
"tables.setBorders": {
18030+
"additionalProperties": false,
18031+
"properties": {
18032+
"available": {
18033+
"type": "boolean"
18034+
},
18035+
"dryRun": {
18036+
"type": "boolean"
18037+
},
18038+
"reasons": {
18039+
"items": {
18040+
"enum": [
18041+
"COMMAND_UNAVAILABLE",
18042+
"HELPER_UNAVAILABLE",
18043+
"OPERATION_UNAVAILABLE",
18044+
"TRACKED_MODE_UNAVAILABLE",
18045+
"DRY_RUN_UNAVAILABLE",
18046+
"NAMESPACE_UNAVAILABLE",
18047+
"STYLES_PART_MISSING",
18048+
"COLLABORATION_ACTIVE"
18049+
]
18050+
},
18051+
"type": "array"
18052+
},
18053+
"tracked": {
18054+
"type": "boolean"
18055+
}
18056+
},
18057+
"required": [
18058+
"available",
18059+
"tracked",
18060+
"dryRun"
18061+
],
18062+
"type": "object"
18063+
},
1796418064
"tables.setCellPadding": {
1796518065
"additionalProperties": false,
1796618066
"properties": {
@@ -18346,6 +18446,41 @@ _No fields._
1834618446
],
1834718447
"type": "object"
1834818448
},
18449+
"tables.setTableOptions": {
18450+
"additionalProperties": false,
18451+
"properties": {
18452+
"available": {
18453+
"type": "boolean"
18454+
},
18455+
"dryRun": {
18456+
"type": "boolean"
18457+
},
18458+
"reasons": {
18459+
"items": {
18460+
"enum": [
18461+
"COMMAND_UNAVAILABLE",
18462+
"HELPER_UNAVAILABLE",
18463+
"OPERATION_UNAVAILABLE",
18464+
"TRACKED_MODE_UNAVAILABLE",
18465+
"DRY_RUN_UNAVAILABLE",
18466+
"NAMESPACE_UNAVAILABLE",
18467+
"STYLES_PART_MISSING",
18468+
"COLLABORATION_ACTIVE"
18469+
]
18470+
},
18471+
"type": "array"
18472+
},
18473+
"tracked": {
18474+
"type": "boolean"
18475+
}
18476+
},
18477+
"required": [
18478+
"available",
18479+
"tracked",
18480+
"dryRun"
18481+
],
18482+
"type": "object"
18483+
},
1834918484
"tables.setTablePadding": {
1835018485
"additionalProperties": false,
1835118486
"properties": {
@@ -19165,6 +19300,9 @@ _No fields._
1916519300
"tables.setCellPadding",
1916619301
"tables.setCellSpacing",
1916719302
"tables.clearCellSpacing",
19303+
"tables.applyStyle",
19304+
"tables.setBorders",
19305+
"tables.setTableOptions",
1916819306
"tables.get",
1916919307
"tables.getCells",
1917019308
"tables.getProperties",

apps/docs/document-api/reference/content-controls/get-binding.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ Returns the ContentControlBinding or null if no binding is set.
4747

4848
## Output fields
4949

50-
### Variant 1 (storeItemId, xpath)
50+
### Variant 1 (required: storeItemId, xpath)
5151

5252
| Field | Type | Required | Description |
5353
| --- | --- | --- | --- |

apps/docs/document-api/reference/delete.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Returns a TextMutationReceipt with applied status; receipt reports NO_OP if the
3636
| `target.kind` | `"selection"` | yes | Constant: `"selection"` |
3737
| `target.start` | SelectionPoint | yes | SelectionPoint |
3838

39-
### Variant 2 (ref)
39+
### Variant 2 (required: ref)
4040

4141
| Field | Type | Required | Description |
4242
| --- | --- | --- | --- |

apps/docs/document-api/reference/format/apply.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe
7979
| `target.kind` | `"selection"` | yes | Constant: `"selection"` |
8080
| `target.start` | SelectionPoint | yes | SelectionPoint |
8181

82-
### Variant 2 (ref, inline)
82+
### Variant 2 (required: ref, inline)
8383

8484
| Field | Type | Required | Description |
8585
| --- | --- | --- | --- |

apps/docs/document-api/reference/format/b-cs.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Returns a TextMutationReceipt confirming the inline run property patch was appli
3636
| `target.start` | SelectionPoint | yes | SelectionPoint |
3737
| `value` | boolean \\| null | no | One of: boolean, null |
3838

39-
### Variant 2 (ref)
39+
### Variant 2 (required: ref)
4040

4141
| Field | Type | Required | Description |
4242
| --- | --- | --- | --- |

apps/docs/document-api/reference/format/bold.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Returns a TextMutationReceipt confirming the inline run property patch was appli
3636
| `target.start` | SelectionPoint | yes | SelectionPoint |
3737
| `value` | boolean \\| null | no | One of: boolean, null |
3838

39-
### Variant 2 (ref)
39+
### Variant 2 (required: ref)
4040

4141
| Field | Type | Required | Description |
4242
| --- | --- | --- | --- |

apps/docs/document-api/reference/format/border.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Returns a TextMutationReceipt confirming the inline run property patch was appli
3636
| `target.start` | SelectionPoint | yes | SelectionPoint |
3737
| `value` | object \\| null | yes | One of: object, null |
3838

39-
### Variant 2 (ref, value)
39+
### Variant 2 (required: ref, value)
4040

4141
| Field | Type | Required | Description |
4242
| --- | --- | --- | --- |

apps/docs/document-api/reference/format/caps.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ Returns a TextMutationReceipt confirming the inline run property patch was appli
3636
| `target.start` | SelectionPoint | yes | SelectionPoint |
3737
| `value` | boolean \\| null | no | One of: boolean, null |
3838

39-
### Variant 2 (ref)
39+
### Variant 2 (required: ref)
4040

4141
| Field | Type | Required | Description |
4242
| --- | --- | --- | --- |

0 commit comments

Comments
 (0)