From 21eb8a626488b74525a670f9c9b65af5d0cb92f2 Mon Sep 17 00:00:00 2001 From: dev Date: Fri, 22 May 2026 23:41:08 +0200 Subject: [PATCH] feat(context-menu): port from soma to eidos (Tier 1 sprint, 4/5) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 14-part compound — DropdownMenu surface minus CheckboxGroup. Same visual recipe vocabulary; the only differences vs DropdownMenu are the trigger surface (a `` wrapping right-clickable content rather than a ` + + + + + + + + {#if tab === 'live'} +
+

Live state

+

+ No knobs at the eidos level — visual treatment is uniform. + Interact with the demo's CheckboxItems / RadioGroup to see + state binding; the trigger area summons the menu via + right-click, Ctrl+Click on macOS, or long-press on touch. +

+
+ + + +
+ +
+
+ soma + headless · cursor-anchored, contextmenu interception + svelte +
+
{somaSnippet}
+
+ +
+
+ eidos + visual · namespaced compound + svelte +
+
{eidosSnippet}
+
+
+ {/if} + + {#if tab === 'api'} +
+

API reference

+

+ 14 pass-through parts (DropdownMenu surface minus + CheckboxGroup). No evaluative props at the eidos layer. +

+
+ + + + + + + + + + + + + + +
PartNotes
ContextMenu (root)Provider; bind:open, modal, dir.
Trigger`<span>` wrapping right-clickable content. Soma intercepts `contextmenu` / long-press / Shift+F10.
ContentFloating panel anchored at the cursor position.
ArrowOptional pointer.
Itemrole=menuitem, onSelect, closeOnSelect.
Group / GroupHeadingSemantic grouping.
Separatorrole=separator.
CheckboxItemrole=menuitemcheckbox; bind:checked.
RadioGroup / RadioItemrole=menuitemradio.
Sub / SubTrigger / SubContentNested fly-out.
+
+
+ {/if} + + {#if tab === 'morfo'} +
+

Morfo contract

+
+ + + + {#each partsList as part} + {@const partAny = part as unknown as Record} + + + + + + + {/each} + +
KebabRoleMarkerKind
{partAny.kebab}{partAny.role ?? '—'}{partAny.marker ?? '—'}{partAny.kind ?? '—'}
+
+
+ {/if} + + {#if tab === 'sema'} +
+

+ sema · events +

+
+ + + + {#each events as action} + {@const sem = action.semantic} + + + + + + + {/each} + +
NameFamilyVerbSequence
{action.name}{sem.family}{sem.verb ?? '—'}{sem.sequence ?? 'pre'}
+
+
+ {/if} + + {#if tab === 'recipe'} +
+

Eidos recipe

+

+ context-menu.css. Visually identical to + DropdownMenu — panel chrome, item rows, indicator slots and + submenu chevrons share the same vocabulary. The Trigger + gets a subtle data-state='open' dashed outline + as an affordance for "the menu came from this region". +

+
+ {/if} + + {#if tab === 'a11y'} +
+

A11y

+

+ WAI-ARIA APG Menu. +

+
+ + + + + + + + + + + + +
InputEffect
Right-clickOpen the menu at cursor.
Ctrl+Click (macOS)Same as right-click.
Long-press (touch)Same after the platform's long-press delay.
Shift+F10Open the menu via keyboard.
ArrowUp / ArrowDownNavigate items.
Enter / SpaceActivate item.
EscapeClose.
ArrowRight on SubTriggerOpen submenu.
+
+
+ {/if} +