@weasel-js/forge 1.5.0 → 1.5.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/{FrameController-Ba3LaWfq.d.ts → FrameController-BPfCt4PJ.d.ts} +68 -1
- package/dist/{chunk-O5OQZQRZ.js → chunk-2JDYOBWM.js} +5 -5
- package/dist/chunk-2JDYOBWM.js.map +1 -0
- package/dist/{chunk-KKF7ZX5E.js → chunk-2MADHLRA.js} +124 -23
- package/dist/chunk-2MADHLRA.js.map +1 -0
- package/dist/{chunk-UZCXH724.js → chunk-6SRQIHJQ.js} +3 -8
- package/dist/chunk-6SRQIHJQ.js.map +1 -0
- package/dist/{chunk-IOBG7GZQ.js → chunk-FTFR2YPM.js} +2 -2
- package/dist/chunk-FTFR2YPM.js.map +1 -0
- package/dist/chunk-TLO6UHF2.js +103 -0
- package/dist/chunk-TLO6UHF2.js.map +1 -0
- package/dist/{config-DdumOfyd.d.ts → config-CrLpfSq9.d.ts} +6 -2
- package/dist/csf/preview-api.js +2 -2
- package/dist/frame/index.d.ts +5 -4
- package/dist/frame/index.js +5 -5
- package/dist/index.d.ts +97 -5
- package/dist/index.js.map +1 -1
- package/dist/shell/index.css +97 -12
- package/dist/shell/index.css.map +1 -1
- package/dist/shell/index.d.ts +58 -4
- package/dist/shell/index.js +363 -173
- package/dist/shell/index.js.map +1 -1
- package/dist/test/index.d.ts +2 -2
- package/dist/test/index.js +7 -7
- package/dist/test/index.js.map +1 -1
- package/dist/test/play.d.ts +25 -0
- package/dist/test/play.js +14 -0
- package/dist/test/play.js.map +1 -0
- package/dist/vite/index.js +46 -13
- package/dist/vite/index.js.map +1 -1
- package/package.json +14 -5
- package/dist/chunk-IOBG7GZQ.js.map +0 -1
- package/dist/chunk-KKF7ZX5E.js.map +0 -1
- package/dist/chunk-KKVTFMWV.js +0 -59
- package/dist/chunk-KKVTFMWV.js.map +0 -1
- package/dist/chunk-O5OQZQRZ.js.map +0 -1
- package/dist/chunk-UZCXH724.js.map +0 -1
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
import { stableStringify } from './chunk-FTFR2YPM.js';
|
|
2
|
+
import { createContext } from 'react';
|
|
3
|
+
|
|
4
|
+
var coverOf = (value) => stableStringify(value) ?? " undefined";
|
|
5
|
+
var appliedLocal = (local, config) => Object.fromEntries(
|
|
6
|
+
Object.entries(local).filter(([key, entry]) => coverOf(config[key]) === entry.over).map(([key, entry]) => [key, entry.value])
|
|
7
|
+
);
|
|
8
|
+
var ArgsContext = createContext(null);
|
|
9
|
+
|
|
10
|
+
// src/csf/portSafe.ts
|
|
11
|
+
var g = globalThis;
|
|
12
|
+
var CLONED_WHOLE = new Set(
|
|
13
|
+
[
|
|
14
|
+
"Date",
|
|
15
|
+
"RegExp",
|
|
16
|
+
"ArrayBuffer",
|
|
17
|
+
"DataView",
|
|
18
|
+
"Int8Array",
|
|
19
|
+
"Uint8Array",
|
|
20
|
+
"Uint8ClampedArray",
|
|
21
|
+
"Int16Array",
|
|
22
|
+
"Uint16Array",
|
|
23
|
+
"Int32Array",
|
|
24
|
+
"Uint32Array",
|
|
25
|
+
"Float16Array",
|
|
26
|
+
"Float32Array",
|
|
27
|
+
"Float64Array",
|
|
28
|
+
"BigInt64Array",
|
|
29
|
+
"BigUint64Array"
|
|
30
|
+
].map((name) => g[name]?.prototype).filter(Boolean)
|
|
31
|
+
);
|
|
32
|
+
var hasOnlyClonedKeys = (v) => Reflect.ownKeys(v).every(
|
|
33
|
+
(key) => typeof key === "string" && (Object.prototype.propertyIsEnumerable.call(v, key) || Array.isArray(v) && key === "length")
|
|
34
|
+
);
|
|
35
|
+
function isPortSafe(value) {
|
|
36
|
+
const seen = /* @__PURE__ */ new Set();
|
|
37
|
+
const safe = (v) => {
|
|
38
|
+
if (v === null) return true;
|
|
39
|
+
if (typeof v !== "object") return typeof v !== "function" && typeof v !== "symbol";
|
|
40
|
+
if (seen.has(v)) return true;
|
|
41
|
+
seen.add(v);
|
|
42
|
+
const proto = Object.getPrototypeOf(v);
|
|
43
|
+
if (CLONED_WHOLE.has(proto)) return true;
|
|
44
|
+
if (proto === Map.prototype)
|
|
45
|
+
return hasOnlyClonedKeys(v) && [...v].every(([key, member]) => safe(key) && safe(member));
|
|
46
|
+
if (proto === Set.prototype) return hasOnlyClonedKeys(v) && [...v].every(safe);
|
|
47
|
+
if (proto !== Array.prototype && proto !== Object.prototype && proto !== null) return false;
|
|
48
|
+
return hasOnlyClonedKeys(v) && Object.values(v).every(safe);
|
|
49
|
+
};
|
|
50
|
+
try {
|
|
51
|
+
return safe(value);
|
|
52
|
+
} catch {
|
|
53
|
+
return false;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
var isPlainOrNull = (v) => {
|
|
57
|
+
if (!v || typeof v !== "object") return false;
|
|
58
|
+
const proto = Object.getPrototypeOf(v);
|
|
59
|
+
return proto === Object.prototype || proto === null;
|
|
60
|
+
};
|
|
61
|
+
var splittable = (v) => (Array.isArray(v) ? Object.getPrototypeOf(v) === Array.prototype : isPlainOrNull(v) && !("$$typeof" in v)) && hasOnlyClonedKeys(v);
|
|
62
|
+
function portSafePart(value) {
|
|
63
|
+
const walking = /* @__PURE__ */ new Set();
|
|
64
|
+
const part = (v) => {
|
|
65
|
+
if (isPortSafe(v)) return { value: v };
|
|
66
|
+
if (!splittable(v) || walking.has(v)) return null;
|
|
67
|
+
walking.add(v);
|
|
68
|
+
try {
|
|
69
|
+
if (Array.isArray(v)) return { value: v.map((member) => part(member)?.value ?? null) };
|
|
70
|
+
const out = {};
|
|
71
|
+
for (const [key, member] of Object.entries(v)) {
|
|
72
|
+
const kept = part(member);
|
|
73
|
+
if (kept) out[key] = kept.value;
|
|
74
|
+
}
|
|
75
|
+
return { value: out };
|
|
76
|
+
} finally {
|
|
77
|
+
walking.delete(v);
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
try {
|
|
81
|
+
return part(value);
|
|
82
|
+
} catch {
|
|
83
|
+
return null;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
function withUnsent(sent, original) {
|
|
87
|
+
if (isPortSafe(original)) return sent;
|
|
88
|
+
if (sent === null && portSafePart(original) === null) return original;
|
|
89
|
+
if (Array.isArray(original) && Array.isArray(sent))
|
|
90
|
+
return sent.map((member, i) => i < original.length ? withUnsent(member, original[i]) : member);
|
|
91
|
+
if (!splittable(original) || Array.isArray(original) || !isPlainOrNull(sent)) return sent;
|
|
92
|
+
const out = {};
|
|
93
|
+
for (const [key, member] of Object.entries(original)) {
|
|
94
|
+
if (key in sent) out[key] = withUnsent(sent[key], member);
|
|
95
|
+
else if (portSafePart(member) === null) out[key] = member;
|
|
96
|
+
}
|
|
97
|
+
for (const [key, member] of Object.entries(sent)) if (!(key in original)) out[key] = member;
|
|
98
|
+
return out;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
export { ArgsContext, appliedLocal, coverOf, isPortSafe, portSafePart, withUnsent };
|
|
102
|
+
//# sourceMappingURL=chunk-TLO6UHF2.js.map
|
|
103
|
+
//# sourceMappingURL=chunk-TLO6UHF2.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/csf/argsContext.ts","../src/csf/portSafe.ts"],"names":[],"mappings":";;;AAcO,IAAM,OAAA,GAAU,CAAC,KAAA,KAA2B,eAAA,CAAgB,KAAK,CAAA,IAAK;AAGtE,IAAM,YAAA,GAAe,CAAC,KAAA,EAAkB,MAAA,KAC7C,MAAA,CAAO,WAAA;AAAA,EACL,MAAA,CAAO,OAAA,CAAQ,KAAK,CAAA,CACjB,MAAA,CAAO,CAAC,CAAC,GAAA,EAAK,KAAK,CAAA,KAAM,OAAA,CAAQ,MAAA,CAAO,GAAG,CAAC,CAAA,KAAM,KAAA,CAAM,IAAI,CAAA,CAC5D,GAAA,CAAI,CAAC,CAAC,GAAA,EAAK,KAAK,CAAA,KAAM,CAAC,GAAA,EAAK,KAAA,CAAM,KAAK,CAAC;AAC7C;AAeK,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C,EAAA,IAAI,SAAS,IAAA,IAAQ,YAAA,CAAa,QAAQ,CAAA,KAAM,MAAM,OAAO,QAAA;AAC7D,EAAA,IAAI,MAAM,OAAA,CAAQ,QAAQ,CAAA,IAAK,KAAA,CAAM,QAAQ,IAAI,CAAA;AAC/C,IAAA,OAAO,IAAA,CAAK,GAAA,CAAI,CAAC,MAAA,EAAQ,MAAO,CAAA,GAAI,QAAA,CAAS,MAAA,GAAS,UAAA,CAAW,MAAA,EAAQ,QAAA,CAAS,CAAC,CAAC,IAAI,MAAO,CAAA;AACjG,EAAA,IAAI,CAAC,UAAA,CAAW,QAAQ,CAAA,IAAK,KAAA,CAAM,OAAA,CAAQ,QAAQ,CAAA,IAAK,CAAC,aAAA,CAAc,IAAI,CAAA,EAAG,OAAO,IAAA;AACrF,EAAA,MAAM,MAA+B,EAAC;AACtC,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,MAAM,KAAK,MAAA,CAAO,OAAA,CAAQ,QAAQ,CAAA,EAAG;AACpD,IAAA,IAAI,GAAA,IAAO,MAAM,GAAA,CAAI,GAAG,IAAI,UAAA,CAAW,IAAA,CAAK,GAAG,CAAA,EAAG,MAAM,CAAA;AAAA,SAAA,IAC/C,aAAa,MAAM,CAAA,KAAM,IAAA,EAAM,GAAA,CAAI,GAAG,CAAA,GAAI,MAAA;AAAA,EACrD;AACA,EAAA,KAAA,MAAW,CAAC,GAAA,EAAK,MAAM,CAAA,IAAK,OAAO,OAAA,CAAQ,IAAI,CAAA,EAAG,IAAI,EAAE,GAAA,IAAO,QAAA,CAAA,EAAW,GAAA,CAAI,GAAG,CAAA,GAAI,MAAA;AACrF,EAAA,OAAO,GAAA;AACT","file":"chunk-TLO6UHF2.js","sourcesContent":["import { type Context, createContext, type Dispatch, type SetStateAction } from 'react';\nimport { stableStringify } from '../protocol/messages';\n\ntype Args = Record<string, unknown>;\n\n/** A frame-local arg, and the config value it was set over: it applies only while config still holds that. */\nexport interface LocalArg {\n value: unknown;\n over: string;\n}\n\nexport type LocalArgs = Record<string, LocalArg>;\n\n/** A config value in the form `LocalArg.over` records. */\nexport const coverOf = (value: unknown): string => stableStringify(value) ?? ' undefined';\n\n/** The frame-local values that still apply over `config`. */\nexport const appliedLocal = (local: LocalArgs, config: Args): Args =>\n Object.fromEntries(\n Object.entries(local)\n .filter(([key, entry]) => coverOf(config[key]) === entry.over)\n .map(([key, entry]) => [key, entry.value]),\n );\n\nexport interface ArgsScope {\n /** The args the story renders with: its own, then config, then the frame-local ones that still apply. */\n args: Args;\n /** The trial's config as it stands. An `undefined` key means the story's own arg. */\n config: Args;\n defaults: Args;\n /** The story's own args, before config and the frame-local ones. */\n original: Args;\n setConfig: (path: string, value: unknown) => void;\n /** Args a MessagePort would not deliver intact, kept in the frame because config crosses one. */\n setLocal: Dispatch<SetStateAction<LocalArgs>>;\n}\n\nexport const ArgsContext: Context<ArgsScope | null> = createContext<ArgsScope | null>(null);\n","const g = globalThis as Record<string, unknown>;\nconst CLONED_WHOLE = new Set<unknown>(\n [\n 'Date',\n 'RegExp',\n 'ArrayBuffer',\n 'DataView',\n 'Int8Array',\n 'Uint8Array',\n 'Uint8ClampedArray',\n 'Int16Array',\n 'Uint16Array',\n 'Int32Array',\n 'Uint32Array',\n 'Float16Array',\n 'Float32Array',\n 'Float64Array',\n 'BigInt64Array',\n 'BigUint64Array',\n ]\n .map((name) => (g[name] as { prototype?: object } | undefined)?.prototype)\n .filter(Boolean),\n);\n\n/** Own keys a clone keeps: enumerable string keys, plus an array's `length`. */\nconst hasOnlyClonedKeys = (v: object): boolean =>\n Reflect.ownKeys(v).every(\n (key) =>\n typeof key === 'string' &&\n (Object.prototype.propertyIsEnumerable.call(v, key) || (Array.isArray(v) && key === 'length')),\n );\n\n/**\n * Whether a MessagePort delivers `value` as the same thing it was. `structuredClone` succeeding is\n * not enough: it copies a class instance's fields onto a plain object and drops its methods.\n */\nexport function isPortSafe(value: unknown): boolean {\n const seen = new Set<object>();\n const safe = (v: unknown): boolean => {\n if (v === null) return true;\n if (typeof v !== 'object') return typeof v !== 'function' && typeof v !== 'symbol';\n if (seen.has(v)) return true;\n seen.add(v);\n const proto = Object.getPrototypeOf(v);\n if (CLONED_WHOLE.has(proto)) return true;\n if (proto === Map.prototype)\n return hasOnlyClonedKeys(v) && [...(v as Map<unknown, unknown>)].every(([key, member]) => safe(key) && safe(member));\n if (proto === Set.prototype) return hasOnlyClonedKeys(v) && [...(v as Set<unknown>)].every(safe);\n if (proto !== Array.prototype && proto !== Object.prototype && proto !== null) return false;\n return hasOnlyClonedKeys(v) && Object.values(v).every(safe);\n };\n try {\n return safe(value);\n } catch {\n return false;\n }\n}\n\nconst isPlainOrNull = (v: unknown): v is Record<string, unknown> => {\n if (!v || typeof v !== 'object') return false;\n const proto = Object.getPrototypeOf(v);\n return proto === Object.prototype || proto === null;\n};\n\n/** A plain object or array whose members can be split: React elements are plain objects, but whole. */\nconst splittable = (v: unknown): v is Record<string, unknown> | unknown[] =>\n (Array.isArray(v) ? Object.getPrototypeOf(v) === Array.prototype : isPlainOrNull(v) && !('$$typeof' in v)) &&\n hasOnlyClonedKeys(v as object);\n\n/**\n * The part of `value` a port delivers intact, or null when none of it can cross. A plain object\n * keeps its port-safe fields; an array holds null where a member has no part.\n */\nexport function portSafePart(value: unknown): { value: unknown } | null {\n const walking = new Set<object>();\n const part = (v: unknown): { value: unknown } | null => {\n if (isPortSafe(v)) return { value: v };\n if (!splittable(v) || walking.has(v)) return null;\n walking.add(v);\n try {\n if (Array.isArray(v)) return { value: v.map((member) => part(member)?.value ?? null) };\n const out: Record<string, unknown> = {};\n for (const [key, member] of Object.entries(v)) {\n const kept = part(member);\n if (kept) out[key] = kept.value;\n }\n return { value: out };\n } finally {\n walking.delete(v);\n }\n };\n try {\n return part(value);\n } catch {\n return null;\n }\n}\n\n/** `sent`, a value that crossed the port as `portSafePart(original)` or an edit of it, with what the part left behind put back. */\nexport function withUnsent(sent: unknown, original: unknown): unknown {\n if (isPortSafe(original)) return sent;\n if (sent === null && portSafePart(original) === null) return original;\n if (Array.isArray(original) && Array.isArray(sent))\n return sent.map((member, i) => (i < original.length ? withUnsent(member, original[i]) : member));\n if (!splittable(original) || Array.isArray(original) || !isPlainOrNull(sent)) return sent;\n const out: Record<string, unknown> = {};\n for (const [key, member] of Object.entries(original)) {\n if (key in sent) out[key] = withUnsent(sent[key], member);\n else if (portSafePart(member) === null) out[key] = member;\n }\n for (const [key, member] of Object.entries(sent)) if (!(key in original)) out[key] = member;\n return out;\n}\n"]}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { LabContribution } from '@weasel-js/labkit';
|
|
1
|
+
import { LabContribution, LabPage } from '@weasel-js/labkit';
|
|
2
2
|
import { ControlRenderer } from '@weasel-js/labkit/config';
|
|
3
|
-
import { F as FrameSetup } from './FrameController-
|
|
3
|
+
import { F as FrameSetup } from './FrameController-BPfCt4PJ.js';
|
|
4
4
|
|
|
5
5
|
/** One global the workshop's toolbar sets for every story, and a trial may pin for its own. */
|
|
6
6
|
interface GlobalDeclaration {
|
|
@@ -19,6 +19,10 @@ interface ShellConfig {
|
|
|
19
19
|
controls?: Record<string, ControlRenderer>;
|
|
20
20
|
/** Globals the lab's header sets for every story, each pinnable per trial. Frames apply them with `applyGlobals`. */
|
|
21
21
|
globals?: GlobalDeclarations;
|
|
22
|
+
/** The project's other labs, offered in the workshop's title menu. */
|
|
23
|
+
pages?: readonly LabPage[];
|
|
24
|
+
/** Which of `pages` the workshop is, when the URL alone cannot say, as across dev servers on different ports. */
|
|
25
|
+
path?: string;
|
|
22
26
|
}
|
|
23
27
|
/** A frame config module's default export. Only frame documents import it, so its CSS stays out of the workshop. */
|
|
24
28
|
declare function defineFrameConfig(config: FrameSetup): FrameSetup;
|
package/dist/csf/preview-api.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { ArgsContext, coverOf, isPortSafe } from '../chunk-
|
|
2
|
-
import '../chunk-
|
|
1
|
+
import { ArgsContext, coverOf, isPortSafe } from '../chunk-TLO6UHF2.js';
|
|
2
|
+
import '../chunk-FTFR2YPM.js';
|
|
3
3
|
import { useContext } from 'react';
|
|
4
4
|
|
|
5
5
|
var sendable = (value) => {
|
package/dist/frame/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { F as FrameSetup, L as LoadedStory } from '../FrameController-
|
|
2
|
-
export {
|
|
1
|
+
import { F as FrameSetup, L as LoadedStory } from '../FrameController-BPfCt4PJ.js';
|
|
2
|
+
export { d as StartFrameOptions, r as reportImportFault, s as startFrame } from '../FrameController-BPfCt4PJ.js';
|
|
3
3
|
import '@weasel-js/labkit/config';
|
|
4
4
|
import 'react';
|
|
5
5
|
|
|
@@ -8,15 +8,16 @@ interface FrameImporters {
|
|
|
8
8
|
}
|
|
9
9
|
interface FrameIndexEntry {
|
|
10
10
|
id: string;
|
|
11
|
+
/** The story's title as indexed, which titles the file's stories when its meta names none. */
|
|
12
|
+
title: string;
|
|
11
13
|
file: string;
|
|
12
14
|
exportName: string;
|
|
13
15
|
}
|
|
14
16
|
interface MountFrameOptions {
|
|
15
17
|
index: readonly FrameIndexEntry[];
|
|
16
18
|
importers: FrameImporters;
|
|
17
|
-
root: string;
|
|
18
19
|
setup?: FrameSetup;
|
|
19
|
-
load?: (mod: Record<string, unknown>,
|
|
20
|
+
load?: (mod: Record<string, unknown>, autoTitle: string, parameters?: Record<string, unknown>) => LoadedStory[];
|
|
20
21
|
}
|
|
21
22
|
/** The frame document's entry: takes the shell's port, loads the story named by the hash, and starts it. */
|
|
22
23
|
declare function mountFrame(options: MountFrameOptions): Promise<void>;
|
package/dist/frame/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { mountFrame, reportImportFault, startFrame } from '../chunk-
|
|
1
|
+
export { mountFrame, reportImportFault, startFrame } from '../chunk-2MADHLRA.js';
|
|
2
2
|
import '../chunk-2GXKNXTJ.js';
|
|
3
|
-
import '../chunk-
|
|
4
|
-
import '../chunk-
|
|
5
|
-
import '../chunk-
|
|
6
|
-
import '../chunk-
|
|
3
|
+
import '../chunk-6SRQIHJQ.js';
|
|
4
|
+
import '../chunk-2JDYOBWM.js';
|
|
5
|
+
import '../chunk-TLO6UHF2.js';
|
|
6
|
+
import '../chunk-FTFR2YPM.js';
|
|
7
7
|
//# sourceMappingURL=index.js.map
|
|
8
8
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.ts
CHANGED
|
@@ -1,11 +1,103 @@
|
|
|
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-
|
|
3
|
-
import {
|
|
4
|
-
|
|
2
|
+
export { G as GlobalDeclaration, a as GlobalDeclarations, S as ShellConfig, d as defineFrameConfig, b as defineShellConfig } from './config-CrLpfSq9.js';
|
|
3
|
+
import { ComponentType, ReactNode } from 'react';
|
|
4
|
+
import { G as Globals, M as MetaSpec, S as StorySpec } from './FrameController-BPfCt4PJ.js';
|
|
5
|
+
export { A as A11yFinding, a as A11yNode, b as A11yReport, D as Decorator, F as FrameSetup, L as LoadedStory, P as PlayContext, c as StoryContext } from './FrameController-BPfCt4PJ.js';
|
|
5
6
|
import '@weasel-js/labkit';
|
|
6
|
-
|
|
7
|
+
|
|
8
|
+
/** Storybook's conditional control: shown only while an arg, or a global, meets the test. */
|
|
9
|
+
type ArgCondition = ({
|
|
10
|
+
arg: string;
|
|
11
|
+
} | {
|
|
12
|
+
global: string;
|
|
13
|
+
}) & {
|
|
14
|
+
truthy?: boolean;
|
|
15
|
+
exists?: boolean;
|
|
16
|
+
eq?: unknown;
|
|
17
|
+
neq?: unknown;
|
|
18
|
+
};
|
|
19
|
+
/** A CSF `argTypes` entry, as far as forge reads it. */
|
|
20
|
+
interface ArgType {
|
|
21
|
+
name?: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
control?: string | false | {
|
|
24
|
+
type?: string;
|
|
25
|
+
min?: number;
|
|
26
|
+
max?: number;
|
|
27
|
+
step?: number;
|
|
28
|
+
};
|
|
29
|
+
options?: readonly unknown[];
|
|
30
|
+
table?: {
|
|
31
|
+
disable?: boolean;
|
|
32
|
+
};
|
|
33
|
+
if?: ArgCondition;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* The CSF surface forge reads, as types a story file can annotate itself with.
|
|
38
|
+
*
|
|
39
|
+
* Component Story Format is a plain-module convention — a default export of
|
|
40
|
+
* meta, one named export per story — and forge's loader (`loadCsfModule`)
|
|
41
|
+
* implements it directly. These types are that loader's `Annotations`
|
|
42
|
+
* interface made public, so a CSF file is typed by the tool that runs it.
|
|
43
|
+
*
|
|
44
|
+
* They are deliberately narrower than Storybook's: what is here is what forge
|
|
45
|
+
* reads. A field forge ignores is a field a story should not be writing.
|
|
46
|
+
*/
|
|
47
|
+
|
|
48
|
+
/** The props a story's args describe: a component type resolves to its props,
|
|
49
|
+
* and a bare props type stands for itself. */
|
|
50
|
+
type ArgsOf<T> = T extends ComponentType<infer P> ? P : T;
|
|
51
|
+
/** What a `render`, `decorators` entry or `play` is handed alongside the args. */
|
|
52
|
+
interface CsfStoryContext {
|
|
53
|
+
args: Record<string, unknown>;
|
|
54
|
+
globals: Globals;
|
|
55
|
+
parameters: Record<string, unknown>;
|
|
56
|
+
title: string;
|
|
57
|
+
name: string;
|
|
58
|
+
id: string;
|
|
59
|
+
viewMode: 'story';
|
|
60
|
+
}
|
|
61
|
+
/** Groups a play function's steps for reporting. */
|
|
62
|
+
type CsfStep = (label: string, fn: () => void | Promise<void>) => Promise<void>;
|
|
63
|
+
/** What a `play` is handed: the story context, the element the story mounted
|
|
64
|
+
* into, and `step`. */
|
|
65
|
+
interface CsfPlayContext extends CsfStoryContext {
|
|
66
|
+
canvasElement: HTMLElement;
|
|
67
|
+
step: CsfStep;
|
|
68
|
+
}
|
|
69
|
+
/** Wraps a story. `Story` renders whatever it wraps — the next decorator in,
|
|
70
|
+
* or the story itself. */
|
|
71
|
+
type CsfDecorator = (Story: ComponentType, context: CsfStoryContext) => ReactNode;
|
|
72
|
+
/** Fields a meta and a story both accept. A story's value wins. */
|
|
73
|
+
interface Shared<T> {
|
|
74
|
+
args?: Partial<ArgsOf<T>>;
|
|
75
|
+
argTypes?: Partial<Record<keyof ArgsOf<T> & string, ArgType>> & Record<string, ArgType>;
|
|
76
|
+
parameters?: Record<string, unknown>;
|
|
77
|
+
globals?: Record<string, unknown>;
|
|
78
|
+
decorators?: CsfDecorator | CsfDecorator[];
|
|
79
|
+
render?: (args: ArgsOf<T>, context: CsfStoryContext) => ReactNode;
|
|
80
|
+
play?: (context: CsfPlayContext) => void | Promise<void>;
|
|
81
|
+
}
|
|
82
|
+
/** A CSF file's default export: what its stories share, and where they sit in
|
|
83
|
+
* the sidebar. */
|
|
84
|
+
interface Meta<T = unknown> extends Shared<T> {
|
|
85
|
+
/** Sidebar path, `/`-separated. Derived from the file's location when omitted. */
|
|
86
|
+
title?: string;
|
|
87
|
+
component?: ComponentType<ArgsOf<T>>;
|
|
88
|
+
/** Named exports to index as stories. Everything not excluded, by default. */
|
|
89
|
+
includeStories?: string[] | RegExp;
|
|
90
|
+
excludeStories?: string[] | RegExp;
|
|
91
|
+
}
|
|
92
|
+
/** One story: a named export of a CSF file. */
|
|
93
|
+
interface StoryObj<T = unknown> extends Shared<T> {
|
|
94
|
+
/** Overrides the name derived from the export's identifier. */
|
|
95
|
+
name?: string;
|
|
96
|
+
/** Storybook's older spelling of `name`; forge reads both. */
|
|
97
|
+
storyName?: string;
|
|
98
|
+
}
|
|
7
99
|
|
|
8
100
|
declare function meta(spec: MetaSpec): MetaSpec;
|
|
9
101
|
declare function story<C = Record<string, never>, S = undefined>(spec: StorySpec<C, S>): StorySpec<C, S>;
|
|
10
102
|
|
|
11
|
-
export { MetaSpec, StorySpec, meta, story };
|
|
103
|
+
export { type ArgType, type ArgsOf, type CsfDecorator, type CsfPlayContext, type CsfStep, type CsfStoryContext, type Meta, MetaSpec, type StoryObj, StorySpec, meta, story };
|
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":";;;;AAkBO,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 { ControlRenderer } from '@weasel-js/labkit/config';\nimport type { FrameSetup } from './frame/FrameController';\nimport type { GlobalDeclarations } from './shell/globals';\n\n/** A shell config module: what the workshop adds to the lab. Only the workshop page imports it. */\nexport interface ShellConfig {\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 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}\n\n/** A frame config module's default export. Only frame documents import it, so its CSS stays out of the workshop. */\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"]}
|
package/dist/shell/index.css
CHANGED
|
@@ -31,6 +31,16 @@
|
|
|
31
31
|
width: 100%;
|
|
32
32
|
height: 100%;
|
|
33
33
|
border: 0;
|
|
34
|
+
transition: opacity var(--wzl-motion-fast) var(--wzl-ease-out-cubic);
|
|
35
|
+
}
|
|
36
|
+
.fg-frame-view[data-pending] {
|
|
37
|
+
visibility: hidden;
|
|
38
|
+
opacity: 0;
|
|
39
|
+
}
|
|
40
|
+
@media (prefers-reduced-motion: reduce) {
|
|
41
|
+
.fg-frame-view {
|
|
42
|
+
transition: none;
|
|
43
|
+
}
|
|
34
44
|
}
|
|
35
45
|
.fg-fault {
|
|
36
46
|
position: absolute;
|
|
@@ -80,6 +90,7 @@
|
|
|
80
90
|
.fg-tree__filter {
|
|
81
91
|
box-sizing: border-box;
|
|
82
92
|
width: 100%;
|
|
93
|
+
font-size: var(--wzl-font-size);
|
|
83
94
|
}
|
|
84
95
|
.fg-tree__items,
|
|
85
96
|
.fg-tree__group {
|
|
@@ -87,7 +98,7 @@
|
|
|
87
98
|
flex-direction: column;
|
|
88
99
|
}
|
|
89
100
|
.fg-tree__items {
|
|
90
|
-
font-size: var(--wzl-font-size
|
|
101
|
+
font-size: var(--wzl-font-size);
|
|
91
102
|
}
|
|
92
103
|
.fg-tree__group {
|
|
93
104
|
padding-inline-start: var(--wzl-space-sm);
|
|
@@ -165,34 +176,108 @@
|
|
|
165
176
|
flex-direction: column;
|
|
166
177
|
gap: var(--wzl-space-xs);
|
|
167
178
|
}
|
|
168
|
-
.fg-css-
|
|
179
|
+
.fg-css-vars-focus {
|
|
169
180
|
display: flex;
|
|
170
181
|
flex-direction: column;
|
|
171
182
|
gap: var(--wzl-space-xs);
|
|
172
|
-
|
|
173
|
-
overflow: auto;
|
|
183
|
+
min-width: 0;
|
|
174
184
|
}
|
|
175
|
-
.fg-css-
|
|
185
|
+
.fg-css-vars__trial {
|
|
176
186
|
margin: 0;
|
|
187
|
+
overflow: hidden;
|
|
177
188
|
color: var(--wzl-fg-muted);
|
|
178
189
|
font-size: var(--wzl-font-size-sm);
|
|
190
|
+
text-overflow: ellipsis;
|
|
191
|
+
white-space: nowrap;
|
|
179
192
|
}
|
|
180
|
-
.fg-css-
|
|
193
|
+
.fg-css-vars__controls {
|
|
194
|
+
position: sticky;
|
|
195
|
+
top: 0;
|
|
196
|
+
z-index: 1;
|
|
181
197
|
display: flex;
|
|
182
|
-
|
|
198
|
+
flex-direction: column;
|
|
183
199
|
gap: var(--wzl-space-xs);
|
|
184
|
-
|
|
200
|
+
padding-block-end: var(--wzl-space-xs);
|
|
201
|
+
background: var(--wzl-surface);
|
|
185
202
|
}
|
|
186
|
-
.fg-css-
|
|
187
|
-
|
|
188
|
-
|
|
203
|
+
.fg-css-vars__empty {
|
|
204
|
+
margin: 0;
|
|
205
|
+
color: var(--wzl-fg-muted);
|
|
206
|
+
font-size: var(--wzl-font-size-sm);
|
|
189
207
|
}
|
|
190
208
|
.fg-globals {
|
|
191
209
|
display: flex;
|
|
192
210
|
align-items: center;
|
|
193
211
|
gap: var(--wzl-space-xs);
|
|
194
212
|
}
|
|
195
|
-
.fg-
|
|
213
|
+
.fg-a11y,
|
|
214
|
+
.fg-a11y-focus {
|
|
215
|
+
display: flex;
|
|
216
|
+
flex-direction: column;
|
|
217
|
+
gap: var(--wzl-space-xs);
|
|
218
|
+
min-width: 0;
|
|
219
|
+
}
|
|
220
|
+
.fg-a11y__trial {
|
|
221
|
+
margin: 0;
|
|
222
|
+
overflow: hidden;
|
|
223
|
+
color: var(--wzl-fg-muted);
|
|
224
|
+
font-size: var(--wzl-font-size-sm);
|
|
225
|
+
text-overflow: ellipsis;
|
|
226
|
+
white-space: nowrap;
|
|
227
|
+
}
|
|
228
|
+
.fg-a11y__controls {
|
|
229
|
+
display: flex;
|
|
230
|
+
gap: var(--wzl-space-xs);
|
|
231
|
+
}
|
|
232
|
+
.fg-a11y__note,
|
|
233
|
+
.fg-a11y__tally {
|
|
234
|
+
margin: 0;
|
|
235
|
+
color: var(--wzl-fg-muted);
|
|
236
|
+
font-size: var(--wzl-font-size-sm);
|
|
237
|
+
font-variant-numeric: tabular-nums;
|
|
238
|
+
}
|
|
239
|
+
.fg-a11y__group {
|
|
240
|
+
display: flex;
|
|
241
|
+
flex-direction: column;
|
|
242
|
+
gap: var(--wzl-space-xs);
|
|
243
|
+
}
|
|
244
|
+
.fg-a11y__group-title {
|
|
245
|
+
margin: 0;
|
|
196
246
|
font-size: var(--wzl-font-size-sm);
|
|
247
|
+
font-variant-numeric: tabular-nums;
|
|
248
|
+
}
|
|
249
|
+
.fg-a11y__findings,
|
|
250
|
+
.fg-a11y__nodes {
|
|
251
|
+
display: flex;
|
|
252
|
+
flex-direction: column;
|
|
253
|
+
gap: var(--wzl-space-xs);
|
|
254
|
+
margin: 0;
|
|
255
|
+
padding: 0;
|
|
256
|
+
list-style: none;
|
|
257
|
+
}
|
|
258
|
+
.fg-a11y__finding {
|
|
259
|
+
border-inline-start: 2px solid var(--wzl-border);
|
|
260
|
+
padding-inline-start: var(--wzl-space-xs);
|
|
261
|
+
}
|
|
262
|
+
.fg-a11y__help {
|
|
263
|
+
display: flex;
|
|
264
|
+
align-items: baseline;
|
|
265
|
+
gap: var(--wzl-space-xs);
|
|
266
|
+
margin: 0;
|
|
267
|
+
font-size: var(--wzl-font-size-sm);
|
|
268
|
+
}
|
|
269
|
+
.fg-a11y__impact {
|
|
270
|
+
color: var(--wzl-fg-muted);
|
|
271
|
+
font-size: var(--wzl-font-size-xs);
|
|
272
|
+
text-transform: uppercase;
|
|
273
|
+
}
|
|
274
|
+
.fg-a11y__impact[data-impact=serious],
|
|
275
|
+
.fg-a11y__impact[data-impact=critical] {
|
|
276
|
+
color: var(--wzl-danger);
|
|
277
|
+
}
|
|
278
|
+
.fg-a11y__nodes {
|
|
279
|
+
color: var(--wzl-fg-muted);
|
|
280
|
+
font-size: var(--wzl-font-size-xs);
|
|
281
|
+
word-break: break-all;
|
|
197
282
|
}
|
|
198
283
|
/*# sourceMappingURL=index.css.map */
|
package/dist/shell/index.css.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/shell/shell.css"],"sourcesContent":[".fg-empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--wzl-space-xs);\n min-height: 100vh;\n padding-inline: var(--wzl-space-md);\n background: var(--wzl-surface-sunken);\n color: var(--wzl-fg);\n}\n\n.fg-empty__title {\n margin: 0;\n font-weight: var(--wzl-font-weight-bold);\n}\n\n.fg-empty__globs {\n margin: 0;\n padding: 0;\n list-style: none;\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-frame-host {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.fg-frame-view {\n display: block;\n width: 100%;\n height: 100%;\n border: 0;\n}\n\n.fg-fault {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n padding: var(--wzl-space-md);\n overflow: auto;\n background: var(--wzl-surface-sunken);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-fault__phase {\n color: var(--wzl-danger);\n font-weight: var(--wzl-font-weight-bold);\n text-transform: uppercase;\n}\n\n.fg-fault__message {\n margin: 0;\n white-space: pre-wrap;\n}\n\n.fg-tree {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n padding: 0 var(--wzl-space-xs) var(--wzl-space-xs);\n border-bottom: var(--wzl-border-w) solid var(--wzl-line-subtle);\n color: var(--wzl-fg);\n}\n\n.fg-tree__heading {\n margin: 0;\n padding-block: var(--wzl-space-xs);\n color: var(--wzl-fg-muted);\n font-family: var(--wzl-font-display);\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-normal);\n letter-spacing: 0.08em;\n text-transform: uppercase;\n}\n\n.fg-route-miss {\n margin: 0;\n color: var(--wzl-danger);\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-tree__filter {\n box-sizing: border-box;\n width: 100%;\n}\n\n.fg-tree__items,\n.fg-tree__group {\n display: flex;\n flex-direction: column;\n}\n\n.fg-tree__items {\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-tree__group {\n padding-inline-start: var(--wzl-space-sm);\n}\n\n.fg-tree__node {\n display: flex;\n flex-direction: column;\n min-width: 0;\n outline: none;\n}\n\n.fg-tree__item {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-xs);\n padding: calc(var(--wzl-space-xs) / 2) var(--wzl-space-xs);\n border-radius: var(--wzl-radius-sm);\n overflow: hidden;\n color: inherit;\n text-decoration: none;\n white-space: nowrap;\n cursor: pointer;\n}\n\n/* text-overflow does not reach a flex container's anonymous text box, so the label clips itself. */\n.fg-tree__label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.fg-tree__item:hover {\n background: var(--wzl-surface-hover);\n}\n\n/* A folder item holds its group, so its ring goes on its own row rather than around the subtree. */\n.fg-tree__story:focus-visible,\n.fg-tree__node:focus-visible > .fg-tree__folder {\n outline: var(--wzl-line-width) solid var(--wzl-accent);\n outline-offset: calc(-1 * var(--wzl-line-width));\n}\n\n.fg-tree__item[aria-current='true'] {\n color: var(--wzl-accent);\n}\n\n/* Drawn with borders rather than a glyph, which would join the item's accessible name. */\n.fg-tree__folder::before {\n content: '';\n flex: none;\n width: 0.35em;\n height: 0.35em;\n border: solid currentColor;\n border-width: 0 1.5px 1.5px 0;\n transform: rotate(-45deg);\n}\n\n.fg-tree__node[aria-expanded='true'] > .fg-tree__folder::before {\n transform: rotate(45deg);\n}\n\n.fg-tree__story {\n padding-inline-start: calc(var(--wzl-space-xs) * 2 + 0.35em);\n}\n\n.lk-trial.fg-flash {\n outline: var(--wzl-line-width) solid var(--wzl-accent);\n outline-offset: calc(-1 * var(--wzl-line-width));\n animation: fg-flash 600ms ease-out forwards;\n}\n\n@keyframes fg-flash {\n from {\n outline-color: var(--wzl-accent);\n }\n to {\n outline-color: transparent;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .lk-trial.fg-flash {\n animation: none;\n }\n}\n\n.fg-css-vars {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n}\n\n.fg-css-vars__list {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n max-height: 60vh;\n overflow: auto;\n}\n\n.fg-css-vars__empty {\n margin: 0;\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-css-var {\n display: flex;\n align-items: flex-end;\n gap: var(--wzl-space-xs);\n font-family: var(--wzl-font-mono);\n}\n\n.fg-css-var__rows {\n flex: 1;\n min-width: 0;\n}\n\n.fg-globals {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-xs);\n}\n\n.fg-globals__select {\n font-size: var(--wzl-font-size-sm);\n}\n"],"mappings":";AAAA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,eAAa;AACb,mBAAiB;AACjB,OAAK,IAAI;AACT,cAAY;AACZ,kBAAgB,IAAI;AACpB,cAAY,IAAI;AAChB,SAAO,IAAI;AACb;AAEA,CAAC;AACC,UAAQ;AACR,eAAa,IAAI;AACnB;AAEA,CAAC;AACC,UAAQ;AACR,WAAS;AACT,cAAY;AACZ,eAAa,IAAI;AACjB,aAAW,IAAI;AACjB;AAEA,CAAC;AACC,YAAU;AACV,SAAO;AACP,UAAQ;AACV;AAEA,CAAC;AACC,WAAS;AACT,SAAO;AACP,UAAQ;AACR,UAAQ;AACV;AAEA,CAAC;AACC,YAAU;AACV,SAAO;AACP,WAAS;AACT,kBAAgB;AAChB,OAAK,IAAI;AACT,WAAS,IAAI;AACb,YAAU;AACV,cAAY,IAAI;AAChB,SAAO,IAAI;AACX,eAAa,IAAI;AACjB,aAAW,IAAI;AACjB;AAEA,CAAC;AACC,SAAO,IAAI;AACX,eAAa,IAAI;AACjB,kBAAgB;AAClB;AAEA,CAAC;AACC,UAAQ;AACR,eAAa;AACf;AAEA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,OAAK,IAAI;AACT,WAAS,EAAE,IAAI,gBAAgB,IAAI;AACnC,iBAAe,IAAI,gBAAgB,MAAM,IAAI;AAC7C,SAAO,IAAI;AACb;AAEA,CAAC;AACC,UAAQ;AACR,iBAAe,IAAI;AACnB,SAAO,IAAI;AACX,eAAa,IAAI;AACjB,aAAW,IAAI;AACf,eAAa,IAAI;AACjB,kBAAgB;AAChB,kBAAgB;AAClB;AAEA,CAAC;AACC,UAAQ;AACR,SA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;AACF;AAEA,QAAO,wBAAyB;AAC9B,GAhBD,QAgBU,CAhBD;AAiBN,eAAW;AACb;AACF;AAEA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,OAAK,IAAI;AACX;AAEA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,OAAK,IAAI;AACT,cAAY;AACZ,YAAU;AACZ;AAEA,CAAC;AACC,UAAQ;AACR,SAAO,IAAI;AACX,aAAW,IAAI;AACjB;AAEA,CAAC;AACC,WAAS;AACT,eAAa;AACb,OAAK,IAAI;AACT,eAAa,IAAI;AACnB;AAEA,CAAC;AACC,QAAM;AACN,aAAW;AACb;AAEA,CAAC;AACC,WAAS;AACT,eAAa;AACb,OAAK,IAAI;AACX;AAEA,CAAC;AACC,aAAW,IAAI;AACjB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/shell/shell.css"],"sourcesContent":[".fg-empty {\n display: flex;\n flex-direction: column;\n align-items: center;\n justify-content: center;\n gap: var(--wzl-space-xs);\n min-height: 100vh;\n padding-inline: var(--wzl-space-md);\n background: var(--wzl-surface-sunken);\n color: var(--wzl-fg);\n}\n\n.fg-empty__title {\n margin: 0;\n font-weight: var(--wzl-font-weight-bold);\n}\n\n.fg-empty__globs {\n margin: 0;\n padding: 0;\n list-style: none;\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-frame-host {\n position: relative;\n width: 100%;\n height: 100%;\n}\n\n.fg-frame-view {\n display: block;\n width: 100%;\n height: 100%;\n border: 0;\n transition: opacity var(--wzl-motion-fast) var(--wzl-ease-out-cubic);\n}\n\n.fg-frame-view[data-pending] {\n visibility: hidden;\n opacity: 0;\n}\n\n@media (prefers-reduced-motion: reduce) {\n .fg-frame-view {\n transition: none;\n }\n}\n\n.fg-fault {\n position: absolute;\n inset: 0;\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n padding: var(--wzl-space-md);\n overflow: auto;\n background: var(--wzl-surface-sunken);\n color: var(--wzl-fg);\n font-family: var(--wzl-font-mono);\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-fault__phase {\n color: var(--wzl-danger);\n font-weight: var(--wzl-font-weight-bold);\n text-transform: uppercase;\n}\n\n.fg-fault__message {\n margin: 0;\n white-space: pre-wrap;\n}\n\n.fg-tree {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n padding: 0 var(--wzl-space-xs) var(--wzl-space-xs);\n border-bottom: var(--wzl-border-w) solid var(--wzl-line-subtle);\n color: var(--wzl-fg);\n}\n\n.fg-tree__heading {\n margin: 0;\n padding-block: var(--wzl-space-xs);\n color: var(--wzl-fg-muted);\n font-family: var(--wzl-font-display);\n font-size: var(--wzl-font-size-sm);\n font-weight: var(--wzl-font-weight-normal);\n letter-spacing: 0.08em;\n text-transform: uppercase;\n}\n\n.fg-route-miss {\n margin: 0;\n color: var(--wzl-danger);\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-tree__filter {\n box-sizing: border-box;\n width: 100%;\n font-size: var(--wzl-font-size);\n}\n\n.fg-tree__items,\n.fg-tree__group {\n display: flex;\n flex-direction: column;\n}\n\n.fg-tree__items {\n font-size: var(--wzl-font-size);\n}\n\n.fg-tree__group {\n padding-inline-start: var(--wzl-space-sm);\n}\n\n.fg-tree__node {\n display: flex;\n flex-direction: column;\n min-width: 0;\n outline: none;\n}\n\n.fg-tree__item {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-xs);\n padding: calc(var(--wzl-space-xs) / 2) var(--wzl-space-xs);\n border-radius: var(--wzl-radius-sm);\n overflow: hidden;\n color: inherit;\n text-decoration: none;\n white-space: nowrap;\n cursor: pointer;\n}\n\n/* text-overflow does not reach a flex container's anonymous text box, so the label clips itself. */\n.fg-tree__label {\n min-width: 0;\n overflow: hidden;\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.fg-tree__item:hover {\n background: var(--wzl-surface-hover);\n}\n\n/* A folder item holds its group, so its ring goes on its own row rather than around the subtree. */\n.fg-tree__story:focus-visible,\n.fg-tree__node:focus-visible > .fg-tree__folder {\n outline: var(--wzl-line-width) solid var(--wzl-accent);\n outline-offset: calc(-1 * var(--wzl-line-width));\n}\n\n.fg-tree__item[aria-current='true'] {\n color: var(--wzl-accent);\n}\n\n/* Drawn with borders rather than a glyph, which would join the item's accessible name. */\n.fg-tree__folder::before {\n content: '';\n flex: none;\n width: 0.35em;\n height: 0.35em;\n border: solid currentColor;\n border-width: 0 1.5px 1.5px 0;\n transform: rotate(-45deg);\n}\n\n.fg-tree__node[aria-expanded='true'] > .fg-tree__folder::before {\n transform: rotate(45deg);\n}\n\n.fg-tree__story {\n padding-inline-start: calc(var(--wzl-space-xs) * 2 + 0.35em);\n}\n\n.lk-trial.fg-flash {\n outline: var(--wzl-line-width) solid var(--wzl-accent);\n outline-offset: calc(-1 * var(--wzl-line-width));\n animation: fg-flash 600ms ease-out forwards;\n}\n\n@keyframes fg-flash {\n from {\n outline-color: var(--wzl-accent);\n }\n to {\n outline-color: transparent;\n }\n}\n\n@media (prefers-reduced-motion: reduce) {\n .lk-trial.fg-flash {\n animation: none;\n }\n}\n\n.fg-css-vars {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n}\n\n.fg-css-vars-focus {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n min-width: 0;\n}\n\n.fg-css-vars__trial {\n margin: 0;\n overflow: hidden;\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-sm);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n/* Held at the top while the list scrolls the aside under it. */\n.fg-css-vars__controls {\n position: sticky;\n top: 0;\n z-index: 1;\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n padding-block-end: var(--wzl-space-xs);\n background: var(--wzl-surface);\n}\n\n.fg-css-vars__empty {\n margin: 0;\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-globals {\n display: flex;\n align-items: center;\n gap: var(--wzl-space-xs);\n}\n\n\n.fg-a11y,\n.fg-a11y-focus {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n min-width: 0;\n}\n\n.fg-a11y__trial {\n margin: 0;\n overflow: hidden;\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-sm);\n text-overflow: ellipsis;\n white-space: nowrap;\n}\n\n.fg-a11y__controls {\n display: flex;\n gap: var(--wzl-space-xs);\n}\n\n.fg-a11y__note,\n.fg-a11y__tally {\n margin: 0;\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-sm);\n font-variant-numeric: tabular-nums;\n}\n\n.fg-a11y__group {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n}\n\n.fg-a11y__group-title {\n margin: 0;\n font-size: var(--wzl-font-size-sm);\n font-variant-numeric: tabular-nums;\n}\n\n.fg-a11y__findings,\n.fg-a11y__nodes {\n display: flex;\n flex-direction: column;\n gap: var(--wzl-space-xs);\n margin: 0;\n padding: 0;\n list-style: none;\n}\n\n.fg-a11y__finding {\n border-inline-start: 2px solid var(--wzl-border);\n padding-inline-start: var(--wzl-space-xs);\n}\n\n.fg-a11y__help {\n display: flex;\n align-items: baseline;\n gap: var(--wzl-space-xs);\n margin: 0;\n font-size: var(--wzl-font-size-sm);\n}\n\n.fg-a11y__impact {\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-xs);\n text-transform: uppercase;\n}\n\n.fg-a11y__impact[data-impact='serious'],\n.fg-a11y__impact[data-impact='critical'] {\n color: var(--wzl-danger);\n}\n\n.fg-a11y__nodes {\n color: var(--wzl-fg-muted);\n font-size: var(--wzl-font-size-xs);\n word-break: break-all;\n}\n"],"mappings":";AAAA,CAAC;AACC,WAAS;AACT,kBAAgB;AAChB,eAAa;AACb,mBAAiB;AACjB,OAAK,IAAI;AACT,cAAY;AACZ,kBAAgB,IAAI;AACpB,cAAY,IAAI;AAChB,SAAO,IAAI;AACb;AAEA,CAAC;AACC,UAAQ;AACR,eAAa,IAA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GED
|
@@ -1,10 +1,15 @@
|
|
|
1
|
-
import { I as IndexEntry, c as FromFrame } from '../FrameController-Ba3LaWfq.js';
|
|
2
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
-
import { StorageAdapter, InstrumentList } from '@weasel-js/labkit';
|
|
4
|
-
import {
|
|
2
|
+
import { LabContribution, StorageAdapter, InstrumentList } from '@weasel-js/labkit';
|
|
3
|
+
import { I as IndexEntry, e as FromFrame, b as A11yReport, T as ToFrame, C as CssVarReport, f as CapturedPicture, V as Viewport } from '../FrameController-BPfCt4PJ.js';
|
|
4
|
+
import { S as ShellConfig, a as GlobalDeclarations } from '../config-CrLpfSq9.js';
|
|
5
5
|
import * as react from 'react';
|
|
6
|
+
import { RefObject } from 'react';
|
|
6
7
|
import '@weasel-js/labkit/config';
|
|
7
8
|
|
|
9
|
+
/** What axe found in the story of the trial this is rendered inside, re-run on demand. */
|
|
10
|
+
declare function A11yPanel(): react_jsx_runtime.JSX.Element;
|
|
11
|
+
declare const A11Y_SECTION: LabContribution;
|
|
12
|
+
|
|
8
13
|
interface WorkshopProps {
|
|
9
14
|
index: readonly IndexEntry[];
|
|
10
15
|
frameUrl: string;
|
|
@@ -34,6 +39,54 @@ type Ready = Extract<FromFrame, {
|
|
|
34
39
|
type: 'ready';
|
|
35
40
|
}>;
|
|
36
41
|
|
|
42
|
+
type Send = (msg: ToFrame) => void;
|
|
43
|
+
/** What an axe run in the frame came back with. */
|
|
44
|
+
type A11yOutcome = {
|
|
45
|
+
ok: true;
|
|
46
|
+
report: A11yReport;
|
|
47
|
+
} | {
|
|
48
|
+
ok: false;
|
|
49
|
+
message: string;
|
|
50
|
+
};
|
|
51
|
+
/** The half of a trial's frame that answers a request: each call is one round trip over the frame's channel. */
|
|
52
|
+
interface TrialFrameCalls {
|
|
53
|
+
send: Send;
|
|
54
|
+
audit: () => Promise<A11yOutcome>;
|
|
55
|
+
/** Rejects when the frame could not draw itself, or went away before it did. */
|
|
56
|
+
capture: () => Promise<CapturedPicture>;
|
|
57
|
+
}
|
|
58
|
+
/** What trial chrome can reach of the frame its trial shows. */
|
|
59
|
+
interface TrialFrame {
|
|
60
|
+
/** Null while no frame is connected. */
|
|
61
|
+
send: Send | null;
|
|
62
|
+
/** The frame's latest `vars` report. */
|
|
63
|
+
vars: readonly CssVarReport[];
|
|
64
|
+
/** Runs axe over the story and records the answer as `a11y`. Null while no frame is connected. */
|
|
65
|
+
audit: (() => Promise<A11yOutcome>) | null;
|
|
66
|
+
/** What the last audit found; null until one has run against the connected frame. */
|
|
67
|
+
a11y: A11yOutcome | null;
|
|
68
|
+
/** The story's own picture, for an export to draw over. Null while no frame is connected. */
|
|
69
|
+
capture: (() => Promise<CapturedPicture>) | null;
|
|
70
|
+
/** The story's content box, as the frame last measured it; null until it has. */
|
|
71
|
+
size: Viewport | null;
|
|
72
|
+
}
|
|
73
|
+
/** Each trial's frame, keyed by trial id: `FrameView` connects and reports, trial chrome reads. */
|
|
74
|
+
interface TrialFrames {
|
|
75
|
+
/** Returns a disconnect that does nothing once a newer connection replaced this one. */
|
|
76
|
+
connect(trialId: string, calls: TrialFrameCalls): () => void;
|
|
77
|
+
report(trialId: string, vars: readonly CssVarReport[]): void;
|
|
78
|
+
reportA11y(trialId: string, outcome: A11yOutcome): void;
|
|
79
|
+
reportSize(trialId: string, size: Viewport): void;
|
|
80
|
+
/** The element a trial's frame is mounted in — stable across the frame reloads that replace the link,
|
|
81
|
+
* because an annotation target's ref has to outlive them. */
|
|
82
|
+
hostRef(trialId: string): RefObject<HTMLElement | null>;
|
|
83
|
+
get(trialId: string): TrialFrame;
|
|
84
|
+
subscribe(listener: () => void): () => void;
|
|
85
|
+
}
|
|
86
|
+
declare const TrialFramesContext: react.Context<TrialFrames | null>;
|
|
87
|
+
/** The frame of the trial `trialId` names, re-read when it connects or reports. */
|
|
88
|
+
declare function useTrialFrame(trialId: string): TrialFrame;
|
|
89
|
+
|
|
37
90
|
interface StoryRegistry {
|
|
38
91
|
instruments: InstrumentList;
|
|
39
92
|
/** Called by FrameView. Replaces the story's instrument only when `ready.schema`, layout or viewport differ from what it holds. */
|
|
@@ -46,6 +99,7 @@ interface StoryRegistry {
|
|
|
46
99
|
declare function useStoryRegistry(index: readonly IndexEntry[], options: {
|
|
47
100
|
frameUrl: string;
|
|
48
101
|
globals?: GlobalDeclarations;
|
|
102
|
+
frames?: TrialFrames;
|
|
49
103
|
}): StoryRegistry;
|
|
50
104
|
|
|
51
|
-
export { type MountWorkshopOptions, type MountedWorkshop, StoryGlobalsContext, type StoryRegistry, Workshop, type WorkshopProps, mountWorkshop, useStoryRegistry };
|
|
105
|
+
export { A11Y_SECTION, type A11yOutcome, A11yPanel, type MountWorkshopOptions, type MountedWorkshop, StoryGlobalsContext, type StoryRegistry, type TrialFrame, type TrialFrames, TrialFramesContext, Workshop, type WorkshopProps, mountWorkshop, useStoryRegistry, useTrialFrame };
|