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/langs/components/index.ts

97 lines
3.5 KiB

uix: rename morfo.translations → morfo.texts (idlangref discipline) Morfo now declares text slots as absolute idlangrefs in `texts: Record<string, LangRef>`, not literal multilingual records. Multilingual content moves out of morfo entirely into per-component catalogs under `src/uix/langs/components/{kebab}.ts`, merged globally by `ActiveUix` via the new `componentLangs` barrel. Morfo stays a pure abstract surface; localization lives in its own layer. - Type: `translations?: LangNode` → `texts?: Record<string, LangRef>` in `src/uix/morfo/types.ts`. Doc and test fixtures updated. - Catalog: new `src/uix/langs/` directory with `common.ts` (was `langs.ts`), `components/` (one file per migrated morfo, plus a barrel), and an aggregate `uixLangs`. `ActiveUix` registers both namespaces at boot. - Registry: `registerMorfo` no longer carries a translations fingerprint and no longer extends `ActiveLangs` dynamically. `connectMorfoTranslations` and `MorfoTranslationTarget` deleted from the public morfo barrel. - Validation: schema.ts drops the relative-translationRef-in-morfo.translations check; catalog presence is enforced by the new `scripts/translations-check.ts` (wired as `npm run translations:check`). - Audit: `scripts/component-audit.ts` rule A-1.3 now validates `texts.label` idlangref shape (`#?components.{kebab}.label|Fallback`) and explicitly errors on any surviving legacy `translations:` field. - Migration: `scripts/migrate-translations-to-texts.ts` is the one-off Node script that produced the 42 morfo rewrites and 42 catalog files. - Tests: `morfo/registry.test.ts` rewritten around the simpler contract; `active-uix.svelte.test.ts` reflects boot-time catalog availability instead of lazy per-morfo extension. Verification: `npm run check` (0 errors), `npm run translations:check` (0/0), `npm run morfo:check` (36/36 routed). The 4 pre-existing failures in `test` are unrelated (date-picker types, css regen, range-calendar clear, color contract). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
import type { LangNode } from '$libs/langs';
import { alertDialogLangs } from './alert-dialog';
import { announceLangs } from './announce';
import { breadcrumbLangs } from './breadcrumb';
import { calendarLangs } from './calendar';
import { carouselLangs } from './carousel';
import { clipboardLangs } from './clipboard';
import { colorFieldLangs } from './color-field';
import { colorPickerLangs } from './color-picker';
import { comboboxLangs } from './combobox';
import { commandLangs } from './command';
import { dateFieldLangs } from './date-field';
import { datePickerLangs } from './date-picker';
import { dateRangeFieldLangs } from './date-range-field';
import { dateRangePickerLangs } from './date-range-picker';
import { dialogLangs } from './dialog';
import { dragDropLangs } from './drag-drop';
import { drawerLangs } from './drawer';
import { feedLangs } from './feed';
import { fileUploadLangs } from './file-upload';
import { formLangs } from './form';
import { gridListLangs } from './grid-list';
import { listboxLangs } from './listbox';
import { meterLangs } from './meter';
import { navigationMenuLangs } from './navigation-menu';
import { paginationLangs } from './pagination';
import { pinInputLangs } from './pin-input';
import { progressLangs } from './progress';
import { rangeCalendarLangs } from './range-calendar';
import { ratingGroupLangs } from './rating-group';
import { scrollAreaLangs } from './scroll-area';
import { searchFieldLangs } from './search-field';
import { splitterLangs } from './splitter';
import { stepperLangs } from './stepper';
import { tableLangs } from './table';
import { tagGroupLangs } from './tag-group';
import { tagsInputLangs } from './tags-input';
import { timeFieldLangs } from './time-field';
import { timePickerLangs } from './time-picker';
import { timeRangeFieldLangs } from './time-range-field';
import { timeRangePickerLangs } from './time-range-picker';
import { tooltipLangs } from './tooltip';
uix: rename morfo.translations → morfo.texts (idlangref discipline) Morfo now declares text slots as absolute idlangrefs in `texts: Record<string, LangRef>`, not literal multilingual records. Multilingual content moves out of morfo entirely into per-component catalogs under `src/uix/langs/components/{kebab}.ts`, merged globally by `ActiveUix` via the new `componentLangs` barrel. Morfo stays a pure abstract surface; localization lives in its own layer. - Type: `translations?: LangNode` → `texts?: Record<string, LangRef>` in `src/uix/morfo/types.ts`. Doc and test fixtures updated. - Catalog: new `src/uix/langs/` directory with `common.ts` (was `langs.ts`), `components/` (one file per migrated morfo, plus a barrel), and an aggregate `uixLangs`. `ActiveUix` registers both namespaces at boot. - Registry: `registerMorfo` no longer carries a translations fingerprint and no longer extends `ActiveLangs` dynamically. `connectMorfoTranslations` and `MorfoTranslationTarget` deleted from the public morfo barrel. - Validation: schema.ts drops the relative-translationRef-in-morfo.translations check; catalog presence is enforced by the new `scripts/translations-check.ts` (wired as `npm run translations:check`). - Audit: `scripts/component-audit.ts` rule A-1.3 now validates `texts.label` idlangref shape (`#?components.{kebab}.label|Fallback`) and explicitly errors on any surviving legacy `translations:` field. - Migration: `scripts/migrate-translations-to-texts.ts` is the one-off Node script that produced the 42 morfo rewrites and 42 catalog files. - Tests: `morfo/registry.test.ts` rewritten around the simpler contract; `active-uix.svelte.test.ts` reflects boot-time catalog availability instead of lazy per-morfo extension. Verification: `npm run check` (0 errors), `npm run translations:check` (0/0), `npm run morfo:check` (36/36 routed). The 4 pre-existing failures in `test` are unrelated (date-picker types, css regen, range-calendar clear, color contract). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
import { treeGridLangs } from './tree-grid';
import { treeViewLangs } from './tree-view';
/**
* Per-component default strings. Each morfo that uses `texts:` with
* idlangrefs under `components.{kebab}.*` ships an entry here. Merged into
* the active langs catalog by `ActiveUix`.
*/
export const componentLangs = {
'alert-dialog': alertDialogLangs,
announce: announceLangs,
breadcrumb: breadcrumbLangs,
calendar: calendarLangs,
carousel: carouselLangs,
clipboard: clipboardLangs,
'color-field': colorFieldLangs,
'color-picker': colorPickerLangs,
combobox: comboboxLangs,
command: commandLangs,
'date-field': dateFieldLangs,
'date-picker': datePickerLangs,
'date-range-field': dateRangeFieldLangs,
'date-range-picker': dateRangePickerLangs,
dialog: dialogLangs,
'drag-drop': dragDropLangs,
drawer: drawerLangs,
feed: feedLangs,
'file-upload': fileUploadLangs,
form: formLangs,
'grid-list': gridListLangs,
listbox: listboxLangs,
meter: meterLangs,
'navigation-menu': navigationMenuLangs,
pagination: paginationLangs,
'pin-input': pinInputLangs,
progress: progressLangs,
'range-calendar': rangeCalendarLangs,
'rating-group': ratingGroupLangs,
'scroll-area': scrollAreaLangs,
'search-field': searchFieldLangs,
splitter: splitterLangs,
stepper: stepperLangs,
table: tableLangs,
'tag-group': tagGroupLangs,
'tags-input': tagsInputLangs,
'time-field': timeFieldLangs,
'time-picker': timePickerLangs,
'time-range-field': timeRangeFieldLangs,
'time-range-picker': timeRangePickerLangs,
tooltip: tooltipLangs,
uix: rename morfo.translations → morfo.texts (idlangref discipline) Morfo now declares text slots as absolute idlangrefs in `texts: Record<string, LangRef>`, not literal multilingual records. Multilingual content moves out of morfo entirely into per-component catalogs under `src/uix/langs/components/{kebab}.ts`, merged globally by `ActiveUix` via the new `componentLangs` barrel. Morfo stays a pure abstract surface; localization lives in its own layer. - Type: `translations?: LangNode` → `texts?: Record<string, LangRef>` in `src/uix/morfo/types.ts`. Doc and test fixtures updated. - Catalog: new `src/uix/langs/` directory with `common.ts` (was `langs.ts`), `components/` (one file per migrated morfo, plus a barrel), and an aggregate `uixLangs`. `ActiveUix` registers both namespaces at boot. - Registry: `registerMorfo` no longer carries a translations fingerprint and no longer extends `ActiveLangs` dynamically. `connectMorfoTranslations` and `MorfoTranslationTarget` deleted from the public morfo barrel. - Validation: schema.ts drops the relative-translationRef-in-morfo.translations check; catalog presence is enforced by the new `scripts/translations-check.ts` (wired as `npm run translations:check`). - Audit: `scripts/component-audit.ts` rule A-1.3 now validates `texts.label` idlangref shape (`#?components.{kebab}.label|Fallback`) and explicitly errors on any surviving legacy `translations:` field. - Migration: `scripts/migrate-translations-to-texts.ts` is the one-off Node script that produced the 42 morfo rewrites and 42 catalog files. - Tests: `morfo/registry.test.ts` rewritten around the simpler contract; `active-uix.svelte.test.ts` reflects boot-time catalog availability instead of lazy per-morfo extension. Verification: `npm run check` (0 errors), `npm run translations:check` (0/0), `npm run morfo:check` (36/36 routed). The 4 pre-existing failures in `test` are unrelated (date-picker types, css regen, range-calendar clear, color contract). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
5 months ago
'tree-grid': treeGridLangs,
'tree-view': treeViewLangs
} satisfies LangNode;

Powered by TurnKey Linux.