storybook 10.0.0-beta.5 → 10.0.0-beta.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (88) hide show
  1. package/assets/server/openBrowser.applescript +94 -0
  2. package/dist/_browser-chunks/{WithTooltip-ERFLZL6W.js → WithTooltip-SK46ZJ2J.js} +1 -1
  3. package/dist/_browser-chunks/{chunk-EOILZP2R.js → chunk-BOOOPFZF.js} +7 -2
  4. package/dist/_browser-chunks/{chunk-YQV3EGQ5.js → chunk-OQ6NCFPL.js} +38 -15
  5. package/dist/_browser-chunks/{chunk-O5R5CGFA.js → chunk-TMDZCWME.js} +1 -2
  6. package/dist/_node-chunks/{builder-manager-ZTS4EIKQ.js → builder-manager-VFP7HSCF.js} +21 -151
  7. package/dist/_node-chunks/camelcase-ZLZNQMDD.js +18 -0
  8. package/dist/_node-chunks/{chunk-VQN4WAIA.js → chunk-2GCKJYK6.js} +7 -7
  9. package/dist/_node-chunks/{chunk-H52PBBSK.js → chunk-3NIQHNDU.js} +7 -7
  10. package/dist/_node-chunks/{chunk-3VVGIILJ.js → chunk-3QZ7KLON.js} +8 -8
  11. package/dist/_node-chunks/{chunk-VWSUFVUF.js → chunk-3XXQRL3A.js} +7 -7
  12. package/dist/_node-chunks/{chunk-OC3TVLYU.js → chunk-46BWYN3K.js} +7 -7
  13. package/dist/_node-chunks/{chunk-VX5P3IYA.js → chunk-4DIDWIST.js} +7 -7
  14. package/dist/_node-chunks/{chunk-TBWOUVTA.js → chunk-5YUTWYNI.js} +709 -935
  15. package/dist/_node-chunks/{chunk-4VDRH7SM.js → chunk-A2DKPKBY.js} +7 -7
  16. package/dist/_node-chunks/{chunk-KU3JBNPY.js → chunk-BC23FKU4.js} +8 -8
  17. package/dist/_node-chunks/{chunk-KZB7ELL6.js → chunk-BID2X7MU.js} +7 -7
  18. package/dist/_node-chunks/{chunk-PIKDGR3O.js → chunk-C4EOB63P.js} +7 -7
  19. package/dist/_node-chunks/{chunk-TVKUJ3SE.js → chunk-DH7BCQMG.js} +8 -8
  20. package/dist/_node-chunks/{chunk-J3DQMIO4.js → chunk-FCNWWJV7.js} +7 -7
  21. package/dist/_node-chunks/{chunk-EIHJ5J3O.js → chunk-GBZZSL2K.js} +264 -109
  22. package/dist/_node-chunks/{chunk-F7YW5W6B.js → chunk-GCWAGPDV.js} +12 -12
  23. package/dist/_node-chunks/{chunk-K4YETNYJ.js → chunk-I7SRMFT5.js} +7 -7
  24. package/dist/_node-chunks/{chunk-TKN5TEZV.js → chunk-IEFSRAX2.js} +13 -13
  25. package/dist/_node-chunks/{chunk-AK5PHLUA.js → chunk-IGWCAXA2.js} +7 -7
  26. package/dist/_node-chunks/chunk-IYOHZPPC.js +18 -0
  27. package/dist/_node-chunks/{chunk-F3WE3456.js → chunk-KVOP6ASA.js} +7 -7
  28. package/dist/_node-chunks/{chunk-DZJNLBBL.js → chunk-MHVF6Y35.js} +7 -7
  29. package/dist/_node-chunks/{chunk-UTCFHTQH.js → chunk-MRCMZPA2.js} +7 -7
  30. package/dist/_node-chunks/chunk-RNHUADRS.js +62 -0
  31. package/dist/_node-chunks/{chunk-4KRR46V2.js → chunk-RP3VMQPF.js} +15 -15
  32. package/dist/_node-chunks/{chunk-P7YMEOXF.js → chunk-TFIGR2HH.js} +7 -7
  33. package/dist/_node-chunks/{chunk-SW3VZAH7.js → chunk-TXDIOSHI.js} +9 -9
  34. package/dist/_node-chunks/{chunk-WCSHG2QT.js → chunk-U6MJQ7C6.js} +7 -7
  35. package/dist/_node-chunks/{chunk-ACUNHBEO.js → chunk-XXVKM2ZR.js} +26 -23
  36. package/dist/_node-chunks/{chunk-QHIU5I7C.js → chunk-YWU65VY4.js} +6 -6
  37. package/dist/_node-chunks/{chunk-P3TWEOO5.js → chunk-Z3PLI7S2.js} +7 -7
  38. package/dist/_node-chunks/{chunk-2VMDKLSW.js → chunk-ZM2HT2RW.js} +6 -6
  39. package/dist/_node-chunks/{chunk-D7SDB4XE.js → chunk-ZPNXCXIT.js} +8 -8
  40. package/dist/_node-chunks/{dist-OGRBL76N.js → dist-PG4I7ZDU.js} +9 -9
  41. package/dist/_node-chunks/{globby-65LOULA6.js → globby-HXB6X43W.js} +17 -13
  42. package/dist/_node-chunks/{lib-TF7JCT3A.js → lib-4JJTZC7T.js} +7 -7
  43. package/dist/_node-chunks/{mdx-N42X6CFJ-6ZJEUZMZ.js → mdx-N42X6CFJ-3JBJ7PQF.js} +8 -8
  44. package/dist/_node-chunks/{p-limit-PF7JSPDT.js → p-limit-WBBNX4KI.js} +7 -7
  45. package/dist/_node-chunks/{plugin-A6XAWMXN.js → plugin-SEQ2OPRK.js} +10 -10
  46. package/dist/_node-chunks/{plugin-LGHGAC6J.js → plugin-SG6I7RFC.js} +10 -10
  47. package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-HDSEOU3Z.js → webpack-inject-mocker-runtime-plugin-5O25VYCQ.js} +10 -10
  48. package/dist/_node-chunks/{webpack-mock-plugin-ZJJVMJUS.js → webpack-mock-plugin-35I32SAF.js} +9 -9
  49. package/dist/babel/index.js +11 -11
  50. package/dist/bin/core.js +11 -11
  51. package/dist/bin/dispatcher.js +11 -11
  52. package/dist/bin/loader.js +8 -8
  53. package/dist/cli/index.js +27 -22
  54. package/dist/common/index.js +21 -21
  55. package/dist/components/index.js +8 -4
  56. package/dist/core-events/index.d.ts +18 -2
  57. package/dist/core-events/index.js +7 -1
  58. package/dist/core-server/index.js +1157 -1024
  59. package/dist/core-server/presets/common-manager.js +84 -39
  60. package/dist/core-server/presets/common-override-preset.js +9 -9
  61. package/dist/core-server/presets/common-preset.js +691 -29
  62. package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
  63. package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
  64. package/dist/csf/index.d.ts +9 -4
  65. package/dist/csf/index.js +37 -8
  66. package/dist/csf-tools/index.d.ts +13 -6
  67. package/dist/csf-tools/index.js +9 -9
  68. package/dist/manager/globals-runtime.js +1318 -1001
  69. package/dist/manager/globals.d.ts +0 -4
  70. package/dist/manager/globals.js +1 -6
  71. package/dist/manager/runtime.js +2198 -721
  72. package/dist/manager-api/index.d.ts +12 -5
  73. package/dist/manager-api/index.js +347 -76
  74. package/dist/node-logger/index.js +14 -14
  75. package/dist/preview/runtime.js +103 -63
  76. package/dist/preview-api/index.d.ts +70 -71
  77. package/dist/preview-api/index.js +1 -1
  78. package/dist/server-errors.js +10 -10
  79. package/dist/telemetry/index.d.ts +1 -1
  80. package/dist/telemetry/index.js +24 -24
  81. package/dist/types/index.d.ts +28 -7
  82. package/dist/viewport/index.d.ts +36 -4
  83. package/dist/viewport/index.js +1 -1
  84. package/package.json +5 -4
  85. package/dist/_node-chunks/camelcase-K3BM7RII.js +0 -18
  86. package/dist/_node-chunks/chunk-7LG5CLCT.js +0 -18
  87. package/dist/_node-chunks/chunk-DWJ7TV2O.js +0 -62
  88. package/dist/_node-chunks/default-browser-id-4RZZMHJE.js +0 -1719
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_0oz6lpav6bgq from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_0oz6lpav6bgq from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_0oz6lpav6bgq from "node:module";
1
+ import CJS_COMPAT_NODE_URL_srln17sp2zh from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_srln17sp2zh from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_srln17sp2zh from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_0oz6lpav6bgq.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_0oz6lpav6bgq.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_0oz6lpav6bgq.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_srln17sp2zh.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_srln17sp2zh.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_srln17sp2zh.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -12,29 +12,644 @@ var require = CJS_COMPAT_NODE_MODULE_0oz6lpav6bgq.createRequire(import.meta.url)
12
12
  import {
13
13
  parseStaticDir,
14
14
  sendTelemetryError
15
- } from "../../_node-chunks/chunk-F7YW5W6B.js";
16
- import "../../_node-chunks/chunk-VQN4WAIA.js";
15
+ } from "../../_node-chunks/chunk-GCWAGPDV.js";
16
+ import "../../_node-chunks/chunk-2GCKJYK6.js";
17
17
  import {
18
18
  invariant
19
- } from "../../_node-chunks/chunk-VWSUFVUF.js";
19
+ } from "../../_node-chunks/chunk-3XXQRL3A.js";
20
20
  import {
21
21
  resolvePackageDir
22
- } from "../../_node-chunks/chunk-KU3JBNPY.js";
22
+ } from "../../_node-chunks/chunk-BC23FKU4.js";
23
23
  import {
24
24
  join
25
- } from "../../_node-chunks/chunk-4VDRH7SM.js";
26
- import "../../_node-chunks/chunk-VX5P3IYA.js";
25
+ } from "../../_node-chunks/chunk-A2DKPKBY.js";
26
+ import "../../_node-chunks/chunk-4DIDWIST.js";
27
27
  import {
28
28
  loadConfig
29
- } from "../../_node-chunks/chunk-EIHJ5J3O.js";
29
+ } from "../../_node-chunks/chunk-GBZZSL2K.js";
30
30
  import {
31
31
  require_dist
32
- } from "../../_node-chunks/chunk-P7YMEOXF.js";
33
- import "../../_node-chunks/chunk-P3TWEOO5.js";
32
+ } from "../../_node-chunks/chunk-TFIGR2HH.js";
34
33
  import {
34
+ require_picocolors
35
+ } from "../../_node-chunks/chunk-Z3PLI7S2.js";
36
+ import {
37
+ __commonJS,
35
38
  __name,
39
+ __require,
36
40
  __toESM
37
- } from "../../_node-chunks/chunk-2VMDKLSW.js";
41
+ } from "../../_node-chunks/chunk-ZM2HT2RW.js";
42
+
43
+ // ../node_modules/shell-quote/quote.js
44
+ var require_quote = __commonJS({
45
+ "../node_modules/shell-quote/quote.js"(exports, module) {
46
+ "use strict";
47
+ module.exports = /* @__PURE__ */ __name(function quote(xs) {
48
+ return xs.map(function(s) {
49
+ if (s === "") {
50
+ return "''";
51
+ }
52
+ if (s && typeof s === "object") {
53
+ return s.op.replace(/(.)/g, "\\$1");
54
+ }
55
+ if (/["\s\\]/.test(s) && !/'/.test(s)) {
56
+ return "'" + s.replace(/(['])/g, "\\$1") + "'";
57
+ }
58
+ if (/["'\s]/.test(s)) {
59
+ return '"' + s.replace(/(["\\$`!])/g, "\\$1") + '"';
60
+ }
61
+ return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, "$1\\$2");
62
+ }).join(" ");
63
+ }, "quote");
64
+ }
65
+ });
66
+
67
+ // ../node_modules/shell-quote/parse.js
68
+ var require_parse = __commonJS({
69
+ "../node_modules/shell-quote/parse.js"(exports, module) {
70
+ "use strict";
71
+ var CONTROL = "(?:" + [
72
+ "\\|\\|",
73
+ "\\&\\&",
74
+ ";;",
75
+ "\\|\\&",
76
+ "\\<\\(",
77
+ "\\<\\<\\<",
78
+ ">>",
79
+ ">\\&",
80
+ "<\\&",
81
+ "[&;()|<>]"
82
+ ].join("|") + ")";
83
+ var controlRE = new RegExp("^" + CONTROL + "$");
84
+ var META = "|&;()<> \\t";
85
+ var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
86
+ var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
87
+ var hash = /^#$/;
88
+ var SQ = "'";
89
+ var DQ = '"';
90
+ var DS = "$";
91
+ var TOKEN = "";
92
+ var mult = 4294967296;
93
+ for (i = 0; i < 4; i++) {
94
+ TOKEN += (mult * Math.random()).toString(16);
95
+ }
96
+ var i;
97
+ var startsWithToken = new RegExp("^" + TOKEN);
98
+ function matchAll(s, r) {
99
+ var origIndex = r.lastIndex;
100
+ var matches = [];
101
+ var matchObj;
102
+ while (matchObj = r.exec(s)) {
103
+ matches.push(matchObj);
104
+ if (r.lastIndex === matchObj.index) {
105
+ r.lastIndex += 1;
106
+ }
107
+ }
108
+ r.lastIndex = origIndex;
109
+ return matches;
110
+ }
111
+ __name(matchAll, "matchAll");
112
+ function getVar(env2, pre, key) {
113
+ var r = typeof env2 === "function" ? env2(key) : env2[key];
114
+ if (typeof r === "undefined" && key != "") {
115
+ r = "";
116
+ } else if (typeof r === "undefined") {
117
+ r = "$";
118
+ }
119
+ if (typeof r === "object") {
120
+ return pre + TOKEN + JSON.stringify(r) + TOKEN;
121
+ }
122
+ return pre + r;
123
+ }
124
+ __name(getVar, "getVar");
125
+ function parseInternal(string, env2, opts) {
126
+ if (!opts) {
127
+ opts = {};
128
+ }
129
+ var BS = opts.escape || "\\";
130
+ var BAREWORD = "(\\" + BS + `['"` + META + `]|[^\\s'"` + META + "])+";
131
+ var chunker = new RegExp([
132
+ "(" + CONTROL + ")",
133
+ // control chars
134
+ "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+"
135
+ ].join("|"), "g");
136
+ var matches = matchAll(string, chunker);
137
+ if (matches.length === 0) {
138
+ return [];
139
+ }
140
+ if (!env2) {
141
+ env2 = {};
142
+ }
143
+ var commented = false;
144
+ return matches.map(function(match) {
145
+ var s = match[0];
146
+ if (!s || commented) {
147
+ return void 0;
148
+ }
149
+ if (controlRE.test(s)) {
150
+ return { op: s };
151
+ }
152
+ var quote = false;
153
+ var esc = false;
154
+ var out = "";
155
+ var isGlob = false;
156
+ var i2;
157
+ function parseEnvVar() {
158
+ i2 += 1;
159
+ var varend;
160
+ var varname;
161
+ var char = s.charAt(i2);
162
+ if (char === "{") {
163
+ i2 += 1;
164
+ if (s.charAt(i2) === "}") {
165
+ throw new Error("Bad substitution: " + s.slice(i2 - 2, i2 + 1));
166
+ }
167
+ varend = s.indexOf("}", i2);
168
+ if (varend < 0) {
169
+ throw new Error("Bad substitution: " + s.slice(i2));
170
+ }
171
+ varname = s.slice(i2, varend);
172
+ i2 = varend;
173
+ } else if (/[*@#?$!_-]/.test(char)) {
174
+ varname = char;
175
+ i2 += 1;
176
+ } else {
177
+ var slicedFromI = s.slice(i2);
178
+ varend = slicedFromI.match(/[^\w\d_]/);
179
+ if (!varend) {
180
+ varname = slicedFromI;
181
+ i2 = s.length;
182
+ } else {
183
+ varname = slicedFromI.slice(0, varend.index);
184
+ i2 += varend.index - 1;
185
+ }
186
+ }
187
+ return getVar(env2, "", varname);
188
+ }
189
+ __name(parseEnvVar, "parseEnvVar");
190
+ for (i2 = 0; i2 < s.length; i2++) {
191
+ var c = s.charAt(i2);
192
+ isGlob = isGlob || !quote && (c === "*" || c === "?");
193
+ if (esc) {
194
+ out += c;
195
+ esc = false;
196
+ } else if (quote) {
197
+ if (c === quote) {
198
+ quote = false;
199
+ } else if (quote == SQ) {
200
+ out += c;
201
+ } else {
202
+ if (c === BS) {
203
+ i2 += 1;
204
+ c = s.charAt(i2);
205
+ if (c === DQ || c === BS || c === DS) {
206
+ out += c;
207
+ } else {
208
+ out += BS + c;
209
+ }
210
+ } else if (c === DS) {
211
+ out += parseEnvVar();
212
+ } else {
213
+ out += c;
214
+ }
215
+ }
216
+ } else if (c === DQ || c === SQ) {
217
+ quote = c;
218
+ } else if (controlRE.test(c)) {
219
+ return { op: s };
220
+ } else if (hash.test(c)) {
221
+ commented = true;
222
+ var commentObj = { comment: string.slice(match.index + i2 + 1) };
223
+ if (out.length) {
224
+ return [out, commentObj];
225
+ }
226
+ return [commentObj];
227
+ } else if (c === BS) {
228
+ esc = true;
229
+ } else if (c === DS) {
230
+ out += parseEnvVar();
231
+ } else {
232
+ out += c;
233
+ }
234
+ }
235
+ if (isGlob) {
236
+ return { op: "glob", pattern: out };
237
+ }
238
+ return out;
239
+ }).reduce(function(prev, arg) {
240
+ return typeof arg === "undefined" ? prev : prev.concat(arg);
241
+ }, []);
242
+ }
243
+ __name(parseInternal, "parseInternal");
244
+ module.exports = /* @__PURE__ */ __name(function parse(s, env2, opts) {
245
+ var mapped = parseInternal(s, env2, opts);
246
+ if (typeof env2 !== "function") {
247
+ return mapped;
248
+ }
249
+ return mapped.reduce(function(acc, s2) {
250
+ if (typeof s2 === "object") {
251
+ return acc.concat(s2);
252
+ }
253
+ var xs = s2.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
254
+ if (xs.length === 1) {
255
+ return acc.concat(xs[0]);
256
+ }
257
+ return acc.concat(xs.filter(Boolean).map(function(x) {
258
+ if (startsWithToken.test(x)) {
259
+ return JSON.parse(x.split(TOKEN)[1]);
260
+ }
261
+ return x;
262
+ }));
263
+ }, []);
264
+ }, "parse");
265
+ }
266
+ });
267
+
268
+ // ../node_modules/shell-quote/index.js
269
+ var require_shell_quote = __commonJS({
270
+ "../node_modules/shell-quote/index.js"(exports) {
271
+ "use strict";
272
+ exports.quote = require_quote();
273
+ exports.parse = require_parse();
274
+ }
275
+ });
276
+
277
+ // ../node_modules/launch-editor/editor-info/macos.js
278
+ var require_macos = __commonJS({
279
+ "../node_modules/launch-editor/editor-info/macos.js"(exports, module) {
280
+ module.exports = {
281
+ "/Applications/Atom.app/Contents/MacOS/Atom": "atom",
282
+ "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta": "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta",
283
+ "/Applications/Brackets.app/Contents/MacOS/Brackets": "brackets",
284
+ "/Applications/Sublime Text.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
285
+ "/Applications/Sublime Text.app/Contents/MacOS/sublime_text": "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
286
+ "/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2": "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl",
287
+ "/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text": "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl",
288
+ "/Applications/Visual Studio Code.app/Contents/MacOS/Electron": "code",
289
+ "/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron": "code-insiders",
290
+ "/Applications/VSCodium.app/Contents/MacOS/Electron": "codium",
291
+ "/Applications/Cursor.app/Contents/MacOS/Cursor": "cursor",
292
+ "/Applications/Trae.app/Contents/MacOS/Electron": "trae",
293
+ "/Applications/AppCode.app/Contents/MacOS/appcode": "/Applications/AppCode.app/Contents/MacOS/appcode",
294
+ "/Applications/CLion.app/Contents/MacOS/clion": "/Applications/CLion.app/Contents/MacOS/clion",
295
+ "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea",
296
+ "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea",
297
+ "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea": "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea",
298
+ "/Applications/PhpStorm.app/Contents/MacOS/phpstorm": "/Applications/PhpStorm.app/Contents/MacOS/phpstorm",
299
+ "/Applications/PyCharm.app/Contents/MacOS/pycharm": "/Applications/PyCharm.app/Contents/MacOS/pycharm",
300
+ "/Applications/PyCharm CE.app/Contents/MacOS/pycharm": "/Applications/PyCharm CE.app/Contents/MacOS/pycharm",
301
+ "/Applications/RubyMine.app/Contents/MacOS/rubymine": "/Applications/RubyMine.app/Contents/MacOS/rubymine",
302
+ "/Applications/WebStorm.app/Contents/MacOS/webstorm": "/Applications/WebStorm.app/Contents/MacOS/webstorm",
303
+ "/Applications/MacVim.app/Contents/MacOS/MacVim": "mvim",
304
+ "/Applications/GoLand.app/Contents/MacOS/goland": "/Applications/GoLand.app/Contents/MacOS/goland",
305
+ "/Applications/Rider.app/Contents/MacOS/rider": "/Applications/Rider.app/Contents/MacOS/rider",
306
+ "/Applications/Zed.app/Contents/MacOS/zed": "zed"
307
+ };
308
+ }
309
+ });
310
+
311
+ // ../node_modules/launch-editor/editor-info/linux.js
312
+ var require_linux = __commonJS({
313
+ "../node_modules/launch-editor/editor-info/linux.js"(exports, module) {
314
+ module.exports = {
315
+ atom: "atom",
316
+ Brackets: "brackets",
317
+ "code-insiders": "code-insiders",
318
+ code: "code",
319
+ vscodium: "vscodium",
320
+ codium: "codium",
321
+ trae: "trae",
322
+ emacs: "emacs",
323
+ gvim: "gvim",
324
+ idea: "idea",
325
+ "idea.sh": "idea",
326
+ phpstorm: "phpstorm",
327
+ "phpstorm.sh": "phpstorm",
328
+ pycharm: "pycharm",
329
+ "pycharm.sh": "pycharm",
330
+ rubymine: "rubymine",
331
+ "rubymine.sh": "rubymine",
332
+ sublime_text: "subl",
333
+ vim: "vim",
334
+ webstorm: "webstorm",
335
+ "webstorm.sh": "webstorm",
336
+ goland: "goland",
337
+ "goland.sh": "goland",
338
+ rider: "rider",
339
+ "rider.sh": "rider",
340
+ zed: "zed"
341
+ };
342
+ }
343
+ });
344
+
345
+ // ../node_modules/launch-editor/editor-info/windows.js
346
+ var require_windows = __commonJS({
347
+ "../node_modules/launch-editor/editor-info/windows.js"(exports, module) {
348
+ module.exports = [
349
+ "Brackets.exe",
350
+ "Code.exe",
351
+ "Code - Insiders.exe",
352
+ "VSCodium.exe",
353
+ "Cursor.exe",
354
+ "atom.exe",
355
+ "sublime_text.exe",
356
+ "notepad++.exe",
357
+ "clion.exe",
358
+ "clion64.exe",
359
+ "idea.exe",
360
+ "idea64.exe",
361
+ "phpstorm.exe",
362
+ "phpstorm64.exe",
363
+ "pycharm.exe",
364
+ "pycharm64.exe",
365
+ "rubymine.exe",
366
+ "rubymine64.exe",
367
+ "webstorm.exe",
368
+ "webstorm64.exe",
369
+ "goland.exe",
370
+ "goland64.exe",
371
+ "rider.exe",
372
+ "rider64.exe",
373
+ "trae.exe"
374
+ ];
375
+ }
376
+ });
377
+
378
+ // ../node_modules/launch-editor/guess.js
379
+ var require_guess = __commonJS({
380
+ "../node_modules/launch-editor/guess.js"(exports, module) {
381
+ var path = __require("path");
382
+ var shellQuote = require_shell_quote();
383
+ var childProcess = __require("child_process");
384
+ var COMMON_EDITORS_MACOS = require_macos();
385
+ var COMMON_EDITORS_LINUX = require_linux();
386
+ var COMMON_EDITORS_WIN = require_windows();
387
+ module.exports = /* @__PURE__ */ __name(function guessEditor(specifiedEditor) {
388
+ if (specifiedEditor) {
389
+ return shellQuote.parse(specifiedEditor);
390
+ }
391
+ if (process.env.LAUNCH_EDITOR) {
392
+ return [process.env.LAUNCH_EDITOR];
393
+ }
394
+ if (process.versions.webcontainer) {
395
+ return [process.env.EDITOR || "code"];
396
+ }
397
+ try {
398
+ if (process.platform === "darwin") {
399
+ const output = childProcess.execSync("ps x -o comm=", {
400
+ stdio: ["pipe", "pipe", "ignore"]
401
+ }).toString();
402
+ const processNames = Object.keys(COMMON_EDITORS_MACOS);
403
+ const processList = output.split("\n");
404
+ for (let i = 0; i < processNames.length; i++) {
405
+ const processName = processNames[i];
406
+ if (processList.includes(processName)) {
407
+ return [COMMON_EDITORS_MACOS[processName]];
408
+ }
409
+ const processNameWithoutApplications = processName.replace("/Applications", "");
410
+ if (output.indexOf(processNameWithoutApplications) !== -1) {
411
+ if (processName !== COMMON_EDITORS_MACOS[processName]) {
412
+ return [COMMON_EDITORS_MACOS[processName]];
413
+ }
414
+ const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications));
415
+ if (runningProcess !== void 0) {
416
+ return [runningProcess];
417
+ }
418
+ }
419
+ }
420
+ } else if (process.platform === "win32") {
421
+ const output = childProcess.execSync(
422
+ 'powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',
423
+ {
424
+ stdio: ["pipe", "pipe", "ignore"]
425
+ }
426
+ ).toString();
427
+ const runningProcesses = output.split("\r\n");
428
+ for (let i = 0; i < runningProcesses.length; i++) {
429
+ const fullProcessPath = runningProcesses[i].trim();
430
+ const shortProcessName = path.basename(fullProcessPath);
431
+ if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) {
432
+ return [fullProcessPath];
433
+ }
434
+ }
435
+ } else if (process.platform === "linux") {
436
+ const output = childProcess.execSync("ps x --no-heading -o comm --sort=comm", {
437
+ stdio: ["pipe", "pipe", "ignore"]
438
+ }).toString();
439
+ const processNames = Object.keys(COMMON_EDITORS_LINUX);
440
+ for (let i = 0; i < processNames.length; i++) {
441
+ const processName = processNames[i];
442
+ if (output.indexOf(processName) !== -1) {
443
+ return [COMMON_EDITORS_LINUX[processName]];
444
+ }
445
+ }
446
+ }
447
+ } catch (ignoreError) {
448
+ }
449
+ if (process.env.VISUAL) {
450
+ return [process.env.VISUAL];
451
+ } else if (process.env.EDITOR) {
452
+ return [process.env.EDITOR];
453
+ }
454
+ return [null];
455
+ }, "guessEditor");
456
+ }
457
+ });
458
+
459
+ // ../node_modules/launch-editor/get-args.js
460
+ var require_get_args = __commonJS({
461
+ "../node_modules/launch-editor/get-args.js"(exports, module) {
462
+ var path = __require("path");
463
+ module.exports = /* @__PURE__ */ __name(function getArgumentsForPosition(editor, fileName, lineNumber, columnNumber = 1) {
464
+ const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, "");
465
+ switch (editorBasename) {
466
+ case "atom":
467
+ case "Atom":
468
+ case "Atom Beta":
469
+ case "subl":
470
+ case "sublime":
471
+ case "sublime_text":
472
+ case "wstorm":
473
+ case "charm":
474
+ case "zed":
475
+ return [`${fileName}:${lineNumber}:${columnNumber}`];
476
+ case "notepad++":
477
+ return ["-n" + lineNumber, "-c" + columnNumber, fileName];
478
+ case "vim":
479
+ case "mvim":
480
+ return [`+call cursor(${lineNumber}, ${columnNumber})`, fileName];
481
+ case "joe":
482
+ case "gvim":
483
+ return [`+${lineNumber}`, fileName];
484
+ case "emacs":
485
+ case "emacsclient":
486
+ return [`+${lineNumber}:${columnNumber}`, fileName];
487
+ case "rmate":
488
+ case "mate":
489
+ case "mine":
490
+ return ["--line", lineNumber, fileName];
491
+ case "code":
492
+ case "Code":
493
+ case "code-insiders":
494
+ case "Code - Insiders":
495
+ case "codium":
496
+ case "trae":
497
+ case "cursor":
498
+ case "vscodium":
499
+ case "VSCodium":
500
+ return ["-r", "-g", `${fileName}:${lineNumber}:${columnNumber}`];
501
+ case "appcode":
502
+ case "clion":
503
+ case "clion64":
504
+ case "idea":
505
+ case "idea64":
506
+ case "phpstorm":
507
+ case "phpstorm64":
508
+ case "pycharm":
509
+ case "pycharm64":
510
+ case "rubymine":
511
+ case "rubymine64":
512
+ case "webstorm":
513
+ case "webstorm64":
514
+ case "goland":
515
+ case "goland64":
516
+ case "rider":
517
+ case "rider64":
518
+ return ["--line", lineNumber, "--column", columnNumber, fileName];
519
+ }
520
+ if (process.env.LAUNCH_EDITOR) {
521
+ return [fileName, lineNumber, columnNumber];
522
+ }
523
+ return [fileName];
524
+ }, "getArgumentsForPosition");
525
+ }
526
+ });
527
+
528
+ // ../node_modules/launch-editor/index.js
529
+ var require_launch_editor = __commonJS({
530
+ "../node_modules/launch-editor/index.js"(exports, module) {
531
+ var fs = __require("fs");
532
+ var os = __require("os");
533
+ var path = __require("path");
534
+ var colors = require_picocolors();
535
+ var childProcess = __require("child_process");
536
+ var guessEditor = require_guess();
537
+ var getArgumentsForPosition = require_get_args();
538
+ function wrapErrorCallback(cb) {
539
+ return (fileName, errorMessage) => {
540
+ console.log();
541
+ console.log(
542
+ colors.red("Could not open " + path.basename(fileName) + " in the editor.")
543
+ );
544
+ if (errorMessage) {
545
+ if (errorMessage[errorMessage.length - 1] !== ".") {
546
+ errorMessage += ".";
547
+ }
548
+ console.log(
549
+ colors.red("The editor process exited with an error: " + errorMessage)
550
+ );
551
+ }
552
+ console.log();
553
+ if (cb) cb(fileName, errorMessage);
554
+ };
555
+ }
556
+ __name(wrapErrorCallback, "wrapErrorCallback");
557
+ function isTerminalEditor(editor) {
558
+ switch (editor) {
559
+ case "vim":
560
+ case "emacs":
561
+ case "nano":
562
+ return true;
563
+ }
564
+ return false;
565
+ }
566
+ __name(isTerminalEditor, "isTerminalEditor");
567
+ var positionRE = /:(\d+)(:(\d+))?$/;
568
+ function parseFile(file) {
569
+ if (file.startsWith("file://")) {
570
+ file = __require("url").fileURLToPath(file);
571
+ }
572
+ const fileName = file.replace(positionRE, "");
573
+ const match = file.match(positionRE);
574
+ const lineNumber = match && match[1];
575
+ const columnNumber = match && match[3];
576
+ return {
577
+ fileName,
578
+ lineNumber,
579
+ columnNumber
580
+ };
581
+ }
582
+ __name(parseFile, "parseFile");
583
+ var _childProcess = null;
584
+ function launchEditor(file, specifiedEditor, onErrorCallback) {
585
+ const parsed = parseFile(file);
586
+ let { fileName } = parsed;
587
+ const { lineNumber, columnNumber } = parsed;
588
+ if (!fs.existsSync(fileName)) {
589
+ return;
590
+ }
591
+ if (typeof specifiedEditor === "function") {
592
+ onErrorCallback = specifiedEditor;
593
+ specifiedEditor = void 0;
594
+ }
595
+ onErrorCallback = wrapErrorCallback(onErrorCallback);
596
+ const [editor, ...args] = guessEditor(specifiedEditor);
597
+ if (!editor) {
598
+ onErrorCallback(fileName, null);
599
+ return;
600
+ }
601
+ if (process.platform === "linux" && fileName.startsWith("/mnt/") && /Microsoft/i.test(os.release())) {
602
+ fileName = path.relative("", fileName);
603
+ }
604
+ if (lineNumber) {
605
+ const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
606
+ args.push.apply(args, extraArgs);
607
+ } else {
608
+ args.push(fileName);
609
+ }
610
+ if (_childProcess && isTerminalEditor(editor)) {
611
+ _childProcess.kill("SIGKILL");
612
+ }
613
+ if (process.platform === "win32") {
614
+ let escapeCmdArgs2 = function(cmdArgs) {
615
+ return cmdArgs.replace(/([&|<>,;=^])/g, "^$1");
616
+ }, doubleQuoteIfNeeded2 = function(str) {
617
+ if (str.includes("^")) {
618
+ return `^"${str}^"`;
619
+ } else if (str.includes(" ")) {
620
+ return `"${str}"`;
621
+ }
622
+ return str;
623
+ };
624
+ var escapeCmdArgs = escapeCmdArgs2, doubleQuoteIfNeeded = doubleQuoteIfNeeded2;
625
+ __name(escapeCmdArgs2, "escapeCmdArgs");
626
+ __name(doubleQuoteIfNeeded2, "doubleQuoteIfNeeded");
627
+ const launchCommand = [editor, ...args.map(escapeCmdArgs2)].map(doubleQuoteIfNeeded2).join(" ");
628
+ _childProcess = childProcess.exec(launchCommand, {
629
+ stdio: "inherit",
630
+ shell: true
631
+ });
632
+ } else {
633
+ _childProcess = childProcess.spawn(editor, args, { stdio: "inherit" });
634
+ }
635
+ _childProcess.on("exit", function(errorCode) {
636
+ _childProcess = null;
637
+ if (errorCode) {
638
+ onErrorCallback(fileName, "(code " + errorCode + ")");
639
+ }
640
+ });
641
+ _childProcess.on("error", function(error) {
642
+ let { code, message } = error;
643
+ if ("ENOENT" === code) {
644
+ message = `${message} ('${editor}' command does not exist in 'PATH')`;
645
+ }
646
+ onErrorCallback(fileName, message);
647
+ });
648
+ }
649
+ __name(launchEditor, "launchEditor");
650
+ module.exports = launchEditor;
651
+ }
652
+ });
38
653
 
39
654
  // src/core-server/presets/common-preset.ts
40
655
  import { existsSync as existsSync3 } from "node:fs";
@@ -53,7 +668,7 @@ import {
53
668
  } from "storybook/internal/common";
54
669
  import { readCsf as readCsf2 } from "storybook/internal/csf-tools";
55
670
  import { logger as logger3 } from "storybook/internal/node-logger";
56
- import { telemetry as telemetry5 } from "storybook/internal/telemetry";
671
+ import { telemetry as telemetry6 } from "storybook/internal/telemetry";
57
672
  var import_ts_dedent4 = __toESM(require_dist(), 1);
58
673
 
59
674
  // src/core-server/server-channel/create-new-story-channel.ts
@@ -84,7 +699,7 @@ var import_ts_dedent = __toESM(require_dist(), 1);
84
699
 
85
700
  // src/core-server/utils/get-component-variable-name.ts
86
701
  var getComponentVariableName = /* @__PURE__ */ __name(async (name) => {
87
- const camelCase = await import("../../_node-chunks/camelcase-K3BM7RII.js");
702
+ const camelCase = await import("../../_node-chunks/camelcase-ZLZNQMDD.js");
88
703
  const camelCased = camelCase.default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: true });
89
704
  const sanitized = camelCased.replace(/[^a-zA-Z_$]+/, "");
90
705
  return sanitized;
@@ -431,7 +1046,7 @@ async function searchFiles({
431
1046
  ignoredFiles = IGNORED_FILES,
432
1047
  fileExtensions = FILE_EXTENSIONS
433
1048
  }) {
434
- const { globby, isDynamicPattern } = await import("../../_node-chunks/globby-65LOULA6.js");
1049
+ const { globby, isDynamicPattern } = await import("../../_node-chunks/globby-HXB6X43W.js");
435
1050
  const hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd });
436
1051
  const hasFileExtensionRegex = /(\.[a-z]+)$/i;
437
1052
  const searchQueryHasExtension = hasFileExtensionRegex.test(searchQuery);
@@ -532,6 +1147,52 @@ ${e?.message}`
532
1147
  }
533
1148
  __name(initFileSearchChannel, "initFileSearchChannel");
534
1149
 
1150
+ // src/core-server/server-channel/open-in-editor-channel.ts
1151
+ var import_launch_editor = __toESM(require_launch_editor(), 1);
1152
+ import { OPEN_IN_EDITOR_REQUEST, OPEN_IN_EDITOR_RESPONSE } from "storybook/internal/core-events";
1153
+ import { telemetry as telemetry3 } from "storybook/internal/telemetry";
1154
+ async function initOpenInEditorChannel(channel, _options, coreOptions) {
1155
+ channel.on(OPEN_IN_EDITOR_REQUEST, async (payload) => {
1156
+ const sendTelemetry = /* @__PURE__ */ __name((data) => {
1157
+ if (!coreOptions.disableTelemetry) {
1158
+ telemetry3("open-in-editor", data);
1159
+ }
1160
+ }, "sendTelemetry");
1161
+ try {
1162
+ const { file: targetFile, line, column } = payload;
1163
+ if (!targetFile) {
1164
+ throw new Error("No file was provided to open");
1165
+ }
1166
+ const location = typeof line === "number" ? `${targetFile}:${line}${typeof column === "number" ? `:${column}` : ""}` : targetFile;
1167
+ await new Promise((resolve, reject) => {
1168
+ (0, import_launch_editor.default)(location, void 0, (_fileName, errorMessage) => {
1169
+ if (errorMessage) {
1170
+ reject(new Error(errorMessage));
1171
+ } else {
1172
+ resolve();
1173
+ }
1174
+ });
1175
+ });
1176
+ channel.emit(OPEN_IN_EDITOR_RESPONSE, {
1177
+ file: targetFile,
1178
+ line,
1179
+ column,
1180
+ error: null
1181
+ });
1182
+ sendTelemetry({ success: true });
1183
+ } catch (e) {
1184
+ const error = e?.message || "Failed to open in editor";
1185
+ channel.emit(OPEN_IN_EDITOR_RESPONSE, {
1186
+ error,
1187
+ ...payload
1188
+ });
1189
+ sendTelemetry({ success: false, error });
1190
+ }
1191
+ });
1192
+ return channel;
1193
+ }
1194
+ __name(initOpenInEditorChannel, "initOpenInEditorChannel");
1195
+
535
1196
  // src/core-server/utils/constants.ts
536
1197
  var defaultStaticDirs = [
537
1198
  {
@@ -553,7 +1214,7 @@ import {
553
1214
  import { storyNameFromExport, toId } from "storybook/internal/csf";
554
1215
  import { printCsf, readCsf } from "storybook/internal/csf-tools";
555
1216
  import { logger } from "storybook/internal/node-logger";
556
- import { isExampleStoryId, telemetry as telemetry3 } from "storybook/internal/telemetry";
1217
+ import { isExampleStoryId, telemetry as telemetry4 } from "storybook/internal/telemetry";
557
1218
 
558
1219
  // src/core-server/utils/save-story/duplicate-story-with-new-name.ts
559
1220
  import { types as t2, traverse } from "storybook/internal/babel";
@@ -832,7 +1493,7 @@ function initializeSaveStory(channel, options, coreConfig) {
832
1493
  });
833
1494
  const isCLIExample = isExampleStoryId(newStoryId ?? csfId);
834
1495
  if (!coreConfig.disableTelemetry && !isCLIExample) {
835
- await telemetry3("save-story", {
1496
+ await telemetry4("save-story", {
836
1497
  action: name ? "createStory" : "updateStory",
837
1498
  success: true
838
1499
  });
@@ -848,7 +1509,7 @@ function initializeSaveStory(channel, options, coreConfig) {
848
1509
  ${error.stack || error.message || error.toString()}`
849
1510
  );
850
1511
  if (!coreConfig.disableTelemetry && !(error instanceof SaveStoryError)) {
851
- await telemetry3("save-story", {
1512
+ await telemetry4("save-story", {
852
1513
  action: name ? "createStory" : "updateStory",
853
1514
  success: false,
854
1515
  error
@@ -871,7 +1532,7 @@ import {
871
1532
  } from "storybook/internal/core-events";
872
1533
  import { printConfig, readConfig } from "storybook/internal/csf-tools";
873
1534
  import { logger as logger2 } from "storybook/internal/node-logger";
874
- import { telemetry as telemetry4 } from "storybook/internal/telemetry";
1535
+ import { telemetry as telemetry5 } from "storybook/internal/telemetry";
875
1536
  var WHATS_NEW_CACHE = "whats-new-cache";
876
1537
  var WHATS_NEW_URL = "https://storybook.js.org/whats-new/v1";
877
1538
  function initializeWhatsNew(channel, options, coreOptions) {
@@ -924,7 +1585,7 @@ function initializeWhatsNew(channel, options, coreOptions) {
924
1585
  main.setFieldValue(["core", "disableWhatsNewNotifications"], disableWhatsNewNotifications);
925
1586
  await writeFile3(mainPath, printConfig(main).code);
926
1587
  if (isTelemetryEnabled) {
927
- await telemetry4("core-config", { disableWhatsNewNotifications });
1588
+ await telemetry5("core-config", { disableWhatsNewNotifications });
928
1589
  }
929
1590
  } catch (error) {
930
1591
  invariant(error instanceof Error);
@@ -1052,7 +1713,7 @@ var experimental_serverAPI = /* @__PURE__ */ __name((extension, options) => {
1052
1713
  });
1053
1714
  if (!options.disableTelemetry) {
1054
1715
  removeAddon = /* @__PURE__ */ __name(async (id, opts) => {
1055
- await telemetry5("remove", { addon: id, source: "api" });
1716
+ await telemetry6("remove", { addon: id, source: "api" });
1056
1717
  return removeAddonBase(id, { ...opts, packageManager });
1057
1718
  }, "removeAddon");
1058
1719
  }
@@ -1107,6 +1768,7 @@ var experimental_serverChannel = /* @__PURE__ */ __name(async (channel, options)
1107
1768
  initializeSaveStory(channel, options, coreOptions);
1108
1769
  initFileSearchChannel(channel, options, coreOptions);
1109
1770
  initCreateNewStoryChannel(channel, options, coreOptions);
1771
+ initOpenInEditorChannel(channel, options, coreOptions);
1110
1772
  return channel;
1111
1773
  }, "experimental_serverChannel");
1112
1774
  var resolvedReact = /* @__PURE__ */ __name(async (existing) => {
@@ -1131,8 +1793,8 @@ var viteFinal = /* @__PURE__ */ __name(async (existing, options) => {
1131
1793
  if (!previewConfigPath) {
1132
1794
  return existing;
1133
1795
  }
1134
- const { viteInjectMockerRuntime } = await import("../../_node-chunks/plugin-A6XAWMXN.js");
1135
- const { viteMockPlugin } = await import("../../_node-chunks/plugin-LGHGAC6J.js");
1796
+ const { viteInjectMockerRuntime } = await import("../../_node-chunks/plugin-SEQ2OPRK.js");
1797
+ const { viteMockPlugin } = await import("../../_node-chunks/plugin-SG6I7RFC.js");
1136
1798
  const coreOptions = await options.presets.apply("core");
1137
1799
  return {
1138
1800
  ...existing,
@@ -1150,8 +1812,8 @@ var webpackFinal = /* @__PURE__ */ __name(async (config, options) => {
1150
1812
  if (!previewConfigPath) {
1151
1813
  return config;
1152
1814
  }
1153
- const { WebpackMockPlugin } = await import("../../_node-chunks/webpack-mock-plugin-ZJJVMJUS.js");
1154
- const { WebpackInjectMockerRuntimePlugin } = await import("../../_node-chunks/webpack-inject-mocker-runtime-plugin-HDSEOU3Z.js");
1815
+ const { WebpackMockPlugin } = await import("../../_node-chunks/webpack-mock-plugin-35I32SAF.js");
1816
+ const { WebpackInjectMockerRuntimePlugin } = await import("../../_node-chunks/webpack-inject-mocker-runtime-plugin-5O25VYCQ.js");
1155
1817
  config.plugins = config.plugins || [];
1156
1818
  config.module.rules.push({
1157
1819
  test: /preview\.(t|j)sx?$/,