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

53 lines
1.1 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';
export const dragDropMorfo: Morfo = {
name: 'DragDrop',
kebab: 'drag-drop',
scope: ['soma'],
parts: [
{
name: 'Provider',
kebab: 'root',
kind: 'public',
defaultElement: 'div',
optional: false,
data: [{ attr: 'data-dragging', severity: 'optional' }],
aria: []
},
{
name: 'Draggable',
kebab: 'draggable',
kind: 'public',
defaultElement: 'div',
optional: false,
data: [
{ attr: 'data-dragging', severity: 'optional' },
{ attr: 'data-disabled', severity: 'optional' }
],
aria: []
},
{
name: 'Droppable',
kebab: 'droppable',
kind: 'public',
defaultElement: 'div',
optional: false,
data: [
{ attr: 'data-dragover', severity: 'optional' },
{ attr: 'data-accepting', severity: 'optional' },
{ attr: 'data-disabled', severity: 'optional' }
],
aria: []
},
{
name: 'Preview',
kebab: 'preview',
kind: 'public',
defaultElement: 'div',
optional: true,
data: [{ attr: 'data-active', severity: 'optional' }],
aria: []
}
]
};

Powered by TurnKey Linux.