@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
|
@@ -7,43 +7,36 @@ var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
|
7
7
|
var __getProtoOf = Object.getPrototypeOf;
|
|
8
8
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
9
9
|
var __export = (target, all) => {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
for (var name in all) __defProp(target, name, {
|
|
11
|
+
get: all[name],
|
|
12
|
+
enumerable: true
|
|
13
|
+
});
|
|
14
14
|
};
|
|
15
15
|
var __copyProps = (to, from, except, desc) => {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
17
|
+
for (let key of __getOwnPropNames(from)) if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
18
|
+
get: () => from[key],
|
|
19
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
return to;
|
|
23
23
|
};
|
|
24
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
28
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
29
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
30
|
-
value: mod,
|
|
31
|
-
enumerable: true
|
|
24
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
25
|
+
value: mod,
|
|
26
|
+
enumerable: true
|
|
32
27
|
}) : target, mod));
|
|
33
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
34
|
-
value: true
|
|
35
|
-
}), mod);
|
|
28
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
36
29
|
var CreatePreview_exports = {};
|
|
37
30
|
__export(CreatePreview_exports, {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
31
|
+
accentColorsChannelEvent: () => accentColorsChannelEvent,
|
|
32
|
+
accentOppositeChannelEvent: () => accentOppositeChannelEvent,
|
|
33
|
+
animationNamesChannelEvent: () => animationNamesChannelEvent,
|
|
34
|
+
baseOppositeChannelEvent: () => baseOppositeChannelEvent,
|
|
35
|
+
baseThemeColorsChannelEvent: () => baseThemeColorsChannelEvent,
|
|
36
|
+
createPreview: () => createPreview,
|
|
37
|
+
frappeDebugChannelEvent: () => frappeDebugChannelEvent,
|
|
38
|
+
themeColorsChannelEvent: () => themeColorsChannelEvent,
|
|
39
|
+
themeColorsOppositeChannelEvent: () => themeColorsOppositeChannelEvent
|
|
47
40
|
});
|
|
48
41
|
module.exports = __toCommonJS(CreatePreview_exports);
|
|
49
42
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -52,11 +45,6 @@ var import_theme = require("@multiplatform.one/theme");
|
|
|
52
45
|
var import_platform = require("@multiplatform.one/platform");
|
|
53
46
|
var import_react_cookie = require("react-cookie");
|
|
54
47
|
var import_tamagui = require("tamagui");
|
|
55
|
-
function _type_of(obj) {
|
|
56
|
-
"@swc/helpers - typeof";
|
|
57
|
-
|
|
58
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
59
|
-
}
|
|
60
48
|
var themeColorsChannelEvent = "theme-addon/theme-colors";
|
|
61
49
|
var themeColorsOppositeChannelEvent = "theme-addon/theme-colors-opposite";
|
|
62
50
|
var baseThemeColorsChannelEvent = "theme-addon/base-theme-colors";
|
|
@@ -67,817 +55,750 @@ var animationNamesChannelEvent = "theme-addon/animation-names";
|
|
|
67
55
|
var frappeDebugChannelEvent = "frappe-addon/debug-state";
|
|
68
56
|
var defaultThemeConfigName = "full";
|
|
69
57
|
var knobOptions = {
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
// LC-40 DISABLED-VISIBLE: the disabled-treatment dial is sweepable so the
|
|
84
|
-
// VERIFY probes (and humans) can flip keepLabel/dimWhole from the toolbar
|
|
85
|
-
// or via URL globals.
|
|
86
|
-
disabledStyle: Object.values(import_theme.DisabledStyle),
|
|
87
|
-
// K4: the one house knob a table sweep has to flip (MPO-132).
|
|
88
|
-
tableZebra: Object.values(import_theme.TableZebra)
|
|
58
|
+
fillStyle: Object.values(import_theme.FillStyle),
|
|
59
|
+
borderRadius: Object.values(import_theme.BorderRadius),
|
|
60
|
+
cornerSmoothing: Object.values(import_theme.CornerSmoothing),
|
|
61
|
+
borderWidth: Object.values(import_theme.BorderWidth),
|
|
62
|
+
elevation: Object.values(import_theme.Elevation),
|
|
63
|
+
textAccent: Object.values(import_theme.TextAccent),
|
|
64
|
+
headingFont: Object.values(import_theme.HeadingFont),
|
|
65
|
+
bodyFont: Object.values(import_theme.BodyFont),
|
|
66
|
+
fontWeight: Object.values(import_theme.FontWeight),
|
|
67
|
+
pageTitleScale: Object.values(import_theme.PageTitleScale),
|
|
68
|
+
animation: ["none", ...import_theme.motionStops],
|
|
69
|
+
disabledStyle: Object.values(import_theme.DisabledStyle),
|
|
70
|
+
tableZebra: Object.values(import_theme.TableZebra)
|
|
89
71
|
};
|
|
90
|
-
var stateKnobFields = [
|
|
72
|
+
var stateKnobFields = [
|
|
73
|
+
"fillStyle",
|
|
74
|
+
"borderRadius",
|
|
75
|
+
"borderWidth",
|
|
76
|
+
"elevation",
|
|
77
|
+
"textAccent",
|
|
78
|
+
"headingFont",
|
|
79
|
+
"bodyFont",
|
|
80
|
+
"fontWeight"
|
|
81
|
+
];
|
|
91
82
|
function parseValue(value) {
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
83
|
+
if (typeof value !== "string") return value;
|
|
84
|
+
try {
|
|
85
|
+
return JSON.parse(value);
|
|
86
|
+
} catch (unused) {
|
|
87
|
+
return value;
|
|
88
|
+
}
|
|
98
89
|
}
|
|
99
90
|
var toTitleCase = function toTitleCase2(str) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
91
|
+
return str.replace(/([A-Z])/g, " $1").replace(/^./, function(s) {
|
|
92
|
+
return s.toUpperCase();
|
|
93
|
+
});
|
|
103
94
|
};
|
|
104
95
|
function createControl(key) {
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
})
|
|
126
|
-
};
|
|
96
|
+
var _knobOptions_key;
|
|
97
|
+
var name = toTitleCase(key);
|
|
98
|
+
var values = (_knobOptions_key = knobOptions[key]) !== null && _knobOptions_key !== void 0 ? _knobOptions_key : [];
|
|
99
|
+
var serialized = values.map(function(value) {
|
|
100
|
+
return value;
|
|
101
|
+
});
|
|
102
|
+
var labels = Object.fromEntries(serialized.map(function(v) {
|
|
103
|
+
return [v, v.replace("$", "")];
|
|
104
|
+
}));
|
|
105
|
+
var fallback = import_theme.defaultKnobs[key];
|
|
106
|
+
return {
|
|
107
|
+
name,
|
|
108
|
+
description: name.toLowerCase(),
|
|
109
|
+
options: serialized,
|
|
110
|
+
control: {
|
|
111
|
+
type: "select",
|
|
112
|
+
labels
|
|
113
|
+
},
|
|
114
|
+
...fallback !== void 0 && { defaultValue: fallback }
|
|
115
|
+
};
|
|
127
116
|
}
|
|
128
117
|
function CanvasBackground(param) {
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
// children include the Tamagui `<Theme>` host, which appears only
|
|
147
|
-
// when a colour global is set — capturing there reports a remount as
|
|
148
|
-
// geometry drift and a dead colour axis.
|
|
149
|
-
id: "mpo-matrix-root",
|
|
150
|
-
children
|
|
151
|
-
});
|
|
118
|
+
var { children } = param;
|
|
119
|
+
var _tamaguiTheme_background;
|
|
120
|
+
var tamaguiTheme = (0, import_tamagui.useTheme)();
|
|
121
|
+
var bg = (_tamaguiTheme_background = tamaguiTheme.background) === null || _tamaguiTheme_background === void 0 ? void 0 : _tamaguiTheme_background.val;
|
|
122
|
+
(0, import_react.useLayoutEffect)(function() {
|
|
123
|
+
if (bg && typeof document !== "undefined") {
|
|
124
|
+
document.body.style.backgroundColor = bg;
|
|
125
|
+
document.documentElement.style.backgroundColor = bg;
|
|
126
|
+
}
|
|
127
|
+
}, [bg]);
|
|
128
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_tamagui.YStack, {
|
|
129
|
+
flex: 1,
|
|
130
|
+
minHeight: "100vh",
|
|
131
|
+
backgroundColor: "background",
|
|
132
|
+
id: "mpo-matrix-root",
|
|
133
|
+
children
|
|
134
|
+
});
|
|
152
135
|
}
|
|
153
136
|
var _channelEmit = null;
|
|
154
137
|
function getChannelEmit() {
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
138
|
+
if (_channelEmit) return _channelEmit;
|
|
139
|
+
try {
|
|
140
|
+
var mod = require("storybook/preview-api");
|
|
141
|
+
var channel = mod.addons.getChannel();
|
|
142
|
+
_channelEmit = function _channelEmit2(event, data) {
|
|
143
|
+
return channel.emit(event, data);
|
|
144
|
+
};
|
|
145
|
+
return _channelEmit;
|
|
146
|
+
} catch (unused) {
|
|
147
|
+
return null;
|
|
148
|
+
}
|
|
166
149
|
}
|
|
167
150
|
function AnimationNamesEmitter() {
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
151
|
+
var emittedRef = (0, import_react.useRef)(false);
|
|
152
|
+
(0, import_react.useEffect)(function() {
|
|
153
|
+
var _getChannelEmit;
|
|
154
|
+
if (emittedRef.current) return;
|
|
155
|
+
emittedRef.current = true;
|
|
156
|
+
(_getChannelEmit = getChannelEmit()) === null || _getChannelEmit === void 0 ? void 0 : _getChannelEmit(animationNamesChannelEvent, [...import_theme.motionStops]);
|
|
157
|
+
}, []);
|
|
158
|
+
return null;
|
|
176
159
|
}
|
|
177
160
|
function FrappeDebugEmitter() {
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
},
|
|
232
|
-
// debug not available
|
|
233
|
-
[tick]);
|
|
234
|
-
return null;
|
|
161
|
+
var prevRef = (0, import_react.useRef)("");
|
|
162
|
+
var syncRef = (0, import_react.useRef)(null);
|
|
163
|
+
var [tick, setTick] = (0, import_react.useState)(0);
|
|
164
|
+
(0, import_react.useEffect)(function() {
|
|
165
|
+
var cancelled = false;
|
|
166
|
+
async function resolve() {
|
|
167
|
+
try {
|
|
168
|
+
var { __getActiveSyncModule } = await import("@multiplatform.one/frappe");
|
|
169
|
+
var sync = __getActiveSyncModule();
|
|
170
|
+
if (sync && !cancelled) {
|
|
171
|
+
syncRef.current = sync;
|
|
172
|
+
setTick(function(t) {
|
|
173
|
+
return t + 1;
|
|
174
|
+
});
|
|
175
|
+
return sync.subscribeStore(function() {
|
|
176
|
+
if (!cancelled) setTick(function(t) {
|
|
177
|
+
return t + 1;
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
} catch (unused) {}
|
|
182
|
+
}
|
|
183
|
+
var cleanupPromise = resolve();
|
|
184
|
+
var attempts = 0;
|
|
185
|
+
var interval = setInterval(async function() {
|
|
186
|
+
attempts++;
|
|
187
|
+
if (syncRef.current || cancelled || attempts >= 10) {
|
|
188
|
+
clearInterval(interval);
|
|
189
|
+
return;
|
|
190
|
+
}
|
|
191
|
+
await resolve();
|
|
192
|
+
}, 2e3);
|
|
193
|
+
return function() {
|
|
194
|
+
cancelled = true;
|
|
195
|
+
clearInterval(interval);
|
|
196
|
+
cleanupPromise.then(function(unsub) {
|
|
197
|
+
return unsub === null || unsub === void 0 ? void 0 : unsub();
|
|
198
|
+
});
|
|
199
|
+
};
|
|
200
|
+
}, []);
|
|
201
|
+
(0, import_react.useEffect)(function() {
|
|
202
|
+
if (!syncRef.current) return;
|
|
203
|
+
var emit = getChannelEmit();
|
|
204
|
+
if (!emit) return;
|
|
205
|
+
try {
|
|
206
|
+
var state = syncRef.current.__debug();
|
|
207
|
+
var key = JSON.stringify(state);
|
|
208
|
+
if (key === prevRef.current) return;
|
|
209
|
+
prevRef.current = key;
|
|
210
|
+
emit(frappeDebugChannelEvent, state);
|
|
211
|
+
} catch (unused) {}
|
|
212
|
+
}, [tick]);
|
|
213
|
+
return null;
|
|
235
214
|
}
|
|
236
215
|
function ThemeColorEmitter() {
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
216
|
+
var tamaguiTheme = (0, import_tamagui.useTheme)();
|
|
217
|
+
var prevRef = (0, import_react.useRef)("");
|
|
218
|
+
(0, import_react.useEffect)(function() {
|
|
219
|
+
var _getChannelEmit;
|
|
220
|
+
var colors = [];
|
|
221
|
+
for (var i = 1; i <= 12; i++) {
|
|
222
|
+
var _ref;
|
|
223
|
+
var token = tamaguiTheme[`color-${i}`];
|
|
224
|
+
colors.push((_ref = token === null || token === void 0 ? void 0 : token.val) !== null && _ref !== void 0 ? _ref : "");
|
|
225
|
+
}
|
|
226
|
+
var key = colors.join("|");
|
|
227
|
+
if (key === prevRef.current) return;
|
|
228
|
+
prevRef.current = key;
|
|
229
|
+
(_getChannelEmit = getChannelEmit()) === null || _getChannelEmit === void 0 ? void 0 : _getChannelEmit(themeColorsChannelEvent, colors);
|
|
230
|
+
}, [tamaguiTheme]);
|
|
231
|
+
return null;
|
|
253
232
|
}
|
|
254
233
|
function BaseThemeColorEmitter() {
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
234
|
+
var tamaguiTheme = (0, import_tamagui.useTheme)();
|
|
235
|
+
var prevRef = (0, import_react.useRef)("");
|
|
236
|
+
(0, import_react.useEffect)(function() {
|
|
237
|
+
var _getChannelEmit;
|
|
238
|
+
var colors = [];
|
|
239
|
+
for (var i = 1; i <= 12; i++) {
|
|
240
|
+
var _ref;
|
|
241
|
+
var token = tamaguiTheme[`color-${i}`];
|
|
242
|
+
colors.push((_ref = token === null || token === void 0 ? void 0 : token.val) !== null && _ref !== void 0 ? _ref : "");
|
|
243
|
+
}
|
|
244
|
+
var key = colors.join("|");
|
|
245
|
+
if (key === prevRef.current) return;
|
|
246
|
+
prevRef.current = key;
|
|
247
|
+
(_getChannelEmit = getChannelEmit()) === null || _getChannelEmit === void 0 ? void 0 : _getChannelEmit(baseThemeColorsChannelEvent, colors);
|
|
248
|
+
}, [tamaguiTheme]);
|
|
249
|
+
return null;
|
|
271
250
|
}
|
|
272
251
|
function OppositeThemeColorEmitter() {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
252
|
+
var tamaguiTheme = (0, import_tamagui.useTheme)();
|
|
253
|
+
var prevRef = (0, import_react.useRef)("");
|
|
254
|
+
(0, import_react.useEffect)(function() {
|
|
255
|
+
var _getChannelEmit;
|
|
256
|
+
var colors = [];
|
|
257
|
+
for (var i = 1; i <= 12; i++) {
|
|
258
|
+
var _ref;
|
|
259
|
+
var token = tamaguiTheme[`color-${i}`];
|
|
260
|
+
colors.push((_ref = token === null || token === void 0 ? void 0 : token.val) !== null && _ref !== void 0 ? _ref : "");
|
|
261
|
+
}
|
|
262
|
+
var key = colors.join("|");
|
|
263
|
+
if (key === prevRef.current) return;
|
|
264
|
+
prevRef.current = key;
|
|
265
|
+
(_getChannelEmit = getChannelEmit()) === null || _getChannelEmit === void 0 ? void 0 : _getChannelEmit(themeColorsOppositeChannelEvent, colors);
|
|
266
|
+
}, [tamaguiTheme]);
|
|
267
|
+
return null;
|
|
289
268
|
}
|
|
290
269
|
function ColorChannelEmitter(param) {
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
270
|
+
var { event, prefix = "color" } = param;
|
|
271
|
+
var tamaguiTheme = (0, import_tamagui.useTheme)();
|
|
272
|
+
var prevRef = (0, import_react.useRef)("");
|
|
273
|
+
(0, import_react.useEffect)(function() {
|
|
274
|
+
var _getChannelEmit;
|
|
275
|
+
var colors = [];
|
|
276
|
+
var found = false;
|
|
277
|
+
for (var i = 1; i <= 12; i++) {
|
|
278
|
+
var _ref;
|
|
279
|
+
var token = tamaguiTheme[`${prefix}${i}`];
|
|
280
|
+
var val = (_ref = token === null || token === void 0 ? void 0 : token.val) !== null && _ref !== void 0 ? _ref : "";
|
|
281
|
+
colors.push(val);
|
|
282
|
+
if (val) found = true;
|
|
283
|
+
}
|
|
284
|
+
if (!found) return;
|
|
285
|
+
var key = colors.join("|");
|
|
286
|
+
if (key === prevRef.current) return;
|
|
287
|
+
prevRef.current = key;
|
|
288
|
+
(_getChannelEmit = getChannelEmit()) === null || _getChannelEmit === void 0 ? void 0 : _getChannelEmit(event, colors);
|
|
289
|
+
}, [
|
|
290
|
+
tamaguiTheme,
|
|
291
|
+
event,
|
|
292
|
+
prefix
|
|
293
|
+
]);
|
|
294
|
+
return null;
|
|
315
295
|
}
|
|
316
|
-
var tamaguiPropLeakPatterns = ["pressTheme", "scaleIcon", "borderTopRightRadius", "borderBottomRightRadius", "borderTopLeftRadius", "borderBottomLeftRadius"];
|
|
317
|
-
function suppressTamaguiDomWarnings() {
|
|
318
|
-
if (typeof window === "undefined") return;
|
|
319
|
-
var origError = console.error;
|
|
320
|
-
console.error = function () {
|
|
321
|
-
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
|
|
322
|
-
args[_key] = arguments[_key];
|
|
323
|
-
}
|
|
324
|
-
var msg = args.map(function (a) {
|
|
325
|
-
return typeof a === "string" ? a : "";
|
|
326
|
-
}).join(" ");
|
|
327
|
-
if (msg.includes("React does not recognize the") && tamaguiPropLeakPatterns.some(function (p) {
|
|
328
|
-
return msg.includes(p);
|
|
329
|
-
})) {
|
|
330
|
-
return;
|
|
331
|
-
}
|
|
332
|
-
origError(...args);
|
|
333
|
-
};
|
|
334
|
-
}
|
|
335
|
-
suppressTamaguiDomWarnings();
|
|
336
296
|
function createPreview(options) {
|
|
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
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
}), /* Opposite scheme emitters */
|
|
843
|
-
/* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.Theme, {
|
|
844
|
-
name: oppositeScheme,
|
|
845
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(OppositeThemeColorEmitter, {}), presetTheme ? /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_tamagui.Theme, {
|
|
846
|
-
name: presetTheme,
|
|
847
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(ColorChannelEmitter, {
|
|
848
|
-
event: baseOppositeChannelEvent
|
|
849
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(ColorChannelEmitter, {
|
|
850
|
-
event: accentOppositeChannelEvent,
|
|
851
|
-
prefix: "accent"
|
|
852
|
-
})]
|
|
853
|
-
}) : /* @__PURE__ */(0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, {
|
|
854
|
-
children: [/* @__PURE__ */(0, import_jsx_runtime.jsx)(ColorChannelEmitter, {
|
|
855
|
-
event: baseOppositeChannelEvent
|
|
856
|
-
}), /* @__PURE__ */(0, import_jsx_runtime.jsx)(ColorChannelEmitter, {
|
|
857
|
-
event: accentOppositeChannelEvent,
|
|
858
|
-
prefix: "accent"
|
|
859
|
-
})]
|
|
860
|
-
})]
|
|
861
|
-
})]
|
|
862
|
-
}, `${themeConfigName}:${scaleId}`)
|
|
863
|
-
});
|
|
864
|
-
}
|
|
865
|
-
var frameworkDecorator = function frameworkDecorator2(Story, context) {
|
|
866
|
-
return /* @__PURE__ */(0, import_jsx_runtime.jsx)(import_react_cookie.CookiesProvider, {
|
|
867
|
-
children: /* @__PURE__ */(0, import_jsx_runtime.jsx)(FrameworkDecoratorInner, {
|
|
868
|
-
Story,
|
|
869
|
-
context
|
|
870
|
-
})
|
|
871
|
-
});
|
|
872
|
-
};
|
|
873
|
-
return {
|
|
874
|
-
globalTypes,
|
|
875
|
-
initialGlobals,
|
|
876
|
-
parameters: {
|
|
877
|
-
...defaultParameters,
|
|
878
|
-
...extraParameters
|
|
879
|
-
},
|
|
880
|
-
decorators: [frameworkDecorator, ...extraDecorators]
|
|
881
|
-
};
|
|
297
|
+
var _themeConfig_defaultPreset;
|
|
298
|
+
var { themeConfig, i18n, AppProvider, setUserScheme, decorators: extraDecorators = [], parameters: extraParameters = {}, globalTypes: extraGlobalTypes = {} } = options;
|
|
299
|
+
var themeConfigsByName = {
|
|
300
|
+
...options.themeConfigs,
|
|
301
|
+
[defaultThemeConfigName]: themeConfig
|
|
302
|
+
};
|
|
303
|
+
var themeConfigNames = [defaultThemeConfigName, ...Object.keys(themeConfigsByName).filter(function(name2) {
|
|
304
|
+
return name2 !== defaultThemeConfigName;
|
|
305
|
+
})];
|
|
306
|
+
var switchesThemeConfig = themeConfigNames.length > 1;
|
|
307
|
+
if (switchesThemeConfig) (0, import_theme.activateThemeConfig)(themeConfig);
|
|
308
|
+
var activeThemeConfigName = defaultThemeConfigName;
|
|
309
|
+
function useActiveThemeConfigName(requested) {
|
|
310
|
+
var [active, setActive] = (0, import_react.useState)(activeThemeConfigName);
|
|
311
|
+
(0, import_react.useLayoutEffect)(function() {
|
|
312
|
+
if (requested !== activeThemeConfigName) {
|
|
313
|
+
(0, import_theme.activateThemeConfig)(themeConfigsByName[requested]);
|
|
314
|
+
activeThemeConfigName = requested;
|
|
315
|
+
}
|
|
316
|
+
setActive(requested);
|
|
317
|
+
}, [requested]);
|
|
318
|
+
return active;
|
|
319
|
+
}
|
|
320
|
+
var enumKeys = Object.keys(knobOptions);
|
|
321
|
+
var generatedGlobalTypes = {};
|
|
322
|
+
var _iteratorNormalCompletion = true, _didIteratorError = false, _iteratorError = void 0;
|
|
323
|
+
try {
|
|
324
|
+
for (var _iterator = enumKeys[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {
|
|
325
|
+
var key = _step.value;
|
|
326
|
+
generatedGlobalTypes[key] = createControl(key);
|
|
327
|
+
}
|
|
328
|
+
} catch (err) {
|
|
329
|
+
_didIteratorError = true;
|
|
330
|
+
_iteratorError = err;
|
|
331
|
+
} finally {
|
|
332
|
+
try {
|
|
333
|
+
if (!_iteratorNormalCompletion && _iterator.return != null) {
|
|
334
|
+
_iterator.return();
|
|
335
|
+
}
|
|
336
|
+
} finally {
|
|
337
|
+
if (_didIteratorError) {
|
|
338
|
+
throw _iteratorError;
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
for (var _i = 0, _iter = [
|
|
343
|
+
"hover",
|
|
344
|
+
"press",
|
|
345
|
+
"focus",
|
|
346
|
+
"focusVisible"
|
|
347
|
+
]; _i < _iter.length; _i++) {
|
|
348
|
+
var state = _iter[_i];
|
|
349
|
+
var _iteratorNormalCompletion1 = true, _didIteratorError1 = false, _iteratorError1 = void 0;
|
|
350
|
+
try {
|
|
351
|
+
for (var _iterator1 = stateKnobFields[Symbol.iterator](), _step1; !(_iteratorNormalCompletion1 = (_step1 = _iterator1.next()).done); _iteratorNormalCompletion1 = true) {
|
|
352
|
+
var field = _step1.value;
|
|
353
|
+
var _knobOptions_field;
|
|
354
|
+
var stateKey = `${state}.${field}`;
|
|
355
|
+
var values = (_knobOptions_field = knobOptions[field]) !== null && _knobOptions_field !== void 0 ? _knobOptions_field : [];
|
|
356
|
+
var serialized = values.map(function(value) {
|
|
357
|
+
return value;
|
|
358
|
+
});
|
|
359
|
+
var labels = Object.fromEntries(serialized.map(function(v) {
|
|
360
|
+
return [v, v.replace("$", "")];
|
|
361
|
+
}));
|
|
362
|
+
generatedGlobalTypes[stateKey] = {
|
|
363
|
+
name: `${toTitleCase(state)} ${toTitleCase(field)}`,
|
|
364
|
+
description: `${state} override for ${field}`,
|
|
365
|
+
options: serialized,
|
|
366
|
+
control: {
|
|
367
|
+
type: "select",
|
|
368
|
+
labels
|
|
369
|
+
},
|
|
370
|
+
defaultValue: ""
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
} catch (err) {
|
|
374
|
+
_didIteratorError1 = true;
|
|
375
|
+
_iteratorError1 = err;
|
|
376
|
+
} finally {
|
|
377
|
+
try {
|
|
378
|
+
if (!_iteratorNormalCompletion1 && _iterator1.return != null) {
|
|
379
|
+
_iterator1.return();
|
|
380
|
+
}
|
|
381
|
+
} finally {
|
|
382
|
+
if (_didIteratorError1) {
|
|
383
|
+
throw _iteratorError1;
|
|
384
|
+
}
|
|
385
|
+
}
|
|
386
|
+
}
|
|
387
|
+
}
|
|
388
|
+
var themeColorNames = ["", ...themeConfig.themeColors];
|
|
389
|
+
var themeSwatches = {};
|
|
390
|
+
var allThemes = themeConfig.tamagui.themes;
|
|
391
|
+
if (allThemes) {
|
|
392
|
+
var _iteratorNormalCompletion2 = true, _didIteratorError2 = false, _iteratorError2 = void 0;
|
|
393
|
+
try {
|
|
394
|
+
for (var _iterator2 = themeConfig.themeColors[Symbol.iterator](), _step2; !(_iteratorNormalCompletion2 = (_step2 = _iterator2.next()).done); _iteratorNormalCompletion2 = true) {
|
|
395
|
+
var name = _step2.value;
|
|
396
|
+
var _allThemes_;
|
|
397
|
+
var theme = (_allThemes_ = allThemes[`light_${name}`]) !== null && _allThemes_ !== void 0 ? _allThemes_ : allThemes[name];
|
|
398
|
+
if (!theme) continue;
|
|
399
|
+
var token = theme["color-7"];
|
|
400
|
+
if (typeof token === "string") {
|
|
401
|
+
themeSwatches[name] = token;
|
|
402
|
+
} else if (token && typeof token === "object" && "val" in token) {
|
|
403
|
+
themeSwatches[name] = String(token.val);
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
} catch (err) {
|
|
407
|
+
_didIteratorError2 = true;
|
|
408
|
+
_iteratorError2 = err;
|
|
409
|
+
} finally {
|
|
410
|
+
try {
|
|
411
|
+
if (!_iteratorNormalCompletion2 && _iterator2.return != null) {
|
|
412
|
+
_iterator2.return();
|
|
413
|
+
}
|
|
414
|
+
} finally {
|
|
415
|
+
if (_didIteratorError2) {
|
|
416
|
+
throw _iteratorError2;
|
|
417
|
+
}
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
}
|
|
421
|
+
generatedGlobalTypes.color = {
|
|
422
|
+
name: "Theme",
|
|
423
|
+
description: "Theme color palette",
|
|
424
|
+
options: themeColorNames,
|
|
425
|
+
control: {
|
|
426
|
+
type: "select",
|
|
427
|
+
labels: Object.fromEntries(themeColorNames.map(function(v) {
|
|
428
|
+
return [v, v || "(none)"];
|
|
429
|
+
}))
|
|
430
|
+
}
|
|
431
|
+
};
|
|
432
|
+
generatedGlobalTypes.scheme = {
|
|
433
|
+
name: "Scheme",
|
|
434
|
+
description: "Color scheme (light/dark/system)",
|
|
435
|
+
options: [
|
|
436
|
+
"system",
|
|
437
|
+
"light",
|
|
438
|
+
"dark"
|
|
439
|
+
],
|
|
440
|
+
control: { type: "select" }
|
|
441
|
+
};
|
|
442
|
+
generatedGlobalTypes.locale = {
|
|
443
|
+
name: "Locale",
|
|
444
|
+
description: "Controls internationalization language",
|
|
445
|
+
options: [...i18n.languages],
|
|
446
|
+
control: { type: "select" },
|
|
447
|
+
toolbar: {
|
|
448
|
+
title: "Locale",
|
|
449
|
+
items: [...i18n.languages],
|
|
450
|
+
dynamicTitle: true
|
|
451
|
+
}
|
|
452
|
+
};
|
|
453
|
+
if (switchesThemeConfig) {
|
|
454
|
+
generatedGlobalTypes.tamaguiConfig = {
|
|
455
|
+
name: "Tamagui config",
|
|
456
|
+
description: "Tamagui config the story renders under",
|
|
457
|
+
options: themeConfigNames,
|
|
458
|
+
control: { type: "select" },
|
|
459
|
+
toolbar: {
|
|
460
|
+
title: "Tamagui config",
|
|
461
|
+
icon: "paintbrush",
|
|
462
|
+
items: themeConfigNames.map(function(name2) {
|
|
463
|
+
return {
|
|
464
|
+
value: name2,
|
|
465
|
+
title: `${name2} config`
|
|
466
|
+
};
|
|
467
|
+
}),
|
|
468
|
+
dynamicTitle: true
|
|
469
|
+
}
|
|
470
|
+
};
|
|
471
|
+
}
|
|
472
|
+
var globalTypes = {
|
|
473
|
+
...generatedGlobalTypes,
|
|
474
|
+
...extraGlobalTypes
|
|
475
|
+
};
|
|
476
|
+
var initialGlobals = {
|
|
477
|
+
locale: import_platform.config.get("I18N_DEFAULT_LANGUAGE", i18n.defaultLanguage),
|
|
478
|
+
color: "",
|
|
479
|
+
scheme: "system",
|
|
480
|
+
__presetNames: (0, import_theme.getPresetNames)(),
|
|
481
|
+
__presetScales: Object.fromEntries((0, import_theme.getPresetNames)().map(function(name2) {
|
|
482
|
+
var _ref;
|
|
483
|
+
var _getPreset;
|
|
484
|
+
var scale = (_ref = (_getPreset = (0, import_theme.getPreset)(name2)) === null || _getPreset === void 0 ? void 0 : _getPreset.scale) !== null && _ref !== void 0 ? _ref : import_theme.defaultScaleInputs;
|
|
485
|
+
return [name2, {
|
|
486
|
+
control: scale.control,
|
|
487
|
+
type: scale.type
|
|
488
|
+
}];
|
|
489
|
+
})),
|
|
490
|
+
__themeColors: themeColorNames,
|
|
491
|
+
__themeSwatches: themeSwatches,
|
|
492
|
+
preset: (_themeConfig_defaultPreset = themeConfig.defaultPreset) !== null && _themeConfig_defaultPreset !== void 0 ? _themeConfig_defaultPreset : "",
|
|
493
|
+
...switchesThemeConfig && { tamaguiConfig: defaultThemeConfigName }
|
|
494
|
+
};
|
|
495
|
+
var _iteratorNormalCompletion3 = true, _didIteratorError3 = false, _iteratorError3 = void 0;
|
|
496
|
+
try {
|
|
497
|
+
for (var _iterator3 = enumKeys[Symbol.iterator](), _step3; !(_iteratorNormalCompletion3 = (_step3 = _iterator3.next()).done); _iteratorNormalCompletion3 = true) {
|
|
498
|
+
var key1 = _step3.value;
|
|
499
|
+
if (!(key1 in initialGlobals)) {
|
|
500
|
+
initialGlobals[key1] = "";
|
|
501
|
+
}
|
|
502
|
+
}
|
|
503
|
+
} catch (err) {
|
|
504
|
+
_didIteratorError3 = true;
|
|
505
|
+
_iteratorError3 = err;
|
|
506
|
+
} finally {
|
|
507
|
+
try {
|
|
508
|
+
if (!_iteratorNormalCompletion3 && _iterator3.return != null) {
|
|
509
|
+
_iterator3.return();
|
|
510
|
+
}
|
|
511
|
+
} finally {
|
|
512
|
+
if (_didIteratorError3) {
|
|
513
|
+
throw _iteratorError3;
|
|
514
|
+
}
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
for (var _i1 = 0, _iter1 = [
|
|
518
|
+
"hover",
|
|
519
|
+
"press",
|
|
520
|
+
"focus",
|
|
521
|
+
"focusVisible"
|
|
522
|
+
]; _i1 < _iter1.length; _i1++) {
|
|
523
|
+
var state1 = _iter1[_i1];
|
|
524
|
+
var _iteratorNormalCompletion4 = true, _didIteratorError4 = false, _iteratorError4 = void 0;
|
|
525
|
+
try {
|
|
526
|
+
for (var _iterator4 = stateKnobFields[Symbol.iterator](), _step4; !(_iteratorNormalCompletion4 = (_step4 = _iterator4.next()).done); _iteratorNormalCompletion4 = true) {
|
|
527
|
+
var field1 = _step4.value;
|
|
528
|
+
initialGlobals[`${state1}.${field1}`] = "";
|
|
529
|
+
}
|
|
530
|
+
} catch (err) {
|
|
531
|
+
_didIteratorError4 = true;
|
|
532
|
+
_iteratorError4 = err;
|
|
533
|
+
} finally {
|
|
534
|
+
try {
|
|
535
|
+
if (!_iteratorNormalCompletion4 && _iterator4.return != null) {
|
|
536
|
+
_iterator4.return();
|
|
537
|
+
}
|
|
538
|
+
} finally {
|
|
539
|
+
if (_didIteratorError4) {
|
|
540
|
+
throw _iteratorError4;
|
|
541
|
+
}
|
|
542
|
+
}
|
|
543
|
+
}
|
|
544
|
+
}
|
|
545
|
+
globalThis.__MPO_THEME_AXES__ = {
|
|
546
|
+
schemes: ["light", "dark"],
|
|
547
|
+
themeColors: themeColorNames,
|
|
548
|
+
presets: ["", ...(0, import_theme.getPresetNames)()],
|
|
549
|
+
presetThemes: Object.fromEntries((0, import_theme.getPresetNames)().flatMap(function(name2) {
|
|
550
|
+
var _getPreset;
|
|
551
|
+
var theme2 = (_getPreset = (0, import_theme.getPreset)(name2)) === null || _getPreset === void 0 ? void 0 : _getPreset.theme;
|
|
552
|
+
return theme2 ? [[name2, theme2]] : [];
|
|
553
|
+
}))
|
|
554
|
+
};
|
|
555
|
+
var defaultParameters = {
|
|
556
|
+
actions: { argTypesRegex: "^on[A-Z].*" },
|
|
557
|
+
layout: "padded",
|
|
558
|
+
viewMode: "story",
|
|
559
|
+
controls: {
|
|
560
|
+
expanded: true,
|
|
561
|
+
hideNoControlsWarning: true,
|
|
562
|
+
matchers: {
|
|
563
|
+
color: /(background|color)$/i,
|
|
564
|
+
date: /Date$/
|
|
565
|
+
}
|
|
566
|
+
},
|
|
567
|
+
backgrounds: { disable: true },
|
|
568
|
+
previewTabs: { "storybook/docs/panel": { hidden: true } },
|
|
569
|
+
a11y: { test: false },
|
|
570
|
+
docs: { codePanel: true },
|
|
571
|
+
darkMode: { stylePreview: true }
|
|
572
|
+
};
|
|
573
|
+
function FrameworkDecoratorInner(param) {
|
|
574
|
+
var { Story, context } = param;
|
|
575
|
+
var _context_parameters;
|
|
576
|
+
var [knobs, setKnobs] = (0, import_theme.useTheme)();
|
|
577
|
+
var schemeGlobal = context.globals.scheme || "system";
|
|
578
|
+
var [resolvedScheme, setResolvedScheme] = (0, import_react.useState)(function() {
|
|
579
|
+
if (schemeGlobal === "light" || schemeGlobal === "dark") return schemeGlobal;
|
|
580
|
+
if (typeof window !== "undefined" && window.matchMedia) {
|
|
581
|
+
return window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light";
|
|
582
|
+
}
|
|
583
|
+
return "light";
|
|
584
|
+
});
|
|
585
|
+
(0, import_react.useEffect)(function() {
|
|
586
|
+
if (schemeGlobal === "light" || schemeGlobal === "dark") {
|
|
587
|
+
setResolvedScheme(schemeGlobal);
|
|
588
|
+
return;
|
|
589
|
+
}
|
|
590
|
+
if (typeof window === "undefined" || !window.matchMedia) {
|
|
591
|
+
setResolvedScheme("light");
|
|
592
|
+
return;
|
|
593
|
+
}
|
|
594
|
+
var mq = window.matchMedia("(prefers-color-scheme: dark)");
|
|
595
|
+
var handler = function handler2() {
|
|
596
|
+
return setResolvedScheme(mq.matches ? "dark" : "light");
|
|
597
|
+
};
|
|
598
|
+
handler();
|
|
599
|
+
mq.addEventListener("change", handler);
|
|
600
|
+
return function() {
|
|
601
|
+
return mq.removeEventListener("change", handler);
|
|
602
|
+
};
|
|
603
|
+
}, [schemeGlobal]);
|
|
604
|
+
(0, import_react.useLayoutEffect)(function() {
|
|
605
|
+
var setting = schemeGlobal === "light" || schemeGlobal === "dark" ? schemeGlobal : "system";
|
|
606
|
+
setUserScheme === null || setUserScheme === void 0 ? void 0 : setUserScheme(setting);
|
|
607
|
+
(0, import_theme.setStoredScheme)(setting);
|
|
608
|
+
}, [schemeGlobal]);
|
|
609
|
+
var colorGlobal = context.globals.color || "";
|
|
610
|
+
var requestedThemeConfig = context.globals.tamaguiConfig;
|
|
611
|
+
var requestedThemeConfigName = requestedThemeConfig && themeConfigNames.includes(requestedThemeConfig) ? requestedThemeConfig : defaultThemeConfigName;
|
|
612
|
+
var themeConfigName = useActiveThemeConfigName(requestedThemeConfigName);
|
|
613
|
+
var storyThemeParams = (_context_parameters = context.parameters) === null || _context_parameters === void 0 ? void 0 : _context_parameters.theme;
|
|
614
|
+
var activePresetName = context.globals.preset || void 0;
|
|
615
|
+
var activePreset = activePresetName ? (0, import_theme.getPreset)(activePresetName) : void 0;
|
|
616
|
+
var presetTheme = colorGlobal || (activePreset === null || activePreset === void 0 ? void 0 : activePreset.theme) || import_theme.defaultPreset.theme;
|
|
617
|
+
var scaleId = (0, import_theme.useActiveScale)(themeConfigsByName[requestedThemeConfigName], activePresetName);
|
|
618
|
+
var knobUpdate = (0, import_react.useMemo)(function() {
|
|
619
|
+
var _normalizeAnimationKnob;
|
|
620
|
+
var result = {};
|
|
621
|
+
var stateKeys = /* @__PURE__ */ new Set([
|
|
622
|
+
"hover",
|
|
623
|
+
"press",
|
|
624
|
+
"focus",
|
|
625
|
+
"focusVisible"
|
|
626
|
+
]);
|
|
627
|
+
var _iteratorNormalCompletion5 = true, _didIteratorError5 = false, _iteratorError5 = void 0;
|
|
628
|
+
try {
|
|
629
|
+
for (var _iterator5 = Object.keys(knobs)[Symbol.iterator](), _step5; !(_iteratorNormalCompletion5 = (_step5 = _iterator5.next()).done); _iteratorNormalCompletion5 = true) {
|
|
630
|
+
var key2 = _step5.value;
|
|
631
|
+
if (stateKeys.has(key2)) continue;
|
|
632
|
+
if (storyThemeParams && key2 in storyThemeParams) {
|
|
633
|
+
result[key2] = storyThemeParams[key2];
|
|
634
|
+
} else if (key2 in context.globals && context.globals[key2] !== void 0 && context.globals[key2] !== "") {
|
|
635
|
+
result[key2] = parseValue(context.globals[key2]);
|
|
636
|
+
} else if (activePreset && key2 in activePreset.knobs) {
|
|
637
|
+
result[key2] = activePreset.knobs[key2];
|
|
638
|
+
} else {
|
|
639
|
+
result[key2] = import_theme.defaultKnobs[key2];
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
} catch (err) {
|
|
643
|
+
_didIteratorError5 = true;
|
|
644
|
+
_iteratorError5 = err;
|
|
645
|
+
} finally {
|
|
646
|
+
try {
|
|
647
|
+
if (!_iteratorNormalCompletion5 && _iterator5.return != null) {
|
|
648
|
+
_iterator5.return();
|
|
649
|
+
}
|
|
650
|
+
} finally {
|
|
651
|
+
if (_didIteratorError5) {
|
|
652
|
+
throw _iteratorError5;
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
}
|
|
656
|
+
result.animation = (_normalizeAnimationKnob = (0, import_theme.normalizeAnimationKnob)(result.animation)) !== null && _normalizeAnimationKnob !== void 0 ? _normalizeAnimationKnob : import_theme.defaultKnobs.animation;
|
|
657
|
+
var _iteratorNormalCompletion12 = true, _didIteratorError12 = false, _iteratorError12 = void 0;
|
|
658
|
+
try {
|
|
659
|
+
for (var _iterator12 = stateKeys[Symbol.iterator](), _step12; !(_iteratorNormalCompletion12 = (_step12 = _iterator12.next()).done); _iteratorNormalCompletion12 = true) {
|
|
660
|
+
var state2 = _step12.value;
|
|
661
|
+
var stateObj = {};
|
|
662
|
+
var hasValues = false;
|
|
663
|
+
var _iteratorNormalCompletion22 = true, _didIteratorError22 = false, _iteratorError22 = void 0;
|
|
664
|
+
try {
|
|
665
|
+
for (var _iterator22 = stateKnobFields[Symbol.iterator](), _step22; !(_iteratorNormalCompletion22 = (_step22 = _iterator22.next()).done); _iteratorNormalCompletion22 = true) {
|
|
666
|
+
var field2 = _step22.value;
|
|
667
|
+
var globalKey = `${state2}.${field2}`;
|
|
668
|
+
var val = context.globals[globalKey];
|
|
669
|
+
if (val) {
|
|
670
|
+
stateObj[field2] = val;
|
|
671
|
+
hasValues = true;
|
|
672
|
+
}
|
|
673
|
+
}
|
|
674
|
+
} catch (err) {
|
|
675
|
+
_didIteratorError22 = true;
|
|
676
|
+
_iteratorError22 = err;
|
|
677
|
+
} finally {
|
|
678
|
+
try {
|
|
679
|
+
if (!_iteratorNormalCompletion22 && _iterator22.return != null) {
|
|
680
|
+
_iterator22.return();
|
|
681
|
+
}
|
|
682
|
+
} finally {
|
|
683
|
+
if (_didIteratorError22) {
|
|
684
|
+
throw _iteratorError22;
|
|
685
|
+
}
|
|
686
|
+
}
|
|
687
|
+
}
|
|
688
|
+
if (hasValues) {
|
|
689
|
+
result[state2] = stateObj;
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
} catch (err) {
|
|
693
|
+
_didIteratorError12 = true;
|
|
694
|
+
_iteratorError12 = err;
|
|
695
|
+
} finally {
|
|
696
|
+
try {
|
|
697
|
+
if (!_iteratorNormalCompletion12 && _iterator12.return != null) {
|
|
698
|
+
_iterator12.return();
|
|
699
|
+
}
|
|
700
|
+
} finally {
|
|
701
|
+
if (_didIteratorError12) {
|
|
702
|
+
throw _iteratorError12;
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
}
|
|
706
|
+
return result;
|
|
707
|
+
}, [
|
|
708
|
+
knobs,
|
|
709
|
+
context.globals,
|
|
710
|
+
storyThemeParams,
|
|
711
|
+
activePreset
|
|
712
|
+
]);
|
|
713
|
+
(0, import_react.useEffect)(function() {
|
|
714
|
+
setKnobs(knobUpdate);
|
|
715
|
+
}, [knobUpdate, setKnobs]);
|
|
716
|
+
(0, import_react.useEffect)(function() {
|
|
717
|
+
i18n.instance.changeLanguage(context.globals.locale);
|
|
718
|
+
}, [context.globals.locale]);
|
|
719
|
+
var presetCtxValue = (0, import_react.useMemo)(function() {
|
|
720
|
+
return {
|
|
721
|
+
preset: {
|
|
722
|
+
...(0, import_theme.applyColorTheme)(activePreset !== null && activePreset !== void 0 ? activePreset : import_theme.defaultPreset, colorGlobal),
|
|
723
|
+
theme: presetTheme,
|
|
724
|
+
knobs: {
|
|
725
|
+
...import_theme.defaultKnobs,
|
|
726
|
+
...knobUpdate
|
|
727
|
+
}
|
|
728
|
+
},
|
|
729
|
+
overrides: void 0,
|
|
730
|
+
presetName: activePresetName,
|
|
731
|
+
scaleId,
|
|
732
|
+
color: colorGlobal || void 0
|
|
733
|
+
};
|
|
734
|
+
}, [
|
|
735
|
+
knobUpdate,
|
|
736
|
+
presetTheme,
|
|
737
|
+
activePreset,
|
|
738
|
+
colorGlobal,
|
|
739
|
+
activePresetName,
|
|
740
|
+
scaleId
|
|
741
|
+
]);
|
|
742
|
+
var animationValue = presetCtxValue.preset.knobs.animation;
|
|
743
|
+
(0, import_react.useEffect)(function() {
|
|
744
|
+
if (typeof document === "undefined") return;
|
|
745
|
+
var ms = `${animationValue === "none" ? 0 : import_theme.animationDurations[animationValue]}ms`;
|
|
746
|
+
document.documentElement.style.setProperty("--mp-transition", ms);
|
|
747
|
+
}, [animationValue]);
|
|
748
|
+
var storyContent = /* @__PURE__ */ (0, import_jsx_runtime.jsx)(CanvasBackground, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(Story, { ...context }) });
|
|
749
|
+
var oppositeScheme = resolvedScheme === "dark" ? "light" : "dark";
|
|
750
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_theme.PresetContext.Provider, {
|
|
751
|
+
value: presetCtxValue,
|
|
752
|
+
children: /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(AppProvider, {
|
|
753
|
+
themeConfig: themeConfigsByName[themeConfigName],
|
|
754
|
+
systemTheme: resolvedScheme,
|
|
755
|
+
children: [
|
|
756
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(AnimationNamesEmitter, {}),
|
|
757
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(FrappeDebugEmitter, {}),
|
|
758
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(BaseThemeColorEmitter, {}),
|
|
759
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Theme, {
|
|
760
|
+
name: presetTheme || resolvedScheme,
|
|
761
|
+
children: [
|
|
762
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ThemeColorEmitter, {}),
|
|
763
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ColorChannelEmitter, {
|
|
764
|
+
event: accentColorsChannelEvent,
|
|
765
|
+
prefix: "accent"
|
|
766
|
+
}),
|
|
767
|
+
storyContent
|
|
768
|
+
]
|
|
769
|
+
}),
|
|
770
|
+
/* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Theme, {
|
|
771
|
+
name: oppositeScheme,
|
|
772
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(OppositeThemeColorEmitter, {}), presetTheme ? /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_tamagui.Theme, {
|
|
773
|
+
name: presetTheme,
|
|
774
|
+
children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ColorChannelEmitter, { event: baseOppositeChannelEvent }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ColorChannelEmitter, {
|
|
775
|
+
event: accentOppositeChannelEvent,
|
|
776
|
+
prefix: "accent"
|
|
777
|
+
})]
|
|
778
|
+
}) : /* @__PURE__ */ (0, import_jsx_runtime.jsxs)(import_jsx_runtime.Fragment, { children: [/* @__PURE__ */ (0, import_jsx_runtime.jsx)(ColorChannelEmitter, { event: baseOppositeChannelEvent }), /* @__PURE__ */ (0, import_jsx_runtime.jsx)(ColorChannelEmitter, {
|
|
779
|
+
event: accentOppositeChannelEvent,
|
|
780
|
+
prefix: "accent"
|
|
781
|
+
})] })]
|
|
782
|
+
})
|
|
783
|
+
]
|
|
784
|
+
}, `${themeConfigName}:${scaleId}`)
|
|
785
|
+
});
|
|
786
|
+
}
|
|
787
|
+
var frameworkDecorator = function frameworkDecorator2(Story, context) {
|
|
788
|
+
return /* @__PURE__ */ (0, import_jsx_runtime.jsx)(import_react_cookie.CookiesProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime.jsx)(FrameworkDecoratorInner, {
|
|
789
|
+
Story,
|
|
790
|
+
context
|
|
791
|
+
}) });
|
|
792
|
+
};
|
|
793
|
+
return {
|
|
794
|
+
globalTypes,
|
|
795
|
+
initialGlobals,
|
|
796
|
+
parameters: {
|
|
797
|
+
...defaultParameters,
|
|
798
|
+
...extraParameters
|
|
799
|
+
},
|
|
800
|
+
decorators: [frameworkDecorator, ...extraDecorators]
|
|
801
|
+
};
|
|
882
802
|
}
|
|
803
|
+
|
|
883
804
|
//# sourceMappingURL=CreatePreview.native.js.map
|