@iris-ui-kit/vue 0.2.29 → 0.2.30
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/admin.cjs +29 -3
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +3 -3
- package/dist/{chunk-X7Y35UUL.js → chunk-3547J6IN.js} +3 -3
- package/dist/{chunk-X7Y35UUL.js.map → chunk-3547J6IN.js.map} +1 -1
- package/dist/{chunk-BVKOOTXG.js → chunk-IAG64CHL.js} +3 -3
- package/dist/chunk-IAG64CHL.js.map +1 -0
- package/dist/{chunk-KSJZLFAT.js → chunk-MO7AAXA6.js} +6 -6
- package/dist/chunk-MO7AAXA6.js.map +1 -0
- package/dist/{chunk-EZUDM4TM.js → chunk-PT6X4543.js} +31 -5
- package/dist/chunk-PT6X4543.js.map +1 -0
- package/dist/{chunk-W3JMJVEK.js → chunk-TCAXRWT6.js} +3 -3
- package/dist/chunk-TCAXRWT6.js.map +1 -0
- package/dist/{chunk-KAOPZNZF.js → chunk-UPC4GN3F.js} +3 -3
- package/dist/chunk-UPC4GN3F.js.map +1 -0
- package/dist/{chunk-X5UOY4IV.js → chunk-W64OMUBD.js} +3 -3
- package/dist/{chunk-X5UOY4IV.js.map → chunk-W64OMUBD.js.map} +1 -1
- package/dist/{chunk-OH4YSGFK.js → chunk-ZTPIXL7Q.js} +3 -3
- package/dist/chunk-ZTPIXL7Q.js.map +1 -0
- package/dist/error-boundary.cjs +1 -1
- package/dist/error-boundary.cjs.map +1 -1
- package/dist/error-boundary.js +2 -2
- package/dist/form.cjs +1 -1
- package/dist/form.cjs.map +1 -1
- package/dist/form.js +1 -1
- package/dist/i18n.cjs +1 -1
- package/dist/i18n.cjs.map +1 -1
- package/dist/i18n.js +1 -1
- package/dist/index.cjs +437 -42
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +28 -3
- package/dist/index.d.ts +28 -3
- package/dist/index.js +416 -47
- package/dist/index.js.map +1 -1
- package/dist/provider.cjs +4 -4
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.js +4 -4
- package/dist/skeletons.cjs +1 -1
- package/dist/skeletons.cjs.map +1 -1
- package/dist/skeletons.js +2 -2
- package/dist/skins.cjs +1 -1
- package/dist/skins.cjs.map +1 -1
- package/dist/skins.js +1 -1
- package/dist/theme.cjs +1 -1
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.js +1 -1
- package/package.json +15 -15
- package/dist/chunk-BVKOOTXG.js.map +0 -1
- package/dist/chunk-EZUDM4TM.js.map +0 -1
- package/dist/chunk-KAOPZNZF.js.map +0 -1
- package/dist/chunk-KSJZLFAT.js.map +0 -1
- package/dist/chunk-OH4YSGFK.js.map +0 -1
- package/dist/chunk-W3JMJVEK.js.map +0 -1
package/dist/provider.cjs
CHANGED
|
@@ -6,7 +6,7 @@ var theme = require('@iris-ui-kit/theme');
|
|
|
6
6
|
var skins = require('@iris-ui-kit/skins');
|
|
7
7
|
|
|
8
8
|
// src/provider/IrisProvider.ts
|
|
9
|
-
var IrisThemeKey = Symbol("IrisTheme");
|
|
9
|
+
var IrisThemeKey = /* @__PURE__ */ Symbol("IrisTheme");
|
|
10
10
|
var ThemeProvider = vue.defineComponent({
|
|
11
11
|
name: "IrisThemeProvider",
|
|
12
12
|
props: {
|
|
@@ -88,7 +88,7 @@ var ThemeProvider = vue.defineComponent({
|
|
|
88
88
|
return () => slots.default?.();
|
|
89
89
|
}
|
|
90
90
|
});
|
|
91
|
-
var IrisSkinKey = Symbol("IrisSkin");
|
|
91
|
+
var IrisSkinKey = /* @__PURE__ */ Symbol("IrisSkin");
|
|
92
92
|
var SkinProvider = vue.defineComponent({
|
|
93
93
|
name: "IrisSkinProvider",
|
|
94
94
|
props: {
|
|
@@ -131,7 +131,7 @@ var SkinProvider = vue.defineComponent({
|
|
|
131
131
|
});
|
|
132
132
|
|
|
133
133
|
// src/i18n/context.ts
|
|
134
|
-
var I18nInjectionKey = Symbol("IrisI18n");
|
|
134
|
+
var I18nInjectionKey = /* @__PURE__ */ Symbol("IrisI18n");
|
|
135
135
|
|
|
136
136
|
// src/i18n/I18nProvider.ts
|
|
137
137
|
var IrisI18nProvider = vue.defineComponent({
|
|
@@ -196,7 +196,7 @@ var IrisI18nProvider = vue.defineComponent({
|
|
|
196
196
|
});
|
|
197
197
|
|
|
198
198
|
// src/provider/context.ts
|
|
199
|
-
var PluginStoreContextKey = Symbol("IrisPluginStore");
|
|
199
|
+
var PluginStoreContextKey = /* @__PURE__ */ Symbol("IrisPluginStore");
|
|
200
200
|
|
|
201
201
|
// src/provider/IrisProvider.ts
|
|
202
202
|
var DEFAULT_LOCALE = "en-US";
|
package/dist/provider.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/theme/ThemeProvider.ts","../src/skins/SkinProvider.ts","../src/i18n/context.ts","../src/i18n/I18nProvider.ts","../src/provider/context.ts","../src/provider/IrisProvider.ts","../src/provider/hooks.ts"],"names":["defineComponent","ref","applyTheme","applyDirection","onMounted","injectGlobalStyles","watch","onBeforeUnmount","provide","computed","applySkin","createI18n","localeDirection","onScopeDispose","shallowRef","runPlugins","shallowReactive","applyCssVars","h","inject"],"mappings":";;;;;;;;AA+BO,IAAM,YAAA,GAA+C,OAAO,WAAW,CAAA;AAWvE,IAAM,gBAAgBA,mBAAA,CAAgB;AAAA,EAC3C,IAAA,EAAM,mBAAA;AAAA,EACN,KAAA,EAAO;AAAA,IACL,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,MAAA;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,OAAA,EAAS;AAAA,KACX;AAAA;AAAA,IAEA,GAAA,EAAK;AAAA,MACH,IAAA,EAAM,MAAA;AAAA,MACN,OAAA,EAAS;AAAA,KACX;AAAA;AAAA,IAEA,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,MAAA;AAAA,MACN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F;AAAA,EACF;AAEA,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,2BAA2B,OAAO,CAAA,mFAAA;AAAA,GAEpC;AACF","file":"provider.cjs","sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n watch,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n type Ref,\n} from 'vue'\nimport {\n applyDirection,\n applyTheme,\n injectGlobalStyles,\n type ApplyDirectionResult,\n type ApplyThemeResult,\n type Direction,\n type ThemeStore,\n} from '@iris-ui-kit/theme'\nimport type { IrisTheme } from '@iris-ui-kit/tokens'\n\nexport interface IrisThemeContext {\n store: ThemeStore\n current: Ref<IrisTheme>\n dir: ComputedRef<Direction>\n}\n\nexport const IrisThemeKey: InjectionKey<IrisThemeContext> = Symbol('IrisTheme')\n\n/**\n * Renderless provider that:\n * 1. exposes the theme store to descendants via `provide`,\n * 2. applies the current theme to a target element on mount and on change,\n * 3. reverts the inline custom properties on unmount.\n *\n * `target` defaults to `document.documentElement`. Pass an element ref to\n * scope a theme to a subtree.\n */\nexport const ThemeProvider = defineComponent({\n name: 'IrisThemeProvider',\n props: {\n store: {\n type: Object as PropType<ThemeStore>,\n required: true,\n },\n target: {\n type: Object as PropType<HTMLElement | null>,\n default: null,\n },\n /** Writing direction; sets `dir` on the target for RTL. Default `'ltr'`. */\n dir: {\n type: String as PropType<Direction>,\n default: 'ltr',\n },\n /** CSP nonce for injected inline stylesheets. */\n cspNonce: {\n type: String,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const current = ref(props.store.store.getState()) as Ref<IrisTheme>\n let unsubscribe = props.store.store.subscribe((next) => {\n current.value = next\n })\n\n let applied: ApplyThemeResult | null = null\n let dirApplied: ApplyDirectionResult | null = null\n\n const targetEl = () => props.target ?? document.documentElement\n\n const applyCurrent = () => {\n applied?.revert()\n applied = applyTheme(current.value, targetEl())\n }\n\n const applyDir = () => {\n dirApplied?.revert()\n dirApplied = applyDirection(props.dir, targetEl())\n }\n\n onMounted(() => {\n injectGlobalStyles(props.cspNonce)\n applyCurrent()\n applyDir()\n })\n\n watch(current, () => {\n if (applied) applyCurrent()\n })\n\n watch(\n () => props.store,\n (nextStore) => {\n unsubscribe()\n unsubscribe = nextStore.store.subscribe((next) => {\n current.value = next\n })\n current.value = nextStore.store.getState()\n if (applied) applyCurrent()\n },\n )\n\n watch(\n () => props.target,\n () => {\n if (applied) applyCurrent()\n if (dirApplied) applyDir()\n },\n )\n\n watch(\n () => props.dir,\n () => {\n if (dirApplied) applyDir()\n },\n )\n\n onBeforeUnmount(() => {\n unsubscribe()\n applied?.revert()\n applied = null\n dirApplied?.revert()\n dirApplied = null\n })\n\n provide(IrisThemeKey, { store: props.store, current, dir: computed(() => props.dir) })\n\n return () => slots.default?.()\n },\n})\n\nexport function useThemeContext(): IrisThemeContext {\n const ctx = inject(IrisThemeKey)\n if (!ctx) {\n throw new Error('[iris-ui] useTheme(): no <ThemeProvider> ancestor found')\n }\n return ctx\n}\n\n/**\n * Current writing direction (`'ltr'` / `'rtl'`) from the nearest\n * `<ThemeProvider>`, or a static `'ltr'` ref when there is none.\n */\nexport function useDirection(): ComputedRef<Direction> {\n const ctx = inject(IrisThemeKey, null)\n return ctx ? ctx.dir : computed(() => 'ltr' as Direction)\n}\n","import {\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n watch,\n type InjectionKey,\n type PropType,\n type Ref,\n} from 'vue'\nimport { injectGlobalStyles } from '@iris-ui-kit/theme'\nimport {\n applySkin,\n type ApplySkinResult,\n type ResolvedSkin,\n type SkinEngine,\n} from '@iris-ui-kit/skins'\n\nexport interface IrisSkinContext {\n engine: SkinEngine\n current: Ref<ResolvedSkin>\n}\n\nexport const IrisSkinKey: InjectionKey<IrisSkinContext> = Symbol('IrisSkin')\n\n/**\n * Renderless provider mirroring `<IrisThemeProvider>` for skins: subscribes to\n * the engine store, applies/reverts the resolved skin on the target element,\n * and provides the engine + current skin to descendants. Zero skin logic.\n */\nexport const SkinProvider = defineComponent({\n name: 'IrisSkinProvider',\n props: {\n engine: { type: Object as PropType<SkinEngine>, required: true },\n target: { type: Object as PropType<HTMLElement | null>, default: null },\n cspNonce: { type: String, default: undefined },\n },\n setup(props, { slots }) {\n const current = ref(props.engine.current()) as Ref<ResolvedSkin>\n const unsubscribe = props.engine.subscribe((next) => {\n current.value = next\n })\n\n let applied: ApplySkinResult | null = null\n const targetEl = () => props.target ?? document.documentElement\n const apply = () => {\n applied?.revert()\n applied = applySkin(current.value, targetEl())\n }\n\n onMounted(() => {\n injectGlobalStyles(props.cspNonce)\n apply()\n })\n watch(current, () => {\n if (applied) apply()\n })\n watch(\n () => props.target,\n () => {\n if (applied) apply()\n },\n )\n onBeforeUnmount(() => {\n unsubscribe()\n applied?.revert()\n applied = null\n })\n\n provide(IrisSkinKey, { engine: props.engine, current })\n return () => slots.default?.()\n },\n})\n\nexport function useSkinContext(): IrisSkinContext {\n const ctx = inject(IrisSkinKey)\n if (!ctx) throw new Error('[iris-ui] useSkin(): no <SkinProvider> ancestor found')\n return ctx\n}\n","import { type InjectionKey } from 'vue'\nimport type { I18n } from '@iris-ui-kit/core'\n\n/** Injection key carrying the active {@link I18n} instance to `useI18n`. */\nexport const I18nInjectionKey: InjectionKey<I18n> = Symbol('IrisI18n')\n","import { defineComponent, onScopeDispose, provide, watch, type PropType } from 'vue'\nimport { createI18n, localeDirection, type I18n, type I18nMessages } from '@iris-ui-kit/core'\nimport { applyDirection } from '@iris-ui-kit/theme'\nimport { I18nInjectionKey } from './context'\n\n/**\n * Makes a locale + message dictionary available to descendant components via\n * `useI18n`. Pass `locale` / `messages` (an instance is created and kept in\n * sync) or a pre-built `i18n` instance you control externally. Renderless:\n * renders its default slot.\n */\nexport const IrisI18nProvider = defineComponent({\n name: 'IrisI18nProvider',\n props: {\n locale: { type: String, default: undefined },\n messages: { type: Object as PropType<I18nMessages>, default: undefined },\n i18n: { type: Object as PropType<I18n>, default: undefined },\n /**\n * When set, the locale's writing direction ({@link localeDirection}) is\n * applied to `directionTarget` (`dir` + `data-iris-dir`) and `<html lang>`\n * is set whenever `locale` changes — so \"set locale → flip direction +\n * announce language\" needs no manual wiring. Off by default so it never\n * fights an explicit `<ThemeProvider dir>`. Reverts on unmount.\n */\n autoDirection: { type: Boolean, default: false },\n /** Element to receive dir/lang when `autoDirection` is set. Defaults to `document.documentElement`. */\n directionTarget: { type: Object as PropType<HTMLElement | null>, default: undefined },\n },\n setup(props, { slots }) {\n const instance = props.i18n ?? createI18n({ locale: props.locale, messages: props.messages })\n provide(I18nInjectionKey, instance)\n\n if (!props.i18n) {\n watch(\n () => props.locale,\n (locale) => {\n if (locale) instance.setLocale(locale)\n },\n )\n watch(\n () => props.messages,\n (messages) => {\n if (messages) instance.setMessages(messages)\n },\n )\n }\n\n // Auto-apply writing direction + `lang` from the active locale (opt-in).\n let revertDirection: (() => void) | null = null\n watch(\n () => [props.autoDirection, props.locale, props.directionTarget] as const,\n ([autoDirection, locale]) => {\n revertDirection?.()\n revertDirection = null\n if (!autoDirection || !locale || typeof document === 'undefined') return\n const el = props.directionTarget ?? document.documentElement\n const applied = applyDirection(localeDirection(locale), el)\n const prevLang = el.getAttribute('lang')\n el.setAttribute('lang', locale)\n revertDirection = () => {\n applied.revert()\n if (prevLang === null) el.removeAttribute('lang')\n else el.setAttribute('lang', prevLang)\n }\n },\n { immediate: true },\n )\n onScopeDispose(() => {\n revertDirection?.()\n revertDirection = null\n })\n\n return () => slots.default?.()\n },\n})\n","import { type InjectionKey } from 'vue'\n\n/**\n * Shape carried by the plugin-store context: the live store instances collected\n * from every installed plugin, plus the set of installed plugin names. Surfaced\n * to descendants through `usePluginStore` / `usePlugin`.\n */\nexport interface PluginStoreContext {\n stores: Map<string, unknown>\n installed: Set<string>\n}\n\n/**\n * Injection key for the {@link PluginStoreContext}. The name ends in `Key` (and\n * the type in `Context`) so the manifest's discover step never mistakes it for a\n * component export.\n */\nexport const PluginStoreContextKey: InjectionKey<PluginStoreContext> = Symbol('IrisPluginStore')\n","import {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n provide,\n shallowReactive,\n shallowRef,\n watch,\n type PropType,\n type VNode,\n} from 'vue'\nimport { runPlugins, type CollectedRegistrations, type IrisPlugin } from '@iris-ui-kit/core'\nimport { applyCssVars, type ApplyCssVarsResult, type ThemeStore } from '@iris-ui-kit/theme'\nimport type { SkinEngine } from '@iris-ui-kit/skins'\nimport { ThemeProvider } from '../theme'\nimport { SkinProvider } from '../skins'\nimport { IrisI18nProvider } from '../i18n'\nimport { PluginStoreContextKey, type PluginStoreContext } from './context'\n\nconst DEFAULT_LOCALE = 'en-US'\n\n/** Public prop surface of {@link IrisProvider}. */\nexport interface IrisProviderProps {\n /** Theme store; when present the inner `ThemeProvider` wraps the subtree. */\n theme?: ThemeStore\n /** Skin engine; when present the inner `SkinProvider` wraps the subtree. */\n skin?: SkinEngine\n /** Writing direction, forwarded to `ThemeProvider` when a theme is given. */\n dir?: 'ltr' | 'rtl'\n /** Active BCP-47 locale; defaults to `'en-US'`. */\n locale?: string\n /** User messages — merged OVER plugin-registered messages (user wins). */\n messages?: Record<string, string>\n /** Plugins to install; their tokens / messages / stores are collected once. */\n plugins?: IrisPlugin[]\n /** Element receiving the plugin token layer; defaults to `documentElement`. */\n target?: HTMLElement | null\n}\n\n/**\n * The single unified Iris entry point. Runs `plugins` through the core\n * `runPlugins` collector and wires the result into the theme (tokens), i18n\n * (messages) and a plugin-store context, composing the existing per-framework\n * providers. A thin bridge — the real logic lives in `@iris-ui-kit/core`.\n *\n * Render order when present: Theme → Skin → I18n → PluginContext → children.\n */\nexport const IrisProvider = defineComponent({\n name: 'IrisProvider',\n props: {\n theme: { type: Object as PropType<ThemeStore>, default: undefined },\n skin: { type: Object as PropType<SkinEngine>, default: undefined },\n dir: { type: String as PropType<'ltr' | 'rtl'>, default: undefined },\n locale: { type: String, default: undefined },\n messages: { type: Object as PropType<Record<string, string>>, default: undefined },\n plugins: { type: Array as PropType<IrisPlugin[]>, default: undefined },\n target: { type: Object as PropType<HTMLElement | null>, default: null },\n },\n setup(props, { slots }) {\n // R1: `collected` is reactive so a `plugins` swap re-derives everything\n // downstream (tokens, messages, stores, installed set). Shallow: the stores\n // Map and store instances stay raw — never proxied — so `instanceof` /\n // private fields on class-based stores keep working.\n const collected = shallowRef<CollectedRegistrations>(runPlugins(props.plugins ?? []))\n\n // R4: one reactive context created once in setup (`provide()` cannot run\n // from a watcher — it requires the setup instance context) and mutated in\n // place on swap so `usePlugin` / `usePluginStore` consumers observe the new\n // stores and installed set after a re-render. Shallow for the same reason.\n const ctx = shallowReactive<PluginStoreContext>({\n stores: collected.value.stores,\n installed: new Set((props.plugins ?? []).map((p) => p.name)),\n })\n provide(PluginStoreContextKey, ctx)\n\n // tokens → additive CSS-var layer over the active theme; reverted on unmount.\n let applied: ApplyCssVarsResult | null = null\n // Pre-mount swaps must not create a token layer whose revert handle gets\n // shadowed by onMounted — `onMounted` applies the (already current) set.\n let mounted = false\n onMounted(() => {\n mounted = true\n if (typeof document === 'undefined') return\n const el = props.target ?? document.documentElement\n applied = applyCssVars(Object.entries(collected.value.tokens), el)\n })\n\n // R1–R4: re-collect when the `plugins` prop identity changes (array ref,\n // `Object.is` — same semantics as React `useMemo([plugins])` / Solid\n // `createMemo` / Svelte `$derived`). Non-immediate: the initial collection\n // happens in setup above, so an immediate watch would re-run `runPlugins`\n // (double eager store factories + spurious install→teardown→install).\n // Compute-then-commit: `runPlugins` is the only fallible step; a throwing\n // install aborts before any revert/teardown/replacement is committed.\n watch(\n () => props.plugins,\n (next) => {\n const prev = collected.value\n const nextCollected = runPlugins(next ?? [])\n applied?.revert()\n applied = null\n // R3: the removed set is torn exactly once at the swap (idempotent in\n // core); the current set is still torn exactly once in onBeforeUnmount.\n prev.teardown()\n collected.value = nextCollected\n ctx.stores = nextCollected.stores\n ctx.installed = new Set((next ?? []).map((p) => p.name))\n // R2 + R5: re-apply the new layer (guard `document` for SSR). Pre-mount\n // swaps are applied by onMounted — exactly one layer, no orphaned handle.\n if (mounted && typeof document !== 'undefined') {\n const el = props.target ?? document.documentElement\n applied = applyCssVars(Object.entries(nextCollected.tokens), el)\n }\n },\n )\n\n onBeforeUnmount(() => {\n applied?.revert()\n applied = null\n // Run plugin teardowns on unmount so eager stores / subscriptions /\n // timers don't leak. Idempotent and safe with no plugins.\n collected.value.teardown()\n })\n\n return () => {\n const locale = props.locale ?? DEFAULT_LOCALE\n // Plugin messages as BASE, user messages WIN.\n const messages = { ...collected.value.messages[locale], ...(props.messages ?? {}) }\n\n // I18n always renders, wrapping children.\n let tree: VNode = h(\n IrisI18nProvider,\n { locale: props.locale, messages },\n { default: () => slots.default?.() },\n )\n // Skin wraps only when a `skin` engine is supplied.\n if (props.skin) {\n tree = h(\n SkinProvider,\n { engine: props.skin, target: props.target },\n { default: () => tree },\n )\n }\n // Theme wraps only when a `theme` store is supplied.\n if (props.theme) {\n tree = h(\n ThemeProvider,\n { store: props.theme, target: props.target, dir: props.dir ?? 'ltr' },\n { default: () => tree },\n )\n }\n return tree\n }\n },\n})\n","import { inject } from 'vue'\nimport { PluginStoreContextKey } from './context'\n\n/** Whether the named plugin is installed by the nearest `<IrisProvider>`. */\nexport function usePlugin(name: string): boolean {\n const ctx = inject(PluginStoreContextKey, null)\n return ctx ? ctx.installed.has(name) : false\n}\n\n// Tracks ambiguous store key warnings to avoid spamming the console.\nconst warnedKeys = new Map<string, boolean>()\n\n/**\n * Read a plugin-registered store by `key` (backward-compatible single-arg form).\n * Throws a clear error when used outside an `<IrisProvider>`.\n */\nexport function usePluginStore<T>(key: string): T\n\n/**\n * Read a plugin-registered store by `namespace` + `key`.\n */\nexport function usePluginStore<T>(namespace: string, key: string): T\n\nexport function usePluginStore<T>(nsOrKey: string, key?: string): T {\n const ctx = inject(PluginStoreContextKey, null)\n if (!ctx) {\n const displayKey = key !== undefined ? `${nsOrKey}::${key}` : nsOrKey\n throw new Error(`[iris-ui] usePluginStore(\"${displayKey}\"): no <IrisProvider> ancestor found`)\n }\n\n const fullKey = key !== undefined ? `${nsOrKey}::${key}` : nsOrKey\n\n // 1. Direct lookup\n let store = ctx.stores.get(fullKey) as T | undefined\n if (store !== undefined) return store\n\n // 2. Single-arg fallback\n if (key === undefined) {\n store = ctx.stores.get(nsOrKey) as T | undefined\n if (store !== undefined) return store\n\n for (const k of ctx.stores.keys()) {\n if (typeof k === 'string' && k.endsWith(`::${nsOrKey}`)) {\n // Warn at most once per ambiguous key.\n if (!warnedKeys.has(nsOrKey)) {\n warnedKeys.set(nsOrKey, true)\n console.warn(\n `[iris-ui] Ambiguous plugin store key \"${nsOrKey}\". ` +\n `Found \"${k}\". Use the namespaced form: usePluginStore(\"${k}\").`,\n )\n }\n return ctx.stores.get(k) as T\n }\n }\n }\n\n throw new Error(\n `[iris-ui] Plugin store \"${fullKey}\" not found. ` +\n `Ensure the plugin is installed in IrisProvider and the key is correct.`,\n )\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/theme/ThemeProvider.ts","../src/skins/SkinProvider.ts","../src/i18n/context.ts","../src/i18n/I18nProvider.ts","../src/provider/context.ts","../src/provider/IrisProvider.ts","../src/provider/hooks.ts"],"names":["defineComponent","ref","applyTheme","applyDirection","onMounted","injectGlobalStyles","watch","onBeforeUnmount","provide","computed","applySkin","createI18n","localeDirection","onScopeDispose","shallowRef","runPlugins","shallowReactive","applyCssVars","h","inject"],"mappings":";;;;;;;;AA+BO,IAAM,YAAA,0BAAsD,WAAW,CAAA;AAWvE,IAAM,gBAAgBA,mBAAA,CAAgB;AAAA,EAC3C,IAAA,EAAM,mBAAA;AAAA,EACN,KAAA,EAAO;AAAA,IACL,KAAA,EAAO;AAAA,MACL,IAAA,EAAM,MAAA;AAAA,MACN,QAAA,EAAU;AAAA,KACZ;AAAA,IACA,MAAA,EAAQ;AAAA,MACN,IAAA,EAAM,MAAA;AAAA,MACN,OAAA,EAAS;AAAA,KACX;AAAA;AAAA,IAEA,GAAA,EAAK;AA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AAA;AAAA,WAC/D;AAAA,QACF;AACA,QAAA,OAAO,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,CAAC,CAAA;AAAA,MACzB;AAAA,IACF;AAAA,EACF;AAEA,EAAA,MAAM,IAAI,KAAA;AAAA,IACR,2BAA2B,OAAO,CAAA,mFAAA;AAAA,GAEpC;AACF","file":"provider.cjs","sourcesContent":["import {\n computed,\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n watch,\n type ComputedRef,\n type InjectionKey,\n type PropType,\n type Ref,\n} from 'vue'\nimport {\n applyDirection,\n applyTheme,\n injectGlobalStyles,\n type ApplyDirectionResult,\n type ApplyThemeResult,\n type Direction,\n type ThemeStore,\n} from '@iris-ui-kit/theme'\nimport type { IrisTheme } from '@iris-ui-kit/tokens'\n\nexport interface IrisThemeContext {\n store: ThemeStore\n current: Ref<IrisTheme>\n dir: ComputedRef<Direction>\n}\n\nexport const IrisThemeKey: InjectionKey<IrisThemeContext> = Symbol('IrisTheme')\n\n/**\n * Renderless provider that:\n * 1. exposes the theme store to descendants via `provide`,\n * 2. applies the current theme to a target element on mount and on change,\n * 3. reverts the inline custom properties on unmount.\n *\n * `target` defaults to `document.documentElement`. Pass an element ref to\n * scope a theme to a subtree.\n */\nexport const ThemeProvider = defineComponent({\n name: 'IrisThemeProvider',\n props: {\n store: {\n type: Object as PropType<ThemeStore>,\n required: true,\n },\n target: {\n type: Object as PropType<HTMLElement | null>,\n default: null,\n },\n /** Writing direction; sets `dir` on the target for RTL. Default `'ltr'`. */\n dir: {\n type: String as PropType<Direction>,\n default: 'ltr',\n },\n /** CSP nonce for injected inline stylesheets. */\n cspNonce: {\n type: String,\n default: undefined,\n },\n },\n setup(props, { slots }) {\n const current = ref(props.store.store.getState()) as Ref<IrisTheme>\n let unsubscribe = props.store.store.subscribe((next) => {\n current.value = next\n })\n\n let applied: ApplyThemeResult | null = null\n let dirApplied: ApplyDirectionResult | null = null\n\n const targetEl = () => props.target ?? document.documentElement\n\n const applyCurrent = () => {\n applied?.revert()\n applied = applyTheme(current.value, targetEl())\n }\n\n const applyDir = () => {\n dirApplied?.revert()\n dirApplied = applyDirection(props.dir, targetEl())\n }\n\n onMounted(() => {\n injectGlobalStyles(props.cspNonce)\n applyCurrent()\n applyDir()\n })\n\n watch(current, () => {\n if (applied) applyCurrent()\n })\n\n watch(\n () => props.store,\n (nextStore) => {\n unsubscribe()\n unsubscribe = nextStore.store.subscribe((next) => {\n current.value = next\n })\n current.value = nextStore.store.getState()\n if (applied) applyCurrent()\n },\n )\n\n watch(\n () => props.target,\n () => {\n if (applied) applyCurrent()\n if (dirApplied) applyDir()\n },\n )\n\n watch(\n () => props.dir,\n () => {\n if (dirApplied) applyDir()\n },\n )\n\n onBeforeUnmount(() => {\n unsubscribe()\n applied?.revert()\n applied = null\n dirApplied?.revert()\n dirApplied = null\n })\n\n provide(IrisThemeKey, { store: props.store, current, dir: computed(() => props.dir) })\n\n return () => slots.default?.()\n },\n})\n\nexport function useThemeContext(): IrisThemeContext {\n const ctx = inject(IrisThemeKey)\n if (!ctx) {\n throw new Error('[iris-ui] useTheme(): no <ThemeProvider> ancestor found')\n }\n return ctx\n}\n\n/**\n * Current writing direction (`'ltr'` / `'rtl'`) from the nearest\n * `<ThemeProvider>`, or a static `'ltr'` ref when there is none.\n */\nexport function useDirection(): ComputedRef<Direction> {\n const ctx = inject(IrisThemeKey, null)\n return ctx ? ctx.dir : computed(() => 'ltr' as Direction)\n}\n","import {\n defineComponent,\n inject,\n onBeforeUnmount,\n onMounted,\n provide,\n ref,\n watch,\n type InjectionKey,\n type PropType,\n type Ref,\n} from 'vue'\nimport { injectGlobalStyles } from '@iris-ui-kit/theme'\nimport {\n applySkin,\n type ApplySkinResult,\n type ResolvedSkin,\n type SkinEngine,\n} from '@iris-ui-kit/skins'\n\nexport interface IrisSkinContext {\n engine: SkinEngine\n current: Ref<ResolvedSkin>\n}\n\nexport const IrisSkinKey: InjectionKey<IrisSkinContext> = Symbol('IrisSkin')\n\n/**\n * Renderless provider mirroring `<IrisThemeProvider>` for skins: subscribes to\n * the engine store, applies/reverts the resolved skin on the target element,\n * and provides the engine + current skin to descendants. Zero skin logic.\n */\nexport const SkinProvider = defineComponent({\n name: 'IrisSkinProvider',\n props: {\n engine: { type: Object as PropType<SkinEngine>, required: true },\n target: { type: Object as PropType<HTMLElement | null>, default: null },\n cspNonce: { type: String, default: undefined },\n },\n setup(props, { slots }) {\n const current = ref(props.engine.current()) as Ref<ResolvedSkin>\n const unsubscribe = props.engine.subscribe((next) => {\n current.value = next\n })\n\n let applied: ApplySkinResult | null = null\n const targetEl = () => props.target ?? document.documentElement\n const apply = () => {\n applied?.revert()\n applied = applySkin(current.value, targetEl())\n }\n\n onMounted(() => {\n injectGlobalStyles(props.cspNonce)\n apply()\n })\n watch(current, () => {\n if (applied) apply()\n })\n watch(\n () => props.target,\n () => {\n if (applied) apply()\n },\n )\n onBeforeUnmount(() => {\n unsubscribe()\n applied?.revert()\n applied = null\n })\n\n provide(IrisSkinKey, { engine: props.engine, current })\n return () => slots.default?.()\n },\n})\n\nexport function useSkinContext(): IrisSkinContext {\n const ctx = inject(IrisSkinKey)\n if (!ctx) throw new Error('[iris-ui] useSkin(): no <SkinProvider> ancestor found')\n return ctx\n}\n","import { type InjectionKey } from 'vue'\nimport type { I18n } from '@iris-ui-kit/core'\n\n/** Injection key carrying the active {@link I18n} instance to `useI18n`. */\nexport const I18nInjectionKey: InjectionKey<I18n> = Symbol('IrisI18n')\n","import { defineComponent, onScopeDispose, provide, watch, type PropType } from 'vue'\nimport { createI18n, localeDirection, type I18n, type I18nMessages } from '@iris-ui-kit/core'\nimport { applyDirection } from '@iris-ui-kit/theme'\nimport { I18nInjectionKey } from './context'\n\n/**\n * Makes a locale + message dictionary available to descendant components via\n * `useI18n`. Pass `locale` / `messages` (an instance is created and kept in\n * sync) or a pre-built `i18n` instance you control externally. Renderless:\n * renders its default slot.\n */\nexport const IrisI18nProvider = defineComponent({\n name: 'IrisI18nProvider',\n props: {\n locale: { type: String, default: undefined },\n messages: { type: Object as PropType<I18nMessages>, default: undefined },\n i18n: { type: Object as PropType<I18n>, default: undefined },\n /**\n * When set, the locale's writing direction ({@link localeDirection}) is\n * applied to `directionTarget` (`dir` + `data-iris-dir`) and `<html lang>`\n * is set whenever `locale` changes — so \"set locale → flip direction +\n * announce language\" needs no manual wiring. Off by default so it never\n * fights an explicit `<ThemeProvider dir>`. Reverts on unmount.\n */\n autoDirection: { type: Boolean, default: false },\n /** Element to receive dir/lang when `autoDirection` is set. Defaults to `document.documentElement`. */\n directionTarget: { type: Object as PropType<HTMLElement | null>, default: undefined },\n },\n setup(props, { slots }) {\n const instance = props.i18n ?? createI18n({ locale: props.locale, messages: props.messages })\n provide(I18nInjectionKey, instance)\n\n if (!props.i18n) {\n watch(\n () => props.locale,\n (locale) => {\n if (locale) instance.setLocale(locale)\n },\n )\n watch(\n () => props.messages,\n (messages) => {\n if (messages) instance.setMessages(messages)\n },\n )\n }\n\n // Auto-apply writing direction + `lang` from the active locale (opt-in).\n let revertDirection: (() => void) | null = null\n watch(\n () => [props.autoDirection, props.locale, props.directionTarget] as const,\n ([autoDirection, locale]) => {\n revertDirection?.()\n revertDirection = null\n if (!autoDirection || !locale || typeof document === 'undefined') return\n const el = props.directionTarget ?? document.documentElement\n const applied = applyDirection(localeDirection(locale), el)\n const prevLang = el.getAttribute('lang')\n el.setAttribute('lang', locale)\n revertDirection = () => {\n applied.revert()\n if (prevLang === null) el.removeAttribute('lang')\n else el.setAttribute('lang', prevLang)\n }\n },\n { immediate: true },\n )\n onScopeDispose(() => {\n revertDirection?.()\n revertDirection = null\n })\n\n return () => slots.default?.()\n },\n})\n","import { type InjectionKey } from 'vue'\n\n/**\n * Shape carried by the plugin-store context: the live store instances collected\n * from every installed plugin, plus the set of installed plugin names. Surfaced\n * to descendants through `usePluginStore` / `usePlugin`.\n */\nexport interface PluginStoreContext {\n stores: Map<string, unknown>\n installed: Set<string>\n}\n\n/**\n * Injection key for the {@link PluginStoreContext}. The name ends in `Key` (and\n * the type in `Context`) so the manifest's discover step never mistakes it for a\n * component export.\n */\nexport const PluginStoreContextKey: InjectionKey<PluginStoreContext> = Symbol('IrisPluginStore')\n","import {\n defineComponent,\n h,\n onBeforeUnmount,\n onMounted,\n provide,\n shallowReactive,\n shallowRef,\n watch,\n type PropType,\n type VNode,\n} from 'vue'\nimport { runPlugins, type CollectedRegistrations, type IrisPlugin } from '@iris-ui-kit/core'\nimport { applyCssVars, type ApplyCssVarsResult, type ThemeStore } from '@iris-ui-kit/theme'\nimport type { SkinEngine } from '@iris-ui-kit/skins'\nimport { ThemeProvider } from '../theme'\nimport { SkinProvider } from '../skins'\nimport { IrisI18nProvider } from '../i18n'\nimport { PluginStoreContextKey, type PluginStoreContext } from './context'\n\nconst DEFAULT_LOCALE = 'en-US'\n\n/** Public prop surface of {@link IrisProvider}. */\nexport interface IrisProviderProps {\n /** Theme store; when present the inner `ThemeProvider` wraps the subtree. */\n theme?: ThemeStore\n /** Skin engine; when present the inner `SkinProvider` wraps the subtree. */\n skin?: SkinEngine\n /** Writing direction, forwarded to `ThemeProvider` when a theme is given. */\n dir?: 'ltr' | 'rtl'\n /** Active BCP-47 locale; defaults to `'en-US'`. */\n locale?: string\n /** User messages — merged OVER plugin-registered messages (user wins). */\n messages?: Record<string, string>\n /** Plugins to install; their tokens / messages / stores are collected once. */\n plugins?: IrisPlugin[]\n /** Element receiving the plugin token layer; defaults to `documentElement`. */\n target?: HTMLElement | null\n}\n\n/**\n * The single unified Iris entry point. Runs `plugins` through the core\n * `runPlugins` collector and wires the result into the theme (tokens), i18n\n * (messages) and a plugin-store context, composing the existing per-framework\n * providers. A thin bridge — the real logic lives in `@iris-ui-kit/core`.\n *\n * Render order when present: Theme → Skin → I18n → PluginContext → children.\n */\nexport const IrisProvider = defineComponent({\n name: 'IrisProvider',\n props: {\n theme: { type: Object as PropType<ThemeStore>, default: undefined },\n skin: { type: Object as PropType<SkinEngine>, default: undefined },\n dir: { type: String as PropType<'ltr' | 'rtl'>, default: undefined },\n locale: { type: String, default: undefined },\n messages: { type: Object as PropType<Record<string, string>>, default: undefined },\n plugins: { type: Array as PropType<IrisPlugin[]>, default: undefined },\n target: { type: Object as PropType<HTMLElement | null>, default: null },\n },\n setup(props, { slots }) {\n // R1: `collected` is reactive so a `plugins` swap re-derives everything\n // downstream (tokens, messages, stores, installed set). Shallow: the stores\n // Map and store instances stay raw — never proxied — so `instanceof` /\n // private fields on class-based stores keep working.\n const collected = shallowRef<CollectedRegistrations>(runPlugins(props.plugins ?? []))\n\n // R4: one reactive context created once in setup (`provide()` cannot run\n // from a watcher — it requires the setup instance context) and mutated in\n // place on swap so `usePlugin` / `usePluginStore` consumers observe the new\n // stores and installed set after a re-render. Shallow for the same reason.\n const ctx = shallowReactive<PluginStoreContext>({\n stores: collected.value.stores,\n installed: new Set((props.plugins ?? []).map((p) => p.name)),\n })\n provide(PluginStoreContextKey, ctx)\n\n // tokens → additive CSS-var layer over the active theme; reverted on unmount.\n let applied: ApplyCssVarsResult | null = null\n // Pre-mount swaps must not create a token layer whose revert handle gets\n // shadowed by onMounted — `onMounted` applies the (already current) set.\n let mounted = false\n onMounted(() => {\n mounted = true\n if (typeof document === 'undefined') return\n const el = props.target ?? document.documentElement\n applied = applyCssVars(Object.entries(collected.value.tokens), el)\n })\n\n // R1–R4: re-collect when the `plugins` prop identity changes (array ref,\n // `Object.is` — same semantics as React `useMemo([plugins])` / Solid\n // `createMemo` / Svelte `$derived`). Non-immediate: the initial collection\n // happens in setup above, so an immediate watch would re-run `runPlugins`\n // (double eager store factories + spurious install→teardown→install).\n // Compute-then-commit: `runPlugins` is the only fallible step; a throwing\n // install aborts before any revert/teardown/replacement is committed.\n watch(\n () => props.plugins,\n (next) => {\n const prev = collected.value\n const nextCollected = runPlugins(next ?? [])\n applied?.revert()\n applied = null\n // R3: the removed set is torn exactly once at the swap (idempotent in\n // core); the current set is still torn exactly once in onBeforeUnmount.\n prev.teardown()\n collected.value = nextCollected\n ctx.stores = nextCollected.stores\n ctx.installed = new Set((next ?? []).map((p) => p.name))\n // R2 + R5: re-apply the new layer (guard `document` for SSR). Pre-mount\n // swaps are applied by onMounted — exactly one layer, no orphaned handle.\n if (mounted && typeof document !== 'undefined') {\n const el = props.target ?? document.documentElement\n applied = applyCssVars(Object.entries(nextCollected.tokens), el)\n }\n },\n )\n\n onBeforeUnmount(() => {\n applied?.revert()\n applied = null\n // Run plugin teardowns on unmount so eager stores / subscriptions /\n // timers don't leak. Idempotent and safe with no plugins.\n collected.value.teardown()\n })\n\n return () => {\n const locale = props.locale ?? DEFAULT_LOCALE\n // Plugin messages as BASE, user messages WIN.\n const messages = { ...collected.value.messages[locale], ...(props.messages ?? {}) }\n\n // I18n always renders, wrapping children.\n let tree: VNode = h(\n IrisI18nProvider,\n { locale: props.locale, messages },\n { default: () => slots.default?.() },\n )\n // Skin wraps only when a `skin` engine is supplied.\n if (props.skin) {\n tree = h(\n SkinProvider,\n { engine: props.skin, target: props.target },\n { default: () => tree },\n )\n }\n // Theme wraps only when a `theme` store is supplied.\n if (props.theme) {\n tree = h(\n ThemeProvider,\n { store: props.theme, target: props.target, dir: props.dir ?? 'ltr' },\n { default: () => tree },\n )\n }\n return tree\n }\n },\n})\n","import { inject } from 'vue'\nimport { PluginStoreContextKey } from './context'\n\n/** Whether the named plugin is installed by the nearest `<IrisProvider>`. */\nexport function usePlugin(name: string): boolean {\n const ctx = inject(PluginStoreContextKey, null)\n return ctx ? ctx.installed.has(name) : false\n}\n\n// Tracks ambiguous store key warnings to avoid spamming the console.\nconst warnedKeys = new Map<string, boolean>()\n\n/**\n * Read a plugin-registered store by `key` (backward-compatible single-arg form).\n * Throws a clear error when used outside an `<IrisProvider>`.\n */\nexport function usePluginStore<T>(key: string): T\n\n/**\n * Read a plugin-registered store by `namespace` + `key`.\n */\nexport function usePluginStore<T>(namespace: string, key: string): T\n\nexport function usePluginStore<T>(nsOrKey: string, key?: string): T {\n const ctx = inject(PluginStoreContextKey, null)\n if (!ctx) {\n const displayKey = key !== undefined ? `${nsOrKey}::${key}` : nsOrKey\n throw new Error(`[iris-ui] usePluginStore(\"${displayKey}\"): no <IrisProvider> ancestor found`)\n }\n\n const fullKey = key !== undefined ? `${nsOrKey}::${key}` : nsOrKey\n\n // 1. Direct lookup\n let store = ctx.stores.get(fullKey) as T | undefined\n if (store !== undefined) return store\n\n // 2. Single-arg fallback\n if (key === undefined) {\n store = ctx.stores.get(nsOrKey) as T | undefined\n if (store !== undefined) return store\n\n for (const k of ctx.stores.keys()) {\n if (typeof k === 'string' && k.endsWith(`::${nsOrKey}`)) {\n // Warn at most once per ambiguous key.\n if (!warnedKeys.has(nsOrKey)) {\n warnedKeys.set(nsOrKey, true)\n console.warn(\n `[iris-ui] Ambiguous plugin store key \"${nsOrKey}\". ` +\n `Found \"${k}\". Use the namespaced form: usePluginStore(\"${k}\").`,\n )\n }\n return ctx.stores.get(k) as T\n }\n }\n }\n\n throw new Error(\n `[iris-ui] Plugin store \"${fullKey}\" not found. ` +\n `Ensure the plugin is installed in IrisProvider and the key is correct.`,\n )\n}\n"]}
|
package/dist/provider.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export { IrisProvider, PluginStoreContextKey, usePlugin, usePluginStore } from './chunk-
|
|
2
|
-
import './chunk-
|
|
3
|
-
import './chunk-
|
|
4
|
-
import './chunk-
|
|
1
|
+
export { IrisProvider, PluginStoreContextKey, usePlugin, usePluginStore } from './chunk-MO7AAXA6.js';
|
|
2
|
+
import './chunk-UPC4GN3F.js';
|
|
3
|
+
import './chunk-ZTPIXL7Q.js';
|
|
4
|
+
import './chunk-TCAXRWT6.js';
|
|
5
5
|
//# sourceMappingURL=provider.js.map
|
|
6
6
|
//# sourceMappingURL=provider.js.map
|
package/dist/skeletons.cjs
CHANGED
|
@@ -242,7 +242,7 @@ var IrisInput = vue.defineComponent({
|
|
|
242
242
|
});
|
|
243
243
|
|
|
244
244
|
// src/i18n/context.ts
|
|
245
|
-
var I18nInjectionKey = Symbol("IrisI18n");
|
|
245
|
+
var I18nInjectionKey = /* @__PURE__ */ Symbol("IrisI18n");
|
|
246
246
|
var fallbackI18n = null;
|
|
247
247
|
function getFallback() {
|
|
248
248
|
if (fallbackI18n === null) fallbackI18n = core.createI18n();
|