refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
import { Context } from 'runed';
|
|
|
|
|
import { createActiveDom } from '$uix/adom';
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
import type {
|
|
|
|
|
AppOptions,
|
|
|
|
|
AppDom,
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
AppLangs,
|
|
|
|
|
AppNums,
|
|
|
|
|
AppMoney,
|
|
|
|
|
AppDates,
|
|
|
|
|
AppUnits,
|
|
|
|
|
AppPresentation,
|
|
|
|
|
AppLogger,
|
|
|
|
|
Direction,
|
|
|
|
|
DateOrder,
|
|
|
|
|
HourCycle
|
|
|
|
|
} from './types';
|
|
|
|
|
import { fallbackDom, fallbackLangs, fallbackPresentation, consoleLogger } from './defaults';
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* App — root service compositor.
|
|
|
|
|
*
|
|
|
|
|
* Holds references to all domain services. Owns no preferences directly —
|
|
|
|
|
* each service owns its own state. App provides convenience getters/setters
|
|
|
|
|
* that delegate to the appropriate service.
|
|
|
|
|
*
|
|
|
|
|
* All services that depend on locale receive `langs` at construction and
|
|
|
|
|
* subscribe to `onLocaleChange` internally. When locale changes, each
|
|
|
|
|
* recalculates its defaults unless the user has set an explicit override.
|
|
|
|
|
*/
|
|
|
|
|
export class App {
|
|
|
|
|
// ── Services ────────────────────────────────────────────────────────
|
|
|
|
|
readonly dom: AppDom;
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
readonly langs: AppLangs;
|
|
|
|
|
readonly nums: AppNums | undefined;
|
|
|
|
|
readonly money: AppMoney | undefined;
|
|
|
|
|
readonly dates: AppDates | undefined;
|
|
|
|
|
readonly units: AppUnits | undefined;
|
|
|
|
|
readonly presentation: AppPresentation;
|
|
|
|
|
readonly logger: AppLogger;
|
|
|
|
|
|
|
|
|
|
constructor(opts: AppOptions) {
|
|
|
|
|
this.dom = opts.dom ?? createActiveDom();
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
this.langs = opts.langs;
|
|
|
|
|
this.nums = opts.nums;
|
|
|
|
|
this.money = opts.money;
|
|
|
|
|
this.dates = opts.dates;
|
|
|
|
|
this.units = opts.units;
|
|
|
|
|
this.presentation = opts.presentation;
|
|
|
|
|
this.logger = opts.logger ?? consoleLogger;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Convenience getters (delegate to services) ──────────────────────
|
|
|
|
|
|
|
|
|
|
get currency(): string | undefined {
|
|
|
|
|
return this.money?.getCurrency();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get dateOrder(): DateOrder | undefined {
|
|
|
|
|
return this.dates?.getDateOrder();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get hourCycle(): HourCycle | undefined {
|
|
|
|
|
return this.dates?.getHourCycle();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get theme(): string {
|
|
|
|
|
return this.presentation.getTheme();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
get mode(): 'light' | 'dark' {
|
|
|
|
|
return this.presentation.getMode();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// ── Convenience setters (delegate to services) ──────────────────────
|
|
|
|
|
|
|
|
|
|
setLocale(locale: string) {
|
|
|
|
|
this.langs.setLocale(locale);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setCurrency(currency: string) {
|
|
|
|
|
this.money?.setCurrency(currency);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setDir(dir: Direction | 'auto') {
|
|
|
|
|
this.presentation.setDir(dir);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setTheme(theme: string) {
|
|
|
|
|
this.presentation.setTheme(theme);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
setMode(mode: 'light' | 'dark' | 'auto') {
|
|
|
|
|
this.presentation.setMode(mode);
|
|
|
|
|
}
|
soma: tier 1/2 components, Field/NumberField integration, codex_audit fixes
New components: context-menu, field, file-upload, link-preview, menubar.
Codex audit fixes (2026-04-17):
- Wrappers thinned: table, scroll-area scrollbar, calendar, range-calendar
- Toast Root → Item refactor (data-toast-item, resolves part collision)
- TreeView tab-stop fallback, Table right-pinned offset, Toolbar O(N) registry
- Combobox label registry, Pagination count=0, Splitter feasible-range clamp
- TagsInput relatedTarget, Toast compound hotkey, RadioGroup closest filter
- Accessible-name props (aria-label/-labelledby) tipados en RadioGroup/Slider/
Switch/Toolbar; Slider thumbLabels per-index
- NumberField startValue saneado, Table getIsSomeSelected filtra visibles
- Docs: DropdownMenu CheckboxGroup, NumberField terra-free, Pagination
First/Last snippet
Supporting changes:
- App layer + ling/logr/glob/util consolidation, tests updates
- Terra/scripts mechanical reformat (quotes, imports)
- Test pages updated to match new APIs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
|
|
|
|
|
// ── Static distribution methods ─────────────────────────────────────
|
|
|
|
|
|
|
|
|
|
static create(opts: AppOptions): App {
|
|
|
|
|
const app = new App(opts);
|
|
|
|
|
return _ctx.set(app);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static get(): App {
|
|
|
|
|
return _ctx.getOr(_fallback);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
static require(): App {
|
|
|
|
|
const app = _ctx.getOr(null as unknown as App);
|
|
|
|
|
if (!app) {
|
|
|
|
|
throw new Error(
|
|
|
|
|
'[app] No App found. Make sure this component is rendered inside a App.create() scope.'
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
return app;
|
|
|
|
|
}
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
}
|
|
|
|
|
|
soma: tier 1/2 components, Field/NumberField integration, codex_audit fixes
New components: context-menu, field, file-upload, link-preview, menubar.
Codex audit fixes (2026-04-17):
- Wrappers thinned: table, scroll-area scrollbar, calendar, range-calendar
- Toast Root → Item refactor (data-toast-item, resolves part collision)
- TreeView tab-stop fallback, Table right-pinned offset, Toolbar O(N) registry
- Combobox label registry, Pagination count=0, Splitter feasible-range clamp
- TagsInput relatedTarget, Toast compound hotkey, RadioGroup closest filter
- Accessible-name props (aria-label/-labelledby) tipados en RadioGroup/Slider/
Switch/Toolbar; Slider thumbLabels per-index
- NumberField startValue saneado, Table getIsSomeSelected filtra visibles
- Docs: DropdownMenu CheckboxGroup, NumberField terra-free, Pagination
First/Last snippet
Supporting changes:
- App layer + ling/logr/glob/util consolidation, tests updates
- Terra/scripts mechanical reformat (quotes, imports)
- Test pages updated to match new APIs
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
6 months ago
|
|
|
// ── Module-level context ────────────────────────────────────────────────────
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
|
|
|
|
|
const _ctx = new Context<App>('App');
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Fallback App used when no <App> ancestor exists.
|
|
|
|
|
* Only provides core services (langs, presentation, logger).
|
|
|
|
|
* Optional services (nums, money, dates, units) are undefined —
|
|
|
|
|
* components must handle their absence gracefully.
|
|
|
|
|
*/
|
|
|
|
|
const _fallback = new App({
|
|
|
|
|
dom: fallbackDom,
|
refactor: App layer with reactive lang, soma migration, 26 component audits, RTL fixes
- Add App service compositor (langs, nums, money, dates, units, presentation)
- Add createSvelteLang() with reactivity for locale and schema changes
- Migrate 25 soma providers from getSoma()/translator.svelte to Soma.getOr()/langs.t()
- Add reactive dir resolution in all component wrappers
- Add dir HTML attribute to 12 root providers (accordion, tabs, slider, etc.)
- Fix slider RTL: range, thumb, tick use right/left based on dir
- Add table structural parts: Header, Body, Footer wrappers
- Implement ColumnPinning, ColumnSizing, Expanded in table-core
- Remove soma core formatters, translator.svelte, prop-resolvers (moved to App)
- Remove duplicate convenience getters (locale, dir, translate) from App/Soma
- Audit all 26 soma components, create audit docs with 84 issues found
- Update test page with pinning, sizing, expandable rows demos
6 months ago
|
|
|
langs: fallbackLangs,
|
|
|
|
|
presentation: fallbackPresentation,
|
|
|
|
|
logger: consoleLogger
|
|
|
|
|
});
|