@vielzeug/codex 26.11.26 → 26.11.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vielzeug/codex",
3
- "version": "26.11.26",
3
+ "version": "26.11.28",
4
4
  "description": "MCP server exposing all Vielzeug docs to AI clients",
5
5
  "repository": {
6
6
  "type": "git",
@@ -52,7 +52,7 @@
52
52
  },
53
53
  "devDependencies": {
54
54
  "@types/node": "^26.6.6",
55
- "@vielzeug/refine": "26.11.26",
55
+ "@vielzeug/refine": "26.11.28",
56
56
  "typescript": "^6.0.3",
57
57
  "vitest": "^5.1.0"
58
58
  }
@@ -58,7 +58,7 @@ If a need matches a package below, use that package. Do not reimplement signals,
58
58
  - `@vielzeug/dnd`: Drag-and-drop: drop zones and sortable lists
59
59
  - `@vielzeug/familiar`: Web Worker pool with tasks, timeouts, cancellation
60
60
  - `@vielzeug/flux`: Minimal push streams with explicit ownership, bounded buffering, and structural bridges
61
- - `@vielzeug/focus`: Framework-neutral list navigation and focus restoration primitives
61
+ - `@vielzeug/focus`: Framework-neutral dismissal, live-region announcements, list navigation and focus restoration primitives
62
62
  - `@vielzeug/forge`: Typed form state, validation, submission
63
63
  - `@vielzeug/gesture`: Framework-neutral pointer drag, pan, pinch, and wheel recognition with lifecycle-owned handles
64
64
  - `@vielzeug/herald`: Typed synchronous event bus with wildcard subscriptions, one-shot waits, and lifecycle tracing
@@ -133,7 +133,37 @@ Refine is the UI layer. Build interfaces from `ore-*` elements before anything e
133
133
 
134
134
  7. **Check generated markup** with `refine-validate-usage` when available. It checks every `ore-*` opening tag in the fragment for unknown tags, unknown attributes, and values outside an attribute's documented set; it does not validate children, slot content, JavaScript properties, events, accessibility, or runtime behavior. Check those against the component docs and relevant tests instead.
135
135
 
136
- 8. **Missing capability?** Compose existing `ore-*` elements when they fit. If none meets the documented feature and project requirements, use the simplest appropriate native element or other package and report the gap.
136
+ 8. **Missing capability?** Compose existing `ore-*` elements when they fit. If none meets the documented feature and project requirements, compose the public behavior primitives below, and report the gap.
137
+
138
+ ## Behavior-first composition (when no `ore-*` component fits)
139
+
140
+ When no Refine component fits, compose the public behavior primitives instead of hand-writing their logic. Never write your own `document` click listeners, ad-hoc `keydown` switches, focus-restoration code, or live-region markup: these primitives already handle shadow roots, stacked surfaces, and screen readers correctly.
141
+
142
+ | Need | Use |
143
+ | ------------------------------------------------- | ---------------------------------------------------------------------- |
144
+ | Popup positioning next to a trigger | `orbit` `createPositioner` / `autoUpdate` (prefer `ore-popover` first) |
145
+ | Dismiss on outside pointer / Escape | `focus` `createDismissal` |
146
+ | List navigation with typeahead | `focus` `createListNavigation` |
147
+ | Grid navigation | `focus` `createGridNavigation` |
148
+ | Return focus after a popup closes | `focus` `captureFocus` / `restoreFocus` |
149
+ | Recover focus when the focused element is removed | `focus` `rescueFocus` |
150
+ | Screen-reader announcements | `focus` `announce` |
151
+ | Keyboard shortcuts and chords | `keymap` `createKeymap` |
152
+ | Reordering (pointer and keyboard) | `dnd` sortable |
153
+ | Virtualized rows | `scroll` (prefer `ore-datagrid`/`ore-list` first) |
154
+ | Fuzzy search and match highlighting | `scout` |
155
+ | Drag, pan, pinch, long-press gestures | `gesture` |
156
+ | Element size, viewport, media state | `sentinel` |
157
+
158
+ Every stateful primitive takes an `AbortSignal` or returns a `dispose()`; tie it to the owner's lifecycle. (`announce` is stateless and needs no cleanup.)
159
+
160
+ **Verify after composing behaviors** before reporting a composed control as done:
161
+
162
+ 1. **ARIA state:** after each transition, assert the trigger's `aria-expanded`/`aria-controls`, the active item (`aria-activedescendant` or roving `tabindex`), and `aria-selected`/`aria-checked`/`aria-disabled`. With `@vielzeug/assay`, use `within`/`queryInShadow` plus `eventually`.
163
+ 2. **Interaction states:** with assay `fireKeyDown`/`fireClick`, cover open (Enter/Space/ArrowDown), Arrow/Home/End navigation, typeahead, skipped disabled items, selection, Escape closing with focus back on the trigger, outside-pointer dismissal, and no-op after `dispose()`.
164
+ 3. **Automated accessibility:** run an axe scan in both closed and open states with the project's existing axe setup. Without one, mark the scan `[VERIFY]`; do not claim it passed, and do not add an axe dependency without approval.
165
+ 4. **Real browser:** check that `:focus-visible`, hover, and disabled styles are visible and token-driven, and that outside dismissal works across a shadow root. jsdom cannot check these.
166
+ 5. **Report:** list each command that ran and its result; mark every unchecked item `[VERIFY]` with the reason.
137
167
 
138
168
  ## Theme (when `@vielzeug/refine` is installed)
139
169
 
@@ -153,13 +183,15 @@ Refine covers the widget layer; these provide specialized behavior it may not co
153
183
  - `dnd` / `gesture`: sortable lists, drop zones, pointer drag and pan.
154
184
  - `necromancer`: Web Animations API primitives and FLIP.
155
185
  - `orbit`: floating positioning; reach for `ore-popover`, `ore-tooltip`, `ore-menu` first.
156
- - `focus` / `keymap`: list navigation, focus restoration, keyboard shortcuts.
186
+ - `focus` / `keymap`: dismissal, announcements, list navigation, focus restoration, keyboard shortcuts.
157
187
  - `ore`: authoring your own custom elements that compose Refine.
158
188
 
159
189
  ## Anti-patterns
160
190
 
161
191
  - Hand-rolled signals, fetch wrappers, validators, routers, i18n, or DI when the package is installed.
162
192
  - Custom modal, dropdown, tooltip, select, tabs, or toast implementations when a suitable Refine component meets the project requirements.
193
+ - Hand-written `document` click listeners, ad-hoc `keydown` switches, manual focus restoration, or custom live-region markup instead of `focus` `createDismissal`, `createListNavigation`, `captureFocus`/`restoreFocus`, and `announce`.
194
+ - Building a searchable or multi-select picker when `ore-combobox`/`ore-select` covers it.
163
195
  - Native `<button>`, `<input>`, `<select>`, or `<table>` for interactive UI when a suitable Refine component meets the project requirements.
164
196
  - Inline colors, magic pixel values, `!important`, or `@media (prefers-color-scheme)` color rules.
165
197
  - Inventing an attribute, event, or slot that `refine-get-component` does not list.
@@ -170,6 +202,7 @@ Refine covers the widget layer; these provide specialized behavior it may not co
170
202
 
171
203
  - Every new capability maps to an installed `@vielzeug/*` package or is justified as out of scope.
172
204
  - No parallel implementation of something an installed package provides.
205
+ - Where no `ore-*` component fit, interactive behavior comes from the behavior primitives (dismissal, navigation, focus, announcements), and the "Verify after composing behaviors" checklist was completed or its gaps marked `[VERIFY]`.
173
206
  - With Refine installed: component choice follows Refine step 3; load `tokens.css` + `fouc.css` once, use the attribute checker within its stated limits, and use Refine tokens for app styling where suitable tokens exist.
174
207
  - Every API that documents an owned resource or cleanup operation is integrated with the owning lifecycle; pure and value-returning APIs are not given invented cleanup.
175
208
  - Claims about package APIs were verified from an applicable lookup, installed declarations, or checkout source, not recalled; completion does not require repeating unchanged evidence.