storybook 10.2.0-alpha.11 → 10.2.0-alpha.12
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/chunk-AFVOZMXQ.js +23 -0
- package/dist/_browser-chunks/{chunk-RBABWY22.js → chunk-BGSDJMFM.js} +6 -4
- package/dist/_node-chunks/{builder-manager-MNAUTRWW.js → builder-manager-G3T6FATF.js} +13 -12
- package/dist/_node-chunks/{camelcase-6H4Z5R35.js → camelcase-NMVRRV6V.js} +7 -7
- package/dist/_node-chunks/chunk-BDTFFW43.js +18 -0
- package/dist/_node-chunks/chunk-ENNXNDBF.js +20 -0
- package/dist/_node-chunks/{chunk-5L22ATN3.js → chunk-EO2J5FE4.js} +8 -8
- package/dist/_node-chunks/{chunk-7FH4U6XC.js → chunk-ERDFVJJE.js} +15 -12
- package/dist/_node-chunks/{chunk-UOHDPKIW.js → chunk-FXCJJSMM.js} +7 -7
- package/dist/_node-chunks/chunk-G4RT3MO3.js +35 -0
- package/dist/_node-chunks/{chunk-GRH5JFTX.js → chunk-HMDODR3W.js} +7 -7
- package/dist/_node-chunks/{chunk-O7O53MP7.js → chunk-HSXHYDWU.js} +12 -12
- package/dist/_node-chunks/{chunk-2DZGIXSN.js → chunk-HVD2LZT3.js} +6 -6
- package/dist/_node-chunks/{chunk-URWJMVZI.js → chunk-IQUZPWN3.js} +7 -7
- package/dist/_node-chunks/{chunk-UNUWAUGG.js → chunk-IW5UJQJL.js} +6 -6
- package/dist/_node-chunks/{chunk-KU4SWNDM.js → chunk-KK73AHXT.js} +7 -7
- package/dist/_node-chunks/{chunk-MAMDH2R3.js → chunk-LF7P2YRI.js} +7 -7
- package/dist/_node-chunks/{chunk-WHIAK7AH.js → chunk-LMYWY6ZJ.js} +12 -12
- package/dist/_node-chunks/{chunk-HXFHXVEW.js → chunk-MCTOTRJG.js} +20 -20
- package/dist/_node-chunks/{chunk-F3OHO2BC.js → chunk-MDDTIMMD.js} +13 -13
- package/dist/_node-chunks/{chunk-L22DGLKT.js → chunk-OJ2CMYDH.js} +6 -6
- package/dist/_node-chunks/chunk-OQ42LCEX.js +61 -0
- package/dist/_node-chunks/{chunk-CMQYFTBQ.js → chunk-QGMW4WKW.js} +6 -6
- package/dist/_node-chunks/{chunk-MAQAZSXK.js → chunk-SEUBEMNQ.js} +6 -6
- package/dist/_node-chunks/{chunk-RJY225Z5.js → chunk-TFFPC3VZ.js} +7 -7
- package/dist/_node-chunks/chunk-TKRINGRM.js +23 -0
- package/dist/_node-chunks/{chunk-TFY6QV57.js → chunk-UEL7SAB5.js} +7 -7
- package/dist/_node-chunks/{chunk-UYMZAYR4.js → chunk-VBIK2FN2.js} +9 -9
- package/dist/_node-chunks/{chunk-TOMGRF4A.js → chunk-VL57YBAT.js} +10 -10
- package/dist/_node-chunks/{chunk-FWVZUHZX.js → chunk-WMWMEGTL.js} +6 -6
- package/dist/_node-chunks/{chunk-KAIK7772.js → chunk-XE2EF6IL.js} +9 -9
- package/dist/_node-chunks/{chunk-WQ4WQYSZ.js → chunk-YPYOZM4G.js} +7 -7
- package/dist/_node-chunks/{dist-ZOBQQCBA.js → dist-4VO67SAZ.js} +9 -9
- package/dist/_node-chunks/{globby-WNZSV3ZO.js → globby-4KANABX2.js} +9 -9
- package/dist/_node-chunks/{lib-YUWKNDR2.js → lib-2MKCQZND.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-K5BCUPEA.js → mdx-N42X6CFJ-3ENJ5IE5.js} +8 -8
- package/dist/_node-chunks/{p-limit-ROJSQI7F.js → p-limit-TLF7WD5L.js} +7 -7
- package/dist/babel/index.js +10 -10
- package/dist/bin/core.js +12 -12
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +9 -9
- package/dist/cli/index.js +18 -18
- package/dist/common/index.js +19 -19
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +4 -0
- package/dist/core-server/index.d.ts +27 -2
- package/dist/core-server/index.js +45 -43
- package/dist/core-server/presets/common-manager.js +2 -2
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +25 -24
- package/dist/csf/index.js +5 -2
- package/dist/csf-tools/index.js +10 -9
- package/dist/manager/globals-runtime.js +87 -23
- package/dist/manager/runtime.js +87 -886
- package/dist/manager-api/index.d.ts +86 -20
- package/dist/manager-api/index.js +52 -6
- package/dist/mocking-utils/index.js +8 -8
- package/dist/node-logger/index.js +9 -9
- package/dist/preview/runtime.js +24 -4
- package/dist/preview-api/index.d.ts +26 -1
- package/dist/preview-api/index.js +5 -1
- package/dist/server-errors.js +11 -11
- package/dist/telemetry/index.js +22 -22
- package/dist/types/index.d.ts +1 -0
- package/package.json +1 -1
- package/dist/_node-chunks/chunk-2CGMTALY.js +0 -61
- package/dist/_node-chunks/chunk-KX7OAVXY.js +0 -18
- package/dist/_node-chunks/chunk-P663SP7U.js +0 -20
- package/dist/_node-chunks/chunk-RI4IBKXZ.js +0 -23
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0j7q77gppets from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0j7q77gppets from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0j7q77gppets from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0j7q77gppets.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0j7q77gppets.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0j7q77gppets.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-KK73AHXT.js";
|
|
15
15
|
import {
|
|
16
16
|
slash
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
18
|
-
import "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-ENNXNDBF.js";
|
|
18
|
+
import "../../_node-chunks/chunk-WMWMEGTL.js";
|
|
19
19
|
|
|
20
20
|
// src/core-server/utils/remove-mdx-entries.ts
|
|
21
21
|
import { isAbsolute, join, relative } from "node:path";
|
|
@@ -1,53 +1,54 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0j7q77gppets from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0j7q77gppets from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0j7q77gppets from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0j7q77gppets.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0j7q77gppets.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0j7q77gppets.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
11
11
|
// ------------------------------------------------------------
|
|
12
|
-
import "../../_node-chunks/chunk-
|
|
12
|
+
import "../../_node-chunks/chunk-HSXHYDWU.js";
|
|
13
13
|
import {
|
|
14
14
|
parseStaticDir,
|
|
15
15
|
sendTelemetryError,
|
|
16
16
|
throttle
|
|
17
|
-
} from "../../_node-chunks/chunk-
|
|
18
|
-
import "../../_node-chunks/chunk-
|
|
19
|
-
import "../../_node-chunks/chunk-
|
|
20
|
-
import "../../_node-chunks/chunk-
|
|
17
|
+
} from "../../_node-chunks/chunk-MDDTIMMD.js";
|
|
18
|
+
import "../../_node-chunks/chunk-TKRINGRM.js";
|
|
19
|
+
import "../../_node-chunks/chunk-FXCJJSMM.js";
|
|
20
|
+
import "../../_node-chunks/chunk-HVD2LZT3.js";
|
|
21
21
|
import {
|
|
22
22
|
globalSettings
|
|
23
|
-
} from "../../_node-chunks/chunk-
|
|
23
|
+
} from "../../_node-chunks/chunk-XE2EF6IL.js";
|
|
24
24
|
import {
|
|
25
25
|
invariant
|
|
26
|
-
} from "../../_node-chunks/chunk-
|
|
27
|
-
import "../../_node-chunks/chunk-
|
|
26
|
+
} from "../../_node-chunks/chunk-QGMW4WKW.js";
|
|
27
|
+
import "../../_node-chunks/chunk-OJ2CMYDH.js";
|
|
28
28
|
import {
|
|
29
29
|
resolvePackageDir
|
|
30
|
-
} from "../../_node-chunks/chunk-
|
|
30
|
+
} from "../../_node-chunks/chunk-TFFPC3VZ.js";
|
|
31
31
|
import {
|
|
32
32
|
isAbsolute,
|
|
33
33
|
join
|
|
34
|
-
} from "../../_node-chunks/chunk-
|
|
34
|
+
} from "../../_node-chunks/chunk-SEUBEMNQ.js";
|
|
35
35
|
import {
|
|
36
36
|
loadConfig
|
|
37
|
-
} from "../../_node-chunks/chunk-
|
|
37
|
+
} from "../../_node-chunks/chunk-ERDFVJJE.js";
|
|
38
|
+
import "../../_node-chunks/chunk-G4RT3MO3.js";
|
|
38
39
|
import {
|
|
39
40
|
require_dist
|
|
40
|
-
} from "../../_node-chunks/chunk-
|
|
41
|
-
import "../../_node-chunks/chunk-
|
|
42
|
-
import "../../_node-chunks/chunk-
|
|
41
|
+
} from "../../_node-chunks/chunk-IQUZPWN3.js";
|
|
42
|
+
import "../../_node-chunks/chunk-VBIK2FN2.js";
|
|
43
|
+
import "../../_node-chunks/chunk-HMDODR3W.js";
|
|
43
44
|
import {
|
|
44
45
|
require_picocolors
|
|
45
|
-
} from "../../_node-chunks/chunk-
|
|
46
|
+
} from "../../_node-chunks/chunk-YPYOZM4G.js";
|
|
46
47
|
import {
|
|
47
48
|
__commonJS,
|
|
48
49
|
__require,
|
|
49
50
|
__toESM
|
|
50
|
-
} from "../../_node-chunks/chunk-
|
|
51
|
+
} from "../../_node-chunks/chunk-WMWMEGTL.js";
|
|
51
52
|
|
|
52
53
|
// ../../node_modules/shell-quote/quote.js
|
|
53
54
|
var require_quote = __commonJS({
|
|
@@ -515,7 +516,7 @@ import { isCsfFactoryPreview } from "storybook/internal/csf-tools";
|
|
|
515
516
|
var import_ts_dedent = __toESM(require_dist(), 1);
|
|
516
517
|
|
|
517
518
|
// src/core-server/utils/get-component-variable-name.ts
|
|
518
|
-
var getComponentVariableName = async (name) => (await import("../../_node-chunks/camelcase-
|
|
519
|
+
var getComponentVariableName = async (name) => (await import("../../_node-chunks/camelcase-NMVRRV6V.js")).default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: !0 }).replace(/[^a-zA-Z_$]+/, "");
|
|
519
520
|
|
|
520
521
|
// src/core-server/utils/new-story-templates/csf-factory-template.ts
|
|
521
522
|
async function getCsfFactoryTemplateForNewStoryFile(data) {
|
|
@@ -780,7 +781,7 @@ async function searchFiles({
|
|
|
780
781
|
ignoredFiles = IGNORED_FILES,
|
|
781
782
|
fileExtensions = FILE_EXTENSIONS
|
|
782
783
|
}) {
|
|
783
|
-
let { globby, isDynamicPattern } = await import("../../_node-chunks/globby-
|
|
784
|
+
let { globby, isDynamicPattern } = await import("../../_node-chunks/globby-4KANABX2.js"), hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd }), searchQueryHasExtension = /(\.[a-z]+)$/i.test(searchQuery), fileExtensionsPattern = `{${fileExtensions.join(",")}}`, globbedSearchQuery = hasSearchSpecialGlobChars ? searchQuery : searchQueryHasExtension ? [`**/*${searchQuery}*`, `**/*${searchQuery}*/**`] : [
|
|
784
785
|
`**/*${searchQuery}*.${fileExtensionsPattern}`,
|
|
785
786
|
`**/*${searchQuery}*/**/*.${fileExtensionsPattern}`
|
|
786
787
|
];
|
package/dist/csf/index.js
CHANGED
|
@@ -10,8 +10,11 @@ import {
|
|
|
10
10
|
mountDestructured,
|
|
11
11
|
normalizeArrays,
|
|
12
12
|
normalizeProjectAnnotations
|
|
13
|
-
} from "../_browser-chunks/chunk-
|
|
13
|
+
} from "../_browser-chunks/chunk-BGSDJMFM.js";
|
|
14
14
|
import "../_browser-chunks/chunk-MEXTPDJG.js";
|
|
15
|
+
import {
|
|
16
|
+
Tag
|
|
17
|
+
} from "../_browser-chunks/chunk-AFVOZMXQ.js";
|
|
15
18
|
import "../_browser-chunks/chunk-XLJZ7AOP.js";
|
|
16
19
|
import {
|
|
17
20
|
combineParameters
|
|
@@ -1888,7 +1891,7 @@ function defineStory(input, meta) {
|
|
|
1888
1891
|
}, test = this.extend({
|
|
1889
1892
|
...annotations,
|
|
1890
1893
|
name,
|
|
1891
|
-
tags: [
|
|
1894
|
+
tags: [Tag.TEST_FN, `!${Tag.AUTODOCS}`, ...annotations.tags ?? []],
|
|
1892
1895
|
play
|
|
1893
1896
|
});
|
|
1894
1897
|
return __children.push(test), test;
|
package/dist/csf-tools/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_0j7q77gppets from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_0j7q77gppets from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_0j7q77gppets from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_0j7q77gppets.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_0j7q77gppets.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_0j7q77gppets.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -38,9 +38,10 @@ 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-ERDFVJJE.js";
|
|
42
|
+
import "../_node-chunks/chunk-G4RT3MO3.js";
|
|
43
|
+
import "../_node-chunks/chunk-IQUZPWN3.js";
|
|
44
|
+
import "../_node-chunks/chunk-WMWMEGTL.js";
|
|
44
45
|
export {
|
|
45
46
|
BadMetaError,
|
|
46
47
|
ConfigFile,
|
|
@@ -11888,13 +11888,13 @@ var require_space_separated_tokens = __commonJS({
|
|
|
11888
11888
|
"../../node_modules/hastscript/node_modules/space-separated-tokens/index.js"(exports) {
|
|
11889
11889
|
"use strict";
|
|
11890
11890
|
exports.parse = parse9;
|
|
11891
|
-
exports.stringify =
|
|
11891
|
+
exports.stringify = stringify8;
|
|
11892
11892
|
var empty = "", space = " ", whiteSpace = /[ \t\n\r\f]+/g;
|
|
11893
11893
|
function parse9(value) {
|
|
11894
11894
|
var input2 = String(value || empty).trim();
|
|
11895
11895
|
return input2 === empty ? [] : input2.split(whiteSpace);
|
|
11896
11896
|
}
|
|
11897
|
-
function
|
|
11897
|
+
function stringify8(values) {
|
|
11898
11898
|
return values.join(space).trim();
|
|
11899
11899
|
}
|
|
11900
11900
|
}
|
|
@@ -11905,14 +11905,14 @@ var require_comma_separated_tokens = __commonJS({
|
|
|
11905
11905
|
"../../node_modules/hastscript/node_modules/comma-separated-tokens/index.js"(exports) {
|
|
11906
11906
|
"use strict";
|
|
11907
11907
|
exports.parse = parse9;
|
|
11908
|
-
exports.stringify =
|
|
11908
|
+
exports.stringify = stringify8;
|
|
11909
11909
|
var comma = ",", space = " ", empty = "";
|
|
11910
11910
|
function parse9(value) {
|
|
11911
11911
|
for (var values = [], input2 = String(value || empty), index4 = input2.indexOf(comma), lastIndex = 0, end2 = !1, val; !end2; )
|
|
11912
11912
|
index4 === -1 && (index4 = input2.length, end2 = !0), val = input2.slice(lastIndex, index4).trim(), (val || !end2) && values.push(val), lastIndex = index4 + 1, index4 = input2.indexOf(comma, lastIndex);
|
|
11913
11913
|
return values;
|
|
11914
11914
|
}
|
|
11915
|
-
function
|
|
11915
|
+
function stringify8(values, options) {
|
|
11916
11916
|
var settings = options || {}, left2 = settings.padLeft === !1 ? empty : space, right2 = settings.padRight ? space : empty;
|
|
11917
11917
|
return values[values.length - 1] === empty && (values = values.concat(empty)), values.join(right2 + comma + left2).trim();
|
|
11918
11918
|
}
|
|
@@ -12877,18 +12877,18 @@ var require_prism_core = __commonJS({
|
|
|
12877
12877
|
function Token(type5, content, alias, matchedStr) {
|
|
12878
12878
|
this.type = type5, this.content = content, this.alias = alias, this.length = (matchedStr || "").length | 0;
|
|
12879
12879
|
}
|
|
12880
|
-
Token.stringify = function
|
|
12880
|
+
Token.stringify = function stringify8(o, language) {
|
|
12881
12881
|
if (typeof o == "string")
|
|
12882
12882
|
return o;
|
|
12883
12883
|
if (Array.isArray(o)) {
|
|
12884
12884
|
var s3 = "";
|
|
12885
12885
|
return o.forEach(function(e) {
|
|
12886
|
-
s3 +=
|
|
12886
|
+
s3 += stringify8(e, language);
|
|
12887
12887
|
}), s3;
|
|
12888
12888
|
}
|
|
12889
12889
|
var env = {
|
|
12890
12890
|
type: o.type,
|
|
12891
|
-
content:
|
|
12891
|
+
content: stringify8(o.content, language),
|
|
12892
12892
|
tag: "span",
|
|
12893
12893
|
classes: ["token", o.type],
|
|
12894
12894
|
attributes: {},
|
|
@@ -13198,7 +13198,7 @@ var require_core = __commonJS({
|
|
|
13198
13198
|
register(clike);
|
|
13199
13199
|
register(js);
|
|
13200
13200
|
refract.util.encode = encode2;
|
|
13201
|
-
refract.Token.stringify =
|
|
13201
|
+
refract.Token.stringify = stringify8;
|
|
13202
13202
|
function register(grammar) {
|
|
13203
13203
|
if (typeof grammar != "function" || !grammar.displayName)
|
|
13204
13204
|
throw new Error("Expected `function` for `grammar`, got `" + grammar + "`");
|
|
@@ -13238,7 +13238,7 @@ var require_core = __commonJS({
|
|
|
13238
13238
|
own.call(languages2, language) && typeof languages2[language] == "object" && list.push(language);
|
|
13239
13239
|
return list;
|
|
13240
13240
|
}
|
|
13241
|
-
function
|
|
13241
|
+
function stringify8(value, language, parent) {
|
|
13242
13242
|
var env;
|
|
13243
13243
|
return typeof value == "string" ? { type: "text", value } : refract.util.type(value) === "Array" ? stringifyAll(value, language) : (env = {
|
|
13244
13244
|
type: value.type,
|
|
@@ -15292,9 +15292,9 @@ var require_stringify = __commonJS({
|
|
|
15292
15292
|
"../../node_modules/picoquery/lib/stringify.js"(exports) {
|
|
15293
15293
|
"use strict";
|
|
15294
15294
|
Object.defineProperty(exports, "__esModule", { value: !0 });
|
|
15295
|
-
exports.stringify =
|
|
15295
|
+
exports.stringify = stringify8;
|
|
15296
15296
|
var object_util_js_1 = require_object_util();
|
|
15297
|
-
function
|
|
15297
|
+
function stringify8(input2, options) {
|
|
15298
15298
|
if (input2 === null || typeof input2 != "object")
|
|
15299
15299
|
return "";
|
|
15300
15300
|
let optionsObj = options ?? {};
|
|
@@ -17310,7 +17310,7 @@ var require_dist = __commonJS({
|
|
|
17310
17310
|
};
|
|
17311
17311
|
}
|
|
17312
17312
|
let storedStringifyRules = stringifyRules2();
|
|
17313
|
-
function
|
|
17313
|
+
function stringify8(result) {
|
|
17314
17314
|
return transform(storedStringifyRules, result);
|
|
17315
17315
|
}
|
|
17316
17316
|
let reservedWords2 = [
|
|
@@ -17944,7 +17944,7 @@ var require_dist = __commonJS({
|
|
|
17944
17944
|
function traverse(node2, onEnter, onLeave) {
|
|
17945
17945
|
_traverse(node2, void 0, void 0, onEnter, onLeave);
|
|
17946
17946
|
}
|
|
17947
|
-
exports2.catharsisTransform = catharsisTransform, exports2.identityTransformRules = identityTransformRules, exports2.jtpTransform = jtpTransform, exports2.parse = parse9, exports2.stringify =
|
|
17947
|
+
exports2.catharsisTransform = catharsisTransform, exports2.identityTransformRules = identityTransformRules, exports2.jtpTransform = jtpTransform, exports2.parse = parse9, exports2.stringify = stringify8, exports2.stringifyRules = stringifyRules2, exports2.transform = transform, exports2.traverse = traverse, exports2.tryParse = tryParse, exports2.visitorKeys = visitorKeys;
|
|
17948
17948
|
}));
|
|
17949
17949
|
}
|
|
17950
17950
|
});
|
|
@@ -40608,6 +40608,7 @@ __export(manager_api_exports, {
|
|
|
40608
40608
|
ManagerContext: () => ManagerContext,
|
|
40609
40609
|
Provider: () => ManagerProvider,
|
|
40610
40610
|
RequestResponseError: () => RequestResponseError,
|
|
40611
|
+
Tag: () => Tag,
|
|
40611
40612
|
addons: () => addons,
|
|
40612
40613
|
combineParameters: () => combineParameters2,
|
|
40613
40614
|
controlOrMetaKey: () => controlOrMetaKey,
|
|
@@ -41436,6 +41437,26 @@ init_client_logger();
|
|
|
41436
41437
|
init_dist();
|
|
41437
41438
|
init_dist();
|
|
41438
41439
|
|
|
41440
|
+
// src/shared/constants/tags.ts
|
|
41441
|
+
var Tag = {
|
|
41442
|
+
/** Indicates that autodocs should be generated for this component */
|
|
41443
|
+
AUTODOCS: "autodocs",
|
|
41444
|
+
/** MDX documentation attached to a component's stories file */
|
|
41445
|
+
ATTACHED_MDX: "attached-mdx",
|
|
41446
|
+
/** Standalone MDX documentation not attached to stories */
|
|
41447
|
+
UNATTACHED_MDX: "unattached-mdx",
|
|
41448
|
+
/** Story has a play function */
|
|
41449
|
+
PLAY_FN: "play-fn",
|
|
41450
|
+
/** Story has a test function */
|
|
41451
|
+
TEST_FN: "test-fn",
|
|
41452
|
+
/** Development environment tag */
|
|
41453
|
+
DEV: "dev",
|
|
41454
|
+
/** Test environment tag */
|
|
41455
|
+
TEST: "test",
|
|
41456
|
+
/** Manifest generation tag */
|
|
41457
|
+
MANIFEST: "manifest"
|
|
41458
|
+
};
|
|
41459
|
+
|
|
41439
41460
|
// src/preview-api/modules/store/parameters.ts
|
|
41440
41461
|
var combineParameters = (...parameterSets) => {
|
|
41441
41462
|
let mergeKeys = {}, definedParametersSets = parameterSets.filter(Boolean), combined = definedParametersSets.reduce((acc, parameters2) => (Object.entries(parameters2).forEach(([key, value]) => {
|
|
@@ -49113,11 +49134,11 @@ function toHaveAccessibleName(htmlElement, expectedAccessibleName) {
|
|
|
49113
49134
|
}
|
|
49114
49135
|
};
|
|
49115
49136
|
}
|
|
49116
|
-
function printAttribute(
|
|
49117
|
-
return value === void 0 ? name : `${name}=${
|
|
49137
|
+
function printAttribute(stringify8, name, value) {
|
|
49138
|
+
return value === void 0 ? name : `${name}=${stringify8(value)}`;
|
|
49118
49139
|
}
|
|
49119
|
-
function getAttributeComment(
|
|
49120
|
-
return value === void 0 ? `element.hasAttribute(${
|
|
49140
|
+
function getAttributeComment(stringify8, name, value) {
|
|
49141
|
+
return value === void 0 ? `element.hasAttribute(${stringify8(name)})` : `element.getAttribute(${stringify8(name)}) === ${stringify8(value)}`;
|
|
49121
49142
|
}
|
|
49122
49143
|
function toHaveAttribute(htmlElement, name, expectedValue) {
|
|
49123
49144
|
checkHtmlElement(htmlElement, toHaveAttribute, this);
|
|
@@ -59475,7 +59496,7 @@ var TITLE_PATH_SEPARATOR = /\s*\/\s*/, denormalizeStoryParameters = ({
|
|
|
59475
59496
|
entries: Object.values(index4.entries).reduce(
|
|
59476
59497
|
(acc, entry) => (acc[entry.id] = {
|
|
59477
59498
|
...entry,
|
|
59478
|
-
tags: entry.tags ? [
|
|
59499
|
+
tags: entry.tags ? [Tag.DEV, Tag.TEST, ...entry.tags] : [Tag.DEV]
|
|
59479
59500
|
}, acc),
|
|
59480
59501
|
{}
|
|
59481
59502
|
)
|
|
@@ -60269,6 +60290,7 @@ var defaultShortcuts = Object.freeze({
|
|
|
60269
60290
|
expandAll: [controlOrMetaKey2(), "shift", "ArrowDown"],
|
|
60270
60291
|
remount: ["alt", "R"],
|
|
60271
60292
|
openInEditor: ["alt", "shift", "E"],
|
|
60293
|
+
openInIsolation: ["alt", "shift", "I"],
|
|
60272
60294
|
copyStoryLink: ["alt", "shift", "L"]
|
|
60273
60295
|
// TODO: bring this back once we want to add shortcuts for this
|
|
60274
60296
|
// copyStoryName: ['alt', 'shift', 'C'],
|
|
@@ -60336,7 +60358,9 @@ var init11 = ({ store: store2, fullAPI, provider }) => {
|
|
|
60336
60358
|
handleShortcutFeature(feature, event) {
|
|
60337
60359
|
let {
|
|
60338
60360
|
ui: { enableShortcuts },
|
|
60339
|
-
storyId
|
|
60361
|
+
storyId,
|
|
60362
|
+
refId,
|
|
60363
|
+
viewMode
|
|
60340
60364
|
} = store2.getState();
|
|
60341
60365
|
if (enableShortcuts)
|
|
60342
60366
|
switch (event?.preventDefault && event.preventDefault(), feature) {
|
|
@@ -60429,6 +60453,13 @@ var init11 = ({ store: store2, fullAPI, provider }) => {
|
|
|
60429
60453
|
});
|
|
60430
60454
|
break;
|
|
60431
60455
|
}
|
|
60456
|
+
case "openInIsolation": {
|
|
60457
|
+
if (storyId && viewMode === "story") {
|
|
60458
|
+
let { previewHref } = fullAPI.getStoryHrefs(storyId, { refId });
|
|
60459
|
+
window.open(previewHref, "_blank", "noopener,noreferrer");
|
|
60460
|
+
}
|
|
60461
|
+
break;
|
|
60462
|
+
}
|
|
60432
60463
|
// TODO: bring this back once we want to add shortcuts for this
|
|
60433
60464
|
// case 'copyStoryName': {
|
|
60434
60465
|
// const storyData = fullAPI.getCurrentStoryData();
|
|
@@ -60438,7 +60469,10 @@ var init11 = ({ store: store2, fullAPI, provider }) => {
|
|
|
60438
60469
|
// break;
|
|
60439
60470
|
// }
|
|
60440
60471
|
case "copyStoryLink": {
|
|
60441
|
-
|
|
60472
|
+
if (storyId) {
|
|
60473
|
+
let { managerHref } = fullAPI.getStoryHrefs(storyId, { refId });
|
|
60474
|
+
(0, import_copy_to_clipboard.default)(managerHref);
|
|
60475
|
+
}
|
|
60442
60476
|
break;
|
|
60443
60477
|
}
|
|
60444
60478
|
default:
|
|
@@ -61968,11 +62002,17 @@ var LocationProvider = (...args) => BrowserRouter(...args), BaseLocationProvider
|
|
|
61968
62002
|
|
|
61969
62003
|
// src/manager-api/modules/url.ts
|
|
61970
62004
|
init_dist();
|
|
61971
|
-
var
|
|
62005
|
+
var import_picoquery5 = __toESM(require_main(), 1);
|
|
62006
|
+
var parseBoolean = (value) => {
|
|
61972
62007
|
if (value === "true" || value === "1")
|
|
61973
62008
|
return !0;
|
|
61974
62009
|
if (value === "false" || value === "0")
|
|
61975
62010
|
return !1;
|
|
62011
|
+
}, parseSerializedParam = (param) => Object.fromEntries(
|
|
62012
|
+
param.split(";").map((pair) => pair.split(":")).map(([key, value]) => [key, encodeURIComponent(value)]).filter(([key, value]) => key && value)
|
|
62013
|
+
), mergeSerializedParams = (params, extraParams) => {
|
|
62014
|
+
let pairs = parseSerializedParam(params), extra = parseSerializedParam(extraParams);
|
|
62015
|
+
return Object.entries({ ...pairs, ...extra }).map(([key, value]) => `${key}:${value}`).join(";");
|
|
61976
62016
|
}, prevParams, initialUrlSupport = ({
|
|
61977
62017
|
state: { location: location4, path, viewMode, storyId: storyIdFromUrl },
|
|
61978
62018
|
singleStory
|
|
@@ -62004,6 +62044,26 @@ var { window: globalWindow4 } = scope, parseBoolean = (value) => {
|
|
|
62004
62044
|
let params = Object.entries(queryParams).filter(([, v]) => v).sort(([a3], [b]) => a3 < b ? -1 : 1).map(([k, v]) => `${k}=${v}`), to = [path, ...params].join("&");
|
|
62005
62045
|
return navigate(to, options);
|
|
62006
62046
|
}, api = {
|
|
62047
|
+
getStoryHrefs(storyId, options = {}) {
|
|
62048
|
+
let { id: currentStoryId, refId: currentRefId } = fullAPI.getCurrentStoryData() ?? {}, isCurrentStory = storyId === currentStoryId && options.refId === currentRefId, { customQueryParams, location: location4, refs } = store2.getState(), {
|
|
62049
|
+
base,
|
|
62050
|
+
inheritArgs = isCurrentStory,
|
|
62051
|
+
inheritGlobals = !0,
|
|
62052
|
+
queryParams = {},
|
|
62053
|
+
refId,
|
|
62054
|
+
viewMode = "story"
|
|
62055
|
+
} = options;
|
|
62056
|
+
if (refId && !refs[refId])
|
|
62057
|
+
throw new Error(`Invalid refId: ${refId}`);
|
|
62058
|
+
let originAddress = scope.window.location.origin + location4.pathname, networkAddress = scope.STORYBOOK_NETWORK_ADDRESS ?? originAddress, managerBase = base === "origin" ? originAddress : base === "network" ? networkAddress : location4.pathname, previewBase = refId ? refs[refId].url + "/iframe.html" : scope.PREVIEW_URL || `${managerBase}iframe.html`, refParam = refId ? `&refId=${encodeURIComponent(refId)}` : "", { args = "", globals = "", ...otherParams } = queryParams, argsParam = inheritArgs ? mergeSerializedParams(customQueryParams?.args ?? "", args) : args, globalsParam = inheritGlobals ? mergeSerializedParams(customQueryParams?.globals ?? "", globals) : globals, customParams = (0, import_picoquery5.stringify)(otherParams, {
|
|
62059
|
+
nesting: !0,
|
|
62060
|
+
nestingSyntax: "js"
|
|
62061
|
+
});
|
|
62062
|
+
return argsParam = argsParam && `&args=${argsParam}`, globalsParam = globalsParam && `&globals=${globalsParam}`, customParams = customParams && `&${customParams}`, {
|
|
62063
|
+
managerHref: `${managerBase}?path=/${viewMode}/${refId ? `${refId}_` : ""}${storyId}${argsParam}${globalsParam}${customParams}`,
|
|
62064
|
+
previewHref: `${previewBase}?id=${storyId}&viewMode=${viewMode}${refParam}${argsParam}${refId ? "" : globalsParam}${customParams}`
|
|
62065
|
+
};
|
|
62066
|
+
},
|
|
62007
62067
|
getQueryParam(key) {
|
|
62008
62068
|
let { customQueryParams } = store2.getState();
|
|
62009
62069
|
return customQueryParams ? customQueryParams[key] : void 0;
|
|
@@ -62046,7 +62106,7 @@ var { window: globalWindow4 } = scope, parseBoolean = (value) => {
|
|
|
62046
62106
|
provider.channel?.on(SET_CURRENT_STORY, () => updateArgsParam());
|
|
62047
62107
|
let handleOrId;
|
|
62048
62108
|
return provider.channel?.on(STORY_ARGS_UPDATED, () => {
|
|
62049
|
-
"requestIdleCallback" in
|
|
62109
|
+
"requestIdleCallback" in scope.window ? (handleOrId && scope.window.cancelIdleCallback(handleOrId), handleOrId = scope.window.requestIdleCallback(updateArgsParam, { timeout: 1e3 })) : (handleOrId && clearTimeout(handleOrId), setTimeout(updateArgsParam, 100));
|
|
62050
62110
|
}), provider.channel?.on(GLOBALS_UPDATED, ({ userGlobals, initialGlobals: initialGlobals5 }) => {
|
|
62051
62111
|
let { path, hash: hash4 = "", queryParams } = api.getUrlState(), globalsString = buildArgsParam(initialGlobals5, userGlobals);
|
|
62052
62112
|
navigateTo(`${path}${hash4}`, { ...queryParams, globals: globalsString }, { replace: !0 }), api.setQueryParams({ globals: globalsString });
|
|
@@ -62067,7 +62127,7 @@ init_dist();
|
|
|
62067
62127
|
var import_memoizerific8 = __toESM(require_memoizerific(), 1), import_semver = __toESM(require_semver2(), 1);
|
|
62068
62128
|
|
|
62069
62129
|
// src/manager-api/version.ts
|
|
62070
|
-
var version = "10.2.0-alpha.
|
|
62130
|
+
var version = "10.2.0-alpha.12";
|
|
62071
62131
|
|
|
62072
62132
|
// src/manager-api/modules/versions.ts
|
|
62073
62133
|
var { VERSIONCHECK } = scope, getVersionCheckData = (0, import_memoizerific8.default)(1)(() => {
|
|
@@ -77669,6 +77729,7 @@ var XMLNS = "http://www.w3.org/2000/svg", rotate = keyframes({
|
|
|
77669
77729
|
}) => typeof percentage == "number" ? import_react188.default.createElement(Wrapper7, { size, ...props }, children, import_react188.default.createElement(Circle, { size, width, xmlns: XMLNS }, import_react188.default.createElement("circle", null)), running && import_react188.default.createElement(Circle, { size, width, xmlns: XMLNS, spinner: !0 }, import_react188.default.createElement("circle", { strokeDashoffset: Math.PI * (size - Math.ceil(width)) * (1 - percentage / 100) })), import_react188.default.createElement(Circle, { size, width, xmlns: XMLNS, progress: !0 }, import_react188.default.createElement("circle", { strokeDashoffset: Math.PI * (size - Math.ceil(width)) * (1 - percentage / 100) }))) : import_react188.default.createElement(Wrapper7, { size, ...props }, children);
|
|
77670
77730
|
|
|
77671
77731
|
// src/components/components/utils/getStoryHref.ts
|
|
77732
|
+
init_client_logger();
|
|
77672
77733
|
function parseQuery(queryString) {
|
|
77673
77734
|
let query = {}, pairs = queryString.split("&");
|
|
77674
77735
|
for (let i = 0; i < pairs.length; i++) {
|
|
@@ -77678,6 +77739,9 @@ function parseQuery(queryString) {
|
|
|
77678
77739
|
return query;
|
|
77679
77740
|
}
|
|
77680
77741
|
var getStoryHref = (baseUrl, storyId, additionalParams = {}) => {
|
|
77742
|
+
deprecate(
|
|
77743
|
+
"getStoryHref is deprecated and will be removed in Storybook 11, use the api.getStoryHrefs method instead"
|
|
77744
|
+
);
|
|
77681
77745
|
let [url, paramsStr] = baseUrl.split("?"), params = paramsStr ? {
|
|
77682
77746
|
...parseQuery(paramsStr),
|
|
77683
77747
|
...additionalParams,
|