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.

4 lines
181 B

Bloque L1 — prefs foundation: capability libs + Source<T> port Introduce the pure preference layer and the framework-wide value port that the runtime layers (`arts/prefs`, format, frontend) consume. - `libs/reactive` gains `Source<T>` — a small `{ get, onChange? }` port any artifact uses to observe an external value (locale, currency, theme, …). - `libs/locale` extracts the lookup-style `matchLocale` helper plus aliases `LocaleSource` to `Source<string>`. Tests added for the four-step exact / lang+script / lang+region / lang priority. - New per-domain libs (`currency`, `density`, `direction`, `motion`, `theme`, `timezone`, `units`) own their own primitives, capability sources and pure helpers (`*FromLocale(s)`, `directionFromLanguage`, `resolveTheme`, `resolveMotion`). The currency catalogue + region table moved here from `arts/format/currency`. - `libs/prefs` is the pure preference layer: `PrefsCapabilities`, `PrefsEnvironment`, `PrefsIntent`, `PrefsEffective`, intent validation (with stable `PrefsValidationFailure` codes) and the parallel-projection resolver. Each `effective` field is now an INDEPENDENT projection of `environment.locales[]` against its own capability catalog — `language` and `locale` are split (i18n catalog vs regional formatting); `currency`, `unitSystem`, `direction` derive per-dimension instead of from a single `effective.locale` anchor. - `arts/format` and `arts/frontend` migrated to the new `Source<T>` shape: `localeSource?.getLocale()` → `localeSource?.get()` and `onLocaleChange?` → `onChange?`. `arts/format/currency/locale-currencies` and `arts/format/units/locale-defaults` collapse to thin re-exports of their `libs/*` counterparts. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
export { UNIT_SYSTEMS } from './types';
export type { UnitSystem, UnitSystemSource } from './types';
export { unitSystemFromLocale, unitSystemFromLocales } from './from-locale.ts';

Powered by TurnKey Linux.