refactor(picker-shell): close as INTERNAL primitive (audit P1 #5)
picker-shell quedó suelto en el audit-codex: existía un morfo placeholder en src/uix/morfo/components/picker-shell.ts sin imports, sin events, sin texts, y los 5 composite pickers (date / date-range / time / time-range / color) consumían eidos parts via re-export bajo SU namespace (<DatePicker.Footer>, etc.) — apps nunca escribían <PickerShell> directo. Cierre como INTERNAL primitive per la propia recomendación del audit: - Movido src/uix/morfo/components/picker-shell.ts → src/uix/morfo/internal/picker-shell.ts. El audit walk de morfo/components/ ya no lo encuentra. Cero imports rotos (no había ninguno). - README en src/uix/eidos/components/picker-shell/README.md declara el status INTERNAL + diagrama de composición de los 5 pickers. - Docstring del morfo actualizado con STATUS: INTERNAL explícito. - audit-codex-full-1.md sección 5 marcada RESUELTO con verbatim del cierre. Verificación: - npm run morfo:vocabulary → EXIT 0 - npx vitest src/uix/sema src/uix/morfo → 195/195 pass - npm run component:audit → picker-shell ya no aparece (no era public component, no debe figurar en lista de NEEDS-WORK) Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>active-uix
parent
826ca2bf46
commit
43b1537291
@ -0,0 +1,51 @@
|
|||||||
|
# PickerShell (INTERNAL primitive)
|
||||||
|
|
||||||
|
**Status:** Internal layout primitive. **Not a public component.**
|
||||||
|
|
||||||
|
PickerShell is the shared layout chrome used by the five composite pickers:
|
||||||
|
|
||||||
|
- `DatePicker`
|
||||||
|
- `DateRangePicker`
|
||||||
|
- `TimePicker`
|
||||||
|
- `TimeRangePicker`
|
||||||
|
- `ColorPicker`
|
||||||
|
|
||||||
|
Each of those re-exports the picker-shell parts under its own namespace, so apps write `<DatePicker.Footer>` / `<ColorPicker.Clear>` / etc., never `<PickerShell>` directly. The main `$uix/eidos` barrel intentionally does **not** export `PickerShell`.
|
||||||
|
|
||||||
|
## Why internal
|
||||||
|
|
||||||
|
- Zero standalone semantics — no events, no state, no morfo contract beyond a single Provider stub.
|
||||||
|
- All meaningful behaviour (Clear / Cancel / Close actions) flows through `pickerShellContext` registered by the host picker's provider in soma.
|
||||||
|
- The contract surface that matters for apps is each individual picker's namespace, not the shell.
|
||||||
|
|
||||||
|
## What lives where
|
||||||
|
|
||||||
|
- **Morfo declaration:** `src/uix/morfo/internal/picker-shell.ts` — outside `morfo/components/` so the component audit (which walks public components) does not flag it for the public-artefact ruleset (demo, `texts.label`, public README requirements).
|
||||||
|
- **Soma:** `src/uix/soma/components/picker-shell/` — the `PickerShellHandle` + context machinery the five pickers register against.
|
||||||
|
- **Eidos parts (this directory):**
|
||||||
|
- `picker-shell.svelte` — Root
|
||||||
|
- `picker-shell-header.svelte` — Header zone
|
||||||
|
- `picker-shell-body.svelte` — Body zone (where the picker's payload lives)
|
||||||
|
- `picker-shell-footer.svelte` — Footer (action row)
|
||||||
|
- `picker-shell-clear.svelte` — Clear action
|
||||||
|
- `picker-shell-cancel.svelte` — Cancel action
|
||||||
|
- `picker-shell-close.svelte` — Close action
|
||||||
|
|
||||||
|
## Adding a new composite picker
|
||||||
|
|
||||||
|
1. Soma provider registers a `PickerShellHandle` via `pickerShellContext`.
|
||||||
|
2. Eidos picker barrel re-exports the shell parts under its namespace:
|
||||||
|
|
||||||
|
```ts
|
||||||
|
import Footer from '../picker-shell/picker-shell-footer.svelte';
|
||||||
|
import Clear from '../picker-shell/picker-shell-clear.svelte';
|
||||||
|
// …
|
||||||
|
MyPicker.Footer = Footer;
|
||||||
|
MyPicker.Clear = Clear;
|
||||||
|
```
|
||||||
|
|
||||||
|
3. Apps use `<MyPicker.Footer>` / `<MyPicker.Clear>` like any other picker.
|
||||||
|
|
||||||
|
## Closes
|
||||||
|
|
||||||
|
audit-codex-full-1.md P1 #5 — "picker-shell existe pero no esta cerrado como pieza de sistema". Closed as INTERNAL primitive per the audit's own recommendation: *"Si es interna, no deberia salir como demo publica ni Morfo publico incompleto."*
|
||||||
@ -1,33 +0,0 @@
|
|||||||
import type { Morfo } from '../types';
|
|
||||||
import { v } from '../types';
|
|
||||||
|
|
||||||
/**
|
|
||||||
* PickerShell — composition shell that wraps composite-picker popover
|
|
||||||
* content (DatePicker, ColorPicker, TimeRangePicker, …). It is a pure
|
|
||||||
* layout primitive: header / body / footer zones + a Clear/Cancel/Close
|
|
||||||
* action row. No interactive state of its own — the host picker's
|
|
||||||
* provider registers a `PickerShellHandle` via `pickerShellContext` and
|
|
||||||
* the descendants (Clear/Cancel/Close) pull from there.
|
|
||||||
*
|
|
||||||
* Scope is `soma` only — no semantic events; the host picker emits
|
|
||||||
* `commit-*` / `shift-*` on its own provider.
|
|
||||||
*/
|
|
||||||
export const pickerShellMorfo = {
|
|
||||||
name: 'PickerShell',
|
|
||||||
kebab: 'picker-shell',
|
|
||||||
scope: ['soma'],
|
|
||||||
texts: {},
|
|
||||||
events: [],
|
|
||||||
parts: [
|
|
||||||
{
|
|
||||||
name: 'Provider',
|
|
||||||
kebab: 'provider',
|
|
||||||
archetype: 'provider',
|
|
||||||
kind: 'public',
|
|
||||||
defaultElement: 'div',
|
|
||||||
optional: false,
|
|
||||||
data: [],
|
|
||||||
aria: []
|
|
||||||
}
|
|
||||||
]
|
|
||||||
} as const satisfies Morfo;
|
|
||||||
@ -0,0 +1,47 @@
|
|||||||
|
import type { Morfo } from '../types';
|
||||||
|
|
||||||
|
/**
|
||||||
|
* PickerShell — INTERNAL layout primitive (not a public component).
|
||||||
|
*
|
||||||
|
* Composition shell that wraps composite-picker popover content
|
||||||
|
* (DatePicker, ColorPicker, TimeRangePicker, TimePicker, DateRangePicker).
|
||||||
|
* Pure layout: header / body / footer zones + a Clear/Cancel/Close action
|
||||||
|
* row. No interactive state of its own — the host picker's provider
|
||||||
|
* registers a `PickerShellHandle` via `pickerShellContext` and the
|
||||||
|
* descendants (Clear/Cancel/Close) pull from there.
|
||||||
|
*
|
||||||
|
* STATUS: INTERNAL primitive. Apps never write `<PickerShell>`; they
|
||||||
|
* compose `<DatePicker.Footer>` / `<ColorPicker.Clear>` etc., which are
|
||||||
|
* re-exports of the picker-shell parts under each composite picker's
|
||||||
|
* namespace (`src/uix/eidos/components/date-picker/index.ts` and the
|
||||||
|
* other four picker barrels).
|
||||||
|
*
|
||||||
|
* Lives under `src/uix/morfo/internal/` so the component audit (which
|
||||||
|
* walks `morfo/components/`) does not flag it for the usual public-
|
||||||
|
* component artefacts (demo, texts.label, README expectations).
|
||||||
|
*
|
||||||
|
* Scope is `soma` only — no semantic events; the host picker emits
|
||||||
|
* `commit-*` / `shift-*` on its own provider. No `expression` field
|
||||||
|
* because there is no morfo-emitted event to express.
|
||||||
|
*
|
||||||
|
* Closes audit-codex P1 #5 (picker-shell internal vs public).
|
||||||
|
*/
|
||||||
|
export const pickerShellMorfo = {
|
||||||
|
name: 'PickerShell',
|
||||||
|
kebab: 'picker-shell',
|
||||||
|
scope: ['soma'],
|
||||||
|
texts: {},
|
||||||
|
events: [],
|
||||||
|
parts: [
|
||||||
|
{
|
||||||
|
name: 'Provider',
|
||||||
|
kebab: 'provider',
|
||||||
|
archetype: 'provider',
|
||||||
|
kind: 'public',
|
||||||
|
defaultElement: 'div',
|
||||||
|
optional: false,
|
||||||
|
data: [],
|
||||||
|
aria: []
|
||||||
|
}
|
||||||
|
]
|
||||||
|
} as const satisfies Morfo;
|
||||||
Loading…
Reference in new issue