Commit c825717
authored
feat(document-api): support wrapping text ranges via contentControls.create (SD-2566) (#2815)
* feat(document-api): support wrapping text ranges via contentControls.create (SD-2566)
Add optional `at` field (SelectionTarget) to CreateContentControlInput,
enabling callers to wrap arbitrary text ranges in content controls
without dropping down to editor internals. Mutually exclusive with the
existing `target` field.
* fix(document-api): address review findings for contentControls.create at field
- Re-acquire editor command after at selection dispatch to avoid stale
state bug (CommandService captures state at access time)
- Reorder validation so at/target mutual exclusivity check runs before
target shape validation for clearer error messages
- Document at + content interaction in JSDoc
- Extract shared validAt constant in tests
* fix(document-api): add at field to create.contentControl contract schema
The objectSchema uses additionalProperties: false, so contract-driven
callers (CLI, SDK) would reject payloads with the new at field.1 parent 86b74fe commit c825717
File tree
5 files changed
+88
-5
lines changed- packages
- document-api/src
- content-controls
- contract
- super-editor/src/editors/v1/document-api-adapters/plan-engine
5 files changed
+88
-5
lines changedLines changed: 44 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
606 | 606 | | |
607 | 607 | | |
608 | 608 | | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
609 | 614 | | |
610 | 615 | | |
611 | 616 | | |
| |||
652 | 657 | | |
653 | 658 | | |
654 | 659 | | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
| 665 | + | |
| 666 | + | |
| 667 | + | |
| 668 | + | |
| 669 | + | |
| 670 | + | |
| 671 | + | |
| 672 | + | |
| 673 | + | |
| 674 | + | |
| 675 | + | |
| 676 | + | |
| 677 | + | |
| 678 | + | |
| 679 | + | |
| 680 | + | |
| 681 | + | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
| 687 | + | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
| 695 | + | |
| 696 | + | |
| 697 | + | |
| 698 | + | |
655 | 699 | | |
Lines changed: 15 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
9 | 9 | | |
10 | 10 | | |
11 | 11 | | |
| 12 | + | |
12 | 13 | | |
13 | 14 | | |
14 | 15 | | |
| |||
1033 | 1034 | | |
1034 | 1035 | | |
1035 | 1036 | | |
| 1037 | + | |
| 1038 | + | |
| 1039 | + | |
| 1040 | + | |
| 1041 | + | |
| 1042 | + | |
| 1043 | + | |
1036 | 1044 | | |
1037 | 1045 | | |
1038 | 1046 | | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
1039 | 1054 | | |
1040 | 1055 | | |
1041 | 1056 | | |
| |||
Lines changed: 7 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
9 | 10 | | |
10 | 11 | | |
11 | 12 | | |
| |||
206 | 207 | | |
207 | 208 | | |
208 | 209 | | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
209 | 216 | | |
210 | 217 | | |
211 | 218 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2190 | 2190 | | |
2191 | 2191 | | |
2192 | 2192 | | |
| 2193 | + | |
2193 | 2194 | | |
2194 | 2195 | | |
2195 | 2196 | | |
| |||
Lines changed: 21 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
89 | 90 | | |
90 | 91 | | |
91 | 92 | | |
| 93 | + | |
92 | 94 | | |
93 | 95 | | |
94 | 96 | | |
| |||
1853 | 1855 | | |
1854 | 1856 | | |
1855 | 1857 | | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
| 1862 | + | |
| 1863 | + | |
| 1864 | + | |
| 1865 | + | |
| 1866 | + | |
| 1867 | + | |
| 1868 | + | |
| 1869 | + | |
| 1870 | + | |
| 1871 | + | |
1856 | 1872 | | |
1857 | 1873 | | |
1858 | 1874 | | |
1859 | 1875 | | |
1860 | 1876 | | |
1861 | | - | |
| 1877 | + | |
1862 | 1878 | | |
1863 | 1879 | | |
1864 | 1880 | | |
1865 | 1881 | | |
1866 | 1882 | | |
1867 | 1883 | | |
1868 | | - | |
| 1884 | + | |
1869 | 1885 | | |
1870 | 1886 | | |
1871 | 1887 | | |
1872 | 1888 | | |
1873 | 1889 | | |
1874 | 1890 | | |
1875 | | - | |
| 1891 | + | |
1876 | 1892 | | |
1877 | | - | |
| 1893 | + | |
1878 | 1894 | | |
1879 | | - | |
| 1895 | + | |
1880 | 1896 | | |
1881 | 1897 | | |
1882 | 1898 | | |
| |||
0 commit comments