@storybook/nextjs 10.1.0-alpha.10 → 10.1.0-alpha.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. package/dist/_browser-chunks/{chunk-KX5HHFXV.js → chunk-2SBZPHE7.js} +50 -100
  2. package/dist/_browser-chunks/chunk-RDMFII4N.js +22 -0
  3. package/dist/_browser-chunks/{chunk-L5NVL7MD.js → chunk-SL3VIQZ3.js} +7 -13
  4. package/dist/_browser-chunks/react-18-PYSEDAWB.js +43 -0
  5. package/dist/_node-chunks/chunk-KG2CEDQ6.js +76 -0
  6. package/dist/_node-chunks/chunk-NVSKNSJK.js +205 -0
  7. package/dist/_node-chunks/chunk-XVBKFOBF.js +57 -0
  8. package/dist/_node-chunks/configureNextFont-QR356EAI.js +28 -0
  9. package/dist/_node-chunks/{loader-WPDBQYKQ.js → loader-GUPXITUF.js} +11 -16
  10. package/dist/_node-chunks/{loader-UJGK53PP.js → loader-VIIL5HSY.js} +15 -25
  11. package/dist/_node-chunks/{utils-G77XBOCW.js → utils-GFLYVHHC.js} +8 -9
  12. package/dist/_node-chunks/webpack-A6CKSXQU.js +24 -0
  13. package/dist/_node-chunks/webpack-HDYOTQDH.js +23 -0
  14. package/dist/_node-chunks/{webpack-AIYB3HRJ.js → webpack-K7FNPCWL.js} +13 -19
  15. package/dist/_node-chunks/webpack-KEI74OHK.js +30 -0
  16. package/dist/_node-chunks/{webpack-QCUACIS6.js → webpack-O4VJM34G.js} +9 -12
  17. package/dist/_node-chunks/webpack-S3SWBOVU.js +97 -0
  18. package/dist/_node-chunks/webpack-YFKESEJQ.js +60 -0
  19. package/dist/_node-chunks/webpack-YOXZVRLP.js +23 -0
  20. package/dist/compatibility/draft-mode.compat.js +1 -1
  21. package/dist/export-mocks/cache/index.js +3 -6
  22. package/dist/export-mocks/headers/index.js +6 -29
  23. package/dist/export-mocks/index.js +9 -10
  24. package/dist/export-mocks/navigation/index.js +17 -41
  25. package/dist/export-mocks/router/index.js +20 -54
  26. package/dist/font/webpack/loader/storybook-nextjs-font-loader.js +38 -80
  27. package/dist/image-context.js +1 -1
  28. package/dist/images/next-image.js +5 -11
  29. package/dist/images/next-legacy-image.js +3 -6
  30. package/dist/index.js +2865 -8413
  31. package/dist/next-image-loader-stub.js +9 -16
  32. package/dist/node/index.js +6 -10
  33. package/dist/preset.js +183 -462
  34. package/dist/preview.js +2 -2
  35. package/dist/rsc/server-only.js +1 -1
  36. package/dist/swc/next-swc-loader-patch.js +46 -84
  37. package/package.json +6 -6
  38. package/dist/_browser-chunks/chunk-I5RFHXDS.js +0 -40
  39. package/dist/_browser-chunks/react-18-G7Q4PNHD.js +0 -71
  40. package/dist/_node-chunks/chunk-2ADK3PCH.js +0 -74
  41. package/dist/_node-chunks/chunk-EVMWO5FG.js +0 -102
  42. package/dist/_node-chunks/chunk-RSBRC6AY.js +0 -475
  43. package/dist/_node-chunks/chunk-Z2RESD5M.js +0 -17
  44. package/dist/_node-chunks/configureNextFont-ZETH4V45.js +0 -36
  45. package/dist/_node-chunks/webpack-4ZO2PLAG.js +0 -107
  46. package/dist/_node-chunks/webpack-6QTUYRFB.js +0 -30
  47. package/dist/_node-chunks/webpack-KRJ4EWQZ.js +0 -27
  48. package/dist/_node-chunks/webpack-L5YFG573.js +0 -38
  49. package/dist/_node-chunks/webpack-QPCUFYIY.js +0 -77
  50. package/dist/_node-chunks/webpack-R5RMXZWI.js +0 -26
@@ -1,475 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_1wy8hqz8e24 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1wy8hqz8e24 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1wy8hqz8e24 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_1wy8hqz8e24.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1wy8hqz8e24.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1wy8hqz8e24.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __name
14
- } from "./chunk-Z2RESD5M.js";
15
-
16
- // ../../core/src/shared/utils/module.ts
17
- import { fileURLToPath, pathToFileURL } from "node:url";
18
-
19
- // ../../node_modules/exsolve/dist/index.mjs
20
- import assert from "node:assert";
21
- import v8 from "node:v8";
22
- import { format, inspect } from "node:util";
23
- var own$1 = {}.hasOwnProperty;
24
- var classRegExp = /^([A-Z][a-z\d]*)+$/;
25
- var kTypes = /* @__PURE__ */ new Set([
26
- "string",
27
- "function",
28
- "number",
29
- "object",
30
- // Accept 'Function' and 'Object' as alternative to the lower cased version.
31
- "Function",
32
- "Object",
33
- "boolean",
34
- "bigint",
35
- "symbol"
36
- ]);
37
- var messages = /* @__PURE__ */ new Map();
38
- var nodeInternalPrefix = "__node_internal_";
39
- var userStackTraceLimit;
40
- function formatList(array, type = "and") {
41
- return array.length < 3 ? array.join(` ${type} `) : `${array.slice(0, -1).join(", ")}, ${type} ${array.at(-1)}`;
42
- }
43
- __name(formatList, "formatList");
44
- function createError(sym, value, constructor) {
45
- messages.set(sym, value);
46
- return makeNodeErrorWithCode(constructor, sym);
47
- }
48
- __name(createError, "createError");
49
- function makeNodeErrorWithCode(Base, key) {
50
- return /* @__PURE__ */ __name(function NodeError(...parameters) {
51
- const limit = Error.stackTraceLimit;
52
- if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = 0;
53
- const error = new Base();
54
- if (isErrorStackTraceLimitWritable()) Error.stackTraceLimit = limit;
55
- const message = getMessage(key, parameters, error);
56
- Object.defineProperties(error, {
57
- // Note: no need to implement `kIsNodeError` symbol, would be hard,
58
- // probably.
59
- message: {
60
- value: message,
61
- enumerable: false,
62
- writable: true,
63
- configurable: true
64
- },
65
- toString: {
66
- /** @this {Error} */
67
- value() {
68
- return `${this.name} [${key}]: ${this.message}`;
69
- },
70
- enumerable: false,
71
- writable: true,
72
- configurable: true
73
- }
74
- });
75
- captureLargerStackTrace(error);
76
- error.code = key;
77
- return error;
78
- }, "NodeError");
79
- }
80
- __name(makeNodeErrorWithCode, "makeNodeErrorWithCode");
81
- function isErrorStackTraceLimitWritable() {
82
- try {
83
- if (v8.startupSnapshot.isBuildingSnapshot()) {
84
- return false;
85
- }
86
- } catch {
87
- }
88
- const desc = Object.getOwnPropertyDescriptor(Error, "stackTraceLimit");
89
- if (desc === void 0) {
90
- return Object.isExtensible(Error);
91
- }
92
- return own$1.call(desc, "writable") && desc.writable !== void 0 ? desc.writable : desc.set !== void 0;
93
- }
94
- __name(isErrorStackTraceLimitWritable, "isErrorStackTraceLimitWritable");
95
- function hideStackFrames(wrappedFunction) {
96
- const hidden = nodeInternalPrefix + wrappedFunction.name;
97
- Object.defineProperty(wrappedFunction, "name", { value: hidden });
98
- return wrappedFunction;
99
- }
100
- __name(hideStackFrames, "hideStackFrames");
101
- var captureLargerStackTrace = hideStackFrames(function(error) {
102
- const stackTraceLimitIsWritable = isErrorStackTraceLimitWritable();
103
- if (stackTraceLimitIsWritable) {
104
- userStackTraceLimit = Error.stackTraceLimit;
105
- Error.stackTraceLimit = Number.POSITIVE_INFINITY;
106
- }
107
- Error.captureStackTrace(error);
108
- if (stackTraceLimitIsWritable) Error.stackTraceLimit = userStackTraceLimit;
109
- return error;
110
- });
111
- function getMessage(key, parameters, self) {
112
- const message = messages.get(key);
113
- assert(message !== void 0, "expected `message` to be found");
114
- if (typeof message === "function") {
115
- assert(
116
- message.length <= parameters.length,
117
- // Default options do not count.
118
- `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${message.length}).`
119
- );
120
- return Reflect.apply(message, self, parameters);
121
- }
122
- const regex = /%[dfijoOs]/g;
123
- let expectedLength = 0;
124
- while (regex.exec(message) !== null) expectedLength++;
125
- assert(
126
- expectedLength === parameters.length,
127
- `Code: ${key}; The provided arguments length (${parameters.length}) does not match the required ones (${expectedLength}).`
128
- );
129
- if (parameters.length === 0) return message;
130
- parameters.unshift(message);
131
- return Reflect.apply(format, null, parameters);
132
- }
133
- __name(getMessage, "getMessage");
134
- function determineSpecificType(value) {
135
- if (value === null || value === void 0) {
136
- return String(value);
137
- }
138
- if (typeof value === "function" && value.name) {
139
- return `function ${value.name}`;
140
- }
141
- if (typeof value === "object") {
142
- if (value.constructor && value.constructor.name) {
143
- return `an instance of ${value.constructor.name}`;
144
- }
145
- return `${inspect(value, { depth: -1 })}`;
146
- }
147
- let inspected = inspect(value, { colors: false });
148
- if (inspected.length > 28) {
149
- inspected = `${inspected.slice(0, 25)}...`;
150
- }
151
- return `type ${typeof value} (${inspected})`;
152
- }
153
- __name(determineSpecificType, "determineSpecificType");
154
- createError(
155
- "ERR_INVALID_ARG_TYPE",
156
- (name, expected, actual) => {
157
- assert(typeof name === "string", "'name' must be a string");
158
- if (!Array.isArray(expected)) {
159
- expected = [expected];
160
- }
161
- let message = "The ";
162
- if (name.endsWith(" argument")) {
163
- message += `${name} `;
164
- } else {
165
- const type = name.includes(".") ? "property" : "argument";
166
- message += `"${name}" ${type} `;
167
- }
168
- message += "must be ";
169
- const types = [];
170
- const instances = [];
171
- const other = [];
172
- for (const value of expected) {
173
- assert(
174
- typeof value === "string",
175
- "All expected entries have to be of type string"
176
- );
177
- if (kTypes.has(value)) {
178
- types.push(value.toLowerCase());
179
- } else if (classRegExp.exec(value) === null) {
180
- assert(
181
- value !== "object",
182
- 'The value "object" should be written as "Object"'
183
- );
184
- other.push(value);
185
- } else {
186
- instances.push(value);
187
- }
188
- }
189
- if (instances.length > 0) {
190
- const pos = types.indexOf("object");
191
- if (pos !== -1) {
192
- types.slice(pos, 1);
193
- instances.push("Object");
194
- }
195
- }
196
- if (types.length > 0) {
197
- message += `${types.length > 1 ? "one of type" : "of type"} ${formatList(
198
- types,
199
- "or"
200
- )}`;
201
- if (instances.length > 0 || other.length > 0) message += " or ";
202
- }
203
- if (instances.length > 0) {
204
- message += `an instance of ${formatList(instances, "or")}`;
205
- if (other.length > 0) message += " or ";
206
- }
207
- if (other.length > 0) {
208
- if (other.length > 1) {
209
- message += `one of ${formatList(other, "or")}`;
210
- } else {
211
- if (other[0]?.toLowerCase() !== other[0]) message += "an ";
212
- message += `${other[0]}`;
213
- }
214
- }
215
- message += `. Received ${determineSpecificType(actual)}`;
216
- return message;
217
- },
218
- TypeError
219
- );
220
- var ERR_INVALID_MODULE_SPECIFIER = createError(
221
- "ERR_INVALID_MODULE_SPECIFIER",
222
- /**
223
- * @param {string} request
224
- * @param {string} reason
225
- * @param {string} [base]
226
- */
227
- (request, reason, base) => {
228
- return `Invalid module "${request}" ${reason}${base ? ` imported from ${base}` : ""}`;
229
- },
230
- TypeError
231
- );
232
- var ERR_INVALID_PACKAGE_CONFIG = createError(
233
- "ERR_INVALID_PACKAGE_CONFIG",
234
- (path2, base, message) => {
235
- return `Invalid package config ${path2}${base ? ` while importing ${base}` : ""}${message ? `. ${message}` : ""}`;
236
- },
237
- Error
238
- );
239
- var ERR_INVALID_PACKAGE_TARGET = createError(
240
- "ERR_INVALID_PACKAGE_TARGET",
241
- (packagePath, key, target, isImport = false, base) => {
242
- const relatedError = typeof target === "string" && !isImport && target.length > 0 && !target.startsWith("./");
243
- if (key === ".") {
244
- assert(isImport === false);
245
- 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 "./"' : ""}`;
246
- }
247
- return `Invalid "${isImport ? "imports" : "exports"}" target ${JSON.stringify(
248
- target
249
- )} defined for '${key}' in the package config ${packagePath}package.json${base ? ` imported from ${base}` : ""}${relatedError ? '; targets must start with "./"' : ""}`;
250
- },
251
- Error
252
- );
253
- var ERR_MODULE_NOT_FOUND = createError(
254
- "ERR_MODULE_NOT_FOUND",
255
- (path2, base, exactUrl = false) => {
256
- return `Cannot find ${exactUrl ? "module" : "package"} '${path2}' imported from ${base}`;
257
- },
258
- Error
259
- );
260
- createError(
261
- "ERR_NETWORK_IMPORT_DISALLOWED",
262
- "import of '%s' by %s is not supported: %s",
263
- Error
264
- );
265
- var ERR_PACKAGE_IMPORT_NOT_DEFINED = createError(
266
- "ERR_PACKAGE_IMPORT_NOT_DEFINED",
267
- (specifier, packagePath, base) => {
268
- return `Package import specifier "${specifier}" is not defined${packagePath ? ` in package ${packagePath || ""}package.json` : ""} imported from ${base}`;
269
- },
270
- TypeError
271
- );
272
- var ERR_PACKAGE_PATH_NOT_EXPORTED = createError(
273
- "ERR_PACKAGE_PATH_NOT_EXPORTED",
274
- /**
275
- * @param {string} packagePath
276
- * @param {string} subpath
277
- * @param {string} [base]
278
- */
279
- (packagePath, subpath, base) => {
280
- if (subpath === ".")
281
- return `No "exports" main defined in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
282
- return `Package subpath '${subpath}' is not defined by "exports" in ${packagePath}package.json${base ? ` imported from ${base}` : ""}`;
283
- },
284
- Error
285
- );
286
- var ERR_UNSUPPORTED_DIR_IMPORT = createError(
287
- "ERR_UNSUPPORTED_DIR_IMPORT",
288
- "Directory import '%s' is not supported resolving ES modules imported from %s",
289
- Error
290
- );
291
- var ERR_UNSUPPORTED_RESOLVE_REQUEST = createError(
292
- "ERR_UNSUPPORTED_RESOLVE_REQUEST",
293
- 'Failed to resolve module specifier "%s" from "%s": Invalid relative URL or base scheme is not hierarchical.',
294
- TypeError
295
- );
296
- var ERR_UNKNOWN_FILE_EXTENSION = createError(
297
- "ERR_UNKNOWN_FILE_EXTENSION",
298
- (extension, path2) => {
299
- return `Unknown file extension "${extension}" for ${path2}`;
300
- },
301
- TypeError
302
- );
303
- createError(
304
- "ERR_INVALID_ARG_VALUE",
305
- (name, value, reason = "is invalid") => {
306
- let inspected = inspect(value);
307
- if (inspected.length > 128) {
308
- inspected = `${inspected.slice(0, 128)}...`;
309
- }
310
- const type = name.includes(".") ? "property" : "argument";
311
- return `The ${type} '${name}' ${reason}. Received ${inspected}`;
312
- },
313
- TypeError
314
- // Note: extra classes have been shaken out.
315
- // , RangeError
316
- );
317
- var hasOwnProperty$1 = {}.hasOwnProperty;
318
- var hasOwnProperty = {}.hasOwnProperty;
319
- var RegExpPrototypeSymbolReplace = RegExp.prototype[Symbol.replace];
320
- var own = {}.hasOwnProperty;
321
- var isWindows = (() => process.platform === "win32")();
322
- var globalCache = (() => (
323
- // eslint-disable-next-line unicorn/no-unreadable-iife
324
- globalThis["__EXSOLVE_CACHE__"] ||= /* @__PURE__ */ new Map()
325
- ))();
326
-
327
- // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
328
- var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
329
- function normalizeWindowsPath(input = "") {
330
- if (!input) {
331
- return input;
332
- }
333
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
334
- }
335
- __name(normalizeWindowsPath, "normalizeWindowsPath");
336
- var _UNC_REGEX = /^[/\\]{2}/;
337
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
338
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
339
- var normalize = /* @__PURE__ */ __name(function(path2) {
340
- if (path2.length === 0) {
341
- return ".";
342
- }
343
- path2 = normalizeWindowsPath(path2);
344
- const isUNCPath = path2.match(_UNC_REGEX);
345
- const isPathAbsolute = isAbsolute(path2);
346
- const trailingSeparator = path2[path2.length - 1] === "/";
347
- path2 = normalizeString(path2, !isPathAbsolute);
348
- if (path2.length === 0) {
349
- if (isPathAbsolute) {
350
- return "/";
351
- }
352
- return trailingSeparator ? "./" : ".";
353
- }
354
- if (trailingSeparator) {
355
- path2 += "/";
356
- }
357
- if (_DRIVE_LETTER_RE.test(path2)) {
358
- path2 += "/";
359
- }
360
- if (isUNCPath) {
361
- if (!isPathAbsolute) {
362
- return `//./${path2}`;
363
- }
364
- return `//${path2}`;
365
- }
366
- return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
367
- }, "normalize");
368
- var join = /* @__PURE__ */ __name(function(...arguments_) {
369
- if (arguments_.length === 0) {
370
- return ".";
371
- }
372
- let joined;
373
- for (const argument of arguments_) {
374
- if (argument && argument.length > 0) {
375
- if (joined === void 0) {
376
- joined = argument;
377
- } else {
378
- joined += `/${argument}`;
379
- }
380
- }
381
- }
382
- if (joined === void 0) {
383
- return ".";
384
- }
385
- return normalize(joined.replace(/\/\/+/g, "/"));
386
- }, "join");
387
- function normalizeString(path2, allowAboveRoot) {
388
- let res = "";
389
- let lastSegmentLength = 0;
390
- let lastSlash = -1;
391
- let dots = 0;
392
- let char = null;
393
- for (let index = 0; index <= path2.length; ++index) {
394
- if (index < path2.length) {
395
- char = path2[index];
396
- } else if (char === "/") {
397
- break;
398
- } else {
399
- char = "/";
400
- }
401
- if (char === "/") {
402
- if (lastSlash === index - 1 || dots === 1) ;
403
- else if (dots === 2) {
404
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
405
- if (res.length > 2) {
406
- const lastSlashIndex = res.lastIndexOf("/");
407
- if (lastSlashIndex === -1) {
408
- res = "";
409
- lastSegmentLength = 0;
410
- } else {
411
- res = res.slice(0, lastSlashIndex);
412
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
413
- }
414
- lastSlash = index;
415
- dots = 0;
416
- continue;
417
- } else if (res.length > 0) {
418
- res = "";
419
- lastSegmentLength = 0;
420
- lastSlash = index;
421
- dots = 0;
422
- continue;
423
- }
424
- }
425
- if (allowAboveRoot) {
426
- res += res.length > 0 ? "/.." : "..";
427
- lastSegmentLength = 2;
428
- }
429
- } else {
430
- if (res.length > 0) {
431
- res += `/${path2.slice(lastSlash + 1, index)}`;
432
- } else {
433
- res = path2.slice(lastSlash + 1, index);
434
- }
435
- lastSegmentLength = index - lastSlash - 1;
436
- }
437
- lastSlash = index;
438
- dots = 0;
439
- } else if (char === "." && dots !== -1) {
440
- ++dots;
441
- } else {
442
- dots = -1;
443
- }
444
- }
445
- return res;
446
- }
447
- __name(normalizeString, "normalizeString");
448
- var isAbsolute = /* @__PURE__ */ __name(function(p) {
449
- return _IS_ABSOLUTE_RE.test(p);
450
- }, "isAbsolute");
451
- var dirname = /* @__PURE__ */ __name(function(p) {
452
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
453
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
454
- segments[0] += "/";
455
- }
456
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
457
- }, "dirname");
458
-
459
- // ../../core/src/shared/utils/module.ts
460
- var importMetaResolve = /* @__PURE__ */ __name((...args) => {
461
- if (typeof import.meta.resolve !== "function" && process.env.VITEST === "true") {
462
- console.warn(
463
- "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"
464
- );
465
- return pathToFileURL(args[0]).href;
466
- }
467
- return import.meta.resolve(...args);
468
- }, "importMetaResolve");
469
- var resolvePackageDir = /* @__PURE__ */ __name((pkg, parent) => {
470
- return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
471
- }, "resolvePackageDir");
472
-
473
- export {
474
- resolvePackageDir
475
- };
@@ -1,17 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_1wy8hqz8e24 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1wy8hqz8e24 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1wy8hqz8e24 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_1wy8hqz8e24.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1wy8hqz8e24.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1wy8hqz8e24.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- var __defProp = Object.defineProperty;
13
- var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
14
-
15
- export {
16
- __name
17
- };
@@ -1,36 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_1wy8hqz8e24 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1wy8hqz8e24 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1wy8hqz8e24 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_1wy8hqz8e24.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1wy8hqz8e24.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1wy8hqz8e24.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __name
14
- } from "./chunk-Z2RESD5M.js";
15
-
16
- // src/font/webpack/configureNextFont.ts
17
- function configureNextFont(baseConfig, isSWC) {
18
- if (isSWC) {
19
- baseConfig.module?.rules?.push({
20
- test: /next(\\|\/|\\\\).*(\\|\/|\\\\)target\.css$/,
21
- loader: "@storybook/nextjs/storybook-nextjs-font-loader"
22
- });
23
- } else {
24
- baseConfig.resolveLoader = {
25
- ...baseConfig.resolveLoader,
26
- alias: {
27
- ...baseConfig.resolveLoader?.alias,
28
- "storybook-nextjs-font-loader": "@storybook/nextjs/storybook-nextjs-font-loader"
29
- }
30
- };
31
- }
32
- }
33
- __name(configureNextFont, "configureNextFont");
34
- export {
35
- configureNextFont
36
- };
@@ -1,107 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_1wy8hqz8e24 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1wy8hqz8e24 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1wy8hqz8e24 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_1wy8hqz8e24.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1wy8hqz8e24.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1wy8hqz8e24.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- resolvePackageDir
14
- } from "./chunk-RSBRC6AY.js";
15
- import {
16
- __name
17
- } from "./chunk-Z2RESD5M.js";
18
-
19
- // src/css/webpack.ts
20
- import { readFileSync } from "node:fs";
21
- import { join } from "node:path";
22
- import { fileURLToPath } from "node:url";
23
- import { cssFileResolve } from "next/dist/build/webpack/config/blocks/css/loaders/file-resolve.js";
24
- import { getCssModuleLocalIdent } from "next/dist/build/webpack/config/blocks/css/loaders/getCssModuleLocalIdent.js";
25
- import semver from "semver";
26
- var configureCss = /* @__PURE__ */ __name((baseConfig, nextConfig) => {
27
- const rules = baseConfig.module?.rules;
28
- rules?.forEach((rule, i) => {
29
- if (rule && typeof rule !== "string" && rule.test instanceof RegExp && rule.test.test("test.css")) {
30
- rules[i] = {
31
- test: /\.css$/,
32
- use: [
33
- fileURLToPath(import.meta.resolve("style-loader")),
34
- {
35
- loader: fileURLToPath(import.meta.resolve("css-loader")),
36
- options: {
37
- importLoaders: 1,
38
- ...getImportAndUrlCssLoaderOptions(nextConfig),
39
- modules: {
40
- auto: true,
41
- getLocalIdent: getCssModuleLocalIdent
42
- }
43
- }
44
- },
45
- fileURLToPath(import.meta.resolve("postcss-loader"))
46
- ],
47
- // We transform the "target.css" files from next.js into Javascript
48
- // for Next.js to support fonts, so it should be ignored by the css-loader.
49
- exclude: /next(\\|\/|\\\\).*(\\|\/|\\\\)target\.css$/
50
- };
51
- }
52
- });
53
- rules?.push({
54
- test: /\.(scss|sass)$/,
55
- use: [
56
- fileURLToPath(import.meta.resolve("style-loader")),
57
- {
58
- loader: fileURLToPath(import.meta.resolve("css-loader")),
59
- options: {
60
- importLoaders: 3,
61
- ...getImportAndUrlCssLoaderOptions(nextConfig),
62
- modules: { auto: true, getLocalIdent: getCssModuleLocalIdent }
63
- }
64
- },
65
- fileURLToPath(import.meta.resolve("postcss-loader")),
66
- fileURLToPath(import.meta.resolve("resolve-url-loader")),
67
- {
68
- loader: fileURLToPath(import.meta.resolve("sass-loader")),
69
- options: {
70
- sourceMap: true,
71
- sassOptions: nextConfig.sassOptions,
72
- additionalData: nextConfig.sassOptions?.prependData || nextConfig.sassOptions?.additionalData
73
- }
74
- }
75
- ]
76
- });
77
- }, "configureCss");
78
- var getImportAndUrlCssLoaderOptions = /* @__PURE__ */ __name((nextConfig) => isCssLoaderV6() ? {
79
- url: {
80
- filter: getUrlResolver(nextConfig)
81
- },
82
- import: {
83
- filter: getImportResolver(nextConfig)
84
- }
85
- } : {
86
- url: getUrlResolver(nextConfig),
87
- import: getImportResolver(nextConfig)
88
- }, "getImportAndUrlCssLoaderOptions");
89
- var getUrlResolver = /* @__PURE__ */ __name((nextConfig) => (url, resourcePath) => cssFileResolve(url, resourcePath, nextConfig.experimental?.urlImports), "getUrlResolver");
90
- var getImportResolver = /* @__PURE__ */ __name((nextConfig) => (url, _, resourcePath) => cssFileResolve(
91
- typeof url === "string" ? url : url.url,
92
- resourcePath,
93
- nextConfig.experimental?.urlImports
94
- ), "getImportResolver");
95
- var isCssLoaderV6 = /* @__PURE__ */ __name(() => {
96
- try {
97
- const cssLoaderVersion = JSON.parse(
98
- readFileSync(join(resolvePackageDir("css-loader"), "package.json"), "utf8")
99
- ).version;
100
- return semver.gte(cssLoaderVersion, "6.0.0");
101
- } catch {
102
- return false;
103
- }
104
- }, "isCssLoaderV6");
105
- export {
106
- configureCss
107
- };
@@ -1,30 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_1wy8hqz8e24 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1wy8hqz8e24 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1wy8hqz8e24 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_1wy8hqz8e24.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1wy8hqz8e24.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1wy8hqz8e24.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __name
14
- } from "./chunk-Z2RESD5M.js";
15
-
16
- // src/nodePolyfills/webpack.ts
17
- import NodePolyfillPlugin from "node-polyfill-webpack-plugin";
18
- var configureNodePolyfills = /* @__PURE__ */ __name((baseConfig) => {
19
- baseConfig.plugins = [...baseConfig.plugins || [], new NodePolyfillPlugin()];
20
- baseConfig.resolve = {
21
- ...baseConfig.resolve,
22
- fallback: {
23
- fs: false
24
- }
25
- };
26
- return baseConfig;
27
- }, "configureNodePolyfills");
28
- export {
29
- configureNodePolyfills
30
- };
@@ -1,27 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_1wy8hqz8e24 from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_1wy8hqz8e24 from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_1wy8hqz8e24 from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_1wy8hqz8e24.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_1wy8hqz8e24.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_1wy8hqz8e24.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- __name
14
- } from "./chunk-Z2RESD5M.js";
15
-
16
- // src/rsc/webpack.ts
17
- import { fileURLToPath } from "node:url";
18
- var configureRSC = /* @__PURE__ */ __name((baseConfig) => {
19
- const resolve = baseConfig.resolve ?? {};
20
- resolve.alias = {
21
- ...resolve.alias,
22
- "server-only$": fileURLToPath(import.meta.resolve("@storybook/nextjs/rsc/server-only"))
23
- };
24
- }, "configureRSC");
25
- export {
26
- configureRSC
27
- };