Commit efec5f4
authored
docs(custom-ui): add Controller setup page (SD-2929) (#3136)
* docs(custom-ui): add Controller setup page (SD-2929)
The Custom UI docs section was React-only. Customers building with
Vue, Svelte, Angular, or vanilla TypeScript had no entry point that
described the framework-agnostic controller surface, even though
that surface is the actual product (the React hooks are sugar over
it).
Adds editor/custom-ui/controller-setup.mdx covering:
- When to read this page vs React setup
- createSuperDocUI({ superdoc })
- ui.<domain>.observe(snapshot => ...) shape (and the wrapped
subscribe alias)
- ui.createScope() for lifecycle, with auto-cascade on ui.destroy()
- scope.add / scope.register / scope.on
- BUILT_IN_COMMAND_IDS / ui.commands.has(id) / ui.commands.require(id)
for config-driven id validation
- Tiny vanilla skeleton in one file
- Common pitfalls: forgetting ui.destroy(), reading live selection
at submit time, built-in UI overlap
Wires the page into the Custom UI nav between React setup and
Toolbar and commands. Adds a Tip callout on react-setup.mdx pointing
non-React readers here.
This is the docs gap the audit surfaced: examples were drifting
toward 'framework matrix' coverage because there was no docs page
that owned the framework-agnostic story. With this page in place,
focused examples (selection-capture, configurable-toolbar) can land
linked from a real docs home.
* docs(custom-ui): group nav into Setup / Commands / Review / Selection (SD-2929)
The Custom UI section grew to 11 pages with this PR's controller-setup
addition. That's nearly twice the next-biggest Editor subsection
(Built-in UI / SuperDoc, both 6 pages). A flat list at that size is
hard to scan, and the existing Toolbar and commands subgroup with a
single child of the same name was already awkward.
Restructure into four sub-groups that match how customers actually
read the section:
- Setup (react-setup, controller-setup): the React vs framework-
agnostic choice is the first decision a reader makes.
- Commands and controls (toolbar-and-commands, custom-commands,
document-control): wiring the chrome that drives the editor.
- Review workflows (comments, track-changes): the two surfaces a
reviewer-style sidebar consumes.
- Selection and navigation (selection-and-viewport, navigation):
positioning utilities that the surfaces above lean on.
Overview stays at the top as the layer model; api-reference stays at
the bottom as reference, not a learning path. The previous Toolbar
and commands subgroup (which had a child of the same name) goes
away; document-control moves out of the trailing-utility cluster
into Commands and controls where it belongs.
Also tightens the controller-setup page description: 'The framework-
agnostic path under React' kept React as the implicit center, which
inverts the actual relationship. Reframed as 'Use Custom UI without
React' so the controller is the subject, not the alternative.
* docs(custom-ui): flatten nav and reorder for teach-flow (SD-2929)
Reversed the sub-grouped nav from the previous commit. Custom UI is
11 pages, which is on the line but not over it — every other Editor
subsection (SuperDoc, React, Built-in UI, Spell check, Theming, PDF)
reads as a flat list. Sub-groups would break that convention without
materially helping discoverability for either teach-flow readers or
return-lookup readers.
The teach-flow ordering carries the structure instead:
overview → react-setup → controller-setup → toolbar-and-commands
→ custom-commands → comments → selection-and-viewport
→ track-changes → document-control → navigation → api-reference
Selection-and-viewport sits immediately after comments because the
capture / focus-loss problem is the concrete case that motivates the
selection mechanics page. The previous Toolbar and commands subgroup
(awkwardly named the same as one of its children) is gone; the two
pages now sit at the top level next to each other.
Reverts only the nav restructure from 8125da9. Keeps the controller-
setup page itself, the Tip callout on react-setup, and the
controller-setup description fix from earlier in this PR.1 parent 1a3b7dd commit efec5f4
3 files changed
Lines changed: 190 additions & 6 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
98 | 98 | | |
99 | 99 | | |
100 | 100 | | |
101 | | - | |
102 | | - | |
103 | | - | |
104 | | - | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
105 | 104 | | |
106 | | - | |
107 | 105 | | |
108 | | - | |
| 106 | + | |
109 | 107 | | |
| 108 | + | |
110 | 109 | | |
111 | 110 | | |
112 | 111 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
0 commit comments