@weasel-js/forge 1.11.1 → 1.13.0-rc.0
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/README.md +110 -5
- package/dist/{FrameController-Cj_i-Rdk.d.ts → FrameController-Tv3jrHyT.d.ts} +3 -3
- package/dist/{chunk-JTCUIJPZ.js → chunk-35DOPXHZ.js} +119 -10
- package/dist/chunk-35DOPXHZ.js.map +1 -0
- package/dist/{chunk-7BQPHMA2.js → chunk-3BAM6M26.js} +2 -2
- package/dist/chunk-3BAM6M26.js.map +1 -0
- package/dist/{chunk-ZAWXMUGZ.js → chunk-5WS67HMU.js} +8 -3
- package/dist/chunk-5WS67HMU.js.map +1 -0
- package/dist/{chunk-BKPDKUDN.js → chunk-BUXUWAI4.js} +45 -60
- package/dist/chunk-BUXUWAI4.js.map +1 -0
- package/dist/chunk-ORMMZ5PV.js +59 -0
- package/dist/chunk-ORMMZ5PV.js.map +1 -0
- package/dist/chunk-RKQ277P5.js +501 -0
- package/dist/chunk-RKQ277P5.js.map +1 -0
- package/dist/chunk-STF6NQ5N.js +60 -0
- package/dist/chunk-STF6NQ5N.js.map +1 -0
- package/dist/chunk-VUPN73JP.js +16 -0
- package/dist/chunk-VUPN73JP.js.map +1 -0
- package/dist/{config-DN6IaNf6.d.ts → config-Bd6FVlh7.d.ts} +22 -5
- package/dist/frame/index.css +37 -0
- package/dist/frame/index.css.map +1 -1
- package/dist/frame/index.d.ts +62 -29
- package/dist/frame/index.js +138 -8
- package/dist/frame/index.js.map +1 -1
- package/dist/index.d.ts +28 -5
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/mountFrame-FdJDb3TB.d.ts +35 -0
- package/dist/shell/index.css +147 -2
- package/dist/shell/index.css.map +1 -1
- package/dist/shell/index.d.ts +44 -8
- package/dist/shell/index.js +1614 -277
- package/dist/shell/index.js.map +1 -1
- package/dist/test/index.css +58 -0
- package/dist/test/index.css.map +1 -0
- package/dist/test/index.d.ts +1 -1
- package/dist/test/index.js +4 -4
- package/dist/vite/index.js +571 -121
- package/dist/vite/index.js.map +1 -1
- package/package.json +13 -8
- package/dist/chunk-5DXUNLV2.js +0 -6
- package/dist/chunk-5DXUNLV2.js.map +0 -1
- package/dist/chunk-7BQPHMA2.js.map +0 -1
- package/dist/chunk-BKPDKUDN.js.map +0 -1
- package/dist/chunk-FZNABWJC.js +0 -282
- package/dist/chunk-FZNABWJC.js.map +0 -1
- package/dist/chunk-JTCUIJPZ.js.map +0 -1
- package/dist/chunk-WEQSLPKT.js +0 -9
- package/dist/chunk-WEQSLPKT.js.map +0 -1
- package/dist/chunk-ZAWXMUGZ.js.map +0 -1
package/dist/frame/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/frame/FrameController.tsx","../../src/frame/index/startIndex.tsx","../../src/frame/mountFrame.tsx"],"names":["jsx","flushSync","id","stories","story"],"mappings":";;;;;;;;;;;;AAmDA,IAAM,cAAA,GAAiB,GAAA;AAEvB,SAAS,KAAA,CAAM,KAAA,EAAmB,KAAA,EAAgB,GAAA,EAAyB;AACzE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,OAAA;AAAA,IACN,KAAA;AAAA,IACA,SAAS,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AAAA,IAC9D,GAAI,KAAA,YAAiB,KAAA,IAAS,KAAA,CAAM,KAAA,GAAQ,EAAE,KAAA,EAAO,KAAA,CAAM,KAAA,EAAM,GAAI,EAAC;AAAA,IACtE,GAAI,GAAA,KAAQ,MAAA,GAAY,EAAC,GAAI,EAAE,GAAA;AAAI,GACrC;AACF;AAGO,SAAS,UAAA,CAAW,EAAE,KAAA,EAAO,OAAA,EAAS,WAAW,KAAA,GAAQ,IAAG,EAAkC;AACnG,EAAA,MAAM,EAAE,MAAK,GAAI,OAAA;AACjB,EAAA,IAAA,CAAK,EAAE,IAAA,EAAM,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,IAAA,iBAAA,CAAkB,SAAS,KAAK,CAAA;AAAA,EAClC;AACF","file":"index.js","sourcesContent":["import { flushSync } from 'react-dom';\nimport type { IconTable } from '@weasel-js/icons';\nimport { createKitRoot } from '../kitIcons';\nimport type { Channel } from '../protocol/channel';\nimport {\n type CssVarReport,\n type FaultPhase,\n type FromFrame,\n type Globals,\n stableStringify,\n type ToFrame,\n} from '../protocol/messages';\nimport { answerSchema, describeSchema } from '../protocol/schema';\nimport type { Decorator, LoadedStory, StoryContext } from '../story/types';\nimport { auditElement } from './a11y';\nimport { createA11yHighlighter } from './a11yHighlight';\nimport { createOverrides, resolveCssVar, scanCssVars } from './cssVars';\nimport { createGlobalsTarget, type GlobalsTarget } from './globalsTarget';\nimport { StoryHost } from './StoryHost';\n\n/** The frame config: what `defineFrameConfig` returns and the `frameConfig` module default-exports. */\nexport interface FrameSetup {\n /** Wraps every story, outermost; receives the globals. From the frame config (`frameConfig`). */\n decorators?: Decorator[];\n /** Applies globals to a target: theme mode, fonts. The target is a frame document's root, or one story's host in\n * the workshop document, so a rule the setup writes goes through `target.style` under `target.scope`. */\n applyGlobals?: (globals: Globals, target: GlobalsTarget) => void;\n /**\n * The elements a CSS variable override is declared on; `:root` by default. An override has to be declared on\n * whichever element declares the token itself — a theme wrapper, say — or that element's own value wins.\n */\n cssVarsScope?: string;\n /** Project-wide CSF parameters, Storybook's preview `parameters`: under each meta's and story's. */\n parameters?: Record<string, unknown>;\n /**\n * Awaited once a story is loaded and before it first renders — the place to import what only some stories\n * need, so the rest never load it.\n */\n prepare?: (story: LoadedStory) => void | Promise<void>;\n /** Icon tables registered beside the kit's in every frame: an app's own, for its stories' glyphs. */\n icons?: readonly IconTable[];\n}\n\n/** Inputs to `startFrame`: the story, the channel to the shell, and the element to render into. */\nexport interface StartFrameOptions {\n story: LoadedStory;\n channel: Channel<ToFrame, FromFrame>;\n container: HTMLElement;\n setup?: FrameSetup;\n}\n\nconst VARS_SETTLE_MS = 100;\n\nfunction fault(phase: FaultPhase, error: unknown, seq?: number): FromFrame {\n return {\n type: 'fault',\n phase,\n message: error instanceof Error ? error.message : String(error),\n ...(error instanceof Error && error.stack ? { stack: error.stack } : {}),\n ...(seq === undefined ? {} : { seq }),\n };\n}\n\n/** Sends `ready`, then renders the story on `init` and keeps it in step. Returns a stop function. */\nexport function startFrame({ story, channel, container, setup = {} }: StartFrameOptions): () => void {\n const { send } = channel;\n send({ type: 'ready', schema: describeSchema(story.config), layout: story.layout, viewport: story.viewport });\n\n const wrapper = document.createElement('div');\n wrapper.className = `fg-frame fg-frame--${story.layout}`;\n container.append(wrapper);\n const root = createKitRoot(wrapper, setup.icons);\n const decorators = setup.decorators ?? [];\n\n let initialized = false;\n let rendered = false;\n let config: unknown;\n let state: unknown = null;\n let globals: Globals = {};\n let answeredKey: string | null = null;\n let resetKey = 0;\n let seq = 0;\n\n const overrides = createOverrides(document, setup.cssVarsScope);\n const globalsTarget = createGlobalsTarget(document.documentElement, ':root');\n const highlighter = createA11yHighlighter(document);\n let lastVars: CssVarReport[] | null = null;\n let reported: string | null = null;\n const publishVars = (vars: CssVarReport[]) => {\n lastVars = vars;\n const key = JSON.stringify(vars);\n if (key === reported) return;\n reported = key;\n send({ type: 'vars', vars });\n };\n const reportVars = () => publishVars(scanCssVars(document, overrides.has));\n const ownMutation = (record: MutationRecord) =>\n overrides.owns(record.target) ||\n (record.type === 'childList' &&\n [...record.addedNodes, ...record.removedNodes].length > 0 &&\n [...record.addedNodes, ...record.removedNodes].every(overrides.owns));\n let settleTimer: ReturnType<typeof setTimeout> | undefined;\n const mutations =\n typeof MutationObserver === 'undefined'\n ? null\n : new MutationObserver((records) => {\n if (records.every(ownMutation)) return;\n clearTimeout(settleTimer);\n settleTimer = setTimeout(reportVars, VARS_SETTLE_MS);\n });\n // Every attribute, not just style and class: a stylesheet can select on any of them, `[data-wzl-mode]` included.\n mutations?.observe(document.documentElement, { subtree: true, childList: true, characterData: true, attributes: true });\n\n const setConfig = (path: string, value: unknown) => send({ type: 'setConfig', path, value });\n const setState = (next: unknown) => {\n state = typeof next === 'function' ? (next as (prev: unknown) => unknown)(state) : next;\n send({ type: 'setState', state });\n render();\n };\n\n const render = () => {\n const ctx: StoryContext = { config, setConfig, state, setState, globals, title: story.title, name: story.name };\n const at = seq;\n root.render(\n <StoryHost\n story={story}\n ctx={ctx}\n decorators={decorators}\n resetKey={resetKey}\n onError={(error) => send(fault('render', error, at))}\n />,\n );\n const key = stableStringify(config);\n if (key !== answeredKey) {\n answeredKey = key;\n send({ type: 'answers', answers: { configKey: key, ...answerSchema(story.config, config) } });\n }\n };\n\n // Input from the trial commits synchronously, so `rendered` and the vars report describe the story it produced. A\n // throw while applying it faults like a render would; otherwise the trial would wait on a frame that never answers.\n const input = (apply: () => void) => {\n seq += 1;\n try {\n apply();\n if (!initialized) return;\n resetKey += 1;\n flushSync(render);\n } catch (error) {\n send(fault('render', error, seq));\n return;\n }\n if (!rendered) {\n rendered = true;\n announceRendered();\n }\n reportVars();\n };\n\n /**\n * The shell unhides the frame on `rendered` and fades it in, so a webfont\n * swapping in after that message reads as the story gliding. Waiting for the\n * fonts and then one painted frame means the story the shell reveals is the\n * settled one.\n *\n * `document.fonts` is absent in jsdom, so the message stays synchronous\n * there; the deferral is only exercised in a browser.\n */\n const announceRendered = () => {\n const { fonts } = document;\n if (!fonts) {\n send({ type: 'rendered' });\n return;\n }\n const afterPaint = () => requestAnimationFrame(() => send({ type: 'rendered' }));\n void fonts.ready.then(afterPaint, afterPaint);\n };\n\n const audit = async (id: string) => send({ type: 'a11y', id, ...(await auditElement(wrapper)) });\n\n const off = channel.on((msg) => {\n switch (msg.type) {\n case 'init':\n input(() => {\n initialized = true;\n config = msg.config;\n globals = msg.globals;\n state = msg.state;\n if (state === null && story.initialState) {\n state = story.initialState(config);\n send({ type: 'setState', state });\n }\n setup.applyGlobals?.(globals, globalsTarget);\n });\n break;\n case 'config':\n input(() => {\n config = msg.config;\n });\n break;\n case 'state':\n input(() => {\n state = msg.state;\n });\n break;\n case 'globals':\n input(() => {\n globals = msg.globals;\n setup.applyGlobals?.(globals, globalsTarget);\n });\n break;\n case 'vars.set': {\n overrides.set(msg.name, msg.value);\n const at = lastVars?.findIndex((v) => v.name === msg.name) ?? -1;\n if (!lastVars || at < 0) break;\n const vars = lastVars.slice();\n vars[at] = { ...vars[at]!, value: resolveCssVar(document, msg.name), overridden: overrides.has(msg.name) };\n publishVars(vars);\n break;\n }\n case 'a11y.run':\n void audit(msg.id);\n break;\n case 'a11y.highlight':\n highlighter.show(msg.targets);\n break;\n }\n });\n\n return () => {\n off();\n mutations?.disconnect();\n clearTimeout(settleTimer);\n overrides.dispose();\n globalsTarget.dispose();\n highlighter.dispose();\n root.unmount();\n wrapper.remove();\n };\n}\n\n/** Reports an import failure — there is no story to start. */\nexport function reportImportFault(channel: Channel<ToFrame, FromFrame>, error: unknown): void {\n channel.send(fault('import', error));\n}\n","import { f } from '@weasel-js/labkit/config';\nimport { Component, type ReactNode } from 'react';\nimport { flushSync } from 'react-dom';\nimport { createKitRoot } from '../../kitIcons';\nimport type { Channel } from '../../protocol/channel';\nimport type { FromFrame, Globals, ToFrame } from '../../protocol/messages';\nimport { describeSchema } from '../../protocol/schema';\nimport type { IndexRender, LoadedStory } from '../../story/types';\nimport { runAxe } from '../a11y';\nimport type { FrameSetup } from '../FrameController';\nimport { createGlobalsTarget } from '../globalsTarget';\nimport { type IndexEnv, IndexPage } from './IndexPage';\n\nexport interface StartIndexOptions {\n title: string;\n /** The package the component ships in. */\n library?: string;\n description?: string;\n /** Whether the component is a gallery. */\n gallery?: boolean;\n /** The ids of the stories tagged `gallery`. */\n galleries?: readonly string[];\n /** In file order. */\n stories: readonly LoadedStory[];\n descriptions: Readonly<Record<string, string>>;\n /** The component's own page; null for the generated one. */\n render: IndexRender | null;\n channel: Channel<ToFrame, FromFrame>;\n container: HTMLElement;\n setup?: FrameSetup;\n}\n\nconst message = (error: unknown): string => (error instanceof Error ? error.message : String(error));\n\n/** Faults the frame when the page itself throws. A single story's throw stays in its own cell. */\nclass PageBoundary extends Component<{ onError: (error: unknown) => void; children: ReactNode }, { failed: unknown }> {\n override state = { failed: null as unknown };\n\n static getDerivedStateFromError(error: unknown) {\n return { failed: error ?? new Error('Index page failed') };\n }\n\n override componentDidCatch(error: unknown): void {\n this.props.onError(error);\n }\n\n override render(): ReactNode {\n return this.state.failed ? null : this.props.children;\n }\n}\n\n/**\n * Sends `ready` for a page with no controls, then renders the component's index on `init` and follows the lab's\n * globals. Returns a stop function.\n */\nexport function startIndex(options: StartIndexOptions): () => void {\n const { channel, container, setup = {} } = options;\n const { send } = channel;\n send({ type: 'ready', schema: describeSchema(f.schema({})), layout: 'fullscreen', viewport: null });\n\n const wrapper = document.createElement('div');\n wrapper.className = 'fg-frame fg-frame--fullscreen';\n container.append(wrapper);\n const root = createKitRoot(wrapper, setup.icons);\n const globalsTarget = createGlobalsTarget(document.documentElement, ':root');\n let globals: Globals | null = null;\n let announced = false;\n\n const render = (): void => {\n if (!globals) return;\n const env: IndexEnv = {\n title: options.title,\n ...(options.library === undefined ? {} : { library: options.library }),\n ...(options.description === undefined ? {} : { description: options.description }),\n stories: options.stories,\n descriptions: options.descriptions,\n gallery: options.gallery ?? false,\n galleries: options.galleries ?? [],\n globals,\n decorators: setup.decorators ?? [],\n open: (id) => send({ type: 'open', id }),\n // A story that throws shows its error in its own cell; the rest of the page is still worth reading.\n onError: (error) => console.error(error),\n };\n root.render(\n <PageBoundary onError={(error) => send({ type: 'fault', phase: 'render', message: message(error) })}>\n <IndexPage env={env} render={options.render} />\n </PageBoundary>,\n );\n };\n\n const announce = (): void => {\n if (announced) return;\n announced = true;\n const { fonts } = document;\n if (!fonts) {\n send({ type: 'rendered' });\n return;\n }\n const afterPaint = () => requestAnimationFrame(() => send({ type: 'rendered' }));\n void fonts.ready.then(afterPaint, afterPaint);\n };\n\n const off = channel.on((msg) => {\n switch (msg.type) {\n case 'init':\n case 'globals':\n globals = msg.globals;\n setup.applyGlobals?.(globals, globalsTarget);\n flushSync(render);\n announce();\n break;\n case 'a11y.run':\n runAxe(wrapper).then(\n (report) => send({ type: 'a11y', id: msg.id, ok: true, report }),\n (error: unknown) => send({ type: 'a11y', id: msg.id, ok: false, message: message(error) }),\n );\n break;\n default:\n break;\n }\n });\n\n return () => {\n off();\n globalsTarget.dispose();\n root.unmount();\n wrapper.remove();\n };\n}\n","import { openChannel } from '../protocol/channel';\nimport { FRAME_HELLO, type FromFrame, PORT_HANDOFF, type ToFrame } from '../protocol/messages';\nimport { indexId, isIndexId } from '../story/indexPages';\nimport { TITLE_LIBRARIES } from '../story/library';\nimport { isGallery } from '../story/tags';\nimport { indexRenderOf, loadStories } from '../story/load';\nimport type { LoadedStory } from '../story/types';\nimport { type FrameSetup, reportImportFault, startFrame } from './FrameController';\nimport { startIndex } from './index/startIndex';\n\n/** Story modules by file path, each loaded on first use. */\nexport interface FrameImporters {\n [file: string]: () => Promise<Record<string, unknown>>;\n}\n\n/** One story as a frame document needs to find it, before its module is loaded. */\nexport interface FrameIndexEntry {\n id: string;\n /** The story's title as indexed, which titles the file's stories when its meta names none. */\n title: string;\n file: string;\n exportName: string;\n /** The JSDoc above the story's export, which its index page shows. */\n description?: string;\n /** The JSDoc above the file's meta, which heads the index page. */\n componentDescription?: string;\n /** The meta's `tags`. */\n tags?: readonly string[];\n}\n\n/** Inputs to `mountFrame`. `load` replaces the default module loader, `loadStories`. */\nexport interface MountFrameOptions {\n index: readonly FrameIndexEntry[];\n importers: FrameImporters;\n setup?: FrameSetup;\n load?: (mod: Record<string, unknown>, title: string, parameters?: Record<string, unknown>) => LoadedStory[];\n}\n\nexport { indexRenderOf, loadStories } from '../story/load';\n\nfunction waitForHandoff():Promise<{ port: MessagePort; id: string | null }> {\n return new Promise((resolve) => {\n const onMessage = (event: MessageEvent) => {\n const data = event.data as { type?: unknown; id?: unknown } | null;\n const port = event.ports[0];\n if (event.origin !== location.origin || event.source !== window.parent) return;\n if (typeof data !== 'object' || data === null || data.type !== PORT_HANDOFF || !port) return;\n window.removeEventListener('message', onMessage);\n resolve({ port, id: typeof data.id === 'string' ? data.id : null });\n };\n window.addEventListener('message', onMessage);\n });\n}\n\n/**\n * The frame document's entry: asks its parent for a port and shows what the handoff names, or, from a shell that\n * names nothing, what the hash does. The hash is read at once, so its module loads during the handshake.\n */\nexport async function mountFrame(options: MountFrameOptions): Promise<void> {\n const imports = new Map<string, Promise<Record<string, unknown>>>();\n const importOf = (file: string): Promise<Record<string, unknown>> => {\n let loading = imports.get(file);\n if (!loading) {\n const importer = options.importers[file];\n if (!importer) throw new Error(`No importer for ${file}`);\n loading = importer();\n imports.set(file, loading);\n }\n return loading;\n };\n /** The entries `id` shows: one story, or every story of the component an index id names. */\n const entriesOf = (id: string): FrameIndexEntry[] =>\n isIndexId(id)\n ? options.index.filter((e) => indexId(e.title) === id)\n : options.index.filter((e) => e.id === id);\n const early = location.hash.slice(1) || null;\n // Only starts the fetch; whoever awaits the import later sees its outcome.\n for (const file of new Set(early === null ? [] : entriesOf(early).map((e) => e.file))) {\n if (options.importers[file]) importOf(file).catch(() => {});\n }\n\n const handoff = waitForHandoff();\n window.parent.postMessage({ type: FRAME_HELLO }, location.origin);\n const { port, id: handed } = await handoff;\n const channel = openChannel<ToFrame, FromFrame>(port);\n const id = handed ?? early ?? '';\n const container = document.getElementById('root') ?? document.body;\n try {\n if (isIndexId(id)) {\n const entries = entriesOf(id);\n const title = entries[0]?.title;\n if (title === undefined) throw new Error(`No component with index \"${id}\"`);\n const files = [...new Set(entries.map((e) => e.file))];\n const mods = await Promise.all(files.map(importOf));\n const loaded = files.map((file, i) => ({\n file,\n stories: (options.load ?? loadStories)(mods[i] ?? {}, title, options.setup?.parameters),\n }));\n const stories = entries.flatMap(\n (e) => loaded.find((l) => l.file === e.file)?.stories.find((s) => s.exportName === e.exportName) ?? [],\n );\n for (const story of stories) await options.setup?.prepare?.(story);\n startIndex({\n title,\n ...(entries[0]?.componentDescription === undefined ? {} : { description: entries[0].componentDescription }),\n // The project's library table is the shell config's, which a frame document does not load.\n library: TITLE_LIBRARIES.of({ file: entries[0]?.file ?? '', title }),\n gallery: entries.every(isGallery),\n galleries: entries.filter(isGallery).map((e) => e.id),\n stories,\n descriptions: Object.fromEntries(entries.flatMap((e) => (e.description ? [[e.id, e.description]] : []))),\n render: mods.map(indexRenderOf).find((render) => render !== null) ?? null,\n channel,\n container,\n ...(options.setup ? { setup: options.setup } : {}),\n });\n return;\n }\n const entry = options.index.find((e) => e.id === id);\n if (!entry) throw new Error(`No story with id \"${id}\"`);\n const mod = await importOf(entry.file);\n const stories = (options.load ?? loadStories)(mod, entry.title, options.setup?.parameters);\n const story = stories.find((s) => s.exportName === entry.exportName);\n if (!story) throw new Error(`${entry.file} has no story export \"${entry.exportName}\"`);\n await options.setup?.prepare?.(story);\n startFrame({ story, channel, container, setup: options.setup });\n } catch (error) {\n reportImportFault(channel, error);\n }\n}\n"]}
|
|
1
|
+
{"version":3,"sources":["../../src/frame/FrameController.tsx","../../src/frame/index/startIndex.tsx","../../src/frame/mountFrame.tsx","../../src/frame/capture/CaptureView.tsx","../../src/frame/capture/mountCapture.tsx"],"names":["jsx","flushSync","id","stories","story","Component"],"mappings":";;;;;;;;;;;;;;;;;AAmDA,IAAM,cAAA,GAAiB,GAAA;AAEvB,SAAS,KAAA,CAAM,KAAA,EAAmB,KAAA,EAAgB,GAAA,EAAyB;AACzE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,OAAA;AAAA,IACN,KAAA;AAAA,IACA,SAAS,KAAA,YAAiB,KAAA,GAAQ,KAAA,CAAM,OAAA,GAAU,OAAO,KAAK,CAAA;AAAA,IAC9D,GAAI,KAAA,YAAiB,KAAA,IAAS,KAAA,CAAM,KAAA,GAAQ,EAAE,KAAA,EAAO,KAAA,CAAM,KAAA,EAAM,GAAI,EAAC;AAAA,IACtE,GAAI,GAAA,KAAQ,MAAA,GAAY,EAAC,GAAI,EAAE,GAAA;AAAI,GACrC;AACF;AAGO,SAA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AAA,GAAG;AACH,MAAA,QAAA,CAAS,GAAA,CAAI,IAAI,OAAO,CAAA;AACxB,MAAA,OAAA,CAAQ,KAAA,CAAM,MAAM,QAAA,CAAS,MAAA,CAAO,EAAE,CAAC,CAAA;AAAA,IACzC;AACA,IAAA,OAAO,OAAA;AAAA,EACT,CAAA;AAEA,EAAA,MAAA,CAAO,cAAA,GAAiB;AAAA,IACtB,MAAM,OAAO,OAAA,EAAS;AACpB,MAAA,MAAM,KAAA,GAAQ,MAAM,OAAA,CAAQ,OAAA,CAAQ,KAAK,CAAA;AACzC,MAAA,OAAA,IAAW,CAAA;AACX,MAAA,MAAM,IAAI,OAAA,CAAc,CAAC,OAAA,EAAS,MAAA,KAAW;AAE3C,QAAA,IAAA,CAAK,MAAA;AAAA,0BACHL,GAAAA,CAAC,eAAA,EAAA,EAA8B,OAAA,EAAS,QACtC,QAAA,kBAAAA,GAAAA,CAAC,WAAA,EAAA,EAAY,KAAA,EAAc,SAAkB,KAAA,EAAc,QAAA,EAAoB,UAAA,EAAY,OAAA,EAAS,KADhF,OAEtB;AAAA,SACF;AAAA,MACF,CAAC,CAAA;AAAA,IACH;AAAA,GACF;AACF","file":"index.js","sourcesContent":["import { flushSync } from 'react-dom';\nimport type { IconTable } from '@weasel-js/icons';\nimport { createKitRoot } from '../kitIcons';\nimport type { Channel } from '../protocol/channel';\nimport {\n type CssVarReport,\n type FaultPhase,\n type FromFrame,\n type Globals,\n stableStringify,\n type ToFrame,\n} from '../protocol/messages';\nimport { answerSchema, describeSchema } from '../protocol/schema';\nimport type { Decorator, LoadedStory, StoryContext } from '../story/types';\nimport { auditElement } from './a11y';\nimport { createA11yHighlighter } from './a11yHighlight';\nimport { createOverrides, resolveCssVar, scanCssVars } from './cssVars';\nimport { createGlobalsTarget, type GlobalsTarget } from './globalsTarget';\nimport { StoryHost } from './StoryHost';\n\n/** The frame config: what `defineFrameConfig` returns and the `frameConfig` module default-exports. */\nexport interface FrameSetup {\n /** Wraps every story, outermost; receives the globals. From the frame config (`frameConfig`). */\n decorators?: Decorator[];\n /** Applies globals to a target: theme mode, fonts. The target is a frame document's root, or one story's host in\n * the workshop document, so a rule the setup writes goes through `target.style` under `target.scope`. */\n applyGlobals?: (globals: Globals, target: GlobalsTarget) => void;\n /**\n * The elements a CSS variable override is declared on; `:root` by default. An override has to be declared on\n * whichever element declares the token itself — a theme wrapper, say — or that element's own value wins.\n */\n cssVarsScope?: string;\n /** Project-wide CSF parameters, Storybook's preview `parameters`: under each meta's and story's. */\n parameters?: Record<string, unknown>;\n /**\n * Awaited once a story is loaded and before it first renders — the place to import what only some stories\n * need, so the rest never load it.\n */\n prepare?: (story: LoadedStory) => void | Promise<void>;\n /** Icon tables registered beside the kit's in every frame: an app's own, for its stories' glyphs. */\n icons?: readonly IconTable[];\n}\n\n/** Inputs to `startFrame`: the story, the channel to the shell, and the element to render into. */\nexport interface StartFrameOptions {\n story: LoadedStory;\n channel: Channel<ToFrame, FromFrame>;\n container: HTMLElement;\n setup?: FrameSetup;\n}\n\nconst VARS_SETTLE_MS = 100;\n\nfunction fault(phase: FaultPhase, error: unknown, seq?: number): FromFrame {\n return {\n type: 'fault',\n phase,\n message: error instanceof Error ? error.message : String(error),\n ...(error instanceof Error && error.stack ? { stack: error.stack } : {}),\n ...(seq === undefined ? {} : { seq }),\n };\n}\n\n/** Sends `ready`, then renders the story on `init` and keeps it in step. Returns a stop function. */\nexport function startFrame({ story, channel, container, setup = {} }: StartFrameOptions): () => void {\n const { send } = channel;\n send({ type: 'ready', schema: describeSchema(story.config), layout: story.layout, viewport: story.viewport });\n\n const wrapper = document.createElement('div');\n wrapper.className = `fg-frame fg-frame--${story.layout}`;\n container.append(wrapper);\n const root = createKitRoot(wrapper, setup.icons);\n const decorators = setup.decorators ?? [];\n\n let initialized = false;\n let rendered = false;\n let config: unknown;\n let state: unknown = null;\n let globals: Globals = {};\n let answeredKey: string | null = null;\n let resetKey = 0;\n let seq = 0;\n\n const overrides = createOverrides(document, setup.cssVarsScope);\n const globalsTarget = createGlobalsTarget(document.documentElement, ':root');\n const highlighter = createA11yHighlighter(document);\n let lastVars: CssVarReport[] | null = null;\n let reported: string | null = null;\n const publishVars = (vars: CssVarReport[]) => {\n lastVars = vars;\n const key = JSON.stringify(vars);\n if (key === reported) return;\n reported = key;\n send({ type: 'vars', vars });\n };\n const reportVars = () => publishVars(scanCssVars(document, overrides.has));\n const ownMutation = (record: MutationRecord) =>\n overrides.owns(record.target) ||\n (record.type === 'childList' &&\n [...record.addedNodes, ...record.removedNodes].length > 0 &&\n [...record.addedNodes, ...record.removedNodes].every(overrides.owns));\n let settleTimer: ReturnType<typeof setTimeout> | undefined;\n const mutations =\n typeof MutationObserver === 'undefined'\n ? null\n : new MutationObserver((records) => {\n if (records.every(ownMutation)) return;\n clearTimeout(settleTimer);\n settleTimer = setTimeout(reportVars, VARS_SETTLE_MS);\n });\n // Every attribute, not just style and class: a stylesheet can select on any of them, `[data-wzl-mode]` included.\n mutations?.observe(document.documentElement, { subtree: true, childList: true, characterData: true, attributes: true });\n\n const setConfig = (path: string, value: unknown) => send({ type: 'setConfig', path, value });\n const setState = (next: unknown) => {\n state = typeof next === 'function' ? (next as (prev: unknown) => unknown)(state) : next;\n send({ type: 'setState', state });\n render();\n };\n\n const render = () => {\n const ctx: StoryContext = { config, setConfig, state, setState, globals, title: story.title, name: story.name };\n const at = seq;\n root.render(\n <StoryHost\n story={story}\n ctx={ctx}\n decorators={decorators}\n resetKey={resetKey}\n onError={(error) => send(fault('render', error, at))}\n />,\n );\n const key = stableStringify(config);\n if (key !== answeredKey) {\n answeredKey = key;\n send({ type: 'answers', answers: { configKey: key, ...answerSchema(story.config, config) } });\n }\n };\n\n // Input from the trial commits synchronously, so `rendered` and the vars report describe the story it produced. A\n // throw while applying it faults like a render would; otherwise the trial would wait on a frame that never answers.\n const input = (apply: () => void) => {\n seq += 1;\n try {\n apply();\n if (!initialized) return;\n resetKey += 1;\n flushSync(render);\n } catch (error) {\n send(fault('render', error, seq));\n return;\n }\n if (!rendered) {\n rendered = true;\n announceRendered();\n }\n reportVars();\n };\n\n /**\n * The shell unhides the frame on `rendered` and fades it in, so a webfont\n * swapping in after that message reads as the story gliding. Waiting for the\n * fonts and then one painted frame means the story the shell reveals is the\n * settled one.\n *\n * `document.fonts` is absent in jsdom, so the message stays synchronous\n * there; the deferral is only exercised in a browser.\n */\n const announceRendered = () => {\n const { fonts } = document;\n if (!fonts) {\n send({ type: 'rendered' });\n return;\n }\n const afterPaint = () => requestAnimationFrame(() => send({ type: 'rendered' }));\n void fonts.ready.then(afterPaint, afterPaint);\n };\n\n const audit = async (id: string) => send({ type: 'a11y', id, ...(await auditElement(wrapper)) });\n\n const off = channel.on((msg) => {\n switch (msg.type) {\n case 'init':\n input(() => {\n initialized = true;\n config = msg.config;\n globals = msg.globals;\n state = msg.state;\n if (state === null && story.initialState) {\n state = story.initialState(config);\n send({ type: 'setState', state });\n }\n setup.applyGlobals?.(globals, globalsTarget);\n });\n break;\n case 'config':\n input(() => {\n config = msg.config;\n });\n break;\n case 'state':\n input(() => {\n state = msg.state;\n });\n break;\n case 'globals':\n input(() => {\n globals = msg.globals;\n setup.applyGlobals?.(globals, globalsTarget);\n });\n break;\n case 'vars.set': {\n overrides.set(msg.name, msg.value);\n const at = lastVars?.findIndex((v) => v.name === msg.name) ?? -1;\n if (!lastVars || at < 0) break;\n const vars = lastVars.slice();\n vars[at] = { ...vars[at]!, value: resolveCssVar(document, msg.name), overridden: overrides.has(msg.name) };\n publishVars(vars);\n break;\n }\n case 'a11y.run':\n void audit(msg.id);\n break;\n case 'a11y.highlight':\n highlighter.show(msg.targets);\n break;\n }\n });\n\n return () => {\n off();\n mutations?.disconnect();\n clearTimeout(settleTimer);\n overrides.dispose();\n globalsTarget.dispose();\n highlighter.dispose();\n root.unmount();\n wrapper.remove();\n };\n}\n\n/** Reports an import failure — there is no story to start. */\nexport function reportImportFault(channel: Channel<ToFrame, FromFrame>, error: unknown): void {\n channel.send(fault('import', error));\n}\n","import { f } from '@weasel-js/labkit/config';\nimport { Component, type ReactNode } from 'react';\nimport { flushSync } from 'react-dom';\nimport { createKitRoot } from '../../kitIcons';\nimport type { Channel } from '../../protocol/channel';\nimport type { FromFrame, Globals, ToFrame } from '../../protocol/messages';\nimport { describeSchema } from '../../protocol/schema';\nimport type { IndexRender, LoadedStory } from '../../story/types';\nimport { runAxe } from '../a11y';\nimport type { FrameSetup } from '../FrameController';\nimport { createGlobalsTarget } from '../globalsTarget';\nimport { type IndexEnv, IndexPage } from './IndexPage';\n\nexport interface StartIndexOptions {\n title: string;\n /** The package the component ships in. */\n library?: string;\n description?: string;\n /** Whether the component is a gallery. */\n gallery?: boolean;\n /** The ids of the stories tagged `gallery`. */\n galleries?: readonly string[];\n /** The ids of the stories tagged `lab`. */\n labs?: readonly string[];\n /** In file order. */\n stories: readonly LoadedStory[];\n descriptions: Readonly<Record<string, string>>;\n /** The component's own page; null for the generated one. */\n render: IndexRender | null;\n channel: Channel<ToFrame, FromFrame>;\n container: HTMLElement;\n setup?: FrameSetup;\n}\n\nconst message = (error: unknown): string => (error instanceof Error ? error.message : String(error));\n\n/** Faults the frame when the page itself throws. A single story's throw stays in its own cell. */\nclass PageBoundary extends Component<{ onError: (error: unknown) => void; children: ReactNode }, { failed: unknown }> {\n override state = { failed: null as unknown };\n\n static getDerivedStateFromError(error: unknown) {\n return { failed: error ?? new Error('Index page failed') };\n }\n\n override componentDidCatch(error: unknown): void {\n this.props.onError(error);\n }\n\n override render(): ReactNode {\n return this.state.failed ? null : this.props.children;\n }\n}\n\n/**\n * Sends `ready` for a page with no controls, then renders the component's index on `init` and follows the lab's\n * globals. Returns a stop function.\n */\nexport function startIndex(options: StartIndexOptions): () => void {\n const { channel, container, setup = {} } = options;\n const { send } = channel;\n send({ type: 'ready', schema: describeSchema(f.schema({})), layout: 'fullscreen', viewport: null });\n\n const wrapper = document.createElement('div');\n wrapper.className = 'fg-frame fg-frame--fullscreen';\n container.append(wrapper);\n const root = createKitRoot(wrapper, setup.icons);\n const globalsTarget = createGlobalsTarget(document.documentElement, ':root');\n let globals: Globals | null = null;\n let announced = false;\n\n const render = (): void => {\n if (!globals) return;\n const env: IndexEnv = {\n title: options.title,\n ...(options.library === undefined ? {} : { library: options.library }),\n ...(options.description === undefined ? {} : { description: options.description }),\n stories: options.stories,\n descriptions: options.descriptions,\n gallery: options.gallery ?? false,\n galleries: options.galleries ?? [],\n labs: options.labs ?? [],\n globals,\n decorators: setup.decorators ?? [],\n open: (id) => send({ type: 'open', id }),\n // A story that throws shows its error in its own cell; the rest of the page is still worth reading.\n onError: (error) => console.error(error),\n };\n root.render(\n <PageBoundary onError={(error) => send({ type: 'fault', phase: 'render', message: message(error) })}>\n <IndexPage env={env} render={options.render} />\n </PageBoundary>,\n );\n };\n\n const announce = (): void => {\n if (announced) return;\n announced = true;\n const { fonts } = document;\n if (!fonts) {\n send({ type: 'rendered' });\n return;\n }\n const afterPaint = () => requestAnimationFrame(() => send({ type: 'rendered' }));\n void fonts.ready.then(afterPaint, afterPaint);\n };\n\n const off = channel.on((msg) => {\n switch (msg.type) {\n case 'init':\n case 'globals':\n globals = msg.globals;\n setup.applyGlobals?.(globals, globalsTarget);\n flushSync(render);\n announce();\n break;\n case 'a11y.run':\n runAxe(wrapper).then(\n (report) => send({ type: 'a11y', id: msg.id, ok: true, report }),\n (error: unknown) => send({ type: 'a11y', id: msg.id, ok: false, message: message(error) }),\n );\n break;\n default:\n break;\n }\n });\n\n return () => {\n off();\n globalsTarget.dispose();\n root.unmount();\n wrapper.remove();\n };\n}\n","import { openChannel } from '../protocol/channel';\nimport { FRAME_HELLO, type FromFrame, PORT_HANDOFF, type ToFrame } from '../protocol/messages';\nimport { indexId, isIndexId } from '../story/indexPages';\nimport { TITLE_LIBRARIES } from '../story/library';\nimport { isGallery, taggedIds } from '../story/tags';\nimport { indexRenderOf, loadStories } from '../story/load';\nimport type { LoadedStory } from '../story/types';\nimport { type FrameSetup, reportImportFault, startFrame } from './FrameController';\nimport { startIndex } from './index/startIndex';\n\n/** Story modules by file path, each loaded on first use. */\nexport interface FrameImporters {\n [file: string]: () => Promise<Record<string, unknown>>;\n}\n\n/** One story as a frame document needs to find it, before its module is loaded. */\nexport interface FrameIndexEntry {\n id: string;\n /** The story's title as indexed, which titles the file's stories when its meta names none. */\n title: string;\n file: string;\n exportName: string;\n /** The JSDoc above the story's export, which its index page shows. */\n description?: string;\n /** The JSDoc above the file's meta, which heads the index page. */\n componentDescription?: string;\n /** The meta's `tags`. */\n tags?: readonly string[];\n}\n\n/** Inputs to `mountFrame`. `load` replaces the default module loader, `loadStories`. */\nexport interface MountFrameOptions {\n index: readonly FrameIndexEntry[];\n importers: FrameImporters;\n setup?: FrameSetup;\n load?: (mod: Record<string, unknown>, title: string, parameters?: Record<string, unknown>) => LoadedStory[];\n}\n\nexport { indexRenderOf, loadStories } from '../story/load';\n\nfunction waitForHandoff():Promise<{ port: MessagePort; id: string | null }> {\n return new Promise((resolve) => {\n const onMessage = (event: MessageEvent) => {\n const data = event.data as { type?: unknown; id?: unknown } | null;\n const port = event.ports[0];\n if (event.origin !== location.origin || event.source !== window.parent) return;\n if (typeof data !== 'object' || data === null || data.type !== PORT_HANDOFF || !port) return;\n window.removeEventListener('message', onMessage);\n resolve({ port, id: typeof data.id === 'string' ? data.id : null });\n };\n window.addEventListener('message', onMessage);\n });\n}\n\n/**\n * The frame document's entry: asks its parent for a port and shows what the handoff names, or, from a shell that\n * names nothing, what the hash does. The hash is read at once, so its module loads during the handshake.\n */\nexport async function mountFrame(options: MountFrameOptions): Promise<void> {\n const imports = new Map<string, Promise<Record<string, unknown>>>();\n const importOf = (file: string): Promise<Record<string, unknown>> => {\n let loading = imports.get(file);\n if (!loading) {\n const importer = options.importers[file];\n if (!importer) throw new Error(`No importer for ${file}`);\n loading = importer();\n imports.set(file, loading);\n }\n return loading;\n };\n /** The entries `id` shows: one story, or every story of the component an index id names. */\n const entriesOf = (id: string): FrameIndexEntry[] =>\n isIndexId(id)\n ? options.index.filter((e) => indexId(e.title) === id)\n : options.index.filter((e) => e.id === id);\n const early = location.hash.slice(1) || null;\n // Only starts the fetch; whoever awaits the import later sees its outcome.\n for (const file of new Set(early === null ? [] : entriesOf(early).map((e) => e.file))) {\n if (options.importers[file]) importOf(file).catch(() => {});\n }\n\n const handoff = waitForHandoff();\n window.parent.postMessage({ type: FRAME_HELLO }, location.origin);\n const { port, id: handed } = await handoff;\n const channel = openChannel<ToFrame, FromFrame>(port);\n const id = handed ?? early ?? '';\n const container = document.getElementById('root') ?? document.body;\n try {\n if (isIndexId(id)) {\n const entries = entriesOf(id);\n const title = entries[0]?.title;\n if (title === undefined) throw new Error(`No component with index \"${id}\"`);\n const files = [...new Set(entries.map((e) => e.file))];\n const mods = await Promise.all(files.map(importOf));\n const loaded = files.map((file, i) => ({\n file,\n stories: (options.load ?? loadStories)(mods[i] ?? {}, title, options.setup?.parameters),\n }));\n const stories = entries.flatMap(\n (e) => loaded.find((l) => l.file === e.file)?.stories.find((s) => s.exportName === e.exportName) ?? [],\n );\n for (const story of stories) await options.setup?.prepare?.(story);\n startIndex({\n title,\n ...(entries[0]?.componentDescription === undefined ? {} : { description: entries[0].componentDescription }),\n // The project's library table is the shell config's, which a frame document does not load.\n library: TITLE_LIBRARIES.of({ file: entries[0]?.file ?? '', title }),\n gallery: entries.every(isGallery),\n ...taggedIds(entries),\n stories,\n descriptions: Object.fromEntries(entries.flatMap((e) => (e.description ? [[e.id, e.description]] : []))),\n render: mods.map(indexRenderOf).find((render) => render !== null) ?? null,\n channel,\n container,\n ...(options.setup ? { setup: options.setup } : {}),\n });\n return;\n }\n const entry = options.index.find((e) => e.id === id);\n if (!entry) throw new Error(`No story with id \"${id}\"`);\n const mod = await importOf(entry.file);\n const stories = (options.load ?? loadStories)(mod, entry.title, options.setup?.parameters);\n const story = stories.find((s) => s.exportName === entry.exportName);\n if (!story) throw new Error(`${entry.file} has no story export \"${entry.exportName}\"`);\n await options.setup?.prepare?.(story);\n startFrame({ story, channel, container, setup: options.setup });\n } catch (error) {\n reportImportFault(channel, error);\n }\n}\n","import './capture.css';\nimport { useLatest, useVisibleRaf } from '@weasel-js/core';\nimport { interstellarTheme, LabRoot } from '@weasel-js/labkit';\nimport type { Theme } from '@weasel-js/theme';\nimport { ThemeProvider } from '@weasel-js/theme/react';\nimport { OverlayPortalProvider } from '@weasel-js/ui/portal-host';\nimport { type CSSProperties, type ReactNode, useEffect, useLayoutEffect, useMemo, useRef, useState } from 'react';\nimport { useHostConditions } from '../../shell/hostConditions';\nimport { LAB_DENSITY } from '../../shell/labDensity';\nimport type { Globals } from '../../protocol/messages';\nimport type { LoadedStory, StoryContext } from '../../story/types';\nimport { ClockContext } from '../../timeline/context';\nimport { useStoryClock } from '../../timeline/StoryClock';\nimport type { CapturePayload } from '../../vite/capture/payload';\nimport type { FrameSetup } from '../FrameController';\nimport { StoryHost } from '../StoryHost';\n\n/** Props for `CaptureView`. */\nexport interface CaptureViewProps {\n story: LoadedStory;\n payload: CapturePayload;\n setup: FrameSetup;\n /** The shell config's `labTheme`, which the workshop's lab is themed by. */\n labTheme?: ((globals: Globals) => Theme) | undefined;\n /** Called once the story has painted with its fonts, so a screenshot taken then shows it settled. */\n onRendered: () => void;\n}\n\nconst HOST_ID = 'capture';\nconst NO_WRITE = () => {};\n\n/** Sizes the box through custom properties, which capture.css reads. */\nconst boxStyle = ({ width, height }: CapturePayload['box']): CSSProperties =>\n ({ ['--fg-capture-w' as string]: `${width}px`, ['--fg-capture-h' as string]: `${height}px` }) as CSSProperties;\n\n/** Scrolls the story's scroller to where the screen's stood; a story still growing is scrolled again before the shot. */\nfunction scrollTo(host: HTMLElement | null, { left, top }: CapturePayload['scroll']) {\n const scroller = host?.querySelector<HTMLElement>(':scope > .fg-story__scroll');\n if (!scroller) return;\n scroller.scrollLeft = left;\n scroller.scrollTop = top;\n}\n\n/**\n * One story rendered from a capture payload, still: its clock stands at the payload's playhead and nothing plays\n * it, and nothing it writes to its config or state goes anywhere. A story that would be in the workshop document\n * sits under a lab root themed as the lab is, as it does there; an isolated one sits in the frame document's own\n * wrapper.\n */\nexport function CaptureView({ story, payload, setup, labTheme, onRendered }: CaptureViewProps) {\n const [host, setHost] = useState<HTMLDivElement | null>(null);\n useHostConditions(host, { hostId: HOST_ID, globals: payload.globals, overrides: payload.overrides, setup });\n\n const spec = useMemo(() => story.timeline?.(payload.config) ?? null, [story, payload.config]);\n const clock = useStoryClock(spec, () => payload.playhead);\n\n const state = useMemo(\n () => (payload.state === null && story.initialState ? story.initialState(payload.config) : payload.state),\n [payload.state, payload.config, story],\n );\n const ctx: StoryContext = {\n config: payload.config,\n setConfig: NO_WRITE,\n state,\n setState: NO_WRITE,\n globals: payload.globals,\n title: story.title,\n name: story.name,\n };\n\n const latest = useLatest({ onRendered, host, scroll: payload.scroll });\n useLayoutEffect(() => scrollTo(host, payload.scroll), [host, payload.scroll]);\n const ticks = useRef(0);\n // A capture page is never looked at, and a headless page can count as hidden.\n const raf = useVisibleRaf(\n (_now, loop) => {\n ticks.current += 1;\n scrollTo(latest.current.host, latest.current.scroll);\n if (ticks.current < 2) loop.request();\n else latest.current.onRendered();\n },\n { dangerouslyRunWhenHidden: true },\n );\n useEffect(() => {\n if (!host) return;\n let canceled = false;\n const start = () => {\n if (!canceled) raf.request();\n };\n const { fonts } = host.ownerDocument;\n if (fonts) void fonts.ready.then(start, start);\n else start();\n return () => {\n canceled = true;\n raf.cancel();\n };\n }, [host, raf]);\n\n const content: ReactNode = host ? (\n <ClockContext.Provider value={clock}>\n <StoryHost story={story} ctx={ctx} decorators={setup.decorators ?? []} resetKey={0} onError={NO_WRITE} />\n </ClockContext.Provider>\n ) : null;\n\n const box = (\n <div\n ref={setHost}\n className=\"fg-story\"\n data-fg-host={HOST_ID}\n data-fg-capture=\"\"\n data-fg-layout={payload.layout}\n style={boxStyle(payload.box)}\n >\n {payload.isolate ? (\n <div className={`fg-frame fg-frame--${payload.layout}`}>{content}</div>\n ) : (\n <div className=\"fg-story__scroll\">\n {host ? (\n <OverlayPortalProvider container={host} contained>\n {content}\n </OverlayPortalProvider>\n ) : null}\n </div>\n )}\n </div>\n );\n if (payload.isolate) return box;\n return (\n <ThemeProvider\n theme={labTheme?.(payload.lab.globals) ?? interstellarTheme}\n selection={{ mode: payload.lab.mode, density: LAB_DENSITY }}\n >\n <LabRoot>{box}</LabRoot>\n </ThemeProvider>\n );\n}\n","import type { Theme } from '@weasel-js/theme';\nimport { Component, type ReactNode } from 'react';\nimport { createKitRoot } from '../../kitIcons';\nimport type { Globals } from '../../protocol/messages';\nimport { loadStories } from '../../story/load';\nimport type { IndexEntry, LoadedStory } from '../../story/types';\nimport type { CapturePayload } from '../../vite/capture/payload';\nimport type { FrameSetup } from '../FrameController';\nimport type { FrameImporters } from '../mountFrame';\nimport { CaptureView } from './CaptureView';\n\n/** Inputs to `mountCapture`, as a capture page's entry module passes them. */\nexport interface MountCaptureOptions {\n index: readonly IndexEntry[];\n importers: FrameImporters;\n setup: FrameSetup;\n /** The shell config's `labTheme`; only the shell's capture page has one. */\n labTheme?: ((globals: Globals) => Theme) | undefined;\n}\n\ndeclare global {\n interface Window {\n /** Set by `mountCapture`: renders one payload and resolves once it has painted. */\n __forgeCapture?: { render(payload: CapturePayload): Promise<void> };\n }\n}\n\n/** Catches what throws outside the story's own boundary, which would otherwise unmount the root and leave the\n * render waiting forever. */\nclass CaptureBoundary extends Component<{ onError: (error: unknown) => void; children: ReactNode }, { failed: boolean }> {\n override state = { failed: false };\n\n static getDerivedStateFromError(): { failed: boolean } {\n return { failed: true };\n }\n\n override componentDidCatch(error: unknown): void {\n this.props.onError(error);\n }\n\n override render(): ReactNode {\n return this.state.failed ? null : this.props.children;\n }\n}\n\n/**\n * A capture page's entry: exposes `window.__forgeCapture.render(payload)`, which loads the payload's story, renders\n * it afresh into `#root`, and resolves once it has painted. Rejects for a story the index does not hold, and with\n * whatever throws outside the story's own error boundary.\n */\nexport function mountCapture({ index, importers, setup, labTheme }: MountCaptureOptions): void {\n const container = document.getElementById('root') ?? document.body;\n const root = createKitRoot(container, setup.icons);\n const prepared = new Map<string, Promise<LoadedStory>>();\n let renders = 0;\n\n const storyOf = (id: string): Promise<LoadedStory> => {\n let loading = prepared.get(id);\n if (!loading) {\n loading = (async () => {\n const entry = index.find((e) => e.id === id);\n if (!entry) throw new Error(`No story with id \"${id}\"`);\n const importer = importers[entry.file];\n if (!importer) throw new Error(`No importer for ${entry.file}`);\n const story = loadStories(await importer(), entry.title, setup.parameters).find((s) => s.exportName === entry.exportName);\n if (!story) throw new Error(`${entry.file} has no story export \"${entry.exportName}\"`);\n await setup.prepare?.(story);\n return story;\n })();\n prepared.set(id, loading);\n loading.catch(() => prepared.delete(id));\n }\n return loading;\n };\n\n window.__forgeCapture = {\n async render(payload) {\n const story = await storyOf(payload.story);\n renders += 1;\n await new Promise<void>((resolve, reject) => {\n // Keyed per render, so a payload never inherits the last one's clock or state.\n root.render(\n <CaptureBoundary key={renders} onError={reject}>\n <CaptureView story={story} payload={payload} setup={setup} labTheme={labTheme} onRendered={resolve} />\n </CaptureBoundary>,\n );\n });\n },\n };\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { ConfigSchema } from '@weasel-js/labkit/config';
|
|
2
2
|
export { f } from '@weasel-js/labkit/config';
|
|
3
|
-
export { F as FOLLOW_APP, G as GlobalDeclaration, a as GlobalDeclarations, L as LabChrome, b as Library, S as ShellConfig, d as defineFrameConfig, c as defineShellConfig } from './config-
|
|
3
|
+
export { F as FOLLOW_APP, G as GlobalDeclaration, a as GlobalDeclarations, L as LabChrome, b as Library, S as ShellConfig, d as defineFrameConfig, c as defineShellConfig } from './config-Bd6FVlh7.js';
|
|
4
4
|
import { ComponentType, ReactNode } from 'react';
|
|
5
|
-
import { G as Globals, M as MetaSpec,
|
|
6
|
-
export { A as A11yFinding,
|
|
5
|
+
import { G as Globals, M as MetaSpec, d as StorySpec, e as ClockState, f as SpanOverride } from './FrameController-Tv3jrHyT.js';
|
|
6
|
+
export { A as A11yFinding, g as A11yNode, h as A11yReport, i as ComponentDeps, j as ComponentHistory, D as Decorator, k as DepGraph, F as FrameSetup, l as GlobalsTarget, m as IndexContext, n as IndexRender, o as IndexStoryProps, p as LoadedStory, P as PlayContext, q as StoryContext, L as StoryLayout, V as StoryViewport, t as TimelineSpan, u as TimelineSpec } from './FrameController-Tv3jrHyT.js';
|
|
7
7
|
import '@weasel-js/labkit';
|
|
8
8
|
import '@weasel-js/theme';
|
|
9
9
|
import '@weasel-js/icons';
|
|
10
|
-
import '@weasel-js/ui/
|
|
10
|
+
import '@weasel-js/ui/appearance';
|
|
11
11
|
|
|
12
12
|
/** Storybook's conditional control: shown only while an arg, or a global, meets the test. */
|
|
13
13
|
type ArgCondition = ({
|
|
@@ -20,10 +20,31 @@ type ArgCondition = ({
|
|
|
20
20
|
eq?: unknown;
|
|
21
21
|
neq?: unknown;
|
|
22
22
|
};
|
|
23
|
+
/**
|
|
24
|
+
* Storybook's `SBType`, as far as forge reads it: the shape of an arg's value. A control is built from the parts of
|
|
25
|
+
* an array, an object or a union, and a union of objects that each pin one field to a string is edited as a choice
|
|
26
|
+
* of that string, with the chosen object's own fields under it.
|
|
27
|
+
*/
|
|
28
|
+
type ArgShape = {
|
|
29
|
+
name: 'boolean' | 'string' | 'number';
|
|
30
|
+
} | {
|
|
31
|
+
name: 'enum';
|
|
32
|
+
value: readonly string[];
|
|
33
|
+
} | {
|
|
34
|
+
name: 'array';
|
|
35
|
+
value: ArgShape;
|
|
36
|
+
} | {
|
|
37
|
+
name: 'object';
|
|
38
|
+
value: Readonly<Record<string, ArgShape>>;
|
|
39
|
+
} | {
|
|
40
|
+
name: 'union';
|
|
41
|
+
value: readonly ArgShape[];
|
|
42
|
+
};
|
|
23
43
|
/** A CSF `argTypes` entry, as far as forge reads it. */
|
|
24
44
|
interface ArgType {
|
|
25
45
|
name?: string;
|
|
26
46
|
description?: string;
|
|
47
|
+
type?: ArgShape;
|
|
27
48
|
control?: string | false | {
|
|
28
49
|
type?: string;
|
|
29
50
|
min?: number;
|
|
@@ -187,5 +208,7 @@ declare function useTimeline(): StoryTimeline;
|
|
|
187
208
|
|
|
188
209
|
/** The meta tag marking a story file as a gallery: a catalog of many components, or of every permutation of one. */
|
|
189
210
|
declare const GALLERY_TAG = "gallery";
|
|
211
|
+
/** The meta tag marking a story file as a lab: a whole screen for exercising a component, not a specimen of it. */
|
|
212
|
+
declare const LAB_TAG = "lab";
|
|
190
213
|
|
|
191
|
-
export { type ArgCondition, type ArgType, type ArgsOf, type CsfDecorator, type CsfPlayContext, type CsfStep, type CsfStoryContext, type ForgeRoute, GALLERY_TAG, type KnobLeaf, type KnobPath, type Meta, MetaSpec, RESERVED_PARAMS, SpanOverride, Globals as StoryGlobals, type StoryObj, StorySpec, type StoryTimeline, decodeKnob, encodeKnob, formatRoute, knobParams, knobPaths, knobsToParams, meta, paramsToKnobs, parseRoute, reservedParams, story, storyHref, usePlayhead, useTimeline };
|
|
214
|
+
export { type ArgCondition, type ArgShape, type ArgType, type ArgsOf, type CsfDecorator, type CsfPlayContext, type CsfStep, type CsfStoryContext, type ForgeRoute, GALLERY_TAG, type KnobLeaf, type KnobPath, LAB_TAG, type Meta, MetaSpec, RESERVED_PARAMS, SpanOverride, Globals as StoryGlobals, type StoryObj, StorySpec, type StoryTimeline, decodeKnob, encodeKnob, formatRoute, knobParams, knobPaths, knobsToParams, meta, paramsToKnobs, parseRoute, reservedParams, story, storyHref, usePlayhead, useTimeline };
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { RESERVED_PARAMS, decodeKnob, encodeKnob, formatRoute, knobParams, knobPaths, knobsToParams, paramsToKnobs, parseRoute, reservedParams, storyHref } from './chunk-LTTEILXY.js';
|
|
2
|
-
export { GALLERY_TAG } from './chunk-
|
|
3
|
-
export { FOLLOW_APP } from './chunk-
|
|
2
|
+
export { GALLERY_TAG, LAB_TAG } from './chunk-VUPN73JP.js';
|
|
3
|
+
export { FOLLOW_APP } from './chunk-3BAM6M26.js';
|
|
4
4
|
export { meta, story, usePlayhead, useTimeline } from './chunk-L5XM5VKB.js';
|
|
5
5
|
import './chunk-GH5RE5X5.js';
|
|
6
6
|
export { f } from '@weasel-js/labkit/config';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"names":[],"mappings":";;;;;;;;AAwCO,SAAS,kBAAkB,MAAA,EAAgC;AAChE,EAAA,OAAO,MAAA;AACT;AAGO,SAAS,kBAAkB,MAAA,EAAkC;AAClE,EAAA,OAAO,MAAA;AACT","file":"index.js","sourcesContent":["import type { LabContribution, LabPage } from '@weasel-js/labkit';\nimport type { Theme } from '@weasel-js/theme';\nimport type { ControlRenderer } from '@weasel-js/labkit/config';\nimport type { FrameSetup } from './frame/FrameController';\nimport type { Globals } from './protocol/messages';\nimport type { GlobalDeclarations } from './shell/globals';\nimport type { Library } from './story/library';\n\n/** A shell config module: what the workshop adds to the lab. Only the workshop page imports it. */\nexport interface ShellConfig {\n /** The workshop's name, in its header and as the document title. Default `weaselforge`. The served page reads\n * it from this module's source, so write it as a string or a `const` of this file; a computed one titles the\n * page only once the workshop has loaded. */\n title?: string;\n /** Whether the lab offers the CSS Vars panel and its header toggle. Default true; the panel starts hidden. */\n cssVars?: boolean;\n labChrome?: readonly LabContribution[];\n controls?: Record<string, ControlRenderer>;\n /** Globals the lab's header sets for every story, each pinnable per trial. Frames apply them with `applyGlobals`. */\n globals?: GlobalDeclarations;\n /** The theme the workshop's own chrome takes at the lab's current globals, so a global can restyle the workshop\n * as well as the stories. Default: labkit's. */\n labTheme?: (globals: Globals) => Theme;\n /** The project's libraries, each a stretch of file path and the label its stories carry in the tree's package\n * filter, on index pages, and in Get Info. A story under none of them takes its title's first segment. */\n libraries?: readonly Library[];\n /** The project's other labs, offered in the workshop's title menu. */\n pages?: readonly LabPage[];\n /** Which of `pages` the workshop is, when the URL alone cannot say, as across dev servers on different ports. */\n path?: string;\n /** What a Pixels capture may load besides the dev server's own pages, such as the origins of a web-font service\n * the stories' fonts come from. Every other request a capture makes is refused. The dev server reads the list\n * from this module's source, as it does `title`, so write each origin as a string. */\n capture?: { allowOrigins?: readonly string[] };\n /** The workshop's lenses. `modeGlobal` names the global holding the color mode, which a lens's opposite-mode\n * comparison flips through its declaration's `opposite`. Default `mode`. */\n loupe?: { modeGlobal?: string };\n}\n\n/** A frame config module's default export. The workshop page imports it as well as every frame document, so CSS it imports reaches both; the plugin's `frameStyles` is for CSS meant for frames alone. */\nexport function defineFrameConfig(config: FrameSetup): FrameSetup {\n return config;\n}\n\n/** A shell config module's default export. */\nexport function defineShellConfig(config: ShellConfig): ShellConfig {\n return config;\n}\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { F as FrameSetup, p as LoadedStory } from './FrameController-Tv3jrHyT.js';
|
|
2
|
+
|
|
3
|
+
/** Story modules by file path, each loaded on first use. */
|
|
4
|
+
interface FrameImporters {
|
|
5
|
+
[file: string]: () => Promise<Record<string, unknown>>;
|
|
6
|
+
}
|
|
7
|
+
/** One story as a frame document needs to find it, before its module is loaded. */
|
|
8
|
+
interface FrameIndexEntry {
|
|
9
|
+
id: string;
|
|
10
|
+
/** The story's title as indexed, which titles the file's stories when its meta names none. */
|
|
11
|
+
title: string;
|
|
12
|
+
file: string;
|
|
13
|
+
exportName: string;
|
|
14
|
+
/** The JSDoc above the story's export, which its index page shows. */
|
|
15
|
+
description?: string;
|
|
16
|
+
/** The JSDoc above the file's meta, which heads the index page. */
|
|
17
|
+
componentDescription?: string;
|
|
18
|
+
/** The meta's `tags`. */
|
|
19
|
+
tags?: readonly string[];
|
|
20
|
+
}
|
|
21
|
+
/** Inputs to `mountFrame`. `load` replaces the default module loader, `loadStories`. */
|
|
22
|
+
interface MountFrameOptions {
|
|
23
|
+
index: readonly FrameIndexEntry[];
|
|
24
|
+
importers: FrameImporters;
|
|
25
|
+
setup?: FrameSetup;
|
|
26
|
+
load?: (mod: Record<string, unknown>, title: string, parameters?: Record<string, unknown>) => LoadedStory[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/**
|
|
30
|
+
* The frame document's entry: asks its parent for a port and shows what the handoff names, or, from a shell that
|
|
31
|
+
* names nothing, what the hash does. The hash is read at once, so its module loads during the handshake.
|
|
32
|
+
*/
|
|
33
|
+
declare function mountFrame(options: MountFrameOptions): Promise<void>;
|
|
34
|
+
|
|
35
|
+
export { type FrameImporters as F, type MountFrameOptions as M, type FrameIndexEntry as a, mountFrame as m };
|
package/dist/shell/index.css
CHANGED
|
@@ -194,9 +194,13 @@
|
|
|
194
194
|
flex: none;
|
|
195
195
|
margin-inline-start: auto;
|
|
196
196
|
}
|
|
197
|
-
.fg-tree__tag
|
|
197
|
+
.fg-tree__tag,
|
|
198
|
+
.fg-tree__lab {
|
|
198
199
|
--badge-font-size: var(--wzl-font-size-2xs);
|
|
199
200
|
}
|
|
201
|
+
.fg-tree__lab {
|
|
202
|
+
flex: none;
|
|
203
|
+
}
|
|
200
204
|
.fg-tree__libraries {
|
|
201
205
|
display: flex;
|
|
202
206
|
flex-wrap: wrap;
|
|
@@ -371,7 +375,6 @@
|
|
|
371
375
|
}
|
|
372
376
|
.fg-info__doc {
|
|
373
377
|
margin: 0;
|
|
374
|
-
white-space: pre-line;
|
|
375
378
|
}
|
|
376
379
|
.fg-info__doc--component {
|
|
377
380
|
color: var(--wzl-fg-muted);
|
|
@@ -522,6 +525,24 @@
|
|
|
522
525
|
margin-top: calc(var(--wzl-space-lg) * 1.5);
|
|
523
526
|
border-top: var(--wzl-border-w) solid var(--wzl-border);
|
|
524
527
|
}
|
|
528
|
+
.fg-index-story__main {
|
|
529
|
+
display: flex;
|
|
530
|
+
flex-wrap: wrap;
|
|
531
|
+
align-items: flex-start;
|
|
532
|
+
gap: var(--wzl-space-8) calc(var(--wzl-space-lg) * 1.5);
|
|
533
|
+
}
|
|
534
|
+
.fg-index-story__text {
|
|
535
|
+
flex: 1 1 20rem;
|
|
536
|
+
min-width: 0;
|
|
537
|
+
}
|
|
538
|
+
.fg-index-story__main > .fg-index-cell {
|
|
539
|
+
flex: 0 1 auto;
|
|
540
|
+
margin: 0;
|
|
541
|
+
}
|
|
542
|
+
.fg-index-story__main > .fg-index-cell--padded,
|
|
543
|
+
.fg-index-story__main > .fg-index-cell--fullscreen {
|
|
544
|
+
flex: 2 1 28rem;
|
|
545
|
+
}
|
|
525
546
|
.fg-index-story__head {
|
|
526
547
|
display: flex;
|
|
527
548
|
align-items: center;
|
|
@@ -536,6 +557,14 @@
|
|
|
536
557
|
text-transform: var(--wzl-panel-title-case);
|
|
537
558
|
color: var(--wzl-panel-title-color);
|
|
538
559
|
}
|
|
560
|
+
.fg-index-story__link {
|
|
561
|
+
color: inherit;
|
|
562
|
+
text-decoration: none;
|
|
563
|
+
}
|
|
564
|
+
.fg-index-story__link:hover {
|
|
565
|
+
color: var(--wzl-accent-fg);
|
|
566
|
+
text-decoration: underline;
|
|
567
|
+
}
|
|
539
568
|
.fg-index-cell {
|
|
540
569
|
margin: var(--wzl-space-8) 0 0;
|
|
541
570
|
width: fit-content;
|
|
@@ -663,6 +692,64 @@
|
|
|
663
692
|
font-size: var(--wzl-font-size-sm);
|
|
664
693
|
}
|
|
665
694
|
|
|
695
|
+
/* src/shell/loupe/loupe.css */
|
|
696
|
+
.fg-lens-live {
|
|
697
|
+
position: absolute;
|
|
698
|
+
inset: 0;
|
|
699
|
+
overflow: hidden;
|
|
700
|
+
}
|
|
701
|
+
.fg-lens-copy {
|
|
702
|
+
position: absolute;
|
|
703
|
+
top: 0;
|
|
704
|
+
left: 0;
|
|
705
|
+
width: var(--fg-lens-copy-w);
|
|
706
|
+
height: var(--fg-lens-copy-h);
|
|
707
|
+
transform-origin: 0 0;
|
|
708
|
+
transform: translate(var(--fg-lens-copy-x), var(--fg-lens-copy-y)) scale(var(--fg-lens-copy-f));
|
|
709
|
+
}
|
|
710
|
+
.fg-lens-copy > .fg-story,
|
|
711
|
+
.fg-lens-copy > .fg-frame-host {
|
|
712
|
+
background: var(--wzl-bg);
|
|
713
|
+
}
|
|
714
|
+
.fg-lens-pixels {
|
|
715
|
+
position: absolute;
|
|
716
|
+
inset: 0;
|
|
717
|
+
width: 100%;
|
|
718
|
+
height: 100%;
|
|
719
|
+
image-rendering: pixelated;
|
|
720
|
+
}
|
|
721
|
+
.fg-lens-empty {
|
|
722
|
+
position: absolute;
|
|
723
|
+
inset: 0;
|
|
724
|
+
display: flex;
|
|
725
|
+
align-items: center;
|
|
726
|
+
justify-content: center;
|
|
727
|
+
padding: var(--wzl-space-4);
|
|
728
|
+
text-align: center;
|
|
729
|
+
font-size: 11px;
|
|
730
|
+
color: var(--wzl-fg-muted);
|
|
731
|
+
background: var(--wzl-bg);
|
|
732
|
+
}
|
|
733
|
+
.fg-lens-empty[hidden] {
|
|
734
|
+
display: none;
|
|
735
|
+
}
|
|
736
|
+
.fg-loupe-hint {
|
|
737
|
+
position: absolute;
|
|
738
|
+
left: var(--wzl-space-8);
|
|
739
|
+
bottom: var(--wzl-space-8);
|
|
740
|
+
z-index: 4;
|
|
741
|
+
}
|
|
742
|
+
.fg-lens-token__link {
|
|
743
|
+
padding: 0;
|
|
744
|
+
border: 0;
|
|
745
|
+
font: inherit;
|
|
746
|
+
color: inherit;
|
|
747
|
+
text-decoration: underline;
|
|
748
|
+
background: none;
|
|
749
|
+
cursor: pointer;
|
|
750
|
+
pointer-events: auto;
|
|
751
|
+
}
|
|
752
|
+
|
|
666
753
|
/* src/shell/cssVars/cssVars.css */
|
|
667
754
|
.fg-css-vars,
|
|
668
755
|
.fg-css-vars-focus {
|
|
@@ -736,4 +823,62 @@
|
|
|
736
823
|
.fg-css-vars__unused {
|
|
737
824
|
font-size: var(--wzl-font-size-sm);
|
|
738
825
|
}
|
|
826
|
+
.fg-css-vars__list [data-revealed] {
|
|
827
|
+
outline: var(--wzl-line-width) solid var(--wzl-accent);
|
|
828
|
+
outline-offset: 1px;
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
/* src/shell/keys/keys.css */
|
|
832
|
+
.fg-keys {
|
|
833
|
+
display: flex;
|
|
834
|
+
flex-direction: column;
|
|
835
|
+
gap: var(--wzl-space-sm);
|
|
836
|
+
min-width: 0;
|
|
837
|
+
}
|
|
838
|
+
.fg-keys__heading {
|
|
839
|
+
margin: 0 0 var(--wzl-space-xs);
|
|
840
|
+
color: var(--wzl-fg-subtle);
|
|
841
|
+
font-size: var(--wzl-font-size-xs);
|
|
842
|
+
font-weight: 600;
|
|
843
|
+
text-transform: capitalize;
|
|
844
|
+
}
|
|
845
|
+
.fg-keys__list {
|
|
846
|
+
display: flex;
|
|
847
|
+
flex-direction: column;
|
|
848
|
+
gap: var(--wzl-space-xs);
|
|
849
|
+
margin: 0;
|
|
850
|
+
padding: 0;
|
|
851
|
+
list-style: none;
|
|
852
|
+
}
|
|
853
|
+
.fg-keys__row {
|
|
854
|
+
display: flex;
|
|
855
|
+
align-items: baseline;
|
|
856
|
+
justify-content: space-between;
|
|
857
|
+
gap: var(--wzl-space-sm);
|
|
858
|
+
font-size: var(--wzl-font-size-sm);
|
|
859
|
+
}
|
|
860
|
+
.fg-keys__label {
|
|
861
|
+
min-width: 0;
|
|
862
|
+
}
|
|
863
|
+
.fg-keys__chips {
|
|
864
|
+
display: flex;
|
|
865
|
+
flex: none;
|
|
866
|
+
flex-wrap: wrap;
|
|
867
|
+
justify-content: flex-end;
|
|
868
|
+
gap: var(--wzl-space-xs);
|
|
869
|
+
}
|
|
870
|
+
.fg-keys__chip {
|
|
871
|
+
padding: 0 var(--wzl-space-xs);
|
|
872
|
+
border: var(--wzl-border-w) solid var(--wzl-line-subtle);
|
|
873
|
+
border-radius: var(--wzl-radius-sm);
|
|
874
|
+
color: var(--wzl-fg-muted);
|
|
875
|
+
font-family: inherit;
|
|
876
|
+
font-size: var(--wzl-font-size-xs);
|
|
877
|
+
white-space: nowrap;
|
|
878
|
+
}
|
|
879
|
+
.fg-keys__empty {
|
|
880
|
+
margin: 0;
|
|
881
|
+
color: var(--wzl-fg-muted);
|
|
882
|
+
font-size: var(--wzl-font-size-sm);
|
|
883
|
+
}
|
|
739
884
|
/*# sourceMappingURL=index.css.map */
|