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