@weasel-js/forge 1.5.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/LICENSE +21 -0
- package/README.md +33 -0
- package/dist/FrameController-Ba3LaWfq.d.ts +196 -0
- package/dist/chunk-2GXKNXTJ.js +15 -0
- package/dist/chunk-2GXKNXTJ.js.map +1 -0
- package/dist/chunk-IOBG7GZQ.js +13 -0
- package/dist/chunk-IOBG7GZQ.js.map +1 -0
- package/dist/chunk-KKF7ZX5E.js +572 -0
- package/dist/chunk-KKF7ZX5E.js.map +1 -0
- package/dist/chunk-KKVTFMWV.js +59 -0
- package/dist/chunk-KKVTFMWV.js.map +1 -0
- package/dist/chunk-O5OQZQRZ.js +118 -0
- package/dist/chunk-O5OQZQRZ.js.map +1 -0
- package/dist/chunk-UZCXH724.js +24 -0
- package/dist/chunk-UZCXH724.js.map +1 -0
- package/dist/cli.js +107 -0
- package/dist/config-DdumOfyd.d.ts +28 -0
- package/dist/csf/preview-api.d.ts +9 -0
- package/dist/csf/preview-api.js +48 -0
- package/dist/csf/preview-api.js.map +1 -0
- package/dist/frame/index.css +35 -0
- package/dist/frame/index.css.map +1 -0
- package/dist/frame/index.d.ts +24 -0
- package/dist/frame/index.js +8 -0
- package/dist/frame/index.js.map +1 -0
- package/dist/index.d.ts +11 -0
- package/dist/index.js +14 -0
- package/dist/index.js.map +1 -0
- package/dist/shell/index.css +198 -0
- package/dist/shell/index.css.map +1 -0
- package/dist/shell/index.d.ts +51 -0
- package/dist/shell/index.js +836 -0
- package/dist/shell/index.js.map +1 -0
- package/dist/test/index.d.ts +17 -0
- package/dist/test/index.js +132 -0
- package/dist/test/index.js.map +1 -0
- package/dist/vite/index.d.ts +29 -0
- package/dist/vite/index.js +392 -0
- package/dist/vite/index.js.map +1 -0
- package/package.json +87 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/frame/frame.css"],"sourcesContent":["html,\nbody {\n margin: 0;\n}\n\n.fg-frame {\n box-sizing: border-box;\n}\n\n.fg-frame--centered {\n display: flex;\n align-items: center;\n justify-content: center;\n min-height: 100vh;\n}\n\n.fg-frame--padded {\n padding: 16px;\n}\n\n.fg-frame--fullscreen {\n padding: 0;\n}\n\n.fg-frame__fault {\n margin: 0;\n padding: 16px;\n white-space: pre-wrap;\n border: 1px solid #f2b8b5;\n border-radius: 4px;\n background: #fdecea;\n color: #8c1d18;\n font: 13px/1.4 ui-monospace, SFMono-Regular, Menlo, monospace;\n}\n"],"mappings":";AAAA;AACA;AACE,UAAQ;AACV;AAEA,CAAC;AACC,cAAY;AACd;AAEA,CAAC;AACC,WAAS;AACT,eAAa;AACb,mBAAiB;AACjB,cAAY;AACd;AAEA,CAAC;AACC,WAAS;AACX;AAEA,CAAC;AACC,WAAS;AACX;AAEA,CAAC;AACC,UAAQ;AACR,WAAS;AACT,eAAa;AACb,UAAQ,IAAI,MAAM;AAClB,iBAAe;AACf,cAAY;AACZ,SAAO;AACP;AAAA,IAAM,IAAI,CAAC,IAAI,YAAY;AAAA,IAAE,cAAc;AAAA,IAAE,KAAK;AAAA,IAAE;AACtD;","names":[]}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { F as FrameSetup, L as LoadedStory } from '../FrameController-Ba3LaWfq.js';
|
|
2
|
+
export { b as StartFrameOptions, r as reportImportFault, s as startFrame } from '../FrameController-Ba3LaWfq.js';
|
|
3
|
+
import '@weasel-js/labkit/config';
|
|
4
|
+
import 'react';
|
|
5
|
+
|
|
6
|
+
interface FrameImporters {
|
|
7
|
+
[file: string]: () => Promise<Record<string, unknown>>;
|
|
8
|
+
}
|
|
9
|
+
interface FrameIndexEntry {
|
|
10
|
+
id: string;
|
|
11
|
+
file: string;
|
|
12
|
+
exportName: string;
|
|
13
|
+
}
|
|
14
|
+
interface MountFrameOptions {
|
|
15
|
+
index: readonly FrameIndexEntry[];
|
|
16
|
+
importers: FrameImporters;
|
|
17
|
+
root: string;
|
|
18
|
+
setup?: FrameSetup;
|
|
19
|
+
load?: (mod: Record<string, unknown>, file: string, root: string, parameters?: Record<string, unknown>) => LoadedStory[];
|
|
20
|
+
}
|
|
21
|
+
/** The frame document's entry: takes the shell's port, loads the story named by the hash, and starts it. */
|
|
22
|
+
declare function mountFrame(options: MountFrameOptions): Promise<void>;
|
|
23
|
+
|
|
24
|
+
export { type FrameImporters, type FrameIndexEntry, FrameSetup, type MountFrameOptions, mountFrame };
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { mountFrame, reportImportFault, startFrame } from '../chunk-KKF7ZX5E.js';
|
|
2
|
+
import '../chunk-2GXKNXTJ.js';
|
|
3
|
+
import '../chunk-UZCXH724.js';
|
|
4
|
+
import '../chunk-O5OQZQRZ.js';
|
|
5
|
+
import '../chunk-KKVTFMWV.js';
|
|
6
|
+
import '../chunk-IOBG7GZQ.js';
|
|
7
|
+
//# sourceMappingURL=index.js.map
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
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-DdumOfyd.js';
|
|
3
|
+
import { M as MetaSpec, S as StorySpec } from './FrameController-Ba3LaWfq.js';
|
|
4
|
+
export { D as Decorator, F as FrameSetup, L as LoadedStory, P as PlayContext, a as StoryContext } from './FrameController-Ba3LaWfq.js';
|
|
5
|
+
import '@weasel-js/labkit';
|
|
6
|
+
import 'react';
|
|
7
|
+
|
|
8
|
+
declare function meta(spec: MetaSpec): MetaSpec;
|
|
9
|
+
declare function story<C = Record<string, never>, S = undefined>(spec: StorySpec<C, S>): StorySpec<C, S>;
|
|
10
|
+
|
|
11
|
+
export { MetaSpec, StorySpec, meta, story };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export { meta, story } from './chunk-2GXKNXTJ.js';
|
|
2
|
+
export { f } from '@weasel-js/labkit/config';
|
|
3
|
+
|
|
4
|
+
// src/config.ts
|
|
5
|
+
function defineFrameConfig(config) {
|
|
6
|
+
return config;
|
|
7
|
+
}
|
|
8
|
+
function defineShellConfig(config) {
|
|
9
|
+
return config;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export { defineFrameConfig, defineShellConfig };
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
14
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/config.ts"],"names":[],"mappings":";;;;AAcO,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 } 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}\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"]}
|
|
@@ -0,0 +1,198 @@
|
|
|
1
|
+
/* src/shell/shell.css */
|
|
2
|
+
.fg-empty {
|
|
3
|
+
display: flex;
|
|
4
|
+
flex-direction: column;
|
|
5
|
+
align-items: center;
|
|
6
|
+
justify-content: center;
|
|
7
|
+
gap: var(--wzl-space-xs);
|
|
8
|
+
min-height: 100vh;
|
|
9
|
+
padding-inline: var(--wzl-space-md);
|
|
10
|
+
background: var(--wzl-surface-sunken);
|
|
11
|
+
color: var(--wzl-fg);
|
|
12
|
+
}
|
|
13
|
+
.fg-empty__title {
|
|
14
|
+
margin: 0;
|
|
15
|
+
font-weight: var(--wzl-font-weight-bold);
|
|
16
|
+
}
|
|
17
|
+
.fg-empty__globs {
|
|
18
|
+
margin: 0;
|
|
19
|
+
padding: 0;
|
|
20
|
+
list-style: none;
|
|
21
|
+
font-family: var(--wzl-font-mono);
|
|
22
|
+
font-size: var(--wzl-font-size-sm);
|
|
23
|
+
}
|
|
24
|
+
.fg-frame-host {
|
|
25
|
+
position: relative;
|
|
26
|
+
width: 100%;
|
|
27
|
+
height: 100%;
|
|
28
|
+
}
|
|
29
|
+
.fg-frame-view {
|
|
30
|
+
display: block;
|
|
31
|
+
width: 100%;
|
|
32
|
+
height: 100%;
|
|
33
|
+
border: 0;
|
|
34
|
+
}
|
|
35
|
+
.fg-fault {
|
|
36
|
+
position: absolute;
|
|
37
|
+
inset: 0;
|
|
38
|
+
display: flex;
|
|
39
|
+
flex-direction: column;
|
|
40
|
+
gap: var(--wzl-space-xs);
|
|
41
|
+
padding: var(--wzl-space-md);
|
|
42
|
+
overflow: auto;
|
|
43
|
+
background: var(--wzl-surface-sunken);
|
|
44
|
+
color: var(--wzl-fg);
|
|
45
|
+
font-family: var(--wzl-font-mono);
|
|
46
|
+
font-size: var(--wzl-font-size-sm);
|
|
47
|
+
}
|
|
48
|
+
.fg-fault__phase {
|
|
49
|
+
color: var(--wzl-danger);
|
|
50
|
+
font-weight: var(--wzl-font-weight-bold);
|
|
51
|
+
text-transform: uppercase;
|
|
52
|
+
}
|
|
53
|
+
.fg-fault__message {
|
|
54
|
+
margin: 0;
|
|
55
|
+
white-space: pre-wrap;
|
|
56
|
+
}
|
|
57
|
+
.fg-tree {
|
|
58
|
+
display: flex;
|
|
59
|
+
flex-direction: column;
|
|
60
|
+
gap: var(--wzl-space-xs);
|
|
61
|
+
padding: 0 var(--wzl-space-xs) var(--wzl-space-xs);
|
|
62
|
+
border-bottom: var(--wzl-border-w) solid var(--wzl-line-subtle);
|
|
63
|
+
color: var(--wzl-fg);
|
|
64
|
+
}
|
|
65
|
+
.fg-tree__heading {
|
|
66
|
+
margin: 0;
|
|
67
|
+
padding-block: var(--wzl-space-xs);
|
|
68
|
+
color: var(--wzl-fg-muted);
|
|
69
|
+
font-family: var(--wzl-font-display);
|
|
70
|
+
font-size: var(--wzl-font-size-sm);
|
|
71
|
+
font-weight: var(--wzl-font-weight-normal);
|
|
72
|
+
letter-spacing: 0.08em;
|
|
73
|
+
text-transform: uppercase;
|
|
74
|
+
}
|
|
75
|
+
.fg-route-miss {
|
|
76
|
+
margin: 0;
|
|
77
|
+
color: var(--wzl-danger);
|
|
78
|
+
font-size: var(--wzl-font-size-sm);
|
|
79
|
+
}
|
|
80
|
+
.fg-tree__filter {
|
|
81
|
+
box-sizing: border-box;
|
|
82
|
+
width: 100%;
|
|
83
|
+
}
|
|
84
|
+
.fg-tree__items,
|
|
85
|
+
.fg-tree__group {
|
|
86
|
+
display: flex;
|
|
87
|
+
flex-direction: column;
|
|
88
|
+
}
|
|
89
|
+
.fg-tree__items {
|
|
90
|
+
font-size: var(--wzl-font-size-sm);
|
|
91
|
+
}
|
|
92
|
+
.fg-tree__group {
|
|
93
|
+
padding-inline-start: var(--wzl-space-sm);
|
|
94
|
+
}
|
|
95
|
+
.fg-tree__node {
|
|
96
|
+
display: flex;
|
|
97
|
+
flex-direction: column;
|
|
98
|
+
min-width: 0;
|
|
99
|
+
outline: none;
|
|
100
|
+
}
|
|
101
|
+
.fg-tree__item {
|
|
102
|
+
display: flex;
|
|
103
|
+
align-items: center;
|
|
104
|
+
gap: var(--wzl-space-xs);
|
|
105
|
+
padding: calc(var(--wzl-space-xs) / 2) var(--wzl-space-xs);
|
|
106
|
+
border-radius: var(--wzl-radius-sm);
|
|
107
|
+
overflow: hidden;
|
|
108
|
+
color: inherit;
|
|
109
|
+
text-decoration: none;
|
|
110
|
+
white-space: nowrap;
|
|
111
|
+
cursor: pointer;
|
|
112
|
+
}
|
|
113
|
+
.fg-tree__label {
|
|
114
|
+
min-width: 0;
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
text-overflow: ellipsis;
|
|
117
|
+
white-space: nowrap;
|
|
118
|
+
}
|
|
119
|
+
.fg-tree__item:hover {
|
|
120
|
+
background: var(--wzl-surface-hover);
|
|
121
|
+
}
|
|
122
|
+
.fg-tree__story:focus-visible,
|
|
123
|
+
.fg-tree__node:focus-visible > .fg-tree__folder {
|
|
124
|
+
outline: var(--wzl-line-width) solid var(--wzl-accent);
|
|
125
|
+
outline-offset: calc(-1 * var(--wzl-line-width));
|
|
126
|
+
}
|
|
127
|
+
.fg-tree__item[aria-current=true] {
|
|
128
|
+
color: var(--wzl-accent);
|
|
129
|
+
}
|
|
130
|
+
.fg-tree__folder::before {
|
|
131
|
+
content: "";
|
|
132
|
+
flex: none;
|
|
133
|
+
width: 0.35em;
|
|
134
|
+
height: 0.35em;
|
|
135
|
+
border: solid currentColor;
|
|
136
|
+
border-width: 0 1.5px 1.5px 0;
|
|
137
|
+
transform: rotate(-45deg);
|
|
138
|
+
}
|
|
139
|
+
.fg-tree__node[aria-expanded=true] > .fg-tree__folder::before {
|
|
140
|
+
transform: rotate(45deg);
|
|
141
|
+
}
|
|
142
|
+
.fg-tree__story {
|
|
143
|
+
padding-inline-start: calc(var(--wzl-space-xs) * 2 + 0.35em);
|
|
144
|
+
}
|
|
145
|
+
.lk-trial.fg-flash {
|
|
146
|
+
outline: var(--wzl-line-width) solid var(--wzl-accent);
|
|
147
|
+
outline-offset: calc(-1 * var(--wzl-line-width));
|
|
148
|
+
animation: fg-flash 600ms ease-out forwards;
|
|
149
|
+
}
|
|
150
|
+
@keyframes fg-flash {
|
|
151
|
+
from {
|
|
152
|
+
outline-color: var(--wzl-accent);
|
|
153
|
+
}
|
|
154
|
+
to {
|
|
155
|
+
outline-color: transparent;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
@media (prefers-reduced-motion: reduce) {
|
|
159
|
+
.lk-trial.fg-flash {
|
|
160
|
+
animation: none;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
.fg-css-vars {
|
|
164
|
+
display: flex;
|
|
165
|
+
flex-direction: column;
|
|
166
|
+
gap: var(--wzl-space-xs);
|
|
167
|
+
}
|
|
168
|
+
.fg-css-vars__list {
|
|
169
|
+
display: flex;
|
|
170
|
+
flex-direction: column;
|
|
171
|
+
gap: var(--wzl-space-xs);
|
|
172
|
+
max-height: 60vh;
|
|
173
|
+
overflow: auto;
|
|
174
|
+
}
|
|
175
|
+
.fg-css-vars__empty {
|
|
176
|
+
margin: 0;
|
|
177
|
+
color: var(--wzl-fg-muted);
|
|
178
|
+
font-size: var(--wzl-font-size-sm);
|
|
179
|
+
}
|
|
180
|
+
.fg-css-var {
|
|
181
|
+
display: flex;
|
|
182
|
+
align-items: flex-end;
|
|
183
|
+
gap: var(--wzl-space-xs);
|
|
184
|
+
font-family: var(--wzl-font-mono);
|
|
185
|
+
}
|
|
186
|
+
.fg-css-var__rows {
|
|
187
|
+
flex: 1;
|
|
188
|
+
min-width: 0;
|
|
189
|
+
}
|
|
190
|
+
.fg-globals {
|
|
191
|
+
display: flex;
|
|
192
|
+
align-items: center;
|
|
193
|
+
gap: var(--wzl-space-xs);
|
|
194
|
+
}
|
|
195
|
+
.fg-globals__select {
|
|
196
|
+
font-size: var(--wzl-font-size-sm);
|
|
197
|
+
}
|
|
198
|
+
/*# sourceMappingURL=index.css.map */
|
|
@@ -0,0 +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":"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","names":[]}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { I as IndexEntry, c as FromFrame } from '../FrameController-Ba3LaWfq.js';
|
|
2
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
3
|
+
import { StorageAdapter, InstrumentList } from '@weasel-js/labkit';
|
|
4
|
+
import { S as ShellConfig, a as GlobalDeclarations } from '../config-DdumOfyd.js';
|
|
5
|
+
import * as react from 'react';
|
|
6
|
+
import '@weasel-js/labkit/config';
|
|
7
|
+
|
|
8
|
+
interface WorkshopProps {
|
|
9
|
+
index: readonly IndexEntry[];
|
|
10
|
+
frameUrl: string;
|
|
11
|
+
config?: ShellConfig;
|
|
12
|
+
/** The story globs the index was built from, named when it is empty. */
|
|
13
|
+
stories?: readonly string[];
|
|
14
|
+
storageKey?: string;
|
|
15
|
+
storage?: StorageAdapter;
|
|
16
|
+
}
|
|
17
|
+
declare function Workshop({ index, frameUrl, config, stories, storageKey, storage }: WorkshopProps): react_jsx_runtime.JSX.Element;
|
|
18
|
+
|
|
19
|
+
interface MountWorkshopOptions extends WorkshopProps {
|
|
20
|
+
/** Default: the document's `#root`. */
|
|
21
|
+
container?: HTMLElement;
|
|
22
|
+
}
|
|
23
|
+
interface MountedWorkshop {
|
|
24
|
+
/** Swaps in a re-indexed story list, as the vite plugin's `forge:index` event carries. */
|
|
25
|
+
setIndex(index: readonly IndexEntry[]): void;
|
|
26
|
+
unmount(): void;
|
|
27
|
+
}
|
|
28
|
+
declare function mountWorkshop({ container, ...props }: MountWorkshopOptions): MountedWorkshop;
|
|
29
|
+
|
|
30
|
+
/** The lab's global values, which a trial's pins override. A change reaches open frames without replacing instruments. */
|
|
31
|
+
declare const StoryGlobalsContext: react.Context<Readonly<Record<string, unknown>>>;
|
|
32
|
+
|
|
33
|
+
type Ready = Extract<FromFrame, {
|
|
34
|
+
type: 'ready';
|
|
35
|
+
}>;
|
|
36
|
+
|
|
37
|
+
interface StoryRegistry {
|
|
38
|
+
instruments: InstrumentList;
|
|
39
|
+
/** Called by FrameView. Replaces the story's instrument only when `ready.schema`, layout or viewport differ from what it holds. */
|
|
40
|
+
onReady: (entry: IndexEntry, ready: Ready) => void;
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* One instrument per story in `index`, each schema holding a `$globals` group for `globals`. The lab's global values
|
|
44
|
+
* reach the frames through `StoryGlobalsContext`, not through here.
|
|
45
|
+
*/
|
|
46
|
+
declare function useStoryRegistry(index: readonly IndexEntry[], options: {
|
|
47
|
+
frameUrl: string;
|
|
48
|
+
globals?: GlobalDeclarations;
|
|
49
|
+
}): StoryRegistry;
|
|
50
|
+
|
|
51
|
+
export { type MountWorkshopOptions, type MountedWorkshop, StoryGlobalsContext, type StoryRegistry, Workshop, type WorkshopProps, mountWorkshop, useStoryRegistry };
|