@multiplatform.one/storybook 9.16.1 → 10.0.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/dist/cjs/CreatePreview.cjs +554 -589
- package/dist/cjs/CreatePreview.native.cjs +802 -0
- package/dist/cjs/CreatePreview.native.js +744 -823
- package/dist/cjs/CreatePreview.native.js.map +1 -1
- package/dist/cjs/index.cjs +17 -19
- package/dist/cjs/index.native.cjs +35 -0
- package/dist/cjs/index.native.js +22 -25
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/safeAction.cjs +53 -57
- package/dist/cjs/safeAction.native.cjs +98 -0
- package/dist/cjs/safeAction.native.js +79 -98
- package/dist/cjs/safeAction.native.js.map +1 -1
- package/dist/esm/CreatePreview.mjs +533 -559
- package/dist/esm/CreatePreview.mjs.map +1 -1
- package/dist/esm/CreatePreview.native.js +723 -794
- package/dist/esm/CreatePreview.native.js.map +1 -1
- package/dist/esm/index.mjs +4 -3
- package/dist/esm/index.native.js +9 -8
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/safeAction.mjs +42 -40
- package/dist/esm/safeAction.mjs.map +1 -1
- package/dist/esm/safeAction.native.js +67 -81
- package/dist/esm/safeAction.native.js.map +1 -1
- package/dist/jsx/CreatePreview.mjs +533 -559
- package/dist/jsx/CreatePreview.mjs.map +1 -1
- package/dist/jsx/CreatePreview.native.cjs +802 -0
- package/dist/jsx/CreatePreview.native.js +744 -823
- package/dist/jsx/CreatePreview.native.js.map +1 -1
- package/dist/jsx/index.js +4 -3
- package/dist/jsx/index.mjs +4 -3
- package/dist/jsx/index.native.cjs +35 -0
- package/dist/jsx/index.native.js +22 -25
- package/dist/jsx/index.native.js.map +1 -1
- package/dist/jsx/safeAction.mjs +42 -40
- package/dist/jsx/safeAction.mjs.map +1 -1
- package/dist/jsx/safeAction.native.cjs +98 -0
- package/dist/jsx/safeAction.native.js +79 -98
- package/dist/jsx/safeAction.native.js.map +1 -1
- package/package.json +14 -14
- package/src/CreatePreview.consoleErrors.spec.ts +49 -0
- package/src/CreatePreview.spec.tsx +1 -1
- package/src/CreatePreview.tsx +5 -30
- package/types/CreatePreview.d.ts +6 -0
- package/types/CreatePreview.d.ts.map +1 -1
- package/dist/esm/index.mjs.map +0 -1
- package/dist/jsx/index.js.map +0 -1
- package/dist/jsx/index.mjs.map +0 -1
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { useEffect, useLayoutEffect, useMemo, useRef, useState } from "react";
|
|
2
|
-
import { BodyFont, BorderRadius, BorderWidth, CornerSmoothing, DisabledStyle, Elevation, FillStyle, FontWeight, HeadingFont, PageTitleScale,
|
|
2
|
+
import { BodyFont, BorderRadius, BorderWidth, CornerSmoothing, DisabledStyle, Elevation, FillStyle, FontWeight, HeadingFont, PageTitleScale, PresetContext, TableZebra, TextAccent, activateThemeConfig, animationDurations, applyColorTheme, defaultKnobs, defaultPreset, defaultScaleInputs, getPreset, getPresetNames, motionStops, normalizeAnimationKnob, setStoredScheme, useActiveScale, useTheme } from "@multiplatform.one/theme";
|
|
3
3
|
import { config } from "@multiplatform.one/platform";
|
|
4
4
|
import { CookiesProvider } from "react-cookie";
|
|
5
|
-
import { Theme, YStack, useTheme as
|
|
5
|
+
import { Theme, YStack, useTheme as useTheme$1 } from "tamagui";
|
|
6
6
|
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
7
|
+
|
|
7
8
|
const themeColorsChannelEvent = "theme-addon/theme-colors";
|
|
8
9
|
const themeColorsOppositeChannelEvent = "theme-addon/theme-colors-opposite";
|
|
9
10
|
const baseThemeColorsChannelEvent = "theme-addon/base-theme-colors";
|
|
@@ -14,584 +15,557 @@ const animationNamesChannelEvent = "theme-addon/animation-names";
|
|
|
14
15
|
const frappeDebugChannelEvent = "frappe-addon/debug-state";
|
|
15
16
|
const defaultThemeConfigName = "full";
|
|
16
17
|
const knobOptions = {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
// LC-40 DISABLED-VISIBLE: the disabled-treatment dial is sweepable so the
|
|
31
|
-
// VERIFY probes (and humans) can flip keepLabel/dimWhole from the toolbar
|
|
32
|
-
// or via URL globals.
|
|
33
|
-
disabledStyle: Object.values(DisabledStyle),
|
|
34
|
-
// K4: the one house knob a table sweep has to flip (MPO-132).
|
|
35
|
-
tableZebra: Object.values(TableZebra)
|
|
18
|
+
fillStyle: Object.values(FillStyle),
|
|
19
|
+
borderRadius: Object.values(BorderRadius),
|
|
20
|
+
cornerSmoothing: Object.values(CornerSmoothing),
|
|
21
|
+
borderWidth: Object.values(BorderWidth),
|
|
22
|
+
elevation: Object.values(Elevation),
|
|
23
|
+
textAccent: Object.values(TextAccent),
|
|
24
|
+
headingFont: Object.values(HeadingFont),
|
|
25
|
+
bodyFont: Object.values(BodyFont),
|
|
26
|
+
fontWeight: Object.values(FontWeight),
|
|
27
|
+
pageTitleScale: Object.values(PageTitleScale),
|
|
28
|
+
animation: ["none", ...motionStops],
|
|
29
|
+
disabledStyle: Object.values(DisabledStyle),
|
|
30
|
+
tableZebra: Object.values(TableZebra)
|
|
36
31
|
};
|
|
37
|
-
const stateKnobFields = [
|
|
32
|
+
const stateKnobFields = [
|
|
33
|
+
"fillStyle",
|
|
34
|
+
"borderRadius",
|
|
35
|
+
"borderWidth",
|
|
36
|
+
"elevation",
|
|
37
|
+
"textAccent",
|
|
38
|
+
"headingFont",
|
|
39
|
+
"bodyFont",
|
|
40
|
+
"fontWeight"
|
|
41
|
+
];
|
|
38
42
|
function parseValue(value) {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
43
|
+
if (typeof value !== "string") return value;
|
|
44
|
+
try {
|
|
45
|
+
return JSON.parse(value);
|
|
46
|
+
} catch {
|
|
47
|
+
return value;
|
|
48
|
+
}
|
|
45
49
|
}
|
|
46
|
-
const toTitleCase = str => str.replace(/([A-Z])/g, " $1").replace(/^./, s => s.toUpperCase());
|
|
50
|
+
const toTitleCase = (str) => str.replace(/([A-Z])/g, " $1").replace(/^./, (s) => s.toUpperCase());
|
|
47
51
|
function createControl(key) {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
})
|
|
64
|
-
};
|
|
52
|
+
const name = toTitleCase(key);
|
|
53
|
+
const values = knobOptions[key] ?? [];
|
|
54
|
+
const serialized = values.map((value) => value);
|
|
55
|
+
const labels = Object.fromEntries(serialized.map((v) => [v, v.replace("$", "")]));
|
|
56
|
+
const fallback = defaultKnobs[key];
|
|
57
|
+
return {
|
|
58
|
+
name,
|
|
59
|
+
description: name.toLowerCase(),
|
|
60
|
+
options: serialized,
|
|
61
|
+
control: {
|
|
62
|
+
type: "select",
|
|
63
|
+
labels
|
|
64
|
+
},
|
|
65
|
+
...fallback !== void 0 && { defaultValue: fallback }
|
|
66
|
+
};
|
|
65
67
|
}
|
|
66
|
-
function CanvasBackground({
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
children
|
|
83
|
-
});
|
|
68
|
+
function CanvasBackground({ children }) {
|
|
69
|
+
const tamaguiTheme = useTheme$1();
|
|
70
|
+
const bg = tamaguiTheme.background?.val;
|
|
71
|
+
useLayoutEffect(() => {
|
|
72
|
+
if (bg && typeof document !== "undefined") {
|
|
73
|
+
document.body.style.backgroundColor = bg;
|
|
74
|
+
document.documentElement.style.backgroundColor = bg;
|
|
75
|
+
}
|
|
76
|
+
}, [bg]);
|
|
77
|
+
return /* @__PURE__ */ jsx(YStack, {
|
|
78
|
+
flex: 1,
|
|
79
|
+
minHeight: "100vh",
|
|
80
|
+
backgroundColor: "background",
|
|
81
|
+
id: "mpo-matrix-root",
|
|
82
|
+
children
|
|
83
|
+
});
|
|
84
84
|
}
|
|
85
85
|
let _channelEmit = null;
|
|
86
86
|
function getChannelEmit() {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
87
|
+
if (_channelEmit) return _channelEmit;
|
|
88
|
+
try {
|
|
89
|
+
const mod = require("storybook/preview-api");
|
|
90
|
+
const channel = mod.addons.getChannel();
|
|
91
|
+
_channelEmit = (event, data) => channel.emit(event, data);
|
|
92
|
+
return _channelEmit;
|
|
93
|
+
} catch {
|
|
94
|
+
return null;
|
|
95
|
+
}
|
|
96
96
|
}
|
|
97
97
|
function AnimationNamesEmitter() {
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
98
|
+
const emittedRef = useRef(false);
|
|
99
|
+
useEffect(() => {
|
|
100
|
+
if (emittedRef.current) return;
|
|
101
|
+
emittedRef.current = true;
|
|
102
|
+
getChannelEmit()?.(animationNamesChannelEvent, [...motionStops]);
|
|
103
|
+
}, []);
|
|
104
|
+
return null;
|
|
105
105
|
}
|
|
106
106
|
function FrappeDebugEmitter() {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
}, [tick]);
|
|
155
|
-
return null;
|
|
107
|
+
const prevRef = useRef("");
|
|
108
|
+
const syncRef = useRef(null);
|
|
109
|
+
const [tick, setTick] = useState(0);
|
|
110
|
+
useEffect(() => {
|
|
111
|
+
let cancelled = false;
|
|
112
|
+
async function resolve() {
|
|
113
|
+
try {
|
|
114
|
+
const { __getActiveSyncModule } = await import("@multiplatform.one/frappe");
|
|
115
|
+
const sync = __getActiveSyncModule();
|
|
116
|
+
if (sync && !cancelled) {
|
|
117
|
+
syncRef.current = sync;
|
|
118
|
+
setTick((t) => t + 1);
|
|
119
|
+
return sync.subscribeStore(() => {
|
|
120
|
+
if (!cancelled) setTick((t) => t + 1);
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
} catch {}
|
|
124
|
+
}
|
|
125
|
+
const cleanupPromise = resolve();
|
|
126
|
+
let attempts = 0;
|
|
127
|
+
const interval = setInterval(async () => {
|
|
128
|
+
attempts++;
|
|
129
|
+
if (syncRef.current || cancelled || attempts >= 10) {
|
|
130
|
+
clearInterval(interval);
|
|
131
|
+
return;
|
|
132
|
+
}
|
|
133
|
+
await resolve();
|
|
134
|
+
}, 2e3);
|
|
135
|
+
return () => {
|
|
136
|
+
cancelled = true;
|
|
137
|
+
clearInterval(interval);
|
|
138
|
+
cleanupPromise.then((unsub) => unsub?.());
|
|
139
|
+
};
|
|
140
|
+
}, []);
|
|
141
|
+
useEffect(() => {
|
|
142
|
+
if (!syncRef.current) return;
|
|
143
|
+
const emit = getChannelEmit();
|
|
144
|
+
if (!emit) return;
|
|
145
|
+
try {
|
|
146
|
+
const state = syncRef.current.__debug();
|
|
147
|
+
const key = JSON.stringify(state);
|
|
148
|
+
if (key === prevRef.current) return;
|
|
149
|
+
prevRef.current = key;
|
|
150
|
+
emit(frappeDebugChannelEvent, state);
|
|
151
|
+
} catch {}
|
|
152
|
+
}, [tick]);
|
|
153
|
+
return null;
|
|
156
154
|
}
|
|
157
155
|
function ThemeColorEmitter() {
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
156
|
+
const tamaguiTheme = useTheme$1();
|
|
157
|
+
const prevRef = useRef("");
|
|
158
|
+
useEffect(() => {
|
|
159
|
+
const colors = [];
|
|
160
|
+
for (let i = 1; i <= 12; i++) {
|
|
161
|
+
const token = tamaguiTheme[`color-${i}`];
|
|
162
|
+
colors.push(token?.val ?? "");
|
|
163
|
+
}
|
|
164
|
+
const key = colors.join("|");
|
|
165
|
+
if (key === prevRef.current) return;
|
|
166
|
+
prevRef.current = key;
|
|
167
|
+
getChannelEmit()?.(themeColorsChannelEvent, colors);
|
|
168
|
+
}, [tamaguiTheme]);
|
|
169
|
+
return null;
|
|
172
170
|
}
|
|
173
171
|
function BaseThemeColorEmitter() {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
172
|
+
const tamaguiTheme = useTheme$1();
|
|
173
|
+
const prevRef = useRef("");
|
|
174
|
+
useEffect(() => {
|
|
175
|
+
const colors = [];
|
|
176
|
+
for (let i = 1; i <= 12; i++) {
|
|
177
|
+
const token = tamaguiTheme[`color-${i}`];
|
|
178
|
+
colors.push(token?.val ?? "");
|
|
179
|
+
}
|
|
180
|
+
const key = colors.join("|");
|
|
181
|
+
if (key === prevRef.current) return;
|
|
182
|
+
prevRef.current = key;
|
|
183
|
+
getChannelEmit()?.(baseThemeColorsChannelEvent, colors);
|
|
184
|
+
}, [tamaguiTheme]);
|
|
185
|
+
return null;
|
|
188
186
|
}
|
|
189
187
|
function OppositeThemeColorEmitter() {
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
188
|
+
const tamaguiTheme = useTheme$1();
|
|
189
|
+
const prevRef = useRef("");
|
|
190
|
+
useEffect(() => {
|
|
191
|
+
const colors = [];
|
|
192
|
+
for (let i = 1; i <= 12; i++) {
|
|
193
|
+
const token = tamaguiTheme[`color-${i}`];
|
|
194
|
+
colors.push(token?.val ?? "");
|
|
195
|
+
}
|
|
196
|
+
const key = colors.join("|");
|
|
197
|
+
if (key === prevRef.current) return;
|
|
198
|
+
prevRef.current = key;
|
|
199
|
+
getChannelEmit()?.(themeColorsOppositeChannelEvent, colors);
|
|
200
|
+
}, [tamaguiTheme]);
|
|
201
|
+
return null;
|
|
204
202
|
}
|
|
205
|
-
function ColorChannelEmitter({
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
203
|
+
function ColorChannelEmitter({ event, prefix = "color" }) {
|
|
204
|
+
const tamaguiTheme = useTheme$1();
|
|
205
|
+
const prevRef = useRef("");
|
|
206
|
+
useEffect(() => {
|
|
207
|
+
const colors = [];
|
|
208
|
+
let found = false;
|
|
209
|
+
for (let i = 1; i <= 12; i++) {
|
|
210
|
+
const token = tamaguiTheme[`${prefix}${i}`];
|
|
211
|
+
const val = token?.val ?? "";
|
|
212
|
+
colors.push(val);
|
|
213
|
+
if (val) found = true;
|
|
214
|
+
}
|
|
215
|
+
if (!found) return;
|
|
216
|
+
const key = colors.join("|");
|
|
217
|
+
if (key === prevRef.current) return;
|
|
218
|
+
prevRef.current = key;
|
|
219
|
+
getChannelEmit()?.(event, colors);
|
|
220
|
+
}, [
|
|
221
|
+
tamaguiTheme,
|
|
222
|
+
event,
|
|
223
|
+
prefix
|
|
224
|
+
]);
|
|
225
|
+
return null;
|
|
227
226
|
}
|
|
228
|
-
const tamaguiPropLeakPatterns = ["pressTheme", "scaleIcon", "borderTopRightRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderBottomLeftRadius"];
|
|
229
|
-
function suppressTamaguiDomWarnings() {
|
|
230
|
-
if (typeof window === "undefined") return;
|
|
231
|
-
const origError = console.error;
|
|
232
|
-
console.error = (...args) => {
|
|
233
|
-
const msg = args.map(a => typeof a === "string" ? a : "").join(" ");
|
|
234
|
-
if (msg.includes("React does not recognize the") && tamaguiPropLeakPatterns.some(p => msg.includes(p))) {
|
|
235
|
-
return;
|
|
236
|
-
}
|
|
237
|
-
origError(...args);
|
|
238
|
-
};
|
|
239
|
-
}
|
|
240
|
-
suppressTamaguiDomWarnings();
|
|
241
227
|
function createPreview(options) {
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
Story,
|
|
583
|
-
context
|
|
584
|
-
})
|
|
585
|
-
});
|
|
586
|
-
return {
|
|
587
|
-
globalTypes,
|
|
588
|
-
initialGlobals,
|
|
589
|
-
parameters: {
|
|
590
|
-
...defaultParameters,
|
|
591
|
-
...extraParameters
|
|
592
|
-
},
|
|
593
|
-
decorators: [frameworkDecorator, ...extraDecorators]
|
|
594
|
-
};
|
|
228
|
+
const { themeConfig, i18n, AppProvider, setUserScheme, decorators: extraDecorators = [], parameters: extraParameters = {}, globalTypes: extraGlobalTypes = {} } = options;
|
|
229
|
+
const themeConfigsByName = {
|
|
230
|
+
...options.themeConfigs,
|
|
231
|
+
[defaultThemeConfigName]: themeConfig
|
|
232
|
+
};
|
|
233
|
+
const themeConfigNames = [defaultThemeConfigName, ...Object.keys(themeConfigsByName).filter((name) => name !== defaultThemeConfigName)];
|
|
234
|
+
const switchesThemeConfig = themeConfigNames.length > 1;
|
|
235
|
+
if (switchesThemeConfig) activateThemeConfig(themeConfig);
|
|
236
|
+
let activeThemeConfigName = defaultThemeConfigName;
|
|
237
|
+
function useActiveThemeConfigName(requested) {
|
|
238
|
+
const [active, setActive] = useState(activeThemeConfigName);
|
|
239
|
+
useLayoutEffect(() => {
|
|
240
|
+
if (requested !== activeThemeConfigName) {
|
|
241
|
+
activateThemeConfig(themeConfigsByName[requested]);
|
|
242
|
+
activeThemeConfigName = requested;
|
|
243
|
+
}
|
|
244
|
+
setActive(requested);
|
|
245
|
+
}, [requested]);
|
|
246
|
+
return active;
|
|
247
|
+
}
|
|
248
|
+
const enumKeys = Object.keys(knobOptions);
|
|
249
|
+
const generatedGlobalTypes = {};
|
|
250
|
+
for (const key of enumKeys) {
|
|
251
|
+
generatedGlobalTypes[key] = createControl(key);
|
|
252
|
+
}
|
|
253
|
+
for (const state of [
|
|
254
|
+
"hover",
|
|
255
|
+
"press",
|
|
256
|
+
"focus",
|
|
257
|
+
"focusVisible"
|
|
258
|
+
]) {
|
|
259
|
+
for (const field of stateKnobFields) {
|
|
260
|
+
const stateKey = `${state}.${field}`;
|
|
261
|
+
const values = knobOptions[field] ?? [];
|
|
262
|
+
const serialized = values.map((value) => value);
|
|
263
|
+
const labels = Object.fromEntries(serialized.map((v) => [v, v.replace("$", "")]));
|
|
264
|
+
generatedGlobalTypes[stateKey] = {
|
|
265
|
+
name: `${toTitleCase(state)} ${toTitleCase(field)}`,
|
|
266
|
+
description: `${state} override for ${field}`,
|
|
267
|
+
options: serialized,
|
|
268
|
+
control: {
|
|
269
|
+
type: "select",
|
|
270
|
+
labels
|
|
271
|
+
},
|
|
272
|
+
defaultValue: ""
|
|
273
|
+
};
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const themeColorNames = ["", ...themeConfig.themeColors];
|
|
277
|
+
const themeSwatches = {};
|
|
278
|
+
const allThemes = themeConfig.tamagui.themes;
|
|
279
|
+
if (allThemes) {
|
|
280
|
+
for (const name of themeConfig.themeColors) {
|
|
281
|
+
const theme = allThemes[`light_${name}`] ?? allThemes[name];
|
|
282
|
+
if (!theme) continue;
|
|
283
|
+
const token = theme["color-7"];
|
|
284
|
+
if (typeof token === "string") {
|
|
285
|
+
themeSwatches[name] = token;
|
|
286
|
+
} else if (token && typeof token === "object" && "val" in token) {
|
|
287
|
+
themeSwatches[name] = String(token.val);
|
|
288
|
+
}
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
generatedGlobalTypes.color = {
|
|
292
|
+
name: "Theme",
|
|
293
|
+
description: "Theme color palette",
|
|
294
|
+
options: themeColorNames,
|
|
295
|
+
control: {
|
|
296
|
+
type: "select",
|
|
297
|
+
labels: Object.fromEntries(themeColorNames.map((v) => [v, v || "(none)"]))
|
|
298
|
+
}
|
|
299
|
+
};
|
|
300
|
+
generatedGlobalTypes.scheme = {
|
|
301
|
+
name: "Scheme",
|
|
302
|
+
description: "Color scheme (light/dark/system)",
|
|
303
|
+
options: [
|
|
304
|
+
"system",
|
|
305
|
+
"light",
|
|
306
|
+
"dark"
|
|
307
|
+
],
|
|
308
|
+
control: { type: "select" }
|
|
309
|
+
};
|
|
310
|
+
generatedGlobalTypes.locale = {
|
|
311
|
+
name: "Locale",
|
|
312
|
+
description: "Controls internationalization language",
|
|
313
|
+
options: [...i18n.languages],
|
|
314
|
+
control: { type: "select" },
|
|
315
|
+
toolbar: {
|
|
316
|
+
title: "Locale",
|
|
317
|
+
items: [...i18n.languages],
|
|
318
|
+
dynamicTitle: true
|
|
319
|
+
}
|
|
320
|
+
};
|
|
321
|
+
if (switchesThemeConfig) {
|
|
322
|
+
generatedGlobalTypes.tamaguiConfig = {
|
|
323
|
+
name: "Tamagui config",
|
|
324
|
+
description: "Tamagui config the story renders under",
|
|
325
|
+
options: themeConfigNames,
|
|
326
|
+
control: { type: "select" },
|
|
327
|
+
toolbar: {
|
|
328
|
+
title: "Tamagui config",
|
|
329
|
+
icon: "paintbrush",
|
|
330
|
+
items: themeConfigNames.map((name) => ({
|
|
331
|
+
value: name,
|
|
332
|
+
title: `${name} config`
|
|
333
|
+
})),
|
|
334
|
+
dynamicTitle: true
|
|
335
|
+
}
|
|
336
|
+
};
|
|
337
|
+
}
|
|
338
|
+
const globalTypes = {
|
|
339
|
+
...generatedGlobalTypes,
|
|
340
|
+
...extraGlobalTypes
|
|
341
|
+
};
|
|
342
|
+
const initialGlobals = {
|
|
343
|
+
locale: config.get("I18N_DEFAULT_LANGUAGE", i18n.defaultLanguage),
|
|
344
|
+
color: "",
|
|
345
|
+
scheme: "system",
|
|
346
|
+
__presetNames: getPresetNames(),
|
|
347
|
+
__presetScales: Object.fromEntries(getPresetNames().map((name) => {
|
|
348
|
+
const scale = getPreset(name)?.scale ?? defaultScaleInputs;
|
|
349
|
+
return [name, {
|
|
350
|
+
control: scale.control,
|
|
351
|
+
type: scale.type
|
|
352
|
+
}];
|
|
353
|
+
})),
|
|
354
|
+
__themeColors: themeColorNames,
|
|
355
|
+
__themeSwatches: themeSwatches,
|
|
356
|
+
preset: themeConfig.defaultPreset ?? "",
|
|
357
|
+
...switchesThemeConfig && { tamaguiConfig: defaultThemeConfigName }
|
|
358
|
+
};
|
|
359
|
+
for (const key of enumKeys) {
|
|
360
|
+
if (!(key in initialGlobals)) {
|
|
361
|
+
initialGlobals[key] = "";
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
for (const state of [
|
|
365
|
+
"hover",
|
|
366
|
+
"press",
|
|
367
|
+
"focus",
|
|
368
|
+
"focusVisible"
|
|
369
|
+
]) {
|
|
370
|
+
for (const field of stateKnobFields) {
|
|
371
|
+
initialGlobals[`${state}.${field}`] = "";
|
|
372
|
+
}
|
|
373
|
+
}
|
|
374
|
+
globalThis.__MPO_THEME_AXES__ = {
|
|
375
|
+
schemes: ["light", "dark"],
|
|
376
|
+
themeColors: themeColorNames,
|
|
377
|
+
presets: ["", ...getPresetNames()],
|
|
378
|
+
presetThemes: Object.fromEntries(getPresetNames().flatMap((name) => {
|
|
379
|
+
const theme = getPreset(name)?.theme;
|
|
380
|
+
return theme ? [[name, theme]] : [];
|
|
381
|
+
}))
|
|
382
|
+
};
|
|
383
|
+
const defaultParameters = {
|
|
384
|
+
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
385
|
+
layout: "padded",
|
|
386
|
+
viewMode: "story",
|
|
387
|
+
controls: {
|
|
388
|
+
expanded: true,
|
|
389
|
+
hideNoControlsWarning: true,
|
|
390
|
+
matchers: {
|
|
391
|
+
color: /(background|color)$/i,
|
|
392
|
+
date: /Date$/
|
|
393
|
+
}
|
|
394
|
+
},
|
|
395
|
+
backgrounds: { disable: true },
|
|
396
|
+
previewTabs: { "storybook/docs/panel": { hidden: true } },
|
|
397
|
+
a11y: { test: false },
|
|
398
|
+
docs: { codePanel: true },
|
|
399
|
+
darkMode: { stylePreview: true }
|
|
400
|
+
};
|
|
401
|
+
function FrameworkDecoratorInner({ Story, context }) {
|
|
402
|
+
const [knobs, setKnobs] = useTheme();
|
|
403
|
+
const schemeGlobal = context.globals.scheme || "system";
|
|
404
|
+
const [resolvedScheme, setResolvedScheme] = useState(() => {
|
|
405
|
+
if (schemeGlobal === "light" || schemeGlobal === "dark") return schemeGlobal;
|
|
406
|
+
if (typeof window !== "undefined" && window.matchMedia) {
|
|
407
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
408
|
+
}
|
|
409
|
+
return "light";
|
|
410
|
+
});
|
|
411
|
+
useEffect(() => {
|
|
412
|
+
if (schemeGlobal === "light" || schemeGlobal === "dark") {
|
|
413
|
+
setResolvedScheme(schemeGlobal);
|
|
414
|
+
return;
|
|
415
|
+
}
|
|
416
|
+
if (typeof window === "undefined" || !window.matchMedia) {
|
|
417
|
+
setResolvedScheme("light");
|
|
418
|
+
return;
|
|
419
|
+
}
|
|
420
|
+
const mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
421
|
+
const handler = () => setResolvedScheme(mq.matches ? "dark" : "light");
|
|
422
|
+
handler();
|
|
423
|
+
mq.addEventListener("change", handler);
|
|
424
|
+
return () => mq.removeEventListener("change", handler);
|
|
425
|
+
}, [schemeGlobal]);
|
|
426
|
+
useLayoutEffect(() => {
|
|
427
|
+
const setting = schemeGlobal === "light" || schemeGlobal === "dark" ? schemeGlobal : "system";
|
|
428
|
+
setUserScheme?.(setting);
|
|
429
|
+
setStoredScheme(setting);
|
|
430
|
+
}, [schemeGlobal]);
|
|
431
|
+
const colorGlobal = context.globals.color || "";
|
|
432
|
+
const requestedThemeConfig = context.globals.tamaguiConfig;
|
|
433
|
+
const requestedThemeConfigName = requestedThemeConfig && themeConfigNames.includes(requestedThemeConfig) ? requestedThemeConfig : defaultThemeConfigName;
|
|
434
|
+
const themeConfigName = useActiveThemeConfigName(requestedThemeConfigName);
|
|
435
|
+
const storyThemeParams = context.parameters?.theme;
|
|
436
|
+
const activePresetName = context.globals.preset || void 0;
|
|
437
|
+
const activePreset = activePresetName ? getPreset(activePresetName) : void 0;
|
|
438
|
+
const presetTheme = colorGlobal || activePreset?.theme || defaultPreset.theme;
|
|
439
|
+
const scaleId = useActiveScale(themeConfigsByName[requestedThemeConfigName], activePresetName);
|
|
440
|
+
const knobUpdate = useMemo(() => {
|
|
441
|
+
const result = {};
|
|
442
|
+
const stateKeys = /* @__PURE__ */ new Set([
|
|
443
|
+
"hover",
|
|
444
|
+
"press",
|
|
445
|
+
"focus",
|
|
446
|
+
"focusVisible"
|
|
447
|
+
]);
|
|
448
|
+
for (const key of Object.keys(knobs)) {
|
|
449
|
+
if (stateKeys.has(key)) continue;
|
|
450
|
+
if (storyThemeParams && key in storyThemeParams) {
|
|
451
|
+
result[key] = storyThemeParams[key];
|
|
452
|
+
} else if (key in context.globals && context.globals[key] !== void 0 && context.globals[key] !== "") {
|
|
453
|
+
result[key] = parseValue(context.globals[key]);
|
|
454
|
+
} else if (activePreset && key in activePreset.knobs) {
|
|
455
|
+
result[key] = activePreset.knobs[key];
|
|
456
|
+
} else {
|
|
457
|
+
result[key] = defaultKnobs[key];
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
result.animation = normalizeAnimationKnob(result.animation) ?? defaultKnobs.animation;
|
|
461
|
+
for (const state of stateKeys) {
|
|
462
|
+
const stateObj = {};
|
|
463
|
+
let hasValues = false;
|
|
464
|
+
for (const field of stateKnobFields) {
|
|
465
|
+
const globalKey = `${state}.${field}`;
|
|
466
|
+
const val = context.globals[globalKey];
|
|
467
|
+
if (val) {
|
|
468
|
+
stateObj[field] = val;
|
|
469
|
+
hasValues = true;
|
|
470
|
+
}
|
|
471
|
+
}
|
|
472
|
+
if (hasValues) {
|
|
473
|
+
result[state] = stateObj;
|
|
474
|
+
}
|
|
475
|
+
}
|
|
476
|
+
return result;
|
|
477
|
+
}, [
|
|
478
|
+
knobs,
|
|
479
|
+
context.globals,
|
|
480
|
+
storyThemeParams,
|
|
481
|
+
activePreset
|
|
482
|
+
]);
|
|
483
|
+
useEffect(() => {
|
|
484
|
+
setKnobs(knobUpdate);
|
|
485
|
+
}, [knobUpdate, setKnobs]);
|
|
486
|
+
useEffect(() => {
|
|
487
|
+
i18n.instance.changeLanguage(context.globals.locale);
|
|
488
|
+
}, [context.globals.locale]);
|
|
489
|
+
const presetCtxValue = useMemo(() => ({
|
|
490
|
+
preset: {
|
|
491
|
+
...applyColorTheme(activePreset ?? defaultPreset, colorGlobal),
|
|
492
|
+
theme: presetTheme,
|
|
493
|
+
knobs: {
|
|
494
|
+
...defaultKnobs,
|
|
495
|
+
...knobUpdate
|
|
496
|
+
}
|
|
497
|
+
},
|
|
498
|
+
overrides: void 0,
|
|
499
|
+
presetName: activePresetName,
|
|
500
|
+
scaleId,
|
|
501
|
+
color: colorGlobal || void 0
|
|
502
|
+
}), [
|
|
503
|
+
knobUpdate,
|
|
504
|
+
presetTheme,
|
|
505
|
+
activePreset,
|
|
506
|
+
colorGlobal,
|
|
507
|
+
activePresetName,
|
|
508
|
+
scaleId
|
|
509
|
+
]);
|
|
510
|
+
const animationValue = presetCtxValue.preset.knobs.animation;
|
|
511
|
+
useEffect(() => {
|
|
512
|
+
if (typeof document === "undefined") return;
|
|
513
|
+
const ms = `${animationValue === "none" ? 0 : animationDurations[animationValue]}ms`;
|
|
514
|
+
document.documentElement.style.setProperty("--mp-transition", ms);
|
|
515
|
+
}, [animationValue]);
|
|
516
|
+
const storyContent = /* @__PURE__ */ jsx(CanvasBackground, { children: /* @__PURE__ */ jsx(Story, { ...context }) });
|
|
517
|
+
const oppositeScheme = resolvedScheme === "dark" ? "light" : "dark";
|
|
518
|
+
return /* @__PURE__ */ jsx(PresetContext.Provider, {
|
|
519
|
+
value: presetCtxValue,
|
|
520
|
+
children: /* @__PURE__ */ jsxs(AppProvider, {
|
|
521
|
+
themeConfig: themeConfigsByName[themeConfigName],
|
|
522
|
+
systemTheme: resolvedScheme,
|
|
523
|
+
children: [
|
|
524
|
+
/* @__PURE__ */ jsx(AnimationNamesEmitter, {}),
|
|
525
|
+
/* @__PURE__ */ jsx(FrappeDebugEmitter, {}),
|
|
526
|
+
/* @__PURE__ */ jsx(BaseThemeColorEmitter, {}),
|
|
527
|
+
/* @__PURE__ */ jsxs(Theme, {
|
|
528
|
+
name: presetTheme || resolvedScheme,
|
|
529
|
+
children: [
|
|
530
|
+
/* @__PURE__ */ jsx(ThemeColorEmitter, {}),
|
|
531
|
+
/* @__PURE__ */ jsx(ColorChannelEmitter, {
|
|
532
|
+
event: accentColorsChannelEvent,
|
|
533
|
+
prefix: "accent"
|
|
534
|
+
}),
|
|
535
|
+
storyContent
|
|
536
|
+
]
|
|
537
|
+
}),
|
|
538
|
+
/* @__PURE__ */ jsxs(Theme, {
|
|
539
|
+
name: oppositeScheme,
|
|
540
|
+
children: [/* @__PURE__ */ jsx(OppositeThemeColorEmitter, {}), presetTheme ? /* @__PURE__ */ jsxs(Theme, {
|
|
541
|
+
name: presetTheme,
|
|
542
|
+
children: [/* @__PURE__ */ jsx(ColorChannelEmitter, { event: baseOppositeChannelEvent }), /* @__PURE__ */ jsx(ColorChannelEmitter, {
|
|
543
|
+
event: accentOppositeChannelEvent,
|
|
544
|
+
prefix: "accent"
|
|
545
|
+
})]
|
|
546
|
+
}) : /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ColorChannelEmitter, { event: baseOppositeChannelEvent }), /* @__PURE__ */ jsx(ColorChannelEmitter, {
|
|
547
|
+
event: accentOppositeChannelEvent,
|
|
548
|
+
prefix: "accent"
|
|
549
|
+
})] })]
|
|
550
|
+
})
|
|
551
|
+
]
|
|
552
|
+
}, `${themeConfigName}:${scaleId}`)
|
|
553
|
+
});
|
|
554
|
+
}
|
|
555
|
+
const frameworkDecorator = (Story, context) => /* @__PURE__ */ jsx(CookiesProvider, { children: /* @__PURE__ */ jsx(FrameworkDecoratorInner, {
|
|
556
|
+
Story,
|
|
557
|
+
context
|
|
558
|
+
}) });
|
|
559
|
+
return {
|
|
560
|
+
globalTypes,
|
|
561
|
+
initialGlobals,
|
|
562
|
+
parameters: {
|
|
563
|
+
...defaultParameters,
|
|
564
|
+
...extraParameters
|
|
565
|
+
},
|
|
566
|
+
decorators: [frameworkDecorator, ...extraDecorators]
|
|
567
|
+
};
|
|
595
568
|
}
|
|
569
|
+
|
|
596
570
|
export { accentColorsChannelEvent, accentOppositeChannelEvent, animationNamesChannelEvent, baseOppositeChannelEvent, baseThemeColorsChannelEvent, createPreview, frappeDebugChannelEvent, themeColorsChannelEvent, themeColorsOppositeChannelEvent };
|
|
597
571
|
//# sourceMappingURL=CreatePreview.mjs.map
|