@weasel-js/forge 1.6.0 → 1.6.1
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/{chunk-PO5JLVYT.js → chunk-CSAXZIMV.js} +4 -4
- package/dist/{chunk-PO5JLVYT.js.map → chunk-CSAXZIMV.js.map} +1 -1
- package/dist/{chunk-A4JOEGYQ.js → chunk-DIOLWCH7.js} +22 -5
- package/dist/chunk-DIOLWCH7.js.map +1 -0
- package/dist/{chunk-VEKEBILL.js → chunk-JXIWZFD4.js} +2 -2
- package/dist/chunk-JXIWZFD4.js.map +1 -0
- package/dist/{chunk-FWPBKKYB.js → chunk-OLWZURU3.js} +3 -3
- package/dist/{chunk-FWPBKKYB.js.map → chunk-OLWZURU3.js.map} +1 -1
- package/dist/{config-DU_WuORS.d.ts → config-C5Vq5Kjj.d.ts} +5 -0
- package/dist/csf/preview-api.js +1 -1
- package/dist/frame/index.js +3 -3
- package/dist/index.d.ts +1 -1
- package/dist/shell/index.d.ts +7 -8
- package/dist/shell/index.js +6 -6
- package/dist/shell/index.js.map +1 -1
- package/dist/test/index.js +3 -3
- package/dist/vite/index.js.map +1 -1
- package/package.json +5 -5
- package/dist/chunk-A4JOEGYQ.js.map +0 -1
- package/dist/chunk-VEKEBILL.js.map +0 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/frame/a11y.ts","../src/frame/cssVars.ts","../src/frame/capture.ts","../src/frame/globalsTarget.ts","../src/frame/StoryHost.tsx","../src/csf/isPlainObject.ts","../src/csf/argsToSchema.ts","../src/csf/loadCsfModule.tsx","../src/story/native.ts","../src/story/load.ts"],"names":["config","value","f"],"mappings":";;;;;;;;AAqBA,IAAM,OAAA,uBAAc,GAAA,CAAI,CAAC,SAAS,UAAA,EAAY,SAAA,EAAW,UAAU,CAAC,CAAA;AAEpE,SAAS,QAAQ,IAAA,EAA+B;AAC9C,EAAA,MAAM,MAAA,GAAS,KAAK,MAAA,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AAC,GAAI,IAAA,CAAK,UAAA,IAAc,EAAC,EAAI,GAAI,QAAA,CAAS,UAAA,IAAc,EAAG,CAAA;AAAA,MACvE,MAAA,EAAQ,IAAA,CAAK,MAAA,IAAU,QAAA,CAAS,MAAA,IAAU,UAAA;AAAA,MAC1C,QAAA,EAAU,KAAK,QAAA,IAAY,IAAA;AAAA,MAC3B,OAAA,EAAS,IAAA,CAAK,OAAA,IAAW,QAAA,CAAS,OAAA,IAAW,IAAA;AAAA,MAC7C,IAAA,EAAM,KAAK,IAAA,IAAQ;AAAA,KACpB,CAAA;AAAA,EACH;AACA,EAAA,OAAO,OAAA;AACT;;;ACrBO,SAAS,WAAA,CACd,GAAA,EACA,SAAA,EACA,UAAA,EACe;AACf,EAAA,OAAO,QAAA,CAAS,GAAA,CAAI,OAAA,EAAS,MAAM,CAAA,GAC/B,gBAAA,CAAiB,GAAA,EAAK,SAAS,CAAA,GAC/B,aAAA,CAAc,GAAA,EAAK,SAAA,EAAW,UAAU,CAAA;AAC9C;AAGO,SAAS,cAAc,GAAA,EAAkD;AAC9E,EAAA,MAAM,OAAO,GAAA,CAAI,OAAA;AACjB,EAAA,MAAM,MAAA,GAAS,SAAS,IAAA,EAAM,MAAM,IAAI,IAAA,EAAM,KAAA,GAAQ,IAAA,EAAM,UAAA,EAAY,KAAA,EAAO,KAAA;AAC/E,EAAA,OAAO,OAAO,MAAA,KAAW,UAAA,GAAc,MAAA,GAAyB,IAAA;AAClE","file":"chunk-FWPBKKYB.js","sourcesContent":["import type { A11yFinding, A11yReport } from '../protocol/messages';\n\n/** The shape of `axe.run`'s answer this module reads. */\ninterface AxeResult {\n violations: readonly AxeFinding[];\n incomplete: readonly AxeFinding[];\n passes: readonly unknown[];\n inapplicable: readonly unknown[];\n}\ninterface AxeFinding {\n id: string;\n impact?: string | null;\n help: string;\n helpUrl: string;\n description: string;\n nodes: readonly { target: readonly unknown[]; html: string; failureSummary?: string }[];\n}\ninterface AxeModule {\n run(context: Element, options?: unknown): Promise<AxeResult>;\n}\n\nconst IMPACTS = new Set(['minor', 'moderate', 'serious', 'critical']);\n\nfunction finding(from: AxeFinding): A11yFinding {\n const impact = from.impact ?? '';\n return {\n id: from.id,\n impact: IMPACTS.has(impact) ? (impact as A11yFinding['impact']) : null,\n help: from.help,\n helpUrl: from.helpUrl,\n description: from.description,\n nodes: from.nodes.map((node) => ({\n // An axe target entry is a selector, or an array of them for an element inside a shadow root.\n target: node.target.map((part) => (Array.isArray(part) ? part.join(' ') : String(part))),\n html: node.html,\n ...(node.failureSummary === undefined ? {} : { failureSummary: node.failureSummary }),\n })),\n };\n}\n\nlet loading: Promise<AxeModule> | null = null;\n\n/** axe is ~500 KB, so a frame that is never audited never pays for it. */\nfunction loadAxe(): Promise<AxeModule> {\n loading ??= import('axe-core').then((mod) => (mod as unknown as { default?: AxeModule }).default ?? (mod as unknown as AxeModule));\n return loading;\n}\n\n/** Rules that judge the page rather than the element audited; off when the element is one story on a page of many. */\nexport const PAGE_RULES: readonly string[] = [\n 'bypass',\n 'document-title',\n 'html-has-lang',\n 'html-lang-valid',\n 'html-xml-lang-mismatch',\n 'landmark-one-main',\n 'page-has-heading-one',\n 'region',\n];\n\nexport interface RunAxeOptions {\n /** Whether `element` stands for the whole page. False leaves `PAGE_RULES` out. Default true. */\n page?: boolean;\n}\n\n/** Runs axe over `element` and reduces its answer to what crosses the frame's channel. */\nexport async function runAxe(element: Element, { page = true }: RunAxeOptions = {}): Promise<A11yReport> {\n const axe = await loadAxe();\n const rules = page ? undefined : Object.fromEntries(PAGE_RULES.map((id) => [id, { enabled: false }]));\n const result = await axe.run(element, rules ? { rules } : undefined);\n return {\n violations: result.violations.map(finding),\n incomplete: result.incomplete.map(finding),\n passes: result.passes.length,\n inapplicable: result.inapplicable.length,\n };\n}\n","import type { CssVarReport } from '../protocol/messages';\n\nconst VAR_REF = /var\\(\\s*(--[\\w-]+)/g;\n\nfunction collect(text: string, names: Set<string>): void {\n if (!text.includes('var(')) return;\n for (const [, name] of text.matchAll(VAR_REF)) names.add(name!);\n}\n\n/** A grouping rule's text holds its children's; an `@import` holds only its URL, so its sheet is read too. */\nfunction walkRules(sheet: CSSStyleSheet, names: Set<string>): void {\n let rules: CSSRuleList;\n try {\n rules = sheet.cssRules;\n } catch {\n // A cross-origin sheet refuses to be read.\n return;\n }\n for (const rule of Array.from(rules)) {\n const imported = (rule as CSSRule & { styleSheet?: CSSStyleSheet | null }).styleSheet;\n if (imported) walkRules(imported, names);\n else collect(rule.cssText, names);\n }\n}\n\n/**\n * Every custom property the document references with `var()`, from inline styles and stylesheet rules — computed\n * styles have already substituted the reference away. Values resolve on `root`, the document's by default, or else\n * on the first element under it that declares one.\n */\nexport function scanCssVars(\n doc: Document,\n overridden: (name: string) => boolean = () => false,\n root: Element = doc.documentElement,\n): CssVarReport[] {\n const names = new Set<string>();\n for (const el of Array.from(doc.querySelectorAll('[style]'))) collect(el.getAttribute('style') ?? '', names);\n for (const sheet of Array.from(doc.styleSheets)) walkRules(sheet, names);\n\n const values = resolveValues(doc, names, root);\n return [...names]\n .sort()\n .map((name) => ({ name, value: values.get(name) ?? '', overridden: overridden(name) }));\n}\n\nfunction resolveValues(doc: Document, names: Iterable<string>, root: Element): Map<string, string> {\n const view = doc.defaultView;\n const values = new Map<string, string>();\n if (!view) return values;\n const own = view.getComputedStyle(root);\n const missing: string[] = [];\n for (const name of names) {\n const value = own.getPropertyValue(name).trim();\n if (value) values.set(name, value);\n else missing.push(name);\n }\n const under = root === doc.documentElement ? (doc.body ?? root) : root;\n for (const el of missing.length > 0 ? Array.from(under.querySelectorAll('*')) : []) {\n const style = view.getComputedStyle(el);\n for (let i = missing.length - 1; i >= 0; i--) {\n const value = style.getPropertyValue(missing[i]!).trim();\n if (!value) continue;\n values.set(missing[i]!, value);\n missing.splice(i, 1);\n }\n if (missing.length === 0) break;\n }\n return values;\n}\n\n/** One custom property's value, resolved the way `scanCssVars` resolves each. */\nexport function resolveCssVar(doc: Document, name: string, root: Element = doc.documentElement): string {\n return resolveValues(doc, [name], root).get(name) ?? '';\n}\n\nexport interface Overrides {\n set(name: string, value: string | null): void;\n has(name: string): boolean;\n /** Whether `node` is the override style element or inside it. */\n owns(node: Node): boolean;\n dispose(): void;\n}\n\n/**\n * Custom property overrides as one rule on `scope`, kept last in `<head>`. `:not(#fg-overrides)` adds an ID's weight\n * without `!important`, so the rule outranks a theme's attribute selectors; a stylesheet that lands after it sends\n * the element back to the end.\n */\nexport function createOverrides(doc: Document, scope = ':root'): Overrides {\n const values = new Map<string, string>();\n const style = doc.createElement('style');\n style.setAttribute('data-fg-overrides', '');\n\n // Another instance's style counts as last place too, or two instances would take turns moving forever.\n const keepLast = () => {\n if (style.parentNode === doc.head) {\n let next = style.nextElementSibling;\n while (next?.hasAttribute('data-fg-overrides')) next = next.nextElementSibling;\n if (next === null) return;\n }\n doc.head.append(style);\n };\n const write = () => {\n const decls = [...values].map(([name, value]) => ` ${name}: ${value};`);\n style.textContent = decls.length > 0 ? `:is(${scope}):not(#fg-overrides) {\\n${decls.join('\\n')}\\n}\\n` : '';\n };\n\n keepLast();\n const observer = typeof MutationObserver === 'undefined' ? null : new MutationObserver(keepLast);\n observer?.observe(doc.head, { childList: true });\n\n return {\n set(name, value) {\n if (value === null) values.delete(name);\n else values.set(name, value);\n write();\n },\n has: (name) => values.has(name),\n owns: (node) => style.contains(node),\n dispose() {\n observer?.disconnect();\n style.remove();\n },\n };\n}\n","import type { CapturedPicture } from '../protocol/messages';\nimport { scanCssVars } from './cssVars';\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\n\n/** Every rule the document can read. A cross-origin sheet refuses, and is skipped. */\nfunction documentCss(doc: Document): string {\n const out: string[] = [];\n for (const sheet of Array.from(doc.styleSheets)) {\n try {\n for (const rule of Array.from(sheet.cssRules)) out.push(rule.cssText);\n } catch {\n // A cross-origin sheet refuses to be read.\n }\n }\n return out.join('\\n');\n}\n\n/**\n * The story's own subtree as an SVG picture: the DOM inside a `<foreignObject>`, with the document's\n * stylesheets beside it.\n *\n * The capture root is a `<div>`, so nothing a rule hangs off `:root`, `html` or `body` reaches the story —\n * hence the custom properties restated on the root, which is what theme tokens travel by.\n */\nexport function captureElement(element: HTMLElement): Extract<CapturedPicture, { kind: 'svg' }> {\n const doc = element.ownerDocument;\n const rect = element.getBoundingClientRect();\n const w = Math.max(1, Math.ceil(rect.width));\n const h = Math.max(1, Math.ceil(rect.height));\n\n const root = doc.createElement('div');\n root.setAttribute('data-fg-capture', '');\n const tokens = scanCssVars(doc)\n .filter((v) => v.value)\n .map((v) => `${v.name}: ${v.value};`)\n .join('');\n const style = doc.createElement('style');\n style.textContent = `${documentCss(doc)}\\n[data-fg-capture]{${tokens}}`;\n root.append(style, element.cloneNode(true));\n\n // XML, not HTML: an `<svg>` base is re-parsed as XML, where `<br>` and friends have to be closed.\n const inner = new XMLSerializer().serializeToString(root);\n return {\n kind: 'svg',\n markup: `<svg xmlns=\"${SVG_NS}\" width=\"${w}\" height=\"${h}\" viewBox=\"0 0 ${w} ${h}\"><foreignObject x=\"0\" y=\"0\" width=\"${w}\" height=\"${h}\">${inner}</foreignObject></svg>`,\n };\n}\n","/** What a setup's `applyGlobals` is handed: the element the globals apply to, and a way to style it alone. */\nexport interface GlobalsTarget {\n /** A frame document's root, or one story's host in the workshop document. */\n root: HTMLElement;\n /** A selector matching `root` and nothing else, so a rule written under it reaches only this target. */\n scope: string;\n /** Replaces the CSS forge keeps for this target. */\n style: (css: string) => void;\n}\n\n/** A target over `root`, owning one `<style>` in the document's head; `dispose` removes it. */\nexport function createGlobalsTarget(root: HTMLElement, scope: string): GlobalsTarget & { dispose: () => void } {\n const doc = root.ownerDocument;\n let style: HTMLStyleElement | null = null;\n return {\n root,\n scope,\n style(css) {\n if (!style) {\n style = doc.createElement('style');\n style.setAttribute('data-fg-globals', scope);\n doc.head.append(style);\n }\n style.textContent = css;\n },\n dispose() {\n style?.remove();\n style = null;\n },\n };\n}\n","import { Component, type ReactNode } from 'react';\nimport type { Decorator, LoadedStory, StoryContext } from '../story/types';\n\nexport interface StoryHostProps {\n story: LoadedStory;\n ctx: StoryContext;\n /** Outermost decorators, from the frame setup. */\n decorators: readonly Decorator[];\n /** A change clears a caught error, so new input retries the render. */\n resetKey: number;\n onError: (error: unknown) => void;\n}\n\nfunction RenderStory({ story, ctx }: { story: LoadedStory; ctx: StoryContext }): ReactNode {\n return story.render(ctx);\n}\n\nfunction Decorated({ story, ctx, decorators }: Omit<StoryHostProps, 'resetKey' | 'onError'>): ReactNode {\n let inner: () => ReactNode = () => <RenderStory story={story} ctx={ctx} />;\n for (const decorate of [...story.decorators, ...decorators]) {\n const wrapped = inner;\n inner = () => decorate(wrapped, ctx);\n }\n return inner();\n}\n\ninterface BoundaryState {\n error: unknown;\n failed: boolean;\n resetKey: number;\n}\n\nexport class StoryHost extends Component<StoryHostProps, BoundaryState> {\n override state: BoundaryState = { error: null, failed: false, resetKey: this.props.resetKey };\n\n static getDerivedStateFromProps(props: StoryHostProps, state: BoundaryState): Partial<BoundaryState> | null {\n return props.resetKey === state.resetKey ? null : { error: null, failed: false, resetKey: props.resetKey };\n }\n\n static getDerivedStateFromError(error: unknown): Partial<BoundaryState> {\n return { error, failed: true };\n }\n\n override componentDidCatch(error: unknown): void {\n this.props.onError(error);\n }\n\n override render(): ReactNode {\n if (this.state.failed) {\n const { error } = this.state;\n return <pre className=\"fg-frame__fault\">{error instanceof Error ? error.message : String(error)}</pre>;\n }\n const { story, ctx, decorators } = this.props;\n return <Decorated story={story} ctx={ctx} decorators={decorators} />;\n }\n}\n","export const isPlainObject = (value: unknown): value is Record<string, unknown> =>\n !!value && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype;\n","import { type ConfigNode, type ConfigSchema, type ConfigShape, f } from '@weasel-js/labkit/config';\nimport { isPlainObject } from './isPlainObject';\nimport { portSafePart } from './portSafe';\n\n/** Storybook's conditional control: shown only while an arg, or a global, meets the test. */\nexport type ArgCondition = ({ arg: string } | { global: string }) & {\n truthy?: boolean;\n exists?: boolean;\n eq?: unknown;\n neq?: unknown;\n};\n\n/** A CSF `argTypes` entry, as far as forge reads it. */\nexport interface ArgType {\n name?: string;\n description?: string;\n control?: string | false | { type?: string; min?: number; max?: number; step?: number };\n options?: readonly unknown[];\n table?: { disable?: boolean };\n if?: ArgCondition;\n}\n\ninterface Leaf extends ConfigNode<unknown> {\n hidden(): Leaf;\n describe(description: string): Leaf;\n label(name: string): Leaf;\n showIf(predicate: (config: Record<string, unknown>) => boolean): Leaf;\n}\n\ninterface Control {\n type: string | undefined;\n min?: number;\n max?: number;\n step?: number;\n}\n\nfunction controlOf(argType: ArgType): Control | false {\n const { control } = argType;\n if (control === false) return false;\n if (typeof control === 'string') return { type: control };\n return { type: control?.type, min: control?.min, max: control?.max, step: control?.step };\n}\n\nfunction stringOptions(argType: ArgType): string[] | null {\n const opts = argType.options;\n return opts && opts.length > 0 && opts.every((o) => typeof o === 'string') ? (opts as string[]) : null;\n}\n\nfunction inferred(value: unknown): Leaf | null {\n switch (typeof value) {\n case 'number':\n return f.number(value);\n case 'boolean':\n return f.boolean(value);\n case 'string':\n return f.string(value);\n default:\n return Array.isArray(value) || isPlainObject(value) ? f.custom('json', value) : null;\n }\n}\n\nfunction bounded(node: ReturnType<typeof f.number>, control: Control) {\n let out = node;\n if (control.min !== undefined && control.max !== undefined) out = out.range(control.min, control.max);\n if (control.step !== undefined) out = out.step(control.step);\n return out;\n}\n\nfunction controlled(control: Control, argType: ArgType, has: boolean, value: unknown): Leaf | null {\n const options = stringOptions(argType);\n // Storybook passes an argTypes-only key as undefined, so the component's own default applies.\n const def = <T>() => (has ? value : undefined) as T;\n switch (control.type) {\n case 'number': {\n const node = bounded(f.number(def()), control);\n return control.min !== undefined && control.max !== undefined ? node.input() : node;\n }\n case 'range':\n case 'slider':\n return has ? bounded(f.number(def()), control).slider() : null;\n case 'boolean':\n return f.boolean(def());\n case 'switch':\n return f.boolean(def()).toggle();\n case 'text':\n case 'textarea':\n return f.string(def());\n case 'select':\n case 'radio':\n case 'inline-radio':\n case undefined: {\n if (!options) return control.type === undefined && has ? inferred(value) : null;\n const node = f.enum(def<string>(), options);\n return control.type === 'radio' || control.type === 'inline-radio' ? node.radio() : node;\n }\n case 'object':\n return has ? f.custom('json', value) : null;\n default:\n return has ? inferred(value) : null;\n }\n}\n\n/** The config predicate for an `if`; null for a condition on a global, which a story's config does not hold. */\nfunction conditionOf(condition: ArgCondition): ((config: Record<string, unknown>) => boolean) | null {\n if (!('arg' in condition)) return null;\n const { arg } = condition;\n return (config) => {\n const value = config[arg];\n if (condition.exists !== undefined) return (value !== undefined) === condition.exists;\n if ('eq' in condition) return Object.is(value, condition.eq);\n if ('neq' in condition) return !Object.is(value, condition.neq);\n return Boolean(value) === (condition.truthy ?? true);\n };\n}\n\n/** `parameters.controls.matchers`: arg names that pick a control when the arg's argType names none. */\nexport interface ControlMatchers {\n color?: RegExp;\n /** labkit has no date leaf, so a date match keeps the leaf its value infers. */\n date?: RegExp;\n}\n\n/** Storybook's rule: a string arg with no control or options whose name matches `color` gets a color picker. */\nfunction matched(key: string, value: unknown, argType: ArgType | undefined, matchers: ControlMatchers): Leaf | null {\n if (typeof value !== 'string' || argType?.control !== undefined || stringOptions(argType ?? {})) return null;\n return matchers.color?.test(key) ? f.color(value) : null;\n}\n\n/** A labkit schema for a CSF story's args, refined by its `argTypes`. */\nexport function argsToSchema(\n args: Readonly<Record<string, unknown>>,\n argTypes: Readonly<Record<string, ArgType | undefined>>,\n matchers: ControlMatchers = {},\n): ConfigSchema<unknown> {\n const nodes: Record<string, Leaf> = {};\n for (const key of new Set([...Object.keys(args), ...Object.keys(argTypes)])) {\n const has = key in args;\n // A control carries only what crosses the port; the frame puts the rest back from `args` (`withUnsent`).\n const part = has ? portSafePart(args[key]) : null;\n if (has && !part) continue;\n const value = part?.value;\n const argType = argTypes[key];\n const control = argType ? controlOf(argType) : false;\n\n let node: Leaf | null =\n (has ? matched(key, value, argType, matchers) : null) ??\n (control ? controlled(control, argType ?? {}, has, value) : has ? inferred(value) : null);\n if (!node) continue;\n if (argType && (argType.control === false || argType.table?.disable)) node = node.hidden();\n if (argType?.description) node = node.describe(argType.description);\n if (argType?.name) node = node.label(argType.name);\n const shownWhen = argType?.if ? conditionOf(argType.if) : null;\n if (shownWhen) node = node.showIf(shownWhen);\n nodes[key] = node;\n }\n return f.schema(nodes as ConfigShape);\n}\n","import {\n type ComponentType,\n createContext,\n createElement,\n type Dispatch,\n type ReactNode,\n type SetStateAction,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport type { Globals, Layout, Viewport } from '../protocol/messages';\nimport { storyId, storyNameFromExport } from '../story/ids';\nimport type { Decorator, LoadedStory, PlayContext, StoryContext } from '../story/types';\nimport { type ArgsScope, ArgsContext, appliedLocal, coverOf, type LocalArgs } from './argsContext';\nimport { type ArgType, argsToSchema, type ControlMatchers } from './argsToSchema';\nimport { isPlainObject } from './isPlainObject';\nimport { withUnsent } from './portSafe';\n\ntype Args = Record<string, unknown>;\ntype CsfContext = {\n args: Args;\n globals: Globals;\n parameters: Record<string, unknown>;\n title: string;\n name: string;\n id: string;\n viewMode: 'story';\n};\ntype CsfRender = (args: Args, context: CsfContext) => ReactNode;\ntype CsfDecorator = (Story: ComponentType, context: CsfContext) => ReactNode;\ntype CsfPlay = (context: CsfContext & { canvasElement: HTMLElement; step: CsfStep }) => void | Promise<void>;\ntype CsfStep = (label: string, fn: () => void | Promise<void>) => Promise<void>;\n\ninterface Annotations {\n title?: string;\n name?: string;\n storyName?: string;\n component?: ComponentType<Args>;\n args?: Args;\n argTypes?: Record<string, ArgType>;\n parameters?: Record<string, unknown>;\n globals?: Record<string, unknown>;\n decorators?: CsfDecorator | CsfDecorator[];\n render?: CsfRender;\n play?: CsfPlay;\n includeStories?: string[] | RegExp;\n excludeStories?: string[] | RegExp;\n}\n\nconst LAYOUTS: readonly Layout[] = ['centered', 'padded', 'fullscreen'];\n\nconst asArray = <T,>(value: T | T[] | undefined): T[] => (value === undefined ? [] : Array.isArray(value) ? value : [value]);\n\n/** Storybook's `deleteUndefined`, which its args store applies after every update. */\nconst withoutUndefined = (args: Args): Args =>\n Object.fromEntries(Object.entries(args).filter(([, value]) => value !== undefined));\n\n/** Storybook's `matches` from `isExportStory`. */\nconst matches = (key: string, filter: string[] | RegExp) =>\n Array.isArray(filter) ? filter.includes(key) : key.match(filter) !== null;\n\n/** Storybook's `combineParameters`: plain objects merge deeply, anything else is replaced. */\nfunction combineParameters(...sources: (Record<string, unknown> | undefined)[]): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const source of sources) {\n for (const [key, value] of Object.entries(source ?? {})) {\n if (value === undefined) continue;\n out[key] = isPlainObject(value) && isPlainObject(out[key]) ? combineParameters(out[key], value) : value;\n }\n }\n return out;\n}\n\nfunction resolveViewport(parameters: Record<string, unknown>, globals: Record<string, unknown>): Viewport | null {\n const selected = globals.viewport as { value?: string; isRotated?: boolean } | undefined;\n const options = (parameters.viewport as { options?: Record<string, { styles?: { width?: string; height?: string } }> } | undefined)\n ?.options;\n const styles = selected?.value ? options?.[selected.value]?.styles : undefined;\n const px = (v: string | undefined) => (v && /^\\d+(\\.\\d+)?px$/.test(v) ? Number.parseFloat(v) : Number.NaN);\n const width = px(styles?.width);\n const height = px(styles?.height);\n if (Number.isNaN(width) || Number.isNaN(height)) return null;\n return selected?.isRotated ? { width: height, height: width } : { width, height };\n}\n\nconst InnerStory = createContext<(() => ReactNode) | null>(null);\n\nfunction Story(): ReactNode {\n return useContext(InnerStory)?.() ?? null;\n}\n\nfunction Call({ fn }: { fn: () => ReactNode }): ReactNode {\n return fn();\n}\n\ninterface StoryLocals {\n story: string;\n local: LocalArgs;\n setLocal: Dispatch<SetStateAction<LocalArgs>>;\n}\n\nconst LocalArgsContext = createContext<StoryLocals | null>(null);\n\n/** The outermost scope of a story holds its frame-local args, so its decorators and render share them. */\nfunction Scoped({\n id,\n build,\n fn,\n}: {\n id: string;\n build: (local: StoryLocals) => [ArgsScope, CsfContext];\n fn: (context: CsfContext) => ReactNode;\n}): ReactNode {\n const outer = useContext(LocalArgsContext);\n const [local, setLocal] = useState<LocalArgs>({});\n const shared = outer?.story === id ? outer : { story: id, local, setLocal };\n const [scope, context] = build(shared);\n const { config } = scope;\n const prune = shared.setLocal;\n // An entry config has moved past must not come back if config later returns to the value it covered.\n useEffect(() => {\n prune((prev) => {\n const kept = Object.entries(prev).filter(([key, entry]) => coverOf(config[key]) === entry.over);\n return kept.length === Object.keys(prev).length ? prev : Object.fromEntries(kept);\n });\n }, [config, prune]);\n return createElement(\n LocalArgsContext.Provider,\n { value: shared },\n createElement(ArgsContext.Provider, { value: scope }, createElement(Call, { fn: () => fn(context) })),\n );\n}\n\n/**\n * Normalizes a Component Story Format module. `autoTitle` titles the stories when the meta names no title;\n * `parameters` are the project's, under the meta's and each story's.\n */\nexport function loadCsfModule(\n mod: Record<string, unknown>,\n autoTitle: string,\n projectParameters: Record<string, unknown> = {},\n): LoadedStory[] {\n const meta = (isPlainObject(mod.default) ? mod.default : {}) as Annotations;\n const title = meta.title ?? autoTitle;\n const stories: LoadedStory[] = [];\n\n for (const [exportName, value] of Object.entries(mod)) {\n if (exportName === 'default' || exportName === '__namedExportsOrder' || exportName === '__esModule') continue;\n if (meta.includeStories && !matches(exportName, meta.includeStories)) continue;\n if (meta.excludeStories && matches(exportName, meta.excludeStories)) continue;\n if (!value || (typeof value !== 'object' && typeof value !== 'function')) continue;\n\n // A CSF 2 function export hoists its annotations onto itself.\n const spec: Annotations = typeof value === 'function' ? { ...value, render: value as CsfRender } : (value as Annotations);\n const id = storyId(title, exportName);\n const name = spec.name || spec.storyName || storyNameFromExport(exportName);\n const args = { ...meta.args, ...spec.args };\n const parameters = combineParameters(projectParameters, meta.parameters, spec.parameters);\n const matchers = (parameters.controls as { matchers?: ControlMatchers } | undefined)?.matchers;\n const config = argsToSchema(\n args,\n combineParameters(meta.argTypes, spec.argTypes) as Record<string, ArgType>,\n isPlainObject(matchers) ? matchers : {},\n );\n const defaults = config.defaults() as Args;\n const storyGlobals = { ...meta.globals, ...spec.globals };\n const component = meta.component;\n const renderFn: CsfRender | undefined =\n spec.render ?? meta.render ?? (component ? (a) => createElement(component, a) : undefined);\n\n const withArgs = (config: Args): Args =>\n Object.fromEntries(\n Object.entries(withoutUndefined(config)).map(([key, value]) => [key, key in args ? withUnsent(value, args[key]) : value]),\n );\n const csfContext = (config: unknown, globals: Globals, local: LocalArgs = {}): CsfContext => ({\n args: withoutUndefined({ ...args, ...withArgs(config as Args), ...appliedLocal(local, config as Args) }),\n globals,\n parameters,\n title,\n name,\n id,\n viewMode: 'story',\n });\n const scoped = (ctx: StoryContext, fn: (context: CsfContext) => ReactNode): ReactNode =>\n createElement(Scoped, {\n id,\n build: ({ local, setLocal }: StoryLocals): [ArgsScope, CsfContext] => {\n const context = csfContext(ctx.config, ctx.globals, local);\n const scope: ArgsScope = {\n args: context.args,\n config: ctx.config as Args,\n defaults,\n original: args,\n setConfig: ctx.setConfig,\n setLocal,\n };\n return [scope, context];\n },\n fn,\n });\n\n const adapt =\n (decorator: CsfDecorator): Decorator =>\n (inner, ctx) =>\n createElement(\n InnerStory.Provider,\n { value: inner },\n scoped(ctx, (context) => decorator(Story, context)),\n );\n\n const layout = parameters.layout as Layout | undefined;\n const isolate = (parameters.forge as { isolate?: unknown } | undefined)?.isolate;\n const play = spec.play ?? meta.play;\n\n stories.push({\n id,\n title,\n name,\n exportName,\n config,\n initialState: null,\n render: (ctx) => {\n if (!renderFn) return null;\n return scoped(ctx, (context) => renderFn(context.args, context));\n },\n decorators: [...asArray(spec.decorators), ...asArray(meta.decorators)].map(adapt),\n layout: layout && LAYOUTS.includes(layout) ? layout : 'padded',\n viewport: resolveViewport(parameters, storyGlobals),\n isolate: typeof isolate === 'string' ? isolate : null,\n play: play\n ? ({ canvasElement, config, globals }: PlayContext) =>\n play({ ...csfContext(config, globals), canvasElement, step: async (_label, fn) => fn() })\n : null,\n });\n }\n return stories;\n}\n","import { f } from '@weasel-js/labkit/config';\nimport { isNative } from './define';\nimport { storyId, storyNameFromExport } from './ids';\nimport type { LoadedStory, MetaSpec, StorySpec } from './types';\n\n/** Normalizes a module written with `meta` and `story`; exports that are not stories are skipped. */\n/** `autoTitle` titles the stories when the meta names no title. */\nexport function loadNativeModule(mod: Record<string, unknown>, autoTitle: string): LoadedStory[] {\n const metaSpec: MetaSpec = isNative(mod.default, 'meta') ? (mod.default as MetaSpec) : {};\n const title = metaSpec.title ?? autoTitle;\n const stories: LoadedStory[] = [];\n for (const [exportName, value] of Object.entries(mod)) {\n if (exportName === 'default' || !isNative(value, 'story')) continue;\n const spec = value as StorySpec<unknown, unknown>;\n stories.push({\n id: storyId(title, exportName),\n title,\n name: spec.name ?? storyNameFromExport(exportName),\n exportName,\n config: spec.config ?? f.schema({}),\n initialState: spec.state ?? null,\n render: spec.render,\n decorators: [...(spec.decorators ?? []), ...(metaSpec.decorators ?? [])],\n layout: spec.layout ?? metaSpec.layout ?? 'centered',\n viewport: spec.viewport ?? null,\n isolate: spec.isolate ?? metaSpec.isolate ?? null,\n play: spec.play ?? null,\n });\n }\n return stories;\n}\n","import { loadCsfModule } from '../csf/loadCsfModule';\nimport { isNative } from './define';\nimport { loadNativeModule } from './native';\nimport type { IndexRender, LoadedStory } from './types';\n\n/**\n * A story module's stories: a module whose default export is a forge `meta` is native, anything else is CSF under\n * `parameters`. `autoTitle` titles the stories when the meta names no title.\n */\nexport function loadStories(\n mod: Record<string, unknown>,\n autoTitle: string,\n parameters?: Record<string, unknown>,\n): LoadedStory[] {\n return isNative(mod.default, 'meta')\n ? loadNativeModule(mod, autoTitle)\n : loadCsfModule(mod, autoTitle, parameters);\n}\n\n/** A module's own index page: a native meta's `index`, or a CSF meta's `parameters.forge.index`. */\nexport function indexRenderOf(mod: Record<string, unknown>): IndexRender | null {\n const meta = mod.default as { index?: unknown; parameters?: { forge?: { index?: unknown } } } | undefined;\n const render = isNative(meta, 'meta') ? meta?.index : meta?.parameters?.forge?.index;\n return typeof render === 'function' ? (render as IndexRender) : null;\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../src/frame/a11y.ts","../src/frame/cssVars.ts","../src/frame/capture.ts","../src/frame/globalsTarget.ts","../src/frame/StoryHost.tsx","../src/csf/isPlainObject.ts","../src/csf/argsToSchema.ts","../src/csf/loadCsfModule.tsx","../src/story/native.ts","../src/story/load.ts"],"names":["config","value","f"],"mappings":";;;;;;;;AAqBA,IAAM,OAAA,uBAAc,GAAA,CAAI,CAAC,SAAS,UAAA,EAAY,SAAA,EAAW,UAAU,CAAC,CAAA;AAEpE,SAAS,QAAQ,IAAA,EAA+B;AAC9C,EAAA,MAAM,MAAA,GAAS,KAAK,MAAA,IAAU,EAAA;AAC9B,EAAA,OAAO;AAAA,IACL,IAAI,IAAA,CAAK,EAAA;AAAA,IACT,MAAA,EAAQ,OAAA,CAAQ,GAAA,CAAI,MAAM,IAAK,MAAA,GAAmC,IAAA;AAAA,IAClE,MAAM,IAAA,CAAK,IAAA;AAAA,IACX,SAAS,IAAA,CAAK,OAAA;AAAA,IACd,aAAa,IAAA,CAAK,WAAA;AAAA,IAClB,KAAA,EAAO,IAAA,CAAK,KAAA,CAAM,GAAA,CAAI,CAAC,IAAA,MAAU;AAAA;AAAA,MAE/B,QAAQ,IAAA,CAAK,MAAA,CAAO,GAAA,CAAI,CAAC,SAAU,KAAA,CAAM,OAAA,CAAQ,IAAI,CAAA,GAAI,KAAK,IAAA,CAAK,GAAG,CAAA,GAAI,MAAA,CAAO,IAAI,CAAE,CAAA;AAAA,MACvF,MAAM,IAAA,CAAK,IAAA;AAAA,MACX,GAAI,KAAK,cAAA,KAAmB,MAAA,GAAY,EAAC,GAAI,EAAE,cAAA,EAAgB,IAAA,CAAK,cAAA;AAAe,KACrF,CAAE;AAAA,GACJ;AACF;AAEA,IAAI,OAAA,GAAqC,IAAA;AAGzC,SAAS,OAAA,GAA8B;AACrC,EAAA,OAAA,KAAY,OAAO,UAAU,CAAA,CAAE,IAAA,CAAK,CA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AAA,EAAY,KAAA,EAAO,KAAA;AAC/E,EAAA,OAAO,OAAO,MAAA,KAAW,UAAA,GAAc,MAAA,GAAyB,IAAA;AAClE","file":"chunk-OLWZURU3.js","sourcesContent":["import type { A11yFinding, A11yReport } from '../protocol/messages';\n\n/** The shape of `axe.run`'s answer this module reads. */\ninterface AxeResult {\n violations: readonly AxeFinding[];\n incomplete: readonly AxeFinding[];\n passes: readonly unknown[];\n inapplicable: readonly unknown[];\n}\ninterface AxeFinding {\n id: string;\n impact?: string | null;\n help: string;\n helpUrl: string;\n description: string;\n nodes: readonly { target: readonly unknown[]; html: string; failureSummary?: string }[];\n}\ninterface AxeModule {\n run(context: Element, options?: unknown): Promise<AxeResult>;\n}\n\nconst IMPACTS = new Set(['minor', 'moderate', 'serious', 'critical']);\n\nfunction finding(from: AxeFinding): A11yFinding {\n const impact = from.impact ?? '';\n return {\n id: from.id,\n impact: IMPACTS.has(impact) ? (impact as A11yFinding['impact']) : null,\n help: from.help,\n helpUrl: from.helpUrl,\n description: from.description,\n nodes: from.nodes.map((node) => ({\n // An axe target entry is a selector, or an array of them for an element inside a shadow root.\n target: node.target.map((part) => (Array.isArray(part) ? part.join(' ') : String(part))),\n html: node.html,\n ...(node.failureSummary === undefined ? {} : { failureSummary: node.failureSummary }),\n })),\n };\n}\n\nlet loading: Promise<AxeModule> | null = null;\n\n/** axe is ~500 KB, so a frame that is never audited never pays for it. */\nfunction loadAxe(): Promise<AxeModule> {\n loading ??= import('axe-core').then((mod) => (mod as unknown as { default?: AxeModule }).default ?? (mod as unknown as AxeModule));\n return loading;\n}\n\n/** Rules that judge the page rather than the element audited; off when the element is one story on a page of many. */\nexport const PAGE_RULES: readonly string[] = [\n 'bypass',\n 'document-title',\n 'html-has-lang',\n 'html-lang-valid',\n 'html-xml-lang-mismatch',\n 'landmark-one-main',\n 'page-has-heading-one',\n 'region',\n];\n\nexport interface RunAxeOptions {\n /** Whether `element` stands for the whole page. False leaves `PAGE_RULES` out. Default true. */\n page?: boolean;\n}\n\n/** Runs axe over `element` and reduces its answer to what crosses the frame's channel. */\nexport async function runAxe(element: Element, { page = true }: RunAxeOptions = {}): Promise<A11yReport> {\n const axe = await loadAxe();\n const rules = page ? undefined : Object.fromEntries(PAGE_RULES.map((id) => [id, { enabled: false }]));\n const result = await axe.run(element, rules ? { rules } : undefined);\n return {\n violations: result.violations.map(finding),\n incomplete: result.incomplete.map(finding),\n passes: result.passes.length,\n inapplicable: result.inapplicable.length,\n };\n}\n","import type { CssVarReport } from '../protocol/messages';\n\nconst VAR_REF = /var\\(\\s*(--[\\w-]+)/g;\n\nfunction collect(text: string, names: Set<string>): void {\n if (!text.includes('var(')) return;\n for (const [, name] of text.matchAll(VAR_REF)) names.add(name!);\n}\n\n/** A grouping rule's text holds its children's; an `@import` holds only its URL, so its sheet is read too. */\nfunction walkRules(sheet: CSSStyleSheet, names: Set<string>): void {\n let rules: CSSRuleList;\n try {\n rules = sheet.cssRules;\n } catch {\n // A cross-origin sheet refuses to be read.\n return;\n }\n for (const rule of Array.from(rules)) {\n const imported = (rule as CSSRule & { styleSheet?: CSSStyleSheet | null }).styleSheet;\n if (imported) walkRules(imported, names);\n else collect(rule.cssText, names);\n }\n}\n\n/**\n * Every custom property the document references with `var()`, from inline styles and stylesheet rules — computed\n * styles have already substituted the reference away. Values resolve on `root`, the document's by default, or else\n * on the first element under it that declares one.\n */\nexport function scanCssVars(\n doc: Document,\n overridden: (name: string) => boolean = () => false,\n root: Element = doc.documentElement,\n): CssVarReport[] {\n const names = new Set<string>();\n for (const el of Array.from(doc.querySelectorAll('[style]'))) collect(el.getAttribute('style') ?? '', names);\n for (const sheet of Array.from(doc.styleSheets)) walkRules(sheet, names);\n\n const values = resolveValues(doc, names, root);\n return [...names]\n .sort()\n .map((name) => ({ name, value: values.get(name) ?? '', overridden: overridden(name) }));\n}\n\nfunction resolveValues(doc: Document, names: Iterable<string>, root: Element): Map<string, string> {\n const view = doc.defaultView;\n const values = new Map<string, string>();\n if (!view) return values;\n const own = view.getComputedStyle(root);\n const missing: string[] = [];\n for (const name of names) {\n const value = own.getPropertyValue(name).trim();\n if (value) values.set(name, value);\n else missing.push(name);\n }\n const under = root === doc.documentElement ? (doc.body ?? root) : root;\n for (const el of missing.length > 0 ? Array.from(under.querySelectorAll('*')) : []) {\n const style = view.getComputedStyle(el);\n for (let i = missing.length - 1; i >= 0; i--) {\n const value = style.getPropertyValue(missing[i]!).trim();\n if (!value) continue;\n values.set(missing[i]!, value);\n missing.splice(i, 1);\n }\n if (missing.length === 0) break;\n }\n return values;\n}\n\n/** One custom property's value, resolved the way `scanCssVars` resolves each. */\nexport function resolveCssVar(doc: Document, name: string, root: Element = doc.documentElement): string {\n return resolveValues(doc, [name], root).get(name) ?? '';\n}\n\nexport interface Overrides {\n set(name: string, value: string | null): void;\n has(name: string): boolean;\n /** Whether `node` is the override style element or inside it. */\n owns(node: Node): boolean;\n dispose(): void;\n}\n\n/**\n * Custom property overrides as one rule on `scope`, kept last in `<head>`. `:not(#fg-overrides)` adds an ID's weight\n * without `!important`, so the rule outranks a theme's attribute selectors; a stylesheet that lands after it sends\n * the element back to the end.\n */\nexport function createOverrides(doc: Document, scope = ':root'): Overrides {\n const values = new Map<string, string>();\n const style = doc.createElement('style');\n style.setAttribute('data-fg-overrides', '');\n\n // Another instance's style counts as last place too, or two instances would take turns moving forever.\n const keepLast = () => {\n if (style.parentNode === doc.head) {\n let next = style.nextElementSibling;\n while (next?.hasAttribute('data-fg-overrides')) next = next.nextElementSibling;\n if (next === null) return;\n }\n doc.head.append(style);\n };\n const write = () => {\n const decls = [...values].map(([name, value]) => ` ${name}: ${value};`);\n style.textContent = decls.length > 0 ? `:is(${scope}):not(#fg-overrides) {\\n${decls.join('\\n')}\\n}\\n` : '';\n };\n\n keepLast();\n const observer = typeof MutationObserver === 'undefined' ? null : new MutationObserver(keepLast);\n observer?.observe(doc.head, { childList: true });\n\n return {\n set(name, value) {\n if (value === null) values.delete(name);\n else values.set(name, value);\n write();\n },\n has: (name) => values.has(name),\n owns: (node) => style.contains(node),\n dispose() {\n observer?.disconnect();\n style.remove();\n },\n };\n}\n","import type { CapturedPicture } from '../protocol/messages';\nimport { scanCssVars } from './cssVars';\n\nconst SVG_NS = 'http://www.w3.org/2000/svg';\n\n/** Every rule the document can read. A cross-origin sheet refuses, and is skipped. */\nfunction documentCss(doc: Document): string {\n const out: string[] = [];\n for (const sheet of Array.from(doc.styleSheets)) {\n try {\n for (const rule of Array.from(sheet.cssRules)) out.push(rule.cssText);\n } catch {\n // A cross-origin sheet refuses to be read.\n }\n }\n return out.join('\\n');\n}\n\n/**\n * The story's own subtree as an SVG picture: the DOM inside a `<foreignObject>`, with the document's\n * stylesheets beside it.\n *\n * The capture root is a `<div>`, so nothing a rule hangs off `:root`, `html` or `body` reaches the story —\n * hence the custom properties restated on the root, which is what theme tokens travel by.\n */\nexport function captureElement(element: HTMLElement): Extract<CapturedPicture, { kind: 'svg' }> {\n const doc = element.ownerDocument;\n const rect = element.getBoundingClientRect();\n const w = Math.max(1, Math.ceil(rect.width));\n const h = Math.max(1, Math.ceil(rect.height));\n\n const root = doc.createElement('div');\n root.setAttribute('data-fg-capture', '');\n const tokens = scanCssVars(doc)\n .filter((v) => v.value)\n .map((v) => `${v.name}: ${v.value};`)\n .join('');\n const style = doc.createElement('style');\n style.textContent = `${documentCss(doc)}\\n[data-fg-capture]{${tokens}}`;\n root.append(style, element.cloneNode(true));\n\n // XML, not HTML: an `<svg>` base is re-parsed as XML, where `<br>` and friends have to be closed.\n const inner = new XMLSerializer().serializeToString(root);\n return {\n kind: 'svg',\n markup: `<svg xmlns=\"${SVG_NS}\" width=\"${w}\" height=\"${h}\" viewBox=\"0 0 ${w} ${h}\"><foreignObject x=\"0\" y=\"0\" width=\"${w}\" height=\"${h}\">${inner}</foreignObject></svg>`,\n };\n}\n","/** What a setup's `applyGlobals` is handed: the element the globals apply to, and a way to style it alone. */\nexport interface GlobalsTarget {\n /** A frame document's root, or one story's host in the workshop document. */\n root: HTMLElement;\n /** A selector matching `root` and nothing else, so a rule written under it reaches only this target. */\n scope: string;\n /** Replaces the CSS forge keeps for this target. */\n style: (css: string) => void;\n}\n\n/** A target over `root`, owning one `<style>` in the document's head; `dispose` removes it. */\nexport function createGlobalsTarget(root: HTMLElement, scope: string): GlobalsTarget & { dispose: () => void } {\n const doc = root.ownerDocument;\n let style: HTMLStyleElement | null = null;\n return {\n root,\n scope,\n style(css) {\n if (!style) {\n style = doc.createElement('style');\n style.setAttribute('data-fg-globals', scope);\n doc.head.append(style);\n }\n style.textContent = css;\n },\n dispose() {\n style?.remove();\n style = null;\n },\n };\n}\n","import { Component, type ReactNode } from 'react';\nimport type { Decorator, LoadedStory, StoryContext } from '../story/types';\n\nexport interface StoryHostProps {\n story: LoadedStory;\n ctx: StoryContext;\n /** Outermost decorators, from the frame setup. */\n decorators: readonly Decorator[];\n /** A change clears a caught error, so new input retries the render. */\n resetKey: number;\n onError: (error: unknown) => void;\n}\n\nfunction RenderStory({ story, ctx }: { story: LoadedStory; ctx: StoryContext }): ReactNode {\n return story.render(ctx);\n}\n\nfunction Decorated({ story, ctx, decorators }: Omit<StoryHostProps, 'resetKey' | 'onError'>): ReactNode {\n let inner: () => ReactNode = () => <RenderStory story={story} ctx={ctx} />;\n for (const decorate of [...story.decorators, ...decorators]) {\n const wrapped = inner;\n inner = () => decorate(wrapped, ctx);\n }\n return inner();\n}\n\ninterface BoundaryState {\n error: unknown;\n failed: boolean;\n resetKey: number;\n}\n\nexport class StoryHost extends Component<StoryHostProps, BoundaryState> {\n override state: BoundaryState = { error: null, failed: false, resetKey: this.props.resetKey };\n\n static getDerivedStateFromProps(props: StoryHostProps, state: BoundaryState): Partial<BoundaryState> | null {\n return props.resetKey === state.resetKey ? null : { error: null, failed: false, resetKey: props.resetKey };\n }\n\n static getDerivedStateFromError(error: unknown): Partial<BoundaryState> {\n return { error, failed: true };\n }\n\n override componentDidCatch(error: unknown): void {\n this.props.onError(error);\n }\n\n override render(): ReactNode {\n if (this.state.failed) {\n const { error } = this.state;\n return <pre className=\"fg-frame__fault\">{error instanceof Error ? error.message : String(error)}</pre>;\n }\n const { story, ctx, decorators } = this.props;\n return <Decorated story={story} ctx={ctx} decorators={decorators} />;\n }\n}\n","export const isPlainObject = (value: unknown): value is Record<string, unknown> =>\n !!value && typeof value === 'object' && Object.getPrototypeOf(value) === Object.prototype;\n","import { type ConfigNode, type ConfigSchema, type ConfigShape, f } from '@weasel-js/labkit/config';\nimport { isPlainObject } from './isPlainObject';\nimport { portSafePart } from './portSafe';\n\n/** Storybook's conditional control: shown only while an arg, or a global, meets the test. */\nexport type ArgCondition = ({ arg: string } | { global: string }) & {\n truthy?: boolean;\n exists?: boolean;\n eq?: unknown;\n neq?: unknown;\n};\n\n/** A CSF `argTypes` entry, as far as forge reads it. */\nexport interface ArgType {\n name?: string;\n description?: string;\n control?: string | false | { type?: string; min?: number; max?: number; step?: number };\n options?: readonly unknown[];\n table?: { disable?: boolean };\n if?: ArgCondition;\n}\n\ninterface Leaf extends ConfigNode<unknown> {\n hidden(): Leaf;\n describe(description: string): Leaf;\n label(name: string): Leaf;\n showIf(predicate: (config: Record<string, unknown>) => boolean): Leaf;\n}\n\ninterface Control {\n type: string | undefined;\n min?: number;\n max?: number;\n step?: number;\n}\n\nfunction controlOf(argType: ArgType): Control | false {\n const { control } = argType;\n if (control === false) return false;\n if (typeof control === 'string') return { type: control };\n return { type: control?.type, min: control?.min, max: control?.max, step: control?.step };\n}\n\nfunction stringOptions(argType: ArgType): string[] | null {\n const opts = argType.options;\n return opts && opts.length > 0 && opts.every((o) => typeof o === 'string') ? (opts as string[]) : null;\n}\n\nfunction inferred(value: unknown): Leaf | null {\n switch (typeof value) {\n case 'number':\n return f.number(value);\n case 'boolean':\n return f.boolean(value);\n case 'string':\n return f.string(value);\n default:\n return Array.isArray(value) || isPlainObject(value) ? f.custom('json', value) : null;\n }\n}\n\nfunction bounded(node: ReturnType<typeof f.number>, control: Control) {\n let out = node;\n if (control.min !== undefined && control.max !== undefined) out = out.range(control.min, control.max);\n if (control.step !== undefined) out = out.step(control.step);\n return out;\n}\n\nfunction controlled(control: Control, argType: ArgType, has: boolean, value: unknown): Leaf | null {\n const options = stringOptions(argType);\n // Storybook passes an argTypes-only key as undefined, so the component's own default applies.\n const def = <T>() => (has ? value : undefined) as T;\n switch (control.type) {\n case 'number': {\n const node = bounded(f.number(def()), control);\n return control.min !== undefined && control.max !== undefined ? node.input() : node;\n }\n case 'range':\n case 'slider':\n return has ? bounded(f.number(def()), control).slider() : null;\n case 'boolean':\n return f.boolean(def());\n case 'switch':\n return f.boolean(def()).toggle();\n case 'text':\n case 'textarea':\n return f.string(def());\n case 'select':\n case 'radio':\n case 'inline-radio':\n case undefined: {\n if (!options) return control.type === undefined && has ? inferred(value) : null;\n const node = f.enum(def<string>(), options);\n return control.type === 'radio' || control.type === 'inline-radio' ? node.radio() : node;\n }\n case 'object':\n return has ? f.custom('json', value) : null;\n default:\n return has ? inferred(value) : null;\n }\n}\n\n/** The config predicate for an `if`; null for a condition on a global, which a story's config does not hold. */\nfunction conditionOf(condition: ArgCondition): ((config: Record<string, unknown>) => boolean) | null {\n if (!('arg' in condition)) return null;\n const { arg } = condition;\n return (config) => {\n const value = config[arg];\n if (condition.exists !== undefined) return (value !== undefined) === condition.exists;\n if ('eq' in condition) return Object.is(value, condition.eq);\n if ('neq' in condition) return !Object.is(value, condition.neq);\n return Boolean(value) === (condition.truthy ?? true);\n };\n}\n\n/** `parameters.controls.matchers`: arg names that pick a control when the arg's argType names none. */\nexport interface ControlMatchers {\n color?: RegExp;\n /** labkit has no date leaf, so a date match keeps the leaf its value infers. */\n date?: RegExp;\n}\n\n/** Storybook's rule: a string arg with no control or options whose name matches `color` gets a color picker. */\nfunction matched(key: string, value: unknown, argType: ArgType | undefined, matchers: ControlMatchers): Leaf | null {\n if (typeof value !== 'string' || argType?.control !== undefined || stringOptions(argType ?? {})) return null;\n return matchers.color?.test(key) ? f.color(value) : null;\n}\n\n/** A labkit schema for a CSF story's args, refined by its `argTypes`. */\nexport function argsToSchema(\n args: Readonly<Record<string, unknown>>,\n argTypes: Readonly<Record<string, ArgType | undefined>>,\n matchers: ControlMatchers = {},\n): ConfigSchema<unknown> {\n const nodes: Record<string, Leaf> = {};\n for (const key of new Set([...Object.keys(args), ...Object.keys(argTypes)])) {\n const has = key in args;\n // A control carries only what crosses the port; the frame puts the rest back from `args` (`withUnsent`).\n const part = has ? portSafePart(args[key]) : null;\n if (has && !part) continue;\n const value = part?.value;\n const argType = argTypes[key];\n const control = argType ? controlOf(argType) : false;\n\n let node: Leaf | null =\n (has ? matched(key, value, argType, matchers) : null) ??\n (control ? controlled(control, argType ?? {}, has, value) : has ? inferred(value) : null);\n if (!node) continue;\n if (argType && (argType.control === false || argType.table?.disable)) node = node.hidden();\n if (argType?.description) node = node.describe(argType.description);\n if (argType?.name) node = node.label(argType.name);\n const shownWhen = argType?.if ? conditionOf(argType.if) : null;\n if (shownWhen) node = node.showIf(shownWhen);\n nodes[key] = node;\n }\n return f.schema(nodes as ConfigShape);\n}\n","import {\n type ComponentType,\n createContext,\n createElement,\n type Dispatch,\n type ReactNode,\n type SetStateAction,\n useContext,\n useEffect,\n useState,\n} from 'react';\nimport type { Globals, Layout, Viewport } from '../protocol/messages';\nimport { storyId, storyNameFromExport } from '../story/ids';\nimport type { Decorator, LoadedStory, PlayContext, StoryContext } from '../story/types';\nimport { type ArgsScope, ArgsContext, appliedLocal, coverOf, type LocalArgs } from './argsContext';\nimport { type ArgType, argsToSchema, type ControlMatchers } from './argsToSchema';\nimport { isPlainObject } from './isPlainObject';\nimport { withUnsent } from './portSafe';\n\ntype Args = Record<string, unknown>;\ntype CsfContext = {\n args: Args;\n globals: Globals;\n parameters: Record<string, unknown>;\n title: string;\n name: string;\n id: string;\n viewMode: 'story';\n};\ntype CsfRender = (args: Args, context: CsfContext) => ReactNode;\ntype CsfDecorator = (Story: ComponentType, context: CsfContext) => ReactNode;\ntype CsfPlay = (context: CsfContext & { canvasElement: HTMLElement; step: CsfStep }) => void | Promise<void>;\ntype CsfStep = (label: string, fn: () => void | Promise<void>) => Promise<void>;\n\ninterface Annotations {\n title?: string;\n name?: string;\n storyName?: string;\n component?: ComponentType<Args>;\n args?: Args;\n argTypes?: Record<string, ArgType>;\n parameters?: Record<string, unknown>;\n globals?: Record<string, unknown>;\n decorators?: CsfDecorator | CsfDecorator[];\n render?: CsfRender;\n play?: CsfPlay;\n includeStories?: string[] | RegExp;\n excludeStories?: string[] | RegExp;\n}\n\nconst LAYOUTS: readonly Layout[] = ['centered', 'padded', 'fullscreen'];\n\nconst asArray = <T,>(value: T | T[] | undefined): T[] => (value === undefined ? [] : Array.isArray(value) ? value : [value]);\n\n/** Storybook's `deleteUndefined`, which its args store applies after every update. */\nconst withoutUndefined = (args: Args): Args =>\n Object.fromEntries(Object.entries(args).filter(([, value]) => value !== undefined));\n\n/** Storybook's `matches` from `isExportStory`. */\nconst matches = (key: string, filter: string[] | RegExp) =>\n Array.isArray(filter) ? filter.includes(key) : key.match(filter) !== null;\n\n/** Storybook's `combineParameters`: plain objects merge deeply, anything else is replaced. */\nfunction combineParameters(...sources: (Record<string, unknown> | undefined)[]): Record<string, unknown> {\n const out: Record<string, unknown> = {};\n for (const source of sources) {\n for (const [key, value] of Object.entries(source ?? {})) {\n if (value === undefined) continue;\n out[key] = isPlainObject(value) && isPlainObject(out[key]) ? combineParameters(out[key], value) : value;\n }\n }\n return out;\n}\n\nfunction resolveViewport(parameters: Record<string, unknown>, globals: Record<string, unknown>): Viewport | null {\n const selected = globals.viewport as { value?: string; isRotated?: boolean } | undefined;\n const options = (parameters.viewport as { options?: Record<string, { styles?: { width?: string; height?: string } }> } | undefined)\n ?.options;\n const styles = selected?.value ? options?.[selected.value]?.styles : undefined;\n const px = (v: string | undefined) => (v && /^\\d+(\\.\\d+)?px$/.test(v) ? Number.parseFloat(v) : Number.NaN);\n const width = px(styles?.width);\n const height = px(styles?.height);\n if (Number.isNaN(width) || Number.isNaN(height)) return null;\n return selected?.isRotated ? { width: height, height: width } : { width, height };\n}\n\nconst InnerStory = createContext<(() => ReactNode) | null>(null);\n\nfunction Story(): ReactNode {\n return useContext(InnerStory)?.() ?? null;\n}\n\nfunction Call({ fn }: { fn: () => ReactNode }): ReactNode {\n return fn();\n}\n\ninterface StoryLocals {\n story: string;\n local: LocalArgs;\n setLocal: Dispatch<SetStateAction<LocalArgs>>;\n}\n\nconst LocalArgsContext = createContext<StoryLocals | null>(null);\n\n/** The outermost scope of a story holds its frame-local args, so its decorators and render share them. */\nfunction Scoped({\n id,\n build,\n fn,\n}: {\n id: string;\n build: (local: StoryLocals) => [ArgsScope, CsfContext];\n fn: (context: CsfContext) => ReactNode;\n}): ReactNode {\n const outer = useContext(LocalArgsContext);\n const [local, setLocal] = useState<LocalArgs>({});\n const shared = outer?.story === id ? outer : { story: id, local, setLocal };\n const [scope, context] = build(shared);\n const { config } = scope;\n const prune = shared.setLocal;\n // An entry config has moved past must not come back if config later returns to the value it covered.\n useEffect(() => {\n prune((prev) => {\n const kept = Object.entries(prev).filter(([key, entry]) => coverOf(config[key]) === entry.over);\n return kept.length === Object.keys(prev).length ? prev : Object.fromEntries(kept);\n });\n }, [config, prune]);\n return createElement(\n LocalArgsContext.Provider,\n { value: shared },\n createElement(ArgsContext.Provider, { value: scope }, createElement(Call, { fn: () => fn(context) })),\n );\n}\n\n/**\n * Normalizes a Component Story Format module. `autoTitle` titles the stories when the meta names no title;\n * `parameters` are the project's, under the meta's and each story's.\n */\nexport function loadCsfModule(\n mod: Record<string, unknown>,\n autoTitle: string,\n projectParameters: Record<string, unknown> = {},\n): LoadedStory[] {\n const meta = (isPlainObject(mod.default) ? mod.default : {}) as Annotations;\n const title = meta.title ?? autoTitle;\n const stories: LoadedStory[] = [];\n\n for (const [exportName, value] of Object.entries(mod)) {\n if (exportName === 'default' || exportName === '__namedExportsOrder' || exportName === '__esModule') continue;\n if (meta.includeStories && !matches(exportName, meta.includeStories)) continue;\n if (meta.excludeStories && matches(exportName, meta.excludeStories)) continue;\n if (!value || (typeof value !== 'object' && typeof value !== 'function')) continue;\n\n // A CSF 2 function export hoists its annotations onto itself.\n const spec: Annotations = typeof value === 'function' ? { ...value, render: value as CsfRender } : (value as Annotations);\n const id = storyId(title, exportName);\n const name = spec.name || spec.storyName || storyNameFromExport(exportName);\n const args = { ...meta.args, ...spec.args };\n const parameters = combineParameters(projectParameters, meta.parameters, spec.parameters);\n const matchers = (parameters.controls as { matchers?: ControlMatchers } | undefined)?.matchers;\n const config = argsToSchema(\n args,\n combineParameters(meta.argTypes, spec.argTypes) as Record<string, ArgType>,\n isPlainObject(matchers) ? matchers : {},\n );\n const defaults = config.defaults() as Args;\n const storyGlobals = { ...meta.globals, ...spec.globals };\n const component = meta.component;\n const renderFn: CsfRender | undefined =\n spec.render ?? meta.render ?? (component ? (a) => createElement(component, a) : undefined);\n\n const withArgs = (config: Args): Args =>\n Object.fromEntries(\n Object.entries(withoutUndefined(config)).map(([key, value]) => [key, key in args ? withUnsent(value, args[key]) : value]),\n );\n const csfContext = (config: unknown, globals: Globals, local: LocalArgs = {}): CsfContext => ({\n args: withoutUndefined({ ...args, ...withArgs(config as Args), ...appliedLocal(local, config as Args) }),\n globals,\n parameters,\n title,\n name,\n id,\n viewMode: 'story',\n });\n const scoped = (ctx: StoryContext, fn: (context: CsfContext) => ReactNode): ReactNode =>\n createElement(Scoped, {\n id,\n build: ({ local, setLocal }: StoryLocals): [ArgsScope, CsfContext] => {\n const context = csfContext(ctx.config, ctx.globals, local);\n const scope: ArgsScope = {\n args: context.args,\n config: ctx.config as Args,\n defaults,\n original: args,\n setConfig: ctx.setConfig,\n setLocal,\n };\n return [scope, context];\n },\n fn,\n });\n\n const adapt =\n (decorator: CsfDecorator): Decorator =>\n (inner, ctx) =>\n createElement(\n InnerStory.Provider,\n { value: inner },\n scoped(ctx, (context) => decorator(Story, context)),\n );\n\n const layout = parameters.layout as Layout | undefined;\n const isolate = (parameters.forge as { isolate?: unknown } | undefined)?.isolate;\n const play = spec.play ?? meta.play;\n\n stories.push({\n id,\n title,\n name,\n exportName,\n config,\n initialState: null,\n render: (ctx) => {\n if (!renderFn) return null;\n return scoped(ctx, (context) => renderFn(context.args, context));\n },\n decorators: [...asArray(spec.decorators), ...asArray(meta.decorators)].map(adapt),\n layout: layout && LAYOUTS.includes(layout) ? layout : 'padded',\n viewport: resolveViewport(parameters, storyGlobals),\n isolate: typeof isolate === 'string' ? isolate : null,\n play: play\n ? ({ canvasElement, config, globals }: PlayContext) =>\n play({ ...csfContext(config, globals), canvasElement, step: async (_label, fn) => fn() })\n : null,\n });\n }\n return stories;\n}\n","import { f } from '@weasel-js/labkit/config';\nimport { isNative } from './define';\nimport { storyId, storyNameFromExport } from './ids';\nimport type { LoadedStory, MetaSpec, StorySpec } from './types';\n\n/** Normalizes a module written with `meta` and `story`; exports that are not stories are skipped. */\n/** `autoTitle` titles the stories when the meta names no title. */\nexport function loadNativeModule(mod: Record<string, unknown>, autoTitle: string): LoadedStory[] {\n const metaSpec: MetaSpec = isNative(mod.default, 'meta') ? (mod.default as MetaSpec) : {};\n const title = metaSpec.title ?? autoTitle;\n const stories: LoadedStory[] = [];\n for (const [exportName, value] of Object.entries(mod)) {\n if (exportName === 'default' || !isNative(value, 'story')) continue;\n const spec = value as StorySpec<unknown, unknown>;\n stories.push({\n id: storyId(title, exportName),\n title,\n name: spec.name ?? storyNameFromExport(exportName),\n exportName,\n config: spec.config ?? f.schema({}),\n initialState: spec.state ?? null,\n render: spec.render,\n decorators: [...(spec.decorators ?? []), ...(metaSpec.decorators ?? [])],\n layout: spec.layout ?? metaSpec.layout ?? 'centered',\n viewport: spec.viewport ?? null,\n isolate: spec.isolate ?? metaSpec.isolate ?? null,\n play: spec.play ?? null,\n });\n }\n return stories;\n}\n","import { loadCsfModule } from '../csf/loadCsfModule';\nimport { isNative } from './define';\nimport { loadNativeModule } from './native';\nimport type { IndexRender, LoadedStory } from './types';\n\n/**\n * A story module's stories: a module whose default export is a forge `meta` is native, anything else is CSF under\n * `parameters`. `autoTitle` titles the stories when the meta names no title.\n */\nexport function loadStories(\n mod: Record<string, unknown>,\n autoTitle: string,\n parameters?: Record<string, unknown>,\n): LoadedStory[] {\n return isNative(mod.default, 'meta')\n ? loadNativeModule(mod, autoTitle)\n : loadCsfModule(mod, autoTitle, parameters);\n}\n\n/** A module's own index page: a native meta's `index`, or a CSF meta's `parameters.forge.index`. */\nexport function indexRenderOf(mod: Record<string, unknown>): IndexRender | null {\n const meta = mod.default as { index?: unknown; parameters?: { forge?: { index?: unknown } } } | undefined;\n const render = isNative(meta, 'meta') ? meta?.index : meta?.parameters?.forge?.index;\n return typeof render === 'function' ? (render as IndexRender) : null;\n}\n"]}
|
|
@@ -13,6 +13,11 @@ interface GlobalDeclaration {
|
|
|
13
13
|
default: string;
|
|
14
14
|
/** Another global's key: the toolbar shows this one in a popover beside that one rather than in the bar itself. */
|
|
15
15
|
under?: string;
|
|
16
|
+
/**
|
|
17
|
+
* Whether the toolbar offers `value` given the lab's other values; every option shows when absent. `globals` is
|
|
18
|
+
* resolved without any declaration's `shows`, so one `shows` cannot depend on another's outcome.
|
|
19
|
+
*/
|
|
20
|
+
shows?: (value: string, globals: Globals) => boolean;
|
|
16
21
|
}
|
|
17
22
|
type GlobalDeclarations = Readonly<Record<string, GlobalDeclaration>>;
|
|
18
23
|
|
package/dist/csf/preview-api.js
CHANGED
package/dist/frame/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { describeSchema, openChannel, isIndexId, indexId, answerSchema, IndexPage } from '../chunk-
|
|
2
|
-
import { createOverrides, createGlobalsTarget, loadStories, indexRenderOf, scanCssVars, runAxe, captureElement, StoryHost, resolveCssVar } from '../chunk-
|
|
1
|
+
import { describeSchema, openChannel, isIndexId, indexId, answerSchema, IndexPage } from '../chunk-CSAXZIMV.js';
|
|
2
|
+
import { createOverrides, createGlobalsTarget, loadStories, indexRenderOf, scanCssVars, runAxe, captureElement, StoryHost, resolveCssVar } from '../chunk-OLWZURU3.js';
|
|
3
3
|
import '../chunk-2GXKNXTJ.js';
|
|
4
4
|
import '../chunk-HRGPFQBW.js';
|
|
5
|
-
import { FRAME_HELLO, stableStringify, PORT_HANDOFF } from '../chunk-
|
|
5
|
+
import { FRAME_HELLO, stableStringify, PORT_HANDOFF } from '../chunk-JXIWZFD4.js';
|
|
6
6
|
import { flushSync } from 'react-dom';
|
|
7
7
|
import { createRoot } from 'react-dom/client';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export { f } from '@weasel-js/labkit/config';
|
|
2
|
-
export { G as GlobalDeclaration, a as GlobalDeclarations, S as ShellConfig, d as defineFrameConfig, b as defineShellConfig } from './config-
|
|
2
|
+
export { G as GlobalDeclaration, a as GlobalDeclarations, S as ShellConfig, d as defineFrameConfig, b as defineShellConfig } from './config-C5Vq5Kjj.js';
|
|
3
3
|
import { ComponentType, ReactNode } from 'react';
|
|
4
4
|
import { G as Globals, M as MetaSpec, S as StorySpec } from './FrameController-BspC9Zr5.js';
|
|
5
5
|
export { A as A11yFinding, a as A11yNode, b as A11yReport, D as Decorator, F as FrameSetup, c as GlobalsTarget, I as IndexContext, d as IndexRender, e as IndexStoryProps, L as LoadedStory, P as PlayContext, f as StoryContext } from './FrameController-BspC9Zr5.js';
|
package/dist/shell/index.d.ts
CHANGED
|
@@ -1,15 +1,14 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as react from 'react';
|
|
2
|
+
import { RefObject, ReactNode } from 'react';
|
|
2
3
|
import { LabContribution, StorageAdapter, RenderContext, InstrumentList } from '@weasel-js/labkit';
|
|
3
4
|
import { FrameImporters } from '../frame/index.js';
|
|
4
5
|
import { g as IndexEntry, F as FrameSetup, L as LoadedStory, h as Layout, G as Globals, i as FromFrame, b as A11yReport, T as ToFrame, C as CssVarReport, j as CapturedPicture, V as Viewport } from '../FrameController-BspC9Zr5.js';
|
|
5
|
-
import { S as ShellConfig, a as GlobalDeclarations } from '../config-
|
|
6
|
-
import * as react from 'react';
|
|
7
|
-
import { RefObject, ReactNode } from 'react';
|
|
6
|
+
import { S as ShellConfig, a as GlobalDeclarations } from '../config-C5Vq5Kjj.js';
|
|
8
7
|
import '@weasel-js/labkit/config';
|
|
9
8
|
import '@weasel-js/theme';
|
|
10
9
|
|
|
11
10
|
/** What axe found in the story of the trial this is rendered inside, re-run on demand. */
|
|
12
|
-
declare function A11yPanel():
|
|
11
|
+
declare function A11yPanel(): react.JSX.Element;
|
|
13
12
|
declare const A11Y_SECTION: LabContribution;
|
|
14
13
|
|
|
15
14
|
/** Story files edited while the workshop runs, for the registry to load again. */
|
|
@@ -34,7 +33,7 @@ interface WorkshopProps {
|
|
|
34
33
|
storageKey?: string;
|
|
35
34
|
storage?: StorageAdapter;
|
|
36
35
|
}
|
|
37
|
-
declare function Workshop({ index, frameUrl, importers, setup, changes, config, stories, storageKey, storage }: WorkshopProps):
|
|
36
|
+
declare function Workshop({ index, frameUrl, importers, setup, changes, config, stories, storageKey, storage }: WorkshopProps): react.JSX.Element;
|
|
38
37
|
|
|
39
38
|
interface MountWorkshopOptions extends WorkshopProps {
|
|
40
39
|
/** Default: the document's `#root`. */
|
|
@@ -65,7 +64,7 @@ interface StoryTrialProps {
|
|
|
65
64
|
onError?: (error: unknown) => void;
|
|
66
65
|
}
|
|
67
66
|
/** A story rendered in the workshop document, inside a `TrialHost`, from the trial's own config and state. */
|
|
68
|
-
declare function StoryTrial({ story, setup, ctx, hostRef, onRendered, onError }: StoryTrialProps):
|
|
67
|
+
declare function StoryTrial({ story, setup, ctx, hostRef, onRendered, onError }: StoryTrialProps): react.JSX.Element;
|
|
69
68
|
|
|
70
69
|
interface TrialHostProps {
|
|
71
70
|
layout: Layout;
|
|
@@ -84,7 +83,7 @@ interface TrialHostProps {
|
|
|
84
83
|
* itself, keeps its CSS variable overrides on itself, contains fixed-position descendants and portals, reports its
|
|
85
84
|
* vars, size and audits to the trial's frame registry, and unmounts its content while out of view.
|
|
86
85
|
*/
|
|
87
|
-
declare function TrialHost({ layout, setup, config, children, hostRef, onRendered }: TrialHostProps):
|
|
86
|
+
declare function TrialHost({ layout, setup, config, children, hostRef, onRendered }: TrialHostProps): react.JSX.Element;
|
|
88
87
|
|
|
89
88
|
type Ready = Extract<FromFrame, {
|
|
90
89
|
type: 'ready';
|
package/dist/shell/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { isIndexId, indexId, indexEntries, schemaFromDescription, openChannel, IndexPage } from '../chunk-
|
|
2
|
-
import { useTrialFrame, createTrialFrames, labGlobals, StoryGlobalsContext, TrialFramesContext, withGlobals, StoryTrial, storyConfig, GLOBALS_KEY, effectiveGlobals, useCssOverrides, TrialHost, isGlobalsPath } from '../chunk-
|
|
3
|
-
export { StoryGlobalsContext, StoryTrial, TrialFramesContext, TrialHost, useTrialFrame } from '../chunk-
|
|
4
|
-
import { loadStories, indexRenderOf } from '../chunk-
|
|
1
|
+
import { isIndexId, indexId, indexEntries, schemaFromDescription, openChannel, IndexPage } from '../chunk-CSAXZIMV.js';
|
|
2
|
+
import { useTrialFrame, createTrialFrames, labGlobals, StoryGlobalsContext, TrialFramesContext, withGlobals, StoryTrial, storyConfig, GLOBALS_KEY, effectiveGlobals, useCssOverrides, TrialHost, shownOptions, isGlobalsPath } from '../chunk-DIOLWCH7.js';
|
|
3
|
+
export { StoryGlobalsContext, StoryTrial, TrialFramesContext, TrialHost, useTrialFrame } from '../chunk-DIOLWCH7.js';
|
|
4
|
+
import { loadStories, indexRenderOf } from '../chunk-OLWZURU3.js';
|
|
5
5
|
import '../chunk-2GXKNXTJ.js';
|
|
6
6
|
import '../chunk-HRGPFQBW.js';
|
|
7
|
-
import { stableStringify, PORT_HANDOFF, FRAME_HELLO, PROTOCOL_VERSION } from '../chunk-
|
|
7
|
+
import { stableStringify, PORT_HANDOFF, FRAME_HELLO, PROTOCOL_VERSION } from '../chunk-JXIWZFD4.js';
|
|
8
8
|
import { useTrialId, Button, Lab, useLabContext, TrialIdContext, usePersistedState, Select, inferTokenType, ToggleBar as ToggleBar$1, Input, TokenPanel, refitScale } from '@weasel-js/labkit';
|
|
9
9
|
import { createContext, useState, useRef, useEffect, useCallback, useMemo, useLayoutEffect, useId, useContext } from 'react';
|
|
10
10
|
import { jsxs, jsx, Fragment } from 'react/jsx-runtime';
|
|
@@ -745,7 +745,7 @@ function GlobalSelect({ name, declaration, values, set, labeled = false }) {
|
|
|
745
745
|
width: labeled ? "fill" : "fit",
|
|
746
746
|
selectedKey: String(values[name]),
|
|
747
747
|
onSelectionChange: (value) => set(name, value),
|
|
748
|
-
options: declaration
|
|
748
|
+
options: shownOptions(declaration, values)
|
|
749
749
|
}
|
|
750
750
|
);
|
|
751
751
|
}
|