Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions apps/cli/scripts/export-sdk-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,9 @@ const INTENT_NAMES = {
'doc.tables.get': 'get_table',
'doc.tables.getCells': 'get_table_cells',
'doc.tables.getProperties': 'get_table_properties',
'doc.tables.getStyles': 'get_table_styles',
'doc.tables.setDefaultStyle': 'set_table_default_style',
'doc.tables.clearDefaultStyle': 'clear_table_default_style',
'doc.history.get': 'get_history',
'doc.history.undo': 'undo',
'doc.history.redo': 'redo',
Expand Down
55 changes: 55 additions & 0 deletions apps/cli/src/__tests__/conformance/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1908,6 +1908,57 @@ export const SUCCESS_SCENARIOS = {
'doc.tables.get': tableReadScenario('tables.get'),
'doc.tables.getCells': tableReadScenario('tables.getCells'),
'doc.tables.getProperties': tableReadScenario('tables.getProperties'),
'doc.tables.getStyles': async (harness: ConformanceHarness): Promise<ScenarioInvocation> => {
const stateDir = await harness.createStateDir('table-getStyles-success');
const { sessionId } = await harness.createTableFixture(stateDir, 'table-getStyles');
return {
stateDir,
args: [...commandTokens('doc.tables.getStyles'), '--session', sessionId],
};
},
'doc.tables.setDefaultStyle': async (harness: ConformanceHarness): Promise<ScenarioInvocation> => {
const stateDir = await harness.createStateDir('table-setDefaultStyle-success');
const { sessionId } = await harness.createTableFixture(stateDir, 'table-setDefaultStyle');
return {
stateDir,
args: [
...commandTokens('doc.tables.setDefaultStyle'),
'--session',
sessionId,
'--style-id',
'TableGrid',
'--out',
harness.createOutputPath('table-setDefaultStyle-out'),
],
};
},
'doc.tables.clearDefaultStyle': async (harness: ConformanceHarness): Promise<ScenarioInvocation> => {
const stateDir = await harness.createStateDir('table-clearDefaultStyle-success');
const { sessionId } = await harness.createTableFixture(stateDir, 'table-clearDefaultStyle');
// First set a default so the clear actually has something to remove
await harness.runCli(
[
...commandTokens('doc.tables.setDefaultStyle'),
'--session',
sessionId,
'--style-id',
'TableGrid',
'--out',
harness.createOutputPath('table-clearDefaultStyle-setup-out'),
],
stateDir,
);
return {
stateDir,
args: [
...commandTokens('doc.tables.clearDefaultStyle'),
'--session',
sessionId,
'--out',
harness.createOutputPath('table-clearDefaultStyle-out'),
],
};
},

// ---------------------------------------------------------------------------
// History operations
Expand Down Expand Up @@ -1935,6 +1986,10 @@ const RUNTIME_CONFORMANCE_SKIP = new Set<CliOperationId>([
'doc.toc.unmarkEntry',
'doc.toc.getEntry',
'doc.toc.editEntry',
// OOB table-style mutations require translatedLinkedStyles from the style-engine,
// which the CLI test harness fixture does not populate.
'doc.tables.setDefaultStyle',
'doc.tables.clearDefaultStyle',
]);

export const OPERATION_SCENARIOS = (Object.keys(SUCCESS_SCENARIOS) as CliOperationId[]).map((operationId) => {
Expand Down
12 changes: 12 additions & 0 deletions apps/cli/src/cli/operation-hints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,9 @@ export const SUCCESS_VERB: Record<CliExposedOperationId, string> = {
'tables.get': 'resolved table',
'tables.getCells': 'listed cells',
'tables.getProperties': 'resolved table properties',
'tables.getStyles': 'listed table styles',
'tables.setDefaultStyle': 'set default table style',
'tables.clearDefaultStyle': 'cleared default table style',
'history.get': 'retrieved history state',
'history.undo': 'undid last change',
'history.redo': 'redid last change',
Expand Down Expand Up @@ -298,6 +301,9 @@ export const OUTPUT_FORMAT: Record<CliExposedOperationId, OutputFormat> = {
'tables.get': 'tableInfo',
'tables.getCells': 'tableCellList',
'tables.getProperties': 'tablePropertiesInfo',
'tables.getStyles': 'plain',
'tables.setDefaultStyle': 'plain',
'tables.clearDefaultStyle': 'plain',
'history.get': 'plain',
'history.undo': 'plain',
'history.redo': 'plain',
Expand Down Expand Up @@ -412,6 +418,9 @@ export const RESPONSE_ENVELOPE_KEY: Record<CliExposedOperationId, string | null>
'tables.get': 'result',
'tables.getCells': 'result',
'tables.getProperties': 'result',
'tables.getStyles': 'result',
'tables.setDefaultStyle': 'result',
'tables.clearDefaultStyle': 'result',
'history.get': 'result',
'history.undo': 'result',
'history.redo': 'result',
Expand Down Expand Up @@ -554,6 +563,9 @@ export const OPERATION_FAMILY: Record<CliExposedOperationId, OperationFamily> =
'tables.get': 'tables',
'tables.getCells': 'tables',
'tables.getProperties': 'tables',
'tables.getStyles': 'tables',
'tables.setDefaultStyle': 'tables',
'tables.clearDefaultStyle': 'tables',
'history.get': 'query',
'history.undo': 'general',
'history.redo': 'general',
Expand Down
5 changes: 4 additions & 1 deletion apps/docs/document-api/available-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ Use the tables below to see what operations are available and where each one is
| Sections | 18 | 0 | 18 | [Reference](/document-api/reference/sections/index) |
| Styles | 1 | 0 | 1 | [Reference](/document-api/reference/styles/index) |
| Table of Contents | 10 | 0 | 10 | [Reference](/document-api/reference/toc/index) |
| Tables | 39 | 0 | 39 | [Reference](/document-api/reference/tables/index) |
| Tables | 42 | 0 | 42 | [Reference](/document-api/reference/tables/index) |
| Track Changes | 3 | 0 | 3 | [Reference](/document-api/reference/track-changes/index) |

| Editor method | Operation |
Expand Down Expand Up @@ -209,6 +209,9 @@ Use the tables below to see what operations are available and where each one is
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.get(...)</code></span> | [`tables.get`](/document-api/reference/tables/get) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.getCells(...)</code></span> | [`tables.getCells`](/document-api/reference/tables/get-cells) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.getProperties(...)</code></span> | [`tables.getProperties`](/document-api/reference/tables/get-properties) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.getStyles(...)</code></span> | [`tables.getStyles`](/document-api/reference/tables/get-styles) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.setDefaultStyle(...)</code></span> | [`tables.setDefaultStyle`](/document-api/reference/tables/set-default-style) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.tables.clearDefaultStyle(...)</code></span> | [`tables.clearDefaultStyle`](/document-api/reference/tables/clear-default-style) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.trackChanges.list(...)</code></span> | [`trackChanges.list`](/document-api/reference/track-changes/list) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.trackChanges.get(...)</code></span> | [`trackChanges.get`](/document-api/reference/track-changes/get) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.trackChanges.decide(...)</code></span> | [`trackChanges.decide`](/document-api/reference/track-changes/decide) |
Expand Down
10 changes: 8 additions & 2 deletions apps/docs/document-api/reference/_generated-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@
"apps/docs/document-api/reference/tables/clear-border.mdx",
"apps/docs/document-api/reference/tables/clear-cell-spacing.mdx",
"apps/docs/document-api/reference/tables/clear-contents.mdx",
"apps/docs/document-api/reference/tables/clear-default-style.mdx",
"apps/docs/document-api/reference/tables/clear-shading.mdx",
"apps/docs/document-api/reference/tables/clear-style.mdx",
"apps/docs/document-api/reference/tables/convert-from-text.mdx",
Expand All @@ -157,6 +158,7 @@
"apps/docs/document-api/reference/tables/distribute-rows.mdx",
"apps/docs/document-api/reference/tables/get-cells.mdx",
"apps/docs/document-api/reference/tables/get-properties.mdx",
"apps/docs/document-api/reference/tables/get-styles.mdx",
"apps/docs/document-api/reference/tables/get.mdx",
"apps/docs/document-api/reference/tables/index.mdx",
"apps/docs/document-api/reference/tables/insert-cell.mdx",
Expand All @@ -170,6 +172,7 @@
"apps/docs/document-api/reference/tables/set-cell-properties.mdx",
"apps/docs/document-api/reference/tables/set-cell-spacing.mdx",
"apps/docs/document-api/reference/tables/set-column-width.mdx",
"apps/docs/document-api/reference/tables/set-default-style.mdx",
"apps/docs/document-api/reference/tables/set-layout.mdx",
"apps/docs/document-api/reference/tables/set-row-height.mdx",
"apps/docs/document-api/reference/tables/set-row-options.mdx",
Expand Down Expand Up @@ -445,7 +448,10 @@
"tables.clearCellSpacing",
"tables.get",
"tables.getCells",
"tables.getProperties"
"tables.getProperties",
"tables.getStyles",
"tables.setDefaultStyle",
"tables.clearDefaultStyle"
],
"pagePath": "apps/docs/document-api/reference/tables/index.mdx",
"title": "Tables"
Expand Down Expand Up @@ -477,5 +483,5 @@
}
],
"marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}",
"sourceHash": "f7276958e365ad87346f051a9dc2d6b1a6313353302531b6f669409cf97b3dcc"
"sourceHash": "f6a9d24400077e26e602241bee1ab5f4c0ea8e0d112b2c7425182458977c1885"
}
147 changes: 147 additions & 0 deletions apps/docs/document-api/reference/capabilities/get.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -917,6 +917,11 @@ _No fields._
| `operations.tables.clearContents.dryRun` | boolean | yes | |
| `operations.tables.clearContents.reasons` | enum[] | no | |
| `operations.tables.clearContents.tracked` | boolean | yes | |
| `operations.tables.clearDefaultStyle` | object | yes | |
| `operations.tables.clearDefaultStyle.available` | boolean | yes | |
| `operations.tables.clearDefaultStyle.dryRun` | boolean | yes | |
| `operations.tables.clearDefaultStyle.reasons` | enum[] | no | |
| `operations.tables.clearDefaultStyle.tracked` | boolean | yes | |
| `operations.tables.clearShading` | object | yes | |
| `operations.tables.clearShading.available` | boolean | yes | |
| `operations.tables.clearShading.dryRun` | boolean | yes | |
Expand Down Expand Up @@ -982,6 +987,11 @@ _No fields._
| `operations.tables.getProperties.dryRun` | boolean | yes | |
| `operations.tables.getProperties.reasons` | enum[] | no | |
| `operations.tables.getProperties.tracked` | boolean | yes | |
| `operations.tables.getStyles` | object | yes | |
| `operations.tables.getStyles.available` | boolean | yes | |
| `operations.tables.getStyles.dryRun` | boolean | yes | |
| `operations.tables.getStyles.reasons` | enum[] | no | |
| `operations.tables.getStyles.tracked` | boolean | yes | |
| `operations.tables.insertCell` | object | yes | |
| `operations.tables.insertCell.available` | boolean | yes | |
| `operations.tables.insertCell.dryRun` | boolean | yes | |
Expand Down Expand Up @@ -1037,6 +1047,11 @@ _No fields._
| `operations.tables.setColumnWidth.dryRun` | boolean | yes | |
| `operations.tables.setColumnWidth.reasons` | enum[] | no | |
| `operations.tables.setColumnWidth.tracked` | boolean | yes | |
| `operations.tables.setDefaultStyle` | object | yes | |
| `operations.tables.setDefaultStyle.available` | boolean | yes | |
| `operations.tables.setDefaultStyle.dryRun` | boolean | yes | |
| `operations.tables.setDefaultStyle.reasons` | enum[] | no | |
| `operations.tables.setDefaultStyle.tracked` | boolean | yes | |
| `operations.tables.setLayout` | object | yes | |
| `operations.tables.setLayout.available` | boolean | yes | |
| `operations.tables.setLayout.dryRun` | boolean | yes | |
Expand Down Expand Up @@ -2495,6 +2510,14 @@ _No fields._
],
"tracked": true
},
"tables.clearDefaultStyle": {
"available": true,
"dryRun": true,
"reasons": [
"COMMAND_UNAVAILABLE"
],
"tracked": true
},
"tables.clearShading": {
"available": true,
"dryRun": true,
Expand Down Expand Up @@ -2599,6 +2622,14 @@ _No fields._
],
"tracked": true
},
"tables.getStyles": {
"available": true,
"dryRun": true,
"reasons": [
"COMMAND_UNAVAILABLE"
],
"tracked": true
},
"tables.insertCell": {
"available": true,
"dryRun": true,
Expand Down Expand Up @@ -2687,6 +2718,14 @@ _No fields._
],
"tracked": true
},
"tables.setDefaultStyle": {
"available": true,
"dryRun": true,
"reasons": [
"COMMAND_UNAVAILABLE"
],
"tracked": true
},
"tables.setLayout": {
"available": true,
"dryRun": true,
Expand Down Expand Up @@ -9067,6 +9106,41 @@ _No fields._
],
"type": "object"
},
"tables.clearDefaultStyle": {
"additionalProperties": false,
"properties": {
"available": {
"type": "boolean"
},
"dryRun": {
"type": "boolean"
},
"reasons": {
"items": {
"enum": [
"COMMAND_UNAVAILABLE",
"HELPER_UNAVAILABLE",
"OPERATION_UNAVAILABLE",
"TRACKED_MODE_UNAVAILABLE",
"DRY_RUN_UNAVAILABLE",
"NAMESPACE_UNAVAILABLE",
"STYLES_PART_MISSING",
"COLLABORATION_ACTIVE"
]
},
"type": "array"
},
"tracked": {
"type": "boolean"
}
},
"required": [
"available",
"tracked",
"dryRun"
],
"type": "object"
},
"tables.clearShading": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -9522,6 +9596,41 @@ _No fields._
],
"type": "object"
},
"tables.getStyles": {
"additionalProperties": false,
"properties": {
"available": {
"type": "boolean"
},
"dryRun": {
"type": "boolean"
},
"reasons": {
"items": {
"enum": [
"COMMAND_UNAVAILABLE",
"HELPER_UNAVAILABLE",
"OPERATION_UNAVAILABLE",
"TRACKED_MODE_UNAVAILABLE",
"DRY_RUN_UNAVAILABLE",
"NAMESPACE_UNAVAILABLE",
"STYLES_PART_MISSING",
"COLLABORATION_ACTIVE"
]
},
"type": "array"
},
"tracked": {
"type": "boolean"
}
},
"required": [
"available",
"tracked",
"dryRun"
],
"type": "object"
},
"tables.insertCell": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -9907,6 +10016,41 @@ _No fields._
],
"type": "object"
},
"tables.setDefaultStyle": {
"additionalProperties": false,
"properties": {
"available": {
"type": "boolean"
},
"dryRun": {
"type": "boolean"
},
"reasons": {
"items": {
"enum": [
"COMMAND_UNAVAILABLE",
"HELPER_UNAVAILABLE",
"OPERATION_UNAVAILABLE",
"TRACKED_MODE_UNAVAILABLE",
"DRY_RUN_UNAVAILABLE",
"NAMESPACE_UNAVAILABLE",
"STYLES_PART_MISSING",
"COLLABORATION_ACTIVE"
]
},
"type": "array"
},
"tracked": {
"type": "boolean"
}
},
"required": [
"available",
"tracked",
"dryRun"
],
"type": "object"
},
"tables.setLayout": {
"additionalProperties": false,
"properties": {
Expand Down Expand Up @@ -10912,6 +11056,9 @@ _No fields._
"tables.get",
"tables.getCells",
"tables.getProperties",
"tables.getStyles",
"tables.setDefaultStyle",
"tables.clearDefaultStyle",
"create.tableOfContents",
"toc.list",
"toc.get",
Expand Down
Loading
Loading