feat(eidos): Card, Avatar ext, Image, SText, Badge, service components + dates engine fixes
Sprint completo:
- Card (eidos + sema): elevation/intent/interactive, eventos select+activate.
- Avatar: ring, AvatarBadge, AvatarGroup separados; demo Avatar standalone.
- Image: status surface (idle/loading/loaded/error) consumiendo soma ImageProvider.
- SText + STextVirtualList: canvas-text engine portado de morfo-driven-soma como
componentes separados para optimizar bundle (no se importa canvas si no se usa).
- Badge: primitivo eidos puro.
- Trans, FormatNumber, FormatDate, RelativeTime: 4 service components greppables
alrededor de uix.langs y uix.format. Nav group "Utilities".
Bugs fix arts/format/dates (engine-dates.ts):
1. Preset / per-axis conflict: Intl.DateTimeFormat rechaza dateStyle/timeStyle
con cualquier per-axis (weekday/era/year/month/day/dayPeriod/hour/minute/
second/fractionalSecondDigits) o con timeZoneName. Engine drop-ea ambos
presets por defecto cuando detecta conflict (regla estricta — un solo
per-axis hace ilegales los dos presets).
2. Per-call locale override: formatDate/Time/DateTime aceptan tercer arg
locale?: string. No muta engine state. Cache (getCachedDateFormat) keyea
por (locale x options). resolveCallHourCycle: cuando hay locale override
y pref auto, el ciclo horario se resuelve desde el locale OVERRIDE.
3. withHourCycle precedence: caller hourCycle/hour12 ahora gana sobre
preferencia del engine. Antes spread mal ordenado sobrescribia 'h12' del
caller con 'h23' del engine cuando locale resolvia a 24h.
FormatDate component vuelve a rutear siempre por uix.format.dates
(cache + hourCycle + locale reactivo), pasando locale como tercer arg.
Demos service components autonomos del toolbar global: cada uno owns su
demoLocale state con 7 chips (es-ES/en-US/en-GB/de-DE/fr-FR/ja-JP/ar-EG).
FormatDate stage filtra dateStyle/timeStyle por mode + chip hourCycle anadido.
Tests: 14/14 passing en engine-dates.test.ts (+6 nuevos: conflict handling,
locale override, hourCycle precedence).
Docs: arts/format/README.md (handoff 2026-05-25 con las 3 reglas),
README.md por service component, project_service_components_sprint_2026-05-25.md,
feedback_service_demos_own_locale.md (pattern reusable).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
<script lang="ts">
|
|
|
|
|
/**
|
|
|
|
|
* Eidos `<Image.Error>` — rendered when the parent Image reports
|
|
|
|
|
* `error` status (image failed to load). `role="img"` + a
|
|
|
|
|
* translated `aria-label` so screen readers know it's a broken
|
|
|
|
|
* image, not arbitrary chrome.
|
|
|
|
|
*/
|
fix(eidos): use ActiveEidos.require() instead of getActiveUix() in 15 components
Cierra P1 #1 del audit Codex: «Eidos no importa `\$active-uix`
directamente — consume el runtime via `ActiveEidos.require()` que
expone la surface bounded (langs / format / prefs / dom / uix)».
`ActiveEidos` ya existe (src/uix/eidos/active-eidos.svelte.ts) y la
mayoria de eidos components la usan (accordion, alert-dialog, banner,
box, button, calendar, card, ~50 archivos). Estos 15 quedaban como
strugglers/adiciones recientes que se saltaron el patron.
Patron canonico aplicado en cada archivo:
-import { getActiveUix } from '\$active-uix';
-const uix = getActiveUix();
-uix.langs.t(...)
+import { ActiveEidos } from '\$uix/eidos';
+const eidos = ActiveEidos.require();
+eidos.langs.t(...)
Archivos (15):
- badge/badge.svelte
- format-date/format-date.svelte
- format-number/format-number.svelte
- image/image-{error,fallback,_}.svelte (3)
- password-field/password-field-caps-lock-indicator.svelte
- picker-shell/picker-shell-{cancel,clear,close}.svelte (3)
- relative-time/relative-time.svelte
- s-text/s-text.svelte
- skeleton/skeleton.svelte
- spinner/spinner.svelte
- trans/trans.svelte
Sin nueva surface introducida — todas las usages (langs, format.dates,
format.numbers, format.currency) ya estaban expuestas en
`ActiveEidos`.
Verificacion:
- `grep getActiveUix src/uix/eidos/components/ --include='*.svelte'`:
cero matches. Quedan referencias en comments/READMEs/types.ts
(informativas, no imports).
- `npm run check`: 0 errors mantenido.
- HTTP 200 en /uix/components/{trans,format-date,format-number,relative-time,badge,skeleton,spinner,image}.
Esto es el fix correcto del audit (no la migracion-a-soma del commit
anterior que se hizo por mal entendimiento de la regla — revertida en
el commit precedente «Revert ... service components from Eidos to
Soma»).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
import { ActiveEidos } from '$uix/eidos';
|
feat(eidos): Card, Avatar ext, Image, SText, Badge, service components + dates engine fixes
Sprint completo:
- Card (eidos + sema): elevation/intent/interactive, eventos select+activate.
- Avatar: ring, AvatarBadge, AvatarGroup separados; demo Avatar standalone.
- Image: status surface (idle/loading/loaded/error) consumiendo soma ImageProvider.
- SText + STextVirtualList: canvas-text engine portado de morfo-driven-soma como
componentes separados para optimizar bundle (no se importa canvas si no se usa).
- Badge: primitivo eidos puro.
- Trans, FormatNumber, FormatDate, RelativeTime: 4 service components greppables
alrededor de uix.langs y uix.format. Nav group "Utilities".
Bugs fix arts/format/dates (engine-dates.ts):
1. Preset / per-axis conflict: Intl.DateTimeFormat rechaza dateStyle/timeStyle
con cualquier per-axis (weekday/era/year/month/day/dayPeriod/hour/minute/
second/fractionalSecondDigits) o con timeZoneName. Engine drop-ea ambos
presets por defecto cuando detecta conflict (regla estricta — un solo
per-axis hace ilegales los dos presets).
2. Per-call locale override: formatDate/Time/DateTime aceptan tercer arg
locale?: string. No muta engine state. Cache (getCachedDateFormat) keyea
por (locale x options). resolveCallHourCycle: cuando hay locale override
y pref auto, el ciclo horario se resuelve desde el locale OVERRIDE.
3. withHourCycle precedence: caller hourCycle/hour12 ahora gana sobre
preferencia del engine. Antes spread mal ordenado sobrescribia 'h12' del
caller con 'h23' del engine cuando locale resolvia a 24h.
FormatDate component vuelve a rutear siempre por uix.format.dates
(cache + hourCycle + locale reactivo), pasando locale como tercer arg.
Demos service components autonomos del toolbar global: cada uno owns su
demoLocale state con 7 chips (es-ES/en-US/en-GB/de-DE/fr-FR/ja-JP/ar-EG).
FormatDate stage filtra dateStyle/timeStyle por mode + chip hourCycle anadido.
Tests: 14/14 passing en engine-dates.test.ts (+6 nuevos: conflict handling,
locale override, hourCycle precedence).
Docs: arts/format/README.md (handoff 2026-05-25 con las 3 reglas),
README.md por service component, project_service_components_sprint_2026-05-25.md,
feedback_service_demos_own_locale.md (pattern reusable).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
import { IMAGE_LANGS } from './langs';
|
|
|
|
|
import type { ImageErrorProps } from './types';
|
|
|
|
|
import { getImageEidosContext } from './image-context';
|
|
|
|
|
|
|
|
|
|
let {
|
|
|
|
|
'aria-label': ariaLabel,
|
|
|
|
|
children,
|
|
|
|
|
...rest
|
|
|
|
|
}: ImageErrorProps = $props();
|
|
|
|
|
|
|
|
|
|
const image = getImageEidosContext();
|
fix(eidos): use ActiveEidos.require() instead of getActiveUix() in 15 components
Cierra P1 #1 del audit Codex: «Eidos no importa `\$active-uix`
directamente — consume el runtime via `ActiveEidos.require()` que
expone la surface bounded (langs / format / prefs / dom / uix)».
`ActiveEidos` ya existe (src/uix/eidos/active-eidos.svelte.ts) y la
mayoria de eidos components la usan (accordion, alert-dialog, banner,
box, button, calendar, card, ~50 archivos). Estos 15 quedaban como
strugglers/adiciones recientes que se saltaron el patron.
Patron canonico aplicado en cada archivo:
-import { getActiveUix } from '\$active-uix';
-const uix = getActiveUix();
-uix.langs.t(...)
+import { ActiveEidos } from '\$uix/eidos';
+const eidos = ActiveEidos.require();
+eidos.langs.t(...)
Archivos (15):
- badge/badge.svelte
- format-date/format-date.svelte
- format-number/format-number.svelte
- image/image-{error,fallback,_}.svelte (3)
- password-field/password-field-caps-lock-indicator.svelte
- picker-shell/picker-shell-{cancel,clear,close}.svelte (3)
- relative-time/relative-time.svelte
- s-text/s-text.svelte
- skeleton/skeleton.svelte
- spinner/spinner.svelte
- trans/trans.svelte
Sin nueva surface introducida — todas las usages (langs, format.dates,
format.numbers, format.currency) ya estaban expuestas en
`ActiveEidos`.
Verificacion:
- `grep getActiveUix src/uix/eidos/components/ --include='*.svelte'`:
cero matches. Quedan referencias en comments/READMEs/types.ts
(informativas, no imports).
- `npm run check`: 0 errors mantenido.
- HTTP 200 en /uix/components/{trans,format-date,format-number,relative-time,badge,skeleton,spinner,image}.
Esto es el fix correcto del audit (no la migracion-a-soma del commit
anterior que se hizo por mal entendimiento de la regla — revertida en
el commit precedente «Revert ... service components from Eidos to
Soma»).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
const eidos = ActiveEidos.require();
|
|
|
|
|
const resolvedLabel = $derived(ariaLabel ?? eidos.langs.ts(IMAGE_LANGS.ERROR_LABEL));
|
feat(eidos): Card, Avatar ext, Image, SText, Badge, service components + dates engine fixes
Sprint completo:
- Card (eidos + sema): elevation/intent/interactive, eventos select+activate.
- Avatar: ring, AvatarBadge, AvatarGroup separados; demo Avatar standalone.
- Image: status surface (idle/loading/loaded/error) consumiendo soma ImageProvider.
- SText + STextVirtualList: canvas-text engine portado de morfo-driven-soma como
componentes separados para optimizar bundle (no se importa canvas si no se usa).
- Badge: primitivo eidos puro.
- Trans, FormatNumber, FormatDate, RelativeTime: 4 service components greppables
alrededor de uix.langs y uix.format. Nav group "Utilities".
Bugs fix arts/format/dates (engine-dates.ts):
1. Preset / per-axis conflict: Intl.DateTimeFormat rechaza dateStyle/timeStyle
con cualquier per-axis (weekday/era/year/month/day/dayPeriod/hour/minute/
second/fractionalSecondDigits) o con timeZoneName. Engine drop-ea ambos
presets por defecto cuando detecta conflict (regla estricta — un solo
per-axis hace ilegales los dos presets).
2. Per-call locale override: formatDate/Time/DateTime aceptan tercer arg
locale?: string. No muta engine state. Cache (getCachedDateFormat) keyea
por (locale x options). resolveCallHourCycle: cuando hay locale override
y pref auto, el ciclo horario se resuelve desde el locale OVERRIDE.
3. withHourCycle precedence: caller hourCycle/hour12 ahora gana sobre
preferencia del engine. Antes spread mal ordenado sobrescribia 'h12' del
caller con 'h23' del engine cuando locale resolvia a 24h.
FormatDate component vuelve a rutear siempre por uix.format.dates
(cache + hourCycle + locale reactivo), pasando locale como tercer arg.
Demos service components autonomos del toolbar global: cada uno owns su
demoLocale state con 7 chips (es-ES/en-US/en-GB/de-DE/fr-FR/ja-JP/ar-EG).
FormatDate stage filtra dateStyle/timeStyle por mode + chip hourCycle anadido.
Tests: 14/14 passing en engine-dates.test.ts (+6 nuevos: conflict handling,
locale override, hourCycle precedence).
Docs: arts/format/README.md (handoff 2026-05-25 con las 3 reglas),
README.md por service component, project_service_components_sprint_2026-05-25.md,
feedback_service_demos_own_locale.md (pattern reusable).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
{#if image?.status === 'error'}
|
|
|
|
|
<span
|
|
|
|
|
{...rest}
|
|
|
|
|
data-image-error=""
|
|
|
|
|
{...image.fallbackAttrs}
|
|
|
|
|
role="img"
|
|
|
|
|
aria-label={resolvedLabel}
|
|
|
|
|
>
|
|
|
|
|
{@render children?.()}
|
|
|
|
|
</span>
|
|
|
|
|
{/if}
|