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
1 change: 1 addition & 0 deletions apps/cli/scripts/export-sdk-contract.ts
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ const INTENT_NAMES = {
'doc.format.fontFamily': 'format_font_family',
'doc.format.color': 'format_color',
'doc.format.align': 'format_align',
'doc.styles.apply': 'styles_apply',
'doc.create.paragraph': 'create_paragraph',
'doc.create.heading': 'create_heading',
'doc.lists.list': 'list_lists',
Expand Down
18 changes: 18 additions & 0 deletions apps/cli/src/__tests__/conformance/scenarios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -614,6 +614,24 @@ export const SUCCESS_SCENARIOS = {
],
};
},
'doc.styles.apply': async (harness: ConformanceHarness): Promise<ScenarioInvocation> => {
const stateDir = await harness.createStateDir('doc-styles-apply-success');
const docPath = await harness.copyFixtureDoc('doc-styles-apply');
return {
stateDir,
args: [
'styles',
'apply',
docPath,
'--target-json',
JSON.stringify({ scope: 'docDefaults', channel: 'run' }),
'--patch-json',
JSON.stringify({ bold: true }),
'--out',
harness.createOutputPath('doc-styles-apply-output'),
],
};
},
'doc.trackChanges.list': async (harness: ConformanceHarness): Promise<ScenarioInvocation> => {
const stateDir = await harness.createStateDir('doc-track-changes-list-success');
const fixture = await harness.addTrackedChangeFixture(stateDir, 'doc-track-changes-list');
Expand Down
4 changes: 4 additions & 0 deletions apps/cli/src/cli/operation-hints.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export const SUCCESS_VERB: Record<CliExposedOperationId, string> = {
'format.fontFamily': 'set font family',
'format.color': 'set text color',
'format.align': 'set alignment',
'styles.apply': 'applied stylesheet defaults',
'create.paragraph': 'created paragraph',
'create.heading': 'created heading',
'lists.list': 'listed items',
Expand Down Expand Up @@ -103,6 +104,7 @@ export const OUTPUT_FORMAT: Record<CliExposedOperationId, OutputFormat> = {
'format.fontFamily': 'mutationReceipt',
'format.color': 'mutationReceipt',
'format.align': 'mutationReceipt',
'styles.apply': 'receipt',
'create.paragraph': 'createResult',
'create.heading': 'createResult',
'lists.list': 'listResult',
Expand Down Expand Up @@ -153,6 +155,7 @@ export const RESPONSE_ENVELOPE_KEY: Record<CliExposedOperationId, string | null>
'format.fontFamily': null,
'format.color': null,
'format.align': null,
'styles.apply': 'receipt',
'create.paragraph': 'result',
'create.heading': 'result',
'lists.list': 'result',
Expand Down Expand Up @@ -232,6 +235,7 @@ export const OPERATION_FAMILY: Record<CliExposedOperationId, OperationFamily> =
'format.fontFamily': 'textMutation',
'format.color': 'textMutation',
'format.align': 'textMutation',
'styles.apply': 'general',
'create.paragraph': 'create',
'create.heading': 'create',
'lists.list': 'lists',
Expand Down
4 changes: 4 additions & 0 deletions apps/cli/src/cli/operation-params.ts
Original file line number Diff line number Diff line change
Expand Up @@ -351,6 +351,10 @@ const EXTRA_CLI_PARAMS: Partial<Record<string, CliOperationParamSpec[]>> = {
'doc.format.fontFamily': [...TEXT_TARGET_FLAT_PARAMS],
'doc.format.color': [...TEXT_TARGET_FLAT_PARAMS],
'doc.format.align': [...TEXT_TARGET_FLAT_PARAMS],
'doc.styles.apply': [
{ name: 'target', kind: 'jsonFlag', flag: 'target-json', type: 'json' },
{ name: 'patch', kind: 'jsonFlag', flag: 'patch-json', type: 'json' },
],
'doc.comments.create': [...TEXT_TARGET_FLAT_PARAMS],
'doc.comments.patch': [...TEXT_TARGET_FLAT_PARAMS],
// List operations: flat flag (--node-id) as shortcut for --target-json, plus --input-json
Expand Down
2 changes: 2 additions & 0 deletions apps/docs/document-api/available-operations.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ Use the tables below to see what operations are available and where each one is
| Lists | 8 | 0 | 8 | [Reference](/document-api/reference/lists/index) |
| Mutations | 2 | 0 | 2 | [Reference](/document-api/reference/mutations/index) |
| Query | 1 | 0 | 1 | [Reference](/document-api/reference/query/index) |
| Styles | 1 | 0 | 1 | [Reference](/document-api/reference/styles/index) |
| Track Changes | 3 | 0 | 3 | [Reference](/document-api/reference/track-changes/index) |

| Editor method | Operation |
Expand Down Expand Up @@ -64,6 +65,7 @@ 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.mutations.preview(...)</code></span> | [`mutations.preview`](/document-api/reference/mutations/preview) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.mutations.apply(...)</code></span> | [`mutations.apply`](/document-api/reference/mutations/apply) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.query.match(...)</code></span> | [`query.match`](/document-api/reference/query/match) |
| <span style={{ whiteSpace: 'nowrap', wordBreak: 'normal', overflowWrap: 'normal' }}><code>editor.doc.styles.apply(...)</code></span> | [`styles.apply`](/document-api/reference/styles/apply) |
| <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
11 changes: 10 additions & 1 deletion apps/docs/document-api/reference/_generated-manifest.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,8 @@
"apps/docs/document-api/reference/query/index.mdx",
"apps/docs/document-api/reference/query/match.mdx",
"apps/docs/document-api/reference/replace.mdx",
"apps/docs/document-api/reference/styles/apply.mdx",
"apps/docs/document-api/reference/styles/index.mdx",
"apps/docs/document-api/reference/track-changes/decide.mdx",
"apps/docs/document-api/reference/track-changes/get.mdx",
"apps/docs/document-api/reference/track-changes/index.mdx",
Expand Down Expand Up @@ -86,6 +88,13 @@
"pagePath": "apps/docs/document-api/reference/format/index.mdx",
"title": "Format"
},
{
"aliasMemberPaths": [],
"key": "styles",
"operationIds": ["styles.apply"],
"pagePath": "apps/docs/document-api/reference/styles/index.mdx",
"title": "Styles"
},
{
"aliasMemberPaths": [],
"key": "lists",
Expand Down Expand Up @@ -132,5 +141,5 @@
}
],
"marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}",
"sourceHash": "87c87f3fdb162eb43656a1971fd5f93fec1c0e76cc1f9a9ac22b585f1e4b0b28"
"sourceHash": "d5b584c9762004cd89a0af9a3068c83a36049453f26a0e80232cfd51654e32a3"
}
Loading
Loading