@storybook/addon-docs 10.0.0-beta.7 → 10.0.0-beta.9

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.
@@ -1,22 +1,22 @@
1
- import CJS_COMPAT_NODE_URL_kvlic0uo7yf from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_kvlic0uo7yf from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_kvlic0uo7yf from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uj1zxsdtbs from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uj1zxsdtbs from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uj1zxsdtbs from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_kvlic0uo7yf.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_kvlic0uo7yf.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_kvlic0uo7yf.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uj1zxsdtbs.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uj1zxsdtbs.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uj1zxsdtbs.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  compile
14
- } from "./_node-chunks/chunk-PZ25TROW.js";
15
- import "./_node-chunks/chunk-YXA7CFIU.js";
16
- import "./_node-chunks/chunk-AGJIZPPI.js";
14
+ } from "./_node-chunks/chunk-SEJXNLHB.js";
15
+ import "./_node-chunks/chunk-2YHJMB7H.js";
16
+ import "./_node-chunks/chunk-6XMJ37FG.js";
17
17
  import {
18
18
  __name
19
- } from "./_node-chunks/chunk-ZWB5EL6N.js";
19
+ } from "./_node-chunks/chunk-TK7GSIWM.js";
20
20
 
21
21
  // src/mdx-loader.ts
22
22
  var DEFAULT_RENDERER = `
package/dist/preset.js CHANGED
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_kvlic0uo7yf from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_kvlic0uo7yf from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_kvlic0uo7yf from "node:module";
1
+ import CJS_COMPAT_NODE_URL_uj1zxsdtbs from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_uj1zxsdtbs from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_uj1zxsdtbs from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_kvlic0uo7yf.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_kvlic0uo7yf.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_kvlic0uo7yf.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_uj1zxsdtbs.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_uj1zxsdtbs.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_uj1zxsdtbs.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
11
  // ------------------------------------------------------------
12
12
  import {
13
13
  __name
14
- } from "./_node-chunks/chunk-ZWB5EL6N.js";
14
+ } from "./_node-chunks/chunk-TK7GSIWM.js";
15
15
 
16
16
  // src/preset.ts
17
17
  import { isAbsolute as isAbsolute2 } from "node:path";
@@ -21,6 +21,314 @@ import { logger } from "storybook/internal/node-logger";
21
21
  // ../../core/src/shared/utils/module.ts
22
22
  import { fileURLToPath, pathToFileURL } from "node:url";
23
23
 
24
+ // ../../node_modules/exsolve/dist/index.mjs
25
+ import assert from "node:assert";
26
+ import v8 from "node:v8";
27
+ 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([
31
+ "string",
32
+ "function",
33
+ "number",
34
+ "object",
35
+ // Accept 'Function' and 'Object' as alternative to the lower cased version.
36
+ "Function",
37
+ "Object",
38
+ "boolean",
39
+ "bigint",
40
+ "symbol"
41
+ ]);
42
+ var messages = /* @__PURE__ */ new Map();
43
+ var nodeInternalPrefix = "__node_internal_";
44
+ var userStackTraceLimit;
45
+ function formatList(array, type = "and") {
46
+ return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
47
+ }
48
+ __name(formatList, "formatList");
49
+ function createError(sym, value, constructor) {
50
+ messages.set(sym, value);
51
+ return makeNodeErrorWithCode(constructor, sym);
52
+ }
53
+ __name(createError, "createError");
54
+ 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.
64
+ message: {
65
+ value: message,
66
+ enumerable: false,
67
+ writable: true,
68
+ configurable: true
69
+ },
70
+ toString: {
71
+ /** @this {Error} */
72
+ value() {
73
+ return `${this.name} [${key}]: ${this.message}`;
74
+ },
75
+ enumerable: false,
76
+ writable: true,
77
+ configurable: true
78
+ }
79
+ });
80
+ captureLargerStackTrace(error);
81
+ error.code = key;
82
+ return error;
83
+ }, "NodeError");
84
+ }
85
+ __name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
86
+ function isErrorStackTraceLimitWritable() {
87
+ try {
88
+ if (v8.startupSnapshot.isBuildingSnapshot()) {
89
+ return false;
90
+ }
91
+ } catch {
92
+ }
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;
98
+ }
99
+ __name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
100
+ function hideStackFrames(wrappedFunction) {
101
+ const hidden = nodeInternalPrefix + wrappedFunction.name;
102
+ Object.defineProperty(wrappedFunction, "name", { value: hidden });
103
+ return wrappedFunction;
104
+ }
105
+ __name(hideStackFrames, "hideStackFrames");
106
+ 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;
115
+ });
116
+ 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);
137
+ }
138
+ __name(getMessage, "getMessage");
139
+ 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 })}`;
151
+ }
152
+ let inspected = inspect(value, { colors: false });
153
+ if (inspected.length > 28) {
154
+ inspected = `${inspected.slice(0, 25)}...`;
155
+ }
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(
226
+ "ERR_INVALID_MODULE_SPECIFIER",
227
+ /**
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
+ },
275
+ TypeError
276
+ );
277
+ var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
278
+ "ERR_PACKAGE_PATH_NOT_EXPORTED",
279
+ /**
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
+ },
289
+ 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;
323
+ 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
+ ))();
331
+
24
332
  // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
25
333
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
26
334
  function normalizeWindowsPath(input = "") {
@@ -184,8 +492,8 @@ var getResolvedReact = /* @__PURE__ */ __name(async (options) => {
184
492
  async function webpack(webpackConfig = {}, options) {
185
493
  const { module = {} } = webpackConfig;
186
494
  const { csfPluginOptions = {}, mdxPluginOptions = {} } = options;
187
- const rehypeSlug = (await import("./_node-chunks/rehype-slug-UITIK4GV.js")).default;
188
- const rehypeExternalLinks = (await import("./_node-chunks/rehype-external-links-46MRPJIG.js")).default;
495
+ const rehypeSlug = (await import("./_node-chunks/rehype-slug-RYEH6YUH.js")).default;
496
+ const rehypeExternalLinks = (await import("./_node-chunks/rehype-external-links-KTKDCKPP.js")).default;
189
497
  const mdxLoaderOptions = await options.presets.apply("mdxLoaderOptions", {
190
498
  ...mdxPluginOptions,
191
499
  mdxCompileOptions: {
@@ -274,7 +582,7 @@ var addons = [
274
582
  ];
275
583
  var viteFinal = /* @__PURE__ */ __name(async (config, options) => {
276
584
  const { plugins = [] } = config;
277
- const { mdxPlugin } = await import("./_node-chunks/mdx-plugin-YI33UEWL.js");
585
+ const { mdxPlugin } = await import("./_node-chunks/mdx-plugin-3MRBPP7E.js");
278
586
  const { react, reactDom, mdx } = await getResolvedReact(options);
279
587
  const packageDeduplicationPlugin = {
280
588
  name: "storybook:package-deduplication",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/addon-docs",
3
- "version": "10.0.0-beta.7",
3
+ "version": "10.0.0-beta.9",
4
4
  "description": "Storybook Docs: Document UI components automatically with stories and MDX",
5
5
  "keywords": [
6
6
  "docs",
@@ -84,9 +84,9 @@
84
84
  },
85
85
  "dependencies": {
86
86
  "@mdx-js/react": "^3.0.0",
87
- "@storybook/csf-plugin": "10.0.0-beta.7",
87
+ "@storybook/csf-plugin": "10.0.0-beta.9",
88
88
  "@storybook/icons": "^1.6.0",
89
- "@storybook/react-dom-shim": "10.0.0-beta.7",
89
+ "@storybook/react-dom-shim": "10.0.0-beta.9",
90
90
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
91
91
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
92
92
  "ts-dedent": "^2.0.0"
@@ -113,7 +113,7 @@
113
113
  "vite": "^7.0.4"
114
114
  },
115
115
  "peerDependencies": {
116
- "storybook": "^10.0.0-beta.7"
116
+ "storybook": "^10.0.0-beta.9"
117
117
  },
118
118
  "publishConfig": {
119
119
  "access": "public"