Commit a9ab6f1
authored
fix(content-controls): default newly-created controls to richText, not unknown (SD-3139) (#3281)
Follow-up to SD-3131 (#3275). After that PR, imported typeless w:sdtPr
correctly resolves to controlType: 'richText' per ECMA-376 §17.5.2.26,
but newly created controls via create.contentControl (no controlType)
and contentControls.wrap still defaulted to 'unknown'. Customers
filtering contentControls.list() by type saw different results before
vs after save/reopen — the same typeless OOXML round-tripped from
'unknown' to 'richText'.
- createWrapper: collapse three `?? 'unknown'` into a single
`?? 'richText'` local.
- wrapWrapper: explicitly seed controlType, type, and a default
sdtPr with <w:richText/> on the wrapper attrs (previously
controlType was unset entirely, leaving resolveControlType to
fall back to 'unknown').
Newly created controls now emit explicit <w:richText/> in sdtPr for
unambiguous engine state and exported markup. Imported typeless
Word-authored SDTs preserve their original raw sdtPr (import path
unchanged).
Per the SD-3131 design, 'unknown' keeps its meaning of "unsupported
or unrecognized type" — it's no longer the default for new controls.
Tests: 3 new (default-create → richText, explicit-richText-create
seeds <w:richText/>, wrap → richText + seeds <w:richText/>).
42 wrappers + 1189 conformance + 1398 document-api pass.1 parent c68d5d4 commit a9ab6f1
2 files changed
Lines changed: 63 additions & 4 deletions
File tree
- packages/super-editor/src/editors/v1/document-api-adapters/plan-engine
Lines changed: 46 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1095 | 1095 | | |
1096 | 1096 | | |
1097 | 1097 | | |
| 1098 | + | |
| 1099 | + | |
| 1100 | + | |
| 1101 | + | |
| 1102 | + | |
| 1103 | + | |
| 1104 | + | |
| 1105 | + | |
| 1106 | + | |
| 1107 | + | |
| 1108 | + | |
| 1109 | + | |
| 1110 | + | |
| 1111 | + | |
| 1112 | + | |
| 1113 | + | |
| 1114 | + | |
| 1115 | + | |
| 1116 | + | |
| 1117 | + | |
| 1118 | + | |
| 1119 | + | |
| 1120 | + | |
| 1121 | + | |
| 1122 | + | |
| 1123 | + | |
| 1124 | + | |
| 1125 | + | |
| 1126 | + | |
| 1127 | + | |
| 1128 | + | |
| 1129 | + | |
| 1130 | + | |
| 1131 | + | |
| 1132 | + | |
| 1133 | + | |
| 1134 | + | |
| 1135 | + | |
| 1136 | + | |
| 1137 | + | |
| 1138 | + | |
| 1139 | + | |
| 1140 | + | |
| 1141 | + | |
| 1142 | + | |
| 1143 | + | |
1098 | 1144 | | |
1099 | 1145 | | |
1100 | 1146 | | |
| |||
Lines changed: 17 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
493 | 493 | | |
494 | 494 | | |
495 | 495 | | |
| 496 | + | |
| 497 | + | |
496 | 498 | | |
497 | | - | |
| 499 | + | |
| 500 | + | |
| 501 | + | |
| 502 | + | |
| 503 | + | |
| 504 | + | |
| 505 | + | |
| 506 | + | |
| 507 | + | |
498 | 508 | | |
499 | 509 | | |
500 | 510 | | |
| |||
1809 | 1819 | | |
1810 | 1820 | | |
1811 | 1821 | | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
1812 | 1825 | | |
1813 | 1826 | | |
1814 | 1827 | | |
1815 | 1828 | | |
1816 | 1829 | | |
1817 | | - | |
1818 | | - | |
| 1830 | + | |
| 1831 | + | |
1819 | 1832 | | |
1820 | | - | |
| 1833 | + | |
1821 | 1834 | | |
1822 | 1835 | | |
1823 | 1836 | | |
| |||
0 commit comments