@storybook/addon-docs 10.1.0-alpha.9 → 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.
Files changed (33) hide show
  1. package/dist/_browser-chunks/Color-S5NAVK5F.js +1096 -0
  2. package/dist/_browser-chunks/{DocsRenderer-HT7GNKAR.js → DocsRenderer-GHJI37HO.js} +2 -2
  3. package/dist/_browser-chunks/{chunk-MM7DTO55.js → chunk-A242L54C.js} +10 -16
  4. package/dist/_browser-chunks/chunk-CYSK6WYR.js +7 -0
  5. package/dist/_browser-chunks/chunk-DDRHE7EB.js +949 -0
  6. package/dist/_browser-chunks/{chunk-74ZUTOZN.js → chunk-OATZR77O.js} +9 -22
  7. package/dist/_browser-chunks/chunk-UUESKCKV.js +31 -0
  8. package/dist/_node-chunks/{chunk-D527LDYX.js → chunk-OGE4GWLB.js} +13 -19
  9. package/dist/_node-chunks/chunk-PRNIBEEO.js +196 -0
  10. package/dist/_node-chunks/chunk-SEBYU7IP.js +168 -0
  11. package/dist/_node-chunks/chunk-SZXCUVK4.js +22630 -0
  12. package/dist/_node-chunks/mdx-plugin-NLBBLG32.js +1032 -0
  13. package/dist/_node-chunks/rehype-external-links-V2D4HT5U.js +121 -0
  14. package/dist/_node-chunks/{rehype-slug-NIZ5EZAF.js → rehype-slug-U5W6TP4H.js} +24 -58
  15. package/dist/angular/index.js +3 -5
  16. package/dist/blocks.d.ts +5 -2
  17. package/dist/blocks.js +4658 -6651
  18. package/dist/ember/index.js +3 -5
  19. package/dist/index.js +4 -6
  20. package/dist/manager.js +11 -22
  21. package/dist/mdx-loader.js +13 -19
  22. package/dist/preset.js +160 -453
  23. package/dist/preview.js +2 -2
  24. package/package.json +6 -6
  25. package/dist/_browser-chunks/Color-64QXVMR3.js +0 -1675
  26. package/dist/_browser-chunks/chunk-DMNQCVA2.js +0 -12
  27. package/dist/_browser-chunks/chunk-UZFOWTVP.js +0 -974
  28. package/dist/_browser-chunks/chunk-YDZYZRYC.js +0 -39
  29. package/dist/_node-chunks/chunk-45YQE7PZ.js +0 -36332
  30. package/dist/_node-chunks/chunk-BBLOWQ3W.js +0 -231
  31. package/dist/_node-chunks/chunk-P7HMFQCU.js +0 -248
  32. package/dist/_node-chunks/mdx-plugin-36DJJXJE.js +0 -1654
  33. package/dist/_node-chunks/rehype-external-links-AGP76D2N.js +0 -168
package/dist/preset.js CHANGED
@@ -1,17 +1,15 @@
1
- import CJS_COMPAT_NODE_URL_1ynzi6bba2j from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1ynzi6bba2j from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1ynzi6bba2j from "node:module";
1
+ import CJS_COMPAT_NODE_URL_2pgro2geduh from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_2pgro2geduh from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_2pgro2geduh from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_1ynzi6bba2j.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1ynzi6bba2j.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1ynzi6bba2j.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_2pgro2geduh.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_2pgro2geduh.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_2pgro2geduh.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
- import {
13
- __name
14
- } from "./_node-chunks/chunk-D527LDYX.js";
12
+ import "./_node-chunks/chunk-OGE4GWLB.js";
15
13
 
16
14
  // src/preset.ts
17
15
  import { isAbsolute as isAbsolute2 } from "node:path";
@@ -25,459 +23,198 @@ import { fileURLToPath, pathToFileURL } from "node:url";
25
23
  import assert from "node:assert";
26
24
  import v8 from "node:v8";
27
25
  import { format, inspect } from "node:util";
28
- var own$1 = {}.hasOwnProperty;
29
- var classRegExp = /^([A-Z][a-z\d]*)+$/;
30
- var kTypes = /* @__PURE__ */ new Set([
26
+ var own$1 = {}.hasOwnProperty, classRegExp = /^([A-Z][a-z\d]*)+$/, kTypes = /* @__PURE__ */ new Set([
31
27
  "string",
32
28
  "function",
33
29
  "number",
34
30
  "object",
35
- // Accept 'Function' and 'Object' as alternative to the lower cased version.
36
31
  "Function",
37
32
  "Object",
38
33
  "boolean",
39
34
  "bigint",
40
35
  "symbol"
41
- ]);
42
- var messages = /* @__PURE__ */ new Map();
43
- var nodeInternalPrefix = "__node_internal_";
44
- var userStackTraceLimit;
36
+ ]), messages = /* @__PURE__ */ new Map(), nodeInternalPrefix = "__node_internal_", userStackTraceLimit;
45
37
  function formatList(array, type = "and") {
46
38
  return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
47
39
  }
48
- __name(formatList, "formatList");
49
40
  function createError(sym, value, constructor) {
50
- messages.set(sym, value);
51
- return makeNodeErrorWithCode(constructor, sym);
41
+ return messages.set(sym, value), makeNodeErrorWithCode(constructor, sym);
52
42
  }
53
- __name(createError, "createError");
54
43
  function makeNodeErrorWithCode(Base, key) {
55
- return /* @__PURE__ */ __name(function NodeError(...parameters) {
56
- const limit = Error.stackTraceLimit;
57
- if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
58
- const error = new Base();
59
- if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
60
- const message = getMessage(key, parameters, error);
61
- Object.defineProperties(error, {
62
- // Note: no need to implement `kIsNodeError` symbol, would be hard,
63
- // probably.
44
+ return function(...parameters) {
45
+ let limit = Error.stackTraceLimit;
46
+ isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = 0);
47
+ let error = new Base();
48
+ isErrorStackTraceLimitWritable() && (Error.stackTraceLimit = limit);
49
+ let message = getMessage(key, parameters, error);
50
+ return Object.defineProperties(error, {
64
51
  message: {
65
52
  value: message,
66
- enumerable: false,
67
- writable: true,
68
- configurable: true
53
+ enumerable: !1,
54
+ writable: !0,
55
+ configurable: !0
69
56
  },
70
57
  toString: {
71
- /** @this {Error} */
72
58
  value() {
73
59
  return `${this.name} [${key}]: ${this.message}`;
74
60
  },
75
- enumerable: false,
76
- writable: true,
77
- configurable: true
61
+ enumerable: !1,
62
+ writable: !0,
63
+ configurable: !0
78
64
  }
79
- });
80
- captureLargerStackTrace(error);
81
- error.code = key;
82
- return error;
83
- }, "NodeError");
65
+ }), captureLargerStackTrace(error), error.code = key, error;
66
+ };
84
67
  }
85
- __name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
86
68
  function isErrorStackTraceLimitWritable() {
87
69
  try {
88
- if (v8.startupSnapshot.isBuildingSnapshot()) {
89
- return false;
90
- }
70
+ if (v8.startupSnapshot.isBuildingSnapshot()) return !1;
91
71
  } catch {
92
72
  }
93
- const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
94
- if (desc === void 0) {
95
- return Object.isExtensible(Error);
96
- }
97
- return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
73
+ let desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
74
+ return desc === void 0 ? Object.isExtensible(Error) : own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
98
75
  }
99
- __name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
100
76
  function hideStackFrames(wrappedFunction) {
101
- const hidden = nodeInternalPrefix + wrappedFunction.name;
102
- Object.defineProperty(wrappedFunction, "name", { value: hidden });
103
- return wrappedFunction;
77
+ let hidden = nodeInternalPrefix + wrappedFunction.name;
78
+ return Object.defineProperty(wrappedFunction, "name", { value: hidden }), wrappedFunction;
104
79
  }
105
- __name(hideStackFrames, "hideStackFrames");
106
80
  var captureLargerStackTrace = hideStackFrames(function(error) {
107
- const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
108
- if (stackTraceLimitIsWritable) {
109
- userStackTraceLimit = Error.stackTraceLimit;
110
- Error.stackTraceLimit = Number.POSITIVE_INFINITY;
111
- }
112
- Error.captureStackTrace(error);
113
- if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
114
- return error;
81
+ let stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
82
+ return stackTraceLimitIsWritable && (userStackTraceLimit = Error.stackTraceLimit, Error.stackTraceLimit = Number.POSITIVE_INFINITY), Error.captureStackTrace(error), stackTraceLimitIsWritable && (Error.stackTraceLimit = userStackTraceLimit), error;
115
83
  });
116
84
  function getMessage(key, parameters, self) {
117
- const message = messages.get(key);
118
- assert(message !== void 0, "expected `message` to be found");
119
- if (typeof message === "function") {
120
- assert(
121
- message.length <= parameters.length,
122
- // Default options do not count.
123
- `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
124
- );
125
- return Reflect.apply(message, self, parameters);
126
- }
127
- const regex = /%[dfijoOs]/g;
128
- let expectedLength = 0;
129
- while (regex.exec(message) !== null) expectedLength++;
130
- assert(
131
- expectedLength === parameters.length,
132
- `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
133
- );
134
- if (parameters.length === 0) return message;
135
- parameters.unshift(message);
136
- return Reflect.apply(format, null, parameters);
85
+ let message = messages.get(key);
86
+ if (assert.ok(message !== void 0, "expected `message` to be found"), typeof message == "function")
87
+ return assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`), Reflect.apply(message, self, parameters);
88
+ let regex = /%[dfijoOs]/g, expectedLength = 0;
89
+ for (; regex.exec(message) !== null; ) expectedLength++;
90
+ return assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`), parameters.length === 0 ? message : (parameters.unshift(message), Reflect.apply(format, null, parameters));
137
91
  }
138
- __name(getMessage, "getMessage");
139
92
  function determineSpecificType(value) {
140
- if (value === null || value === void 0) {
141
- return String(value);
142
- }
143
- if (typeof value === "function" && value.name) {
144
- return `function ${value.name}`;
145
- }
146
- if (typeof value === "object") {
147
- if (value.constructor && value.constructor.name) {
148
- return `an instance of ${value.constructor.name}`;
149
- }
150
- return `${inspect(value, { depth: -1 })}`;
93
+ if (value == null) return String(value);
94
+ if (typeof value == "function" && value.name) return `function ${value.name}`;
95
+ if (typeof value == "object")
96
+ return value.constructor && value.constructor.name ? `an instance of ${value.constructor.name}` : `${inspect(value, { depth: -1 })}`;
97
+ let inspected = inspect(value, { colors: !1 });
98
+ return inspected.length > 28 && (inspected = `${inspected.slice(0, 25)}...`), `type ${typeof value} (${inspected})`;
99
+ }
100
+ var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
101
+ assert.ok(typeof name == "string", "'name' must be a string"), Array.isArray(expected) || (expected = [expected]);
102
+ let message = "The ";
103
+ if (name.endsWith(" argument")) message += `${name} `;
104
+ else {
105
+ let type = name.includes(".") ? "property" : "argument";
106
+ message += `"${name}" ${type} `;
151
107
  }
152
- let inspected = inspect(value, { colors: false });
153
- if (inspected.length > 28) {
154
- inspected = `${inspected.slice(0, 25)}...`;
108
+ message += "must be ";
109
+ let types = [], instances = [], other = [];
110
+ for (let value of expected)
111
+ assert.ok(typeof value == "string", "All expected entries have to be of type string"), kTypes.has(value) ? types.push(value.toLowerCase()) : classRegExp.exec(value) === null ? (assert.ok(value !== "object", 'The value "object" should be written as "Object"'), other.push(value)) : instances.push(value);
112
+ if (instances.length > 0) {
113
+ let pos = types.indexOf("object");
114
+ pos !== -1 && (types.slice(pos, 1), instances.push("Object"));
155
115
  }
156
- return `type ${typeof value} (${inspected})`;
157
- }
158
- __name(determineSpecificType, "determineSpecificType");
159
- createError(
160
- "ERR_INVALID_ARG_TYPE",
161
- (name, expected, actual) => {
162
- assert(typeof name === "string", "'name' must be a string");
163
- if (!Array.isArray(expected)) {
164
- expected = [expected];
165
- }
166
- let message = "The ";
167
- if (name.endsWith(" argument")) {
168
- message += `${name} `;
169
- } else {
170
- const type = name.includes(".") ? "property" : "argument";
171
- message += `"${name}" ${type} `;
172
- }
173
- message += "must be ";
174
- const types = [];
175
- const instances = [];
176
- const other = [];
177
- for (const value of expected) {
178
- assert(
179
- typeof value === "string",
180
- "All expected entries have to be of type string"
181
- );
182
- if (kTypes.has(value)) {
183
- types.push(value.toLowerCase());
184
- } else if (classRegExp.exec(value) === null) {
185
- assert(
186
- value !== "object",
187
- 'The value "object" should be written as "Object"'
188
- );
189
- other.push(value);
190
- } else {
191
- instances.push(value);
192
- }
193
- }
194
- if (instances.length > 0) {
195
- const pos = types.indexOf("object");
196
- if (pos !== -1) {
197
- types.slice(pos, 1);
198
- instances.push("Object");
199
- }
200
- }
201
- if (types.length > 0) {
202
- message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
203
- types,
204
- "or"
205
- )}`;
206
- if (instances.length > 0 || other.length > 0) message += " or ";
207
- }
208
- if (instances.length > 0) {
209
- message += `an instance of ${formatList(instances, "or")}`;
210
- if (other.length > 0) message += " or ";
211
- }
212
- if (other.length > 0) {
213
- if (other.length > 1) {
214
- message += `one of ${formatList(other, "or")}`;
215
- } else {
216
- if (other[0]?.toLowerCase() !== other[0]) message += "an ";
217
- message += `${other[0]}`;
218
- }
219
- }
220
- message += `. Received ${determineSpecificType(actual)}`;
221
- return message;
222
- },
223
- TypeError
224
- );
225
- var ERR_INVALID_MODULE_SPECIFIER = createError(
116
+ return types.length > 0 && (message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`, (instances.length > 0 || other.length > 0) && (message += " or ")), instances.length > 0 && (message += `an instance of ${formatList(instances, "or")}`, other.length > 0 && (message += " or ")), other.length > 0 && (other.length > 1 ? message += `one of ${formatList(other, "or")}` : (other[0]?.toLowerCase() !== other[0] && (message += "an "), message += `${other[0]}`)), message += `. Received ${determineSpecificType(actual)}`, message;
117
+ }, TypeError), ERR_INVALID_MODULE_SPECIFIER = createError(
226
118
  "ERR_INVALID_MODULE_SPECIFIER",
227
119
  /**
228
- * @param {string} request
229
- * @param {string} reason
230
- * @param {string} [base]
231
- */
232
- (request, reason, base) => {
233
- return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
234
- },
235
- TypeError
236
- );
237
- var ERR_INVALID_PACKAGE_CONFIG = createError(
238
- "ERR_INVALID_PACKAGE_CONFIG",
239
- (path2, base, message) => {
240
- return `Invalid package config ${path2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
241
- },
242
- Error
243
- );
244
- var ERR_INVALID_PACKAGE_TARGET = createError(
245
- "ERR_INVALID_PACKAGE_TARGET",
246
- (packagePath, key, target, isImport = false, base) => {
247
- const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
248
- if (key === ".") {
249
- assert(isImport === false);
250
- return `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
251
- }
252
- return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
253
- target
254
- )} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
255
- },
256
- Error
257
- );
258
- var ERR_MODULE_NOT_FOUND = createError(
259
- "ERR_MODULE_NOT_FOUND",
260
- (path2, base, exactUrl = false) => {
261
- return `Cannot find ${exactUrl ? "module" : "package"} '${path2}' imported from ${base}`;
262
- },
263
- Error
264
- );
265
- createError(
266
- "ERR_NETWORK_IMPORT_DISALLOWED",
267
- "import of '%s' by %s is not supported: %s",
268
- Error
269
- );
270
- var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
271
- "ERR_PACKAGE_IMPORT_NOT_DEFINED",
272
- (specifier, packagePath, base) => {
273
- return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
274
- },
120
+ * @param {string} request
121
+ * @param {string} reason
122
+ * @param {string} [base]
123
+ */
124
+ (request, reason, base) => `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`,
275
125
  TypeError
276
- );
277
- var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
126
+ ), ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`, Error), ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = !1, base) => {
127
+ let relatedError = typeof target == "string" && !isImport && target.length > 0 && !target.startsWith("./");
128
+ return key === "." ? (assert.ok(isImport === !1), `Invalid "exports" main target ${JSON.stringify(target)} defined in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`) : `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(target)} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
129
+ }, Error), ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = !1) => `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`, Error), ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error), ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`, TypeError), ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
278
130
  "ERR_PACKAGE_PATH_NOT_EXPORTED",
279
131
  /**
280
- * @param {string} packagePath
281
- * @param {string} subpath
282
- * @param {string} [base]
283
- */
284
- (packagePath, subpath, base) => {
285
- if (subpath === ".")
286
- return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
287
- return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
288
- },
132
+ * @param {string} packagePath
133
+ * @param {string} subpath
134
+ * @param {string} [base]
135
+ */
136
+ (packagePath, subpath, base) => subpath === "." ? `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}` : `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`,
289
137
  Error
290
- );
291
- var ERR_UNSUPPORTED_DIR_IMPORT = createError(
292
- "ERR_UNSUPPORTED_DIR_IMPORT",
293
- "Directory import '%s' is not supported resolving ES modules imported from %s",
294
- Error
295
- );
296
- var ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
297
- "ERR_UNSUPPORTED_RESOLVE_REQUEST",
298
- 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
299
- TypeError
300
- );
301
- var ERR_UNKNOWN_FILE_EXTENSION = createError(
302
- "ERR_UNKNOWN_FILE_EXTENSION",
303
- (extension, path2) => {
304
- return `Unknown file extension "${extension}" for ${path2}`;
305
- },
306
- TypeError
307
- );
308
- createError(
309
- "ERR_INVALID_ARG_VALUE",
310
- (name, value, reason = "is invalid") => {
311
- let inspected = inspect(value);
312
- if (inspected.length > 128) {
313
- inspected = `${inspected.slice(0, 128)}...`;
314
- }
315
- const type = name.includes(".") ? "property" : "argument";
316
- return `The ${type} '${name}' ${reason}. Received ${inspected}`;
317
- },
318
- TypeError
319
- // Note: extra classes have been shaken out.
320
- // , RangeError
321
- );
322
- var hasOwnProperty$1 = {}.hasOwnProperty;
138
+ ), ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error), ERR_UNSUPPORTED_RESOLVE_REQUEST = createError("ERR_UNSUPPORTED_RESOLVE_REQUEST", 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.', TypeError), ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => `Unknown file extension "${extension}" for ${path$1}`, TypeError), ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
139
+ let inspected = inspect(value);
140
+ return inspected.length > 128 && (inspected = `${inspected.slice(0, 128)}...`), `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
141
+ }, TypeError), hasOwnProperty$1 = {}.hasOwnProperty;
323
142
  var hasOwnProperty = {}.hasOwnProperty;
324
- var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
325
- var own = {}.hasOwnProperty;
326
- var isWindows = (() => process.platform === "win32")();
327
- var globalCache = (() => (
328
- // eslint-disable-next-line unicorn/no-unreadable-iife
329
- globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map()
330
- ))();
143
+ var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace], own = {}.hasOwnProperty;
144
+ var isWindows = process.platform === "win32", globalCache = globalThis.__EXSOLVE_CACHE__ ||= /* @__PURE__ */ new Map();
331
145
 
332
146
  // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
333
147
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
334
148
  function normalizeWindowsPath(input = "") {
335
- if (!input) {
336
- return input;
337
- }
338
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
149
+ return input && input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
339
150
  }
340
- __name(normalizeWindowsPath, "normalizeWindowsPath");
341
- var _UNC_REGEX = /^[/\\]{2}/;
342
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
343
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
344
- var normalize = /* @__PURE__ */ __name(function(path2) {
345
- if (path2.length === 0) {
151
+ var _UNC_REGEX = /^[/\\]{2}/, _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/, _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
152
+ var normalize = function(path2) {
153
+ if (path2.length === 0)
346
154
  return ".";
347
- }
348
155
  path2 = normalizeWindowsPath(path2);
349
- const isUNCPath = path2.match(_UNC_REGEX);
350
- const isPathAbsolute = isAbsolute(path2);
351
- const trailingSeparator = path2[path2.length - 1] === "/";
352
- path2 = normalizeString(path2, !isPathAbsolute);
353
- if (path2.length === 0) {
354
- if (isPathAbsolute) {
355
- return "/";
356
- }
357
- return trailingSeparator ? "./" : ".";
358
- }
359
- if (trailingSeparator) {
360
- path2 += "/";
361
- }
362
- if (_DRIVE_LETTER_RE.test(path2)) {
363
- path2 += "/";
364
- }
365
- if (isUNCPath) {
366
- if (!isPathAbsolute) {
367
- return `//./${path2}`;
368
- }
369
- return `//${path2}`;
370
- }
371
- return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
372
- }, "normalize");
373
- var join = /* @__PURE__ */ __name(function(...arguments_) {
374
- if (arguments_.length === 0) {
156
+ let isUNCPath = path2.match(_UNC_REGEX), isPathAbsolute = isAbsolute(path2), trailingSeparator = path2[path2.length - 1] === "/";
157
+ return path2 = normalizeString(path2, !isPathAbsolute), path2.length === 0 ? isPathAbsolute ? "/" : trailingSeparator ? "./" : "." : (trailingSeparator && (path2 += "/"), _DRIVE_LETTER_RE.test(path2) && (path2 += "/"), isUNCPath ? isPathAbsolute ? `//${path2}` : `//./${path2}` : isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2);
158
+ }, join = function(...arguments_) {
159
+ if (arguments_.length === 0)
375
160
  return ".";
376
- }
377
161
  let joined;
378
- for (const argument of arguments_) {
379
- if (argument && argument.length > 0) {
380
- if (joined === void 0) {
381
- joined = argument;
382
- } else {
383
- joined += `/${argument}`;
384
- }
385
- }
386
- }
387
- if (joined === void 0) {
388
- return ".";
389
- }
390
- return normalize(joined.replace(/\/\/+/g, "/"));
391
- }, "join");
162
+ for (let argument of arguments_)
163
+ argument && argument.length > 0 && (joined === void 0 ? joined = argument : joined += `/${argument}`);
164
+ return joined === void 0 ? "." : normalize(joined.replace(/\/\/+/g, "/"));
165
+ };
392
166
  function normalizeString(path2, allowAboveRoot) {
393
- let res = "";
394
- let lastSegmentLength = 0;
395
- let lastSlash = -1;
396
- let dots = 0;
397
- let char = null;
167
+ let res = "", lastSegmentLength = 0, lastSlash = -1, dots = 0, char = null;
398
168
  for (let index = 0; index <= path2.length; ++index) {
399
- if (index < path2.length) {
169
+ if (index < path2.length)
400
170
  char = path2[index];
401
- } else if (char === "/") {
402
- break;
403
- } else {
171
+ else {
172
+ if (char === "/")
173
+ break;
404
174
  char = "/";
405
175
  }
406
176
  if (char === "/") {
407
- if (lastSlash === index - 1 || dots === 1) ;
408
- else if (dots === 2) {
177
+ if (!(lastSlash === index - 1 || dots === 1)) if (dots === 2) {
409
178
  if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
410
179
  if (res.length > 2) {
411
- const lastSlashIndex = res.lastIndexOf("/");
412
- if (lastSlashIndex === -1) {
413
- res = "";
414
- lastSegmentLength = 0;
415
- } else {
416
- res = res.slice(0, lastSlashIndex);
417
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
418
- }
419
- lastSlash = index;
420
- dots = 0;
180
+ let lastSlashIndex = res.lastIndexOf("/");
181
+ lastSlashIndex === -1 ? (res = "", lastSegmentLength = 0) : (res = res.slice(0, lastSlashIndex), lastSegmentLength = res.length - 1 - res.lastIndexOf("/")), lastSlash = index, dots = 0;
421
182
  continue;
422
183
  } else if (res.length > 0) {
423
- res = "";
424
- lastSegmentLength = 0;
425
- lastSlash = index;
426
- dots = 0;
184
+ res = "", lastSegmentLength = 0, lastSlash = index, dots = 0;
427
185
  continue;
428
186
  }
429
187
  }
430
- if (allowAboveRoot) {
431
- res += res.length > 0 ? "/.." : "..";
432
- lastSegmentLength = 2;
433
- }
434
- } else {
435
- if (res.length > 0) {
436
- res += `/${path2.slice(lastSlash + 1, index)}`;
437
- } else {
438
- res = path2.slice(lastSlash + 1, index);
439
- }
440
- lastSegmentLength = index - lastSlash - 1;
441
- }
442
- lastSlash = index;
443
- dots = 0;
444
- } else if (char === "." && dots !== -1) {
445
- ++dots;
446
- } else {
447
- dots = -1;
448
- }
188
+ allowAboveRoot && (res += res.length > 0 ? "/.." : "..", lastSegmentLength = 2);
189
+ } else
190
+ res.length > 0 ? res += `/${path2.slice(lastSlash + 1, index)}` : res = path2.slice(lastSlash + 1, index), lastSegmentLength = index - lastSlash - 1;
191
+ lastSlash = index, dots = 0;
192
+ } else char === "." && dots !== -1 ? ++dots : dots = -1;
449
193
  }
450
194
  return res;
451
195
  }
452
- __name(normalizeString, "normalizeString");
453
- var isAbsolute = /* @__PURE__ */ __name(function(p) {
196
+ var isAbsolute = function(p) {
454
197
  return _IS_ABSOLUTE_RE.test(p);
455
- }, "isAbsolute");
456
- var dirname = /* @__PURE__ */ __name(function(p) {
457
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
458
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
459
- segments[0] += "/";
460
- }
461
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
462
- }, "dirname");
198
+ };
199
+ var dirname = function(p) {
200
+ let segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
201
+ return segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0]) && (segments[0] += "/"), segments.join("/") || (isAbsolute(p) ? "/" : ".");
202
+ };
463
203
 
464
204
  // ../../core/src/shared/utils/module.ts
465
- var importMetaResolve = /* @__PURE__ */ __name((...args) => {
466
- if (typeof import.meta.resolve !== "function" && process.env.VITEST === "true") {
467
- console.warn(
468
- "importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
469
- );
470
- return pathToFileURL(args[0]).href;
205
+ var importMetaResolve = (...args) => typeof import.meta.resolve != "function" && process.env.VITEST === "true" ? (console.warn(
206
+ "importMetaResolve from within Storybook is being used in a Vitest test, but it shouldn't be. Please report this at https://github.com/storybookjs/storybook/issues/new?template=bug_report.yml"
207
+ ), pathToFileURL(args[0]).href) : import.meta.resolve(...args), resolvePackageDir = (pkg, parent) => {
208
+ try {
209
+ return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
210
+ } catch {
211
+ return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"))));
471
212
  }
472
- return import.meta.resolve(...args);
473
- }, "importMetaResolve");
474
- var resolvePackageDir = /* @__PURE__ */ __name((pkg, parent) => {
475
- return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
476
- }, "resolvePackageDir");
213
+ };
477
214
 
478
215
  // src/preset.ts
479
- var getResolvedReact = /* @__PURE__ */ __name(async (options) => {
480
- const resolvedReact2 = await options.presets.apply("resolvedReact", {});
216
+ var getResolvedReact = async (options) => {
217
+ let resolvedReact2 = await options.presets.apply("resolvedReact", {});
481
218
  return {
482
219
  react: resolvedReact2.react ?? resolvePackageDir("react"),
483
220
  reactDom: resolvedReact2.reactDom ?? resolvePackageDir("react-dom"),
@@ -488,14 +225,9 @@ var getResolvedReact = /* @__PURE__ */ __name(async (options) => {
488
225
  // Explicitly alias @mdx-js/react to avoid this issue.
489
226
  mdx: resolvedReact2.mdx ?? fileURLToPath2(import.meta.resolve("@mdx-js/react"))
490
227
  };
491
- }, "getResolvedReact");
228
+ };
492
229
  async function webpack(webpackConfig = {}, options) {
493
- const { module = {} } = webpackConfig;
494
- const { csfPluginOptions = {}, mdxPluginOptions = {} } = options;
495
- const enrichCsf = await options.presets.apply("experimental_enrichCsf");
496
- const rehypeSlug = (await import("./_node-chunks/rehype-slug-NIZ5EZAF.js")).default;
497
- const rehypeExternalLinks = (await import("./_node-chunks/rehype-external-links-AGP76D2N.js")).default;
498
- const mdxLoaderOptions = await options.presets.apply("mdxLoaderOptions", {
230
+ let { module = {} } = webpackConfig, { csfPluginOptions = {}, mdxPluginOptions = {} } = options, enrichCsf = await options.presets.apply("experimental_enrichCsf"), rehypeSlug = (await import("./_node-chunks/rehype-slug-U5W6TP4H.js")).default, rehypeExternalLinks = (await import("./_node-chunks/rehype-external-links-V2D4HT5U.js")).default, mdxLoaderOptions = await options.presets.apply("mdxLoaderOptions", {
499
231
  ...mdxPluginOptions,
500
232
  mdxCompileOptions: {
501
233
  providerImportSource: import.meta.resolve("@storybook/addon-docs/mdx-react-shim"),
@@ -507,34 +239,27 @@ async function webpack(webpackConfig = {}, options) {
507
239
  ]
508
240
  }
509
241
  });
510
- logger.info(`Addon-docs: using MDX3`);
511
- const { react, reactDom, mdx } = await getResolvedReact(options);
512
- let alias;
513
- if (Array.isArray(webpackConfig.resolve?.alias)) {
514
- alias = [...webpackConfig.resolve?.alias];
515
- alias.push(
516
- {
517
- name: "react",
518
- alias: react
519
- },
520
- {
521
- name: "react-dom",
522
- alias: reactDom
523
- },
524
- {
525
- name: "@mdx-js/react",
526
- alias: mdx
527
- }
528
- );
529
- } else {
530
- alias = {
531
- ...webpackConfig.resolve?.alias,
532
- react,
533
- "react-dom": reactDom,
534
- "@mdx-js/react": mdx
535
- };
536
- }
537
- const result = {
242
+ logger.info("Addon-docs: using MDX3");
243
+ let { react, reactDom, mdx } = await getResolvedReact(options), alias;
244
+ return Array.isArray(webpackConfig.resolve?.alias) ? (alias = [...webpackConfig.resolve?.alias], alias.push(
245
+ {
246
+ name: "react",
247
+ alias: react
248
+ },
249
+ {
250
+ name: "react-dom",
251
+ alias: reactDom
252
+ },
253
+ {
254
+ name: "@mdx-js/react",
255
+ alias: mdx
256
+ }
257
+ )) : alias = {
258
+ ...webpackConfig.resolve?.alias,
259
+ react,
260
+ "react-dom": reactDom,
261
+ "@mdx-js/react": mdx
262
+ }, {
538
263
  ...webpackConfig,
539
264
  plugins: [
540
265
  ...webpackConfig.plugins || [],
@@ -566,34 +291,22 @@ async function webpack(webpackConfig = {}, options) {
566
291
  ]
567
292
  }
568
293
  };
569
- return result;
570
294
  }
571
- __name(webpack, "webpack");
572
- var docs = /* @__PURE__ */ __name((input = {}, options) => {
573
- if (options?.build?.test?.disableAutoDocs) {
574
- return void 0;
575
- }
576
- const result = {
295
+ var docs = (input = {}, options) => {
296
+ if (options?.build?.test?.disableAutoDocs)
297
+ return;
298
+ let result = {
577
299
  ...input,
578
300
  defaultName: "Docs"
579
- };
580
- const docsMode = options.docs;
581
- if (docsMode) {
582
- result.docsMode = docsMode;
583
- }
584
- return result;
585
- }, "docs");
586
- var addons = [
301
+ }, docsMode = options.docs;
302
+ return docsMode && (result.docsMode = docsMode), result;
303
+ }, addons = [
587
304
  import.meta.resolve("@storybook/react-dom-shim/preset")
588
- ];
589
- var viteFinal = /* @__PURE__ */ __name(async (config, options) => {
590
- const { plugins = [] } = config;
591
- const { mdxPlugin } = await import("./_node-chunks/mdx-plugin-36DJJXJE.js");
592
- const { react, reactDom, mdx } = await getResolvedReact(options);
593
- const packageDeduplicationPlugin = {
305
+ ], viteFinal = async (config, options) => {
306
+ let { plugins = [] } = config, { mdxPlugin } = await import("./_node-chunks/mdx-plugin-NLBBLG32.js"), { react, reactDom, mdx } = await getResolvedReact(options), packageDeduplicationPlugin = {
594
307
  name: "storybook:package-deduplication",
595
308
  enforce: "pre",
596
- config: /* @__PURE__ */ __name(() => ({
309
+ config: () => ({
597
310
  resolve: {
598
311
  alias: {
599
312
  react,
@@ -603,23 +316,17 @@ var viteFinal = /* @__PURE__ */ __name(async (config, options) => {
603
316
  "@mdx-js/react": mdx
604
317
  }
605
318
  }
606
- }), "config")
319
+ })
607
320
  };
608
- plugins.unshift(packageDeduplicationPlugin);
609
- plugins.unshift(mdxPlugin(options));
610
- return {
321
+ return plugins.unshift(packageDeduplicationPlugin), plugins.unshift(mdxPlugin(options)), {
611
322
  ...config,
612
323
  plugins
613
324
  };
614
- }, "viteFinal");
615
- var webpackX = webpack;
616
- var docsX = docs;
617
- var resolvedReact = /* @__PURE__ */ __name(async (existing) => ({
325
+ }, webpackX = webpack, docsX = docs, resolvedReact = async (existing) => ({
618
326
  react: existing?.react ?? resolvePackageDir("react"),
619
327
  reactDom: existing?.reactDom ?? resolvePackageDir("react-dom"),
620
328
  mdx: existing?.mdx ?? fileURLToPath2(import.meta.resolve("@mdx-js/react"))
621
- }), "resolvedReact");
622
- var optimizeViteDeps = [
329
+ }), optimizeViteDeps = [
623
330
  "@storybook/addon-docs",
624
331
  "@storybook/addon-docs/blocks",
625
332
  "@storybook/addon-docs > @mdx-js/react"