@cocoar/vue-ui 3.1.0 → 3.2.0-beta.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts +1 -1
- package/dist/components/checkbox/CoarCheckbox.vue.d.ts.map +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts +1 -1
- package/dist/components/code-block/CoarCodeBlock.vue.d.ts.map +1 -1
- package/dist/components/data-list/CoarDataList.vue.d.ts +158 -0
- package/dist/components/data-list/CoarDataList.vue.d.ts.map +1 -0
- package/dist/components/data-list/CoarDataListToolbar.vue.d.ts +30 -0
- package/dist/components/data-list/CoarDataListToolbar.vue.d.ts.map +1 -0
- package/dist/components/data-list/data-list-builder.d.ts +288 -0
- package/dist/components/data-list/data-list-builder.d.ts.map +1 -0
- package/dist/components/data-list/index.d.ts +12 -0
- package/dist/components/data-list/index.d.ts.map +1 -0
- package/dist/components/data-list/internal/compare.d.ts +14 -0
- package/dist/components/data-list/internal/compare.d.ts.map +1 -0
- package/dist/components/data-list/internal/reorder-core.d.ts +46 -0
- package/dist/components/data-list/internal/reorder-core.d.ts.map +1 -0
- package/dist/components/data-list/internal/search.d.ts +16 -0
- package/dist/components/data-list/internal/search.d.ts.map +1 -0
- package/dist/components/data-list/internal/useDataListLines.d.ts +92 -0
- package/dist/components/data-list/internal/useDataListLines.d.ts.map +1 -0
- package/dist/components/data-list/internal/useDataListReorder.d.ts +68 -0
- package/dist/components/data-list/internal/useDataListReorder.d.ts.map +1 -0
- package/dist/components/data-list/internal/useSearchHighlight.d.ts +19 -0
- package/dist/components/data-list/internal/useSearchHighlight.d.ts.map +1 -0
- package/dist/components/data-list/types.d.ts +185 -0
- package/dist/components/data-list/types.d.ts.map +1 -0
- package/dist/components/data-list/useDataListModel.d.ts +79 -0
- package/dist/components/data-list/useDataListModel.d.ts.map +1 -0
- package/dist/components/date-time/_shared/maskito-config.d.ts +7 -2
- package/dist/components/date-time/_shared/maskito-config.d.ts.map +1 -1
- package/dist/components/date-time/_shared/time-helpers.d.ts +11 -4
- package/dist/components/date-time/_shared/time-helpers.d.ts.map +1 -1
- package/dist/components/date-time/_shared/use-date-picker-base.d.ts +1 -1
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts +1 -1
- package/dist/components/date-time/plain-date-picker/CoarPlainDatePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts +1 -1
- package/dist/components/date-time/plain-date-time-picker/CoarPlainDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts +1 -1
- package/dist/components/date-time/zoned-date-time-picker/CoarZonedDateTimePicker.vue.d.ts.map +1 -1
- package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts +3 -0
- package/dist/components/dual-listbox/CoarDualListbox.vue.d.ts.map +1 -1
- package/dist/components/form-field/CoarFormField.vue.d.ts +1 -1
- package/dist/components/form-field/CoarFormField.vue.d.ts.map +1 -1
- package/dist/components/icon/CoarIcon.vue.d.ts +2 -2
- package/dist/components/icon/CoarIcon.vue.d.ts.map +1 -1
- package/dist/components/listbox/CoarListbox.vue.d.ts +7 -0
- package/dist/components/listbox/CoarListbox.vue.d.ts.map +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts +1 -1
- package/dist/components/number-input/CoarNumberInput.vue.d.ts.map +1 -1
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts +1 -1
- package/dist/components/otp-input/CoarOtpInput.vue.d.ts.map +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts +1 -1
- package/dist/components/password-input/CoarPasswordInput.vue.d.ts.map +1 -1
- package/dist/components/switch/CoarSwitch.vue.d.ts +1 -1
- package/dist/components/switch/CoarSwitch.vue.d.ts.map +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts +1 -1
- package/dist/components/text-input/CoarTextInput.vue.d.ts.map +1 -1
- package/dist/composables/dragRegistry.d.ts +12 -0
- package/dist/composables/dragRegistry.d.ts.map +1 -1
- package/dist/composables/index.d.ts +2 -2
- package/dist/composables/index.d.ts.map +1 -1
- package/dist/composables/useDragDrop.d.ts +62 -6
- package/dist/composables/useDragDrop.d.ts.map +1 -1
- package/dist/composables/useVirtualList.d.ts +21 -1
- package/dist/composables/useVirtualList.d.ts.map +1 -1
- package/dist/index.css +1 -1
- package/dist/index.d.ts +4 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +4508 -2039
- package/package.json +5 -3
- package/skills/cocoar-vue-ui/SKILL.md +244 -0
- package/skills/cocoar-vue-ui/references/components/avatar.md +178 -0
- package/skills/cocoar-vue-ui/references/components/badge.md +290 -0
- package/skills/cocoar-vue-ui/references/components/breadcrumb.md +238 -0
- package/skills/cocoar-vue-ui/references/components/button.md +252 -0
- package/skills/cocoar-vue-ui/references/components/calendar/agenda-view.md +353 -0
- package/skills/cocoar-vue-ui/references/components/calendar/coar-calendar.md +1645 -0
- package/skills/cocoar-vue-ui/references/components/calendar/day-view.md +361 -0
- package/skills/cocoar-vue-ui/references/components/calendar/index.md +312 -0
- package/skills/cocoar-vue-ui/references/components/calendar/month-view.md +475 -0
- package/skills/cocoar-vue-ui/references/components/calendar/performance.md +186 -0
- package/skills/cocoar-vue-ui/references/components/calendar/timeline-view.md +301 -0
- package/skills/cocoar-vue-ui/references/components/calendar/week-view.md +382 -0
- package/skills/cocoar-vue-ui/references/components/calendar/work-week-view.md +145 -0
- package/skills/cocoar-vue-ui/references/components/calendar/year-view.md +63 -0
- package/skills/cocoar-vue-ui/references/components/card.md +151 -0
- package/skills/cocoar-vue-ui/references/components/checkbox-group.md +103 -0
- package/skills/cocoar-vue-ui/references/components/checkbox.md +279 -0
- package/skills/cocoar-vue-ui/references/components/code-block.md +241 -0
- package/skills/cocoar-vue-ui/references/components/context-menu.md +355 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/checkbox.md +213 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/date-columns.md +272 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/editing.md +236 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/multi-select.md +193 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/number.md +147 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/select.md +202 -0
- package/skills/cocoar-vue-ui/references/components/data-grid/text.md +127 -0
- package/skills/cocoar-vue-ui/references/components/data-grid.md +1225 -0
- package/skills/cocoar-vue-ui/references/components/data-list.md +2121 -0
- package/skills/cocoar-vue-ui/references/components/date-or-time-picker.md +200 -0
- package/skills/cocoar-vue-ui/references/components/date-picker.md +203 -0
- package/skills/cocoar-vue-ui/references/components/date-time-picker.md +154 -0
- package/skills/cocoar-vue-ui/references/components/date-views.md +212 -0
- package/skills/cocoar-vue-ui/references/components/dialog.md +148 -0
- package/skills/cocoar-vue-ui/references/components/divider.md +157 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/annotations.md +400 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/coar-document-viewer.md +327 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/index.md +234 -0
- package/skills/cocoar-vue-ui/references/components/document-viewer/toolbar.md +221 -0
- package/skills/cocoar-vue-ui/references/components/drag-drop.md +267 -0
- package/skills/cocoar-vue-ui/references/components/dual-listbox.md +449 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/asset-store.md +327 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/in-memory-store.md +176 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/index.md +311 -0
- package/skills/cocoar-vue-ui/references/components/file-explorer/use-file-explorer.md +300 -0
- package/skills/cocoar-vue-ui/references/components/form-field.md +1025 -0
- package/skills/cocoar-vue-ui/references/components/fragment-parser.md +298 -0
- package/skills/cocoar-vue-ui/references/components/link.md +235 -0
- package/skills/cocoar-vue-ui/references/components/listbox.md +575 -0
- package/skills/cocoar-vue-ui/references/components/map/editor.md +448 -0
- package/skills/cocoar-vue-ui/references/components/map/index.md +351 -0
- package/skills/cocoar-vue-ui/references/components/markdown-diagrams.md +210 -0
- package/skills/cocoar-vue-ui/references/components/markdown-editor.md +1478 -0
- package/skills/cocoar-vue-ui/references/components/markdown-embeds.md +387 -0
- package/skills/cocoar-vue-ui/references/components/markdown-form.md +447 -0
- package/skills/cocoar-vue-ui/references/components/markdown.md +276 -0
- package/skills/cocoar-vue-ui/references/components/menu.md +380 -0
- package/skills/cocoar-vue-ui/references/components/mermaid.md +172 -0
- package/skills/cocoar-vue-ui/references/components/navbar.md +147 -0
- package/skills/cocoar-vue-ui/references/components/note.md +96 -0
- package/skills/cocoar-vue-ui/references/components/notice.md +131 -0
- package/skills/cocoar-vue-ui/references/components/number-input.md +215 -0
- package/skills/cocoar-vue-ui/references/components/otp-input.md +324 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/authoring-contract.md +271 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-builder.md +476 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/coar-page-renderer.md +677 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/custom-elements.md +441 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/idp-integration.md +122 -0
- package/skills/cocoar-vue-ui/references/components/page-builder/index.md +573 -0
- package/skills/cocoar-vue-ui/references/components/pagination.md +150 -0
- package/skills/cocoar-vue-ui/references/components/panel-layout.md +372 -0
- package/skills/cocoar-vue-ui/references/components/password-input.md +175 -0
- package/skills/cocoar-vue-ui/references/components/popconfirm.md +186 -0
- package/skills/cocoar-vue-ui/references/components/popover.md +173 -0
- package/skills/cocoar-vue-ui/references/components/progress-bar.md +178 -0
- package/skills/cocoar-vue-ui/references/components/radio-group.md +225 -0
- package/skills/cocoar-vue-ui/references/components/script-editor.md +1271 -0
- package/skills/cocoar-vue-ui/references/components/segmented-control.md +238 -0
- package/skills/cocoar-vue-ui/references/components/select.md +463 -0
- package/skills/cocoar-vue-ui/references/components/sidebar.md +421 -0
- package/skills/cocoar-vue-ui/references/components/spinner.md +132 -0
- package/skills/cocoar-vue-ui/references/components/switch.md +195 -0
- package/skills/cocoar-vue-ui/references/components/table.md +170 -0
- package/skills/cocoar-vue-ui/references/components/tabs.md +382 -0
- package/skills/cocoar-vue-ui/references/components/tag.md +178 -0
- package/skills/cocoar-vue-ui/references/components/text-input.md +256 -0
- package/skills/cocoar-vue-ui/references/components/toast.md +160 -0
- package/skills/cocoar-vue-ui/references/components/tooltip.md +121 -0
- package/skills/cocoar-vue-ui/references/components/transitions.md +193 -0
- package/skills/cocoar-vue-ui/references/components/tree.md +2388 -0
- package/skills/cocoar-vue-ui/references/components/virtual-list.md +212 -0
- package/skills/cocoar-vue-ui/references/components/wizard.md +251 -0
- package/skills/cocoar-vue-ui/references/components/zoned-date-time-picker.md +177 -0
- package/skills/cocoar-vue-ui/references/foundations/colors.md +708 -0
- package/skills/cocoar-vue-ui/references/foundations/design-principles.md +115 -0
- package/skills/cocoar-vue-ui/references/foundations/icons.md +381 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/formatting.md +530 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/setup.md +86 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/timezones.md +182 -0
- package/skills/cocoar-vue-ui/references/foundations/localization/translations.md +305 -0
- package/skills/cocoar-vue-ui/references/foundations/motion.md +549 -0
- package/skills/cocoar-vue-ui/references/foundations/spacing.md +330 -0
- package/skills/cocoar-vue-ui/references/foundations/theming.md +140 -0
- package/skills/cocoar-vue-ui/references/foundations/typography.md +206 -0
- package/skills/cocoar-vue-ui/references/guide/error-handling.md +162 -0
- package/skills/cocoar-vue-ui/references/guide/getting-started.md +119 -0
- package/skills/cocoar-vue-ui/references/guide/migration-page-builder-3.md +207 -0
- package/skills/cocoar-vue-ui/references/guide/migration.md +140 -0
- package/skills/cocoar-vue-ui/references/guide/theming.md +98 -0
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
<!-- Generated from apps/docs/components/page-builder/authoring-contract.md by apps/docs/scripts/sync-skill.mjs. Do not edit; edit the docs page. -->
|
|
2
|
+
|
|
3
|
+
# Authoring contract
|
|
4
|
+
|
|
5
|
+
Every capability the renderer honours must be reachable from an authoring
|
|
6
|
+
surface. This page is the inventory: each part of the document grammar, the
|
|
7
|
+
surface that writes it, and — where a surface is missing — whether that is a
|
|
8
|
+
**named exception** or an **open gap**.
|
|
9
|
+
|
|
10
|
+
## The rules
|
|
11
|
+
|
|
12
|
+
1. **Nothing is JSON-only.** Every capability is reachable through Element Code
|
|
13
|
+
/ Page Code or a panel control. Editing raw JSON is a convenience, never a
|
|
14
|
+
requirement.
|
|
15
|
+
2. **Nothing rewrites the document behind the author's back.** Problems are
|
|
16
|
+
reported, not silently healed.
|
|
17
|
+
3. **Code is the truth.** Element Code, Page Code and Page State are the
|
|
18
|
+
authored artifact; the document follows from them. A Quick Property is
|
|
19
|
+
nothing but a fixed Element Code block — not editable as text, placed before
|
|
20
|
+
the element's custom code, so custom code can override it. Quick Properties
|
|
21
|
+
are a convenience for frequently-touched properties, not a second model.
|
|
22
|
+
4. **Renderer ⊆ Builder.** `CoarPageRenderer` supports exactly what the builder
|
|
23
|
+
can write. It cannot do more than the editor can author.
|
|
24
|
+
|
|
25
|
+
An exception to any of these is legitimate **only if it is named on this
|
|
26
|
+
page**. An unnamed exception is a bug.
|
|
27
|
+
|
|
28
|
+
## Two modes, one of them on the way out
|
|
29
|
+
|
|
30
|
+
`authoringMode="properties"` is the **legacy** mode. It writes values directly
|
|
31
|
+
into the document (`node.style`, `node.props`, `node.visibleWhen`) through
|
|
32
|
+
per-element inspectors, a Style section, a Visibility section and a Field
|
|
33
|
+
section. It is scheduled for removal.
|
|
34
|
+
|
|
35
|
+
`authoringMode="code"` is the target. Everything is authored as code:
|
|
36
|
+
|
|
37
|
+
| Surface | Writes | Notes |
|
|
38
|
+
|---|---|---|
|
|
39
|
+
| **Element Code** | `props`, `style`, `responsive`, `validation`, `visibleWhen`, `bindings`, `defaultValue` | Computed per render. Cannot change `type` or `name`. |
|
|
40
|
+
| **Quick Properties** | locked assignments inside `elementCode`, ahead of the custom-code slot | Paths limited to `props.*`, `style.*`, `validation.*` |
|
|
41
|
+
| **Page Root Code** | `style`, `responsive`, `enterSubmits` on the root | |
|
|
42
|
+
| **Page Code / Page State** | shared state, repeat `items`, cross-element logic | |
|
|
43
|
+
| **Structure section** | `type` (representation switch), `name` (free or contract-bound) | Structural — deliberately not code |
|
|
44
|
+
| **Canvas / Outline** | `children`, tree order, `id` | Structural |
|
|
45
|
+
| **Logic tab** | `bindings`, expressions | |
|
|
46
|
+
| **Translations tab** | `translations` | |
|
|
47
|
+
| **JSON tab** | everything, as a paste-and-apply convenience | Never the only way |
|
|
48
|
+
|
|
49
|
+
The inventory below is written against the **target** state. Where a capability
|
|
50
|
+
today has only a legacy-mode control, that is called out — it is a gap that
|
|
51
|
+
opens the day properties mode is removed, not a gap you can see now.
|
|
52
|
+
|
|
53
|
+
## The sandbox is mandatory
|
|
54
|
+
|
|
55
|
+
If code is the truth, then the code has to run. `CoarPageRenderer` never
|
|
56
|
+
evaluates it: the host runs `usePageCodeRuntime()` against an isolated Worker
|
|
57
|
+
session and passes the data-only result as `pageCodeValues`.
|
|
58
|
+
|
|
59
|
+
Leaving it out does **not** produce an error. `applyPageCodeValues` returns the
|
|
60
|
+
schema untouched when it gets no values, so the renderer draws the persisted
|
|
61
|
+
document — a different page, silently. And the difference is not small, because
|
|
62
|
+
Quick Properties write **only** into `elementCode`; no write path touches
|
|
63
|
+
`node.style` or `node.props`. A page whose author set anything in code mode
|
|
64
|
+
renders unconfigured without the runtime.
|
|
65
|
+
|
|
66
|
+
There is no realistic document that avoids this. A Quick Property *is* Element
|
|
67
|
+
Code, and a page with a button or a validated field has one.
|
|
68
|
+
|
|
69
|
+
```ts
|
|
70
|
+
const runtime = usePageCodeRuntime({ schema, pageId, /* … */ });
|
|
71
|
+
```
|
|
72
|
+
```vue
|
|
73
|
+
<CoarPageRenderer :schema :config :page-code-values="runtime.values.value" />
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
**Consequence to know about:** the persisted JSON on its own no longer
|
|
77
|
+
describes the page. Static `style` values left over from earlier authoring can
|
|
78
|
+
disagree with the code that overrides them, and the code wins. Read a document
|
|
79
|
+
through the runtime, not by eye.
|
|
80
|
+
|
|
81
|
+
## Node grammar
|
|
82
|
+
|
|
83
|
+
### Every node
|
|
84
|
+
|
|
85
|
+
| Field | Target-state surface |
|
|
86
|
+
|---|---|
|
|
87
|
+
| `id` | Canvas / Outline, builder-assigned — **named exception** |
|
|
88
|
+
| `style` | Element Code (`element.style`), Quick Properties for the common keys |
|
|
89
|
+
| `responsive` | Element Code (`element.responsive`) — **no Quick Property**, see gaps |
|
|
90
|
+
| `composition`, `compositionOrigins` | Compositions library — **named exception** |
|
|
91
|
+
|
|
92
|
+
`NodeStyle` in full: presentation (`surface`, `foreground`, `borderTone`,
|
|
93
|
+
`borderWidth`, `radius`, `elevation`), typography (`fontFamily`, `fontSize`,
|
|
94
|
+
`fontWeight`, `fontStyle`, `fontVariationSettings`, `lineHeight`,
|
|
95
|
+
`letterSpacing`, `textAlign`, `textDecoration`), layout (`gap`, `padding`,
|
|
96
|
+
`justify`, `align`, `direction`, `wrap`, `alignSelf`, `size`, `width`,
|
|
97
|
+
`minWidth`, `maxWidth`, `height`, `minHeight`, `maxHeight`, `aspectRatio`,
|
|
98
|
+
`overflow`, `hidden`). All of it is writable from Element Code. Quick Properties
|
|
99
|
+
cover the layout subset plus `hidden`; the token-backed keys are deliberately
|
|
100
|
+
code-only, because they carry design-system semantics that a free-text field
|
|
101
|
+
would invite authors to bypass.
|
|
102
|
+
|
|
103
|
+
### Elements
|
|
104
|
+
|
|
105
|
+
| Field | Target-state surface |
|
|
106
|
+
|---|---|
|
|
107
|
+
| `type` | Palette; Structure section for a representation switch |
|
|
108
|
+
| `name` | Structure section (free text, or a select over the field contract) |
|
|
109
|
+
| `props` | Element Code; Quick Properties for the common ones |
|
|
110
|
+
| `defaultValue` | Element Code (`element.defaultValue`) — no Quick Property |
|
|
111
|
+
| `validation` | Element Code; Quick Property for `required` only |
|
|
112
|
+
| `bindings` | Logic tab and the per-property *fx* buttons; Element Code |
|
|
113
|
+
| `visibleWhen` | Element Code (`element.visibleWhen`), full grammar |
|
|
114
|
+
| `elementCode` | Element Code dialog |
|
|
115
|
+
| `children` | Canvas / Outline |
|
|
116
|
+
|
|
117
|
+
### Page root
|
|
118
|
+
|
|
119
|
+
| Field | Target-state surface |
|
|
120
|
+
|---|---|
|
|
121
|
+
| `enterSubmits` | Page Root Code (`page.enterSubmits`) |
|
|
122
|
+
| `style`, `responsive` | Page Root Code, Quick Properties |
|
|
123
|
+
| `pageCode`, `rootCode`, `stateCode` | Their own editors |
|
|
124
|
+
| `translations` | Translations tab |
|
|
125
|
+
| `children` | Canvas / Outline |
|
|
126
|
+
| `schemaVersion` | Builder-managed — **named exception** |
|
|
127
|
+
| `style.width`, `style.height` | Not authorable — **named exception** |
|
|
128
|
+
|
|
129
|
+
## Named exceptions
|
|
130
|
+
|
|
131
|
+
Each states what it costs.
|
|
132
|
+
|
|
133
|
+
### The page is exactly its host container
|
|
134
|
+
|
|
135
|
+
Size values on the page root are dropped, and the root offers no size fields.
|
|
136
|
+
The page is one element inside the host's viewport, and the host container owns
|
|
137
|
+
its box; `overflow` stays authorable and defaults to `auto`. The contract for
|
|
138
|
+
the host is that the container must have a determinable height — for `body`
|
|
139
|
+
that means `html, body { height: 100% }`.
|
|
140
|
+
|
|
141
|
+
**Cost:** a document cannot make itself taller than its host. That is the
|
|
142
|
+
intent: a page that fights its container breaks in every second embedding.
|
|
143
|
+
|
|
144
|
+
### Structure is not code
|
|
145
|
+
|
|
146
|
+
`type`, `name`, `id` and `children` are authored visually, never by Element
|
|
147
|
+
Code — the runtime patch deliberately drops them. A program that could rename
|
|
148
|
+
or retype its own node would break every binding and Page Code reference that
|
|
149
|
+
points at it, at render time, with no way for the builder to see it coming.
|
|
150
|
+
|
|
151
|
+
**Cost:** generating elements from data is not possible per element. The
|
|
152
|
+
`repeat` element covers the case that motivates it.
|
|
153
|
+
|
|
154
|
+
### Identity is builder-managed
|
|
155
|
+
|
|
156
|
+
`id` is a UUID the builder assigns; `schemaVersion` is the wire format. A
|
|
157
|
+
hand-picked id collides, and a hand-picked version lies about the shape of the
|
|
158
|
+
document.
|
|
159
|
+
|
|
160
|
+
**Cost:** none for authors. Existing ids are preserved — the builder only
|
|
161
|
+
assigns missing ones.
|
|
162
|
+
|
|
163
|
+
### Composition metadata is repository-owned
|
|
164
|
+
|
|
165
|
+
`composition` and `compositionOrigins` record which reusable definition a
|
|
166
|
+
subtree came from and at which pinned version. Written by the Compositions
|
|
167
|
+
library, stripped by `compilePageCompositions()` before runtime delivery, never
|
|
168
|
+
hand-edited.
|
|
169
|
+
|
|
170
|
+
**Cost:** hand-editing them detaches an instance from its definition. The
|
|
171
|
+
builder then treats the subtree as ordinary nodes.
|
|
172
|
+
|
|
173
|
+
### Legacy ingest may rewrite the document
|
|
174
|
+
|
|
175
|
+
A document from an older `schemaVersion` is migrated on entry. This is the one
|
|
176
|
+
place where rule 2 does not hold, and it is bounded to documents the current
|
|
177
|
+
builder could not otherwise open.
|
|
178
|
+
|
|
179
|
+
**Cost:** a v1–v4 document saved by this builder comes back as v5. Round-trips
|
|
180
|
+
within one version rewrite nothing.
|
|
181
|
+
|
|
182
|
+
### Host CSS never reaches the document
|
|
183
|
+
|
|
184
|
+
There is no way for a document to carry a CSS class or a stylesheet. Styling is
|
|
185
|
+
`NodeStyle` per node, `CoarTheme` for brand colours, radii and fonts, and the
|
|
186
|
+
`visual-markup` element for free-form decoration inside its sealed iframe.
|
|
187
|
+
|
|
188
|
+
`config.stylePresets` used to be a fourth channel — a host-registered catalogue
|
|
189
|
+
of named classes the author could pick from. It was removed: the author who
|
|
190
|
+
builds a page owns the realm it renders in, so the restriction protected
|
|
191
|
+
nobody, and a class name written into a document couples it to one application's
|
|
192
|
+
stylesheet forever. A leftover `stylePreset` key in an old document is reported
|
|
193
|
+
as a warning, never stripped.
|
|
194
|
+
|
|
195
|
+
**Cost:** a vendor cannot ship a catalogue of ready-made looks. If that becomes
|
|
196
|
+
a product requirement, it is a new feature with its own design — not a revival
|
|
197
|
+
of this one.
|
|
198
|
+
|
|
199
|
+
### Host data has one channel
|
|
200
|
+
|
|
201
|
+
Everything the host knows travels through `runtimeContext`, allow-listed by
|
|
202
|
+
`config.contextFields`. There is no separate view-state input and no named
|
|
203
|
+
preview fixtures: "which screen is this right now" is ordinary host data, and
|
|
204
|
+
a fixture was a bundle of the very props the host already passes.
|
|
205
|
+
|
|
206
|
+
A context field may declare `values: string[]`, and the condition editor then
|
|
207
|
+
offers them as a dropdown instead of a free-text box. That is what makes a
|
|
208
|
+
host state, tier or status authorable without a second mechanism carrying it.
|
|
209
|
+
|
|
210
|
+
Three channels remain, each with one owner: `runtimeContext` (host), Page State
|
|
211
|
+
via `definePageState` (the page author), and the field values — `defaultValue`
|
|
212
|
+
authored, `initialValues` supplied by the host and winning over it.
|
|
213
|
+
|
|
214
|
+
**Cost:** a host wanting an "empty / typical / 50 items" preview picker builds
|
|
215
|
+
it in its own chrome and binds the chosen sample to `previewContext`. The
|
|
216
|
+
builder no longer draws that control.
|
|
217
|
+
|
|
218
|
+
### The document is not policed
|
|
219
|
+
|
|
220
|
+
There is no way for a host to pin a node as present, placed or visually
|
|
221
|
+
untouchable. `config.requiredNodes` did that and was removed: a page author
|
|
222
|
+
owns the realm the page renders in, and the mechanism did not hold anyway — a
|
|
223
|
+
locked node still vanished when the container above it was hidden, with the
|
|
224
|
+
document reporting no issue.
|
|
225
|
+
|
|
226
|
+
**Cost:** a host that must guarantee a notice — a compliance line on a consent
|
|
227
|
+
screen — enforces it where activation happens. The IDP contract already puts
|
|
228
|
+
publication behind trusted server validation; that check runs on the document
|
|
229
|
+
about to go live and cannot be reached from the browser.
|
|
230
|
+
|
|
231
|
+
### Token-backed style keys are code-only
|
|
232
|
+
|
|
233
|
+
`surface`, `radius`, `elevation` and the typography keys have no Quick
|
|
234
|
+
Property. They carry design-system semantics: a token name picked in passing
|
|
235
|
+
next to the canvas is how a page ends up with six subtly different card looks.
|
|
236
|
+
Element Code still writes them, so nothing is out of reach.
|
|
237
|
+
|
|
238
|
+
**Cost:** changing a card's surface needs the code editor. Deliberate friction.
|
|
239
|
+
|
|
240
|
+
## Open gaps
|
|
241
|
+
|
|
242
|
+
These violate the rules and are not exceptions.
|
|
243
|
+
|
|
244
|
+
### Blocking the removal of properties mode
|
|
245
|
+
|
|
246
|
+
| Gap | Evidence | Consequence |
|
|
247
|
+
|---|---|---|
|
|
248
|
+
| `visibleWhen` has no code-mode control | The Visibility section is legacy-only | Conditions become text-only. Acceptable under rule 1, but it is the single most-used non-style property. |
|
|
249
|
+
| Element inspectors are legacy-only | Only `visual-markup` sets `inspectorInCodeMode` | Every per-element prop not covered by a Quick Property becomes text-only: `heading.level`, `note.variant`, `otp.length`, `select.options`, `button.icon`/`validates`/`default`, `image.alt`/`assetId`, `repeat.*`, action wiring. |
|
|
250
|
+
|
|
251
|
+
### Renderer beyond the builder
|
|
252
|
+
|
|
253
|
+
| Gap | Evidence | Consequence |
|
|
254
|
+
|---|---|---|
|
|
255
|
+
| `repeat.maxItems` is not authorable anywhere | Renderer clamps to it (default 100, ceiling 500); no inspector field | A list longer than 100 items truncates and the author cannot say otherwise |
|
|
256
|
+
| `repeat.itemAlias` is not authorable | Only read, to label the binding picker | Cosmetic; the alias is stuck at its default |
|
|
257
|
+
| `feedback.emptyText` exists in the schema and nothing reads it | Neither renderer nor inspector | Dead field: implement it or remove it |
|
|
258
|
+
|
|
259
|
+
### Rule 2
|
|
260
|
+
|
|
261
|
+
| Gap | Evidence |
|
|
262
|
+
|---|---|
|
|
263
|
+
| Normalization heals instead of reporting | Duplicate names renamed, ids reassigned, heading levels clamped, legacy containers converted, non-object children dropped — on `v-model` assignment, initial value and JSON apply alike |
|
|
264
|
+
|
|
265
|
+
### Legacy-mode wording, dying with the mode
|
|
266
|
+
|
|
267
|
+
The Visibility section tells the author to "edit it in the JSON tab" for an
|
|
268
|
+
`in` condition and for an `equals` against a multi-value field, and its operator
|
|
269
|
+
list omits `in` / `notIn` although `conditions.ts` evaluates both. All three
|
|
270
|
+
live only in properties mode. They are wrong today — Element Code expresses all
|
|
271
|
+
of it — but they disappear with the mode rather than needing their own fix.
|