storybook 10.1.0-alpha.8 → 10.1.0-beta.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/_browser-chunks/Color-FTG7SQDA.js +1097 -0
- package/dist/_browser-chunks/WithTooltip-LMROHDUP.js +1651 -0
- package/dist/_browser-chunks/chunk-2FRVAXCZ.js +7 -0
- package/dist/_browser-chunks/{chunk-FDWKXLBI.js → chunk-2XZMBGTA.js} +44 -109
- package/dist/_browser-chunks/chunk-3IAH5M2U.js +171 -0
- package/dist/_browser-chunks/chunk-3OXGAGBE.js +779 -0
- package/dist/_browser-chunks/{chunk-TMDZCWME.js → chunk-3PJE6VLG.js} +1 -3
- package/dist/_browser-chunks/{chunk-VAMFPZY3.js → chunk-45UGUKRX.js} +2 -7
- package/dist/_browser-chunks/chunk-6XWLIJQL.js +11 -0
- package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
- package/dist/_browser-chunks/chunk-AIOS4NGK.js +252 -0
- package/dist/_browser-chunks/chunk-AS2HQEYC.js +14 -0
- package/dist/_browser-chunks/chunk-AXG2BOBL.js +836 -0
- package/dist/_browser-chunks/{chunk-MH6AXFXB.js → chunk-CHUV5WSW.js} +0 -5
- package/dist/_browser-chunks/chunk-EUVGDK4H.js +93 -0
- package/dist/_browser-chunks/chunk-EZSQOHRI.js +18 -0
- package/dist/_browser-chunks/{chunk-CADGRH3P.js → chunk-FNXWN6IK.js} +3 -8
- package/dist/_browser-chunks/chunk-FQ7SLVLR.js +66 -0
- package/dist/_browser-chunks/chunk-GFLS4VP3.js +64 -0
- package/dist/_browser-chunks/chunk-GFY5R5EY.js +47 -0
- package/dist/_browser-chunks/{chunk-L2D73C6Z.js → chunk-H6XK3RSC.js} +13 -21
- package/dist/_browser-chunks/chunk-IPA5A322.js +71 -0
- package/dist/_browser-chunks/chunk-JP7NCOJX.js +37 -0
- package/dist/_browser-chunks/chunk-KJHJLCBK.js +11 -0
- package/dist/_browser-chunks/{chunk-OWPZQM2D.js → chunk-L4RMQ7D7.js} +60 -110
- package/dist/_browser-chunks/chunk-P4F4UVXX.js +951 -0
- package/dist/_browser-chunks/{chunk-AB7OOPUX.js → chunk-QKODTO7K.js} +0 -5
- package/dist/_browser-chunks/chunk-RP5RXKFU.js +2491 -0
- package/dist/_browser-chunks/chunk-SL75JR6Y.js +9 -0
- package/dist/_browser-chunks/chunk-SS2NHR7W.js +2969 -0
- package/dist/_browser-chunks/chunk-UD6FQLAF.js +1481 -0
- package/dist/_browser-chunks/chunk-VYJQ7RU5.js +2853 -0
- package/dist/_browser-chunks/chunk-WJYERY3R.js +136 -0
- package/dist/_browser-chunks/chunk-XJNX76GA.js +85 -0
- package/dist/_browser-chunks/{chunk-F4Q6SGTB.js → chunk-YKE5S47A.js} +177 -399
- package/dist/_browser-chunks/{chunk-SN4J4IQ3.js → chunk-ZUWEVLDX.js} +1 -7
- package/dist/_browser-chunks/{formatter-OMEEQ6HG.js → formatter-QJ4M4OGQ.js} +4 -9
- package/dist/_browser-chunks/{syntaxhighlighter-CAVLW7PM.js → syntaxhighlighter-IQDEPFLK.js} +704 -1848
- package/dist/_node-chunks/{builder-manager-57OYTFQ5.js → builder-manager-BDAQHXFI.js} +510 -1019
- package/dist/_node-chunks/camelcase-3C7DZZPX.js +37 -0
- package/dist/_node-chunks/chunk-2IIQTGNE.js +6024 -0
- package/dist/_node-chunks/chunk-56U5LEMP.js +3043 -0
- package/dist/_node-chunks/chunk-7LIRCAQE.js +20 -0
- package/dist/_node-chunks/chunk-7RN6TXKP.js +603 -0
- package/dist/_node-chunks/chunk-7SJ7PZNL.js +4523 -0
- package/dist/_node-chunks/{chunk-2GK7NW46.js → chunk-BG4RDXG7.js} +8 -10
- package/dist/_node-chunks/chunk-CBQKMXLQ.js +18 -0
- package/dist/_node-chunks/chunk-CN2IW2KQ.js +1564 -0
- package/dist/_node-chunks/chunk-CQMAU6UQ.js +943 -0
- package/dist/_node-chunks/{chunk-RG4Z25PY.js → chunk-D6ND3TVY.js} +116 -276
- package/dist/_node-chunks/chunk-DC355CYB.js +61 -0
- package/dist/_node-chunks/{chunk-EBYCXVVR.js → chunk-EVK2SBW5.js} +292 -688
- package/dist/_node-chunks/chunk-IXWEUXJ2.js +119 -0
- package/dist/_node-chunks/{chunk-6F6CCOXH.js → chunk-KVRF22SH.js} +469 -983
- package/dist/_node-chunks/chunk-LEDP4QQW.js +919 -0
- package/dist/_node-chunks/{chunk-C4KEDJ6O.js → chunk-MMVV6DGG.js} +8133 -8887
- package/dist/_node-chunks/chunk-O5CGEVRI.js +29 -0
- package/dist/_node-chunks/chunk-OZZO56XN.js +299 -0
- package/dist/_node-chunks/chunk-POT2EVGD.js +78 -0
- package/dist/_node-chunks/chunk-R5YGFSTV.js +3781 -0
- package/dist/_node-chunks/chunk-SQCTM2OS.js +23 -0
- package/dist/_node-chunks/chunk-UFOFO5H7.js +54 -0
- package/dist/_node-chunks/chunk-VBF7ALJF.js +72 -0
- package/dist/_node-chunks/chunk-W6MAMTUF.js +70 -0
- package/dist/_node-chunks/chunk-WURL4XOT.js +46662 -0
- package/dist/_node-chunks/chunk-XGK6MVKR.js +61 -0
- package/dist/_node-chunks/chunk-YV3GDSDT.js +765 -0
- package/dist/_node-chunks/{chunk-RSHLCHYY.js → chunk-YWV55YW3.js} +15 -24
- package/dist/_node-chunks/dist-KEP4IFRN.js +121 -0
- package/dist/_node-chunks/globby-4WUBTDCN.js +3452 -0
- package/dist/_node-chunks/lib-JVOEKTYM.js +366 -0
- package/dist/_node-chunks/mdx-N42X6CFJ-C5WFYYXR.js +14329 -0
- package/dist/_node-chunks/p-limit-LDY632RS.js +116 -0
- package/dist/actions/decorator.js +21 -42
- package/dist/actions/index.js +3 -3
- package/dist/babel/index.d.ts +671 -335
- package/dist/babel/index.js +10 -11
- package/dist/bin/core.js +601 -1548
- package/dist/bin/dispatcher.js +36 -36
- package/dist/bin/loader.js +24 -38
- package/dist/channels/index.js +98 -234
- package/dist/cli/index.d.ts +1479 -133
- package/dist/cli/index.js +30 -8540
- package/dist/client-logger/index.js +31 -61
- package/dist/common/index.d.ts +139 -62
- package/dist/common/index.js +66 -51
- package/dist/components/index.d.ts +575 -273
- package/dist/components/index.js +14863 -4313
- package/dist/core-events/index.js +2 -66
- package/dist/core-server/index.d.ts +3 -2
- package/dist/core-server/index.js +2910 -8519
- package/dist/core-server/presets/common-manager.css +2 -2
- package/dist/core-server/presets/common-manager.js +2521 -5233
- package/dist/core-server/presets/common-override-preset.js +31 -60
- package/dist/core-server/presets/common-preset.js +663 -962
- package/dist/csf/index.js +534 -1179
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +6 -6
- package/dist/highlight/index.js +2 -2
- package/dist/instrumenter/index.js +199 -415
- package/dist/manager/globals-runtime.js +59044 -67141
- package/dist/manager/globals.js +2 -3
- package/dist/manager/manager-stores.d.ts +1 -0
- package/dist/manager/manager-stores.js +23 -0
- package/dist/manager/runtime.js +11511 -10953
- package/dist/manager-api/index.d.ts +1811 -2
- package/dist/manager-api/index.js +1348 -2401
- package/dist/manager-errors.d.ts +9 -0
- package/dist/manager-errors.js +3 -3
- package/dist/mocking-utils/index.d.ts +1126 -0
- package/dist/mocking-utils/index.js +1181 -0
- package/dist/node-logger/index.d.ts +192 -24
- package/dist/node-logger/index.js +23 -4471
- package/dist/preview/globals.js +2 -3
- package/dist/preview/runtime.js +10799 -22393
- package/dist/preview-api/index.d.ts +1 -1
- package/dist/preview-api/index.js +13 -13
- package/dist/preview-errors.d.ts +9 -0
- package/dist/preview-errors.js +4 -4
- package/dist/router/index.js +347 -899
- package/dist/server-errors.d.ts +34 -1
- package/dist/server-errors.js +17 -10
- package/dist/telemetry/index.d.ts +24 -3
- package/dist/telemetry/index.js +25 -24
- package/dist/test/index.js +6131 -11916
- package/dist/theming/create.d.ts +1 -0
- package/dist/theming/create.js +4 -4
- package/dist/theming/index.d.ts +3366 -2599
- package/dist/theming/index.js +501 -1091
- package/dist/types/index.d.ts +72 -8
- package/dist/types/index.js +27 -12
- package/dist/viewport/index.js +3 -3
- package/package.json +26 -17
- package/dist/_browser-chunks/Color-7ZNS6F6B.js +0 -1676
- package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
- package/dist/_browser-chunks/chunk-6A7OIVEL.js +0 -66
- package/dist/_browser-chunks/chunk-B4A3ADP3.js +0 -3816
- package/dist/_browser-chunks/chunk-BOOOPFZF.js +0 -2335
- package/dist/_browser-chunks/chunk-FSBVR7H5.js +0 -106
- package/dist/_browser-chunks/chunk-FUOHXXZT.js +0 -23
- package/dist/_browser-chunks/chunk-GTKOCWCT.js +0 -17
- package/dist/_browser-chunks/chunk-HHW4FUMO.js +0 -12
- package/dist/_browser-chunks/chunk-JVSKG4YS.js +0 -4052
- package/dist/_browser-chunks/chunk-LASUB7TL.js +0 -76
- package/dist/_browser-chunks/chunk-LYCSRYYR.js +0 -101
- package/dist/_browser-chunks/chunk-NVV6MIOE.js +0 -243
- package/dist/_browser-chunks/chunk-OBXWFEPB.js +0 -852
- package/dist/_browser-chunks/chunk-OPCDBBL3.js +0 -48
- package/dist/_browser-chunks/chunk-PB6FZ3WE.js +0 -130
- package/dist/_browser-chunks/chunk-RNE2IUTB.js +0 -1300
- package/dist/_browser-chunks/chunk-RW5PKMWM.js +0 -4182
- package/dist/_browser-chunks/chunk-SYS437NN.js +0 -122
- package/dist/_browser-chunks/chunk-U46RQHA4.js +0 -12
- package/dist/_browser-chunks/chunk-UTNZYD2N.js +0 -311
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +0 -20
- package/dist/_browser-chunks/chunk-XDGMHOV7.js +0 -2197
- package/dist/_browser-chunks/chunk-XW6KSYKF.js +0 -16
- package/dist/_browser-chunks/chunk-Y3M7TW6K.js +0 -1041
- package/dist/_browser-chunks/chunk-ZNRFDIVA.js +0 -233
- package/dist/_node-chunks/camelcase-2KEDZHZ2.js +0 -18
- package/dist/_node-chunks/chunk-34NNXTBR.js +0 -28
- package/dist/_node-chunks/chunk-3N2A3KZX.js +0 -420
- package/dist/_node-chunks/chunk-5P7P5KDN.js +0 -90
- package/dist/_node-chunks/chunk-5WBRBDXI.js +0 -79
- package/dist/_node-chunks/chunk-7PWTU7T2.js +0 -697
- package/dist/_node-chunks/chunk-CHRHQ7AZ.js +0 -4272
- package/dist/_node-chunks/chunk-D4EGQLJI.js +0 -64656
- package/dist/_node-chunks/chunk-EKCURTKU.js +0 -1544
- package/dist/_node-chunks/chunk-GBVPPW4H.js +0 -1657
- package/dist/_node-chunks/chunk-J6VOKT2F.js +0 -220
- package/dist/_node-chunks/chunk-JLBYSGXS.js +0 -69
- package/dist/_node-chunks/chunk-LLCELSUL.js +0 -1198
- package/dist/_node-chunks/chunk-NS4OCQ4F.js +0 -61
- package/dist/_node-chunks/chunk-NXVLFYDR.js +0 -1518
- package/dist/_node-chunks/chunk-NZPWAJOZ.js +0 -304
- package/dist/_node-chunks/chunk-OYFSIV3I.js +0 -6712
- package/dist/_node-chunks/chunk-OZ43LMDF.js +0 -5029
- package/dist/_node-chunks/chunk-Q5HJHFF2.js +0 -61
- package/dist/_node-chunks/chunk-QHER4CEN.js +0 -34
- package/dist/_node-chunks/chunk-RF2PJM54.js +0 -1531
- package/dist/_node-chunks/chunk-S3OHGEE3.js +0 -101
- package/dist/_node-chunks/chunk-S5XOMVSV.js +0 -2256
- package/dist/_node-chunks/chunk-SGXQZ47H.js +0 -1586
- package/dist/_node-chunks/chunk-TDU6OVUH.js +0 -111
- package/dist/_node-chunks/chunk-TYQQFNQX.js +0 -1250
- package/dist/_node-chunks/chunk-WNGLARN2.js +0 -4741
- package/dist/_node-chunks/chunk-YUOVDCXL.js +0 -18
- package/dist/_node-chunks/dist-O5FB7YUW.js +0 -175
- package/dist/_node-chunks/globby-3NMV7WHX.js +0 -5222
- package/dist/_node-chunks/lib-VZD7BRSA.js +0 -518
- package/dist/_node-chunks/mdx-N42X6CFJ-3RP7RKKU.js +0 -22017
- package/dist/_node-chunks/p-limit-LIKBTXEJ.js +0 -168
- package/dist/_node-chunks/plugin-2NYZBK4A.js +0 -129
- package/dist/_node-chunks/plugin-6QGMO7J7.js +0 -159
- package/dist/_node-chunks/webpack-inject-mocker-runtime-plugin-Z2JI6J2H.js +0 -69102
- package/dist/_node-chunks/webpack-mock-plugin-D4BE2SSI.js +0 -124
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +0 -36
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +0 -33
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
import {
|
|
2
|
-
__name
|
|
3
|
-
} from "./chunk-MM7DTO55.js";
|
|
4
|
-
|
|
5
1
|
// ../node_modules/@babel/runtime/helpers/esm/extends.js
|
|
6
2
|
function _extends() {
|
|
7
3
|
return _extends = Object.assign ? Object.assign.bind() : function(n) {
|
|
@@ -12,7 +8,6 @@ function _extends() {
|
|
|
12
8
|
return n;
|
|
13
9
|
}, _extends.apply(null, arguments);
|
|
14
10
|
}
|
|
15
|
-
__name(_extends, "_extends");
|
|
16
11
|
|
|
17
12
|
export {
|
|
18
13
|
_extends
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EVENT_ID
|
|
3
|
+
} from "./chunk-6XWLIJQL.js";
|
|
4
|
+
|
|
5
|
+
// src/actions/runtime/configureActions.ts
|
|
6
|
+
var config = {
|
|
7
|
+
depth: 10,
|
|
8
|
+
clearOnStoryChange: !0,
|
|
9
|
+
limit: 50
|
|
10
|
+
}, configureActions = (options = {}) => {
|
|
11
|
+
Object.assign(config, options);
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
// src/actions/runtime/action.ts
|
|
15
|
+
import { ImplicitActionsDuringRendering } from "storybook/internal/preview-errors";
|
|
16
|
+
import { global } from "@storybook/global";
|
|
17
|
+
import { addons } from "storybook/preview-api";
|
|
18
|
+
var findProto = (obj, callback) => {
|
|
19
|
+
let proto = Object.getPrototypeOf(obj);
|
|
20
|
+
return !proto || callback(proto) ? proto : findProto(proto, callback);
|
|
21
|
+
}, isReactSyntheticEvent = (e) => !!(typeof e == "object" && e && findProto(e, (proto) => /^Synthetic(?:Base)?Event$/.test(proto.constructor.name)) && typeof e.persist == "function"), serializeArg = (a) => {
|
|
22
|
+
if (isReactSyntheticEvent(a)) {
|
|
23
|
+
let e = Object.create(
|
|
24
|
+
a.constructor.prototype,
|
|
25
|
+
Object.getOwnPropertyDescriptors(a)
|
|
26
|
+
);
|
|
27
|
+
e.persist();
|
|
28
|
+
let viewDescriptor = Object.getOwnPropertyDescriptor(e, "view"), view = viewDescriptor?.value;
|
|
29
|
+
return typeof view == "object" && view?.constructor.name === "Window" && Object.defineProperty(e, "view", {
|
|
30
|
+
...viewDescriptor,
|
|
31
|
+
value: Object.create(view.constructor.prototype)
|
|
32
|
+
}), e;
|
|
33
|
+
}
|
|
34
|
+
return a;
|
|
35
|
+
};
|
|
36
|
+
function action(name, options = {}) {
|
|
37
|
+
let actionOptions = {
|
|
38
|
+
...config,
|
|
39
|
+
...options
|
|
40
|
+
}, handler = function(...args) {
|
|
41
|
+
if (options.implicit) {
|
|
42
|
+
let storyRenderer = ("__STORYBOOK_PREVIEW__" in global ? global.__STORYBOOK_PREVIEW__ : void 0)?.storyRenders.find(
|
|
43
|
+
(render) => render.phase === "playing" || render.phase === "rendering"
|
|
44
|
+
);
|
|
45
|
+
if (storyRenderer) {
|
|
46
|
+
let deprecated = !globalThis?.FEATURES?.disallowImplicitActionsInRenderV8, error = new ImplicitActionsDuringRendering({
|
|
47
|
+
phase: storyRenderer.phase,
|
|
48
|
+
name,
|
|
49
|
+
deprecated
|
|
50
|
+
});
|
|
51
|
+
if (deprecated)
|
|
52
|
+
console.warn(error);
|
|
53
|
+
else
|
|
54
|
+
throw error;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
let channel = addons.getChannel(), id = Date.now().toString(36) + Math.random().toString(36).substring(2), minDepth = 5, serializedArgs = args.map(serializeArg), normalizedArgs = args.length > 1 ? serializedArgs : serializedArgs[0], actionDisplayToEmit = {
|
|
58
|
+
id,
|
|
59
|
+
count: 0,
|
|
60
|
+
data: { name, args: normalizedArgs },
|
|
61
|
+
options: {
|
|
62
|
+
...actionOptions,
|
|
63
|
+
maxDepth: minDepth + (actionOptions.depth || 3)
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
channel.emit(EVENT_ID, actionDisplayToEmit);
|
|
67
|
+
};
|
|
68
|
+
return handler.isAction = !0, handler.implicit = options.implicit, handler;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// src/actions/runtime/actions.ts
|
|
72
|
+
var actions = (...args) => {
|
|
73
|
+
let options = config, names = args;
|
|
74
|
+
names.length === 1 && Array.isArray(names[0]) && ([names] = names), names.length !== 1 && typeof names[names.length - 1] != "string" && (options = {
|
|
75
|
+
...config,
|
|
76
|
+
...names.pop()
|
|
77
|
+
});
|
|
78
|
+
let namesObject = names[0];
|
|
79
|
+
(names.length !== 1 || typeof namesObject == "string") && (namesObject = {}, names.forEach((name) => {
|
|
80
|
+
namesObject[name] = name;
|
|
81
|
+
}));
|
|
82
|
+
let actionsObject = {};
|
|
83
|
+
return Object.keys(namesObject).forEach((name) => {
|
|
84
|
+
actionsObject[name] = action(namesObject[name], options);
|
|
85
|
+
}), actionsObject;
|
|
86
|
+
};
|
|
87
|
+
|
|
88
|
+
export {
|
|
89
|
+
config,
|
|
90
|
+
configureActions,
|
|
91
|
+
action,
|
|
92
|
+
actions
|
|
93
|
+
};
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS
|
|
3
|
+
} from "./chunk-A242L54C.js";
|
|
4
|
+
|
|
5
|
+
// ../node_modules/picocolors/picocolors.browser.js
|
|
6
|
+
var require_picocolors_browser = __commonJS({
|
|
7
|
+
"../node_modules/picocolors/picocolors.browser.js"(exports, module) {
|
|
8
|
+
var x = String, create = function() {
|
|
9
|
+
return { isColorSupported: !1, reset: x, bold: x, dim: x, italic: x, underline: x, inverse: x, hidden: x, strikethrough: x, black: x, red: x, green: x, yellow: x, blue: x, magenta: x, cyan: x, white: x, gray: x, bgBlack: x, bgRed: x, bgGreen: x, bgYellow: x, bgBlue: x, bgMagenta: x, bgCyan: x, bgWhite: x, blackBright: x, redBright: x, greenBright: x, yellowBright: x, blueBright: x, magentaBright: x, cyanBright: x, whiteBright: x, bgBlackBright: x, bgRedBright: x, bgGreenBright: x, bgYellowBright: x, bgBlueBright: x, bgMagentaBright: x, bgCyanBright: x, bgWhiteBright: x };
|
|
10
|
+
};
|
|
11
|
+
module.exports = create();
|
|
12
|
+
module.exports.createColors = create;
|
|
13
|
+
}
|
|
14
|
+
});
|
|
15
|
+
|
|
16
|
+
export {
|
|
17
|
+
require_picocolors_browser
|
|
18
|
+
};
|
|
@@ -1,23 +1,18 @@
|
|
|
1
1
|
// src/backgrounds/constants.ts
|
|
2
|
-
var ADDON_ID = "storybook/background";
|
|
3
|
-
var PARAM_KEY = "backgrounds";
|
|
2
|
+
var ADDON_ID = "storybook/background", PARAM_KEY = "backgrounds";
|
|
4
3
|
var EVENTS = {
|
|
5
4
|
UPDATE: `${ADDON_ID}/update`
|
|
6
5
|
};
|
|
7
6
|
|
|
8
7
|
// src/measure/constants.ts
|
|
9
|
-
var ADDON_ID2 = "storybook/measure-addon"
|
|
10
|
-
var TOOL_ID = `${ADDON_ID2}/tool`;
|
|
11
|
-
var PARAM_KEY2 = "measureEnabled";
|
|
12
|
-
var EVENTS2 = {
|
|
8
|
+
var ADDON_ID2 = "storybook/measure-addon", TOOL_ID = `${ADDON_ID2}/tool`, PARAM_KEY2 = "measureEnabled", EVENTS2 = {
|
|
13
9
|
RESULT: `${ADDON_ID2}/result`,
|
|
14
10
|
REQUEST: `${ADDON_ID2}/request`,
|
|
15
11
|
CLEAR: `${ADDON_ID2}/clear`
|
|
16
12
|
};
|
|
17
13
|
|
|
18
14
|
// src/outline/constants.ts
|
|
19
|
-
var ADDON_ID3 = "storybook/outline";
|
|
20
|
-
var PARAM_KEY3 = "outline";
|
|
15
|
+
var ADDON_ID3 = "storybook/outline", PARAM_KEY3 = "outline";
|
|
21
16
|
|
|
22
17
|
// src/backgrounds/defaults.ts
|
|
23
18
|
var DEFAULT_BACKGROUNDS = {
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
// src/storybook-error.ts
|
|
2
|
+
function parseErrorCode({
|
|
3
|
+
code,
|
|
4
|
+
category
|
|
5
|
+
}) {
|
|
6
|
+
let paddedCode = String(code).padStart(4, "0");
|
|
7
|
+
return `SB_${category}_${paddedCode}`;
|
|
8
|
+
}
|
|
9
|
+
function appendErrorRef(url) {
|
|
10
|
+
if (/^(?!.*storybook\.js\.org)|[?&]ref=error\b/.test(url))
|
|
11
|
+
return url;
|
|
12
|
+
try {
|
|
13
|
+
let urlObj = new URL(url);
|
|
14
|
+
return urlObj.searchParams.set("ref", "error"), urlObj.toString();
|
|
15
|
+
} catch {
|
|
16
|
+
return url;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
var StorybookError = class _StorybookError extends Error {
|
|
20
|
+
constructor(props) {
|
|
21
|
+
super(_StorybookError.getFullMessage(props));
|
|
22
|
+
/**
|
|
23
|
+
* Data associated with the error. Used to provide additional information in the error message or
|
|
24
|
+
* to be passed to telemetry.
|
|
25
|
+
*/
|
|
26
|
+
this.data = {};
|
|
27
|
+
/** Flag used to easily determine if the error originates from Storybook. */
|
|
28
|
+
this.fromStorybook = !0;
|
|
29
|
+
/**
|
|
30
|
+
* Flag used to determine if the error is handled by us and should therefore not be shown to the
|
|
31
|
+
* user.
|
|
32
|
+
*/
|
|
33
|
+
this.isHandledError = !1;
|
|
34
|
+
this.category = props.category, this.documentation = props.documentation ?? !1, this.code = props.code, this.isHandledError = props.isHandledError ?? !1, this.name = props.name;
|
|
35
|
+
}
|
|
36
|
+
get fullErrorCode() {
|
|
37
|
+
return parseErrorCode({ code: this.code, category: this.category });
|
|
38
|
+
}
|
|
39
|
+
/** Overrides the default `Error.name` property in the format: SB_<CATEGORY>_<CODE>. */
|
|
40
|
+
get name() {
|
|
41
|
+
let errorName = this._name || this.constructor.name;
|
|
42
|
+
return `${this.fullErrorCode} (${errorName})`;
|
|
43
|
+
}
|
|
44
|
+
set name(name) {
|
|
45
|
+
this._name = name;
|
|
46
|
+
}
|
|
47
|
+
/** Generates the error message along with additional documentation link (if applicable). */
|
|
48
|
+
static getFullMessage({
|
|
49
|
+
documentation,
|
|
50
|
+
code,
|
|
51
|
+
category,
|
|
52
|
+
message
|
|
53
|
+
}) {
|
|
54
|
+
let page;
|
|
55
|
+
return documentation === !0 ? page = `https://storybook.js.org/error/${parseErrorCode({ code, category })}?ref=error` : typeof documentation == "string" ? page = appendErrorRef(documentation) : Array.isArray(documentation) && (page = `
|
|
56
|
+
${documentation.map((doc) => ` - ${appendErrorRef(doc)}`).join(`
|
|
57
|
+
`)}`), `${message}${page != null ? `
|
|
58
|
+
|
|
59
|
+
More info: ${page}
|
|
60
|
+
` : ""}`;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
|
|
64
|
+
export {
|
|
65
|
+
StorybookError
|
|
66
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
// ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
2
|
+
function isPlainObject(value) {
|
|
3
|
+
if (!value || typeof value != "object")
|
|
4
|
+
return !1;
|
|
5
|
+
let proto = Object.getPrototypeOf(value);
|
|
6
|
+
return proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null ? Object.prototype.toString.call(value) === "[object Object]" : !1;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
// ../node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
|
|
10
|
+
function isPrimitive(value) {
|
|
11
|
+
return value == null || typeof value != "object" && typeof value != "function";
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
// ../node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
|
|
15
|
+
function isTypedArray(x) {
|
|
16
|
+
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
// ../node_modules/es-toolkit/dist/compat/_internal/getSymbols.mjs
|
|
20
|
+
function getSymbols(object) {
|
|
21
|
+
return Object.getOwnPropertySymbols(object).filter((symbol) => Object.prototype.propertyIsEnumerable.call(object, symbol));
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// ../node_modules/es-toolkit/dist/compat/_internal/getTag.mjs
|
|
25
|
+
function getTag(value) {
|
|
26
|
+
return value == null ? value === void 0 ? "[object Undefined]" : "[object Null]" : Object.prototype.toString.call(value);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// ../node_modules/es-toolkit/dist/compat/_internal/tags.mjs
|
|
30
|
+
var regexpTag = "[object RegExp]", stringTag = "[object String]", numberTag = "[object Number]", booleanTag = "[object Boolean]", argumentsTag = "[object Arguments]", symbolTag = "[object Symbol]", dateTag = "[object Date]", mapTag = "[object Map]", setTag = "[object Set]", arrayTag = "[object Array]", functionTag = "[object Function]", arrayBufferTag = "[object ArrayBuffer]", objectTag = "[object Object]", errorTag = "[object Error]", dataViewTag = "[object DataView]", uint8ArrayTag = "[object Uint8Array]", uint8ClampedArrayTag = "[object Uint8ClampedArray]", uint16ArrayTag = "[object Uint16Array]", uint32ArrayTag = "[object Uint32Array]", bigUint64ArrayTag = "[object BigUint64Array]", int8ArrayTag = "[object Int8Array]", int16ArrayTag = "[object Int16Array]", int32ArrayTag = "[object Int32Array]", bigInt64ArrayTag = "[object BigInt64Array]", float32ArrayTag = "[object Float32Array]", float64ArrayTag = "[object Float64Array]";
|
|
31
|
+
|
|
32
|
+
export {
|
|
33
|
+
isPrimitive,
|
|
34
|
+
isTypedArray,
|
|
35
|
+
getSymbols,
|
|
36
|
+
getTag,
|
|
37
|
+
regexpTag,
|
|
38
|
+
stringTag,
|
|
39
|
+
numberTag,
|
|
40
|
+
booleanTag,
|
|
41
|
+
argumentsTag,
|
|
42
|
+
symbolTag,
|
|
43
|
+
dateTag,
|
|
44
|
+
mapTag,
|
|
45
|
+
setTag,
|
|
46
|
+
arrayTag,
|
|
47
|
+
functionTag,
|
|
48
|
+
arrayBufferTag,
|
|
49
|
+
objectTag,
|
|
50
|
+
errorTag,
|
|
51
|
+
dataViewTag,
|
|
52
|
+
uint8ArrayTag,
|
|
53
|
+
uint8ClampedArrayTag,
|
|
54
|
+
uint16ArrayTag,
|
|
55
|
+
uint32ArrayTag,
|
|
56
|
+
bigUint64ArrayTag,
|
|
57
|
+
int8ArrayTag,
|
|
58
|
+
int16ArrayTag,
|
|
59
|
+
int32ArrayTag,
|
|
60
|
+
bigInt64ArrayTag,
|
|
61
|
+
float32ArrayTag,
|
|
62
|
+
float64ArrayTag,
|
|
63
|
+
isPlainObject
|
|
64
|
+
};
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import {
|
|
2
|
+
StorybookError
|
|
3
|
+
} from "./chunk-FQ7SLVLR.js";
|
|
4
|
+
|
|
5
|
+
// src/manager-errors.ts
|
|
6
|
+
var Category = /* @__PURE__ */ ((Category2) => (Category2.MANAGER_UNCAUGHT = "MANAGER_UNCAUGHT", Category2.MANAGER_UI = "MANAGER_UI", Category2.MANAGER_API = "MANAGER_API", Category2.MANAGER_CLIENT_LOGGER = "MANAGER_CLIENT-LOGGER", Category2.MANAGER_CHANNELS = "MANAGER_CHANNELS", Category2.MANAGER_CORE_EVENTS = "MANAGER_CORE-EVENTS", Category2.MANAGER_ROUTER = "MANAGER_ROUTER", Category2.MANAGER_THEMING = "MANAGER_THEMING", Category2))(Category || {}), ProviderDoesNotExtendBaseProviderError = class extends StorybookError {
|
|
7
|
+
constructor() {
|
|
8
|
+
super({
|
|
9
|
+
name: "ProviderDoesNotExtendBaseProviderError",
|
|
10
|
+
category: "MANAGER_UI" /* MANAGER_UI */,
|
|
11
|
+
code: 1,
|
|
12
|
+
message: "The Provider passed into Storybook's UI is not extended from the base Provider. Please check your Provider implementation."
|
|
13
|
+
});
|
|
14
|
+
}
|
|
15
|
+
}, UncaughtManagerError = class extends StorybookError {
|
|
16
|
+
constructor(data) {
|
|
17
|
+
super({
|
|
18
|
+
name: "UncaughtManagerError",
|
|
19
|
+
category: "MANAGER_UNCAUGHT" /* MANAGER_UNCAUGHT */,
|
|
20
|
+
code: 1,
|
|
21
|
+
message: data.error.message
|
|
22
|
+
});
|
|
23
|
+
this.data = data;
|
|
24
|
+
this.stack = data.error.stack;
|
|
25
|
+
}
|
|
26
|
+
}, StatusTypeIdMismatchError = class extends StorybookError {
|
|
27
|
+
constructor(data) {
|
|
28
|
+
super({
|
|
29
|
+
name: "StatusTypeIdMismatchError",
|
|
30
|
+
category: "MANAGER_API" /* MANAGER_API */,
|
|
31
|
+
code: 1,
|
|
32
|
+
message: `Status has typeId "${data.status.typeId}" but was added to store with typeId "${data.typeId}". Full status: ${JSON.stringify(
|
|
33
|
+
data.status,
|
|
34
|
+
null,
|
|
35
|
+
2
|
|
36
|
+
)}`
|
|
37
|
+
});
|
|
38
|
+
this.data = data;
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
Category,
|
|
44
|
+
ProviderDoesNotExtendBaseProviderError,
|
|
45
|
+
UncaughtManagerError,
|
|
46
|
+
StatusTypeIdMismatchError
|
|
47
|
+
};
|
|
@@ -1,63 +1,55 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_objectWithoutPropertiesLoose
|
|
3
|
-
} from "./chunk-
|
|
4
|
-
import {
|
|
5
|
-
__name
|
|
6
|
-
} from "./chunk-MM7DTO55.js";
|
|
3
|
+
} from "./chunk-45UGUKRX.js";
|
|
7
4
|
|
|
8
5
|
// ../node_modules/@babel/runtime/helpers/esm/typeof.js
|
|
9
6
|
function _typeof(o) {
|
|
10
7
|
"@babel/helpers - typeof";
|
|
11
|
-
return _typeof =
|
|
8
|
+
return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o2) {
|
|
12
9
|
return typeof o2;
|
|
13
10
|
} : function(o2) {
|
|
14
|
-
return o2 && "function"
|
|
11
|
+
return o2 && typeof Symbol == "function" && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
15
12
|
}, _typeof(o);
|
|
16
13
|
}
|
|
17
|
-
__name(_typeof, "_typeof");
|
|
18
14
|
|
|
19
15
|
// ../node_modules/@babel/runtime/helpers/esm/toPrimitive.js
|
|
20
16
|
function toPrimitive(t, r) {
|
|
21
|
-
if (
|
|
17
|
+
if (_typeof(t) != "object" || !t) return t;
|
|
22
18
|
var e = t[Symbol.toPrimitive];
|
|
23
|
-
if (void 0
|
|
19
|
+
if (e !== void 0) {
|
|
24
20
|
var i = e.call(t, r || "default");
|
|
25
|
-
if (
|
|
21
|
+
if (_typeof(i) != "object") return i;
|
|
26
22
|
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
27
23
|
}
|
|
28
|
-
return ("string"
|
|
24
|
+
return (r === "string" ? String : Number)(t);
|
|
29
25
|
}
|
|
30
|
-
__name(toPrimitive, "toPrimitive");
|
|
31
26
|
|
|
32
27
|
// ../node_modules/@babel/runtime/helpers/esm/toPropertyKey.js
|
|
33
28
|
function toPropertyKey(t) {
|
|
34
29
|
var i = toPrimitive(t, "string");
|
|
35
|
-
return
|
|
30
|
+
return _typeof(i) == "symbol" ? i : i + "";
|
|
36
31
|
}
|
|
37
|
-
__name(toPropertyKey, "toPropertyKey");
|
|
38
32
|
|
|
39
33
|
// ../node_modules/@babel/runtime/helpers/esm/defineProperty.js
|
|
40
34
|
function _defineProperty(e, r, t) {
|
|
41
35
|
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
42
36
|
value: t,
|
|
43
|
-
enumerable:
|
|
44
|
-
configurable:
|
|
45
|
-
writable:
|
|
37
|
+
enumerable: !0,
|
|
38
|
+
configurable: !0,
|
|
39
|
+
writable: !0
|
|
46
40
|
}) : e[r] = t, e;
|
|
47
41
|
}
|
|
48
|
-
__name(_defineProperty, "_defineProperty");
|
|
49
42
|
|
|
50
43
|
// ../node_modules/@babel/runtime/helpers/esm/objectWithoutProperties.js
|
|
51
44
|
function _objectWithoutProperties(e, t) {
|
|
52
|
-
if (
|
|
45
|
+
if (e == null) return {};
|
|
53
46
|
var o, r, i = _objectWithoutPropertiesLoose(e, t);
|
|
54
47
|
if (Object.getOwnPropertySymbols) {
|
|
55
48
|
var n = Object.getOwnPropertySymbols(e);
|
|
56
|
-
for (r = 0; r < n.length; r++) o = n[r],
|
|
49
|
+
for (r = 0; r < n.length; r++) o = n[r], t.indexOf(o) === -1 && {}.propertyIsEnumerable.call(e, o) && (i[o] = e[o]);
|
|
57
50
|
}
|
|
58
51
|
return i;
|
|
59
52
|
}
|
|
60
|
-
__name(_objectWithoutProperties, "_objectWithoutProperties");
|
|
61
53
|
|
|
62
54
|
export {
|
|
63
55
|
_objectWithoutProperties,
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
// src/preview-api/modules/preview-web/render/animation-utils.ts
|
|
2
|
+
function isTestEnvironment() {
|
|
3
|
+
try {
|
|
4
|
+
return (
|
|
5
|
+
// @ts-expect-error This property exists in Vitest browser mode
|
|
6
|
+
!!globalThis.__vitest_browser__ || !!globalThis.window?.navigator?.userAgent?.match(/StorybookTestRunner/)
|
|
7
|
+
);
|
|
8
|
+
} catch {
|
|
9
|
+
return !1;
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
function pauseAnimations(atEnd = !0) {
|
|
13
|
+
if (!("document" in globalThis && "createElement" in globalThis.document))
|
|
14
|
+
return () => {
|
|
15
|
+
};
|
|
16
|
+
let disableStyle = document.createElement("style");
|
|
17
|
+
disableStyle.textContent = `*, *:before, *:after {
|
|
18
|
+
animation: none !important;
|
|
19
|
+
}`, document.head.appendChild(disableStyle);
|
|
20
|
+
let pauseStyle = document.createElement("style");
|
|
21
|
+
return pauseStyle.textContent = `*, *:before, *:after {
|
|
22
|
+
animation-delay: 0s !important;
|
|
23
|
+
animation-direction: ${atEnd ? "reverse" : "normal"} !important;
|
|
24
|
+
animation-play-state: paused !important;
|
|
25
|
+
transition: none !important;
|
|
26
|
+
}`, document.head.appendChild(pauseStyle), document.body.clientHeight, document.head.removeChild(disableStyle), () => {
|
|
27
|
+
pauseStyle.parentNode?.removeChild(pauseStyle);
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
async function waitForAnimations(signal) {
|
|
31
|
+
if (!("document" in globalThis && "getAnimations" in globalThis.document && "querySelectorAll" in globalThis.document))
|
|
32
|
+
return;
|
|
33
|
+
let timedOut = !1;
|
|
34
|
+
await Promise.race([
|
|
35
|
+
// After 50ms, retrieve any running animations and wait for them to finish
|
|
36
|
+
// If new animations are created while waiting, we'll wait for them too
|
|
37
|
+
new Promise((resolve) => {
|
|
38
|
+
setTimeout(() => {
|
|
39
|
+
let animationRoots = [globalThis.document, ...getShadowRoots(globalThis.document)], checkAnimationsFinished = async () => {
|
|
40
|
+
if (timedOut || signal?.aborted)
|
|
41
|
+
return;
|
|
42
|
+
let runningAnimations = animationRoots.flatMap((el) => el?.getAnimations?.() || []).filter((a) => a.playState === "running" && !isInfiniteAnimation(a));
|
|
43
|
+
runningAnimations.length > 0 && (await Promise.all(runningAnimations.map((a) => a.finished)), await checkAnimationsFinished());
|
|
44
|
+
};
|
|
45
|
+
checkAnimationsFinished().then(resolve);
|
|
46
|
+
}, 100);
|
|
47
|
+
}),
|
|
48
|
+
// If animations don't finish within the timeout, continue without waiting
|
|
49
|
+
new Promise(
|
|
50
|
+
(resolve) => setTimeout(() => {
|
|
51
|
+
timedOut = !0, resolve(void 0);
|
|
52
|
+
}, 5e3)
|
|
53
|
+
)
|
|
54
|
+
]);
|
|
55
|
+
}
|
|
56
|
+
function getShadowRoots(doc) {
|
|
57
|
+
return [doc, ...doc.querySelectorAll("*")].reduce((acc, el) => ("shadowRoot" in el && el.shadowRoot && acc.push(el.shadowRoot, ...getShadowRoots(el.shadowRoot)), acc), []);
|
|
58
|
+
}
|
|
59
|
+
function isInfiniteAnimation(anim) {
|
|
60
|
+
if (anim instanceof CSSAnimation && anim.effect instanceof KeyframeEffect && anim.effect.target) {
|
|
61
|
+
let style = getComputedStyle(anim.effect.target, anim.effect.pseudoElement), index = style.animationName?.split(", ").indexOf(anim.animationName);
|
|
62
|
+
return style.animationIterationCount.split(", ")[index] === "infinite";
|
|
63
|
+
}
|
|
64
|
+
return !1;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
export {
|
|
68
|
+
isTestEnvironment,
|
|
69
|
+
pauseAnimations,
|
|
70
|
+
waitForAnimations
|
|
71
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// ../node_modules/ts-dedent/esm/index.js
|
|
2
|
+
function dedent(templ) {
|
|
3
|
+
for (var values = [], _i = 1; _i < arguments.length; _i++)
|
|
4
|
+
values[_i - 1] = arguments[_i];
|
|
5
|
+
var strings = Array.from(typeof templ == "string" ? [templ] : templ);
|
|
6
|
+
strings[strings.length - 1] = strings[strings.length - 1].replace(/\r?\n([\t ]*)$/, "");
|
|
7
|
+
var indentLengths = strings.reduce(function(arr, str) {
|
|
8
|
+
var matches = str.match(/\n([\t ]+|(?!\s).)/g);
|
|
9
|
+
return matches ? arr.concat(matches.map(function(match) {
|
|
10
|
+
var _a, _b;
|
|
11
|
+
return (_b = (_a = match.match(/[\t ]/g)) === null || _a === void 0 ? void 0 : _a.length) !== null && _b !== void 0 ? _b : 0;
|
|
12
|
+
})) : arr;
|
|
13
|
+
}, []);
|
|
14
|
+
if (indentLengths.length) {
|
|
15
|
+
var pattern_1 = new RegExp(`
|
|
16
|
+
[ ]{` + Math.min.apply(Math, indentLengths) + "}", "g");
|
|
17
|
+
strings = strings.map(function(str) {
|
|
18
|
+
return str.replace(pattern_1, `
|
|
19
|
+
`);
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
strings[0] = strings[0].replace(/^\r?\n/, "");
|
|
23
|
+
var string = strings[0];
|
|
24
|
+
return values.forEach(function(value, i) {
|
|
25
|
+
var endentations = string.match(/(?:^|\n)( *)$/), endentation = endentations ? endentations[1] : "", indentedValue = value;
|
|
26
|
+
typeof value == "string" && value.includes(`
|
|
27
|
+
`) && (indentedValue = String(value).split(`
|
|
28
|
+
`).map(function(str, i2) {
|
|
29
|
+
return i2 === 0 ? str : "" + endentation + str;
|
|
30
|
+
}).join(`
|
|
31
|
+
`)), string += indentedValue + strings[i + 1];
|
|
32
|
+
}), string;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export {
|
|
36
|
+
dedent
|
|
37
|
+
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
// src/highlight/constants.ts
|
|
2
|
+
var ADDON_ID = "storybook/highlight", HIGHLIGHT = `${ADDON_ID}/add`, REMOVE_HIGHLIGHT = `${ADDON_ID}/remove`, RESET_HIGHLIGHT = `${ADDON_ID}/reset`, SCROLL_INTO_VIEW = `${ADDON_ID}/scroll-into-view`, MAX_Z_INDEX = 2147483647, MIN_TOUCH_AREA_SIZE = 28;
|
|
3
|
+
|
|
4
|
+
export {
|
|
5
|
+
HIGHLIGHT,
|
|
6
|
+
REMOVE_HIGHLIGHT,
|
|
7
|
+
RESET_HIGHLIGHT,
|
|
8
|
+
SCROLL_INTO_VIEW,
|
|
9
|
+
MAX_Z_INDEX,
|
|
10
|
+
MIN_TOUCH_AREA_SIZE
|
|
11
|
+
};
|