storybook 10.1.0-alpha.0 → 10.1.0-alpha.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.
- package/dist/_browser-chunks/{Color-7ZNS6F6B.js → Color-FQNEU7YS.js} +79 -60
- package/dist/_browser-chunks/{chunk-BOOOPFZF.js → WithTooltip-6NHN2GXF.js} +25 -17
- package/dist/_browser-chunks/{chunk-RNE2IUTB.js → chunk-AW46NMGV.js} +9 -1
- package/dist/_browser-chunks/{chunk-C4XOKMDU.js → chunk-QMY4G4R2.js} +49 -49
- package/dist/_browser-chunks/{syntaxhighlighter-DK2ODWXH.js → syntaxhighlighter-RJZASWHL.js} +5 -5
- package/dist/_node-chunks/{builder-manager-OTO33TIA.js → builder-manager-HA7CYFCK.js} +32 -12
- package/dist/_node-chunks/camelcase-QALD4XFE.js +18 -0
- package/dist/_node-chunks/{chunk-O4KUWXD6.js → chunk-2XY53ALL.js} +8 -8
- package/dist/_node-chunks/{chunk-Q4CZSEBO.js → chunk-3CBQMG2A.js} +7 -7
- package/dist/_node-chunks/{chunk-L5WAZZY3.js → chunk-3WDAPZYQ.js} +7 -7
- package/dist/_node-chunks/{chunk-6C7OBGYG.js → chunk-4ZB555EJ.js} +7 -7
- package/dist/_node-chunks/{chunk-RKANIOER.js → chunk-52DXKXY3.js} +8 -8
- package/dist/_node-chunks/{chunk-HYNQ2IX4.js → chunk-5OVB4A6F.js} +7 -7
- package/dist/_node-chunks/chunk-AGHGNXGH.js +18 -0
- package/dist/_node-chunks/{chunk-OYGAWJQE.js → chunk-B23X5ZCK.js} +7 -7
- package/dist/_node-chunks/{chunk-HHTKRAIE.js → chunk-B2DAHWJK.js} +25 -7
- package/dist/_node-chunks/{chunk-FDDQACQD.js → chunk-CC4PW5MJ.js} +7 -7
- package/dist/_node-chunks/{chunk-Q6QFW2Y7.js → chunk-D7NIZELR.js} +67 -59
- package/dist/_node-chunks/{chunk-EFJRT54D.js → chunk-DO5Q3H4L.js} +7 -7
- package/dist/_node-chunks/{chunk-VW3GGAQI.js → chunk-ECK7WVFX.js} +12 -12
- package/dist/_node-chunks/{chunk-XI2VU32X.js → chunk-EUH3NHXA.js} +7 -7
- package/dist/_node-chunks/{chunk-YS6OLN4N.js → chunk-F3XOPI6H.js} +7 -7
- package/dist/_node-chunks/{chunk-NTB3C5XQ.js → chunk-FOQHPHCV.js} +7 -7
- package/dist/_node-chunks/{chunk-HIGKW2KB.js → chunk-G6EL47NS.js} +7 -7
- package/dist/_node-chunks/{chunk-QOI32MCO.js → chunk-GFLS4TJB.js} +7 -7
- package/dist/_node-chunks/{chunk-2WZNP46P.js → chunk-J3XZKWHE.js} +8 -8
- package/dist/_node-chunks/{chunk-LOF6SIRE.js → chunk-LE63EHJ5.js} +12 -12
- package/dist/_node-chunks/{chunk-RR6Q3657.js → chunk-M47XA42S.js} +9 -9
- package/dist/_node-chunks/{chunk-VL6WDGIU.js → chunk-OOI74AL3.js} +6 -6
- package/dist/_node-chunks/{chunk-AITYHU22.js → chunk-OVXB5GGT.js} +7 -7
- package/dist/_node-chunks/chunk-PRJHT3GJ.js +61 -0
- package/dist/_node-chunks/{chunk-SV7ZHC5Z.js → chunk-Q52PVUSU.js} +7 -7
- package/dist/_node-chunks/{chunk-NTAOH664.js → chunk-RMHAL25C.js} +9 -9
- package/dist/_node-chunks/{chunk-A6T2YN75.js → chunk-SDCF5RNN.js} +15 -15
- package/dist/_node-chunks/{chunk-3ICYWJ3N.js → chunk-UJ5SJ23M.js} +7 -7
- package/dist/_node-chunks/{chunk-FWW4IJCM.js → chunk-UPHK4ETU.js} +19 -17
- package/dist/_node-chunks/{chunk-O3OJUFKU.js → chunk-V7VURIPB.js} +8 -8
- package/dist/_node-chunks/{chunk-6M2IPO4E.js → chunk-VPR5IBMG.js} +6 -6
- package/dist/_node-chunks/{chunk-27W6KHQ2.js → chunk-X4XU27M6.js} +7 -7
- package/dist/_node-chunks/{chunk-ZFRTME73.js → chunk-ZHSCUGNP.js} +1467 -148
- package/dist/_node-chunks/{dist-BA2GAJJB.js → dist-6TXHNR5C.js} +9 -9
- package/dist/_node-chunks/{globby-4HAI4KJH.js → globby-PBTV6PX6.js} +9 -9
- package/dist/_node-chunks/{lib-ITRY6RT7.js → lib-4RTDZVGX.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-7PULFTZI.js → mdx-N42X6CFJ-COWEH7KR.js} +8 -8
- package/dist/_node-chunks/{p-limit-63FY4KTG.js → p-limit-PBVZQOFY.js} +7 -7
- package/dist/_node-chunks/{plugin-2BSKCSMA.js → plugin-6ZPCS4LI.js} +10 -10
- package/dist/_node-chunks/{plugin-JEBMTDIB.js → plugin-EOZKYZAG.js} +10 -10
- package/dist/_node-chunks/{webpack-inject-mocker-runtime-plugin-AZ7YPMMD.js → webpack-inject-mocker-runtime-plugin-35HMSMR5.js} +10 -10
- package/dist/_node-chunks/{webpack-mock-plugin-7IF6PA2O.js → webpack-mock-plugin-GT3MA5E2.js} +9 -9
- package/dist/babel/index.js +11 -11
- package/dist/bin/core.js +11 -11
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +9 -9
- package/dist/cli/index.js +50 -74
- package/dist/common/index.d.ts +210 -3
- package/dist/common/index.js +28 -20
- package/dist/components/index.d.ts +472 -280
- package/dist/components/index.js +20367 -75
- package/dist/core-server/index.js +1128 -247
- package/dist/core-server/presets/common-manager.js +1143 -2230
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +27 -27
- package/dist/core-server/presets/webpack/loaders/storybook-mock-transform-loader.js +9 -9
- package/dist/core-server/presets/webpack/loaders/webpack-automock-loader.js +10 -10
- package/dist/csf/index.js +13 -6
- package/dist/csf-tools/index.d.ts +15 -4
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +40951 -26253
- package/dist/manager/runtime.js +1688 -2693
- package/dist/manager-api/index.d.ts +11 -3
- package/dist/manager-api/index.js +53 -6
- package/dist/node-logger/index.d.ts +1 -1
- package/dist/node-logger/index.js +473 -448
- package/dist/preview/runtime.js +903 -896
- package/dist/preview-api/index.d.ts +68 -67
- package/dist/preview-api/index.js +5 -5
- package/dist/server-errors.js +10 -10
- package/dist/telemetry/index.js +24 -24
- package/dist/test/index.js +547 -547
- package/dist/theming/create.d.ts +4 -2
- package/dist/theming/create.js +1 -1
- package/dist/theming/index.d.ts +9 -6
- package/dist/theming/index.js +13 -6
- package/dist/types/index.d.ts +50 -5
- package/package.json +14 -6
- package/dist/_browser-chunks/WithTooltip-SK46ZJ2J.js +0 -13
- package/dist/_browser-chunks/chunk-I74EUU5O.js +0 -5809
- package/dist/_node-chunks/camelcase-HURSU73A.js +0 -18
- package/dist/_node-chunks/chunk-P7ZABCRS.js +0 -18
- package/dist/_node-chunks/chunk-QWBT2XCX.js +0 -61
- package/dist/_browser-chunks/{chunk-W4QKLQSC.js → chunk-RW5PKMWM.js} +5 -5
|
@@ -1,23 +1,23 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_8vqew0zn9si from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_8vqew0zn9si from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_8vqew0zn9si.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.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
|
glob
|
|
14
|
-
} from "../../_node-chunks/chunk-
|
|
14
|
+
} from "../../_node-chunks/chunk-3CBQMG2A.js";
|
|
15
15
|
import {
|
|
16
16
|
slash
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-3WDAPZYQ.js";
|
|
18
18
|
import {
|
|
19
19
|
__name
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-OOI74AL3.js";
|
|
21
21
|
|
|
22
22
|
// src/core-server/utils/remove-mdx-entries.ts
|
|
23
23
|
import { isAbsolute, join, relative } from "node:path";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_8vqew0zn9si from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_8vqew0zn9si from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_8vqew0zn9si.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,37 +12,38 @@ var require = CJS_COMPAT_NODE_MODULE_viqf41uklqm.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
parseStaticDir,
|
|
14
14
|
sendTelemetryError
|
|
15
|
-
} from "../../_node-chunks/chunk-
|
|
16
|
-
import "../../_node-chunks/chunk-
|
|
15
|
+
} from "../../_node-chunks/chunk-ECK7WVFX.js";
|
|
16
|
+
import "../../_node-chunks/chunk-4ZB555EJ.js";
|
|
17
17
|
import {
|
|
18
18
|
getLastEvents,
|
|
19
19
|
getSessionId
|
|
20
|
-
} from "../../_node-chunks/chunk-
|
|
20
|
+
} from "../../_node-chunks/chunk-G6EL47NS.js";
|
|
21
21
|
import {
|
|
22
22
|
invariant
|
|
23
|
-
} from "../../_node-chunks/chunk-
|
|
23
|
+
} from "../../_node-chunks/chunk-CC4PW5MJ.js";
|
|
24
24
|
import {
|
|
25
25
|
resolvePackageDir
|
|
26
|
-
} from "../../_node-chunks/chunk-
|
|
26
|
+
} from "../../_node-chunks/chunk-V7VURIPB.js";
|
|
27
27
|
import {
|
|
28
|
+
isAbsolute,
|
|
28
29
|
join
|
|
29
|
-
} from "../../_node-chunks/chunk-
|
|
30
|
-
import "../../_node-chunks/chunk-
|
|
30
|
+
} from "../../_node-chunks/chunk-B2DAHWJK.js";
|
|
31
|
+
import "../../_node-chunks/chunk-UJ5SJ23M.js";
|
|
31
32
|
import {
|
|
32
33
|
loadConfig
|
|
33
|
-
} from "../../_node-chunks/chunk-
|
|
34
|
+
} from "../../_node-chunks/chunk-D7NIZELR.js";
|
|
34
35
|
import {
|
|
35
36
|
require_dist
|
|
36
|
-
} from "../../_node-chunks/chunk-
|
|
37
|
+
} from "../../_node-chunks/chunk-5OVB4A6F.js";
|
|
37
38
|
import {
|
|
38
39
|
require_picocolors
|
|
39
|
-
} from "../../_node-chunks/chunk-
|
|
40
|
+
} from "../../_node-chunks/chunk-X4XU27M6.js";
|
|
40
41
|
import {
|
|
41
42
|
__commonJS,
|
|
42
43
|
__name,
|
|
43
44
|
__require,
|
|
44
45
|
__toESM
|
|
45
|
-
} from "../../_node-chunks/chunk-
|
|
46
|
+
} from "../../_node-chunks/chunk-OOI74AL3.js";
|
|
46
47
|
|
|
47
48
|
// ../node_modules/shell-quote/quote.js
|
|
48
49
|
var require_quote = __commonJS({
|
|
@@ -658,7 +659,6 @@ var require_launch_editor = __commonJS({
|
|
|
658
659
|
// src/core-server/presets/common-preset.ts
|
|
659
660
|
import { existsSync as existsSync3 } from "node:fs";
|
|
660
661
|
import { readFile as readFile3 } from "node:fs/promises";
|
|
661
|
-
import { isAbsolute, join as join5 } from "node:path";
|
|
662
662
|
import { fileURLToPath } from "node:url";
|
|
663
663
|
import { optionalEnvToBoolean } from "storybook/internal/common";
|
|
664
664
|
import {
|
|
@@ -703,7 +703,7 @@ var import_ts_dedent = __toESM(require_dist(), 1);
|
|
|
703
703
|
|
|
704
704
|
// src/core-server/utils/get-component-variable-name.ts
|
|
705
705
|
var getComponentVariableName = /* @__PURE__ */ __name(async (name) => {
|
|
706
|
-
const camelCase = await import("../../_node-chunks/camelcase-
|
|
706
|
+
const camelCase = await import("../../_node-chunks/camelcase-QALD4XFE.js");
|
|
707
707
|
const camelCased = camelCase.default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: true });
|
|
708
708
|
const sanitized = camelCased.replace(/[^a-zA-Z_$]+/, "");
|
|
709
709
|
return sanitized;
|
|
@@ -1050,7 +1050,7 @@ async function searchFiles({
|
|
|
1050
1050
|
ignoredFiles = IGNORED_FILES,
|
|
1051
1051
|
fileExtensions = FILE_EXTENSIONS
|
|
1052
1052
|
}) {
|
|
1053
|
-
const { globby, isDynamicPattern } = await import("../../_node-chunks/globby-
|
|
1053
|
+
const { globby, isDynamicPattern } = await import("../../_node-chunks/globby-PBTV6PX6.js");
|
|
1054
1054
|
const hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd });
|
|
1055
1055
|
const hasFileExtensionRegex = /(\.[a-z]+)$/i;
|
|
1056
1056
|
const searchQueryHasExtension = hasFileExtensionRegex.test(searchQuery);
|
|
@@ -1675,8 +1675,8 @@ var favicon = /* @__PURE__ */ __name(async (value, options) => {
|
|
|
1675
1675
|
results.push(staticPath);
|
|
1676
1676
|
}
|
|
1677
1677
|
if (targetEndpoint === "/") {
|
|
1678
|
-
results.push(
|
|
1679
|
-
results.push(
|
|
1678
|
+
results.push(join(staticPath, "favicon.svg"));
|
|
1679
|
+
results.push(join(staticPath, "favicon.ico"));
|
|
1680
1680
|
}
|
|
1681
1681
|
return results.filter((path) => existsSync3(path));
|
|
1682
1682
|
}).reduce((l1, l2) => l1.concat(l2), []);
|
|
@@ -1793,7 +1793,7 @@ var frameworkOptions = /* @__PURE__ */ __name(async (_, options) => {
|
|
|
1793
1793
|
return config.options;
|
|
1794
1794
|
}, "frameworkOptions");
|
|
1795
1795
|
var managerHead = /* @__PURE__ */ __name(async (_, options) => {
|
|
1796
|
-
const location =
|
|
1796
|
+
const location = join(options.configDir, "manager-head.html");
|
|
1797
1797
|
if (existsSync3(location)) {
|
|
1798
1798
|
const contents = readFile3(location, { encoding: "utf8" });
|
|
1799
1799
|
const interpolations = options.presets.apply("env");
|
|
@@ -1833,8 +1833,8 @@ var viteFinal = /* @__PURE__ */ __name(async (existing, options) => {
|
|
|
1833
1833
|
if (!previewConfigPath) {
|
|
1834
1834
|
return existing;
|
|
1835
1835
|
}
|
|
1836
|
-
const { viteInjectMockerRuntime } = await import("../../_node-chunks/plugin-
|
|
1837
|
-
const { viteMockPlugin } = await import("../../_node-chunks/plugin-
|
|
1836
|
+
const { viteInjectMockerRuntime } = await import("../../_node-chunks/plugin-6ZPCS4LI.js");
|
|
1837
|
+
const { viteMockPlugin } = await import("../../_node-chunks/plugin-EOZKYZAG.js");
|
|
1838
1838
|
const coreOptions = await options.presets.apply("core");
|
|
1839
1839
|
return {
|
|
1840
1840
|
...existing,
|
|
@@ -1852,8 +1852,8 @@ var webpackFinal = /* @__PURE__ */ __name(async (config, options) => {
|
|
|
1852
1852
|
if (!previewConfigPath) {
|
|
1853
1853
|
return config;
|
|
1854
1854
|
}
|
|
1855
|
-
const { WebpackMockPlugin } = await import("../../_node-chunks/webpack-mock-plugin-
|
|
1856
|
-
const { WebpackInjectMockerRuntimePlugin } = await import("../../_node-chunks/webpack-inject-mocker-runtime-plugin-
|
|
1855
|
+
const { WebpackMockPlugin } = await import("../../_node-chunks/webpack-mock-plugin-GT3MA5E2.js");
|
|
1856
|
+
const { WebpackInjectMockerRuntimePlugin } = await import("../../_node-chunks/webpack-inject-mocker-runtime-plugin-35HMSMR5.js");
|
|
1857
1857
|
config.plugins = config.plugins || [];
|
|
1858
1858
|
config.module.rules.push({
|
|
1859
1859
|
test: /preview\.(t|j)sx?$/,
|
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_8vqew0zn9si from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_8vqew0zn9si from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_8vqew0zn9si.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.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
|
rewriteSbMockImportCalls
|
|
14
|
-
} from "../../../../_node-chunks/chunk-
|
|
15
|
-
import "../../../../_node-chunks/chunk-
|
|
14
|
+
} from "../../../../_node-chunks/chunk-2XY53ALL.js";
|
|
15
|
+
import "../../../../_node-chunks/chunk-B2DAHWJK.js";
|
|
16
16
|
import {
|
|
17
17
|
__name
|
|
18
|
-
} from "../../../../_node-chunks/chunk-
|
|
18
|
+
} from "../../../../_node-chunks/chunk-OOI74AL3.js";
|
|
19
19
|
|
|
20
20
|
// src/core-server/presets/webpack/loaders/storybook-mock-transform-loader.ts
|
|
21
21
|
import { logger } from "storybook/internal/node-logger";
|
|
@@ -1,24 +1,24 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_8vqew0zn9si from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_8vqew0zn9si from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_8vqew0zn9si.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.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
|
getAutomockCode
|
|
14
|
-
} from "../../../../_node-chunks/chunk-
|
|
14
|
+
} from "../../../../_node-chunks/chunk-DO5Q3H4L.js";
|
|
15
15
|
import {
|
|
16
16
|
babelParser
|
|
17
|
-
} from "../../../../_node-chunks/chunk-
|
|
18
|
-
import "../../../../_node-chunks/chunk-
|
|
17
|
+
} from "../../../../_node-chunks/chunk-2XY53ALL.js";
|
|
18
|
+
import "../../../../_node-chunks/chunk-B2DAHWJK.js";
|
|
19
19
|
import {
|
|
20
20
|
__name
|
|
21
|
-
} from "../../../../_node-chunks/chunk-
|
|
21
|
+
} from "../../../../_node-chunks/chunk-OOI74AL3.js";
|
|
22
22
|
|
|
23
23
|
// src/core-server/presets/webpack/loaders/webpack-automock-loader.ts
|
|
24
24
|
function webpackAutomockLoader(source) {
|
package/dist/csf/index.js
CHANGED
|
@@ -10,7 +10,8 @@ import {
|
|
|
10
10
|
mountDestructured,
|
|
11
11
|
normalizeArrays,
|
|
12
12
|
normalizeProjectAnnotations
|
|
13
|
-
} from "../_browser-chunks/chunk-
|
|
13
|
+
} from "../_browser-chunks/chunk-RW5PKMWM.js";
|
|
14
|
+
import "../_browser-chunks/chunk-LYCSRYYR.js";
|
|
14
15
|
import "../_browser-chunks/chunk-Y3M7TW6K.js";
|
|
15
16
|
import {
|
|
16
17
|
combineParameters
|
|
@@ -21,7 +22,6 @@ import {
|
|
|
21
22
|
} from "../_browser-chunks/chunk-FUOHXXZT.js";
|
|
22
23
|
import "../_browser-chunks/chunk-AB7OOPUX.js";
|
|
23
24
|
import "../_browser-chunks/chunk-F4Q6SGTB.js";
|
|
24
|
-
import "../_browser-chunks/chunk-LYCSRYYR.js";
|
|
25
25
|
import "../_browser-chunks/chunk-UTNZYD2N.js";
|
|
26
26
|
import "../_browser-chunks/chunk-FSBVR7H5.js";
|
|
27
27
|
import "../_browser-chunks/chunk-NVV6MIOE.js";
|
|
@@ -2341,20 +2341,27 @@ var enhanceContext = /* @__PURE__ */ __name(async (context) => {
|
|
|
2341
2341
|
get: /* @__PURE__ */ __name(() => clipboard, "get"),
|
|
2342
2342
|
configurable: true
|
|
2343
2343
|
});
|
|
2344
|
-
let currentFocus = HTMLElement.prototype.focus;
|
|
2345
2344
|
if (!patchedFocus) {
|
|
2345
|
+
const originalFocus = HTMLElement.prototype.focus;
|
|
2346
|
+
let currentFocus = HTMLElement.prototype.focus;
|
|
2347
|
+
const focusingElements = /* @__PURE__ */ new Set();
|
|
2346
2348
|
Object.defineProperties(HTMLElement.prototype, {
|
|
2347
2349
|
focus: {
|
|
2348
2350
|
configurable: true,
|
|
2349
2351
|
set: /* @__PURE__ */ __name((newFocus) => {
|
|
2350
2352
|
currentFocus = newFocus;
|
|
2351
|
-
patchedFocus = true;
|
|
2352
2353
|
}, "set"),
|
|
2353
|
-
get
|
|
2354
|
+
get() {
|
|
2355
|
+
if (focusingElements.has(this)) {
|
|
2356
|
+
return originalFocus;
|
|
2357
|
+
}
|
|
2358
|
+
focusingElements.add(this);
|
|
2359
|
+
setTimeout(() => focusingElements.delete(this), 0);
|
|
2354
2360
|
return currentFocus;
|
|
2355
|
-
}
|
|
2361
|
+
}
|
|
2356
2362
|
}
|
|
2357
2363
|
});
|
|
2364
|
+
patchedFocus = true;
|
|
2358
2365
|
}
|
|
2359
2366
|
}
|
|
2360
2367
|
}, "enhanceContext");
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { types, NodePath, GeneratorOptions, generate, RecastOptions } from 'storybook/internal/babel';
|
|
2
2
|
export { babelParse } from 'storybook/internal/babel';
|
|
3
|
-
import { ComponentAnnotations, StoryAnnotations, IndexInputStats, IndexedCSFFile, IndexInput, StoriesEntry, Tag } from 'storybook/internal/types';
|
|
3
|
+
import { ComponentAnnotations, StoryAnnotations, IndexInputStats, IndexedCSFFile, IndexInput, CsfEnricher, StoriesEntry, Tag } from 'storybook/internal/types';
|
|
4
4
|
|
|
5
5
|
interface PrintResultType {
|
|
6
6
|
code: string;
|
|
@@ -13,7 +13,7 @@ interface BabelFile {
|
|
|
13
13
|
opts: any;
|
|
14
14
|
hub: any;
|
|
15
15
|
metadata: object;
|
|
16
|
-
path:
|
|
16
|
+
path: NodePath<types.Program>;
|
|
17
17
|
scope: any;
|
|
18
18
|
inputMap: object | null;
|
|
19
19
|
code: string;
|
|
@@ -64,13 +64,16 @@ declare class CsfFile {
|
|
|
64
64
|
_file: BabelFile;
|
|
65
65
|
_options: CsfOptions;
|
|
66
66
|
_rawComponentPath?: string;
|
|
67
|
+
_componentImportSpecifier?: types.ImportSpecifier | types.ImportDefaultSpecifier;
|
|
67
68
|
_meta?: StaticMeta;
|
|
68
69
|
_stories: Record<string, StaticStory>;
|
|
69
70
|
_metaAnnotations: Record<string, types.Node>;
|
|
70
71
|
_storyExports: Record<string, types.VariableDeclarator | types.FunctionDeclaration>;
|
|
72
|
+
_storyDeclarationPath: Record<string, NodePath<types.VariableDeclarator | types.FunctionDeclaration>>;
|
|
71
73
|
_storyPaths: Record<string, NodePath<types.ExportNamedDeclaration>>;
|
|
72
74
|
_metaStatement: types.Statement | undefined;
|
|
73
|
-
|
|
75
|
+
_metaStatementPath: NodePath<types.Statement> | undefined;
|
|
76
|
+
_metaNode: types.ObjectExpression | undefined;
|
|
74
77
|
_metaPath: NodePath<types.ExportDefaultDeclaration> | undefined;
|
|
75
78
|
_metaVariableName: string | undefined;
|
|
76
79
|
_metaIsFactory: boolean | undefined;
|
|
@@ -117,6 +120,13 @@ declare class ConfigFile {
|
|
|
117
120
|
hasDefaultExport: boolean;
|
|
118
121
|
constructor(ast: types.File, code: string, fileName?: string);
|
|
119
122
|
_parseExportsObject(exportsObject: types.ObjectExpression): void;
|
|
123
|
+
/** Unwraps TS assertions/satisfies from a node, to get the underlying node. */
|
|
124
|
+
_unwrap: (node: types.Node | undefined | null) => any;
|
|
125
|
+
/**
|
|
126
|
+
* Resolve a declaration node by unwrapping TS assertions/satisfies and following identifiers to
|
|
127
|
+
* resolve the correct node in case it's an identifier.
|
|
128
|
+
*/
|
|
129
|
+
_resolveDeclaration: (node: types.Node, parent?: types.Node) => any;
|
|
120
130
|
parse(): this;
|
|
121
131
|
getFieldNode(path: string[]): types.Node | undefined;
|
|
122
132
|
getFieldProperties(path: string[]): ReturnType<typeof _getPathProperties>;
|
|
@@ -263,10 +273,11 @@ declare const getStorySortParameter: (previewCode: string) => any;
|
|
|
263
273
|
interface EnrichCsfOptions {
|
|
264
274
|
disableSource?: boolean;
|
|
265
275
|
disableDescription?: boolean;
|
|
276
|
+
enrichCsf?: CsfEnricher;
|
|
266
277
|
}
|
|
267
278
|
declare const enrichCsfStory: (csf: CsfFile, csfSource: CsfFile, key: string, options?: EnrichCsfOptions) => void;
|
|
268
279
|
declare const enrichCsfMeta: (csf: CsfFile, csfSource: CsfFile, options?: EnrichCsfOptions) => void;
|
|
269
|
-
declare const enrichCsf: (csf: CsfFile, csfSource: CsfFile, options?: EnrichCsfOptions) => void
|
|
280
|
+
declare const enrichCsf: (csf: CsfFile, csfSource: CsfFile, options?: EnrichCsfOptions) => Promise<void>;
|
|
270
281
|
declare const extractSource: (node: types.Node) => string;
|
|
271
282
|
declare const extractDescription: (node?: types.Node) => string;
|
|
272
283
|
|
package/dist/csf-tools/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_8vqew0zn9si from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_8vqew0zn9si from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_8vqew0zn9si from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_8vqew0zn9si.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_8vqew0zn9si.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_8vqew0zn9si.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -38,9 +38,9 @@ import {
|
|
|
38
38
|
vitestTransform,
|
|
39
39
|
writeConfig,
|
|
40
40
|
writeCsf
|
|
41
|
-
} from "../_node-chunks/chunk-
|
|
42
|
-
import "../_node-chunks/chunk-
|
|
43
|
-
import "../_node-chunks/chunk-
|
|
41
|
+
} from "../_node-chunks/chunk-D7NIZELR.js";
|
|
42
|
+
import "../_node-chunks/chunk-5OVB4A6F.js";
|
|
43
|
+
import "../_node-chunks/chunk-OOI74AL3.js";
|
|
44
44
|
export {
|
|
45
45
|
BadMetaError,
|
|
46
46
|
ConfigFile,
|