storybook 10.0.0-beta.1 → 10.0.0-beta.11
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/assets/server/openBrowser.applescript +94 -0
- package/dist/_browser-chunks/Color-KPLIACXP.js +1569 -0
- package/dist/_browser-chunks/{WithTooltip-ERFLZL6W.js → WithTooltip-SK46ZJ2J.js} +1 -1
- package/dist/_browser-chunks/{chunk-YY5GICNT.js → chunk-6E2SHJSL.js} +175 -32
- package/dist/_browser-chunks/{chunk-EOILZP2R.js → chunk-BOOOPFZF.js} +7 -2
- package/dist/_browser-chunks/{chunk-YWDKX534.js → chunk-FA42P6MO.js} +49 -4
- package/dist/_browser-chunks/chunk-G33S6YM3.js +521 -0
- package/dist/_browser-chunks/{chunk-MZNYTCNT.js → chunk-HMIIJ6UD.js} +6 -6
- package/dist/_browser-chunks/{chunk-4QPX7WIQ.js → chunk-JJZMHC3A.js} +57 -166
- package/dist/_browser-chunks/{chunk-MD2FTHCZ.js → chunk-JVSKG4YS.js} +3 -16
- package/dist/_browser-chunks/{chunk-E7VLET3C.js → chunk-KSCAWCCE.js} +3947 -4291
- package/dist/_browser-chunks/{chunk-PYK5ZTFK.js → chunk-PS3AOQI4.js} +48 -25
- package/dist/_browser-chunks/chunk-QK3L5AXO.js +372 -0
- package/dist/_browser-chunks/chunk-SHR3NNR3.js +5810 -0
- package/dist/_browser-chunks/{chunk-O5R5CGFA.js → chunk-TMDZCWME.js} +1 -2
- package/dist/_browser-chunks/chunk-VUAFL5XK.js +20 -0
- package/dist/_browser-chunks/{chunk-T7RCAJIX.js → chunk-Y3M7TW6K.js} +43 -47
- package/dist/_browser-chunks/{syntaxhighlighter-YYAA4CS4.js → syntaxhighlighter-R46XOLMC.js} +1 -1
- package/dist/_node-chunks/{builder-manager-EXW4ETLN.js → builder-manager-VLFDK43H.js} +45 -155
- package/dist/_node-chunks/camelcase-RENSEFK6.js +18 -0
- package/dist/_node-chunks/{chunk-5ZX5SJOP.js → chunk-4SPBIDJV.js} +162 -103
- package/dist/_node-chunks/{chunk-PMEEE3UE.js → chunk-4WZFG35Z.js} +30 -21
- package/dist/_node-chunks/{chunk-WP7DV5JT.js → chunk-5K7G6NFK.js} +583 -180
- package/dist/_node-chunks/{chunk-FZP2YGG3.js → chunk-5NSMDC6F.js} +7 -7
- package/dist/_node-chunks/{chunk-6CCUFDHU.js → chunk-5THWZTEL.js} +7 -7
- package/dist/_node-chunks/chunk-7MUMULSR.js +79 -0
- package/dist/_node-chunks/chunk-7QAAJL75.js +1540 -0
- package/dist/_node-chunks/{chunk-EO4S3VXL.js → chunk-DVY3VWHZ.js} +653 -775
- package/dist/_node-chunks/{chunk-WDKWVNL2.js → chunk-EBLOP2C5.js} +7 -7
- package/dist/_node-chunks/{chunk-EDBXIJN5.js → chunk-EF56ZUQY.js} +7 -7
- package/dist/_node-chunks/{chunk-F5J33SXQ.js → chunk-ER2UQBIA.js} +7 -7
- package/dist/_node-chunks/chunk-GHICGP2P.js +18 -0
- package/dist/_node-chunks/{chunk-4WNZYNQY.js → chunk-GYBN5GXT.js} +623 -750
- package/dist/_node-chunks/{chunk-2G5THETV.js → chunk-H2YBWE3T.js} +12 -12
- package/dist/_node-chunks/{camelcase-VZZFWA2L.js → chunk-HYMBYTGJ.js} +9 -8
- package/dist/_node-chunks/{chunk-SUMFFLGF.js → chunk-Q5IJJX3T.js} +6 -6
- package/dist/_node-chunks/{chunk-U45F2NP6.js → chunk-QLRMR54O.js} +7 -7
- package/dist/_node-chunks/{chunk-XTSBFCVE.js → chunk-QSNDRP62.js} +7 -7
- package/dist/_node-chunks/chunk-S2RQAF7K.js +4741 -0
- package/dist/_node-chunks/{chunk-2QZOLZDJ.js → chunk-SDZVOIZI.js} +9 -9
- package/dist/_node-chunks/{chunk-VNLBDN2Z.js → chunk-SGJZDMJW.js} +6 -6
- package/dist/_node-chunks/{chunk-PL2PKDRO.js → chunk-TJOIDMXP.js} +60 -102
- package/dist/_node-chunks/{chunk-ICPKUV5G.js → chunk-U2UIPLJI.js} +7 -7
- package/dist/_node-chunks/{chunk-3SGKBLOL.js → chunk-UAMXREF3.js} +8 -8
- package/dist/_node-chunks/{chunk-GVCXNIAA.js → chunk-UC6O5PNX.js} +399 -116
- package/dist/_node-chunks/{chunk-CM3UGTR5.js → chunk-VFUP6Z4J.js} +7 -7
- package/dist/_node-chunks/{chunk-3ZKQWDCG.js → chunk-XKPJCSPD.js} +223 -243
- package/dist/_node-chunks/{chunk-24TGL6EX.js → chunk-XWCQWB3R.js} +8 -8
- package/dist/_node-chunks/{chunk-QC5FE2D7.js → chunk-XYFEBEHY.js} +7 -7
- package/dist/_node-chunks/chunk-YAEIMHFX.js +62 -0
- package/dist/_node-chunks/{chunk-5V6QH7WC.js → chunk-ZHBCPKYD.js} +7 -7
- package/dist/_node-chunks/{dist-VZL6D6Y3.js → dist-A2RPEHEC.js} +9 -9
- package/dist/_node-chunks/{globby-GZXJJ4W6.js → globby-3TWPXGQS.js} +17 -13
- package/dist/_node-chunks/{lib-PHT5GCV2.js → lib-MUNM6ZJ6.js} +40 -16
- package/dist/_node-chunks/{mdx-N42X6CFJ-EPDIV4A2.js → mdx-N42X6CFJ-QQDHJZQ3.js} +8 -8
- package/dist/_node-chunks/{p-limit-AJIFSZTI.js → p-limit-FEN55OV6.js} +76 -10
- package/dist/_node-chunks/{plugin-3VI56CEF.js → plugin-ESAYNJ5V.js} +11 -11
- package/dist/_node-chunks/{plugin-AV4OEKYM.js → plugin-GDMP3JPR.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-E7J5FKLA.js → webpack-inject-mocker-runtime-plugin-5AKTLYIV.js} +1307 -847
- package/dist/_node-chunks/{webpack-mock-plugin-VTYGW7HO.js → webpack-mock-plugin-AWGZ65AQ.js} +9 -9
- package/dist/babel/index.d.ts +1 -1
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +638 -187
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +77 -12
- package/dist/cli/index.d.ts +62 -75
- package/dist/cli/index.js +67 -55
- package/dist/common/index.d.ts +3 -1
- package/dist/common/index.js +22 -22
- package/dist/components/index.d.ts +228 -1
- package/dist/components/index.js +74 -5738
- package/dist/core-events/index.d.ts +18 -2
- package/dist/core-events/index.js +7 -1
- package/dist/core-server/index.d.ts +515 -14
- package/dist/core-server/index.js +4647 -4182
- package/dist/core-server/presets/common-manager.js +1570 -1272
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +691 -38
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf/index.d.ts +9 -4
- package/dist/csf/index.js +50 -15
- package/dist/csf-tools/index.d.ts +47 -6
- package/dist/csf-tools/index.js +9 -9
- package/dist/docs-tools/index.js +4 -4
- package/dist/instrumenter/index.js +1 -1
- package/dist/manager/globals-runtime.js +9230 -18109
- package/dist/manager/globals.d.ts +0 -4
- package/dist/manager/globals.js +1 -6
- package/dist/manager/runtime.js +13194 -11367
- package/dist/manager-api/index.d.ts +513 -5
- package/dist/manager-api/index.js +364 -90
- package/dist/manager-errors.d.ts +501 -0
- package/dist/node-logger/index.d.ts +1 -1
- package/dist/node-logger/index.js +1136 -662
- package/dist/preview/globals.js +1 -1
- package/dist/preview/runtime.js +12103 -21579
- package/dist/preview-api/index.d.ts +70 -71
- package/dist/preview-api/index.js +10 -10
- package/dist/preview-errors.d.ts +501 -0
- package/dist/router/index.d.ts +668 -10
- package/dist/router/index.js +2 -2
- package/dist/server-errors.d.ts +501 -0
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.d.ts +1 -1
- package/dist/telemetry/index.js +23 -25
- package/dist/test/index.js +1874 -4024
- package/dist/theming/index.d.ts +2 -2
- package/dist/theming/index.js +6 -6
- package/dist/types/index.d.ts +553 -16
- package/dist/viewport/index.d.ts +36 -4
- package/dist/viewport/index.js +1 -1
- package/package.json +9 -46
- package/dist/_browser-chunks/Color-SFYJJKWL.js +0 -605
- package/dist/_browser-chunks/chunk-DHO2SA6L.js +0 -12
- package/dist/_browser-chunks/chunk-WPHPDNUA.js +0 -974
- package/dist/_node-chunks/chunk-32JYCD74.js +0 -80
- package/dist/_node-chunks/chunk-GE6I3YYG.js +0 -62
- package/dist/_node-chunks/chunk-KXCNXWXI.js +0 -18
- package/dist/_node-chunks/chunk-LAUOYAOX.js +0 -87
- package/dist/_node-chunks/chunk-QJTT4OC2.js +0 -266
- package/dist/_node-chunks/chunk-V2ZF4DUD.js +0 -2377
- package/dist/_node-chunks/chunk-ZMV3WY6R.js +0 -9845
- package/dist/_node-chunks/default-browser-id-JNATP42X.js +0 -1719
|
@@ -15,19 +15,22 @@ import {
|
|
|
15
15
|
import {
|
|
16
16
|
dequal
|
|
17
17
|
} from "../_browser-chunks/chunk-2DK2T7MP.js";
|
|
18
|
+
import "../_browser-chunks/chunk-G33S6YM3.js";
|
|
19
|
+
import {
|
|
20
|
+
require_picocolors_browser
|
|
21
|
+
} from "../_browser-chunks/chunk-VUAFL5XK.js";
|
|
18
22
|
import {
|
|
19
23
|
mergeWith,
|
|
20
|
-
pick
|
|
21
|
-
|
|
24
|
+
pick,
|
|
25
|
+
toMerged
|
|
26
|
+
} from "../_browser-chunks/chunk-FA42P6MO.js";
|
|
22
27
|
import "../_browser-chunks/chunk-WKCVJYVJ.js";
|
|
23
28
|
import {
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
toMerged
|
|
27
|
-
} from "../_browser-chunks/chunk-E7VLET3C.js";
|
|
29
|
+
mapValues
|
|
30
|
+
} from "../_browser-chunks/chunk-QK3L5AXO.js";
|
|
28
31
|
import {
|
|
29
32
|
isEqual
|
|
30
|
-
} from "../_browser-chunks/chunk-
|
|
33
|
+
} from "../_browser-chunks/chunk-JJZMHC3A.js";
|
|
31
34
|
import {
|
|
32
35
|
require_memoizerific
|
|
33
36
|
} from "../_browser-chunks/chunk-NVV6MIOE.js";
|
|
@@ -41,22 +44,147 @@ import {
|
|
|
41
44
|
__toESM
|
|
42
45
|
} from "../_browser-chunks/chunk-MM7DTO55.js";
|
|
43
46
|
|
|
44
|
-
// ../node_modules/
|
|
45
|
-
var
|
|
46
|
-
"../node_modules/
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
47
|
+
// ../node_modules/toggle-selection/index.js
|
|
48
|
+
var require_toggle_selection = __commonJS({
|
|
49
|
+
"../node_modules/toggle-selection/index.js"(exports, module) {
|
|
50
|
+
module.exports = function() {
|
|
51
|
+
var selection = document.getSelection();
|
|
52
|
+
if (!selection.rangeCount) {
|
|
53
|
+
return function() {
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
var active = document.activeElement;
|
|
57
|
+
var ranges = [];
|
|
58
|
+
for (var i = 0; i < selection.rangeCount; i++) {
|
|
59
|
+
ranges.push(selection.getRangeAt(i));
|
|
60
|
+
}
|
|
61
|
+
switch (active.tagName.toUpperCase()) {
|
|
62
|
+
// .toUpperCase handles XHTML
|
|
63
|
+
case "INPUT":
|
|
64
|
+
case "TEXTAREA":
|
|
65
|
+
active.blur();
|
|
66
|
+
break;
|
|
67
|
+
default:
|
|
68
|
+
active = null;
|
|
69
|
+
break;
|
|
70
|
+
}
|
|
71
|
+
selection.removeAllRanges();
|
|
72
|
+
return function() {
|
|
73
|
+
selection.type === "Caret" && selection.removeAllRanges();
|
|
74
|
+
if (!selection.rangeCount) {
|
|
75
|
+
ranges.forEach(function(range) {
|
|
76
|
+
selection.addRange(range);
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
active && active.focus();
|
|
80
|
+
};
|
|
81
|
+
};
|
|
82
|
+
}
|
|
83
|
+
});
|
|
84
|
+
|
|
85
|
+
// ../node_modules/copy-to-clipboard/index.js
|
|
86
|
+
var require_copy_to_clipboard = __commonJS({
|
|
87
|
+
"../node_modules/copy-to-clipboard/index.js"(exports, module) {
|
|
88
|
+
"use strict";
|
|
89
|
+
var deselectCurrent = require_toggle_selection();
|
|
90
|
+
var clipboardToIE11Formatting = {
|
|
91
|
+
"text/plain": "Text",
|
|
92
|
+
"text/html": "Url",
|
|
93
|
+
"default": "Text"
|
|
94
|
+
};
|
|
95
|
+
var defaultMessage = "Copy to clipboard: #{key}, Enter";
|
|
96
|
+
function format(message) {
|
|
97
|
+
var copyKey = (/mac os x/i.test(navigator.userAgent) ? "\u2318" : "Ctrl") + "+C";
|
|
98
|
+
return message.replace(/#{\s*key\s*}/g, copyKey);
|
|
99
|
+
}
|
|
100
|
+
__name(format, "format");
|
|
101
|
+
function copy2(text, options) {
|
|
102
|
+
var debug, message, reselectPrevious, range, selection, mark, success = false;
|
|
103
|
+
if (!options) {
|
|
104
|
+
options = {};
|
|
105
|
+
}
|
|
106
|
+
debug = options.debug || false;
|
|
107
|
+
try {
|
|
108
|
+
reselectPrevious = deselectCurrent();
|
|
109
|
+
range = document.createRange();
|
|
110
|
+
selection = document.getSelection();
|
|
111
|
+
mark = document.createElement("span");
|
|
112
|
+
mark.textContent = text;
|
|
113
|
+
mark.ariaHidden = "true";
|
|
114
|
+
mark.style.all = "unset";
|
|
115
|
+
mark.style.position = "fixed";
|
|
116
|
+
mark.style.top = 0;
|
|
117
|
+
mark.style.clip = "rect(0, 0, 0, 0)";
|
|
118
|
+
mark.style.whiteSpace = "pre";
|
|
119
|
+
mark.style.webkitUserSelect = "text";
|
|
120
|
+
mark.style.MozUserSelect = "text";
|
|
121
|
+
mark.style.msUserSelect = "text";
|
|
122
|
+
mark.style.userSelect = "text";
|
|
123
|
+
mark.addEventListener("copy", function(e) {
|
|
124
|
+
e.stopPropagation();
|
|
125
|
+
if (options.format) {
|
|
126
|
+
e.preventDefault();
|
|
127
|
+
if (typeof e.clipboardData === "undefined") {
|
|
128
|
+
debug && console.warn("unable to use e.clipboardData");
|
|
129
|
+
debug && console.warn("trying IE specific stuff");
|
|
130
|
+
window.clipboardData.clearData();
|
|
131
|
+
var format2 = clipboardToIE11Formatting[options.format] || clipboardToIE11Formatting["default"];
|
|
132
|
+
window.clipboardData.setData(format2, text);
|
|
133
|
+
} else {
|
|
134
|
+
e.clipboardData.clearData();
|
|
135
|
+
e.clipboardData.setData(options.format, text);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
if (options.onCopy) {
|
|
139
|
+
e.preventDefault();
|
|
140
|
+
options.onCopy(e.clipboardData);
|
|
141
|
+
}
|
|
142
|
+
});
|
|
143
|
+
document.body.appendChild(mark);
|
|
144
|
+
range.selectNodeContents(mark);
|
|
145
|
+
selection.addRange(range);
|
|
146
|
+
var successful = document.execCommand("copy");
|
|
147
|
+
if (!successful) {
|
|
148
|
+
throw new Error("copy command was unsuccessful");
|
|
149
|
+
}
|
|
150
|
+
success = true;
|
|
151
|
+
} catch (err) {
|
|
152
|
+
debug && console.error("unable to copy using execCommand: ", err);
|
|
153
|
+
debug && console.warn("trying IE specific stuff");
|
|
154
|
+
try {
|
|
155
|
+
window.clipboardData.setData(options.format || "text", text);
|
|
156
|
+
options.onCopy && options.onCopy(window.clipboardData);
|
|
157
|
+
success = true;
|
|
158
|
+
} catch (err2) {
|
|
159
|
+
debug && console.error("unable to copy using clipboardData: ", err2);
|
|
160
|
+
debug && console.error("falling back to prompt");
|
|
161
|
+
message = format("message" in options ? options.message : defaultMessage);
|
|
162
|
+
window.prompt(message, text);
|
|
163
|
+
}
|
|
164
|
+
} finally {
|
|
165
|
+
if (selection) {
|
|
166
|
+
if (typeof selection.removeRange == "function") {
|
|
167
|
+
selection.removeRange(range);
|
|
168
|
+
} else {
|
|
169
|
+
selection.removeAllRanges();
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
if (mark) {
|
|
173
|
+
document.body.removeChild(mark);
|
|
174
|
+
}
|
|
175
|
+
reselectPrevious();
|
|
176
|
+
}
|
|
177
|
+
return success;
|
|
178
|
+
}
|
|
179
|
+
__name(copy2, "copy");
|
|
180
|
+
module.exports = copy2;
|
|
53
181
|
}
|
|
54
182
|
});
|
|
55
183
|
|
|
56
184
|
// ../node_modules/store2/dist/store2.js
|
|
57
185
|
var require_store2 = __commonJS({
|
|
58
186
|
"../node_modules/store2/dist/store2.js"(exports, module) {
|
|
59
|
-
(function(
|
|
187
|
+
(function(window2, define) {
|
|
60
188
|
var _ = {
|
|
61
189
|
version: "2.14.4",
|
|
62
190
|
areas: {},
|
|
@@ -383,17 +511,17 @@ var require_store2 = __commonJS({
|
|
|
383
511
|
} else if (typeof module !== "undefined" && module.exports) {
|
|
384
512
|
module.exports = store2;
|
|
385
513
|
} else {
|
|
386
|
-
if (
|
|
387
|
-
_.conflict =
|
|
514
|
+
if (window2.store) {
|
|
515
|
+
_.conflict = window2.store;
|
|
388
516
|
}
|
|
389
|
-
|
|
517
|
+
window2.store = store2;
|
|
390
518
|
}
|
|
391
519
|
})(exports, exports && exports.define);
|
|
392
520
|
}
|
|
393
521
|
});
|
|
394
522
|
|
|
395
523
|
// src/manager-api/root.tsx
|
|
396
|
-
import
|
|
524
|
+
import React4, {
|
|
397
525
|
Component,
|
|
398
526
|
Fragment,
|
|
399
527
|
useCallback as useCallback2,
|
|
@@ -683,6 +811,18 @@ import { global as global2 } from "@storybook/global";
|
|
|
683
811
|
// src/manager-api/lib/stories.ts
|
|
684
812
|
import { sanitize } from "storybook/internal/csf";
|
|
685
813
|
|
|
814
|
+
// ../node_modules/es-toolkit/dist/array/countBy.mjs
|
|
815
|
+
function countBy(arr, mapper) {
|
|
816
|
+
const result = {};
|
|
817
|
+
for (let i = 0; i < arr.length; i++) {
|
|
818
|
+
const item = arr[i];
|
|
819
|
+
const key = mapper(item);
|
|
820
|
+
result[key] = (result[key] ?? 0) + 1;
|
|
821
|
+
}
|
|
822
|
+
return result;
|
|
823
|
+
}
|
|
824
|
+
__name(countBy, "countBy");
|
|
825
|
+
|
|
686
826
|
// ../node_modules/es-toolkit/dist/array/partition.mjs
|
|
687
827
|
function partition(arr, isInTruthy) {
|
|
688
828
|
const truthy = [];
|
|
@@ -755,6 +895,7 @@ var transformSetStoriesStoryDataToPreparedStoryIndex = /* @__PURE__ */ __name((s
|
|
|
755
895
|
const { argTypes, args, initialArgs } = story;
|
|
756
896
|
acc[id] = {
|
|
757
897
|
type: "story",
|
|
898
|
+
subtype: "story",
|
|
758
899
|
...base,
|
|
759
900
|
parameters,
|
|
760
901
|
argTypes,
|
|
@@ -832,19 +973,18 @@ var transformStoryIndexToStoriesHash = /* @__PURE__ */ __name((input, { provider
|
|
|
832
973
|
index = index.v === 3 ? transformStoryIndexV3toV4(index) : index;
|
|
833
974
|
index = index.v === 4 ? transformStoryIndexV4toV5(index) : index;
|
|
834
975
|
index = index;
|
|
835
|
-
const
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
976
|
+
const indexEntries = Object.values(index.entries);
|
|
977
|
+
const filterFunctions = Object.values(filters);
|
|
978
|
+
const entryValues = indexEntries.filter((entry) => {
|
|
979
|
+
const statuses = allStatuses[entry.id] ?? {};
|
|
980
|
+
if (Object.values(statuses).some(({ value }) => value === "status-value:error")) {
|
|
981
|
+
return true;
|
|
840
982
|
}
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
});
|
|
847
|
-
return result;
|
|
983
|
+
if (filterFunctions.every((fn) => fn({ ...entry, statuses }))) {
|
|
984
|
+
return true;
|
|
985
|
+
}
|
|
986
|
+
const children = indexEntries.filter((item) => "parent" in item && item.parent === entry.id);
|
|
987
|
+
return children.some((child) => filterFunctions.every((fn) => fn({ ...child, statuses })));
|
|
848
988
|
});
|
|
849
989
|
const { sidebar = {} } = provider.getConfig();
|
|
850
990
|
const { showRoots, collapsedRoots = [], renderLabel } = sidebar;
|
|
@@ -867,7 +1007,7 @@ var transformStoryIndexToStoriesHash = /* @__PURE__ */ __name((input, { provider
|
|
|
867
1007
|
throw new Error(
|
|
868
1008
|
dedent`
|
|
869
1009
|
Invalid part '${name}', leading to id === parentId ('${id}'), inside title '${title}'
|
|
870
|
-
|
|
1010
|
+
|
|
871
1011
|
Did you create a path that uses the separator char accidentally, such as 'Vue <docs/>' where '/' is a separator char? See https://github.com/storybookjs/storybook/issues/6128
|
|
872
1012
|
`
|
|
873
1013
|
);
|
|
@@ -918,33 +1058,60 @@ var transformStoryIndexToStoriesHash = /* @__PURE__ */ __name((input, { provider
|
|
|
918
1058
|
}
|
|
919
1059
|
});
|
|
920
1060
|
acc[item.id] = {
|
|
921
|
-
type: "story",
|
|
922
1061
|
tags: [],
|
|
923
1062
|
...item,
|
|
924
1063
|
depth: paths.length,
|
|
925
|
-
parent: paths[paths.length - 1],
|
|
1064
|
+
parent: "parent" in item ? item.parent : paths[paths.length - 1],
|
|
926
1065
|
renderLabel,
|
|
927
1066
|
prepared: !!item.parameters
|
|
928
1067
|
};
|
|
929
1068
|
return acc;
|
|
930
1069
|
}, {});
|
|
931
1070
|
function addItem(acc, item) {
|
|
932
|
-
if (acc[item.id]) {
|
|
933
|
-
|
|
1071
|
+
if (!acc[item.id]) {
|
|
1072
|
+
acc[item.id] = item;
|
|
1073
|
+
if ("children" in item && item.children) {
|
|
1074
|
+
item.children.forEach((childId) => addItem(acc, storiesHashOutOfOrder[childId]));
|
|
1075
|
+
item.tags = item.children.reduce((currentTags, childId) => {
|
|
1076
|
+
return currentTags === null ? acc[childId].tags : intersect_default(currentTags, acc[childId].tags);
|
|
1077
|
+
}, null) || [];
|
|
1078
|
+
}
|
|
934
1079
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
return currentTags === null ? child.tags : intersect_default(currentTags, child.tags);
|
|
941
|
-
}, null);
|
|
1080
|
+
if (item.type === "component") {
|
|
1081
|
+
const firstChild = acc[item.children[0]];
|
|
1082
|
+
if (firstChild && "importPath" in firstChild) {
|
|
1083
|
+
item.importPath = firstChild.importPath;
|
|
1084
|
+
}
|
|
942
1085
|
}
|
|
943
1086
|
return acc;
|
|
944
1087
|
}
|
|
945
1088
|
__name(addItem, "addItem");
|
|
946
|
-
|
|
947
|
-
|
|
1089
|
+
let storiesHash = Object.values(storiesHashOutOfOrder).filter((i) => i.type !== "root" && !i.parent).reduce((acc, item) => addItem(acc, item), {});
|
|
1090
|
+
storiesHash = Object.values(storiesHashOutOfOrder).filter((i) => i.type === "root").reduce(addItem, storiesHash);
|
|
1091
|
+
storiesHash = Object.values(storiesHash).reduce((acc, item) => {
|
|
1092
|
+
if (item.type === "story" && item.subtype === "test") {
|
|
1093
|
+
const story = acc[item.parent];
|
|
1094
|
+
const component = acc[story.parent];
|
|
1095
|
+
acc[component.id] = {
|
|
1096
|
+
...component,
|
|
1097
|
+
// Remove test from the component node as it will be attached to the story node instead
|
|
1098
|
+
children: component.children && component.children.filter((id) => id !== item.id)
|
|
1099
|
+
};
|
|
1100
|
+
acc[story.id] = {
|
|
1101
|
+
...story,
|
|
1102
|
+
// Add test to the story node
|
|
1103
|
+
children: (story.children || []).concat(item.id)
|
|
1104
|
+
};
|
|
1105
|
+
acc[item.id] = {
|
|
1106
|
+
...item,
|
|
1107
|
+
depth: item.depth + 1
|
|
1108
|
+
};
|
|
1109
|
+
} else {
|
|
1110
|
+
acc[item.id] = item;
|
|
1111
|
+
}
|
|
1112
|
+
return acc;
|
|
1113
|
+
}, {});
|
|
1114
|
+
return storiesHash;
|
|
948
1115
|
}, "transformStoryIndexToStoriesHash");
|
|
949
1116
|
var addPreparedStories = /* @__PURE__ */ __name((newHash, oldHash) => {
|
|
950
1117
|
if (!oldHash) {
|
|
@@ -954,6 +1121,9 @@ var addPreparedStories = /* @__PURE__ */ __name((newHash, oldHash) => {
|
|
|
954
1121
|
Object.entries(newHash).map(([id, newEntry]) => {
|
|
955
1122
|
const oldEntry = oldHash[id];
|
|
956
1123
|
if (newEntry.type === "story" && oldEntry?.type === "story" && oldEntry.prepared) {
|
|
1124
|
+
if ("children" in oldEntry) {
|
|
1125
|
+
delete oldEntry.children;
|
|
1126
|
+
}
|
|
957
1127
|
return [id, { ...oldEntry, ...newEntry, prepared: true }];
|
|
958
1128
|
}
|
|
959
1129
|
return [id, newEntry];
|
|
@@ -1323,7 +1493,7 @@ __export(layout_exports, {
|
|
|
1323
1493
|
import { SET_CONFIG as SET_CONFIG2 } from "storybook/internal/core-events";
|
|
1324
1494
|
import { global as global3 } from "@storybook/global";
|
|
1325
1495
|
import { create } from "storybook/theming/create";
|
|
1326
|
-
var { document } = global3;
|
|
1496
|
+
var { document: document2 } = global3;
|
|
1327
1497
|
var isFunction = /* @__PURE__ */ __name((val) => typeof val === "function", "isFunction");
|
|
1328
1498
|
var ActiveTabs = {
|
|
1329
1499
|
SIDEBAR: "sidebar",
|
|
@@ -1517,7 +1687,7 @@ var init5 = /* @__PURE__ */ __name(({ store: store2, provider, singleStory }) =>
|
|
|
1517
1687
|
if (!elementId) {
|
|
1518
1688
|
return;
|
|
1519
1689
|
}
|
|
1520
|
-
const element =
|
|
1690
|
+
const element = document2.getElementById(elementId);
|
|
1521
1691
|
if (element) {
|
|
1522
1692
|
element.focus();
|
|
1523
1693
|
if (select) {
|
|
@@ -1561,6 +1731,13 @@ var init5 = /* @__PURE__ */ __name(({ store: store2, provider, singleStory }) =>
|
|
|
1561
1731
|
}
|
|
1562
1732
|
return showToolbar;
|
|
1563
1733
|
},
|
|
1734
|
+
getShowPanelWithCustomisations(showPanel) {
|
|
1735
|
+
const state = store2.getState();
|
|
1736
|
+
if (isFunction(state.layoutCustomisations.showPanel)) {
|
|
1737
|
+
return state.layoutCustomisations.showPanel(state, showPanel) ?? showPanel;
|
|
1738
|
+
}
|
|
1739
|
+
return showPanel;
|
|
1740
|
+
},
|
|
1564
1741
|
getNavSizeWithCustomisations(navSize) {
|
|
1565
1742
|
const state = store2.getState();
|
|
1566
1743
|
if (isFunction(state.layoutCustomisations.showSidebar)) {
|
|
@@ -1652,15 +1829,68 @@ var init6 = /* @__PURE__ */ __name(({ store: store2 }) => {
|
|
|
1652
1829
|
}, "clearNotification")
|
|
1653
1830
|
};
|
|
1654
1831
|
const state = { notifications: [] };
|
|
1655
|
-
return {
|
|
1832
|
+
return {
|
|
1833
|
+
api,
|
|
1834
|
+
state
|
|
1835
|
+
};
|
|
1836
|
+
}, "init");
|
|
1837
|
+
|
|
1838
|
+
// src/manager-api/modules/open-in-editor.tsx
|
|
1839
|
+
var open_in_editor_exports = {};
|
|
1840
|
+
__export(open_in_editor_exports, {
|
|
1841
|
+
init: () => init7
|
|
1842
|
+
});
|
|
1843
|
+
import React from "react";
|
|
1844
|
+
import {
|
|
1845
|
+
OPEN_IN_EDITOR_REQUEST,
|
|
1846
|
+
OPEN_IN_EDITOR_RESPONSE
|
|
1847
|
+
} from "storybook/internal/core-events";
|
|
1848
|
+
import { FailedIcon } from "@storybook/icons";
|
|
1849
|
+
var init7 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
|
|
1850
|
+
const api = {
|
|
1851
|
+
openInEditor(payload) {
|
|
1852
|
+
return new Promise((resolve) => {
|
|
1853
|
+
const { file, line, column } = payload;
|
|
1854
|
+
const handler = /* @__PURE__ */ __name((res) => {
|
|
1855
|
+
if (res.file === file && res.line === line && res.column === column) {
|
|
1856
|
+
provider.channel?.off(OPEN_IN_EDITOR_RESPONSE, handler);
|
|
1857
|
+
resolve(res);
|
|
1858
|
+
}
|
|
1859
|
+
}, "handler");
|
|
1860
|
+
provider.channel?.on(OPEN_IN_EDITOR_RESPONSE, handler);
|
|
1861
|
+
provider.channel?.emit(OPEN_IN_EDITOR_REQUEST, payload);
|
|
1862
|
+
});
|
|
1863
|
+
}
|
|
1864
|
+
};
|
|
1865
|
+
const state = { notifications: [] };
|
|
1866
|
+
return {
|
|
1867
|
+
api,
|
|
1868
|
+
state,
|
|
1869
|
+
init: /* @__PURE__ */ __name(async () => {
|
|
1870
|
+
const { color } = await import("../theming/index.js");
|
|
1871
|
+
provider.channel?.on(OPEN_IN_EDITOR_RESPONSE, (payload) => {
|
|
1872
|
+
if (payload.error !== null) {
|
|
1873
|
+
fullAPI.addNotification({
|
|
1874
|
+
id: "open-in-editor-error",
|
|
1875
|
+
content: {
|
|
1876
|
+
headline: "Failed to open in editor",
|
|
1877
|
+
subHeadline: payload.error || "Check the Storybook process on the command line for more details."
|
|
1878
|
+
},
|
|
1879
|
+
icon: React.createElement(FailedIcon, { color: color.negative }),
|
|
1880
|
+
duration: 8e3
|
|
1881
|
+
});
|
|
1882
|
+
}
|
|
1883
|
+
});
|
|
1884
|
+
}, "init")
|
|
1885
|
+
};
|
|
1656
1886
|
}, "init");
|
|
1657
1887
|
|
|
1658
1888
|
// src/manager-api/modules/provider.ts
|
|
1659
1889
|
var provider_exports = {};
|
|
1660
1890
|
__export(provider_exports, {
|
|
1661
|
-
init: () =>
|
|
1891
|
+
init: () => init8
|
|
1662
1892
|
});
|
|
1663
|
-
var
|
|
1893
|
+
var init8 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
|
|
1664
1894
|
return {
|
|
1665
1895
|
api: provider.renderPreview ? { renderPreview: provider.renderPreview } : {},
|
|
1666
1896
|
state: {},
|
|
@@ -1673,9 +1903,9 @@ var init7 = /* @__PURE__ */ __name(({ provider, fullAPI }) => {
|
|
|
1673
1903
|
// src/manager-api/modules/settings.ts
|
|
1674
1904
|
var settings_exports = {};
|
|
1675
1905
|
__export(settings_exports, {
|
|
1676
|
-
init: () =>
|
|
1906
|
+
init: () => init9
|
|
1677
1907
|
});
|
|
1678
|
-
var
|
|
1908
|
+
var init9 = /* @__PURE__ */ __name(({ store: store2, navigate, fullAPI }) => {
|
|
1679
1909
|
const isSettingsScreenActive = /* @__PURE__ */ __name(() => {
|
|
1680
1910
|
const { path } = fullAPI.getUrlState();
|
|
1681
1911
|
return !!(path || "").match(/^\/settings/);
|
|
@@ -1717,10 +1947,11 @@ var shortcuts_exports = {};
|
|
|
1717
1947
|
__export(shortcuts_exports, {
|
|
1718
1948
|
controlOrMetaKey: () => controlOrMetaKey2,
|
|
1719
1949
|
defaultShortcuts: () => defaultShortcuts,
|
|
1720
|
-
init: () =>
|
|
1950
|
+
init: () => init10,
|
|
1721
1951
|
isMacLike: () => isMacLike2,
|
|
1722
1952
|
keys: () => keys
|
|
1723
1953
|
});
|
|
1954
|
+
var import_copy_to_clipboard = __toESM(require_copy_to_clipboard(), 1);
|
|
1724
1955
|
import {
|
|
1725
1956
|
FORCE_REMOUNT,
|
|
1726
1957
|
PREVIEW_KEYDOWN,
|
|
@@ -1731,8 +1962,8 @@ import { global as global5 } from "@storybook/global";
|
|
|
1731
1962
|
|
|
1732
1963
|
// src/manager-api/lib/shortcut.ts
|
|
1733
1964
|
import { global as global4 } from "@storybook/global";
|
|
1734
|
-
var { navigator } = global4;
|
|
1735
|
-
var isMacLike = /* @__PURE__ */ __name(() =>
|
|
1965
|
+
var { navigator: navigator2 } = global4;
|
|
1966
|
+
var isMacLike = /* @__PURE__ */ __name(() => navigator2 && navigator2.platform ? !!navigator2.platform.match(/(Mac|iPhone|iPod|iPad)/i) : false, "isMacLike");
|
|
1736
1967
|
var controlOrMetaSymbol = /* @__PURE__ */ __name(() => isMacLike() ? "\u2318" : "ctrl", "controlOrMetaSymbol");
|
|
1737
1968
|
var controlOrMetaKey = /* @__PURE__ */ __name(() => isMacLike() ? "meta" : "control", "controlOrMetaKey");
|
|
1738
1969
|
var optionOrAltSymbol = /* @__PURE__ */ __name(() => isMacLike() ? "\u2325" : "alt", "optionOrAltSymbol");
|
|
@@ -1754,14 +1985,31 @@ var eventToShortcut = /* @__PURE__ */ __name((e) => {
|
|
|
1754
1985
|
if (e.shiftKey) {
|
|
1755
1986
|
keys2.push("shift");
|
|
1756
1987
|
}
|
|
1988
|
+
const codeUpper = e.code?.toUpperCase();
|
|
1989
|
+
const codeToCharMap = {
|
|
1990
|
+
MINUS: "-",
|
|
1991
|
+
EQUAL: "=",
|
|
1992
|
+
BRACKETLEFT: "[",
|
|
1993
|
+
BRACKETRIGHT: "]",
|
|
1994
|
+
BACKSLASH: "\\",
|
|
1995
|
+
SEMICOLON: ";",
|
|
1996
|
+
QUOTE: "'",
|
|
1997
|
+
BACKQUOTE: "`",
|
|
1998
|
+
COMMA: ",",
|
|
1999
|
+
PERIOD: ".",
|
|
2000
|
+
SLASH: "/"
|
|
2001
|
+
};
|
|
2002
|
+
const codeChar = codeUpper ? codeUpper.startsWith("KEY") && codeUpper.length === 4 ? codeUpper.replace("KEY", "") : codeUpper.startsWith("DIGIT") ? codeUpper.replace("DIGIT", "") : codeToCharMap[codeUpper] : void 0;
|
|
1757
2003
|
if (e.key && e.key.length === 1 && e.key !== " ") {
|
|
1758
2004
|
const key = e.key.toUpperCase();
|
|
1759
|
-
const code =
|
|
2005
|
+
const code = codeChar;
|
|
1760
2006
|
if (code && code.length === 1 && code !== key) {
|
|
1761
2007
|
keys2.push([key, code]);
|
|
1762
2008
|
} else {
|
|
1763
2009
|
keys2.push(key);
|
|
1764
2010
|
}
|
|
2011
|
+
} else if (e.key === "Dead" && codeChar) {
|
|
2012
|
+
keys2.push(codeChar);
|
|
1765
2013
|
}
|
|
1766
2014
|
if (e.key === " ") {
|
|
1767
2015
|
keys2.push("space");
|
|
@@ -1834,15 +2082,15 @@ var keyToSymbol = /* @__PURE__ */ __name((key) => {
|
|
|
1834
2082
|
if (key === "ArrowRight") {
|
|
1835
2083
|
return "\u2192";
|
|
1836
2084
|
}
|
|
1837
|
-
return key
|
|
2085
|
+
return key?.toUpperCase();
|
|
1838
2086
|
}, "keyToSymbol");
|
|
1839
2087
|
var shortcutToHumanString = /* @__PURE__ */ __name((shortcut) => {
|
|
1840
2088
|
return shortcut.map(keyToSymbol).join(" ");
|
|
1841
2089
|
}, "shortcutToHumanString");
|
|
1842
2090
|
|
|
1843
2091
|
// src/manager-api/modules/shortcuts.ts
|
|
1844
|
-
var { navigator:
|
|
1845
|
-
var isMacLike2 = /* @__PURE__ */ __name(() =>
|
|
2092
|
+
var { navigator: navigator3, document: document3 } = global5;
|
|
2093
|
+
var isMacLike2 = /* @__PURE__ */ __name(() => navigator3 && navigator3.platform ? !!navigator3.platform.match(/(Mac|iPhone|iPod|iPad)/i) : false, "isMacLike");
|
|
1846
2094
|
var controlOrMetaKey2 = /* @__PURE__ */ __name(() => isMacLike2() ? "meta" : "control", "controlOrMetaKey");
|
|
1847
2095
|
function keys(o) {
|
|
1848
2096
|
return Object.keys(o);
|
|
@@ -1868,7 +2116,11 @@ var defaultShortcuts = Object.freeze({
|
|
|
1868
2116
|
// This one is not customizable
|
|
1869
2117
|
collapseAll: [controlOrMetaKey2(), "shift", "ArrowUp"],
|
|
1870
2118
|
expandAll: [controlOrMetaKey2(), "shift", "ArrowDown"],
|
|
1871
|
-
remount: ["alt", "R"]
|
|
2119
|
+
remount: ["alt", "R"],
|
|
2120
|
+
openInEditor: ["alt", "shift", "E"],
|
|
2121
|
+
copyStoryLink: ["alt", "shift", "L"]
|
|
2122
|
+
// TODO: bring this back once we want to add shortcuts for this
|
|
2123
|
+
// copyStoryName: ['alt', 'shift', 'C'],
|
|
1872
2124
|
});
|
|
1873
2125
|
var addonsShortcuts = {};
|
|
1874
2126
|
function shouldSkipShortcut(event) {
|
|
@@ -1883,7 +2135,7 @@ function shouldSkipShortcut(event) {
|
|
|
1883
2135
|
return false;
|
|
1884
2136
|
}
|
|
1885
2137
|
__name(shouldSkipShortcut, "shouldSkipShortcut");
|
|
1886
|
-
var
|
|
2138
|
+
var init10 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
1887
2139
|
const api = {
|
|
1888
2140
|
// Getting and setting shortcuts
|
|
1889
2141
|
getShortcutKeys() {
|
|
@@ -1993,7 +2245,7 @@ var init9 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
|
1993
2245
|
break;
|
|
1994
2246
|
}
|
|
1995
2247
|
case "focusIframe": {
|
|
1996
|
-
const element =
|
|
2248
|
+
const element = document3.getElementById("storybook-preview-iframe");
|
|
1997
2249
|
if (element) {
|
|
1998
2250
|
try {
|
|
1999
2251
|
element.contentWindow.focus();
|
|
@@ -2074,6 +2326,26 @@ var init9 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
|
2074
2326
|
fullAPI.emit(FORCE_REMOUNT, { storyId });
|
|
2075
2327
|
break;
|
|
2076
2328
|
}
|
|
2329
|
+
case "openInEditor": {
|
|
2330
|
+
if (global5.CONFIG_TYPE === "DEVELOPMENT") {
|
|
2331
|
+
fullAPI.openInEditor({
|
|
2332
|
+
file: fullAPI.getCurrentStoryData().importPath
|
|
2333
|
+
});
|
|
2334
|
+
}
|
|
2335
|
+
break;
|
|
2336
|
+
}
|
|
2337
|
+
// TODO: bring this back once we want to add shortcuts for this
|
|
2338
|
+
// case 'copyStoryName': {
|
|
2339
|
+
// const storyData = fullAPI.getCurrentStoryData();
|
|
2340
|
+
// if (storyData.type === 'story') {
|
|
2341
|
+
// copy(storyData.exportName);
|
|
2342
|
+
// }
|
|
2343
|
+
// break;
|
|
2344
|
+
// }
|
|
2345
|
+
case "copyStoryLink": {
|
|
2346
|
+
(0, import_copy_to_clipboard.default)(window.location.href);
|
|
2347
|
+
break;
|
|
2348
|
+
}
|
|
2077
2349
|
default:
|
|
2078
2350
|
addonsShortcuts[feature].action();
|
|
2079
2351
|
break;
|
|
@@ -2089,7 +2361,7 @@ var init9 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
|
2089
2361
|
)
|
|
2090
2362
|
};
|
|
2091
2363
|
const initModule = /* @__PURE__ */ __name(() => {
|
|
2092
|
-
|
|
2364
|
+
document3.addEventListener("keydown", (event) => {
|
|
2093
2365
|
if (!shouldSkipShortcut(event)) {
|
|
2094
2366
|
api.handleKeydownEvent(event);
|
|
2095
2367
|
}
|
|
@@ -2104,7 +2376,7 @@ var init9 = /* @__PURE__ */ __name(({ store: store2, fullAPI, provider }) => {
|
|
|
2104
2376
|
// src/manager-api/modules/stories.ts
|
|
2105
2377
|
var stories_exports = {};
|
|
2106
2378
|
__export(stories_exports, {
|
|
2107
|
-
init: () =>
|
|
2379
|
+
init: () => init11
|
|
2108
2380
|
});
|
|
2109
2381
|
import { logger as logger5 } from "storybook/internal/client-logger";
|
|
2110
2382
|
import {
|
|
@@ -2272,12 +2544,12 @@ function createStatusStore({
|
|
|
2272
2544
|
__name(createStatusStore, "createStatusStore");
|
|
2273
2545
|
|
|
2274
2546
|
// src/shared/universal-store/use-universal-store-manager.ts
|
|
2275
|
-
import * as
|
|
2547
|
+
import * as React2 from "react";
|
|
2276
2548
|
var useUniversalStore = /* @__PURE__ */ __name((universalStore, selector) => {
|
|
2277
|
-
const snapshotRef =
|
|
2549
|
+
const snapshotRef = React2.useRef(
|
|
2278
2550
|
selector ? selector(universalStore.getState()) : universalStore.getState()
|
|
2279
2551
|
);
|
|
2280
|
-
const subscribe =
|
|
2552
|
+
const subscribe = React2.useCallback(
|
|
2281
2553
|
(listener) => universalStore.onStateChange((state2, previousState) => {
|
|
2282
2554
|
if (!selector) {
|
|
2283
2555
|
snapshotRef.current = state2;
|
|
@@ -2294,7 +2566,7 @@ var useUniversalStore = /* @__PURE__ */ __name((universalStore, selector) => {
|
|
|
2294
2566
|
}),
|
|
2295
2567
|
[universalStore, selector]
|
|
2296
2568
|
);
|
|
2297
|
-
const getSnapshot =
|
|
2569
|
+
const getSnapshot = React2.useCallback(() => {
|
|
2298
2570
|
const currentState = universalStore.getState();
|
|
2299
2571
|
const selectedState = selector ? selector(currentState) : currentState;
|
|
2300
2572
|
if (isEqual(selectedState, snapshotRef.current)) {
|
|
@@ -2303,7 +2575,7 @@ var useUniversalStore = /* @__PURE__ */ __name((universalStore, selector) => {
|
|
|
2303
2575
|
snapshotRef.current = selectedState;
|
|
2304
2576
|
return snapshotRef.current;
|
|
2305
2577
|
}, [universalStore, selector]);
|
|
2306
|
-
const state =
|
|
2578
|
+
const state = React2.useSyncExternalStore(subscribe, getSnapshot);
|
|
2307
2579
|
return [state, universalStore.setState];
|
|
2308
2580
|
}, "useUniversalStore");
|
|
2309
2581
|
|
|
@@ -2335,7 +2607,7 @@ function removeRemovedOptions(options) {
|
|
|
2335
2607
|
return result;
|
|
2336
2608
|
}
|
|
2337
2609
|
__name(removeRemovedOptions, "removeRemovedOptions");
|
|
2338
|
-
var
|
|
2610
|
+
var init11 = /* @__PURE__ */ __name(({
|
|
2339
2611
|
fullAPI,
|
|
2340
2612
|
store: store2,
|
|
2341
2613
|
navigate,
|
|
@@ -2492,8 +2764,9 @@ var init10 = /* @__PURE__ */ __name(({
|
|
|
2492
2764
|
}
|
|
2493
2765
|
if (node.type === "story") {
|
|
2494
2766
|
results.push(node.id);
|
|
2495
|
-
}
|
|
2496
|
-
|
|
2767
|
+
}
|
|
2768
|
+
if ("children" in node) {
|
|
2769
|
+
node.children?.forEach((childId) => findChildEntriesRecursively(childId, results));
|
|
2497
2770
|
}
|
|
2498
2771
|
return results;
|
|
2499
2772
|
}, "findChildEntriesRecursively");
|
|
@@ -2836,7 +3109,7 @@ var init10 = /* @__PURE__ */ __name(({
|
|
|
2836
3109
|
// src/manager-api/modules/url.ts
|
|
2837
3110
|
var url_exports = {};
|
|
2838
3111
|
__export(url_exports, {
|
|
2839
|
-
init: () =>
|
|
3112
|
+
init: () => init12
|
|
2840
3113
|
});
|
|
2841
3114
|
import {
|
|
2842
3115
|
GLOBALS_UPDATED as GLOBALS_UPDATED2,
|
|
@@ -2913,7 +3186,7 @@ var initialUrlSupport = /* @__PURE__ */ __name(({
|
|
|
2913
3186
|
prevParams = customQueryParams;
|
|
2914
3187
|
return { viewMode, layout, ui, selectedPanel, location: location2, path, customQueryParams, storyId };
|
|
2915
3188
|
}, "initialUrlSupport");
|
|
2916
|
-
var
|
|
3189
|
+
var init12 = /* @__PURE__ */ __name((moduleArgs) => {
|
|
2917
3190
|
const { store: store2, navigate, provider, fullAPI } = moduleArgs;
|
|
2918
3191
|
const navigateTo = /* @__PURE__ */ __name((path, queryParams = {}, options = {}) => {
|
|
2919
3192
|
const params = Object.entries(queryParams).filter(([, v]) => v).sort(([a], [b]) => a < b ? -1 : 1).map(([k, v]) => `${k}=${v}`);
|
|
@@ -3009,14 +3282,14 @@ var init11 = /* @__PURE__ */ __name((moduleArgs) => {
|
|
|
3009
3282
|
// src/manager-api/modules/versions.ts
|
|
3010
3283
|
var versions_exports = {};
|
|
3011
3284
|
__export(versions_exports, {
|
|
3012
|
-
init: () =>
|
|
3285
|
+
init: () => init13
|
|
3013
3286
|
});
|
|
3014
3287
|
var import_memoizerific2 = __toESM(require_memoizerific(), 1);
|
|
3015
3288
|
import { global as global8 } from "@storybook/global";
|
|
3016
3289
|
import semver from "semver";
|
|
3017
3290
|
|
|
3018
3291
|
// src/manager-api/version.ts
|
|
3019
|
-
var version = "10.0.0-beta.
|
|
3292
|
+
var version = "10.0.0-beta.11";
|
|
3020
3293
|
|
|
3021
3294
|
// src/manager-api/modules/versions.ts
|
|
3022
3295
|
var { VERSIONCHECK } = global8;
|
|
@@ -3033,7 +3306,7 @@ var normalizeRendererName = /* @__PURE__ */ __name((renderer) => {
|
|
|
3033
3306
|
}
|
|
3034
3307
|
return renderer;
|
|
3035
3308
|
}, "normalizeRendererName");
|
|
3036
|
-
var
|
|
3309
|
+
var init13 = /* @__PURE__ */ __name(({ store: store2 }) => {
|
|
3037
3310
|
const { dismissedVersionNotification } = store2.getState();
|
|
3038
3311
|
const state = {
|
|
3039
3312
|
versions: {
|
|
@@ -3122,9 +3395,9 @@ var init12 = /* @__PURE__ */ __name(({ store: store2 }) => {
|
|
|
3122
3395
|
// src/manager-api/modules/whatsnew.tsx
|
|
3123
3396
|
var whatsnew_exports = {};
|
|
3124
3397
|
__export(whatsnew_exports, {
|
|
3125
|
-
init: () =>
|
|
3398
|
+
init: () => init14
|
|
3126
3399
|
});
|
|
3127
|
-
import
|
|
3400
|
+
import React3 from "react";
|
|
3128
3401
|
import {
|
|
3129
3402
|
REQUEST_WHATS_NEW_DATA,
|
|
3130
3403
|
RESULT_WHATS_NEW_DATA,
|
|
@@ -3134,7 +3407,7 @@ import {
|
|
|
3134
3407
|
import { global as global9 } from "@storybook/global";
|
|
3135
3408
|
var WHATS_NEW_NOTIFICATION_ID = "whats-new";
|
|
3136
3409
|
var StorybookIcon = /* @__PURE__ */ __name(({ color = "currentColor", size = 14 }) => {
|
|
3137
|
-
return
|
|
3410
|
+
return React3.createElement(
|
|
3138
3411
|
"svg",
|
|
3139
3412
|
{
|
|
3140
3413
|
width: size,
|
|
@@ -3143,7 +3416,7 @@ var StorybookIcon = /* @__PURE__ */ __name(({ color = "currentColor", size = 14
|
|
|
3143
3416
|
fill: "none",
|
|
3144
3417
|
xmlns: "http://www.w3.org/2000/svg"
|
|
3145
3418
|
},
|
|
3146
|
-
|
|
3419
|
+
React3.createElement(
|
|
3147
3420
|
"path",
|
|
3148
3421
|
{
|
|
3149
3422
|
fillRule: "evenodd",
|
|
@@ -3154,7 +3427,7 @@ var StorybookIcon = /* @__PURE__ */ __name(({ color = "currentColor", size = 14
|
|
|
3154
3427
|
)
|
|
3155
3428
|
);
|
|
3156
3429
|
}, "StorybookIcon");
|
|
3157
|
-
var
|
|
3430
|
+
var init14 = /* @__PURE__ */ __name(({ fullAPI, store: store2, provider }) => {
|
|
3158
3431
|
const state = {
|
|
3159
3432
|
whatsNewData: void 0
|
|
3160
3433
|
};
|
|
@@ -3216,7 +3489,7 @@ var init13 = /* @__PURE__ */ __name(({ fullAPI, store: store2, provider }) => {
|
|
|
3216
3489
|
headline: whatsNewData.title,
|
|
3217
3490
|
subHeadline: "Learn what's new in Storybook"
|
|
3218
3491
|
},
|
|
3219
|
-
icon:
|
|
3492
|
+
icon: React3.createElement(StorybookIcon, null),
|
|
3220
3493
|
onClear({ dismissed }) {
|
|
3221
3494
|
if (dismissed) {
|
|
3222
3495
|
setWhatsNewCache({ lastDismissedPost: whatsNewData.url });
|
|
@@ -3409,7 +3682,8 @@ var _ManagerProvider = class _ManagerProvider extends Component {
|
|
|
3409
3682
|
globals_exports,
|
|
3410
3683
|
url_exports,
|
|
3411
3684
|
versions_exports,
|
|
3412
|
-
whatsnew_exports
|
|
3685
|
+
whatsnew_exports,
|
|
3686
|
+
open_in_editor_exports
|
|
3413
3687
|
].map(
|
|
3414
3688
|
(m) => m.init({ ...routeData, ...optionsData, ...apiData, state: this.state, fullAPI: this.api })
|
|
3415
3689
|
);
|
|
@@ -3442,14 +3716,14 @@ var _ManagerProvider = class _ManagerProvider extends Component {
|
|
|
3442
3716
|
state: this.state,
|
|
3443
3717
|
api: this.api
|
|
3444
3718
|
};
|
|
3445
|
-
return
|
|
3719
|
+
return React4.createElement(EffectOnMount, { effect: this.initModules }, React4.createElement(ManagerContext.Provider, { value }, React4.createElement(ManagerConsumer, null, children)));
|
|
3446
3720
|
}
|
|
3447
3721
|
};
|
|
3448
3722
|
__name(_ManagerProvider, "ManagerProvider");
|
|
3449
3723
|
_ManagerProvider.displayName = "Manager";
|
|
3450
3724
|
var ManagerProvider = _ManagerProvider;
|
|
3451
3725
|
var EffectOnMount = /* @__PURE__ */ __name(({ children, effect }) => {
|
|
3452
|
-
|
|
3726
|
+
React4.useEffect(effect, []);
|
|
3453
3727
|
return children;
|
|
3454
3728
|
}, "EffectOnMount");
|
|
3455
3729
|
var defaultFilter = /* @__PURE__ */ __name((c) => c, "defaultFilter");
|
|
@@ -3462,7 +3736,7 @@ function ManagerConsumer({
|
|
|
3462
3736
|
const renderer = useRef2(children);
|
|
3463
3737
|
const filterer = useRef2(filter);
|
|
3464
3738
|
if (typeof renderer.current !== "function") {
|
|
3465
|
-
return
|
|
3739
|
+
return React4.createElement(Fragment, null, renderer.current);
|
|
3466
3740
|
}
|
|
3467
3741
|
const comboData = filterer.current(managerContext);
|
|
3468
3742
|
const comboDataArray = useMemo(() => {
|
|
@@ -3470,7 +3744,7 @@ function ManagerConsumer({
|
|
|
3470
3744
|
}, [managerContext.state]);
|
|
3471
3745
|
return useMemo(() => {
|
|
3472
3746
|
const Child = renderer.current;
|
|
3473
|
-
return
|
|
3747
|
+
return React4.createElement(Child, { ...comboData });
|
|
3474
3748
|
}, comboDataArray);
|
|
3475
3749
|
}
|
|
3476
3750
|
__name(ManagerConsumer, "ManagerConsumer");
|