@storybook/react 10.0.6 → 10.0.8

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 (2) hide show
  1. package/dist/preset.js +96 -188
  2. package/package.json +4 -4
package/dist/preset.js CHANGED
@@ -1,10 +1,10 @@
1
- import CJS_COMPAT_NODE_URL_10nq7sgkz42 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_10nq7sgkz42 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_10nq7sgkz42 from "node:module";
1
+ import CJS_COMPAT_NODE_URL_6wxet4m1w7e from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_6wxet4m1w7e from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_6wxet4m1w7e from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_10nq7sgkz42.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_10nq7sgkz42.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_10nq7sgkz42.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_6wxet4m1w7e.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_6wxet4m1w7e.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_6wxet4m1w7e.createRequire(import.meta.url);
8
8
 
9
9
  // ------------------------------------------------------------
10
10
  // end of CJS compatibility banner, injected by Storybook's esbuild configuration
@@ -29,7 +29,6 @@ var kTypes = /* @__PURE__ */ new Set([
29
29
  "function",
30
30
  "number",
31
31
  "object",
32
- // Accept 'Function' and 'Object' as alternative to the lower cased version.
33
32
  "Function",
34
33
  "Object",
35
34
  "boolean",
@@ -56,8 +55,6 @@ function makeNodeErrorWithCode(Base, key) {
56
55
  if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
57
56
  const message = getMessage(key, parameters, error);
58
57
  Object.defineProperties(error, {
59
- // Note: no need to implement `kIsNodeError` symbol, would be hard,
60
- // probably.
61
58
  message: {
62
59
  value: message,
63
60
  enumerable: false,
@@ -65,7 +62,6 @@ function makeNodeErrorWithCode(Base, key) {
65
62
  configurable: true
66
63
  },
67
64
  toString: {
68
- /** @this {Error} */
69
65
  value() {
70
66
  return `${this.name} [${key}]: ${this.message}`;
71
67
  },
@@ -82,15 +78,11 @@ function makeNodeErrorWithCode(Base, key) {
82
78
  __name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
83
79
  function isErrorStackTraceLimitWritable() {
84
80
  try {
85
- if (v8.startupSnapshot.isBuildingSnapshot()) {
86
- return false;
87
- }
81
+ if (v8.startupSnapshot.isBuildingSnapshot()) return false;
88
82
  } catch {
89
83
  }
90
84
  const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
91
- if (desc === void 0) {
92
- return Object.isExtensible(Error);
93
- }
85
+ if (desc === void 0) return Object.isExtensible(Error);
94
86
  return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
95
87
  }
96
88
  __name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
@@ -112,219 +104,135 @@ var captureLargerStackTrace = hideStackFrames(function(error) {
112
104
  });
113
105
  function getMessage(key, parameters, self) {
114
106
  const message = messages.get(key);
115
- assert(message !== void 0, "expected `message` to be found");
107
+ assert.ok(message !== void 0, "expected `message` to be found");
116
108
  if (typeof message === "function") {
117
- assert(
118
- message.length <= parameters.length,
119
- // Default options do not count.
120
- `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
121
- );
109
+ assert.ok(message.length <= parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`);
122
110
  return Reflect.apply(message, self, parameters);
123
111
  }
124
112
  const regex = /%[dfijoOs]/g;
125
113
  let expectedLength = 0;
126
114
  while (regex.exec(message) !== null) expectedLength++;
127
- assert(
128
- expectedLength === parameters.length,
129
- `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
130
- );
115
+ assert.ok(expectedLength === parameters.length, `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`);
131
116
  if (parameters.length === 0) return message;
132
117
  parameters.unshift(message);
133
118
  return Reflect.apply(format, null, parameters);
134
119
  }
135
120
  __name(getMessage, "getMessage");
136
121
  function determineSpecificType(value) {
137
- if (value === null || value === void 0) {
138
- return String(value);
139
- }
140
- if (typeof value === "function" && value.name) {
141
- return `function ${value.name}`;
142
- }
122
+ if (value === null || value === void 0) return String(value);
123
+ if (typeof value === "function" && value.name) return `function ${value.name}`;
143
124
  if (typeof value === "object") {
144
- if (value.constructor && value.constructor.name) {
145
- return `an instance of ${value.constructor.name}`;
146
- }
125
+ if (value.constructor && value.constructor.name) return `an instance of ${value.constructor.name}`;
147
126
  return `${inspect(value, { depth: -1 })}`;
148
127
  }
149
128
  let inspected = inspect(value, { colors: false });
150
- if (inspected.length > 28) {
151
- inspected = `${inspected.slice(0, 25)}...`;
152
- }
129
+ if (inspected.length > 28) inspected = `${inspected.slice(0, 25)}...`;
153
130
  return `type ${typeof value} (${inspected})`;
154
131
  }
155
132
  __name(determineSpecificType, "determineSpecificType");
156
- createError(
157
- "ERR_INVALID_ARG_TYPE",
158
- (name, expected, actual) => {
159
- assert(typeof name === "string", "'name' must be a string");
160
- if (!Array.isArray(expected)) {
161
- expected = [expected];
162
- }
163
- let message = "The ";
164
- if (name.endsWith(" argument")) {
165
- message += `${name} `;
166
- } else {
167
- const type = name.includes(".") ? "property" : "argument";
168
- message += `"${name}" ${type} `;
169
- }
170
- message += "must be ";
171
- const types = [];
172
- const instances = [];
173
- const other = [];
174
- for (const value of expected) {
175
- assert(
176
- typeof value === "string",
177
- "All expected entries have to be of type string"
178
- );
179
- if (kTypes.has(value)) {
180
- types.push(value.toLowerCase());
181
- } else if (classRegExp.exec(value) === null) {
182
- assert(
183
- value !== "object",
184
- 'The value "object" should be written as "Object"'
185
- );
186
- other.push(value);
187
- } else {
188
- instances.push(value);
189
- }
190
- }
191
- if (instances.length > 0) {
192
- const pos = types.indexOf("object");
193
- if (pos !== -1) {
194
- types.slice(pos, 1);
195
- instances.push("Object");
196
- }
197
- }
198
- if (types.length > 0) {
199
- message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
200
- types,
201
- "or"
202
- )}`;
203
- if (instances.length > 0 || other.length > 0) message += " or ";
204
- }
205
- if (instances.length > 0) {
206
- message += `an instance of ${formatList(instances, "or")}`;
207
- if (other.length > 0) message += " or ";
208
- }
209
- if (other.length > 0) {
210
- if (other.length > 1) {
211
- message += `one of ${formatList(other, "or")}`;
212
- } else {
213
- if (other[0]?.toLowerCase() !== other[0]) message += "an ";
214
- message += `${other[0]}`;
215
- }
133
+ var ERR_INVALID_ARG_TYPE = createError("ERR_INVALID_ARG_TYPE", (name, expected, actual) => {
134
+ assert.ok(typeof name === "string", "'name' must be a string");
135
+ if (!Array.isArray(expected)) expected = [expected];
136
+ let message = "The ";
137
+ if (name.endsWith(" argument")) message += `${name} `;
138
+ else {
139
+ const type = name.includes(".") ? "property" : "argument";
140
+ message += `"${name}" ${type} `;
141
+ }
142
+ message += "must be ";
143
+ const types = [];
144
+ const instances = [];
145
+ const other = [];
146
+ for (const value of expected) {
147
+ assert.ok(typeof value === "string", "All expected entries have to be of type string");
148
+ if (kTypes.has(value)) types.push(value.toLowerCase());
149
+ else if (classRegExp.exec(value) === null) {
150
+ assert.ok(value !== "object", 'The value "object" should be written as "Object"');
151
+ other.push(value);
152
+ } else instances.push(value);
153
+ }
154
+ if (instances.length > 0) {
155
+ const pos = types.indexOf("object");
156
+ if (pos !== -1) {
157
+ types.slice(pos, 1);
158
+ instances.push("Object");
216
159
  }
217
- message += `. Received ${determineSpecificType(actual)}`;
218
- return message;
219
- },
220
- TypeError
221
- );
160
+ }
161
+ if (types.length > 0) {
162
+ message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(types, "or")}`;
163
+ if (instances.length > 0 || other.length > 0) message += " or ";
164
+ }
165
+ if (instances.length > 0) {
166
+ message += `an instance of ${formatList(instances, "or")}`;
167
+ if (other.length > 0) message += " or ";
168
+ }
169
+ if (other.length > 0) if (other.length > 1) message += `one of ${formatList(other, "or")}`;
170
+ else {
171
+ if (other[0]?.toLowerCase() !== other[0]) message += "an ";
172
+ message += `${other[0]}`;
173
+ }
174
+ message += `. Received ${determineSpecificType(actual)}`;
175
+ return message;
176
+ }, TypeError);
222
177
  var ERR_INVALID_MODULE_SPECIFIER = createError(
223
178
  "ERR_INVALID_MODULE_SPECIFIER",
224
179
  /**
225
- * @param {string} request
226
- * @param {string} reason
227
- * @param {string} [base]
228
- */
180
+ * @param {string} request
181
+ * @param {string} reason
182
+ * @param {string} [base]
183
+ */
229
184
  (request, reason, base) => {
230
185
  return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
231
186
  },
232
187
  TypeError
233
188
  );
234
- var ERR_INVALID_PACKAGE_CONFIG = createError(
235
- "ERR_INVALID_PACKAGE_CONFIG",
236
- (path2, base, message) => {
237
- return `Invalid package config ${path2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
238
- },
239
- Error
240
- );
241
- var ERR_INVALID_PACKAGE_TARGET = createError(
242
- "ERR_INVALID_PACKAGE_TARGET",
243
- (packagePath, key, target, isImport = false, base) => {
244
- const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
245
- if (key === ".") {
246
- assert(isImport === false);
247
- 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 "./"' : ""}`;
248
- }
249
- return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
250
- target
251
- )} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
252
- },
253
- Error
254
- );
255
- var ERR_MODULE_NOT_FOUND = createError(
256
- "ERR_MODULE_NOT_FOUND",
257
- (path2, base, exactUrl = false) => {
258
- return `Cannot find ${exactUrl ? "module" : "package"} '${path2}' imported from ${base}`;
259
- },
260
- Error
261
- );
262
- createError(
263
- "ERR_NETWORK_IMPORT_DISALLOWED",
264
- "import of '%s' by %s is not supported: %s",
265
- Error
266
- );
267
- var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
268
- "ERR_PACKAGE_IMPORT_NOT_DEFINED",
269
- (specifier, packagePath, base) => {
270
- return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
271
- },
272
- TypeError
273
- );
189
+ var ERR_INVALID_PACKAGE_CONFIG = createError("ERR_INVALID_PACKAGE_CONFIG", (path$1, base, message) => {
190
+ return `Invalid package config ${path$1}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
191
+ }, Error);
192
+ var ERR_INVALID_PACKAGE_TARGET = createError("ERR_INVALID_PACKAGE_TARGET", (packagePath, key, target, isImport = false, base) => {
193
+ const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
194
+ if (key === ".") {
195
+ assert.ok(isImport === false);
196
+ 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 "./"' : ""}`;
197
+ }
198
+ return `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 "./"' : ""}`;
199
+ }, Error);
200
+ var ERR_MODULE_NOT_FOUND = createError("ERR_MODULE_NOT_FOUND", (path$1, base, exactUrl = false) => {
201
+ return `Cannot find ${exactUrl ? "module" : "package"} '${path$1}' imported from ${base}`;
202
+ }, Error);
203
+ var ERR_NETWORK_IMPORT_DISALLOWED = createError("ERR_NETWORK_IMPORT_DISALLOWED", "import of '%s' by %s is not supported: %s", Error);
204
+ var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError("ERR_PACKAGE_IMPORT_NOT_DEFINED", (specifier, packagePath, base) => {
205
+ return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
206
+ }, TypeError);
274
207
  var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
275
208
  "ERR_PACKAGE_PATH_NOT_EXPORTED",
276
209
  /**
277
- * @param {string} packagePath
278
- * @param {string} subpath
279
- * @param {string} [base]
280
- */
210
+ * @param {string} packagePath
211
+ * @param {string} subpath
212
+ * @param {string} [base]
213
+ */
281
214
  (packagePath, subpath, base) => {
282
- if (subpath === ".")
283
- return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
215
+ if (subpath === ".") return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
284
216
  return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
285
217
  },
286
218
  Error
287
219
  );
288
- var ERR_UNSUPPORTED_DIR_IMPORT = createError(
289
- "ERR_UNSUPPORTED_DIR_IMPORT",
290
- "Directory import '%s' is not supported resolving ES modules imported from %s",
291
- Error
292
- );
293
- var ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
294
- "ERR_UNSUPPORTED_RESOLVE_REQUEST",
295
- 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
296
- TypeError
297
- );
298
- var ERR_UNKNOWN_FILE_EXTENSION = createError(
299
- "ERR_UNKNOWN_FILE_EXTENSION",
300
- (extension, path2) => {
301
- return `Unknown file extension "${extension}" for ${path2}`;
302
- },
303
- TypeError
304
- );
305
- createError(
306
- "ERR_INVALID_ARG_VALUE",
307
- (name, value, reason = "is invalid") => {
308
- let inspected = inspect(value);
309
- if (inspected.length > 128) {
310
- inspected = `${inspected.slice(0, 128)}...`;
311
- }
312
- const type = name.includes(".") ? "property" : "argument";
313
- return `The ${type} '${name}' ${reason}. Received ${inspected}`;
314
- },
315
- TypeError
316
- // Note: extra classes have been shaken out.
317
- // , RangeError
318
- );
220
+ var ERR_UNSUPPORTED_DIR_IMPORT = createError("ERR_UNSUPPORTED_DIR_IMPORT", "Directory import '%s' is not supported resolving ES modules imported from %s", Error);
221
+ var 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);
222
+ var ERR_UNKNOWN_FILE_EXTENSION = createError("ERR_UNKNOWN_FILE_EXTENSION", (extension, path$1) => {
223
+ return `Unknown file extension "${extension}" for ${path$1}`;
224
+ }, TypeError);
225
+ var ERR_INVALID_ARG_VALUE = createError("ERR_INVALID_ARG_VALUE", (name, value, reason = "is invalid") => {
226
+ let inspected = inspect(value);
227
+ if (inspected.length > 128) inspected = `${inspected.slice(0, 128)}...`;
228
+ return `The ${name.includes(".") ? "property" : "argument"} '${name}' ${reason}. Received ${inspected}`;
229
+ }, TypeError);
319
230
  var hasOwnProperty$1 = {}.hasOwnProperty;
320
231
  var hasOwnProperty = {}.hasOwnProperty;
321
232
  var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
322
233
  var own = {}.hasOwnProperty;
323
234
  var isWindows = (() => process.platform === "win32")();
324
- var globalCache = (() => (
325
- // eslint-disable-next-line unicorn/no-unreadable-iife
326
- globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map()
327
- ))();
235
+ var globalCache = (() => globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map())();
328
236
 
329
237
  // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
330
238
  var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/react",
3
- "version": "10.0.6",
3
+ "version": "10.0.8",
4
4
  "description": "Storybook React renderer",
5
5
  "keywords": [
6
6
  "storybook"
@@ -54,7 +54,7 @@
54
54
  },
55
55
  "dependencies": {
56
56
  "@storybook/global": "^5.0.0",
57
- "@storybook/react-dom-shim": "10.0.6"
57
+ "@storybook/react-dom-shim": "10.0.8"
58
58
  },
59
59
  "devDependencies": {
60
60
  "@types/babel-plugin-react-docgen": "^4.2.3",
@@ -78,7 +78,7 @@
78
78
  "peerDependencies": {
79
79
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
80
80
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
81
- "storybook": "^10.0.6",
81
+ "storybook": "^10.0.8",
82
82
  "typescript": ">= 4.9.x"
83
83
  },
84
84
  "peerDependenciesMeta": {
@@ -89,5 +89,5 @@
89
89
  "publishConfig": {
90
90
  "access": "public"
91
91
  },
92
- "gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae16"
92
+ "gitHead": "a8e7fd8a655c69780bc20b9749d2699e45beae1l"
93
93
  }