From 969aaa2851b6e1a11e6a1d50af79d54c48fd60f8 Mon Sep 17 00:00:00 2001 From: Nick Bernal Date: Wed, 27 May 2026 10:02:18 -0700 Subject: [PATCH 1/2] chore: generate all --- .../docs/document-api/reference/_generated-manifest.json | 2 +- apps/docs/document-api/reference/format/apply.mdx | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/apps/docs/document-api/reference/_generated-manifest.json b/apps/docs/document-api/reference/_generated-manifest.json index dc4acccd0a..73084acd22 100644 --- a/apps/docs/document-api/reference/_generated-manifest.json +++ b/apps/docs/document-api/reference/_generated-manifest.json @@ -1078,5 +1078,5 @@ } ], "marker": "{/* GENERATED FILE: DO NOT EDIT. Regenerate via `pnpm run docapi:sync`. */}", - "sourceHash": "2cba047f028916729fa2c6c33b90070023085a295522e2097a916cdc90634096" + "sourceHash": "5f439c4117bbb2e55f227e7711df415c1173f8c476954c6e412a4b8b45edd1a3" } diff --git a/apps/docs/document-api/reference/format/apply.mdx b/apps/docs/document-api/reference/format/apply.mdx index ccfff56f6d..661b004e93 100644 --- a/apps/docs/document-api/reference/format/apply.mdx +++ b/apps/docs/document-api/reference/format/apply.mdx @@ -194,7 +194,7 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe | Field | Type | Required | Description | | --- | --- | --- | --- | | `failure` | object | yes | | -| `failure.code` | enum | yes | `"INVALID_TARGET"` | +| `failure.code` | enum | yes | `"INVALID_TARGET"`, `"NO_OP"` | | `failure.details` | any | no | | | `failure.message` | string | yes | | | `resolution` | TextMutationResolution | yes | TextMutationResolution | @@ -293,6 +293,7 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe ## Non-applied failure codes - `INVALID_TARGET` +- `NO_OP` ## Raw schemas @@ -1974,7 +1975,8 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe "properties": { "code": { "enum": [ - "INVALID_TARGET" + "INVALID_TARGET", + "NO_OP" ] }, "details": {}, @@ -2025,7 +2027,8 @@ Returns a TextMutationReceipt confirming inline styles were applied to the targe "properties": { "code": { "enum": [ - "INVALID_TARGET" + "INVALID_TARGET", + "NO_OP" ] }, "details": {}, From baf581570daa1220cc0951e3d74974517348642b Mon Sep 17 00:00:00 2001 From: Nick Bernal Date: Wed, 27 May 2026 10:06:38 -0700 Subject: [PATCH 2/2] fix: import breaking delinstrtext orphans --- .../src/editors/v1/core/super-converter/exporter.js | 8 +++++--- .../src/editors/v1/tests/export/docxExporter.test.js | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/packages/super-editor/src/editors/v1/core/super-converter/exporter.js b/packages/super-editor/src/editors/v1/core/super-converter/exporter.js index de2b377c07..bb8151ce75 100644 --- a/packages/super-editor/src/editors/v1/core/super-converter/exporter.js +++ b/packages/super-editor/src/editors/v1/core/super-converter/exporter.js @@ -701,9 +701,11 @@ export class DocxExporter { let { name } = node; const { elements, attributes } = node; - // Normalize w:delInstrText โ†’ w:instrText only when the field instruction is - // no longer inside a surviving w:del wrapper. Inside w:del, ECMA-376 expects - // w:delInstrText to remain intact. + // Normalize w:delInstrText โ†’ w:instrText. During import, w:del wrappers around + // field character runs lose their trackDelete marks (only text content gets marked), + // so on export the w:del wrapper is absent. Per ECMA-376 ยง17.16.13, w:delInstrText + // outside w:del is non-conformant โ€” renaming to w:instrText keeps the field valid. + // Inside a surviving w:del wrapper, ECMA-376 expects w:delInstrText to remain intact. if (name === 'w:delInstrText' && !insideDeletion) { name = 'w:instrText'; } diff --git a/packages/super-editor/src/editors/v1/tests/export/docxExporter.test.js b/packages/super-editor/src/editors/v1/tests/export/docxExporter.test.js index 41e466aacb..9b57157f04 100644 --- a/packages/super-editor/src/editors/v1/tests/export/docxExporter.test.js +++ b/packages/super-editor/src/editors/v1/tests/export/docxExporter.test.js @@ -511,7 +511,7 @@ describe('DocxExporter', () => { elements: [ { name: 'w:del', - attributes: { 'w:id': '1' }, + attributes: { 'w:id': '1544' }, elements: [ { name: 'w:r', @@ -523,7 +523,7 @@ describe('DocxExporter', () => { elements: [ { type: 'text', - text: ' PAGE \\\\* MERGEFORMAT ', + text: ' PAGE \\\\* MERGEFORMAT ', }, ], }, @@ -536,9 +536,10 @@ describe('DocxExporter', () => { const xml = exporter.schemaToXml(data); + expect(xml).toContain(' {