@iris-ui-kit/vue 0.2.20 → 0.2.22
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 +36 -6
- package/dist/admin.cjs.map +1 -1
- package/dist/admin.js +4 -4
- package/dist/async.cjs +48 -2
- package/dist/async.cjs.map +1 -1
- package/dist/async.d.cts +27 -3
- package/dist/async.d.ts +27 -3
- package/dist/async.js +1 -1
- package/dist/chunk-25NYWSXP.js +20 -0
- package/dist/chunk-25NYWSXP.js.map +1 -0
- package/dist/{chunk-I6D5VXQK.js → chunk-3V46HGRC.js} +4 -3
- package/dist/chunk-3V46HGRC.js.map +1 -0
- package/dist/{chunk-QLUIKEMJ.js → chunk-ENKE2BPC.js} +3 -3
- package/dist/{chunk-QLUIKEMJ.js.map → chunk-ENKE2BPC.js.map} +1 -1
- package/dist/{chunk-4FLIW67H.js → chunk-IAG64CHL.js} +21 -28
- package/dist/chunk-IAG64CHL.js.map +1 -0
- package/dist/{chunk-W2JVHGFR.js → chunk-MO7AAXA6.js} +33 -13
- package/dist/chunk-MO7AAXA6.js.map +1 -0
- package/dist/chunk-NNOF7KUH.js +24 -0
- package/dist/chunk-NNOF7KUH.js.map +1 -0
- package/dist/{chunk-MMQKSFME.js → chunk-QQ25RKOO.js} +9 -5
- package/dist/chunk-QQ25RKOO.js.map +1 -0
- package/dist/chunk-SJB5DIIY.js +119 -0
- package/dist/chunk-SJB5DIIY.js.map +1 -0
- package/dist/{chunk-H7HVVPYR.js → chunk-UPC4GN3F.js} +8 -2
- package/dist/chunk-UPC4GN3F.js.map +1 -0
- package/dist/{chunk-72PZMU6R.js → chunk-ZTPIXL7Q.js} +21 -3
- package/dist/chunk-ZTPIXL7Q.js.map +1 -0
- package/dist/form.cjs +28 -23
- package/dist/form.cjs.map +1 -1
- package/dist/form.d.cts +3 -2
- package/dist/form.d.ts +3 -2
- package/dist/form.js +2 -1
- package/dist/index.cjs +166 -45
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +38 -16
- package/dist/index.js.map +1 -1
- package/dist/layouts.cjs +2 -1
- package/dist/layouts.cjs.map +1 -1
- package/dist/layouts.js +1 -1
- package/dist/machine.cjs +11 -4
- package/dist/machine.cjs.map +1 -1
- package/dist/machine.d.cts +12 -3
- package/dist/machine.d.ts +12 -3
- package/dist/machine.js +1 -1
- package/dist/provider.cjs +53 -9
- package/dist/provider.cjs.map +1 -1
- package/dist/provider.js +3 -3
- package/dist/resource.cjs +7 -3
- package/dist/resource.cjs.map +1 -1
- package/dist/resource.d.cts +10 -1
- package/dist/resource.d.ts +10 -1
- package/dist/resource.js +1 -1
- package/dist/skeletons.cjs +2 -1
- package/dist/skeletons.cjs.map +1 -1
- package/dist/skeletons.js +2 -2
- package/dist/skins.cjs +6 -0
- package/dist/skins.cjs.map +1 -1
- package/dist/skins.js +1 -1
- package/dist/theme.cjs +19 -1
- package/dist/theme.cjs.map +1 -1
- package/dist/theme.js +1 -1
- package/package.json +1 -1
- package/dist/chunk-4FLIW67H.js.map +0 -1
- package/dist/chunk-72PZMU6R.js.map +0 -1
- package/dist/chunk-H7HVVPYR.js.map +0 -1
- package/dist/chunk-I6D5VXQK.js.map +0 -1
- package/dist/chunk-MMQKSFME.js.map +0 -1
- package/dist/chunk-TQB5LVOH.js +0 -17
- package/dist/chunk-TQB5LVOH.js.map +0 -1
- package/dist/chunk-W2JVHGFR.js.map +0 -1
- package/dist/chunk-XSLBANUV.js +0 -16
- package/dist/chunk-XSLBANUV.js.map +0 -1
- package/dist/chunk-ZY4NLITM.js +0 -73
- package/dist/chunk-ZY4NLITM.js.map +0 -1
package/dist/layouts.cjs
CHANGED
|
@@ -29,7 +29,8 @@ var IrisSidebarLayout = vue.defineComponent({
|
|
|
29
29
|
() => props.collapsed,
|
|
30
30
|
(value) => {
|
|
31
31
|
if (value !== void 0) internalCollapsed.value = value;
|
|
32
|
-
}
|
|
32
|
+
},
|
|
33
|
+
{ immediate: true }
|
|
33
34
|
);
|
|
34
35
|
const setCollapsed = (value) => {
|
|
35
36
|
if (!isControlled.value) internalCollapsed.value = value;
|
package/dist/layouts.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/layouts/SidebarLayout.ts","../src/layouts/HeaderLayout.ts","../src/layouts/DashboardGrid.ts","../src/layouts/Stack.ts","../src/layouts/Container.ts","../src/layouts/Grid.ts"],"names":["defineComponent","computed","ref","watch","h","toCssSpacing"],"mappings":";;;;;AAaO,IAAM,oBAAoBA,mBAAA,CAAgB;AAAA,EAC/C,IAAA,EAAM,mBAAA;AAAA,EACN,YAAA,EAAc,KAAA;AAAA,EACd,KAAA,EAAO;AAAA,IACL,SAAA,EAAW,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,MAAA,EAAU;AAAA,IAC/C,gBAAA,EAAkB,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,KAAA,EAAM;AAAA;AAAA,IAElD,KAAA,EAAO,EAAE,IAAA,EAAM,CAAC,QAAQ,MAAM,CAAA,EAAG,SAAS,GAAA,EAAI;AAAA;AAAA,IAE9C,cAAA,EAAgB,EAAE,IAAA,EAAM,CAAC,QAAQ,MAAM,CAAA,EAAG,SAAS,EAAA,EAAG;AAAA;AAAA,IAEtD,IAAA,EAAM,EAAE,IAAA,EAAM,MAAA,EAAkC,SAAS,MAAA;AAAO,GAClE;AAAA,EACA,KAAA,EAAO;AAAA,IACL,kBAAA,EAAoB,CAAC,MAAA,KAAoB;AAAA,GAC3C;AAAA,EACA,MAAM,KAAA,EAAO,EAAE,KAAA,EAAO,KAAA,EAAO,MAAK,EAAG;AACnC,IAAA,MAAM,YAAA,GAAeC,YAAA,CAAS,MAAM,KAAA,CAAM,cAAc,MAAS,CAAA;AACjE,IAAA,MAAM,iBAAA,GAAoBC,OAAA,CAAI,KAAA,CAAM,gBAAgB,CAAA;AACpD,IAAA,MAAM,SAAA,GAAYD,YAAA;AAAA,MAAS,MACzB,YAAA,CAAa,KA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AA,GAAIA,aAAAA,CAAa,KAAA,CAAM,GAAG,CAAA;AAClF,MAAA,MAAM,MAAA,GACJ,KAAA,CAAM,SAAA,KAAc,MAAA,GAAYA,aAAAA,CAAa,MAAM,SAAS,CAAA,GAAIA,aAAAA,CAAa,KAAA,CAAM,GAAG,CAAA;AACxF,MAAA,OAAO;AAAA,QACL,OAAA,EAAS,KAAA,CAAM,MAAA,GAAS,aAAA,GAAgB,MAAA;AAAA,QACxC,mBAAA,EAAqB,WAAA;AAAA,QACrB,MAAA;AAAA,QACA,SAAA,EAAW;AAAA,OACb;AAAA,IACF,CAAC,CAAA;AAED,IAAA,OAAO,MACLD,KAAAA;AAAA,MACE,KAAA;AAAA,MACA;AAAA,QACE,GAAG,KAAA;AAAA,QACH,gBAAA,EAAkB,EAAA;AAAA,QAClB,wBAAA,EAA0B,MAAA,CAAO,KAAA,CAAM,OAAO,CAAA;AAAA,QAC9C,KAAA,EAAO,EAAE,GAAG,KAAA,CAAM,OAAO,GAAK,KAAA,CAAM,KAAA,IAAgD,EAAC;AAAG,OAC1F;AAAA,MACA,MAAM,OAAA;AAAU,KAClB;AAAA,EACJ;AACF,CAAC","file":"layouts.cjs","sourcesContent":["import { computed, defineComponent, h, ref, watch } from 'vue'\n\n/**\n * Two-column layout with a collapsible sidebar.\n *\n * Slots:\n * - `sidebar` — content rendered in the sidebar (kept mounted across collapses).\n * - `default` — the main content area.\n *\n * Use `:collapsed` for controlled mode or `:default-collapsed` for the\n * uncontrolled initial state. When collapsed, the sidebar shrinks to\n * `:collapsed-width` so icon-only navigation still fits.\n */\nexport const IrisSidebarLayout = defineComponent({\n name: 'IrisSidebarLayout',\n inheritAttrs: false,\n props: {\n collapsed: { type: Boolean, default: undefined },\n defaultCollapsed: { type: Boolean, default: false },\n /** Sidebar width when expanded (px or CSS length). */\n width: { type: [Number, String], default: 240 },\n /** Sidebar width when collapsed. */\n collapsedWidth: { type: [Number, String], default: 60 },\n /** Sidebar position. */\n side: { type: String as () => 'left' | 'right', default: 'left' },\n },\n emits: {\n 'update:collapsed': (_value: boolean) => true,\n },\n setup(props, { slots, attrs, emit }) {\n const isControlled = computed(() => props.collapsed !== undefined)\n const internalCollapsed = ref(props.defaultCollapsed)\n const collapsed = computed(() =>\n isControlled.value ? Boolean(props.collapsed) : internalCollapsed.value,\n )\n\n // Sync controlled prop changes into internal state on first run so a later\n // detach to uncontrolled mode preserves the last-known value.\n watch(\n () => props.collapsed,\n (value) => {\n if (value !== undefined) internalCollapsed.value = value\n },\n )\n\n const setCollapsed = (value: boolean) => {\n if (!isControlled.value) internalCollapsed.value = value\n emit('update:collapsed', value)\n }\n\n const asLen = (v: number | string) => (typeof v === 'number' ? `${v}px` : v)\n\n return () => {\n const sidebarStyle: Record<string, string> = {\n width: collapsed.value ? asLen(props.collapsedWidth) : asLen(props.width),\n flexShrink: '0',\n background: 'var(--iris-surface)',\n borderRight: props.side === 'left' ? '1px solid var(--iris-border)' : 'none',\n borderLeft: props.side === 'right' ? '1px solid var(--iris-border)' : 'none',\n transition: 'width 180ms ease',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n }\n const mainStyle: Record<string, string> = {\n flex: '1',\n minWidth: '0',\n overflow: 'auto',\n background: 'var(--iris-background)',\n }\n const direction = props.side === 'right' ? 'row-reverse' : 'row'\n\n return h(\n 'div',\n {\n ...attrs,\n 'data-iris-sidebar-layout': '',\n 'data-collapsed': collapsed.value ? '' : undefined,\n 'data-side': props.side,\n style: {\n display: 'flex',\n flexDirection: direction,\n width: '100%',\n height: '100%',\n minHeight: '0',\n color: 'var(--iris-foreground)',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n [\n h(\n 'aside',\n {\n role: 'complementary',\n 'data-iris-sidebar': '',\n 'data-collapsed': collapsed.value ? '' : undefined,\n style: sidebarStyle,\n },\n slots.sidebar?.({ collapsed: collapsed.value, setCollapsed }),\n ),\n h('div', { 'data-iris-sidebar-main': '', style: mainStyle }, slots.default?.()),\n ],\n )\n }\n },\n})\n","import { defineComponent, h, type PropType } from 'vue'\n\n/**\n * Two-region vertical layout: a sticky header on top, scrollable main below.\n *\n * Slots:\n * - `header` — fixed at top.\n * - `footer` — optional fixed at bottom.\n * - `default` — scrollable main region.\n */\nexport const IrisHeaderLayout = defineComponent({\n name: 'IrisHeaderLayout',\n inheritAttrs: false,\n props: {\n /** Header height (px or CSS length). Default `'auto'`. */\n headerHeight: { type: [Number, String] as PropType<number | string>, default: 'auto' },\n /** Footer height (px or CSS length). Default `'auto'`. */\n footerHeight: { type: [Number, String] as PropType<number | string>, default: 'auto' },\n /** When true, header sticks via `position: sticky` instead of static. */\n sticky: { type: Boolean, default: true },\n },\n setup(props, { slots, attrs }) {\n const asLen = (v: number | string) => (typeof v === 'number' ? `${v}px` : v)\n return () =>\n h(\n 'div',\n {\n ...attrs,\n 'data-iris-header-layout': '',\n style: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%',\n minHeight: '0',\n background: 'var(--iris-background)',\n color: 'var(--iris-foreground)',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n [\n slots.header\n ? h(\n 'header',\n {\n role: 'banner',\n 'data-iris-header': '',\n style: {\n flexShrink: '0',\n height: asLen(props.headerHeight),\n borderBottom: '1px solid var(--iris-border)',\n background: 'var(--iris-surface)',\n position: props.sticky ? 'sticky' : 'static',\n top: '0',\n zIndex: '50',\n },\n },\n slots.header(),\n )\n : null,\n h(\n 'main',\n {\n role: 'main',\n 'data-iris-header-main': '',\n style: { flex: '1', minHeight: '0', overflow: 'auto' },\n },\n slots.default?.(),\n ),\n slots.footer\n ? h(\n 'footer',\n {\n role: 'contentinfo',\n 'data-iris-footer': '',\n style: {\n flexShrink: '0',\n height: asLen(props.footerHeight),\n borderTop: '1px solid var(--iris-border)',\n background: 'var(--iris-surface)',\n },\n },\n slots.footer(),\n )\n : null,\n ],\n )\n },\n})\n","import { defineComponent, h } from 'vue'\n\n/**\n * 12-column responsive grid for dashboard composition. Each child should be\n * an `IrisDashboardCard` (or any element with `grid-column: span N`).\n *\n * Children control their span via inline `style=\"grid-column: span N\"` or\n * by wrapping with `IrisDashboardCard` whose `col-span` / `row-span` props\n * compile to the same CSS.\n */\nexport const IrisDashboardGrid = defineComponent({\n name: 'IrisDashboardGrid',\n inheritAttrs: false,\n props: {\n columns: { type: Number, default: 12 },\n gap: { type: [Number, String], default: 16 },\n /** Minimum column width via `grid-template-columns: repeat(auto-fill, minmax(...))`. */\n minColWidth: { type: [Number, String], default: undefined },\n },\n setup(props, { slots, attrs }) {\n const gap = typeof props.gap === 'number' ? `${props.gap}px` : props.gap\n return () => {\n const gridTemplateColumns = props.minColWidth\n ? `repeat(auto-fill, minmax(${typeof props.minColWidth === 'number' ? `${props.minColWidth}px` : props.minColWidth}, 1fr))`\n : `repeat(${props.columns}, 1fr)`\n return h(\n 'div',\n {\n ...attrs,\n 'data-iris-dashboard-grid': '',\n style: {\n display: 'grid',\n gap,\n gridTemplateColumns,\n width: '100%',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n slots.default?.(),\n )\n }\n },\n})\n\n/**\n * A single grid cell — wraps content in a styled card with optional span\n * controls. `col-span` accepts a number (column count) or `'full'` to fill\n * the entire row.\n */\nexport const IrisDashboardCard = defineComponent({\n name: 'IrisDashboardCard',\n inheritAttrs: false,\n props: {\n colSpan: { type: [Number, String], default: 1 },\n rowSpan: { type: Number, default: 1 },\n /** Show a styled card surface (background + border). Default `true`. */\n surface: { type: Boolean, default: true },\n },\n setup(props, { slots, attrs }) {\n return () => {\n const colSpan = props.colSpan === 'full' ? '1 / -1' : `span ${props.colSpan}`\n const rowSpan = props.rowSpan > 1 ? `span ${props.rowSpan}` : undefined\n return h(\n 'div',\n {\n ...attrs,\n 'data-iris-dashboard-card': '',\n style: {\n gridColumn: colSpan,\n gridRow: rowSpan,\n background: props.surface ? 'var(--iris-surface)' : 'transparent',\n border: props.surface ? '1px solid var(--iris-border)' : 'none',\n borderRadius: 'var(--iris-radius-md)',\n padding: props.surface ? 'var(--iris-padding-lg)' : '0',\n minWidth: '0',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n slots.default?.(),\n )\n }\n },\n})\n","import { computed, defineComponent, h, type PropType } from 'vue'\n\nexport type IrisStackDirection = 'row' | 'column'\nexport type IrisStackAlign = 'start' | 'center' | 'end' | 'stretch'\nexport type IrisStackJustify = 'start' | 'center' | 'end' | 'between' | 'around'\n\nconst ALIGN_MAP: Record<IrisStackAlign, string> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n stretch: 'stretch',\n}\n\nconst JUSTIFY_MAP: Record<IrisStackJustify, string> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n between: 'space-between',\n around: 'space-around',\n}\n\nfunction toCssSpacing(spacing: string | number): string {\n if (typeof spacing === 'number') return `${spacing}px`\n // Token shorthand: \"sm\" / \"md\" / \"lg\" → var(--iris-gap-X)\n if (spacing === 'sm' || spacing === 'md' || spacing === 'lg') {\n return `var(--iris-gap-${spacing})`\n }\n return spacing\n}\n\n/**\n * Flex container with token-driven spacing. The lightest possible layout\n * primitive — most pages need a horizontal or vertical stack and this saves\n * hand-writing `display: flex` everywhere.\n *\n * Use `direction`/`spacing`/`align`/`justify`/`wrap` to configure; children\n * are arranged in document order with `gap: <spacing>`.\n */\nexport const IrisStack = defineComponent({\n name: 'IrisStack',\n inheritAttrs: false,\n props: {\n direction: { type: String as PropType<IrisStackDirection>, default: 'column' },\n spacing: { type: [String, Number], default: 'md' },\n align: { type: String as PropType<IrisStackAlign>, default: 'stretch' },\n justify: { type: String as PropType<IrisStackJustify>, default: 'start' },\n wrap: { type: Boolean, default: false },\n /** When true, renders as an inline-flex container. */\n inline: { type: Boolean, default: false },\n },\n setup(props, { slots, attrs }) {\n const style = computed<Record<string, string>>(() => ({\n display: props.inline ? 'inline-flex' : 'flex',\n flexDirection: props.direction,\n gap: toCssSpacing(props.spacing),\n alignItems: ALIGN_MAP[props.align],\n justifyContent: JUSTIFY_MAP[props.justify],\n flexWrap: props.wrap ? 'wrap' : 'nowrap',\n }))\n\n return () =>\n h(\n 'div',\n {\n ...attrs,\n 'data-iris-stack': '',\n 'data-iris-stack-direction': props.direction,\n style: { ...style.value, ...((attrs.style as Record<string, string> | undefined) ?? {}) },\n },\n slots.default?.(),\n )\n },\n})\n","import { computed, defineComponent, h, type PropType } from 'vue'\n\nexport type IrisContainerMaxWidth = 'sm' | 'md' | 'lg' | 'xl' | 'full' | string\n\nconst WIDTH_MAP: Record<'sm' | 'md' | 'lg' | 'xl' | 'full', string> = {\n sm: '640px',\n md: '768px',\n lg: '1024px',\n xl: '1280px',\n full: '100%',\n}\n\nfunction resolveMaxWidth(input: IrisContainerMaxWidth): string {\n if (input === 'sm' || input === 'md' || input === 'lg' || input === 'xl' || input === 'full') {\n return WIDTH_MAP[input]\n }\n return input // arbitrary CSS length\n}\n\nfunction resolvePadding(input: string | number): string {\n if (typeof input === 'number') return `${input}px`\n if (input === 'sm' || input === 'md' || input === 'lg') {\n return `var(--iris-padding-${input})`\n }\n return input\n}\n\n/**\n * Centered max-width wrapper. Use to bound content width on large screens\n * without rewriting flex/grid plumbing.\n *\n * `maxWidth='lg'` (≈1024px) is the most common default for marketing /\n * docs / app pages.\n */\nexport const IrisContainer = defineComponent({\n name: 'IrisContainer',\n inheritAttrs: false,\n props: {\n maxWidth: { type: String as PropType<IrisContainerMaxWidth>, default: 'lg' },\n padding: { type: [String, Number], default: 'md' },\n center: { type: Boolean, default: true },\n },\n setup(props, { slots, attrs }) {\n const style = computed<Record<string, string>>(() => ({\n width: '100%',\n maxWidth: resolveMaxWidth(props.maxWidth),\n padding: `0 ${resolvePadding(props.padding)}`,\n ...(props.center ? { marginInlineStart: 'auto', marginInlineEnd: 'auto' } : {}),\n }))\n\n return () =>\n h(\n 'div',\n {\n ...attrs,\n 'data-iris-container': '',\n 'data-iris-container-max-width': props.maxWidth,\n style: { ...style.value, ...((attrs.style as Record<string, string> | undefined) ?? {}) },\n },\n slots.default?.(),\n )\n },\n})\n","import { computed, defineComponent, h, type PropType } from 'vue'\n\nexport type IrisGridColumns =\n | number\n | 'auto-fit'\n | 'auto-fill'\n | string /* raw grid-template-columns value */\n\nfunction resolveColumns(columns: IrisGridColumns, minColWidth: string): string {\n if (typeof columns === 'number') return `repeat(${columns}, minmax(0, 1fr))`\n if (columns === 'auto-fit') return `repeat(auto-fit, minmax(${minColWidth}, 1fr))`\n if (columns === 'auto-fill') return `repeat(auto-fill, minmax(${minColWidth}, 1fr))`\n return columns\n}\n\nfunction toCssSpacing(spacing: string | number): string {\n if (typeof spacing === 'number') return `${spacing}px`\n if (spacing === 'sm' || spacing === 'md' || spacing === 'lg') {\n return `var(--iris-gap-${spacing})`\n }\n return spacing\n}\n\n/**\n * Two-dimensional grid layout primitive. Three column modes:\n *\n * - **Fixed integer** — `columns={3}` → three equal-width columns.\n * - **Responsive auto-fit** — `columns=\"auto-fit\"` + `minColWidth` → fluid\n * grid where columns add/remove with container width. Most common.\n * - **Raw CSS** — pass any `grid-template-columns` string.\n *\n * Spacing accepts token shorthand (`sm` / `md` / `lg`), numeric px, or any\n * CSS length string. `gap` is a shortcut for both row + column gap.\n */\nexport const IrisGrid = defineComponent({\n name: 'IrisGrid',\n inheritAttrs: false,\n props: {\n columns: { type: [Number, String] as PropType<IrisGridColumns>, default: 'auto-fit' },\n /** Min width per column for `auto-fit` / `auto-fill`. */\n minColWidth: { type: String, default: '200px' },\n /** Row gap (token / px / CSS). */\n rowGap: { type: [String, Number], default: undefined },\n /** Column gap (token / px / CSS). */\n columnGap: { type: [String, Number], default: undefined },\n /** Shorthand for both row + column gap. Overridden if rowGap/columnGap given. */\n gap: { type: [String, Number], default: 'md' },\n inline: { type: Boolean, default: false },\n },\n setup(props, { slots, attrs }) {\n const style = computed<Record<string, string>>(() => {\n const colTemplate = resolveColumns(props.columns, props.minColWidth)\n const rowGap =\n props.rowGap !== undefined ? toCssSpacing(props.rowGap) : toCssSpacing(props.gap)\n const colGap =\n props.columnGap !== undefined ? toCssSpacing(props.columnGap) : toCssSpacing(props.gap)\n return {\n display: props.inline ? 'inline-grid' : 'grid',\n gridTemplateColumns: colTemplate,\n rowGap,\n columnGap: colGap,\n }\n })\n\n return () =>\n h(\n 'div',\n {\n ...attrs,\n 'data-iris-grid': '',\n 'data-iris-grid-columns': String(props.columns),\n style: { ...style.value, ...((attrs.style as Record<string, string> | undefined) ?? {}) },\n },\n slots.default?.(),\n )\n },\n})\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/layouts/SidebarLayout.ts","../src/layouts/HeaderLayout.ts","../src/layouts/DashboardGrid.ts","../src/layouts/Stack.ts","../src/layouts/Container.ts","../src/layouts/Grid.ts"],"names":["defineComponent","computed","ref","watch","h","toCssSpacing"],"mappings":";;;;;AAaO,IAAM,oBAAoBA,mBAAA,CAAgB;AAAA,EAC/C,IAAA,EAAM,mBAAA;AAAA,EACN,YAAA,EAAc,KAAA;AAAA,EACd,KAAA,EAAO;AAAA,IACL,SAAA,EAAW,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,MAAA,EAAU;AAAA,IAC/C,gBAAA,EAAkB,EAAE,IAAA,EAAM,OAAA,EAAS,SAAS,KAAA,EAAM;AAAA;AAAA,IAElD,KAAA,EAAO,EAAE,IAAA,EAAM,CAAC,QAAQ,MAAM,CAAA,EAAG,SAAS,GAAA,EAAI;AAAA;AAAA,IAE9C,cAAA,EAAgB,EAAE,IAAA,EAAM,CAAC,QAAQ,MAAM,CAAA,EAAG,SAAS,EAAA,EAAG;AAAA;AAAA,IAEtD,IAAA,EAAM,EAAE,IAAA,EAAM,MAAA,EAAkC,SAAS,MAAA;AAAO,GAClE;AAAA,EACA,KAAA,EAAO;AAAA,IACL,kBAAA,EAAoB,CAAC,MAAA,KAAoB;AAAA,GAC3C;AAAA,EACA,MAAM,KAAA,EAAO,EAAE,KAAA,EAAO,KAAA,EAAO,MAAK,EAAG;AACnC,IAAA,MAAM,YAAA,GAAeC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G;AAC7B,IAAA,MAAM,KAAA,GAAQC,aAAiC,MAAM;AACnD,MAAA,MAAM,WAAA,GAAc,cAAA,CAAe,KAAA,CAAM,OAAA,EAAS,MAAM,WAAW,CAAA;AACnE,MAAA,MAAM,MAAA,GACJ,KAAA,CAAM,MAAA,KAAW,MAAA,GAAYI,aAAAA,CAAa,MAAM,MAAM,CAAA,GAAIA,aAAAA,CAAa,KAAA,CAAM,GAAG,CAAA;AAClF,MAAA,MAAM,MAAA,GACJ,KAAA,CAAM,SAAA,KAAc,MAAA,GAAYA,aAAAA,CAAa,MAAM,SAAS,CAAA,GAAIA,aAAAA,CAAa,KAAA,CAAM,GAAG,CAAA;AACxF,MAAA,OAAO;AAAA,QACL,OAAA,EAAS,KAAA,CAAM,MAAA,GAAS,aAAA,GAAgB,MAAA;AAAA,QACxC,mBAAA,EAAqB,WAAA;AAAA,QACrB,MAAA;AAAA,QACA,SAAA,EAAW;AAAA,OACb;AAAA,IACF,CAAC,CAAA;AAED,IAAA,OAAO,MACLD,KAAAA;AAAA,MACE,KAAA;AAAA,MACA;AAAA,QACE,GAAG,KAAA;AAAA,QACH,gBAAA,EAAkB,EAAA;AAAA,QAClB,wBAAA,EAA0B,MAAA,CAAO,KAAA,CAAM,OAAO,CAAA;AAAA,QAC9C,KAAA,EAAO,EAAE,GAAG,KAAA,CAAM,OAAO,GAAK,KAAA,CAAM,KAAA,IAAgD,EAAC;AAAG,OAC1F;AAAA,MACA,MAAM,OAAA;AAAU,KAClB;AAAA,EACJ;AACF,CAAC","file":"layouts.cjs","sourcesContent":["import { computed, defineComponent, h, ref, watch } from 'vue'\n\n/**\n * Two-column layout with a collapsible sidebar.\n *\n * Slots:\n * - `sidebar` — content rendered in the sidebar (kept mounted across collapses).\n * - `default` — the main content area.\n *\n * Use `:collapsed` for controlled mode or `:default-collapsed` for the\n * uncontrolled initial state. When collapsed, the sidebar shrinks to\n * `:collapsed-width` so icon-only navigation still fits.\n */\nexport const IrisSidebarLayout = defineComponent({\n name: 'IrisSidebarLayout',\n inheritAttrs: false,\n props: {\n collapsed: { type: Boolean, default: undefined },\n defaultCollapsed: { type: Boolean, default: false },\n /** Sidebar width when expanded (px or CSS length). */\n width: { type: [Number, String], default: 240 },\n /** Sidebar width when collapsed. */\n collapsedWidth: { type: [Number, String], default: 60 },\n /** Sidebar position. */\n side: { type: String as () => 'left' | 'right', default: 'left' },\n },\n emits: {\n 'update:collapsed': (_value: boolean) => true,\n },\n setup(props, { slots, attrs, emit }) {\n const isControlled = computed(() => props.collapsed !== undefined)\n const internalCollapsed = ref(props.defaultCollapsed)\n const collapsed = computed(() =>\n isControlled.value ? Boolean(props.collapsed) : internalCollapsed.value,\n )\n\n // Sync controlled prop changes into internal state on first run so a later\n // detach to uncontrolled mode preserves the last-known value. `immediate`\n // fires the watcher on mount; the `value !== undefined` guard keeps the\n // first run a no-op for pure-uncontrolled mounts so `defaultCollapsed`\n // stays untouched.\n watch(\n () => props.collapsed,\n (value) => {\n if (value !== undefined) internalCollapsed.value = value\n },\n { immediate: true },\n )\n\n const setCollapsed = (value: boolean) => {\n if (!isControlled.value) internalCollapsed.value = value\n emit('update:collapsed', value)\n }\n\n const asLen = (v: number | string) => (typeof v === 'number' ? `${v}px` : v)\n\n return () => {\n const sidebarStyle: Record<string, string> = {\n width: collapsed.value ? asLen(props.collapsedWidth) : asLen(props.width),\n flexShrink: '0',\n background: 'var(--iris-surface)',\n borderRight: props.side === 'left' ? '1px solid var(--iris-border)' : 'none',\n borderLeft: props.side === 'right' ? '1px solid var(--iris-border)' : 'none',\n transition: 'width 180ms ease',\n overflow: 'hidden',\n display: 'flex',\n flexDirection: 'column',\n }\n const mainStyle: Record<string, string> = {\n flex: '1',\n minWidth: '0',\n overflow: 'auto',\n background: 'var(--iris-background)',\n }\n const direction = props.side === 'right' ? 'row-reverse' : 'row'\n\n return h(\n 'div',\n {\n ...attrs,\n 'data-iris-sidebar-layout': '',\n 'data-collapsed': collapsed.value ? '' : undefined,\n 'data-side': props.side,\n style: {\n display: 'flex',\n flexDirection: direction,\n width: '100%',\n height: '100%',\n minHeight: '0',\n color: 'var(--iris-foreground)',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n [\n h(\n 'aside',\n {\n role: 'complementary',\n 'data-iris-sidebar': '',\n 'data-collapsed': collapsed.value ? '' : undefined,\n style: sidebarStyle,\n },\n slots.sidebar?.({ collapsed: collapsed.value, setCollapsed }),\n ),\n h('div', { 'data-iris-sidebar-main': '', style: mainStyle }, slots.default?.()),\n ],\n )\n }\n },\n})\n","import { defineComponent, h, type PropType } from 'vue'\n\n/**\n * Two-region vertical layout: a sticky header on top, scrollable main below.\n *\n * Slots:\n * - `header` — fixed at top.\n * - `footer` — optional fixed at bottom.\n * - `default` — scrollable main region.\n */\nexport const IrisHeaderLayout = defineComponent({\n name: 'IrisHeaderLayout',\n inheritAttrs: false,\n props: {\n /** Header height (px or CSS length). Default `'auto'`. */\n headerHeight: { type: [Number, String] as PropType<number | string>, default: 'auto' },\n /** Footer height (px or CSS length). Default `'auto'`. */\n footerHeight: { type: [Number, String] as PropType<number | string>, default: 'auto' },\n /** When true, header sticks via `position: sticky` instead of static. */\n sticky: { type: Boolean, default: true },\n },\n setup(props, { slots, attrs }) {\n const asLen = (v: number | string) => (typeof v === 'number' ? `${v}px` : v)\n return () =>\n h(\n 'div',\n {\n ...attrs,\n 'data-iris-header-layout': '',\n style: {\n display: 'flex',\n flexDirection: 'column',\n width: '100%',\n height: '100%',\n minHeight: '0',\n background: 'var(--iris-background)',\n color: 'var(--iris-foreground)',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n [\n slots.header\n ? h(\n 'header',\n {\n role: 'banner',\n 'data-iris-header': '',\n style: {\n flexShrink: '0',\n height: asLen(props.headerHeight),\n borderBottom: '1px solid var(--iris-border)',\n background: 'var(--iris-surface)',\n position: props.sticky ? 'sticky' : 'static',\n top: '0',\n zIndex: '50',\n },\n },\n slots.header(),\n )\n : null,\n h(\n 'main',\n {\n role: 'main',\n 'data-iris-header-main': '',\n style: { flex: '1', minHeight: '0', overflow: 'auto' },\n },\n slots.default?.(),\n ),\n slots.footer\n ? h(\n 'footer',\n {\n role: 'contentinfo',\n 'data-iris-footer': '',\n style: {\n flexShrink: '0',\n height: asLen(props.footerHeight),\n borderTop: '1px solid var(--iris-border)',\n background: 'var(--iris-surface)',\n },\n },\n slots.footer(),\n )\n : null,\n ],\n )\n },\n})\n","import { defineComponent, h } from 'vue'\n\n/**\n * 12-column responsive grid for dashboard composition. Each child should be\n * an `IrisDashboardCard` (or any element with `grid-column: span N`).\n *\n * Children control their span via inline `style=\"grid-column: span N\"` or\n * by wrapping with `IrisDashboardCard` whose `col-span` / `row-span` props\n * compile to the same CSS.\n */\nexport const IrisDashboardGrid = defineComponent({\n name: 'IrisDashboardGrid',\n inheritAttrs: false,\n props: {\n columns: { type: Number, default: 12 },\n gap: { type: [Number, String], default: 16 },\n /** Minimum column width via `grid-template-columns: repeat(auto-fill, minmax(...))`. */\n minColWidth: { type: [Number, String], default: undefined },\n },\n setup(props, { slots, attrs }) {\n const gap = typeof props.gap === 'number' ? `${props.gap}px` : props.gap\n return () => {\n const gridTemplateColumns = props.minColWidth\n ? `repeat(auto-fill, minmax(${typeof props.minColWidth === 'number' ? `${props.minColWidth}px` : props.minColWidth}, 1fr))`\n : `repeat(${props.columns}, 1fr)`\n return h(\n 'div',\n {\n ...attrs,\n 'data-iris-dashboard-grid': '',\n style: {\n display: 'grid',\n gap,\n gridTemplateColumns,\n width: '100%',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n slots.default?.(),\n )\n }\n },\n})\n\n/**\n * A single grid cell — wraps content in a styled card with optional span\n * controls. `col-span` accepts a number (column count) or `'full'` to fill\n * the entire row.\n */\nexport const IrisDashboardCard = defineComponent({\n name: 'IrisDashboardCard',\n inheritAttrs: false,\n props: {\n colSpan: { type: [Number, String], default: 1 },\n rowSpan: { type: Number, default: 1 },\n /** Show a styled card surface (background + border). Default `true`. */\n surface: { type: Boolean, default: true },\n },\n setup(props, { slots, attrs }) {\n return () => {\n const colSpan = props.colSpan === 'full' ? '1 / -1' : `span ${props.colSpan}`\n const rowSpan = props.rowSpan > 1 ? `span ${props.rowSpan}` : undefined\n return h(\n 'div',\n {\n ...attrs,\n 'data-iris-dashboard-card': '',\n style: {\n gridColumn: colSpan,\n gridRow: rowSpan,\n background: props.surface ? 'var(--iris-surface)' : 'transparent',\n border: props.surface ? '1px solid var(--iris-border)' : 'none',\n borderRadius: 'var(--iris-radius-md)',\n padding: props.surface ? 'var(--iris-padding-lg)' : '0',\n minWidth: '0',\n ...((attrs.style as Record<string, string> | undefined) ?? {}),\n },\n },\n slots.default?.(),\n )\n }\n },\n})\n","import { computed, defineComponent, h, type PropType } from 'vue'\n\nexport type IrisStackDirection = 'row' | 'column'\nexport type IrisStackAlign = 'start' | 'center' | 'end' | 'stretch'\nexport type IrisStackJustify = 'start' | 'center' | 'end' | 'between' | 'around'\n\nconst ALIGN_MAP: Record<IrisStackAlign, string> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n stretch: 'stretch',\n}\n\nconst JUSTIFY_MAP: Record<IrisStackJustify, string> = {\n start: 'flex-start',\n center: 'center',\n end: 'flex-end',\n between: 'space-between',\n around: 'space-around',\n}\n\nfunction toCssSpacing(spacing: string | number): string {\n if (typeof spacing === 'number') return `${spacing}px`\n // Token shorthand: \"sm\" / \"md\" / \"lg\" → var(--iris-gap-X)\n if (spacing === 'sm' || spacing === 'md' || spacing === 'lg') {\n return `var(--iris-gap-${spacing})`\n }\n return spacing\n}\n\n/**\n * Flex container with token-driven spacing. The lightest possible layout\n * primitive — most pages need a horizontal or vertical stack and this saves\n * hand-writing `display: flex` everywhere.\n *\n * Use `direction`/`spacing`/`align`/`justify`/`wrap` to configure; children\n * are arranged in document order with `gap: <spacing>`.\n */\nexport const IrisStack = defineComponent({\n name: 'IrisStack',\n inheritAttrs: false,\n props: {\n direction: { type: String as PropType<IrisStackDirection>, default: 'column' },\n spacing: { type: [String, Number], default: 'md' },\n align: { type: String as PropType<IrisStackAlign>, default: 'stretch' },\n justify: { type: String as PropType<IrisStackJustify>, default: 'start' },\n wrap: { type: Boolean, default: false },\n /** When true, renders as an inline-flex container. */\n inline: { type: Boolean, default: false },\n },\n setup(props, { slots, attrs }) {\n const style = computed<Record<string, string>>(() => ({\n display: props.inline ? 'inline-flex' : 'flex',\n flexDirection: props.direction,\n gap: toCssSpacing(props.spacing),\n alignItems: ALIGN_MAP[props.align],\n justifyContent: JUSTIFY_MAP[props.justify],\n flexWrap: props.wrap ? 'wrap' : 'nowrap',\n }))\n\n return () =>\n h(\n 'div',\n {\n ...attrs,\n 'data-iris-stack': '',\n 'data-iris-stack-direction': props.direction,\n style: { ...style.value, ...((attrs.style as Record<string, string> | undefined) ?? {}) },\n },\n slots.default?.(),\n )\n },\n})\n","import { computed, defineComponent, h, type PropType } from 'vue'\n\nexport type IrisContainerMaxWidth = 'sm' | 'md' | 'lg' | 'xl' | 'full' | string\n\nconst WIDTH_MAP: Record<'sm' | 'md' | 'lg' | 'xl' | 'full', string> = {\n sm: '640px',\n md: '768px',\n lg: '1024px',\n xl: '1280px',\n full: '100%',\n}\n\nfunction resolveMaxWidth(input: IrisContainerMaxWidth): string {\n if (input === 'sm' || input === 'md' || input === 'lg' || input === 'xl' || input === 'full') {\n return WIDTH_MAP[input]\n }\n return input // arbitrary CSS length\n}\n\nfunction resolvePadding(input: string | number): string {\n if (typeof input === 'number') return `${input}px`\n if (input === 'sm' || input === 'md' || input === 'lg') {\n return `var(--iris-padding-${input})`\n }\n return input\n}\n\n/**\n * Centered max-width wrapper. Use to bound content width on large screens\n * without rewriting flex/grid plumbing.\n *\n * `maxWidth='lg'` (≈1024px) is the most common default for marketing /\n * docs / app pages.\n */\nexport const IrisContainer = defineComponent({\n name: 'IrisContainer',\n inheritAttrs: false,\n props: {\n maxWidth: { type: String as PropType<IrisContainerMaxWidth>, default: 'lg' },\n padding: { type: [String, Number], default: 'md' },\n center: { type: Boolean, default: true },\n },\n setup(props, { slots, attrs }) {\n const style = computed<Record<string, string>>(() => ({\n width: '100%',\n maxWidth: resolveMaxWidth(props.maxWidth),\n padding: `0 ${resolvePadding(props.padding)}`,\n ...(props.center ? { marginInlineStart: 'auto', marginInlineEnd: 'auto' } : {}),\n }))\n\n return () =>\n h(\n 'div',\n {\n ...attrs,\n 'data-iris-container': '',\n 'data-iris-container-max-width': props.maxWidth,\n style: { ...style.value, ...((attrs.style as Record<string, string> | undefined) ?? {}) },\n },\n slots.default?.(),\n )\n },\n})\n","import { computed, defineComponent, h, type PropType } from 'vue'\n\nexport type IrisGridColumns =\n | number\n | 'auto-fit'\n | 'auto-fill'\n | string /* raw grid-template-columns value */\n\nfunction resolveColumns(columns: IrisGridColumns, minColWidth: string): string {\n if (typeof columns === 'number') return `repeat(${columns}, minmax(0, 1fr))`\n if (columns === 'auto-fit') return `repeat(auto-fit, minmax(${minColWidth}, 1fr))`\n if (columns === 'auto-fill') return `repeat(auto-fill, minmax(${minColWidth}, 1fr))`\n return columns\n}\n\nfunction toCssSpacing(spacing: string | number): string {\n if (typeof spacing === 'number') return `${spacing}px`\n if (spacing === 'sm' || spacing === 'md' || spacing === 'lg') {\n return `var(--iris-gap-${spacing})`\n }\n return spacing\n}\n\n/**\n * Two-dimensional grid layout primitive. Three column modes:\n *\n * - **Fixed integer** — `columns={3}` → three equal-width columns.\n * - **Responsive auto-fit** — `columns=\"auto-fit\"` + `minColWidth` → fluid\n * grid where columns add/remove with container width. Most common.\n * - **Raw CSS** — pass any `grid-template-columns` string.\n *\n * Spacing accepts token shorthand (`sm` / `md` / `lg`), numeric px, or any\n * CSS length string. `gap` is a shortcut for both row + column gap.\n */\nexport const IrisGrid = defineComponent({\n name: 'IrisGrid',\n inheritAttrs: false,\n props: {\n columns: { type: [Number, String] as PropType<IrisGridColumns>, default: 'auto-fit' },\n /** Min width per column for `auto-fit` / `auto-fill`. */\n minColWidth: { type: String, default: '200px' },\n /** Row gap (token / px / CSS). */\n rowGap: { type: [String, Number], default: undefined },\n /** Column gap (token / px / CSS). */\n columnGap: { type: [String, Number], default: undefined },\n /** Shorthand for both row + column gap. Overridden if rowGap/columnGap given. */\n gap: { type: [String, Number], default: 'md' },\n inline: { type: Boolean, default: false },\n },\n setup(props, { slots, attrs }) {\n const style = computed<Record<string, string>>(() => {\n const colTemplate = resolveColumns(props.columns, props.minColWidth)\n const rowGap =\n props.rowGap !== undefined ? toCssSpacing(props.rowGap) : toCssSpacing(props.gap)\n const colGap =\n props.columnGap !== undefined ? toCssSpacing(props.columnGap) : toCssSpacing(props.gap)\n return {\n display: props.inline ? 'inline-grid' : 'grid',\n gridTemplateColumns: colTemplate,\n rowGap,\n columnGap: colGap,\n }\n })\n\n return () =>\n h(\n 'div',\n {\n ...attrs,\n 'data-iris-grid': '',\n 'data-iris-grid-columns': String(props.columns),\n style: { ...style.value, ...((attrs.style as Record<string, string> | undefined) ?? {}) },\n },\n slots.default?.(),\n )\n },\n})\n"]}
|
package/dist/layouts.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { IrisGrid } from './chunk-WL67XCH5.js';
|
|
2
2
|
export { IrisContainer, IrisDashboardCard, IrisDashboardGrid, IrisStack } from './chunk-3R3QDLJC.js';
|
|
3
|
-
export { IrisHeaderLayout, IrisSidebarLayout } from './chunk-
|
|
3
|
+
export { IrisHeaderLayout, IrisSidebarLayout } from './chunk-3V46HGRC.js';
|
|
4
4
|
//# sourceMappingURL=layouts.js.map
|
|
5
5
|
//# sourceMappingURL=layouts.js.map
|
package/dist/machine.cjs
CHANGED
|
@@ -3,14 +3,21 @@
|
|
|
3
3
|
var vue = require('vue');
|
|
4
4
|
|
|
5
5
|
// src/machine/useMachine.ts
|
|
6
|
-
function useMachine(machine) {
|
|
6
|
+
function useMachine(machine, options = {}) {
|
|
7
7
|
const state = vue.ref(machine.store.getState());
|
|
8
8
|
const unsubscribe = machine.store.subscribe((next) => {
|
|
9
9
|
state.value = next;
|
|
10
10
|
});
|
|
11
|
-
vue.
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
vue.onScopeDispose(
|
|
12
|
+
() => {
|
|
13
|
+
unsubscribe();
|
|
14
|
+
if (options.stopOnUnmount !== false) machine.stop();
|
|
15
|
+
},
|
|
16
|
+
// failSilently: outside any effect scope there is nothing to dispose —
|
|
17
|
+
// registering is a no-op and must not emit the "no active effect scope"
|
|
18
|
+
// dev warning. Within a component/effectScope this arg changes nothing.
|
|
19
|
+
true
|
|
20
|
+
);
|
|
14
21
|
return { state, send: machine.send };
|
|
15
22
|
}
|
|
16
23
|
|
package/dist/machine.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/machine/useMachine.ts"],"names":["ref","
|
|
1
|
+
{"version":3,"sources":["../src/machine/useMachine.ts"],"names":["ref","onScopeDispose"],"mappings":";;;;;AAmBO,SAAS,UAAA,CACd,OAAA,EACA,OAAA,GAAuC,EAAC,EAIxC;AACA,EAAA,MAAM,KAAA,GAAQA,OAAA,CAAI,OAAA,CAAQ,KAAA,CAAM,UAAU,CAAA;AAC1C,EAAA,MAAM,WAAA,GAAc,OAAA,CAAQ,KAAA,CAAM,SAAA,CAAU,CAAC,IAAA,KAAS;AACpD,IAAA,KAAA,CAAM,KAAA,GAAQ,IAAA;AAAA,EAChB,CAAC,CAAA;AACD,EAAAC,kBAAA;AAAA,IACE,MAAM;AAEJ,MAAA,WAAA,EAAY;AACZ,MAAA,IAAI,OAAA,CAAQ,aAAA,KAAkB,KAAA,EAAO,OAAA,CAAQ,IAAA,EAAK;AAAA,IACpD,CAAA;AAAA;AAAA;AAAA;AAAA,IAIA;AAAA,GACF;AACA,EAAA,OAAO,EAAE,KAAA,EAAO,IAAA,EAAM,OAAA,CAAQ,IAAA,EAAK;AACrC","file":"machine.cjs","sourcesContent":["import { onScopeDispose, ref, type Ref } from 'vue'\nimport type { Machine, MachineEvent, MachineState } from '@iris-ui-kit/core'\n\n/**\n * Bridge a framework-agnostic `Machine` into Vue reactivity.\n *\n * Returns a reactive ref of the current `{ value, context }` state and a\n * stable `send` function. Subscription is created eagerly and cleaned up on\n * scope dispose, so this hook is safe to call from any component's `setup()`.\n *\n * Teardown semantics: when the owning scope is disposed (component unmount,\n * `effectScope().stop()`, end of SSR render), the store subscription is\n * detached AND — by default — `machine.stop()` is called: pending `after`\n * timers are cancelled and further `send` calls become no-ops, so a delayed\n * transition can never fire into a disposed consumer (see the core `Machine`\n * contract). Pass `{ stopOnUnmount: false }` only when the machine is shared\n * with other consumers that outlive this scope — the subscription is still\n * detached, the machine keeps running.\n */\nexport function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(\n machine: Machine<TState, TContext, TEvent>,\n options: { stopOnUnmount?: boolean } = {},\n): {\n state: Ref<MachineState<TState, TContext>>\n send: (event: TEvent) => void\n} {\n const state = ref(machine.store.getState()) as Ref<MachineState<TState, TContext>>\n const unsubscribe = machine.store.subscribe((next) => {\n state.value = next\n })\n onScopeDispose(\n () => {\n // Detach the bridge first (conservative order), then stop the machine.\n unsubscribe()\n if (options.stopOnUnmount !== false) machine.stop()\n },\n // failSilently: outside any effect scope there is nothing to dispose —\n // registering is a no-op and must not emit the \"no active effect scope\"\n // dev warning. Within a component/effectScope this arg changes nothing.\n true,\n )\n return { state, send: machine.send }\n}\n"]}
|
package/dist/machine.d.cts
CHANGED
|
@@ -6,11 +6,20 @@ import { MachineEvent, Machine, MachineState } from '@iris-ui-kit/core';
|
|
|
6
6
|
*
|
|
7
7
|
* Returns a reactive ref of the current `{ value, context }` state and a
|
|
8
8
|
* stable `send` function. Subscription is created eagerly and cleaned up on
|
|
9
|
-
*
|
|
9
|
+
* scope dispose, so this hook is safe to call from any component's `setup()`.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* Teardown semantics: when the owning scope is disposed (component unmount,
|
|
12
|
+
* `effectScope().stop()`, end of SSR render), the store subscription is
|
|
13
|
+
* detached AND — by default — `machine.stop()` is called: pending `after`
|
|
14
|
+
* timers are cancelled and further `send` calls become no-ops, so a delayed
|
|
15
|
+
* transition can never fire into a disposed consumer (see the core `Machine`
|
|
16
|
+
* contract). Pass `{ stopOnUnmount: false }` only when the machine is shared
|
|
17
|
+
* with other consumers that outlive this scope — the subscription is still
|
|
18
|
+
* detached, the machine keeps running.
|
|
12
19
|
*/
|
|
13
|
-
declare function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(machine: Machine<TState, TContext, TEvent
|
|
20
|
+
declare function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(machine: Machine<TState, TContext, TEvent>, options?: {
|
|
21
|
+
stopOnUnmount?: boolean;
|
|
22
|
+
}): {
|
|
14
23
|
state: Ref<MachineState<TState, TContext>>;
|
|
15
24
|
send: (event: TEvent) => void;
|
|
16
25
|
};
|
package/dist/machine.d.ts
CHANGED
|
@@ -6,11 +6,20 @@ import { MachineEvent, Machine, MachineState } from '@iris-ui-kit/core';
|
|
|
6
6
|
*
|
|
7
7
|
* Returns a reactive ref of the current `{ value, context }` state and a
|
|
8
8
|
* stable `send` function. Subscription is created eagerly and cleaned up on
|
|
9
|
-
*
|
|
9
|
+
* scope dispose, so this hook is safe to call from any component's `setup()`.
|
|
10
10
|
*
|
|
11
|
-
*
|
|
11
|
+
* Teardown semantics: when the owning scope is disposed (component unmount,
|
|
12
|
+
* `effectScope().stop()`, end of SSR render), the store subscription is
|
|
13
|
+
* detached AND — by default — `machine.stop()` is called: pending `after`
|
|
14
|
+
* timers are cancelled and further `send` calls become no-ops, so a delayed
|
|
15
|
+
* transition can never fire into a disposed consumer (see the core `Machine`
|
|
16
|
+
* contract). Pass `{ stopOnUnmount: false }` only when the machine is shared
|
|
17
|
+
* with other consumers that outlive this scope — the subscription is still
|
|
18
|
+
* detached, the machine keeps running.
|
|
12
19
|
*/
|
|
13
|
-
declare function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(machine: Machine<TState, TContext, TEvent
|
|
20
|
+
declare function useMachine<TState extends string, TContext, TEvent extends MachineEvent>(machine: Machine<TState, TContext, TEvent>, options?: {
|
|
21
|
+
stopOnUnmount?: boolean;
|
|
22
|
+
}): {
|
|
14
23
|
state: Ref<MachineState<TState, TContext>>;
|
|
15
24
|
send: (event: TEvent) => void;
|
|
16
25
|
};
|
package/dist/machine.js
CHANGED
package/dist/provider.cjs
CHANGED
|
@@ -31,7 +31,7 @@ var ThemeProvider = vue.defineComponent({
|
|
|
31
31
|
},
|
|
32
32
|
setup(props, { slots }) {
|
|
33
33
|
const current = vue.ref(props.store.store.getState());
|
|
34
|
-
|
|
34
|
+
let unsubscribe = props.store.store.subscribe((next) => {
|
|
35
35
|
current.value = next;
|
|
36
36
|
});
|
|
37
37
|
let applied = null;
|
|
@@ -53,6 +53,24 @@ var ThemeProvider = vue.defineComponent({
|
|
|
53
53
|
vue.watch(current, () => {
|
|
54
54
|
if (applied) applyCurrent();
|
|
55
55
|
});
|
|
56
|
+
vue.watch(
|
|
57
|
+
() => props.store,
|
|
58
|
+
(nextStore) => {
|
|
59
|
+
unsubscribe();
|
|
60
|
+
unsubscribe = nextStore.store.subscribe((next) => {
|
|
61
|
+
current.value = next;
|
|
62
|
+
});
|
|
63
|
+
current.value = nextStore.store.getState();
|
|
64
|
+
if (applied) applyCurrent();
|
|
65
|
+
}
|
|
66
|
+
);
|
|
67
|
+
vue.watch(
|
|
68
|
+
() => props.target,
|
|
69
|
+
() => {
|
|
70
|
+
if (applied) applyCurrent();
|
|
71
|
+
if (dirApplied) applyDir();
|
|
72
|
+
}
|
|
73
|
+
);
|
|
56
74
|
vue.watch(
|
|
57
75
|
() => props.dir,
|
|
58
76
|
() => {
|
|
@@ -96,6 +114,12 @@ var SkinProvider = vue.defineComponent({
|
|
|
96
114
|
vue.watch(current, () => {
|
|
97
115
|
if (applied) apply();
|
|
98
116
|
});
|
|
117
|
+
vue.watch(
|
|
118
|
+
() => props.target,
|
|
119
|
+
() => {
|
|
120
|
+
if (applied) apply();
|
|
121
|
+
}
|
|
122
|
+
);
|
|
99
123
|
vue.onBeforeUnmount(() => {
|
|
100
124
|
unsubscribe();
|
|
101
125
|
applied?.revert();
|
|
@@ -188,25 +212,45 @@ var IrisProvider = vue.defineComponent({
|
|
|
188
212
|
target: { type: Object, default: null }
|
|
189
213
|
},
|
|
190
214
|
setup(props, { slots }) {
|
|
191
|
-
const collected = core.runPlugins(props.plugins ?? []);
|
|
215
|
+
const collected = vue.shallowRef(core.runPlugins(props.plugins ?? []));
|
|
216
|
+
const ctx = vue.shallowReactive({
|
|
217
|
+
stores: collected.value.stores,
|
|
218
|
+
installed: new Set((props.plugins ?? []).map((p) => p.name))
|
|
219
|
+
});
|
|
220
|
+
vue.provide(PluginStoreContextKey, ctx);
|
|
192
221
|
let applied = null;
|
|
222
|
+
let mounted = false;
|
|
193
223
|
vue.onMounted(() => {
|
|
224
|
+
mounted = true;
|
|
194
225
|
if (typeof document === "undefined") return;
|
|
195
226
|
const el = props.target ?? document.documentElement;
|
|
196
|
-
applied = theme.applyCssVars(Object.entries(collected.tokens), el);
|
|
227
|
+
applied = theme.applyCssVars(Object.entries(collected.value.tokens), el);
|
|
197
228
|
});
|
|
229
|
+
vue.watch(
|
|
230
|
+
() => props.plugins,
|
|
231
|
+
(next) => {
|
|
232
|
+
const prev = collected.value;
|
|
233
|
+
const nextCollected = core.runPlugins(next ?? []);
|
|
234
|
+
applied?.revert();
|
|
235
|
+
applied = null;
|
|
236
|
+
prev.teardown();
|
|
237
|
+
collected.value = nextCollected;
|
|
238
|
+
ctx.stores = nextCollected.stores;
|
|
239
|
+
ctx.installed = new Set((next ?? []).map((p) => p.name));
|
|
240
|
+
if (mounted && typeof document !== "undefined") {
|
|
241
|
+
const el = props.target ?? document.documentElement;
|
|
242
|
+
applied = theme.applyCssVars(Object.entries(nextCollected.tokens), el);
|
|
243
|
+
}
|
|
244
|
+
}
|
|
245
|
+
);
|
|
198
246
|
vue.onBeforeUnmount(() => {
|
|
199
247
|
applied?.revert();
|
|
200
248
|
applied = null;
|
|
201
|
-
collected.teardown();
|
|
202
|
-
});
|
|
203
|
-
vue.provide(PluginStoreContextKey, {
|
|
204
|
-
stores: collected.stores,
|
|
205
|
-
installed: new Set((props.plugins ?? []).map((p) => p.name))
|
|
249
|
+
collected.value.teardown();
|
|
206
250
|
});
|
|
207
251
|
return () => {
|
|
208
252
|
const locale = props.locale ?? DEFAULT_LOCALE;
|
|
209
|
-
const messages = { ...collected.messages[locale], ...props.messages ?? {} };
|
|
253
|
+
const messages = { ...collected.value.messages[locale], ...props.messages ?? {} };
|
|
210
254
|
let tree = vue.h(
|
|
211
255
|
IrisI18nProvider,
|
|
212
256
|
{ locale: props.locale, messages },
|
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","runPlugins","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;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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GAAQ,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA;AAClC,EAAA,IAAI,KAAA,KAAU,QAAW,OAAO,KAAA;AAGhC,EAAA,IAAI,QAAQ,MAAA,EAAW;AACrB,IAAA,KAAA,GAAQ,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA;AAC9B,IAAA,IAAI,KAAA,KAAU,QAAW,OAAO,KAAA;AAEhC,IAAA,KAAA,MAAW,CAAA,IAAK,GAAA,CAAI,MAAA,CAAO,IAAA,EAAK,EAAG;AACjC,MAAA,IAAI,OAAO,MAAM,QAAA,IAAY,CAAA,CAAE,SAAS,CAAA,EAAA,EAAK,OAAO,EAAE,CAAA,EAAG;AAEvD,QAAA,IAAI,CAAC,UAAA,CAAW,GAAA,CAAI,OAAO,CAAA,EAAG;AAC5B,UAAA,UAAA,CAAW,GAAA,CAAI,SAAS,IAAI,CAAA;AAC5B,UAAA,OAAA,CAAQ,IAAA;AAAA,YACN,CAAA,sCAAA,EAAyC,OAAO,CAAA,UAAA,EACpC,CAAC,+CAA+C,CAAC,CAAA,GAAA;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 const 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.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 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 type PropType,\n type VNode,\n} from 'vue'\nimport { runPlugins, 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 } 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 // Sync, pure, deterministic — computed once per setup over `plugins`.\n const collected = runPlugins(props.plugins ?? [])\n\n // tokens → additive CSS-var layer over the active theme; reverted on unmount.\n let applied: ApplyCssVarsResult | null = null\n onMounted(() => {\n if (typeof document === 'undefined') return\n const el = props.target ?? document.documentElement\n applied = applyCssVars(Object.entries(collected.tokens), el)\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.teardown()\n })\n\n // stores + installed names → PluginStoreContext.\n provide(PluginStoreContextKey, {\n stores: collected.stores,\n installed: new Set((props.plugins ?? []).map((p) => p.name)),\n })\n\n return () => {\n const locale = props.locale ?? DEFAULT_LOCALE\n // Plugin messages as BASE, user messages WIN.\n const messages = { ...collected.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;AAAA,MACH,IAAA,EAAM,MAAA;AAAA,MACN,OAAA,EAAS;AAAA,KACX;AAAA;AAAA,IAEA,QAAA,EAAU;AAAA,MACR,IAAA,EAAM,MAAA;AAAA,MACN,OAAA,EAAS;AAAA;AACX,GACF;AAAA,EACA,KAAA,CAAM,KAAA,EAAO,EAAE,KAAA,EAAM,EAAG;AACtB,IAAA,MAAM,UAAUC,OAAA,CAAI,KAAA,CAAM,KAAA,CAAM,KAAA,CAAM,UAAU,CAAA;AAChD,IAAA,IAAI,cAAc,KAAA,CAAM,KAAA,CAAM,KAAA,CAAM,SAAA,CAAU,CAAC,IAAA,KAAS;AACtD,MAAA,OAAA,CAAQ,KAAA,GAAQ,IAAA;AAAA,IAClB,CAAC,CAAA;AAED,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G,OAAO,CAAA,EAAA,EAAK,GAAG,CAAA,CAAA,GAAK,OAAA;AAG3D,EAAA,IAAI,KAAA,GAAQ,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA;AAClC,EAAA,IAAI,KAAA,KAAU,QAAW,OAAO,KAAA;AAGhC,EAAA,IAAI,QAAQ,MAAA,EAAW;AACrB,IAAA,KAAA,GAAQ,GAAA,CAAI,MAAA,CAAO,GAAA,CAAI,OAAO,CAAA;AAC9B,IAAA,IAAI,KAAA,KAAU,QAAW,OAAO,KAAA;AAEhC,IAAA,KAAA,MAAW,CAAA,IAAK,GAAA,CAAI,MAAA,CAAO,IAAA,EAAK,EAAG;AACjC,MAAA,IAAI,OAAO,MAAM,QAAA,IAAY,CAAA,CAAE,SAAS,CAAA,EAAA,EAAK,OAAO,EAAE,CAAA,EAAG;AAEvD,QAAA,IAAI,CAAC,UAAA,CAAW,GAAA,CAAI,OAAO,CAAA,EAAG;AAC5B,UAAA,UAAA,CAAW,GAAA,CAAI,SAAS,IAAI,CAAA;AAC5B,UAAA,OAAA,CAAQ,IAAA;AAAA,YACN,CAAA,sCAAA,EAAyC,OAAO,CAAA,UAAA,EACpC,CAAC,+CAA+C,CAAC,CAAA,GAAA;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-
|
|
1
|
+
export { IrisProvider, PluginStoreContextKey, usePlugin, usePluginStore } from './chunk-MO7AAXA6.js';
|
|
2
|
+
import './chunk-UPC4GN3F.js';
|
|
3
|
+
import './chunk-ZTPIXL7Q.js';
|
|
4
4
|
import './chunk-TCAXRWT6.js';
|
|
5
5
|
//# sourceMappingURL=provider.js.map
|
|
6
6
|
//# sourceMappingURL=provider.js.map
|
package/dist/resource.cjs
CHANGED
|
@@ -5,10 +5,14 @@ var core = require('@iris-ui-kit/core');
|
|
|
5
5
|
|
|
6
6
|
// src/resource/useResourceController.ts
|
|
7
7
|
function useResourceController(config) {
|
|
8
|
-
const controller = core.createResourceController(config);
|
|
8
|
+
const controller = core.createResourceController({ ...config, immediate: false });
|
|
9
|
+
const immediate = config.immediate !== false;
|
|
10
|
+
if (immediate) {
|
|
11
|
+
vue.onMounted(() => void controller.load());
|
|
12
|
+
}
|
|
13
|
+
vue.onScopeDispose(() => controller.destroy());
|
|
9
14
|
const state = vue.shallowRef(controller.getState());
|
|
10
|
-
vue.
|
|
11
|
-
vue.onBeforeUnmount(() => controller.destroy());
|
|
15
|
+
vue.onScopeDispose(controller.subscribe((next) => state.value = next));
|
|
12
16
|
return { ...controller, state };
|
|
13
17
|
}
|
|
14
18
|
|
package/dist/resource.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/resource/useResourceController.ts"],"names":["createResourceController","
|
|
1
|
+
{"version":3,"sources":["../src/resource/useResourceController.ts"],"names":["createResourceController","onMounted","onScopeDispose","shallowRef"],"mappings":";;;;;;AA4BO,SAAS,sBACd,MAAA,EAC0B;AAC1B,EAAA,MAAM,aAAaA,6BAAA,CAAyB,EAAE,GAAG,MAAA,EAAQ,SAAA,EAAW,OAAO,CAAA;AAC3E,EAAA,MAAM,SAAA,GAAY,OAAO,SAAA,KAAc,KAAA;AAEvC,EAAA,IAAI,SAAA,EAAW;AACb,IAAAC,aAAA,CAAU,MAAM,KAAK,UAAA,CAAW,IAAA,EAAM,CAAA;AAAA,EACxC;AAKA,EAAAC,kBAAA,CAAe,MAAM,UAAA,CAAW,OAAA,EAAS,CAAA;AAEzC,EAAA,MAAM,KAAA,GAAQC,cAAA,CAAW,UAAA,CAAW,QAAA,EAAU,CAAA;AAC9C,EAAAD,kBAAA,CAAe,WAAW,SAAA,CAAU,CAAC,SAAU,KAAA,CAAM,KAAA,GAAQ,IAAK,CAAC,CAAA;AACnE,EAAA,OAAO,EAAE,GAAG,UAAA,EAAY,KAAA,EAAM;AAChC","file":"resource.cjs","sourcesContent":["import { onMounted, onScopeDispose, shallowRef, type ShallowRef } from 'vue'\nimport {\n createResourceController,\n type ResourceController,\n type ResourceControllerConfig,\n type ResourceState,\n} from '@iris-ui-kit/core'\n\nexport interface UseResourceController<T> extends ResourceController<T> {\n /** The live resource state as a reactive ref (rows, total, page, loading, selectedKeys). */\n state: ShallowRef<ResourceState<T>>\n}\n\n/**\n * Vue bridge over the framework-agnostic {@link createResourceController} (L4\n * CRUD list composite). Creates the controller once in `setup()`, mirrors its\n * store into a `shallowRef`, and returns the controller plus that live `state`.\n * A thin bridge — all logic lives in `@iris-ui-kit/core`.\n *\n * Constructed with `immediate: false` so no fetch fires during `setup()`\n * (SSR-safe: server rendering never runs `onMounted`); the initial load is\n * kicked from `onMounted` when the caller's config says `immediate !== false`.\n * The `onMounted` registration is conditional on that flag — inside a bare\n * `effectScope` there is no component instance and Vue would warn on an\n * unconditional registration. The controller is torn down on scope dispose\n * (aborting any in-flight request and detaching the state mirror), so a late\n * response never writes back to a torn-down instance.\n */\nexport function useResourceController<T>(\n config: ResourceControllerConfig<T>,\n): UseResourceController<T> {\n const controller = createResourceController({ ...config, immediate: false })\n const immediate = config.immediate !== false\n\n if (immediate) {\n onMounted(() => void controller.load())\n }\n // Abort any in-flight fetch + detach the controller's internal subscriptions\n // on scope dispose (a late response must not write back to a torn-down\n // instance). Fires on unmount inside a component scope and on `scope.stop()`\n // inside a bare effectScope.\n onScopeDispose(() => controller.destroy())\n\n const state = shallowRef(controller.getState())\n onScopeDispose(controller.subscribe((next) => (state.value = next)))\n return { ...controller, state }\n}\n"]}
|
package/dist/resource.d.cts
CHANGED
|
@@ -10,7 +10,16 @@ interface UseResourceController<T> extends ResourceController<T> {
|
|
|
10
10
|
* Vue bridge over the framework-agnostic {@link createResourceController} (L4
|
|
11
11
|
* CRUD list composite). Creates the controller once in `setup()`, mirrors its
|
|
12
12
|
* store into a `shallowRef`, and returns the controller plus that live `state`.
|
|
13
|
-
* A
|
|
13
|
+
* A thin bridge — all logic lives in `@iris-ui-kit/core`.
|
|
14
|
+
*
|
|
15
|
+
* Constructed with `immediate: false` so no fetch fires during `setup()`
|
|
16
|
+
* (SSR-safe: server rendering never runs `onMounted`); the initial load is
|
|
17
|
+
* kicked from `onMounted` when the caller's config says `immediate !== false`.
|
|
18
|
+
* The `onMounted` registration is conditional on that flag — inside a bare
|
|
19
|
+
* `effectScope` there is no component instance and Vue would warn on an
|
|
20
|
+
* unconditional registration. The controller is torn down on scope dispose
|
|
21
|
+
* (aborting any in-flight request and detaching the state mirror), so a late
|
|
22
|
+
* response never writes back to a torn-down instance.
|
|
14
23
|
*/
|
|
15
24
|
declare function useResourceController<T>(config: ResourceControllerConfig<T>): UseResourceController<T>;
|
|
16
25
|
|
package/dist/resource.d.ts
CHANGED
|
@@ -10,7 +10,16 @@ interface UseResourceController<T> extends ResourceController<T> {
|
|
|
10
10
|
* Vue bridge over the framework-agnostic {@link createResourceController} (L4
|
|
11
11
|
* CRUD list composite). Creates the controller once in `setup()`, mirrors its
|
|
12
12
|
* store into a `shallowRef`, and returns the controller plus that live `state`.
|
|
13
|
-
* A
|
|
13
|
+
* A thin bridge — all logic lives in `@iris-ui-kit/core`.
|
|
14
|
+
*
|
|
15
|
+
* Constructed with `immediate: false` so no fetch fires during `setup()`
|
|
16
|
+
* (SSR-safe: server rendering never runs `onMounted`); the initial load is
|
|
17
|
+
* kicked from `onMounted` when the caller's config says `immediate !== false`.
|
|
18
|
+
* The `onMounted` registration is conditional on that flag — inside a bare
|
|
19
|
+
* `effectScope` there is no component instance and Vue would warn on an
|
|
20
|
+
* unconditional registration. The controller is torn down on scope dispose
|
|
21
|
+
* (aborting any in-flight request and detaching the state mirror), so a late
|
|
22
|
+
* response never writes back to a torn-down instance.
|
|
14
23
|
*/
|
|
15
24
|
declare function useResourceController<T>(config: ResourceControllerConfig<T>): UseResourceController<T>;
|
|
16
25
|
|
package/dist/resource.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { createClientFetcher, createResourceController, useResourceController } from './chunk-
|
|
1
|
+
export { createClientFetcher, createResourceController, useResourceController } from './chunk-25NYWSXP.js';
|
|
2
2
|
//# sourceMappingURL=resource.js.map
|
|
3
3
|
//# sourceMappingURL=resource.js.map
|
package/dist/skeletons.cjs
CHANGED
|
@@ -1270,7 +1270,8 @@ var IrisSidebarLayout = vue.defineComponent({
|
|
|
1270
1270
|
() => props.collapsed,
|
|
1271
1271
|
(value) => {
|
|
1272
1272
|
if (value !== void 0) internalCollapsed.value = value;
|
|
1273
|
-
}
|
|
1273
|
+
},
|
|
1274
|
+
{ immediate: true }
|
|
1274
1275
|
);
|
|
1275
1276
|
const setCollapsed = (value) => {
|
|
1276
1277
|
if (!isControlled.value) internalCollapsed.value = value;
|