storybook 10.1.0-alpha.13 → 10.1.0-alpha.14
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-WXP2XJ3O.js → chunk-P4F4UVXX.js} +1 -0
- package/dist/_browser-chunks/{chunk-BE2DAXKJ.js → chunk-SS2NHR7W.js} +4 -1
- package/dist/_browser-chunks/{syntaxhighlighter-WKBQ5RC7.js → syntaxhighlighter-IQDEPFLK.js} +1 -1
- package/dist/_node-chunks/{builder-manager-DWDUVXZM.js → builder-manager-FQ5J6V3U.js} +17 -12
- package/dist/_node-chunks/{camelcase-EETCRTJX.js → camelcase-VGUYV77Z.js} +7 -7
- package/dist/_node-chunks/{chunk-FCVNHU2F.js → chunk-2JR3QBT2.js} +7 -7
- package/dist/_node-chunks/chunk-3EBH66BB.js +23 -0
- package/dist/_node-chunks/{chunk-447655DM.js → chunk-4ZFHN3ZY.js} +6 -6
- package/dist/_node-chunks/{chunk-RUUNVQ6W.js → chunk-63PL4NNE.js} +9 -9
- package/dist/_node-chunks/{chunk-OVVZIUHS.js → chunk-A4KENTXT.js} +7 -7
- package/dist/_node-chunks/{chunk-XKRVQL2G.js → chunk-ALIA3J6S.js} +44 -10
- package/dist/_node-chunks/{chunk-4EJUC2SD.js → chunk-C2HKH2XQ.js} +31 -48
- package/dist/_node-chunks/{chunk-LPKSBF62.js → chunk-DQNBAQYT.js} +6 -6
- package/dist/_node-chunks/{chunk-MIA5324I.js → chunk-F74UHHR6.js} +7 -7
- package/dist/_node-chunks/{chunk-B76FDKVB.js → chunk-H5XWXVWR.js} +6 -6
- package/dist/_node-chunks/{chunk-WC2YEQHJ.js → chunk-JMP7YFX2.js} +6 -6
- package/dist/_node-chunks/{chunk-DPFYWXEA.js → chunk-JZR4DHG2.js} +19 -7
- package/dist/_node-chunks/{chunk-DIPKXLEP.js → chunk-KEA7CVMZ.js} +80 -13
- package/dist/_node-chunks/{chunk-CMYD2JNN.js → chunk-KF3WTAEP.js} +7 -7
- package/dist/_node-chunks/{chunk-URLNGLC2.js → chunk-LPPM7L5D.js} +10 -10
- package/dist/_node-chunks/{chunk-7IAVT2FU.js → chunk-MJUDR7HQ.js} +7 -7
- package/dist/_node-chunks/chunk-NPB4THZQ.js +18 -0
- package/dist/_node-chunks/chunk-NZBK3DSJ.js +29 -0
- package/dist/_node-chunks/{chunk-7KFHRNOT.js → chunk-Q2QUNQK6.js} +7 -7
- package/dist/_node-chunks/{chunk-CLUBH2LP.js → chunk-TMCKISJR.js} +65 -101
- package/dist/_node-chunks/chunk-TWK7AR3U.js +6024 -0
- package/dist/_node-chunks/{chunk-2W4GZCLE.js → chunk-V7CXWJXC.js} +7 -7
- package/dist/_node-chunks/{chunk-B7PGKETD.js → chunk-W4F3T6CY.js} +8 -8
- package/dist/_node-chunks/{chunk-Z2OWEMX3.js → chunk-WACDSFMO.js} +9 -9
- package/dist/_node-chunks/{chunk-MJM4TEMP.js → chunk-WVXZFQQU.js} +7 -7
- package/dist/_node-chunks/{chunk-LYEZOJ43.js → chunk-XBPE4PT7.js} +6 -6
- package/dist/_node-chunks/chunk-YMM6BYF2.js +61 -0
- package/dist/_node-chunks/{chunk-AZIPBEBK.js → chunk-ZGZKNZ5S.js} +6 -6
- package/dist/_node-chunks/{dist-22CLJ4BC.js → dist-DR3AP3RJ.js} +9 -9
- package/dist/_node-chunks/{globby-GR24TGSK.js → globby-D4FPSHY2.js} +9 -9
- package/dist/_node-chunks/{lib-G2LGVRPC.js → lib-ZEFOVNTK.js} +7 -7
- package/dist/_node-chunks/{mdx-N42X6CFJ-W6P6IDDW.js → mdx-N42X6CFJ-PJF3ICCG.js} +8 -8
- package/dist/_node-chunks/{p-limit-K4FZHG2F.js → p-limit-CYQOFYPV.js} +7 -7
- package/dist/babel/index.js +10 -10
- package/dist/bin/core.js +12 -11
- package/dist/bin/dispatcher.js +11 -11
- package/dist/bin/loader.js +9 -9
- package/dist/cli/index.d.ts +788 -1
- package/dist/cli/index.js +42 -5999
- package/dist/common/index.d.ts +1 -1
- package/dist/common/index.js +22 -21
- package/dist/components/index.d.ts +136 -26
- package/dist/components/index.js +3163 -2859
- package/dist/core-server/index.js +51 -108
- package/dist/core-server/presets/common-manager.js +5 -5
- package/dist/core-server/presets/common-override-preset.js +9 -9
- package/dist/core-server/presets/common-preset.js +266 -35
- package/dist/csf/index.js +2 -2
- package/dist/csf-tools/index.js +9 -9
- package/dist/manager/globals-runtime.js +21553 -21158
- package/dist/manager/manager-stores.d.ts +1 -0
- package/dist/manager/manager-stores.js +23 -0
- package/dist/manager/runtime.js +6694 -719
- package/dist/manager-api/index.d.ts +1803 -2
- package/dist/manager-api/index.js +102 -8
- package/dist/mocking-utils/index.js +8 -8
- package/dist/node-logger/index.js +9 -9
- package/dist/preview/runtime.js +4 -1
- package/dist/preview-api/index.js +2 -2
- package/dist/server-errors.js +11 -11
- package/dist/telemetry/index.d.ts +2 -2
- package/dist/telemetry/index.js +23 -23
- package/package.json +5 -1
- package/dist/_node-chunks/chunk-4ZJOH2UN.js +0 -61
- package/dist/_node-chunks/chunk-654SJIMS.js +0 -23
- package/dist/_node-chunks/chunk-JQ7RQS5Q.js +0 -26
- package/dist/_node-chunks/chunk-LEL5OSY3.js +0 -18
|
@@ -1,48 +1,57 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-TWK7AR3U.js";
|
|
12
13
|
import {
|
|
13
14
|
parseStaticDir,
|
|
14
|
-
sendTelemetryError
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
import "../../_node-chunks/chunk-
|
|
15
|
+
sendTelemetryError,
|
|
16
|
+
throttle
|
|
17
|
+
} from "../../_node-chunks/chunk-KEA7CVMZ.js";
|
|
18
|
+
import "../../_node-chunks/chunk-V7CXWJXC.js";
|
|
19
|
+
import "../../_node-chunks/chunk-3EBH66BB.js";
|
|
20
|
+
import "../../_node-chunks/chunk-XBPE4PT7.js";
|
|
18
21
|
import {
|
|
19
22
|
getLastEvents,
|
|
20
23
|
getSessionId
|
|
21
|
-
} from "../../_node-chunks/chunk-
|
|
24
|
+
} from "../../_node-chunks/chunk-H5XWXVWR.js";
|
|
25
|
+
import {
|
|
26
|
+
globalSettings
|
|
27
|
+
} from "../../_node-chunks/chunk-ALIA3J6S.js";
|
|
22
28
|
import {
|
|
23
29
|
invariant
|
|
24
|
-
} from "../../_node-chunks/chunk-
|
|
30
|
+
} from "../../_node-chunks/chunk-JZR4DHG2.js";
|
|
25
31
|
import {
|
|
26
32
|
resolvePackageDir
|
|
27
|
-
} from "../../_node-chunks/chunk-
|
|
33
|
+
} from "../../_node-chunks/chunk-WVXZFQQU.js";
|
|
34
|
+
import "../../_node-chunks/chunk-NZBK3DSJ.js";
|
|
28
35
|
import {
|
|
29
36
|
isAbsolute,
|
|
30
37
|
join
|
|
31
|
-
} from "../../_node-chunks/chunk-
|
|
38
|
+
} from "../../_node-chunks/chunk-DQNBAQYT.js";
|
|
32
39
|
import {
|
|
33
40
|
loadConfig
|
|
34
|
-
} from "../../_node-chunks/chunk-
|
|
41
|
+
} from "../../_node-chunks/chunk-WACDSFMO.js";
|
|
35
42
|
import {
|
|
36
43
|
require_dist
|
|
37
|
-
} from "../../_node-chunks/chunk-
|
|
44
|
+
} from "../../_node-chunks/chunk-KF3WTAEP.js";
|
|
45
|
+
import "../../_node-chunks/chunk-63PL4NNE.js";
|
|
46
|
+
import "../../_node-chunks/chunk-2JR3QBT2.js";
|
|
38
47
|
import {
|
|
39
48
|
require_picocolors
|
|
40
|
-
} from "../../_node-chunks/chunk-
|
|
49
|
+
} from "../../_node-chunks/chunk-A4KENTXT.js";
|
|
41
50
|
import {
|
|
42
51
|
__commonJS,
|
|
43
52
|
__require,
|
|
44
53
|
__toESM
|
|
45
|
-
} from "../../_node-chunks/chunk-
|
|
54
|
+
} from "../../_node-chunks/chunk-JMP7YFX2.js";
|
|
46
55
|
|
|
47
56
|
// ../node_modules/shell-quote/quote.js
|
|
48
57
|
var require_quote = __commonJS({
|
|
@@ -478,8 +487,8 @@ import {
|
|
|
478
487
|
removeAddon as removeAddonBase
|
|
479
488
|
} from "storybook/internal/common";
|
|
480
489
|
import { readCsf as readCsf2 } from "storybook/internal/csf-tools";
|
|
481
|
-
import { logger as
|
|
482
|
-
import { telemetry as
|
|
490
|
+
import { logger as logger4 } from "storybook/internal/node-logger";
|
|
491
|
+
import { telemetry as telemetry8 } from "storybook/internal/telemetry";
|
|
483
492
|
var import_ts_dedent4 = __toESM(require_dist(), 1);
|
|
484
493
|
|
|
485
494
|
// src/core-server/server-channel/create-new-story-channel.ts
|
|
@@ -509,7 +518,7 @@ import { isCsfFactoryPreview } from "storybook/internal/csf-tools";
|
|
|
509
518
|
var import_ts_dedent = __toESM(require_dist(), 1);
|
|
510
519
|
|
|
511
520
|
// src/core-server/utils/get-component-variable-name.ts
|
|
512
|
-
var getComponentVariableName = async (name) => (await import("../../_node-chunks/camelcase-
|
|
521
|
+
var getComponentVariableName = async (name) => (await import("../../_node-chunks/camelcase-VGUYV77Z.js")).default(name.replace(/^[^a-zA-Z_$]*/, ""), { pascalCase: !0 }).replace(/[^a-zA-Z_$]+/, "");
|
|
513
522
|
|
|
514
523
|
// src/core-server/utils/new-story-templates/csf-factory-template.ts
|
|
515
524
|
async function getCsfFactoryTemplateForNewStoryFile(data) {
|
|
@@ -774,7 +783,7 @@ async function searchFiles({
|
|
|
774
783
|
ignoredFiles = IGNORED_FILES,
|
|
775
784
|
fileExtensions = FILE_EXTENSIONS
|
|
776
785
|
}) {
|
|
777
|
-
let { globby, isDynamicPattern } = await import("../../_node-chunks/globby-
|
|
786
|
+
let { globby, isDynamicPattern } = await import("../../_node-chunks/globby-D4FPSHY2.js"), hasSearchSpecialGlobChars = isDynamicPattern(searchQuery, { cwd }), searchQueryHasExtension = /(\.[a-z]+)$/i.test(searchQuery), fileExtensionsPattern = `{${fileExtensions.join(",")}}`, globbedSearchQuery = hasSearchSpecialGlobChars ? searchQuery : searchQueryHasExtension ? [`**/*${searchQuery}*`, `**/*${searchQuery}*/**`] : [
|
|
778
787
|
`**/*${searchQuery}*.${fileExtensionsPattern}`,
|
|
779
788
|
`**/*${searchQuery}*/**/*.${fileExtensionsPattern}`
|
|
780
789
|
];
|
|
@@ -906,6 +915,228 @@ function initPreviewInitializedChannel(channel, options, _coreConfig) {
|
|
|
906
915
|
});
|
|
907
916
|
}
|
|
908
917
|
|
|
918
|
+
// src/core-server/utils/checklist.ts
|
|
919
|
+
import { createFileSystemCache, resolvePathInStorybookCache } from "storybook/internal/common";
|
|
920
|
+
import { experimental_UniversalStore } from "storybook/internal/core-server";
|
|
921
|
+
import { logger } from "storybook/internal/node-logger";
|
|
922
|
+
import { telemetry as telemetry5 } from "storybook/internal/telemetry";
|
|
923
|
+
|
|
924
|
+
// ../node_modules/dequal/dist/index.mjs
|
|
925
|
+
var has = Object.prototype.hasOwnProperty;
|
|
926
|
+
function find(iter, tar, key) {
|
|
927
|
+
for (key of iter.keys())
|
|
928
|
+
if (dequal(key, tar)) return key;
|
|
929
|
+
}
|
|
930
|
+
function dequal(foo, bar) {
|
|
931
|
+
var ctor, len, tmp;
|
|
932
|
+
if (foo === bar) return !0;
|
|
933
|
+
if (foo && bar && (ctor = foo.constructor) === bar.constructor) {
|
|
934
|
+
if (ctor === Date) return foo.getTime() === bar.getTime();
|
|
935
|
+
if (ctor === RegExp) return foo.toString() === bar.toString();
|
|
936
|
+
if (ctor === Array) {
|
|
937
|
+
if ((len = foo.length) === bar.length)
|
|
938
|
+
for (; len-- && dequal(foo[len], bar[len]); ) ;
|
|
939
|
+
return len === -1;
|
|
940
|
+
}
|
|
941
|
+
if (ctor === Set) {
|
|
942
|
+
if (foo.size !== bar.size)
|
|
943
|
+
return !1;
|
|
944
|
+
for (len of foo)
|
|
945
|
+
if (tmp = len, tmp && typeof tmp == "object" && (tmp = find(bar, tmp), !tmp) || !bar.has(tmp)) return !1;
|
|
946
|
+
return !0;
|
|
947
|
+
}
|
|
948
|
+
if (ctor === Map) {
|
|
949
|
+
if (foo.size !== bar.size)
|
|
950
|
+
return !1;
|
|
951
|
+
for (len of foo)
|
|
952
|
+
if (tmp = len[0], tmp && typeof tmp == "object" && (tmp = find(bar, tmp), !tmp) || !dequal(len[1], bar.get(tmp)))
|
|
953
|
+
return !1;
|
|
954
|
+
return !0;
|
|
955
|
+
}
|
|
956
|
+
if (ctor === ArrayBuffer)
|
|
957
|
+
foo = new Uint8Array(foo), bar = new Uint8Array(bar);
|
|
958
|
+
else if (ctor === DataView) {
|
|
959
|
+
if ((len = foo.byteLength) === bar.byteLength)
|
|
960
|
+
for (; len-- && foo.getInt8(len) === bar.getInt8(len); ) ;
|
|
961
|
+
return len === -1;
|
|
962
|
+
}
|
|
963
|
+
if (ArrayBuffer.isView(foo)) {
|
|
964
|
+
if ((len = foo.byteLength) === bar.byteLength)
|
|
965
|
+
for (; len-- && foo[len] === bar[len]; ) ;
|
|
966
|
+
return len === -1;
|
|
967
|
+
}
|
|
968
|
+
if (!ctor || typeof foo == "object") {
|
|
969
|
+
len = 0;
|
|
970
|
+
for (ctor in foo)
|
|
971
|
+
if (has.call(foo, ctor) && ++len && !has.call(bar, ctor) || !(ctor in bar) || !dequal(foo[ctor], bar[ctor])) return !1;
|
|
972
|
+
return Object.keys(bar).length === len;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
return foo !== foo && bar !== bar;
|
|
976
|
+
}
|
|
977
|
+
|
|
978
|
+
// ../node_modules/es-toolkit/dist/predicate/isPrimitive.mjs
|
|
979
|
+
function isPrimitive(value) {
|
|
980
|
+
return value == null || typeof value != "object" && typeof value != "function";
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
// ../node_modules/es-toolkit/dist/predicate/isTypedArray.mjs
|
|
984
|
+
function isTypedArray(x) {
|
|
985
|
+
return ArrayBuffer.isView(x) && !(x instanceof DataView);
|
|
986
|
+
}
|
|
987
|
+
|
|
988
|
+
// ../node_modules/es-toolkit/dist/object/clone.mjs
|
|
989
|
+
function clone(obj) {
|
|
990
|
+
if (isPrimitive(obj))
|
|
991
|
+
return obj;
|
|
992
|
+
if (Array.isArray(obj) || isTypedArray(obj) || obj instanceof ArrayBuffer || typeof SharedArrayBuffer < "u" && obj instanceof SharedArrayBuffer)
|
|
993
|
+
return obj.slice(0);
|
|
994
|
+
let prototype = Object.getPrototypeOf(obj), Constructor = prototype.constructor;
|
|
995
|
+
if (obj instanceof Date || obj instanceof Map || obj instanceof Set)
|
|
996
|
+
return new Constructor(obj);
|
|
997
|
+
if (obj instanceof RegExp) {
|
|
998
|
+
let newRegExp = new Constructor(obj);
|
|
999
|
+
return newRegExp.lastIndex = obj.lastIndex, newRegExp;
|
|
1000
|
+
}
|
|
1001
|
+
if (obj instanceof DataView)
|
|
1002
|
+
return new Constructor(obj.buffer.slice(0));
|
|
1003
|
+
if (obj instanceof Error) {
|
|
1004
|
+
let newError = new Constructor(obj.message);
|
|
1005
|
+
return newError.stack = obj.stack, newError.name = obj.name, newError.cause = obj.cause, newError;
|
|
1006
|
+
}
|
|
1007
|
+
if (typeof File < "u" && obj instanceof File)
|
|
1008
|
+
return new Constructor([obj], obj.name, { type: obj.type, lastModified: obj.lastModified });
|
|
1009
|
+
if (typeof obj == "object") {
|
|
1010
|
+
let newObject = Object.create(prototype);
|
|
1011
|
+
return Object.assign(newObject, obj);
|
|
1012
|
+
}
|
|
1013
|
+
return obj;
|
|
1014
|
+
}
|
|
1015
|
+
|
|
1016
|
+
// ../node_modules/es-toolkit/dist/predicate/isPlainObject.mjs
|
|
1017
|
+
function isPlainObject(value) {
|
|
1018
|
+
if (!value || typeof value != "object")
|
|
1019
|
+
return !1;
|
|
1020
|
+
let proto = Object.getPrototypeOf(value);
|
|
1021
|
+
return proto === null || proto === Object.prototype || Object.getPrototypeOf(proto) === null ? Object.prototype.toString.call(value) === "[object Object]" : !1;
|
|
1022
|
+
}
|
|
1023
|
+
|
|
1024
|
+
// ../node_modules/es-toolkit/dist/_internal/isUnsafeProperty.mjs
|
|
1025
|
+
function isUnsafeProperty(key) {
|
|
1026
|
+
return key === "__proto__";
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
// ../node_modules/es-toolkit/dist/object/mergeWith.mjs
|
|
1030
|
+
function mergeWith(target, source, merge2) {
|
|
1031
|
+
let sourceKeys = Object.keys(source);
|
|
1032
|
+
for (let i = 0; i < sourceKeys.length; i++) {
|
|
1033
|
+
let key = sourceKeys[i];
|
|
1034
|
+
if (isUnsafeProperty(key))
|
|
1035
|
+
continue;
|
|
1036
|
+
let sourceValue = source[key], targetValue = target[key], merged = merge2(targetValue, sourceValue, key, target, source);
|
|
1037
|
+
merged !== void 0 ? target[key] = merged : Array.isArray(sourceValue) ? Array.isArray(targetValue) ? target[key] = mergeWith(targetValue, sourceValue, merge2) : target[key] = mergeWith([], sourceValue, merge2) : isPlainObject(sourceValue) ? isPlainObject(targetValue) ? target[key] = mergeWith(targetValue, sourceValue, merge2) : target[key] = mergeWith({}, sourceValue, merge2) : (targetValue === void 0 || sourceValue !== void 0) && (target[key] = sourceValue);
|
|
1038
|
+
}
|
|
1039
|
+
return target;
|
|
1040
|
+
}
|
|
1041
|
+
|
|
1042
|
+
// ../node_modules/es-toolkit/dist/string/words.mjs
|
|
1043
|
+
var CASE_SPLIT_PATTERN = new RegExp("\\p{Lu}?\\p{Ll}+|[0-9]+|\\p{Lu}+(?!\\p{Ll})|\\p{Emoji_Presentation}|\\p{Extended_Pictographic}|\\p{L}+", "gu");
|
|
1044
|
+
|
|
1045
|
+
// ../node_modules/es-toolkit/dist/object/toMerged.mjs
|
|
1046
|
+
function toMerged(target, source) {
|
|
1047
|
+
return mergeWith(clone(target), source, function mergeRecursively(targetValue, sourceValue) {
|
|
1048
|
+
if (Array.isArray(sourceValue))
|
|
1049
|
+
return Array.isArray(targetValue) ? mergeWith(clone(targetValue), sourceValue, mergeRecursively) : mergeWith([], sourceValue, mergeRecursively);
|
|
1050
|
+
if (isPlainObject(sourceValue))
|
|
1051
|
+
return isPlainObject(targetValue) ? mergeWith(clone(targetValue), sourceValue, mergeRecursively) : mergeWith({}, sourceValue, mergeRecursively);
|
|
1052
|
+
});
|
|
1053
|
+
}
|
|
1054
|
+
|
|
1055
|
+
// src/shared/checklist-store/checklistData.state.ts
|
|
1056
|
+
var initialState = {
|
|
1057
|
+
items: {
|
|
1058
|
+
accessibilityTests: { status: "open" },
|
|
1059
|
+
autodocs: { status: "open" },
|
|
1060
|
+
ciTests: { status: "open" },
|
|
1061
|
+
controls: { status: "open" },
|
|
1062
|
+
coverage: { status: "open" },
|
|
1063
|
+
guidedTour: { status: "open" },
|
|
1064
|
+
installA11y: { status: "open" },
|
|
1065
|
+
installChromatic: { status: "open" },
|
|
1066
|
+
installDocs: { status: "open" },
|
|
1067
|
+
installVitest: { status: "open" },
|
|
1068
|
+
mdxDocs: { status: "open" },
|
|
1069
|
+
moreComponents: { status: "open" },
|
|
1070
|
+
moreStories: { status: "open" },
|
|
1071
|
+
onboardingSurvey: { status: "open" },
|
|
1072
|
+
organizeStories: { status: "open" },
|
|
1073
|
+
publishStorybook: { status: "open" },
|
|
1074
|
+
renderComponent: { status: "open" },
|
|
1075
|
+
runTests: { status: "open" },
|
|
1076
|
+
viewports: { status: "open" },
|
|
1077
|
+
visualTests: { status: "open" },
|
|
1078
|
+
whatsNewStorybook10: { status: "open" },
|
|
1079
|
+
writeInteractions: { status: "open" }
|
|
1080
|
+
},
|
|
1081
|
+
widget: {}
|
|
1082
|
+
};
|
|
1083
|
+
|
|
1084
|
+
// src/shared/checklist-store/index.ts
|
|
1085
|
+
var UNIVERSAL_CHECKLIST_STORE_OPTIONS = {
|
|
1086
|
+
id: "storybook/checklist",
|
|
1087
|
+
initialState
|
|
1088
|
+
};
|
|
1089
|
+
|
|
1090
|
+
// src/core-server/utils/checklist.ts
|
|
1091
|
+
async function initializeChecklist() {
|
|
1092
|
+
try {
|
|
1093
|
+
let store = experimental_UniversalStore.create({
|
|
1094
|
+
...UNIVERSAL_CHECKLIST_STORE_OPTIONS,
|
|
1095
|
+
leader: !0
|
|
1096
|
+
}), cache = createFileSystemCache({
|
|
1097
|
+
basePath: resolvePathInStorybookCache("checklist"),
|
|
1098
|
+
ns: "storybook"
|
|
1099
|
+
}), [[userState, saveUserState], [projectState, saveProjectState]] = await Promise.all([
|
|
1100
|
+
globalSettings().then((settings) => {
|
|
1101
|
+
let save = throttle(() => settings.save(), 1e3), state = {
|
|
1102
|
+
items: settings.value.checklist?.items ?? {},
|
|
1103
|
+
widget: settings.value.checklist?.widget ?? {}
|
|
1104
|
+
};
|
|
1105
|
+
return [state, ({
|
|
1106
|
+
items = state.items,
|
|
1107
|
+
widget = state.widget
|
|
1108
|
+
}) => {
|
|
1109
|
+
settings.value.checklist = { items, widget }, save();
|
|
1110
|
+
}];
|
|
1111
|
+
}),
|
|
1112
|
+
cache.get("state").then((cachedState) => [{ items: cachedState?.items ?? {} }, ({ items }) => cache.set("state", { items })])
|
|
1113
|
+
]);
|
|
1114
|
+
store.setState(
|
|
1115
|
+
(value) => ({
|
|
1116
|
+
...toMerged(value, toMerged(userState, projectState)),
|
|
1117
|
+
loaded: !0
|
|
1118
|
+
})
|
|
1119
|
+
), store.onStateChange((state, previousState) => {
|
|
1120
|
+
let projectValues = {}, userValues = {};
|
|
1121
|
+
Object.entries(state.items).forEach(([id, { status, mutedAt }]) => {
|
|
1122
|
+
status === "done" ? projectValues[id] = { status } : (status === "accepted" || status === "skipped") && (userValues[id] = { status }), mutedAt && (userValues[id] = {
|
|
1123
|
+
...userValues[id],
|
|
1124
|
+
mutedAt
|
|
1125
|
+
});
|
|
1126
|
+
}), saveProjectState({ items: projectValues }), saveUserState({ items: userValues, widget: state.widget });
|
|
1127
|
+
let changedValues = Object.entries(state.items).filter(
|
|
1128
|
+
([key, value]) => value !== previousState.items[key]
|
|
1129
|
+
);
|
|
1130
|
+
telemetry5("onboarding-checklist", {
|
|
1131
|
+
...changedValues.length > 0 ? { items: Object.fromEntries(changedValues) } : {},
|
|
1132
|
+
...dequal(state.widget, previousState.widget) ? {} : { widget: state.widget }
|
|
1133
|
+
});
|
|
1134
|
+
});
|
|
1135
|
+
} catch (err) {
|
|
1136
|
+
logger.error("Failed to initialize checklist"), logger.error(err);
|
|
1137
|
+
}
|
|
1138
|
+
}
|
|
1139
|
+
|
|
909
1140
|
// src/core-server/utils/constants.ts
|
|
910
1141
|
var defaultStaticDirs = [
|
|
911
1142
|
{
|
|
@@ -925,8 +1156,8 @@ import {
|
|
|
925
1156
|
} from "storybook/internal/core-events";
|
|
926
1157
|
import { storyNameFromExport, toId } from "storybook/internal/csf";
|
|
927
1158
|
import { printCsf, readCsf } from "storybook/internal/csf-tools";
|
|
928
|
-
import { logger } from "storybook/internal/node-logger";
|
|
929
|
-
import { isExampleStoryId, telemetry as
|
|
1159
|
+
import { logger as logger2 } from "storybook/internal/node-logger";
|
|
1160
|
+
import { isExampleStoryId, telemetry as telemetry6 } from "storybook/internal/telemetry";
|
|
930
1161
|
|
|
931
1162
|
// src/core-server/utils/save-story/duplicate-story-with-new-name.ts
|
|
932
1163
|
import { types as t2, traverse } from "storybook/internal/babel";
|
|
@@ -1133,7 +1364,7 @@ function initializeSaveStory(channel, options, coreConfig) {
|
|
|
1133
1364
|
error: null
|
|
1134
1365
|
});
|
|
1135
1366
|
let isCLIExample = isExampleStoryId(newStoryId ?? csfId);
|
|
1136
|
-
!coreConfig.disableTelemetry && !isCLIExample && await
|
|
1367
|
+
!coreConfig.disableTelemetry && !isCLIExample && await telemetry6("save-story", {
|
|
1137
1368
|
action: name ? "createStory" : "updateStory",
|
|
1138
1369
|
success: !0
|
|
1139
1370
|
});
|
|
@@ -1142,10 +1373,10 @@ function initializeSaveStory(channel, options, coreConfig) {
|
|
|
1142
1373
|
id,
|
|
1143
1374
|
success: !1,
|
|
1144
1375
|
error: error instanceof SaveStoryError ? error.message : "Unknown error"
|
|
1145
|
-
}),
|
|
1376
|
+
}), logger2.error(
|
|
1146
1377
|
`Error writing to ${sourceFilePath}:
|
|
1147
1378
|
${error.stack || error.message || error.toString()}`
|
|
1148
|
-
), !coreConfig.disableTelemetry && !(error instanceof SaveStoryError) && await
|
|
1379
|
+
), !coreConfig.disableTelemetry && !(error instanceof SaveStoryError) && await telemetry6("save-story", {
|
|
1149
1380
|
action: name ? "createStory" : "updateStory",
|
|
1150
1381
|
success: !1,
|
|
1151
1382
|
error
|
|
@@ -1165,12 +1396,12 @@ import {
|
|
|
1165
1396
|
TOGGLE_WHATS_NEW_NOTIFICATIONS
|
|
1166
1397
|
} from "storybook/internal/core-events";
|
|
1167
1398
|
import { printConfig, readConfig } from "storybook/internal/csf-tools";
|
|
1168
|
-
import { logger as
|
|
1169
|
-
import { telemetry as
|
|
1399
|
+
import { logger as logger3 } from "storybook/internal/node-logger";
|
|
1400
|
+
import { telemetry as telemetry7 } from "storybook/internal/telemetry";
|
|
1170
1401
|
var WHATS_NEW_CACHE = "whats-new-cache", WHATS_NEW_URL = "https://storybook.js.org/whats-new/v1";
|
|
1171
1402
|
function initializeWhatsNew(channel, options, coreOptions) {
|
|
1172
1403
|
channel.on(SET_WHATS_NEW_CACHE, async (data) => {
|
|
1173
|
-
let cache = await options.cache.get(WHATS_NEW_CACHE).catch((e) => (
|
|
1404
|
+
let cache = await options.cache.get(WHATS_NEW_CACHE).catch((e) => (logger3.verbose(e), {}));
|
|
1174
1405
|
await options.cache.set(WHATS_NEW_CACHE, { ...cache, ...data });
|
|
1175
1406
|
}), channel.on(REQUEST_WHATS_NEW_DATA, async () => {
|
|
1176
1407
|
try {
|
|
@@ -1187,7 +1418,7 @@ function initializeWhatsNew(channel, options, coreOptions) {
|
|
|
1187
1418
|
};
|
|
1188
1419
|
channel.emit(RESULT_WHATS_NEW_DATA, { data });
|
|
1189
1420
|
} catch (e) {
|
|
1190
|
-
|
|
1421
|
+
logger3.verbose(e instanceof Error ? e.message : String(e)), channel.emit(RESULT_WHATS_NEW_DATA, {
|
|
1191
1422
|
data: { status: "ERROR" }
|
|
1192
1423
|
});
|
|
1193
1424
|
}
|
|
@@ -1203,7 +1434,7 @@ function initializeWhatsNew(channel, options, coreOptions) {
|
|
|
1203
1434
|
throw new Error(
|
|
1204
1435
|
"Unable to parse Storybook main file while trying to read 'core' property"
|
|
1205
1436
|
);
|
|
1206
|
-
main.setFieldValue(["core", "disableWhatsNewNotifications"], disableWhatsNewNotifications), await writeFile3(mainPath, printConfig(main).code), isTelemetryEnabled && await
|
|
1437
|
+
main.setFieldValue(["core", "disableWhatsNewNotifications"], disableWhatsNewNotifications), await writeFile3(mainPath, printConfig(main).code), isTelemetryEnabled && await telemetry7("core-config", { disableWhatsNewNotifications });
|
|
1207
1438
|
} catch (error) {
|
|
1208
1439
|
invariant(error instanceof Error), isTelemetryEnabled && await sendTelemetryError(error, "core-config", {
|
|
1209
1440
|
cliOptions: options,
|
|
@@ -1236,7 +1467,7 @@ var interpolate = (string, data = {}) => Object.entries(data).reduce((acc, [k, v
|
|
|
1236
1467
|
}) : dir, { staticPath, targetEndpoint } = parseStaticDir(normalizedDir);
|
|
1237
1468
|
return ["/favicon.svg", "/favicon.ico"].includes(targetEndpoint) && results.push(staticPath), targetEndpoint === "/" && (results.push(join(staticPath, "favicon.svg")), results.push(join(staticPath, "favicon.ico"))), results.filter((path) => existsSync3(path));
|
|
1238
1469
|
}).reduce((l1, l2) => l1.concat(l2), []);
|
|
1239
|
-
return faviconPaths.length > 1 &&
|
|
1470
|
+
return faviconPaths.length > 1 && logger4.warn(import_ts_dedent4.dedent`
|
|
1240
1471
|
Looks like multiple favicons were detected. Using the first one.
|
|
1241
1472
|
|
|
1242
1473
|
${faviconPaths.join(", ")}
|
|
@@ -1293,7 +1524,7 @@ var interpolate = (string, data = {}) => Object.entries(data).reduce((acc, [k, v
|
|
|
1293
1524
|
let removeAddon = removeAddonBase, packageManager = JsPackageManagerFactory.getPackageManager({
|
|
1294
1525
|
configDir: options.configDir
|
|
1295
1526
|
});
|
|
1296
|
-
return options.disableTelemetry || (removeAddon = async (id, opts) => (await
|
|
1527
|
+
return options.disableTelemetry || (removeAddon = async (id, opts) => (await telemetry8("remove", { addon: id, source: "api" }), removeAddonBase(id, { ...opts, packageManager }))), { ...extension, removeAddon };
|
|
1297
1528
|
}, core = async (existing, options) => ({
|
|
1298
1529
|
...existing,
|
|
1299
1530
|
disableTelemetry: options.disableTelemetry === !0,
|
|
@@ -1326,7 +1557,7 @@ var interpolate = (string, data = {}) => Object.entries(data).reduce((acc, [k, v
|
|
|
1326
1557
|
return "";
|
|
1327
1558
|
}, experimental_serverChannel = async (channel, options) => {
|
|
1328
1559
|
let coreOptions = await options.presets.apply("core");
|
|
1329
|
-
return initializeWhatsNew(channel, options, coreOptions), initializeSaveStory(channel, options, coreOptions), initFileSearchChannel(channel, options, coreOptions), initCreateNewStoryChannel(channel, options, coreOptions), initOpenInEditorChannel(channel, options, coreOptions), initPreviewInitializedChannel(channel, options, coreOptions), channel;
|
|
1560
|
+
return initializeChecklist(), initializeWhatsNew(channel, options, coreOptions), initializeSaveStory(channel, options, coreOptions), initFileSearchChannel(channel, options, coreOptions), initCreateNewStoryChannel(channel, options, coreOptions), initOpenInEditorChannel(channel, options, coreOptions), initPreviewInitializedChannel(channel, options, coreOptions), channel;
|
|
1330
1561
|
}, resolvedReact = async (existing) => {
|
|
1331
1562
|
try {
|
|
1332
1563
|
return {
|
package/dist/csf/index.js
CHANGED
|
@@ -10,17 +10,17 @@ import {
|
|
|
10
10
|
mountDestructured,
|
|
11
11
|
normalizeArrays,
|
|
12
12
|
normalizeProjectAnnotations
|
|
13
|
-
} from "../_browser-chunks/chunk-
|
|
13
|
+
} from "../_browser-chunks/chunk-SS2NHR7W.js";
|
|
14
14
|
import "../_browser-chunks/chunk-IPA5A322.js";
|
|
15
15
|
import "../_browser-chunks/chunk-3OXGAGBE.js";
|
|
16
16
|
import {
|
|
17
17
|
combineParameters
|
|
18
18
|
} from "../_browser-chunks/chunk-VYJQ7RU5.js";
|
|
19
19
|
import "../_browser-chunks/chunk-3IAH5M2U.js";
|
|
20
|
+
import "../_browser-chunks/chunk-QKODTO7K.js";
|
|
20
21
|
import {
|
|
21
22
|
invariant
|
|
22
23
|
} from "../_browser-chunks/chunk-AS2HQEYC.js";
|
|
23
|
-
import "../_browser-chunks/chunk-QKODTO7K.js";
|
|
24
24
|
import "../_browser-chunks/chunk-YKE5S47A.js";
|
|
25
25
|
import "../_browser-chunks/chunk-AIOS4NGK.js";
|
|
26
26
|
import "../_browser-chunks/chunk-GFLS4VP3.js";
|
package/dist/csf-tools/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_yntchggdu3k from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_yntchggdu3k from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_yntchggdu3k from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_yntchggdu3k.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_yntchggdu3k.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_yntchggdu3k.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-WACDSFMO.js";
|
|
42
|
+
import "../_node-chunks/chunk-KF3WTAEP.js";
|
|
43
|
+
import "../_node-chunks/chunk-JMP7YFX2.js";
|
|
44
44
|
export {
|
|
45
45
|
BadMetaError,
|
|
46
46
|
ConfigFile,
|