@storybook/nextjs 10.0.0-beta.1 → 10.0.0-beta.10

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/{chunk-JOMP7DUK.js → chunk-KX5HHFXV.js} +0 -4
  2. package/dist/_node-chunks/chunk-36CC7SQ7.js +17 -0
  3. package/dist/_node-chunks/{chunk-254AWWVV.js → chunk-3GULY6EP.js} +8 -8
  4. package/dist/_node-chunks/chunk-4S33U2ZV.js +475 -0
  5. package/dist/_node-chunks/{chunk-N47GZ6ZF.js → chunk-V7RYWD75.js} +8 -8
  6. package/dist/_node-chunks/{configureNextFont-YCA4Y2MY.js → configureNextFont-TR6FXSGG.js} +7 -7
  7. package/dist/_node-chunks/{loader-BMOR26K7.js → loader-DAH237CQ.js} +9 -9
  8. package/dist/_node-chunks/{loader-W6JNOWKU.js → loader-EDIU27IE.js} +9 -9
  9. package/dist/_node-chunks/{utils-TOBNY3XG.js → utils-VATWGGB7.js} +9 -9
  10. package/dist/_node-chunks/{webpack-422IPQRP.js → webpack-5MBM2JQ5.js} +7 -7
  11. package/dist/_node-chunks/{webpack-E2SJEFJM.js → webpack-7ATFWREA.js} +7 -7
  12. package/dist/_node-chunks/{webpack-WWJ5TQDG.js → webpack-GNWQXRPK.js} +7 -7
  13. package/dist/_node-chunks/{webpack-MCDIAAFL.js → webpack-KBFNFK3Q.js} +10 -10
  14. package/dist/_node-chunks/{webpack-7CTFG24J.js → webpack-MFR56R4E.js} +8 -8
  15. package/dist/_node-chunks/{webpack-GIA2WMBH.js → webpack-SSDUEAPT.js} +9 -9
  16. package/dist/_node-chunks/{webpack-AGJ2TY75.js → webpack-UIT3HSQ4.js} +7 -7
  17. package/dist/_node-chunks/webpack-VFMODTJY.js +26 -0
  18. package/dist/config/preview.js +3 -0
  19. package/dist/export-mocks/index.js +10 -10
  20. package/dist/font/webpack/loader/storybook-nextjs-font-loader.js +7 -7
  21. package/dist/index.js +3845 -3536
  22. package/dist/node/index.js +7 -7
  23. package/dist/preset.js +43 -33
  24. package/dist/preview.d.ts +18 -3
  25. package/dist/preview.js +1 -1
  26. package/dist/swc/next-swc-loader-patch.js +7 -7
  27. package/package.json +6 -5
  28. package/template/cli/js/Button.stories.js +1 -1
  29. package/template/cli/ts/Button.stories.ts +1 -1
  30. package/dist/_node-chunks/chunk-4Q3WLK5D.js +0 -167
  31. package/dist/_node-chunks/chunk-DF7TGUJT.js +0 -17
  32. package/dist/_node-chunks/webpack-UPXNFNSK.js +0 -26
  33. package/dist/preview.d.tsx +0 -18
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_nafzxsaqn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_nafzxsaqn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_nafzxsaqn from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ccrtjqfxrkc from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ccrtjqfxrkc from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ccrtjqfxrkc from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_nafzxsaqn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_nafzxsaqn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_nafzxsaqn.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ccrtjqfxrkc.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ccrtjqfxrkc.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ccrtjqfxrkc.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-DF7TGUJT.js";
14
+ } from "../_node-chunks/chunk-36CC7SQ7.js";
15
15
 
16
16
  // src/node/index.ts
17
17
  function defineMain(config) {
package/dist/preset.js CHANGED
@@ -1,22 +1,23 @@
1
- import CJS_COMPAT_NODE_URL_nafzxsaqn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_nafzxsaqn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_nafzxsaqn from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ccrtjqfxrkc from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ccrtjqfxrkc from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ccrtjqfxrkc from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_nafzxsaqn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_nafzxsaqn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_nafzxsaqn.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ccrtjqfxrkc.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ccrtjqfxrkc.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ccrtjqfxrkc.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
  addScopedAlias,
14
+ getNextjsVersion,
14
15
  resolveNextConfig
15
- } from "./_node-chunks/chunk-254AWWVV.js";
16
- import "./_node-chunks/chunk-4Q3WLK5D.js";
16
+ } from "./_node-chunks/chunk-3GULY6EP.js";
17
+ import "./_node-chunks/chunk-4S33U2ZV.js";
17
18
  import {
18
19
  __name
19
- } from "./_node-chunks/chunk-DF7TGUJT.js";
20
+ } from "./_node-chunks/chunk-36CC7SQ7.js";
20
21
 
21
22
  // src/preset.ts
22
23
  import { existsSync } from "node:fs";
@@ -25,7 +26,7 @@ import { fileURLToPath as fileURLToPath2 } from "node:url";
25
26
  import { getProjectRoot } from "storybook/internal/common";
26
27
  import { logger } from "storybook/internal/node-logger";
27
28
  import { loadPartialConfig } from "@babel/core";
28
- import semver from "semver";
29
+ import semver2 from "semver";
29
30
 
30
31
  // src/babel/preset.ts
31
32
  import { createRequire } from "node:module";
@@ -456,6 +457,9 @@ var preset_default = /* @__PURE__ */ __name((api, options = {}) => {
456
457
 
457
458
  // src/config/webpack.ts
458
459
  import { fileURLToPath } from "node:url";
460
+ import semver from "semver";
461
+ var nextjsVersion = getNextjsVersion();
462
+ var isNext16orNewer = semver.gte(nextjsVersion, "16.0.0");
459
463
  var tryResolve = /* @__PURE__ */ __name((path) => {
460
464
  try {
461
465
  return fileURLToPath(import.meta.resolve(path)) || false;
@@ -468,7 +472,9 @@ var configureConfig = /* @__PURE__ */ __name(async ({
468
472
  nextConfigPath
469
473
  }) => {
470
474
  const nextConfig = await resolveNextConfig({ nextConfigPath });
471
- addScopedAlias(baseConfig, "next/config");
475
+ if (!isNext16orNewer) {
476
+ addScopedAlias(baseConfig, "next/config");
477
+ }
472
478
  if (baseConfig.resolve?.alias?.["react-dom"]) {
473
479
  delete baseConfig.resolve.alias?.["react-dom"];
474
480
  }
@@ -491,14 +497,13 @@ var configureConfig = /* @__PURE__ */ __name(async ({
491
497
  return nextConfig;
492
498
  }, "configureConfig");
493
499
  var setupRuntimeConfig = /* @__PURE__ */ __name(async (baseConfig, nextConfig) => {
494
- const definePluginConfig = {
495
- // this mimics what nextjs does client side
496
- // https://github.com/vercel/next.js/blob/57702cb2a9a9dba4b552e0007c16449cf36cfb44/packages/next/client/index.tsx#L101
497
- "process.env.__NEXT_RUNTIME_CONFIG": JSON.stringify({
500
+ const definePluginConfig = {};
501
+ if (!isNext16orNewer) {
502
+ definePluginConfig["process.env.__NEXT_RUNTIME_CONFIG"] = JSON.stringify({
498
503
  serverRuntimeConfig: {},
499
504
  publicRuntimeConfig: nextConfig.publicRuntimeConfig
500
- })
501
- };
505
+ });
506
+ }
502
507
  const newNextLinkBehavior = nextConfig.experimental?.newNextLinkBehavior;
503
508
  definePluginConfig["process.env.__NEXT_NEW_LINK_BEHAVIOR"] = newNextLinkBehavior;
504
509
  baseConfig.plugins?.push(new (await import("webpack")).default.DefinePlugin(definePluginConfig));
@@ -713,8 +718,13 @@ var core = /* @__PURE__ */ __name(async (config, options) => {
713
718
  };
714
719
  }, "core");
715
720
  var previewAnnotations = /* @__PURE__ */ __name((entry = []) => {
716
- const result = [...entry, fileURLToPath2(import.meta.resolve("@storybook/nextjs/preview"))];
717
- return result;
721
+ const annotations = [...entry, fileURLToPath2(import.meta.resolve("@storybook/nextjs/preview"))];
722
+ const nextjsVersion2 = getNextjsVersion();
723
+ const isNext16orNewer2 = semver2.gte(nextjsVersion2, "16.0.0");
724
+ if (!isNext16orNewer2) {
725
+ annotations.push(fileURLToPath2(import.meta.resolve("@storybook/nextjs/config/preview")));
726
+ }
727
+ return annotations;
718
728
  }, "previewAnnotations");
719
729
  var babel = /* @__PURE__ */ __name(async (baseConfig) => {
720
730
  const configPartial = loadPartialConfig({
@@ -779,24 +789,24 @@ var webpackFinal = /* @__PURE__ */ __name(async (baseConfig, options) => {
779
789
  baseConfig,
780
790
  nextConfigPath
781
791
  });
782
- const { configureNextFont } = await import("./_node-chunks/configureNextFont-YCA4Y2MY.js");
783
- const { configureRuntimeNextjsVersionResolution, getNextjsVersion } = await import("./_node-chunks/utils-TOBNY3XG.js");
784
- const { configureImports } = await import("./_node-chunks/webpack-422IPQRP.js");
785
- const { configureCss } = await import("./_node-chunks/webpack-7CTFG24J.js");
786
- const { configureImages } = await import("./_node-chunks/webpack-GIA2WMBH.js");
787
- const { configureStyledJsx } = await import("./_node-chunks/webpack-UPXNFNSK.js");
788
- const { configureNodePolyfills } = await import("./_node-chunks/webpack-WWJ5TQDG.js");
789
- const { configureAliases } = await import("./_node-chunks/webpack-MCDIAAFL.js");
790
- const { configureFastRefresh } = await import("./_node-chunks/webpack-AGJ2TY75.js");
791
- const { configureRSC } = await import("./_node-chunks/webpack-E2SJEFJM.js");
792
- const { configureSWCLoader } = await import("./_node-chunks/loader-BMOR26K7.js");
793
- const { configureBabelLoader } = await import("./_node-chunks/loader-W6JNOWKU.js");
792
+ const { configureNextFont } = await import("./_node-chunks/configureNextFont-TR6FXSGG.js");
793
+ const { configureRuntimeNextjsVersionResolution, getNextjsVersion: getNextjsVersion2 } = await import("./_node-chunks/utils-VATWGGB7.js");
794
+ const { configureImports } = await import("./_node-chunks/webpack-5MBM2JQ5.js");
795
+ const { configureCss } = await import("./_node-chunks/webpack-MFR56R4E.js");
796
+ const { configureImages } = await import("./_node-chunks/webpack-SSDUEAPT.js");
797
+ const { configureStyledJsx } = await import("./_node-chunks/webpack-VFMODTJY.js");
798
+ const { configureNodePolyfills } = await import("./_node-chunks/webpack-GNWQXRPK.js");
799
+ const { configureAliases } = await import("./_node-chunks/webpack-KBFNFK3Q.js");
800
+ const { configureFastRefresh } = await import("./_node-chunks/webpack-UIT3HSQ4.js");
801
+ const { configureRSC } = await import("./_node-chunks/webpack-7ATFWREA.js");
802
+ const { configureSWCLoader } = await import("./_node-chunks/loader-DAH237CQ.js");
803
+ const { configureBabelLoader } = await import("./_node-chunks/loader-EDIU27IE.js");
794
804
  const babelRCPath = join(getProjectRoot(), ".babelrc");
795
805
  const babelConfigPath = join(getProjectRoot(), "babel.config.js");
796
806
  const hasBabelConfig = existsSync(babelRCPath) || existsSync(babelConfigPath);
797
- const nextjsVersion = getNextjsVersion();
807
+ const nextjsVersion2 = getNextjsVersion2();
798
808
  const isDevelopment = options.configType !== "PRODUCTION";
799
- const isNext14orNewer = semver.gte(nextjsVersion, "14.0.0");
809
+ const isNext14orNewer = semver2.gte(nextjsVersion2, "14.0.0");
800
810
  const useSWC = isNext14orNewer && (nextConfig.experimental?.forceSwcTransforms || !hasBabelConfig);
801
811
  configureNextFont(baseConfig, useSWC);
802
812
  configureRuntimeNextjsVersionResolution(baseConfig);
package/dist/preview.d.ts CHANGED
@@ -1,3 +1,18 @@
1
- // auto generated file from file:///home/runner/work/storybook/storybook/scripts/build/utils/generate-type-mappers.ts, do not edit
2
- export * from '../src/preview.tsx';
3
- export type * from '../src/preview.tsx';
1
+ import { Addon_DecoratorFunction, Addon_LoaderFunction } from 'storybook/internal/types';
2
+
3
+ declare const decorators: Addon_DecoratorFunction<any>[];
4
+ declare const loaders: Addon_LoaderFunction;
5
+ declare const parameters: {
6
+ docs: {
7
+ source: {
8
+ excludeDecorators: boolean;
9
+ };
10
+ };
11
+ react: {
12
+ rootOptions: {
13
+ onCaughtError(error: unknown): void;
14
+ };
15
+ };
16
+ };
17
+
18
+ export { decorators, loaders, parameters };
package/dist/preview.js CHANGED
@@ -2,7 +2,7 @@ import {
2
2
  decorators,
3
3
  loaders,
4
4
  parameters
5
- } from "./_browser-chunks/chunk-JOMP7DUK.js";
5
+ } from "./_browser-chunks/chunk-KX5HHFXV.js";
6
6
  import "./_browser-chunks/chunk-L5NVL7MD.js";
7
7
  export {
8
8
  decorators,
@@ -1,17 +1,17 @@
1
- import CJS_COMPAT_NODE_URL_nafzxsaqn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_nafzxsaqn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_nafzxsaqn from "node:module";
1
+ import CJS_COMPAT_NODE_URL_ccrtjqfxrkc from 'node:url';
2
+ import CJS_COMPAT_NODE_PATH_ccrtjqfxrkc from 'node:path';
3
+ import CJS_COMPAT_NODE_MODULE_ccrtjqfxrkc from "node:module";
4
4
 
5
- var __filename = CJS_COMPAT_NODE_URL_nafzxsaqn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_nafzxsaqn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_nafzxsaqn.createRequire(import.meta.url);
5
+ var __filename = CJS_COMPAT_NODE_URL_ccrtjqfxrkc.fileURLToPath(import.meta.url);
6
+ var __dirname = CJS_COMPAT_NODE_PATH_ccrtjqfxrkc.dirname(__filename);
7
+ var require = CJS_COMPAT_NODE_MODULE_ccrtjqfxrkc.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-DF7TGUJT.js";
14
+ } from "../_node-chunks/chunk-36CC7SQ7.js";
15
15
 
16
16
  // src/swc/next-swc-loader-patch.ts
17
17
  import { isAbsolute, relative } from "node:path";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@storybook/nextjs",
3
- "version": "10.0.0-beta.1",
3
+ "version": "10.0.0-beta.10",
4
4
  "description": "Storybook for Next.js: Develop, document, and test UI components in isolation",
5
5
  "keywords": [
6
6
  "storybook",
@@ -35,6 +35,7 @@
35
35
  "default": "./dist/export-mocks/cache/index.js"
36
36
  },
37
37
  "./compatibility/draft-mode.compat": "./dist/compatibility/draft-mode.compat.js",
38
+ "./config/preview": "./dist/config/preview.js",
38
39
  "./export-mocks": "./dist/export-mocks/index.js",
39
40
  "./headers.mock": {
40
41
  "types": "./dist/export-mocks/headers/index.d.ts",
@@ -93,9 +94,9 @@
93
94
  "@babel/preset-typescript": "^7.24.1",
94
95
  "@babel/runtime": "^7.24.4",
95
96
  "@pmmmwh/react-refresh-webpack-plugin": "^0.5.11",
96
- "@storybook/builder-webpack5": "10.0.0-beta.1",
97
- "@storybook/preset-react-webpack": "10.0.0-beta.1",
98
- "@storybook/react": "10.0.0-beta.1",
97
+ "@storybook/builder-webpack5": "10.0.0-beta.10",
98
+ "@storybook/preset-react-webpack": "10.0.0-beta.10",
99
+ "@storybook/react": "10.0.0-beta.10",
99
100
  "@types/semver": "^7.3.4",
100
101
  "babel-loader": "^9.1.3",
101
102
  "css-loader": "^6.7.3",
@@ -129,7 +130,7 @@
129
130
  "next": "^14.1.0 || ^15.0.0",
130
131
  "react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
131
132
  "react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
132
- "storybook": "^10.0.0-beta.1",
133
+ "storybook": "^10.0.0-beta.10",
133
134
  "webpack": "^5.0.0"
134
135
  },
135
136
  "peerDependenciesMeta": {
@@ -16,7 +16,7 @@ export default {
16
16
  argTypes: {
17
17
  backgroundColor: { control: 'color' },
18
18
  },
19
- // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
19
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
20
20
  args: { onClick: fn() },
21
21
  };
22
22
 
@@ -18,7 +18,7 @@ const meta = {
18
18
  argTypes: {
19
19
  backgroundColor: { control: 'color' },
20
20
  },
21
- // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#action-args
21
+ // Use `fn` to spy on the onClick arg, which will appear in the actions panel once invoked: https://storybook.js.org/docs/essentials/actions#story-args
22
22
  args: { onClick: fn() },
23
23
  } satisfies Meta<typeof Button>;
24
24
 
@@ -1,167 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_nafzxsaqn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_nafzxsaqn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_nafzxsaqn from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_nafzxsaqn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_nafzxsaqn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_nafzxsaqn.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-DF7TGUJT.js";
15
-
16
- // ../../core/src/shared/utils/module.ts
17
- import { fileURLToPath, pathToFileURL } from "node:url";
18
-
19
- // ../../node_modules/pathe/dist/shared/pathe.ff20891b.mjs
20
- var _DRIVE_LETTER_START_RE = /^[A-Za-z]:\//;
21
- function normalizeWindowsPath(input = "") {
22
- if (!input) {
23
- return input;
24
- }
25
- return input.replace(/\\/g, "/").replace(_DRIVE_LETTER_START_RE, (r) => r.toUpperCase());
26
- }
27
- __name(normalizeWindowsPath, "normalizeWindowsPath");
28
- var _UNC_REGEX = /^[/\\]{2}/;
29
- var _IS_ABSOLUTE_RE = /^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Za-z]:[/\\]/;
30
- var _DRIVE_LETTER_RE = /^[A-Za-z]:$/;
31
- var normalize = /* @__PURE__ */ __name(function(path2) {
32
- if (path2.length === 0) {
33
- return ".";
34
- }
35
- path2 = normalizeWindowsPath(path2);
36
- const isUNCPath = path2.match(_UNC_REGEX);
37
- const isPathAbsolute = isAbsolute(path2);
38
- const trailingSeparator = path2[path2.length - 1] === "/";
39
- path2 = normalizeString(path2, !isPathAbsolute);
40
- if (path2.length === 0) {
41
- if (isPathAbsolute) {
42
- return "/";
43
- }
44
- return trailingSeparator ? "./" : ".";
45
- }
46
- if (trailingSeparator) {
47
- path2 += "/";
48
- }
49
- if (_DRIVE_LETTER_RE.test(path2)) {
50
- path2 += "/";
51
- }
52
- if (isUNCPath) {
53
- if (!isPathAbsolute) {
54
- return `//./${path2}`;
55
- }
56
- return `//${path2}`;
57
- }
58
- return isPathAbsolute && !isAbsolute(path2) ? `/${path2}` : path2;
59
- }, "normalize");
60
- var join = /* @__PURE__ */ __name(function(...arguments_) {
61
- if (arguments_.length === 0) {
62
- return ".";
63
- }
64
- let joined;
65
- for (const argument of arguments_) {
66
- if (argument && argument.length > 0) {
67
- if (joined === void 0) {
68
- joined = argument;
69
- } else {
70
- joined += `/${argument}`;
71
- }
72
- }
73
- }
74
- if (joined === void 0) {
75
- return ".";
76
- }
77
- return normalize(joined.replace(/\/\/+/g, "/"));
78
- }, "join");
79
- function normalizeString(path2, allowAboveRoot) {
80
- let res = "";
81
- let lastSegmentLength = 0;
82
- let lastSlash = -1;
83
- let dots = 0;
84
- let char = null;
85
- for (let index = 0; index <= path2.length; ++index) {
86
- if (index < path2.length) {
87
- char = path2[index];
88
- } else if (char === "/") {
89
- break;
90
- } else {
91
- char = "/";
92
- }
93
- if (char === "/") {
94
- if (lastSlash === index - 1 || dots === 1) ;
95
- else if (dots === 2) {
96
- if (res.length < 2 || lastSegmentLength !== 2 || res[res.length - 1] !== "." || res[res.length - 2] !== ".") {
97
- if (res.length > 2) {
98
- const lastSlashIndex = res.lastIndexOf("/");
99
- if (lastSlashIndex === -1) {
100
- res = "";
101
- lastSegmentLength = 0;
102
- } else {
103
- res = res.slice(0, lastSlashIndex);
104
- lastSegmentLength = res.length - 1 - res.lastIndexOf("/");
105
- }
106
- lastSlash = index;
107
- dots = 0;
108
- continue;
109
- } else if (res.length > 0) {
110
- res = "";
111
- lastSegmentLength = 0;
112
- lastSlash = index;
113
- dots = 0;
114
- continue;
115
- }
116
- }
117
- if (allowAboveRoot) {
118
- res += res.length > 0 ? "/.." : "..";
119
- lastSegmentLength = 2;
120
- }
121
- } else {
122
- if (res.length > 0) {
123
- res += `/${path2.slice(lastSlash + 1, index)}`;
124
- } else {
125
- res = path2.slice(lastSlash + 1, index);
126
- }
127
- lastSegmentLength = index - lastSlash - 1;
128
- }
129
- lastSlash = index;
130
- dots = 0;
131
- } else if (char === "." && dots !== -1) {
132
- ++dots;
133
- } else {
134
- dots = -1;
135
- }
136
- }
137
- return res;
138
- }
139
- __name(normalizeString, "normalizeString");
140
- var isAbsolute = /* @__PURE__ */ __name(function(p) {
141
- return _IS_ABSOLUTE_RE.test(p);
142
- }, "isAbsolute");
143
- var dirname = /* @__PURE__ */ __name(function(p) {
144
- const segments = normalizeWindowsPath(p).replace(/\/$/, "").split("/").slice(0, -1);
145
- if (segments.length === 1 && _DRIVE_LETTER_RE.test(segments[0])) {
146
- segments[0] += "/";
147
- }
148
- return segments.join("/") || (isAbsolute(p) ? "/" : ".");
149
- }, "dirname");
150
-
151
- // ../../core/src/shared/utils/module.ts
152
- var importMetaResolve = /* @__PURE__ */ __name((...args) => {
153
- if (typeof import.meta.resolve !== "function" && process.env.VITEST === "true") {
154
- console.warn(
155
- "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"
156
- );
157
- return pathToFileURL(args[0]).href;
158
- }
159
- return import.meta.resolve(...args);
160
- }, "importMetaResolve");
161
- var resolvePackageDir = /* @__PURE__ */ __name((pkg, parent) => {
162
- return dirname(fileURLToPath(importMetaResolve(join(pkg, "package.json"), parent)));
163
- }, "resolvePackageDir");
164
-
165
- export {
166
- resolvePackageDir
167
- };
@@ -1,17 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_nafzxsaqn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_nafzxsaqn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_nafzxsaqn from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_nafzxsaqn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_nafzxsaqn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_nafzxsaqn.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,26 +0,0 @@
1
- import CJS_COMPAT_NODE_URL_nafzxsaqn from 'node:url';
2
- import CJS_COMPAT_NODE_PATH_nafzxsaqn from 'node:path';
3
- import CJS_COMPAT_NODE_MODULE_nafzxsaqn from "node:module";
4
-
5
- var __filename = CJS_COMPAT_NODE_URL_nafzxsaqn.fileURLToPath(import.meta.url);
6
- var __dirname = CJS_COMPAT_NODE_PATH_nafzxsaqn.dirname(__filename);
7
- var require = CJS_COMPAT_NODE_MODULE_nafzxsaqn.createRequire(import.meta.url);
8
-
9
- // ------------------------------------------------------------
10
- // end of CJS compatibility banner, injected by Storybook's esbuild configuration
11
- // ------------------------------------------------------------
12
- import {
13
- addScopedAlias
14
- } from "./chunk-254AWWVV.js";
15
- import "./chunk-4Q3WLK5D.js";
16
- import {
17
- __name
18
- } from "./chunk-DF7TGUJT.js";
19
-
20
- // src/styledJsx/webpack.ts
21
- var configureStyledJsx = /* @__PURE__ */ __name((baseConfig) => {
22
- addScopedAlias(baseConfig, "styled-jsx");
23
- }, "configureStyledJsx");
24
- export {
25
- configureStyledJsx
26
- };
@@ -1,18 +0,0 @@
1
- import { Addon_DecoratorFunction, Addon_LoaderFunction } from 'storybook/internal/types';
2
-
3
- declare const decorators: Addon_DecoratorFunction<any>[];
4
- declare const loaders: Addon_LoaderFunction;
5
- declare const parameters: {
6
- docs: {
7
- source: {
8
- excludeDecorators: boolean;
9
- };
10
- };
11
- react: {
12
- rootOptions: {
13
- onCaughtError(error: unknown): void;
14
- };
15
- };
16
- };
17
-
18
- export { decorators, loaders, parameters };