You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
svelte-kit-vice/src/uix/morfo/components/drag-drop.ts

156 lines
4.5 KiB

morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
import type { Morfo } from '../types';
import { v } from '../types';
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
soma/morfo: typed createAttrs + 6 audit batches + form hang fix + A36 ## morfo: typed createAttrs - `types.ts`: all array fields are now `readonly` so morfos can be authored with `as const satisfies Morfo` without casts. - `createAttrs` is a generic `<const M extends MorfoShape>` that infers the emitted attr map from the morfo's literal shape. Typos like `attrs.trigerr` are now compile errors; autocomplete lists every valid part. - All 66 morfos migrated: `export const xMorfo = { ... } as const satisfies Morfo`. - Two latent bugs the new typing caught: `dateRangeFieldAttrs.root` and `timeRangeFieldAttrs.root` — legacy from the root→provider refactor, fixed to `.provider`. - Docs (morfo/README, COMPONENT_GUIDE) mandate `as const satisfies Morfo`; the older `: Morfo` annotation widens literals and loses autocomplete. ## Audit batches 1–7 (soma-audit-2026-04-20) Batch 1 — Keyboard a11y (A14/A12): - Tabs: `isFallbackTabStop(el)` using `untrack` → first trigger gets `tabindex=0` when no tab matches (WCAG 2.1.1 was failing). - RatingGroup: `dir` prop + `getDirectionalKeys(dir, 'horizontal')` for RTL. - Accordion P1-1/P1-6 dismissed: roving/labelledby already correct per APG. Batch 2 — A33 reactive collections: Select `labelRegistry` and NavigationMenu `triggerRefs` migrated to `SvelteMap`. Batch 3 — A31 O(N²) fix: RadioGroup lifts `hasSelection` + `isFallbackTabStop` to the provider with `untrack`-wrapped DOM walk. Per-item derivations drop from O(N²) to O(1) per trigger. Batch 4 — Morfo aria sync: toast / time-field / date-field / tabs / tag-group / navigation-menu declare every aria the provider emits (14 entries across 6 files). Batch 5 — Accessible naming props: Tabs.List, ToggleGroup, TreeView, NavigationMenu expose `aria-label?` / `aria-labelledby?` with explicit "required unless labelledby is set" JSDoc. Batch 6 — A30 cleanup: Checkbox `setLabelId` and 5 trigger-ref providers (select/tooltip/link-preview/dropdown-menu/context-menu) migrated from `$effect(() => parent.ref = opts.ref)` to the `Provider` base's `onRefChange` callback (fires via attachRef inside `untrack`). Batch 7 — A11 wrapper thinning: stepper/tree-view wrappers removed `ctx.get()`, providers expose proxy derivations; time/date-range-field inputs use `untrack(() => …)` for one-shot id registration; menubar content's 40-line keyboard nav moved to `MenubarMenuProvider.onContentKeydown`; color-picker area + channel-slider pointer state machines moved to the providers with `onpointerdown/move/up` emitted via `props`. form-auto-fields deferred with justification (reflective schema renderer, not a state-holding wrapper). ## Form hang fix (A36) `runValidate` entered the `isPromiseLike` branch even for sync schemas because sium's Standard-Schema adapter declares `validate: async`. The fallback `return { errors, issues }` read both reactive vars inside the validation `$effect` while the `.then(...)` microtask wrote them → microtask-mediated loop, silent to Svelte's sync effect-depth guard. Symptom: kitchen-sink hung the tab on mount with onChange / onBlur. Fix: `return untrack(() => ({ errors, issues }))`. Regression locked by two new 5s-timeout tests in `form-auto-fields.svelte.test.ts`. Pattern codified as A36 in COMPONENT_GUIDE; CLAUDE.md count updated to A1–A36 / 39 items. ## Verification - `npm run check`: 0 errors in soma/morfo scope (sema demo pre-existing errors untouched). - `npx vitest run src/uix/soma src/uix/morfo`: all tests green (94 + 7 = 101 tests, inc. 2 new form regression tests). - `npm run smoke`: 65/65 routes. - `npx tsx scripts/morfo-check.ts`: 66/66 morfos. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
export const dragDropMorfo = {
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
name: 'DragDrop',
kebab: 'drag-drop',
scope: ['soma', 'sema'],
uix: rename morfo.translations → morfo.texts (idlangref discipline) Morfo now declares text slots as absolute idlangrefs in `texts: Record<string, LangRef>`, not literal multilingual records. Multilingual content moves out of morfo entirely into per-component catalogs under `src/uix/langs/components/{kebab}.ts`, merged globally by `ActiveUix` via the new `componentLangs` barrel. Morfo stays a pure abstract surface; localization lives in its own layer. - Type: `translations?: LangNode` → `texts?: Record<string, LangRef>` in `src/uix/morfo/types.ts`. Doc and test fixtures updated. - Catalog: new `src/uix/langs/` directory with `common.ts` (was `langs.ts`), `components/` (one file per migrated morfo, plus a barrel), and an aggregate `uixLangs`. `ActiveUix` registers both namespaces at boot. - Registry: `registerMorfo` no longer carries a translations fingerprint and no longer extends `ActiveLangs` dynamically. `connectMorfoTranslations` and `MorfoTranslationTarget` deleted from the public morfo barrel. - Validation: schema.ts drops the relative-translationRef-in-morfo.translations check; catalog presence is enforced by the new `scripts/translations-check.ts` (wired as `npm run translations:check`). - Audit: `scripts/component-audit.ts` rule A-1.3 now validates `texts.label` idlangref shape (`#?components.{kebab}.label|Fallback`) and explicitly errors on any surviving legacy `translations:` field. - Migration: `scripts/migrate-translations-to-texts.ts` is the one-off Node script that produced the 42 morfo rewrites and 42 catalog files. - Tests: `morfo/registry.test.ts` rewritten around the simpler contract; `active-uix.svelte.test.ts` reflects boot-time catalog availability instead of lazy per-morfo extension. Verification: `npm run check` (0 errors), `npm run translations:check` (0/0), `npm run morfo:check` (36/36 routed). The 4 pre-existing failures in `test` are unrelated (date-picker types, css regen, range-calendar clear, color contract). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
texts: {
label: '#?components.drag-drop.label|Drag and drop',
uix: rename morfo.translations → morfo.texts (idlangref discipline) Morfo now declares text slots as absolute idlangrefs in `texts: Record<string, LangRef>`, not literal multilingual records. Multilingual content moves out of morfo entirely into per-component catalogs under `src/uix/langs/components/{kebab}.ts`, merged globally by `ActiveUix` via the new `componentLangs` barrel. Morfo stays a pure abstract surface; localization lives in its own layer. - Type: `translations?: LangNode` → `texts?: Record<string, LangRef>` in `src/uix/morfo/types.ts`. Doc and test fixtures updated. - Catalog: new `src/uix/langs/` directory with `common.ts` (was `langs.ts`), `components/` (one file per migrated morfo, plus a barrel), and an aggregate `uixLangs`. `ActiveUix` registers both namespaces at boot. - Registry: `registerMorfo` no longer carries a translations fingerprint and no longer extends `ActiveLangs` dynamically. `connectMorfoTranslations` and `MorfoTranslationTarget` deleted from the public morfo barrel. - Validation: schema.ts drops the relative-translationRef-in-morfo.translations check; catalog presence is enforced by the new `scripts/translations-check.ts` (wired as `npm run translations:check`). - Audit: `scripts/component-audit.ts` rule A-1.3 now validates `texts.label` idlangref shape (`#?components.{kebab}.label|Fallback`) and explicitly errors on any surviving legacy `translations:` field. - Migration: `scripts/migrate-translations-to-texts.ts` is the one-off Node script that produced the 42 morfo rewrites and 42 catalog files. - Tests: `morfo/registry.test.ts` rewritten around the simpler contract; `active-uix.svelte.test.ts` reflects boot-time catalog availability instead of lazy per-morfo extension. Verification: `npm run check` (0 errors), `npm run translations:check` (0/0), `npm run morfo:check` (36/36 routed). The 4 pre-existing failures in `test` are unrelated (date-picker types, css regen, range-calendar clear, color contract). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'drag-started': '#?components.drag-drop.drag-started|Started dragging {{item}}',
'drag-over': '#?components.drag-drop.drag-over|Over drop zone {{target}}',
dropped: '#?components.drag-drop.dropped|Dropped {{item}} on {{target}}',
cancelled: '#?components.drag-drop.cancelled|Drag cancelled',
'no-targets': '#?components.drag-drop.no-targets|No drop targets available',
draggable: '#?components.drag-drop.draggable|Draggable',
droppable: '#?components.drag-drop.droppable|Drop zone',
'draggable-role': '#?components.drag-drop.draggable-role|draggable',
'droppable-role': '#?components.drag-drop.droppable-role|drop zone',
'droppable-active': '#?components.drag-drop.droppable-active|active drop zone'
},
events: [
{
refactor(morfo): align 22 events with book family doctrine (Capa 2) Resolves family-level misclassifications across 9 morfos. Each cluster maps a doctrinally wrong family to the book's literal prescription: CLUSTER 4 — announce (cap. 24 §5): - commit-announce-polite (commit.submit) → signal-announce (signal.announce + neutral) - commit-announce-assertive (commit.submit) → signal-alert (signal.alert + threat) Announcing is the canonical signal verb. Was misclassified as commit. CLUSTER 5 — checkbox (cap. 22 §10, option B per user): - commit-check (commit.select) → commit-toggle-check (commit.toggle + affirm) - commit-uncheck (commit.remove) → commit-toggle-uncheck (commit.toggle + neutral) Book literal: "Toggle: contact.press → commit.toggle + affirm". Two events retained (option B) so check/uncheck carry different intents; same canonical verb `toggle` per book. CLUSTER 1 — tree-view + tree-grid (cap. 26): - shift-expand (shift.navigate) → emerge-expand (emerge.expand) - shift-collapse (shift.navigate) → emerge-collapse (emerge.collapse) Book literal: "emerge.expand — una región crece y revela contenido". Tree node expansion reveals content; it's not a context shift. CLUSTER 3 — drag-drop (cap. 25 §4): - commit-drag-start (commit.submit) → handle-pick (handle.pick) - commit-drop (commit.submit) → handle-drop (handle.drop) - commit-cancel verb 'reset' → verb 'cancel' (was inconsistent with name) Book literal pick → carry → drop. The commit (reorder/delete/move) lives downstream in whichever morfo owns the moved entity, not on drag-drop. CLUSTER 6 — table (cap. 23, 26): - shift-sort (shift.navigate) → commit-set-sort (commit.set + neutral) Sort sets a criterion; the reorder is consequence. Not regime change. - shift-expand-row (shift.navigate) → emerge-expand-row (emerge.expand) Same argument as tree. CLUSTER 2 — virtual-list + virtual-grid (cap. 25, 27, 23): - shift-scroll, shift-scroll-row, shift-scroll-column (shift.navigate) → handle-scroll, handle-scroll-row, handle-scroll-column (handle.scroll) User-initiated scroll = direct manipulation of viewport. `scroll` extends the book's literal handle verb list per Cap 8 §1. - shift-scroll-to-index, shift-scroll-to-cell (shift.navigate) → shift-navigate-to-index, shift-navigate-to-cell (shift.navigate) Programmatic scroll = the SYSTEM moves the viewport, not the user. Still shift.navigate, but name now surfaces family+verb canonical shape. - shift-resize (shift.navigate) → commit-set-resize (commit.set + neutral) System applies a new container/data size. Useful for "items loaded" cues. CLUSTER 7 — clipboard (cap. 23, user directive): - commit-copy (commit.submit + affirm) → commit-save-copy (commit.save + affirm) Value persisted to clipboard = save per book. - commit-copy-error (commit.submit + threat) → commit-fail-copy (commit.fail + risk) Failure is fail + risk (correctable, not threat which is exigent). - shift-reset (shift.navigate) → REMOVED Timer-driven internal flag flip; no subscriber; not a perceptive event per user directive ("eliminar si no es perceptivo"). The visible label revert is signalled by `data-copied` attribute. Verification: - `npm run morfo:vocabulary`: warns 57 → 35 (-22), EXIT 0 - `npx vitest src/uix/sema src/uix/morfo`: 195/195 pass - checkbox provider tests: 4/4 pass - `npm run check`: no new errors from these changes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
// Per book cap. 25 §4 literal: "Pick — handle.pick — ¿he
// agarrado esto?". Start of direct manipulation. NOT a commit
// (commit is the consequence of the drop, fired by whichever
// morfo owns the moved/deleted entity).
name: 'handle-pick',
semantic: {
refactor(morfo): align 22 events with book family doctrine (Capa 2) Resolves family-level misclassifications across 9 morfos. Each cluster maps a doctrinally wrong family to the book's literal prescription: CLUSTER 4 — announce (cap. 24 §5): - commit-announce-polite (commit.submit) → signal-announce (signal.announce + neutral) - commit-announce-assertive (commit.submit) → signal-alert (signal.alert + threat) Announcing is the canonical signal verb. Was misclassified as commit. CLUSTER 5 — checkbox (cap. 22 §10, option B per user): - commit-check (commit.select) → commit-toggle-check (commit.toggle + affirm) - commit-uncheck (commit.remove) → commit-toggle-uncheck (commit.toggle + neutral) Book literal: "Toggle: contact.press → commit.toggle + affirm". Two events retained (option B) so check/uncheck carry different intents; same canonical verb `toggle` per book. CLUSTER 1 — tree-view + tree-grid (cap. 26): - shift-expand (shift.navigate) → emerge-expand (emerge.expand) - shift-collapse (shift.navigate) → emerge-collapse (emerge.collapse) Book literal: "emerge.expand — una región crece y revela contenido". Tree node expansion reveals content; it's not a context shift. CLUSTER 3 — drag-drop (cap. 25 §4): - commit-drag-start (commit.submit) → handle-pick (handle.pick) - commit-drop (commit.submit) → handle-drop (handle.drop) - commit-cancel verb 'reset' → verb 'cancel' (was inconsistent with name) Book literal pick → carry → drop. The commit (reorder/delete/move) lives downstream in whichever morfo owns the moved entity, not on drag-drop. CLUSTER 6 — table (cap. 23, 26): - shift-sort (shift.navigate) → commit-set-sort (commit.set + neutral) Sort sets a criterion; the reorder is consequence. Not regime change. - shift-expand-row (shift.navigate) → emerge-expand-row (emerge.expand) Same argument as tree. CLUSTER 2 — virtual-list + virtual-grid (cap. 25, 27, 23): - shift-scroll, shift-scroll-row, shift-scroll-column (shift.navigate) → handle-scroll, handle-scroll-row, handle-scroll-column (handle.scroll) User-initiated scroll = direct manipulation of viewport. `scroll` extends the book's literal handle verb list per Cap 8 §1. - shift-scroll-to-index, shift-scroll-to-cell (shift.navigate) → shift-navigate-to-index, shift-navigate-to-cell (shift.navigate) Programmatic scroll = the SYSTEM moves the viewport, not the user. Still shift.navigate, but name now surfaces family+verb canonical shape. - shift-resize (shift.navigate) → commit-set-resize (commit.set + neutral) System applies a new container/data size. Useful for "items loaded" cues. CLUSTER 7 — clipboard (cap. 23, user directive): - commit-copy (commit.submit + affirm) → commit-save-copy (commit.save + affirm) Value persisted to clipboard = save per book. - commit-copy-error (commit.submit + threat) → commit-fail-copy (commit.fail + risk) Failure is fail + risk (correctable, not threat which is exigent). - shift-reset (shift.navigate) → REMOVED Timer-driven internal flag flip; no subscriber; not a perceptive event per user directive ("eliminar si no es perceptivo"). The visible label revert is signalled by `data-copied` attribute. Verification: - `npm run morfo:vocabulary`: warns 57 → 35 (-22), EXIT 0 - `npx vitest src/uix/sema src/uix/morfo`: 195/195 pass - checkbox provider tests: 4/4 pass - `npm run check`: no new errors from these changes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
family: 'handle',
verb: 'pick',
target: v.partRef('draggable'),
sequence: 'post'
}
},
{
refactor(morfo): align 22 events with book family doctrine (Capa 2) Resolves family-level misclassifications across 9 morfos. Each cluster maps a doctrinally wrong family to the book's literal prescription: CLUSTER 4 — announce (cap. 24 §5): - commit-announce-polite (commit.submit) → signal-announce (signal.announce + neutral) - commit-announce-assertive (commit.submit) → signal-alert (signal.alert + threat) Announcing is the canonical signal verb. Was misclassified as commit. CLUSTER 5 — checkbox (cap. 22 §10, option B per user): - commit-check (commit.select) → commit-toggle-check (commit.toggle + affirm) - commit-uncheck (commit.remove) → commit-toggle-uncheck (commit.toggle + neutral) Book literal: "Toggle: contact.press → commit.toggle + affirm". Two events retained (option B) so check/uncheck carry different intents; same canonical verb `toggle` per book. CLUSTER 1 — tree-view + tree-grid (cap. 26): - shift-expand (shift.navigate) → emerge-expand (emerge.expand) - shift-collapse (shift.navigate) → emerge-collapse (emerge.collapse) Book literal: "emerge.expand — una región crece y revela contenido". Tree node expansion reveals content; it's not a context shift. CLUSTER 3 — drag-drop (cap. 25 §4): - commit-drag-start (commit.submit) → handle-pick (handle.pick) - commit-drop (commit.submit) → handle-drop (handle.drop) - commit-cancel verb 'reset' → verb 'cancel' (was inconsistent with name) Book literal pick → carry → drop. The commit (reorder/delete/move) lives downstream in whichever morfo owns the moved entity, not on drag-drop. CLUSTER 6 — table (cap. 23, 26): - shift-sort (shift.navigate) → commit-set-sort (commit.set + neutral) Sort sets a criterion; the reorder is consequence. Not regime change. - shift-expand-row (shift.navigate) → emerge-expand-row (emerge.expand) Same argument as tree. CLUSTER 2 — virtual-list + virtual-grid (cap. 25, 27, 23): - shift-scroll, shift-scroll-row, shift-scroll-column (shift.navigate) → handle-scroll, handle-scroll-row, handle-scroll-column (handle.scroll) User-initiated scroll = direct manipulation of viewport. `scroll` extends the book's literal handle verb list per Cap 8 §1. - shift-scroll-to-index, shift-scroll-to-cell (shift.navigate) → shift-navigate-to-index, shift-navigate-to-cell (shift.navigate) Programmatic scroll = the SYSTEM moves the viewport, not the user. Still shift.navigate, but name now surfaces family+verb canonical shape. - shift-resize (shift.navigate) → commit-set-resize (commit.set + neutral) System applies a new container/data size. Useful for "items loaded" cues. CLUSTER 7 — clipboard (cap. 23, user directive): - commit-copy (commit.submit + affirm) → commit-save-copy (commit.save + affirm) Value persisted to clipboard = save per book. - commit-copy-error (commit.submit + threat) → commit-fail-copy (commit.fail + risk) Failure is fail + risk (correctable, not threat which is exigent). - shift-reset (shift.navigate) → REMOVED Timer-driven internal flag flip; no subscriber; not a perceptive event per user directive ("eliminar si no es perceptivo"). The visible label revert is signalled by `data-copied` attribute. Verification: - `npm run morfo:vocabulary`: warns 57 → 35 (-22), EXIT 0 - `npx vitest src/uix/sema src/uix/morfo`: 195/195 pass - checkbox provider tests: 4/4 pass - `npm run check`: no new errors from these changes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
// Per book cap. 25 §4 literal: "Drop — handle.drop — ¿qué
// ocurrió al soltar?". Just the release; what the release
// resolves (commit.reorder + affirm, commit.delete + loss,
// etc.) lives in the morfo that owns the target/entity.
name: 'handle-drop',
semantic: {
refactor(morfo): align 22 events with book family doctrine (Capa 2) Resolves family-level misclassifications across 9 morfos. Each cluster maps a doctrinally wrong family to the book's literal prescription: CLUSTER 4 — announce (cap. 24 §5): - commit-announce-polite (commit.submit) → signal-announce (signal.announce + neutral) - commit-announce-assertive (commit.submit) → signal-alert (signal.alert + threat) Announcing is the canonical signal verb. Was misclassified as commit. CLUSTER 5 — checkbox (cap. 22 §10, option B per user): - commit-check (commit.select) → commit-toggle-check (commit.toggle + affirm) - commit-uncheck (commit.remove) → commit-toggle-uncheck (commit.toggle + neutral) Book literal: "Toggle: contact.press → commit.toggle + affirm". Two events retained (option B) so check/uncheck carry different intents; same canonical verb `toggle` per book. CLUSTER 1 — tree-view + tree-grid (cap. 26): - shift-expand (shift.navigate) → emerge-expand (emerge.expand) - shift-collapse (shift.navigate) → emerge-collapse (emerge.collapse) Book literal: "emerge.expand — una región crece y revela contenido". Tree node expansion reveals content; it's not a context shift. CLUSTER 3 — drag-drop (cap. 25 §4): - commit-drag-start (commit.submit) → handle-pick (handle.pick) - commit-drop (commit.submit) → handle-drop (handle.drop) - commit-cancel verb 'reset' → verb 'cancel' (was inconsistent with name) Book literal pick → carry → drop. The commit (reorder/delete/move) lives downstream in whichever morfo owns the moved entity, not on drag-drop. CLUSTER 6 — table (cap. 23, 26): - shift-sort (shift.navigate) → commit-set-sort (commit.set + neutral) Sort sets a criterion; the reorder is consequence. Not regime change. - shift-expand-row (shift.navigate) → emerge-expand-row (emerge.expand) Same argument as tree. CLUSTER 2 — virtual-list + virtual-grid (cap. 25, 27, 23): - shift-scroll, shift-scroll-row, shift-scroll-column (shift.navigate) → handle-scroll, handle-scroll-row, handle-scroll-column (handle.scroll) User-initiated scroll = direct manipulation of viewport. `scroll` extends the book's literal handle verb list per Cap 8 §1. - shift-scroll-to-index, shift-scroll-to-cell (shift.navigate) → shift-navigate-to-index, shift-navigate-to-cell (shift.navigate) Programmatic scroll = the SYSTEM moves the viewport, not the user. Still shift.navigate, but name now surfaces family+verb canonical shape. - shift-resize (shift.navigate) → commit-set-resize (commit.set + neutral) System applies a new container/data size. Useful for "items loaded" cues. CLUSTER 7 — clipboard (cap. 23, user directive): - commit-copy (commit.submit + affirm) → commit-save-copy (commit.save + affirm) Value persisted to clipboard = save per book. - commit-copy-error (commit.submit + threat) → commit-fail-copy (commit.fail + risk) Failure is fail + risk (correctable, not threat which is exigent). - shift-reset (shift.navigate) → REMOVED Timer-driven internal flag flip; no subscriber; not a perceptive event per user directive ("eliminar si no es perceptivo"). The visible label revert is signalled by `data-copied` attribute. Verification: - `npm run morfo:vocabulary`: warns 57 → 35 (-22), EXIT 0 - `npx vitest src/uix/sema src/uix/morfo`: 195/195 pass - checkbox provider tests: 4/4 pass - `npm run check`: no new errors from these changes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
family: 'handle',
verb: 'drop',
target: v.partRef('droppable'),
sequence: 'post'
}
},
{
refactor(morfo): align 22 events with book family doctrine (Capa 2) Resolves family-level misclassifications across 9 morfos. Each cluster maps a doctrinally wrong family to the book's literal prescription: CLUSTER 4 — announce (cap. 24 §5): - commit-announce-polite (commit.submit) → signal-announce (signal.announce + neutral) - commit-announce-assertive (commit.submit) → signal-alert (signal.alert + threat) Announcing is the canonical signal verb. Was misclassified as commit. CLUSTER 5 — checkbox (cap. 22 §10, option B per user): - commit-check (commit.select) → commit-toggle-check (commit.toggle + affirm) - commit-uncheck (commit.remove) → commit-toggle-uncheck (commit.toggle + neutral) Book literal: "Toggle: contact.press → commit.toggle + affirm". Two events retained (option B) so check/uncheck carry different intents; same canonical verb `toggle` per book. CLUSTER 1 — tree-view + tree-grid (cap. 26): - shift-expand (shift.navigate) → emerge-expand (emerge.expand) - shift-collapse (shift.navigate) → emerge-collapse (emerge.collapse) Book literal: "emerge.expand — una región crece y revela contenido". Tree node expansion reveals content; it's not a context shift. CLUSTER 3 — drag-drop (cap. 25 §4): - commit-drag-start (commit.submit) → handle-pick (handle.pick) - commit-drop (commit.submit) → handle-drop (handle.drop) - commit-cancel verb 'reset' → verb 'cancel' (was inconsistent with name) Book literal pick → carry → drop. The commit (reorder/delete/move) lives downstream in whichever morfo owns the moved entity, not on drag-drop. CLUSTER 6 — table (cap. 23, 26): - shift-sort (shift.navigate) → commit-set-sort (commit.set + neutral) Sort sets a criterion; the reorder is consequence. Not regime change. - shift-expand-row (shift.navigate) → emerge-expand-row (emerge.expand) Same argument as tree. CLUSTER 2 — virtual-list + virtual-grid (cap. 25, 27, 23): - shift-scroll, shift-scroll-row, shift-scroll-column (shift.navigate) → handle-scroll, handle-scroll-row, handle-scroll-column (handle.scroll) User-initiated scroll = direct manipulation of viewport. `scroll` extends the book's literal handle verb list per Cap 8 §1. - shift-scroll-to-index, shift-scroll-to-cell (shift.navigate) → shift-navigate-to-index, shift-navigate-to-cell (shift.navigate) Programmatic scroll = the SYSTEM moves the viewport, not the user. Still shift.navigate, but name now surfaces family+verb canonical shape. - shift-resize (shift.navigate) → commit-set-resize (commit.set + neutral) System applies a new container/data size. Useful for "items loaded" cues. CLUSTER 7 — clipboard (cap. 23, user directive): - commit-copy (commit.submit + affirm) → commit-save-copy (commit.save + affirm) Value persisted to clipboard = save per book. - commit-copy-error (commit.submit + threat) → commit-fail-copy (commit.fail + risk) Failure is fail + risk (correctable, not threat which is exigent). - shift-reset (shift.navigate) → REMOVED Timer-driven internal flag flip; no subscriber; not a perceptive event per user directive ("eliminar si no es perceptivo"). The visible label revert is signalled by `data-copied` attribute. Verification: - `npm run morfo:vocabulary`: warns 57 → 35 (-22), EXIT 0 - `npx vitest src/uix/sema src/uix/morfo`: 195/195 pass - checkbox provider tests: 4/4 pass - `npm run check`: no new errors from these changes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
// User cancelled the drag (Escape during carry). The operation
// reverts; nothing committed downstream. `commit.cancel` per
// book cap. 23.
name: 'commit-cancel',
semantic: {
family: 'commit',
refactor(morfo): align 22 events with book family doctrine (Capa 2) Resolves family-level misclassifications across 9 morfos. Each cluster maps a doctrinally wrong family to the book's literal prescription: CLUSTER 4 — announce (cap. 24 §5): - commit-announce-polite (commit.submit) → signal-announce (signal.announce + neutral) - commit-announce-assertive (commit.submit) → signal-alert (signal.alert + threat) Announcing is the canonical signal verb. Was misclassified as commit. CLUSTER 5 — checkbox (cap. 22 §10, option B per user): - commit-check (commit.select) → commit-toggle-check (commit.toggle + affirm) - commit-uncheck (commit.remove) → commit-toggle-uncheck (commit.toggle + neutral) Book literal: "Toggle: contact.press → commit.toggle + affirm". Two events retained (option B) so check/uncheck carry different intents; same canonical verb `toggle` per book. CLUSTER 1 — tree-view + tree-grid (cap. 26): - shift-expand (shift.navigate) → emerge-expand (emerge.expand) - shift-collapse (shift.navigate) → emerge-collapse (emerge.collapse) Book literal: "emerge.expand — una región crece y revela contenido". Tree node expansion reveals content; it's not a context shift. CLUSTER 3 — drag-drop (cap. 25 §4): - commit-drag-start (commit.submit) → handle-pick (handle.pick) - commit-drop (commit.submit) → handle-drop (handle.drop) - commit-cancel verb 'reset' → verb 'cancel' (was inconsistent with name) Book literal pick → carry → drop. The commit (reorder/delete/move) lives downstream in whichever morfo owns the moved entity, not on drag-drop. CLUSTER 6 — table (cap. 23, 26): - shift-sort (shift.navigate) → commit-set-sort (commit.set + neutral) Sort sets a criterion; the reorder is consequence. Not regime change. - shift-expand-row (shift.navigate) → emerge-expand-row (emerge.expand) Same argument as tree. CLUSTER 2 — virtual-list + virtual-grid (cap. 25, 27, 23): - shift-scroll, shift-scroll-row, shift-scroll-column (shift.navigate) → handle-scroll, handle-scroll-row, handle-scroll-column (handle.scroll) User-initiated scroll = direct manipulation of viewport. `scroll` extends the book's literal handle verb list per Cap 8 §1. - shift-scroll-to-index, shift-scroll-to-cell (shift.navigate) → shift-navigate-to-index, shift-navigate-to-cell (shift.navigate) Programmatic scroll = the SYSTEM moves the viewport, not the user. Still shift.navigate, but name now surfaces family+verb canonical shape. - shift-resize (shift.navigate) → commit-set-resize (commit.set + neutral) System applies a new container/data size. Useful for "items loaded" cues. CLUSTER 7 — clipboard (cap. 23, user directive): - commit-copy (commit.submit + affirm) → commit-save-copy (commit.save + affirm) Value persisted to clipboard = save per book. - commit-copy-error (commit.submit + threat) → commit-fail-copy (commit.fail + risk) Failure is fail + risk (correctable, not threat which is exigent). - shift-reset (shift.navigate) → REMOVED Timer-driven internal flag flip; no subscriber; not a perceptive event per user directive ("eliminar si no es perceptivo"). The visible label revert is signalled by `data-copied` attribute. Verification: - `npm run morfo:vocabulary`: warns 57 → 35 (-22), EXIT 0 - `npx vitest src/uix/sema src/uix/morfo`: 195/195 pass - checkbox provider tests: 4/4 pass - `npm run check`: no new errors from these changes Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
verb: 'cancel',
target: v.partRef('draggable'),
intent: 'neutral',
sequence: 'post'
}
}
],
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
parts: [
{
name: 'Provider',
kebab: 'provider',
morfo: catalog `archetype` across 65 components (~265 part declarations) Bulk classification pass that gives every part a cross-component archetype where one applies. Done with `scripts/catalog-archetypes.ts` — a one-shot mechanical mapping based on a kebab → archetype table, plus three manual overrides for components where Provider IS the interactive element. Coverage - 440 part declarations examined. - ~265 received an archetype (provider, trigger, content, overlay, viewport, item, indicator, thumb, track, label, title, description, close, action, header, image, fallback, arrow, separator, group, input, segment). - ~175 left without one — genuinely component-specific (Slider.Range, PinInput.Segment internals, color-picker channel-slider, etc.). Manual overrides (Provider IS the trigger) - Toggle, Switch, Checkbox: their `Provider` part is a `<button>` that the user actually interacts with, not a root container. Archetype set to `'trigger'` instead of the default `'provider'` so eidos can style them alongside Dialog.Trigger / Popover.Trigger / etc. Script (scripts/catalog-archetypes.ts) - Walks every `*.ts` under `src/uix/morfo/components/`. - Inserts `archetype: '...'` directly after the matching `kebab:` line when a mapping exists. - Idempotent — skips parts that already declare an archetype. - Indent-aware — only operates on part kebabs (≥2 tabs), never the morfo root kebab. Bug discovered + fixed mid-pass when radio-group's root kebab `'radio-group'` matched the `'radio-group' → 'group'` alias and inserted at the wrong level (cleaned up by hand). - Reports per-file counts + the list of unmapped kebabs at the end so future passes can extend the mapping. Tests - Updated `omits data-archetype when not declared` test to use a tiny inline morfo (Toggle's Provider now has archetype 'trigger', so it can't be the "no archetype" fixture anymore). Verification - 22/22 runtime tests, full focused suite green. - 66/66 morfo-check (every component still validates against its DOM — archetype is additive, doesn't change emitted attrs apart from the new `data-archetype="..."` which morfo-check doesn't enforce yet). - 68/68 smoke routes. - svelte-check unchanged at 155.
6 months ago
archetype: 'provider',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
kind: 'public',
defaultElement: 'div',
optional: false,
data: [{ attr: 'data-dragging', severity: 'optional' }],
aria: []
},
{
name: 'Draggable',
kebab: 'draggable',
kind: 'public',
defaultElement: 'div',
role: 'button',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
optional: false,
data: [
{ attr: 'data-value' },
{ attr: 'data-text-value', severity: 'optional' },
{ attr: 'data-drag-handle', severity: 'optional' },
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
{ attr: 'data-dragging', severity: 'optional' },
{ attr: 'data-disabled', severity: 'optional' }
],
aria: [
{
attr: 'aria-roledescription',
value: v.translationRef('#?components.drag-drop.draggable|Draggable')
},
{
attr: 'aria-disabled',
value: v.literal('true'),
severity: 'optional',
condition: { when: 'prop-truthy', prop: 'disabled' }
},
{
attr: 'aria-grabbed',
value: v.literal('true'),
severity: 'optional',
condition: { when: 'prop-truthy', prop: 'active' }
}
],
keyboard: [
{ key: 'Enter', action: 'activate' },
{ key: ' ', action: 'activate' },
{ key: 'Escape', action: 'cancel' },
{ key: 'ArrowDown', action: 'next' },
{ key: 'ArrowRight', action: 'next' },
{ key: 'ArrowUp', action: 'prev' },
{ key: 'ArrowLeft', action: 'prev' },
{ key: 'Tab', action: 'next' },
{ key: 'Shift+Tab', action: 'prev' }
]
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
},
{
name: 'Droppable',
kebab: 'droppable',
kind: 'public',
defaultElement: 'div',
role: 'region',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
optional: false,
data: [
{ attr: 'data-dragover', severity: 'optional' },
{ attr: 'data-accepting', severity: 'optional' },
{ attr: 'data-text-value', severity: 'optional' },
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
{ attr: 'data-disabled', severity: 'optional' }
],
aria: [
{
attr: 'aria-roledescription',
value: v.translationRef('#?components.drag-drop.droppable|Drop zone')
},
{ attr: 'aria-dropeffect', value: v.propRef('dropEffect'), severity: 'optional' },
{
attr: 'aria-disabled',
value: v.literal('true'),
severity: 'optional',
condition: { when: 'prop-truthy', prop: 'disabled' }
}
]
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
},
{
name: 'Preview',
kebab: 'preview',
morfo: catalog `archetype` across 65 components (~265 part declarations) Bulk classification pass that gives every part a cross-component archetype where one applies. Done with `scripts/catalog-archetypes.ts` — a one-shot mechanical mapping based on a kebab → archetype table, plus three manual overrides for components where Provider IS the interactive element. Coverage - 440 part declarations examined. - ~265 received an archetype (provider, trigger, content, overlay, viewport, item, indicator, thumb, track, label, title, description, close, action, header, image, fallback, arrow, separator, group, input, segment). - ~175 left without one — genuinely component-specific (Slider.Range, PinInput.Segment internals, color-picker channel-slider, etc.). Manual overrides (Provider IS the trigger) - Toggle, Switch, Checkbox: their `Provider` part is a `<button>` that the user actually interacts with, not a root container. Archetype set to `'trigger'` instead of the default `'provider'` so eidos can style them alongside Dialog.Trigger / Popover.Trigger / etc. Script (scripts/catalog-archetypes.ts) - Walks every `*.ts` under `src/uix/morfo/components/`. - Inserts `archetype: '...'` directly after the matching `kebab:` line when a mapping exists. - Idempotent — skips parts that already declare an archetype. - Indent-aware — only operates on part kebabs (≥2 tabs), never the morfo root kebab. Bug discovered + fixed mid-pass when radio-group's root kebab `'radio-group'` matched the `'radio-group' → 'group'` alias and inserted at the wrong level (cleaned up by hand). - Reports per-file counts + the list of unmapped kebabs at the end so future passes can extend the mapping. Tests - Updated `omits data-archetype when not declared` test to use a tiny inline morfo (Toggle's Provider now has archetype 'trigger', so it can't be the "no archetype" fixture anymore). Verification - 22/22 runtime tests, full focused suite green. - 66/66 morfo-check (every component still validates against its DOM — archetype is additive, doesn't change emitted attrs apart from the new `data-archetype="..."` which morfo-check doesn't enforce yet). - 68/68 smoke routes. - svelte-check unchanged at 155.
6 months ago
archetype: 'preview',
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
kind: 'public',
defaultElement: 'div',
optional: true,
data: [{ attr: 'data-active', severity: 'optional' }],
aria: [{ attr: 'aria-hidden', value: v.literal('true') }]
morfo: port 65 components + sium.lazy + morfo-check passes 66/66 All 65 soma components now consume their morfo as the cross-layer contract. createAttrs(morfo) and registerContract(morfo) overloads removed — the Morfo form is now mandatory. Each component provider has a 3-line morfo import + wire-up block instead of 20+ lines of inline declarations. Additions: sium/core/lazy.ts — lazy() combinator for recursive schemas (unblocks morfo's eventual lazy part-tree validation; tests included). sium/examples/ — booking, color, login, settings, signup, survey, tree form demos. Route demos at src/routes/test/sium/{booking,color,login,settings, signup,survey,tree}. Tooling: morfo-check.ts — now tolerates sibling parts sharing a physical element (Link variant of Item, etc.). Queries via allPartAttrs cross-scope. morfo-vocabulary-check.ts — 28 WARN (legitimate per-component vocabularies or subsets like switch missing "indeterminate"). All reviewed, none are bugs. Fixes caught by morfo-check: table: data-sorted / data-pinned marked severity:'optional' (only emitted when sorting/pinning active, not always). tree-grid: data-expanded on Row severity:'optional' (branches only). menubar: data-menubar-value declared on Trigger. splitter: data-splitter-panel-id declared on Panel. Verify: npm run check — 0 morfo errors (4 pre-existing in sium/examples, unrelated). npx vitest run src/uix/morfo — 7/7 tests pass. npm run smoke — 65/65 routes pass. npm run morfo:check — 66/66 morfos validate against real DOM. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
}
]
soma/morfo: typed createAttrs + 6 audit batches + form hang fix + A36 ## morfo: typed createAttrs - `types.ts`: all array fields are now `readonly` so morfos can be authored with `as const satisfies Morfo` without casts. - `createAttrs` is a generic `<const M extends MorfoShape>` that infers the emitted attr map from the morfo's literal shape. Typos like `attrs.trigerr` are now compile errors; autocomplete lists every valid part. - All 66 morfos migrated: `export const xMorfo = { ... } as const satisfies Morfo`. - Two latent bugs the new typing caught: `dateRangeFieldAttrs.root` and `timeRangeFieldAttrs.root` — legacy from the root→provider refactor, fixed to `.provider`. - Docs (morfo/README, COMPONENT_GUIDE) mandate `as const satisfies Morfo`; the older `: Morfo` annotation widens literals and loses autocomplete. ## Audit batches 1–7 (soma-audit-2026-04-20) Batch 1 — Keyboard a11y (A14/A12): - Tabs: `isFallbackTabStop(el)` using `untrack` → first trigger gets `tabindex=0` when no tab matches (WCAG 2.1.1 was failing). - RatingGroup: `dir` prop + `getDirectionalKeys(dir, 'horizontal')` for RTL. - Accordion P1-1/P1-6 dismissed: roving/labelledby already correct per APG. Batch 2 — A33 reactive collections: Select `labelRegistry` and NavigationMenu `triggerRefs` migrated to `SvelteMap`. Batch 3 — A31 O(N²) fix: RadioGroup lifts `hasSelection` + `isFallbackTabStop` to the provider with `untrack`-wrapped DOM walk. Per-item derivations drop from O(N²) to O(1) per trigger. Batch 4 — Morfo aria sync: toast / time-field / date-field / tabs / tag-group / navigation-menu declare every aria the provider emits (14 entries across 6 files). Batch 5 — Accessible naming props: Tabs.List, ToggleGroup, TreeView, NavigationMenu expose `aria-label?` / `aria-labelledby?` with explicit "required unless labelledby is set" JSDoc. Batch 6 — A30 cleanup: Checkbox `setLabelId` and 5 trigger-ref providers (select/tooltip/link-preview/dropdown-menu/context-menu) migrated from `$effect(() => parent.ref = opts.ref)` to the `Provider` base's `onRefChange` callback (fires via attachRef inside `untrack`). Batch 7 — A11 wrapper thinning: stepper/tree-view wrappers removed `ctx.get()`, providers expose proxy derivations; time/date-range-field inputs use `untrack(() => …)` for one-shot id registration; menubar content's 40-line keyboard nav moved to `MenubarMenuProvider.onContentKeydown`; color-picker area + channel-slider pointer state machines moved to the providers with `onpointerdown/move/up` emitted via `props`. form-auto-fields deferred with justification (reflective schema renderer, not a state-holding wrapper). ## Form hang fix (A36) `runValidate` entered the `isPromiseLike` branch even for sync schemas because sium's Standard-Schema adapter declares `validate: async`. The fallback `return { errors, issues }` read both reactive vars inside the validation `$effect` while the `.then(...)` microtask wrote them → microtask-mediated loop, silent to Svelte's sync effect-depth guard. Symptom: kitchen-sink hung the tab on mount with onChange / onBlur. Fix: `return untrack(() => ({ errors, issues }))`. Regression locked by two new 5s-timeout tests in `form-auto-fields.svelte.test.ts`. Pattern codified as A36 in COMPONENT_GUIDE; CLAUDE.md count updated to A1–A36 / 39 items. ## Verification - `npm run check`: 0 errors in soma/morfo scope (sema demo pre-existing errors untouched). - `npx vitest run src/uix/soma src/uix/morfo`: all tests green (94 + 7 = 101 tests, inc. 2 new form regression tests). - `npm run smoke`: 65/65 routes. - `npx tsx scripts/morfo-check.ts`: 66/66 morfos. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
} as const satisfies Morfo;

Powered by TurnKey Linux.