@storybook/nextjs-vite 10.5.0-alpha.0 → 10.5.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/{chunk-4ZRKYE2G.js → chunk-342N7CWU.js} +1 -1
- package/dist/_browser-chunks/{chunk-SL3VIQZ3.js → chunk-UAWMPV5J.js} +5 -1
- package/dist/_browser-chunks/{react-18-PYSEDAWB.js → react-18-ODWMAYZK.js} +1 -1
- package/dist/_node-chunks/{api-LTP2FDDH.js → api-WERSIAUS.js} +220 -19
- package/dist/_node-chunks/{chunk-FZCY53YQ.js → chunk-7G5KYCPZ.js} +18 -9
- package/dist/_node-chunks/{dist-US74ZQ4O.js → dist-J64YAQZR.js} +10 -13
- package/dist/_node-chunks/{jiti-D3ZKXDG5.js → jiti-ZCHSXSBE.js} +8 -9
- package/dist/_node-chunks/{lexer-DQCqS3nf-DTASBSAA.js → lexer-DQCqS3nf-Q4UOK5GH.js} +7 -7
- package/dist/export-mocks/cache/index.js +1 -1
- package/dist/export-mocks/headers/index.js +1 -1
- package/dist/export-mocks/link/index.d.ts +318 -0
- package/dist/export-mocks/link/index.js +46 -0
- package/dist/export-mocks/navigation/index.js +1 -1
- package/dist/export-mocks/router/index.js +1 -1
- package/dist/index.d.ts +0 -4
- package/dist/index.js +12 -17
- package/dist/node/index.js +7 -7
- package/dist/preset.js +12 -11
- package/dist/preview.js +2 -2
- package/dist/vite-plugin/index.d.ts +3 -1
- package/dist/vite-plugin/index.js +7 -7
- package/package.json +11 -6
- package/template/cli/js/Button.stories.js +1 -1
- package/template/cli/ts/Button.stories.ts +1 -1
|
@@ -4,7 +4,11 @@ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
|
4
4
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
5
|
var __getProtoOf = Object.getPrototypeOf, __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
6
|
var __commonJS = (cb, mod) => function() {
|
|
7
|
-
|
|
7
|
+
try {
|
|
8
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
9
|
+
} catch (e) {
|
|
10
|
+
throw mod = 0, e;
|
|
11
|
+
}
|
|
8
12
|
};
|
|
9
13
|
var __export = (target, all) => {
|
|
10
14
|
for (var name in all)
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zr6linfu4po from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zr6linfu4po from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zr6linfu4po from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zr6linfu4po.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zr6linfu4po.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zr6linfu4po.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
__esm,
|
|
15
15
|
__require,
|
|
16
16
|
__toESM
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7G5KYCPZ.js";
|
|
18
18
|
|
|
19
19
|
// ../../../node_modules/tsx/dist/temporary-directory-CwHp0_NW.mjs
|
|
20
20
|
import r from "node:path";
|
|
@@ -523,7 +523,7 @@ var Le, i2, Z, E2, $e, G, fe, q, K, ae, P, Q, ce, ge, Re, ke, me, C, I2, Se, ee,
|
|
|
523
523
|
(function(e5) {
|
|
524
524
|
e5[e5.InvalidSymbol = 1] = "InvalidSymbol", e5[e5.InvalidNumberFormat = 2] = "InvalidNumberFormat", e5[e5.PropertyNameExpected = 3] = "PropertyNameExpected", e5[e5.ValueExpected = 4] = "ValueExpected", e5[e5.ColonExpected = 5] = "ColonExpected", e5[e5.CommaExpected = 6] = "CommaExpected", e5[e5.CloseBraceExpected = 7] = "CloseBraceExpected", e5[e5.CloseBracketExpected = 8] = "CloseBracketExpected", e5[e5.EndOfFileExpected = 9] = "EndOfFileExpected", e5[e5.InvalidCommentToken = 10] = "InvalidCommentToken", e5[e5.UnexpectedEndOfComment = 11] = "UnexpectedEndOfComment", e5[e5.UnexpectedEndOfString = 12] = "UnexpectedEndOfString", e5[e5.UnexpectedEndOfNumber = 13] = "UnexpectedEndOfNumber", e5[e5.InvalidUnicode = 14] = "InvalidUnicode", e5[e5.InvalidEscapeCharacter = 15] = "InvalidEscapeCharacter", e5[e5.InvalidCharacter = 16] = "InvalidCharacter";
|
|
525
525
|
})(ke || (ke = {}));
|
|
526
|
-
me = i2((e5, t3) => Re($e(t3, e5, "utf8")), "readJsonc"), C = Symbol("implicitBaseUrl"), I2 = "${configDir}", Se = i2(() => {
|
|
526
|
+
me = i2((e5, t3) => Re($e(t3, e5, "utf8")), "readJsonc"), C = /* @__PURE__ */ Symbol("implicitBaseUrl"), I2 = "${configDir}", Se = i2(() => {
|
|
527
527
|
let { findPnpApi: e5 } = he;
|
|
528
528
|
return e5 && e5(process.cwd());
|
|
529
529
|
}, "getPnpApi"), ee = i2((e5, t3, s4, n2) => {
|
|
@@ -967,11 +967,203 @@ esbuild in this environment because esbuild relies on this invariant. This
|
|
|
967
967
|
is not a problem with esbuild. You need to fix your environment instead.
|
|
968
968
|
`);
|
|
969
969
|
function readUInt32LE(buffer, offset) {
|
|
970
|
-
return buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24;
|
|
970
|
+
return (buffer[offset++] | buffer[offset++] << 8 | buffer[offset++] << 16 | buffer[offset++] << 24) >>> 0;
|
|
971
971
|
}
|
|
972
972
|
function writeUInt32LE(buffer, value, offset) {
|
|
973
973
|
buffer[offset++] = value, buffer[offset++] = value >> 8, buffer[offset++] = value >> 16, buffer[offset++] = value >> 24;
|
|
974
974
|
}
|
|
975
|
+
var fromCharCode = String.fromCharCode;
|
|
976
|
+
function throwSyntaxError(bytes, index, message) {
|
|
977
|
+
let c2 = bytes[index], line = 1, column = 0;
|
|
978
|
+
for (let i5 = 0; i5 < index; i5++)
|
|
979
|
+
bytes[i5] === 10 ? (line++, column = 0) : column++;
|
|
980
|
+
throw new SyntaxError(
|
|
981
|
+
message || (index === bytes.length ? "Unexpected end of input while parsing JSON" : c2 >= 32 && c2 <= 126 ? `Unexpected character ${fromCharCode(c2)} in JSON at position ${index} (line ${line}, column ${column})` : `Unexpected byte 0x${c2.toString(16)} in JSON at position ${index} (line ${line}, column ${column})`)
|
|
982
|
+
);
|
|
983
|
+
}
|
|
984
|
+
function JSON_parse(bytes) {
|
|
985
|
+
if (!(bytes instanceof Uint8Array))
|
|
986
|
+
throw new Error("JSON input must be a Uint8Array");
|
|
987
|
+
let propertyStack = [], objectStack = [], stateStack = [], length = bytes.length, property = null, state = 0, object, i5 = 0;
|
|
988
|
+
for (; i5 < length; ) {
|
|
989
|
+
let c2 = bytes[i5++];
|
|
990
|
+
if (c2 <= 32)
|
|
991
|
+
continue;
|
|
992
|
+
let value;
|
|
993
|
+
switch (state === 2 && property === null && c2 !== 34 && c2 !== 125 && throwSyntaxError(bytes, --i5), c2) {
|
|
994
|
+
// True
|
|
995
|
+
case 116: {
|
|
996
|
+
(bytes[i5++] !== 114 || bytes[i5++] !== 117 || bytes[i5++] !== 101) && throwSyntaxError(bytes, --i5), value = !0;
|
|
997
|
+
break;
|
|
998
|
+
}
|
|
999
|
+
// False
|
|
1000
|
+
case 102: {
|
|
1001
|
+
(bytes[i5++] !== 97 || bytes[i5++] !== 108 || bytes[i5++] !== 115 || bytes[i5++] !== 101) && throwSyntaxError(bytes, --i5), value = !1;
|
|
1002
|
+
break;
|
|
1003
|
+
}
|
|
1004
|
+
// Null
|
|
1005
|
+
case 110: {
|
|
1006
|
+
(bytes[i5++] !== 117 || bytes[i5++] !== 108 || bytes[i5++] !== 108) && throwSyntaxError(bytes, --i5), value = null;
|
|
1007
|
+
break;
|
|
1008
|
+
}
|
|
1009
|
+
// Number begin
|
|
1010
|
+
case 45:
|
|
1011
|
+
case 46:
|
|
1012
|
+
case 48:
|
|
1013
|
+
case 49:
|
|
1014
|
+
case 50:
|
|
1015
|
+
case 51:
|
|
1016
|
+
case 52:
|
|
1017
|
+
case 53:
|
|
1018
|
+
case 54:
|
|
1019
|
+
case 55:
|
|
1020
|
+
case 56:
|
|
1021
|
+
case 57: {
|
|
1022
|
+
let index = i5;
|
|
1023
|
+
for (value = fromCharCode(c2), c2 = bytes[i5]; ; ) {
|
|
1024
|
+
switch (c2) {
|
|
1025
|
+
case 43:
|
|
1026
|
+
case 45:
|
|
1027
|
+
case 46:
|
|
1028
|
+
case 48:
|
|
1029
|
+
case 49:
|
|
1030
|
+
case 50:
|
|
1031
|
+
case 51:
|
|
1032
|
+
case 52:
|
|
1033
|
+
case 53:
|
|
1034
|
+
case 54:
|
|
1035
|
+
case 55:
|
|
1036
|
+
case 56:
|
|
1037
|
+
case 57:
|
|
1038
|
+
case 101:
|
|
1039
|
+
case 69: {
|
|
1040
|
+
value += fromCharCode(c2), c2 = bytes[++i5];
|
|
1041
|
+
continue;
|
|
1042
|
+
}
|
|
1043
|
+
}
|
|
1044
|
+
break;
|
|
1045
|
+
}
|
|
1046
|
+
value = +value, isNaN(value) && throwSyntaxError(bytes, --index, "Invalid number");
|
|
1047
|
+
break;
|
|
1048
|
+
}
|
|
1049
|
+
// String begin
|
|
1050
|
+
case 34: {
|
|
1051
|
+
for (value = ""; i5 >= length && throwSyntaxError(bytes, length), c2 = bytes[i5++], c2 !== 34; )
|
|
1052
|
+
if (c2 === 92)
|
|
1053
|
+
switch (bytes[i5++]) {
|
|
1054
|
+
// Normal escape sequence
|
|
1055
|
+
case 34:
|
|
1056
|
+
value += '"';
|
|
1057
|
+
break;
|
|
1058
|
+
case 47:
|
|
1059
|
+
value += "/";
|
|
1060
|
+
break;
|
|
1061
|
+
case 92:
|
|
1062
|
+
value += "\\";
|
|
1063
|
+
break;
|
|
1064
|
+
case 98:
|
|
1065
|
+
value += "\b";
|
|
1066
|
+
break;
|
|
1067
|
+
case 102:
|
|
1068
|
+
value += "\f";
|
|
1069
|
+
break;
|
|
1070
|
+
case 110:
|
|
1071
|
+
value += `
|
|
1072
|
+
`;
|
|
1073
|
+
break;
|
|
1074
|
+
case 114:
|
|
1075
|
+
value += "\r";
|
|
1076
|
+
break;
|
|
1077
|
+
case 116:
|
|
1078
|
+
value += " ";
|
|
1079
|
+
break;
|
|
1080
|
+
// Unicode escape sequence
|
|
1081
|
+
case 117: {
|
|
1082
|
+
let code = 0;
|
|
1083
|
+
for (let j2 = 0; j2 < 4; j2++)
|
|
1084
|
+
c2 = bytes[i5++], code <<= 4, c2 >= 48 && c2 <= 57 ? code |= c2 - 48 : c2 >= 97 && c2 <= 102 ? code |= c2 + -87 : c2 >= 65 && c2 <= 70 ? code |= c2 + -55 : throwSyntaxError(bytes, --i5);
|
|
1085
|
+
value += fromCharCode(code);
|
|
1086
|
+
break;
|
|
1087
|
+
}
|
|
1088
|
+
// Invalid escape sequence
|
|
1089
|
+
default:
|
|
1090
|
+
throwSyntaxError(bytes, --i5);
|
|
1091
|
+
break;
|
|
1092
|
+
}
|
|
1093
|
+
else if (c2 <= 127)
|
|
1094
|
+
value += fromCharCode(c2);
|
|
1095
|
+
else if ((c2 & 224) === 192)
|
|
1096
|
+
value += fromCharCode((c2 & 31) << 6 | bytes[i5++] & 63);
|
|
1097
|
+
else if ((c2 & 240) === 224)
|
|
1098
|
+
value += fromCharCode((c2 & 15) << 12 | (bytes[i5++] & 63) << 6 | bytes[i5++] & 63);
|
|
1099
|
+
else if ((c2 & 248) == 240) {
|
|
1100
|
+
let codePoint = (c2 & 7) << 18 | (bytes[i5++] & 63) << 12 | (bytes[i5++] & 63) << 6 | bytes[i5++] & 63;
|
|
1101
|
+
codePoint > 65535 && (codePoint -= 65536, value += fromCharCode(codePoint >> 10 & 1023 | 55296), codePoint = 56320 | codePoint & 1023), value += fromCharCode(codePoint);
|
|
1102
|
+
}
|
|
1103
|
+
value[0];
|
|
1104
|
+
break;
|
|
1105
|
+
}
|
|
1106
|
+
// Array begin
|
|
1107
|
+
case 91: {
|
|
1108
|
+
value = [], propertyStack.push(property), objectStack.push(object), stateStack.push(state), property = null, object = value, state = 1;
|
|
1109
|
+
continue;
|
|
1110
|
+
}
|
|
1111
|
+
// Object begin
|
|
1112
|
+
case 123: {
|
|
1113
|
+
value = {}, propertyStack.push(property), objectStack.push(object), stateStack.push(state), property = null, object = value, state = 2;
|
|
1114
|
+
continue;
|
|
1115
|
+
}
|
|
1116
|
+
// Array end
|
|
1117
|
+
case 93: {
|
|
1118
|
+
state !== 1 && throwSyntaxError(bytes, --i5), value = object, property = propertyStack.pop(), object = objectStack.pop(), state = stateStack.pop();
|
|
1119
|
+
break;
|
|
1120
|
+
}
|
|
1121
|
+
// Object end
|
|
1122
|
+
case 125: {
|
|
1123
|
+
state !== 2 && throwSyntaxError(bytes, --i5), value = object, property = propertyStack.pop(), object = objectStack.pop(), state = stateStack.pop();
|
|
1124
|
+
break;
|
|
1125
|
+
}
|
|
1126
|
+
default:
|
|
1127
|
+
throwSyntaxError(bytes, --i5);
|
|
1128
|
+
}
|
|
1129
|
+
for (c2 = bytes[i5]; c2 <= 32; )
|
|
1130
|
+
c2 = bytes[++i5];
|
|
1131
|
+
switch (state) {
|
|
1132
|
+
case 0: {
|
|
1133
|
+
if (i5 === length)
|
|
1134
|
+
return value;
|
|
1135
|
+
break;
|
|
1136
|
+
}
|
|
1137
|
+
case 1: {
|
|
1138
|
+
if (object.push(value), c2 === 44) {
|
|
1139
|
+
i5++;
|
|
1140
|
+
continue;
|
|
1141
|
+
}
|
|
1142
|
+
if (c2 === 93)
|
|
1143
|
+
continue;
|
|
1144
|
+
break;
|
|
1145
|
+
}
|
|
1146
|
+
case 2: {
|
|
1147
|
+
if (property === null) {
|
|
1148
|
+
if (property = value, c2 === 58) {
|
|
1149
|
+
i5++;
|
|
1150
|
+
continue;
|
|
1151
|
+
}
|
|
1152
|
+
} else {
|
|
1153
|
+
if (object[property] = value, property = null, c2 === 44) {
|
|
1154
|
+
i5++;
|
|
1155
|
+
continue;
|
|
1156
|
+
}
|
|
1157
|
+
if (c2 === 125)
|
|
1158
|
+
continue;
|
|
1159
|
+
}
|
|
1160
|
+
break;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
break;
|
|
1164
|
+
}
|
|
1165
|
+
throwSyntaxError(bytes, i5);
|
|
1166
|
+
}
|
|
975
1167
|
var quote = JSON.stringify, buildLogLevelDefault = "warning", transformLogLevelDefault = "silent";
|
|
976
1168
|
function validateAndJoinStringArray(values, what) {
|
|
977
1169
|
let toJoin = [];
|
|
@@ -1186,8 +1378,8 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
1186
1378
|
if (isFirstPacket) {
|
|
1187
1379
|
isFirstPacket = !1;
|
|
1188
1380
|
let binaryVersion = String.fromCharCode(...bytes);
|
|
1189
|
-
if (binaryVersion !== "0.
|
|
1190
|
-
throw new Error(`Cannot start service: Host version "0.
|
|
1381
|
+
if (binaryVersion !== "0.28.1")
|
|
1382
|
+
throw new Error(`Cannot start service: Host version "0.28.1" does not match binary version ${quote(binaryVersion)}`);
|
|
1191
1383
|
return;
|
|
1192
1384
|
}
|
|
1193
1385
|
let packet = decodePacket(bytes);
|
|
@@ -1398,7 +1590,7 @@ is not a problem with esbuild. You need to fix your environment instead.
|
|
|
1398
1590
|
metafile: void 0,
|
|
1399
1591
|
mangleCache: void 0
|
|
1400
1592
|
}, originalErrors = result.errors.slice(), originalWarnings = result.warnings.slice();
|
|
1401
|
-
response.outputFiles && (result.outputFiles = response.outputFiles.map(convertOutputFiles)), response.metafile && (result.metafile =
|
|
1593
|
+
response.outputFiles && (result.outputFiles = response.outputFiles.map(convertOutputFiles)), response.metafile && response.metafile.length && (result.metafile = parseJSON(response.metafile)), response.mangleCache && (result.mangleCache = response.mangleCache), response.writeToStdout !== void 0 && console.log(decodeUTF8(response.writeToStdout).replace(/\n$/, "")), runOnEndCallbacks(result, (onEndErrors, onEndWarnings) => {
|
|
1402
1594
|
if (originalErrors.length > 0 || onEndErrors.length > 0) {
|
|
1403
1595
|
let error = failureErrorWithLog("Build failed", originalErrors.concat(onEndErrors), originalWarnings.concat(onEndWarnings));
|
|
1404
1596
|
return callback2(error, null, onEndErrors, onEndWarnings);
|
|
@@ -1873,6 +2065,15 @@ ${file}:${line}:${column}: ERROR: ${pluginText}${e5.text}`;
|
|
|
1873
2065
|
let result = regexp.source;
|
|
1874
2066
|
return regexp.flags && (result = `(?${regexp.flags})${result}`), result;
|
|
1875
2067
|
}
|
|
2068
|
+
function parseJSON(bytes) {
|
|
2069
|
+
let text;
|
|
2070
|
+
try {
|
|
2071
|
+
text = decodeUTF8(bytes);
|
|
2072
|
+
} catch {
|
|
2073
|
+
return JSON_parse(bytes);
|
|
2074
|
+
}
|
|
2075
|
+
return JSON.parse(text);
|
|
2076
|
+
}
|
|
1876
2077
|
var fs = __require("fs"), os = __require("os"), path = __require("path"), ESBUILD_BINARY_PATH = process.env.ESBUILD_BINARY_PATH || ESBUILD_BINARY_PATH, isValidBinaryPath = (x) => !!x && x !== "/usr/bin/esbuild", packageDarwin_arm64 = "@esbuild/darwin-arm64", packageDarwin_x64 = "@esbuild/darwin-x64", knownWindowsPackages = {
|
|
1877
2078
|
"win32 arm64 LE": "@esbuild/win32-arm64",
|
|
1878
2079
|
"win32 ia32 LE": "@esbuild/win32-ia32",
|
|
@@ -2022,7 +2223,7 @@ for your current platform.`);
|
|
|
2022
2223
|
"node_modules",
|
|
2023
2224
|
".cache",
|
|
2024
2225
|
"esbuild",
|
|
2025
|
-
`pnpapi-${pkg.replace("/", "-")}-0.
|
|
2226
|
+
`pnpapi-${pkg.replace("/", "-")}-0.28.1-${path.basename(subpath)}`
|
|
2026
2227
|
);
|
|
2027
2228
|
return fs.existsSync(binTargetPath) || (fs.mkdirSync(path.dirname(binTargetPath), { recursive: !0 }), fs.copyFileSync(binPath, binTargetPath), fs.chmodSync(binTargetPath, 493)), { binPath: binTargetPath, isWASM };
|
|
2028
2229
|
}
|
|
@@ -2039,7 +2240,7 @@ for your current platform.`);
|
|
|
2039
2240
|
// <v12.17.0 does not work
|
|
2040
2241
|
(+major < 12 || +major == 12 && +minor < 17 || +major == 13 && +minor < 13) && (worker_threads = void 0);
|
|
2041
2242
|
}
|
|
2042
|
-
var _a, isInternalWorkerThread = ((_a = worker_threads?.workerData) == null ? void 0 : _a.esbuildVersion) === "0.
|
|
2243
|
+
var _a, isInternalWorkerThread = ((_a = worker_threads?.workerData) == null ? void 0 : _a.esbuildVersion) === "0.28.1", esbuildCommandAndArgs = () => {
|
|
2043
2244
|
if (!ESBUILD_BINARY_PATH && (path2.basename(__filename) !== "main.js" || path2.basename(__dirname) !== "lib"))
|
|
2044
2245
|
throw new Error(
|
|
2045
2246
|
`The esbuild JavaScript API cannot be bundled. Please mark the "esbuild" package as external so it's not included in the bundle.
|
|
@@ -2093,7 +2294,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
2093
2294
|
callback(null);
|
|
2094
2295
|
}
|
|
2095
2296
|
}
|
|
2096
|
-
}, version = "0.
|
|
2297
|
+
}, version = "0.28.1", build = (options) => ensureServiceIsRunning().build(options), context = (buildOptions) => ensureServiceIsRunning().context(buildOptions), transform = (input, options) => ensureServiceIsRunning().transform(input, options), formatMessages = (messages, options) => ensureServiceIsRunning().formatMessages(messages, options), analyzeMetafile = (messages, options) => ensureServiceIsRunning().analyzeMetafile(messages, options), buildSync = (options) => {
|
|
2097
2298
|
if (worker_threads && !isInternalWorkerThread)
|
|
2098
2299
|
return workerThreadService || (workerThreadService = startWorkerThreadService(worker_threads)), workerThreadService.buildSync(options);
|
|
2099
2300
|
let result;
|
|
@@ -2160,7 +2361,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
2160
2361
|
return ensureServiceIsRunning(), initializeWasCalled = !0, Promise.resolve();
|
|
2161
2362
|
}, defaultWD = process.cwd(), longLivedService, stopService, ensureServiceIsRunning = () => {
|
|
2162
2363
|
if (longLivedService) return longLivedService;
|
|
2163
|
-
let [command, args] = esbuildCommandAndArgs(), child = child_process.spawn(command, args.concat("--service=0.
|
|
2364
|
+
let [command, args] = esbuildCommandAndArgs(), child = child_process.spawn(command, args.concat("--service=0.28.1", "--ping"), {
|
|
2164
2365
|
windowsHide: !0,
|
|
2165
2366
|
stdio: ["pipe", "pipe", "inherit"],
|
|
2166
2367
|
cwd: defaultWD
|
|
@@ -2244,7 +2445,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
2244
2445
|
esbuild: node_exports
|
|
2245
2446
|
});
|
|
2246
2447
|
callback(service);
|
|
2247
|
-
let stdout = child_process.execFileSync(command, args.concat("--service=0.
|
|
2448
|
+
let stdout = child_process.execFileSync(command, args.concat("--service=0.28.1"), {
|
|
2248
2449
|
cwd: defaultWD,
|
|
2249
2450
|
windowsHide: !0,
|
|
2250
2451
|
input: stdin,
|
|
@@ -2257,7 +2458,7 @@ More information: The file containing the code for esbuild's JavaScript API (${_
|
|
|
2257
2458
|
readFromStdout(stdout), afterClose(null);
|
|
2258
2459
|
}, randomFileName = () => path2.join(os2.tmpdir(), `esbuild-${crypto.randomBytes(32).toString("hex")}`), workerThreadService = null, startWorkerThreadService = (worker_threads2) => {
|
|
2259
2460
|
let { port1: mainPort, port2: workerPort } = new worker_threads2.MessageChannel(), worker = new worker_threads2.Worker(__filename, {
|
|
2260
|
-
workerData: { workerPort, defaultWD, esbuildVersion: "0.
|
|
2461
|
+
workerData: { workerPort, defaultWD, esbuildVersion: "0.28.1" },
|
|
2261
2462
|
transferList: [workerPort],
|
|
2262
2463
|
// From node's documentation: https://nodejs.org/api/worker_threads.html
|
|
2263
2464
|
//
|
|
@@ -4595,7 +4796,7 @@ var import_esbuild, Pt, f2, Ne2, Ie2, Yt, Me2, $e2, Ue2, me2, ae2, ee2, nn2, rn,
|
|
|
4595
4796
|
f2(Be2, "u");
|
|
4596
4797
|
f2(D, "o");
|
|
4597
4798
|
typeof WebAssembly < "u" && (async () => {
|
|
4598
|
-
let { parse: s4, init: e5 } = await import("./lexer-DQCqS3nf-
|
|
4799
|
+
let { parse: s4, init: e5 } = await import("./lexer-DQCqS3nf-Q4UOK5GH.js");
|
|
4599
4800
|
await e5, Se2 = s4;
|
|
4600
4801
|
})();
|
|
4601
4802
|
Pe2 = f2((s4, e5) => Se2 ? Se2(s4, e5) : fn(s4, e5), "parseEsm"), gn = f2((s4) => {
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zr6linfu4po from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zr6linfu4po from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zr6linfu4po from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zr6linfu4po.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zr6linfu4po.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zr6linfu4po.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -20,11 +20,20 @@ var __require = /* @__PURE__ */ ((x) => typeof require < "u" ? require : typeof
|
|
|
20
20
|
if (typeof require < "u") return require.apply(this, arguments);
|
|
21
21
|
throw Error('Dynamic require of "' + x + '" is not supported');
|
|
22
22
|
});
|
|
23
|
-
var __esm = (fn, res) => function() {
|
|
24
|
-
|
|
23
|
+
var __esm = (fn, res, err) => function() {
|
|
24
|
+
if (err) throw err[0];
|
|
25
|
+
try {
|
|
26
|
+
return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res;
|
|
27
|
+
} catch (e) {
|
|
28
|
+
throw err = [e], e;
|
|
29
|
+
}
|
|
25
30
|
};
|
|
26
31
|
var __commonJS = (cb, mod) => function() {
|
|
27
|
-
|
|
32
|
+
try {
|
|
33
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
34
|
+
} catch (e) {
|
|
35
|
+
throw mod = 0, e;
|
|
36
|
+
}
|
|
28
37
|
};
|
|
29
38
|
var __copyProps = (to, from, except, desc) => {
|
|
30
39
|
if (from && typeof from == "object" || typeof from == "function")
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zr6linfu4po from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zr6linfu4po from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zr6linfu4po from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zr6linfu4po.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zr6linfu4po.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zr6linfu4po.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -12,13 +12,13 @@ var require = CJS_COMPAT_NODE_MODULE_3ig3iodzjni.createRequire(import.meta.url);
|
|
|
12
12
|
import {
|
|
13
13
|
__commonJS,
|
|
14
14
|
__require
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-7G5KYCPZ.js";
|
|
16
16
|
|
|
17
17
|
// ../../../node_modules/yaml/dist/nodes/identity.js
|
|
18
18
|
var require_identity = __commonJS({
|
|
19
19
|
"../../../node_modules/yaml/dist/nodes/identity.js"(exports) {
|
|
20
20
|
"use strict";
|
|
21
|
-
var ALIAS = Symbol.for("yaml.alias"), DOC = Symbol.for("yaml.document"), MAP = Symbol.for("yaml.map"), PAIR = Symbol.for("yaml.pair"), SCALAR = Symbol.for("yaml.scalar"), SEQ = Symbol.for("yaml.seq"), NODE_TYPE = Symbol.for("yaml.node.type"), isAlias = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === ALIAS, isDocument = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === DOC, isMap = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === MAP, isPair = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === PAIR, isScalar = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === SCALAR, isSeq = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === SEQ;
|
|
21
|
+
var ALIAS = /* @__PURE__ */ Symbol.for("yaml.alias"), DOC = /* @__PURE__ */ Symbol.for("yaml.document"), MAP = /* @__PURE__ */ Symbol.for("yaml.map"), PAIR = /* @__PURE__ */ Symbol.for("yaml.pair"), SCALAR = /* @__PURE__ */ Symbol.for("yaml.scalar"), SEQ = /* @__PURE__ */ Symbol.for("yaml.seq"), NODE_TYPE = /* @__PURE__ */ Symbol.for("yaml.node.type"), isAlias = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === ALIAS, isDocument = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === DOC, isMap = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === MAP, isPair = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === PAIR, isScalar = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === SCALAR, isSeq = (node) => !!node && typeof node == "object" && node[NODE_TYPE] === SEQ;
|
|
22
22
|
function isCollection(node) {
|
|
23
23
|
if (node && typeof node == "object")
|
|
24
24
|
switch (node[NODE_TYPE]) {
|
|
@@ -63,7 +63,7 @@ var require_identity = __commonJS({
|
|
|
63
63
|
var require_visit = __commonJS({
|
|
64
64
|
"../../../node_modules/yaml/dist/visit.js"(exports) {
|
|
65
65
|
"use strict";
|
|
66
|
-
var identity = require_identity(), BREAK = Symbol("break visit"), SKIP = Symbol("skip children"), REMOVE = Symbol("remove node");
|
|
66
|
+
var identity = require_identity(), BREAK = /* @__PURE__ */ Symbol("break visit"), SKIP = /* @__PURE__ */ Symbol("skip children"), REMOVE = /* @__PURE__ */ Symbol("remove node");
|
|
67
67
|
function visit(node, visitor) {
|
|
68
68
|
let visitor_ = initVisitor(visitor);
|
|
69
69
|
identity.isDocument(node) ? visit_(null, node.contents, visitor_, Object.freeze([node])) === REMOVE && (node.contents = null) : visit_(null, node, visitor_, Object.freeze([]));
|
|
@@ -4071,7 +4071,7 @@ var require_cst_stringify = __commonJS({
|
|
|
4071
4071
|
var require_cst_visit = __commonJS({
|
|
4072
4072
|
"../../../node_modules/yaml/dist/parse/cst-visit.js"(exports) {
|
|
4073
4073
|
"use strict";
|
|
4074
|
-
var BREAK = Symbol("break visit"), SKIP = Symbol("skip children"), REMOVE = Symbol("remove item");
|
|
4074
|
+
var BREAK = /* @__PURE__ */ Symbol("break visit"), SKIP = /* @__PURE__ */ Symbol("skip children"), REMOVE = /* @__PURE__ */ Symbol("remove item");
|
|
4075
4075
|
function visit(cst, visitor) {
|
|
4076
4076
|
"type" in cst && cst.type === "document" && (cst = { start: cst.start, value: cst.value }), _visit(Object.freeze([]), cst, visitor);
|
|
4077
4077
|
}
|
|
@@ -5321,9 +5321,6 @@ var require_parser = __commonJS({
|
|
|
5321
5321
|
break;
|
|
5322
5322
|
case "newline":
|
|
5323
5323
|
this.onKeyLine = !1;
|
|
5324
|
-
// fallthrough
|
|
5325
|
-
case "space":
|
|
5326
|
-
case "comment":
|
|
5327
5324
|
default:
|
|
5328
5325
|
token.end ? token.end.push(this.sourceToken) : token.end = [this.sourceToken], this.type === "newline" && (yield* this.pop());
|
|
5329
5326
|
}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zr6linfu4po from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zr6linfu4po from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zr6linfu4po from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zr6linfu4po.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zr6linfu4po.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zr6linfu4po.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -14,7 +14,7 @@ import {
|
|
|
14
14
|
__esm,
|
|
15
15
|
__require,
|
|
16
16
|
__toESM
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-7G5KYCPZ.js";
|
|
18
18
|
|
|
19
19
|
// ../../../node_modules/jiti/dist/jiti.cjs
|
|
20
20
|
var require_jiti = __commonJS({
|
|
@@ -2106,7 +2106,6 @@ Defaulting to 2020, but this will stop working in the future.`)), t3.ecmaVersion
|
|
|
2106
2106
|
} else i2 = e4;
|
|
2107
2107
|
return i2;
|
|
2108
2108
|
}
|
|
2109
|
-
Symbol.for("ufo:protocolRelative");
|
|
2110
2109
|
let me = /^[A-Za-z]:\//;
|
|
2111
2110
|
function pathe_M_eThtNZ_normalizeWindowsPath(e3 = "") {
|
|
2112
2111
|
return e3 && e3.replace(/\\/g, "/").replace(me, (e4) => e4.toUpperCase());
|
|
@@ -2647,7 +2646,7 @@ Default "index" lookups for the main are deprecated for ES modules.`, "Deprecati
|
|
|
2647
2646
|
if (typeof e3 != "string") throw new TypeError("Expected a string");
|
|
2648
2647
|
return e3.replace(/[|\\{}()[\]^$+*?.]/g, "\\$&").replace(/-/g, "\\x2d");
|
|
2649
2648
|
}
|
|
2650
|
-
let ct = /* @__PURE__ */ new Set(["/", "\\", void 0]), pt = Symbol.for("pathe:normalizedAlias"), lt = /[/\\]/;
|
|
2649
|
+
let ct = /* @__PURE__ */ new Set(["/", "\\", void 0]), pt = /* @__PURE__ */ Symbol.for("pathe:normalizedAlias"), lt = /[/\\]/;
|
|
2651
2650
|
function normalizeAliases(e3) {
|
|
2652
2651
|
if (e3[pt]) return e3;
|
|
2653
2652
|
let t3 = Object.fromEntries(Object.entries(e3).sort(([e4], [t4]) => (function(e5, t5) {
|
|
@@ -1,17 +1,17 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zr6linfu4po from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zr6linfu4po from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zr6linfu4po from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zr6linfu4po.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zr6linfu4po.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zr6linfu4po.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
|
__esm
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-7G5KYCPZ.js";
|
|
15
15
|
|
|
16
16
|
// ../../../node_modules/tsx/dist/lexer-DQCqS3nf.mjs
|
|
17
17
|
function F(A, E = "@") {
|
|
@@ -0,0 +1,318 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
|
|
3
|
+
interface MockResultReturn<T> {
|
|
4
|
+
type: "return";
|
|
5
|
+
/**
|
|
6
|
+
* The value that was returned from the function. If function returned a Promise, then this will be a resolved value.
|
|
7
|
+
*/
|
|
8
|
+
value: T;
|
|
9
|
+
}
|
|
10
|
+
interface MockResultIncomplete {
|
|
11
|
+
type: "incomplete";
|
|
12
|
+
value: undefined;
|
|
13
|
+
}
|
|
14
|
+
interface MockResultThrow {
|
|
15
|
+
type: "throw";
|
|
16
|
+
/**
|
|
17
|
+
* An error that was thrown during function execution.
|
|
18
|
+
*/
|
|
19
|
+
value: any;
|
|
20
|
+
}
|
|
21
|
+
interface MockSettledResultFulfilled<T> {
|
|
22
|
+
type: "fulfilled";
|
|
23
|
+
value: T;
|
|
24
|
+
}
|
|
25
|
+
interface MockSettledResultRejected {
|
|
26
|
+
type: "rejected";
|
|
27
|
+
value: any;
|
|
28
|
+
}
|
|
29
|
+
type MockResult<T> = MockResultReturn<T> | MockResultThrow | MockResultIncomplete;
|
|
30
|
+
type MockSettledResult<T> = MockSettledResultFulfilled<T> | MockSettledResultRejected;
|
|
31
|
+
interface MockContext<T extends Procedure> {
|
|
32
|
+
/**
|
|
33
|
+
* This is an array containing all arguments for each call. One item of the array is the arguments of that call.
|
|
34
|
+
*
|
|
35
|
+
* @see https://vitest.dev/api/mock#mock-calls
|
|
36
|
+
* @example
|
|
37
|
+
* const fn = vi.fn()
|
|
38
|
+
*
|
|
39
|
+
* fn('arg1', 'arg2')
|
|
40
|
+
* fn('arg3')
|
|
41
|
+
*
|
|
42
|
+
* fn.mock.calls === [
|
|
43
|
+
* ['arg1', 'arg2'], // first call
|
|
44
|
+
* ['arg3'], // second call
|
|
45
|
+
* ]
|
|
46
|
+
*/
|
|
47
|
+
calls: Parameters<T>[];
|
|
48
|
+
/**
|
|
49
|
+
* This is an array containing all instances that were instantiated when mock was called with a `new` keyword. Note that this is an actual context (`this`) of the function, not a return value.
|
|
50
|
+
* @see https://vitest.dev/api/mock#mock-instances
|
|
51
|
+
*/
|
|
52
|
+
instances: ReturnType<T>[];
|
|
53
|
+
/**
|
|
54
|
+
* An array of `this` values that were used during each call to the mock function.
|
|
55
|
+
* @see https://vitest.dev/api/mock#mock-contexts
|
|
56
|
+
*/
|
|
57
|
+
contexts: ThisParameterType<T>[];
|
|
58
|
+
/**
|
|
59
|
+
* The order of mock's execution. This returns an array of numbers which are shared between all defined mocks.
|
|
60
|
+
*
|
|
61
|
+
* @see https://vitest.dev/api/mock#mock-invocationcallorder
|
|
62
|
+
* @example
|
|
63
|
+
* const fn1 = vi.fn()
|
|
64
|
+
* const fn2 = vi.fn()
|
|
65
|
+
*
|
|
66
|
+
* fn1()
|
|
67
|
+
* fn2()
|
|
68
|
+
* fn1()
|
|
69
|
+
*
|
|
70
|
+
* fn1.mock.invocationCallOrder === [1, 3]
|
|
71
|
+
* fn2.mock.invocationCallOrder === [2]
|
|
72
|
+
*/
|
|
73
|
+
invocationCallOrder: number[];
|
|
74
|
+
/**
|
|
75
|
+
* This is an array containing all values that were `returned` from the function.
|
|
76
|
+
*
|
|
77
|
+
* The `value` property contains the returned value or thrown error. If the function returned a `Promise`, then `result` will always be `'return'` even if the promise was rejected.
|
|
78
|
+
*
|
|
79
|
+
* @see https://vitest.dev/api/mock#mock-results
|
|
80
|
+
* @example
|
|
81
|
+
* const fn = vi.fn()
|
|
82
|
+
* .mockReturnValueOnce('result')
|
|
83
|
+
* .mockImplementationOnce(() => { throw new Error('thrown error') })
|
|
84
|
+
*
|
|
85
|
+
* const result = fn()
|
|
86
|
+
*
|
|
87
|
+
* try {
|
|
88
|
+
* fn()
|
|
89
|
+
* }
|
|
90
|
+
* catch {}
|
|
91
|
+
*
|
|
92
|
+
* fn.mock.results === [
|
|
93
|
+
* {
|
|
94
|
+
* type: 'return',
|
|
95
|
+
* value: 'result',
|
|
96
|
+
* },
|
|
97
|
+
* {
|
|
98
|
+
* type: 'throw',
|
|
99
|
+
* value: Error,
|
|
100
|
+
* },
|
|
101
|
+
* ]
|
|
102
|
+
*/
|
|
103
|
+
results: MockResult<ReturnType<T>>[];
|
|
104
|
+
/**
|
|
105
|
+
* An array containing all values that were `resolved` or `rejected` from the function.
|
|
106
|
+
*
|
|
107
|
+
* This array will be empty if the function was never resolved or rejected.
|
|
108
|
+
*
|
|
109
|
+
* @see https://vitest.dev/api/mock#mock-settledresults
|
|
110
|
+
* @example
|
|
111
|
+
* const fn = vi.fn().mockResolvedValueOnce('result')
|
|
112
|
+
*
|
|
113
|
+
* const result = fn()
|
|
114
|
+
*
|
|
115
|
+
* fn.mock.settledResults === []
|
|
116
|
+
* fn.mock.results === [
|
|
117
|
+
* {
|
|
118
|
+
* type: 'return',
|
|
119
|
+
* value: Promise<'result'>,
|
|
120
|
+
* },
|
|
121
|
+
* ]
|
|
122
|
+
*
|
|
123
|
+
* await result
|
|
124
|
+
*
|
|
125
|
+
* fn.mock.settledResults === [
|
|
126
|
+
* {
|
|
127
|
+
* type: 'fulfilled',
|
|
128
|
+
* value: 'result',
|
|
129
|
+
* },
|
|
130
|
+
* ]
|
|
131
|
+
*/
|
|
132
|
+
settledResults: MockSettledResult<Awaited<ReturnType<T>>>[];
|
|
133
|
+
/**
|
|
134
|
+
* This contains the arguments of the last call. If spy wasn't called, will return `undefined`.
|
|
135
|
+
* @see https://vitest.dev/api/mock#mock-lastcall
|
|
136
|
+
*/
|
|
137
|
+
lastCall: Parameters<T> | undefined;
|
|
138
|
+
}
|
|
139
|
+
type Procedure = (...args: any[]) => any;
|
|
140
|
+
// pick a single function type from function overloads, unions, etc...
|
|
141
|
+
type NormalizedProcedure<T extends Procedure> = (...args: Parameters<T>) => ReturnType<T>;
|
|
142
|
+
/*
|
|
143
|
+
cf. https://typescript-eslint.io/rules/method-signature-style/
|
|
144
|
+
|
|
145
|
+
Typescript assignability is different between
|
|
146
|
+
{ foo: (f: T) => U } (this is "method-signature-style")
|
|
147
|
+
and
|
|
148
|
+
{ foo(f: T): U }
|
|
149
|
+
|
|
150
|
+
Jest uses the latter for `MockInstance.mockImplementation` etc... and it allows assignment such as:
|
|
151
|
+
const boolFn: Jest.Mock<() => boolean> = jest.fn<() => true>(() => true)
|
|
152
|
+
*/
|
|
153
|
+
/* eslint-disable ts/method-signature-style */
|
|
154
|
+
interface MockInstance<T extends Procedure = Procedure> extends Disposable {
|
|
155
|
+
/**
|
|
156
|
+
* Use it to return the name assigned to the mock with the `.mockName(name)` method. By default, it will return `vi.fn()`.
|
|
157
|
+
* @see https://vitest.dev/api/mock#getmockname
|
|
158
|
+
*/
|
|
159
|
+
getMockName(): string;
|
|
160
|
+
/**
|
|
161
|
+
* Sets the internal mock name. This is useful for identifying the mock when an assertion fails.
|
|
162
|
+
* @see https://vitest.dev/api/mock#mockname
|
|
163
|
+
*/
|
|
164
|
+
mockName(name: string): this;
|
|
165
|
+
/**
|
|
166
|
+
* Current context of the mock. It stores information about all invocation calls, instances, and results.
|
|
167
|
+
*/
|
|
168
|
+
mock: MockContext<T>;
|
|
169
|
+
/**
|
|
170
|
+
* Clears all information about every call. After calling it, all properties on `.mock` will return to their initial state. This method does not reset implementations. It is useful for cleaning up mocks between different assertions.
|
|
171
|
+
*
|
|
172
|
+
* To automatically call this method before each test, enable the [`clearMocks`](https://vitest.dev/config/#clearmocks) setting in the configuration.
|
|
173
|
+
* @see https://vitest.dev/api/mock#mockclear
|
|
174
|
+
*/
|
|
175
|
+
mockClear(): this;
|
|
176
|
+
/**
|
|
177
|
+
* Does what `mockClear` does and resets inner implementation to the original function. This also resets all "once" implementations.
|
|
178
|
+
*
|
|
179
|
+
* Note that resetting a mock from `vi.fn()` will set implementation to an empty function that returns `undefined`.
|
|
180
|
+
* Resetting a mock from `vi.fn(impl)` will set implementation to `impl`. It is useful for completely resetting a mock to its default state.
|
|
181
|
+
*
|
|
182
|
+
* To automatically call this method before each test, enable the [`mockReset`](https://vitest.dev/config/#mockreset) setting in the configuration.
|
|
183
|
+
* @see https://vitest.dev/api/mock#mockreset
|
|
184
|
+
*/
|
|
185
|
+
mockReset(): this;
|
|
186
|
+
/**
|
|
187
|
+
* Does what `mockReset` does and restores original descriptors of spied-on objects.
|
|
188
|
+
*
|
|
189
|
+
* Note that restoring mock from `vi.fn()` will set implementation to an empty function that returns `undefined`. Restoring a `vi.fn(impl)` will restore implementation to `impl`.
|
|
190
|
+
* @see https://vitest.dev/api/mock#mockrestore
|
|
191
|
+
*/
|
|
192
|
+
mockRestore(): void;
|
|
193
|
+
/**
|
|
194
|
+
* Returns current permanent mock implementation if there is one.
|
|
195
|
+
*
|
|
196
|
+
* If mock was created with `vi.fn`, it will consider passed down method as a mock implementation.
|
|
197
|
+
*
|
|
198
|
+
* If mock was created with `vi.spyOn`, it will return `undefined` unless a custom implementation was provided.
|
|
199
|
+
*/
|
|
200
|
+
getMockImplementation(): NormalizedProcedure<T> | undefined;
|
|
201
|
+
/**
|
|
202
|
+
* Accepts a function to be used as the mock implementation. TypeScript expects the arguments and return type to match those of the original function.
|
|
203
|
+
* @see https://vitest.dev/api/mock#mockimplementation
|
|
204
|
+
* @example
|
|
205
|
+
* const increment = vi.fn().mockImplementation(count => count + 1);
|
|
206
|
+
* expect(increment(3)).toBe(4);
|
|
207
|
+
*/
|
|
208
|
+
mockImplementation(fn: NormalizedProcedure<T>): this;
|
|
209
|
+
/**
|
|
210
|
+
* Accepts a function to be used as the mock implementation. TypeScript expects the arguments and return type to match those of the original function. This method can be chained to produce different results for multiple function calls.
|
|
211
|
+
*
|
|
212
|
+
* When the mocked function runs out of implementations, it will invoke the default implementation set with `vi.fn(() => defaultValue)` or `.mockImplementation(() => defaultValue)` if they were called.
|
|
213
|
+
* @see https://vitest.dev/api/mock#mockimplementationonce
|
|
214
|
+
* @example
|
|
215
|
+
* const fn = vi.fn(count => count).mockImplementationOnce(count => count + 1);
|
|
216
|
+
* expect(fn(3)).toBe(4);
|
|
217
|
+
* expect(fn(3)).toBe(3);
|
|
218
|
+
*/
|
|
219
|
+
mockImplementationOnce(fn: NormalizedProcedure<T>): this;
|
|
220
|
+
/**
|
|
221
|
+
* Overrides the original mock implementation temporarily while the callback is being executed.
|
|
222
|
+
*
|
|
223
|
+
* Note that this method takes precedence over the [`mockImplementationOnce`](https://vitest.dev/api/mock#mockimplementationonce).
|
|
224
|
+
* @see https://vitest.dev/api/mock#withimplementation
|
|
225
|
+
* @example
|
|
226
|
+
* const myMockFn = vi.fn(() => 'original')
|
|
227
|
+
*
|
|
228
|
+
* myMockFn.withImplementation(() => 'temp', () => {
|
|
229
|
+
* myMockFn() // 'temp'
|
|
230
|
+
* })
|
|
231
|
+
*
|
|
232
|
+
* myMockFn() // 'original'
|
|
233
|
+
*/
|
|
234
|
+
withImplementation<T2>(fn: NormalizedProcedure<T>, cb: () => T2): T2 extends Promise<unknown> ? Promise<this> : this;
|
|
235
|
+
/**
|
|
236
|
+
* Use this if you need to return the `this` context from the method without invoking the actual implementation.
|
|
237
|
+
* @see https://vitest.dev/api/mock#mockreturnthis
|
|
238
|
+
*/
|
|
239
|
+
mockReturnThis(): this;
|
|
240
|
+
/**
|
|
241
|
+
* Accepts a value that will be returned whenever the mock function is called. TypeScript will only accept values that match the return type of the original function.
|
|
242
|
+
* @see https://vitest.dev/api/mock#mockreturnvalue
|
|
243
|
+
* @example
|
|
244
|
+
* const mock = vi.fn()
|
|
245
|
+
* mock.mockReturnValue(42)
|
|
246
|
+
* mock() // 42
|
|
247
|
+
* mock.mockReturnValue(43)
|
|
248
|
+
* mock() // 43
|
|
249
|
+
*/
|
|
250
|
+
mockReturnValue(value: ReturnType<T>): this;
|
|
251
|
+
/**
|
|
252
|
+
* Accepts a value that will be returned whenever the mock function is called. TypeScript will only accept values that match the return type of the original function.
|
|
253
|
+
*
|
|
254
|
+
* When the mocked function runs out of implementations, it will invoke the default implementation set with `vi.fn(() => defaultValue)` or `.mockImplementation(() => defaultValue)` if they were called.
|
|
255
|
+
* @example
|
|
256
|
+
* const myMockFn = vi
|
|
257
|
+
* .fn()
|
|
258
|
+
* .mockReturnValue('default')
|
|
259
|
+
* .mockReturnValueOnce('first call')
|
|
260
|
+
* .mockReturnValueOnce('second call')
|
|
261
|
+
*
|
|
262
|
+
* // 'first call', 'second call', 'default'
|
|
263
|
+
* console.log(myMockFn(), myMockFn(), myMockFn())
|
|
264
|
+
*/
|
|
265
|
+
mockReturnValueOnce(value: ReturnType<T>): this;
|
|
266
|
+
/**
|
|
267
|
+
* Accepts a value that will be resolved when the async function is called. TypeScript will only accept values that match the return type of the original function.
|
|
268
|
+
* @example
|
|
269
|
+
* const asyncMock = vi.fn().mockResolvedValue(42)
|
|
270
|
+
* asyncMock() // Promise<42>
|
|
271
|
+
*/
|
|
272
|
+
mockResolvedValue(value: Awaited<ReturnType<T>>): this;
|
|
273
|
+
/**
|
|
274
|
+
* Accepts a value that will be resolved during the next function call. TypeScript will only accept values that match the return type of the original function. If chained, each consecutive call will resolve the specified value.
|
|
275
|
+
* @example
|
|
276
|
+
* const myMockFn = vi
|
|
277
|
+
* .fn()
|
|
278
|
+
* .mockResolvedValue('default')
|
|
279
|
+
* .mockResolvedValueOnce('first call')
|
|
280
|
+
* .mockResolvedValueOnce('second call')
|
|
281
|
+
*
|
|
282
|
+
* // Promise<'first call'>, Promise<'second call'>, Promise<'default'>
|
|
283
|
+
* console.log(myMockFn(), myMockFn(), myMockFn())
|
|
284
|
+
*/
|
|
285
|
+
mockResolvedValueOnce(value: Awaited<ReturnType<T>>): this;
|
|
286
|
+
/**
|
|
287
|
+
* Accepts an error that will be rejected when async function is called.
|
|
288
|
+
* @example
|
|
289
|
+
* const asyncMock = vi.fn().mockRejectedValue(new Error('Async error'))
|
|
290
|
+
* await asyncMock() // throws Error<'Async error'>
|
|
291
|
+
*/
|
|
292
|
+
mockRejectedValue(error: unknown): this;
|
|
293
|
+
/**
|
|
294
|
+
* Accepts a value that will be rejected during the next function call. If chained, each consecutive call will reject the specified value.
|
|
295
|
+
* @example
|
|
296
|
+
* const asyncMock = vi
|
|
297
|
+
* .fn()
|
|
298
|
+
* .mockResolvedValueOnce('first call')
|
|
299
|
+
* .mockRejectedValueOnce(new Error('Async error'))
|
|
300
|
+
*
|
|
301
|
+
* await asyncMock() // first call
|
|
302
|
+
* await asyncMock() // throws Error<'Async error'>
|
|
303
|
+
*/
|
|
304
|
+
mockRejectedValueOnce(error: unknown): this;
|
|
305
|
+
}
|
|
306
|
+
/* eslint-enable ts/method-signature-style */
|
|
307
|
+
interface Mock<T extends Procedure = Procedure> extends MockInstance<T> {
|
|
308
|
+
new (...args: Parameters<T>): ReturnType<T>;
|
|
309
|
+
(...args: Parameters<T>): ReturnType<T>;
|
|
310
|
+
}
|
|
311
|
+
|
|
312
|
+
declare const MockLink: React.ForwardRefExoticComponent<Omit<any, "ref"> & React.RefAttributes<HTMLAnchorElement>>;
|
|
313
|
+
|
|
314
|
+
declare const useLinkStatus: Mock<() => {
|
|
315
|
+
pending: boolean;
|
|
316
|
+
}>;
|
|
317
|
+
|
|
318
|
+
export { MockLink as Link, MockLink as default, useLinkStatus };
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import "../../_browser-chunks/chunk-UAWMPV5J.js";
|
|
2
|
+
|
|
3
|
+
// src/export-mocks/link/index.tsx
|
|
4
|
+
import React from "react";
|
|
5
|
+
import { fn } from "storybook/test";
|
|
6
|
+
var linkAction = fn().mockName("next/link::Link"), MockLink = React.forwardRef(function({
|
|
7
|
+
href,
|
|
8
|
+
as,
|
|
9
|
+
replace,
|
|
10
|
+
scroll,
|
|
11
|
+
shallow,
|
|
12
|
+
prefetch,
|
|
13
|
+
passHref,
|
|
14
|
+
legacyBehavior,
|
|
15
|
+
locale,
|
|
16
|
+
onClick,
|
|
17
|
+
children,
|
|
18
|
+
...rest
|
|
19
|
+
}, ref) {
|
|
20
|
+
let resolvedHref = as ?? href, hrefString = typeof resolvedHref == "object" ? `${resolvedHref.pathname || ""}${resolvedHref.query ? "?" + new URLSearchParams(resolvedHref.query).toString() : ""}${resolvedHref.hash || ""}` : resolvedHref, navigate = (e) => {
|
|
21
|
+
e.defaultPrevented || (e.preventDefault(), linkAction(hrefString, { replace, scroll, shallow, prefetch, locale }));
|
|
22
|
+
}, handleClick = (e) => {
|
|
23
|
+
onClick?.(e), navigate(e);
|
|
24
|
+
};
|
|
25
|
+
if (legacyBehavior) {
|
|
26
|
+
let child = React.Children.only(children), childProps = {
|
|
27
|
+
ref,
|
|
28
|
+
onClick: (e) => {
|
|
29
|
+
child.props && typeof child.props.onClick == "function" && child.props.onClick(e), navigate(e);
|
|
30
|
+
},
|
|
31
|
+
...rest
|
|
32
|
+
};
|
|
33
|
+
return (passHref || child.type === "a" && !("href" in (child.props || {}))) && (childProps.href = hrefString), React.cloneElement(child, childProps);
|
|
34
|
+
}
|
|
35
|
+
return React.createElement("a", { ref, href: hrefString, onClick: handleClick, ...rest }, children);
|
|
36
|
+
});
|
|
37
|
+
MockLink.displayName = "NextLink";
|
|
38
|
+
var link_default = MockLink;
|
|
39
|
+
var useLinkStatus = fn(() => ({ pending: !1 })).mockName(
|
|
40
|
+
"next/link::useLinkStatus"
|
|
41
|
+
);
|
|
42
|
+
export {
|
|
43
|
+
MockLink as Link,
|
|
44
|
+
link_default as default,
|
|
45
|
+
useLinkStatus
|
|
46
|
+
};
|
package/dist/index.d.ts
CHANGED
|
@@ -2,7 +2,6 @@ import { PreviewAddon, InferTypes, AddonTypes } from 'storybook/internal/csf';
|
|
|
2
2
|
import { CompatibleString, NamedOrDefaultProjectAnnotations, NormalizedProjectAnnotations, Args, StoryAnnotationsOrFn, ProjectAnnotations, ComposedStoryFn, Store_CSFExports, StoriesWithPartialProps } from 'storybook/internal/types';
|
|
3
3
|
import { ReactRenderer, Meta, ReactTypes, ReactPreview } from '@storybook/react';
|
|
4
4
|
export * from '@storybook/react';
|
|
5
|
-
import vitePluginStorybookNextJs from 'vite-plugin-storybook-nextjs';
|
|
6
5
|
import { BuilderOptions } from '@storybook/builder-vite';
|
|
7
6
|
import { StorybookConfig as StorybookConfig$1 } from '@storybook/react-vite';
|
|
8
7
|
import { NextRouter } from 'next/router';
|
|
@@ -135,9 +134,6 @@ declare function composeStory<TArgs extends Args = Args>(story: StoryAnnotations
|
|
|
135
134
|
*/
|
|
136
135
|
declare function composeStories<TModule extends Store_CSFExports<ReactRenderer, any>>(csfExports: TModule, projectAnnotations?: ProjectAnnotations<ReactRenderer>): Omit<StoriesWithPartialProps<ReactRenderer, TModule>, keyof Store_CSFExports>;
|
|
137
136
|
|
|
138
|
-
declare module '@storybook/nextjs-vite/vite-plugin' {
|
|
139
|
-
const storybookNextJsPlugin: typeof vitePluginStorybookNextJs;
|
|
140
|
-
}
|
|
141
137
|
declare function definePreview<Addons extends PreviewAddon<never>[]>(preview: {
|
|
142
138
|
addons?: Addons;
|
|
143
139
|
} & ProjectAnnotations<ReactTypes & NextJsTypes & InferTypes<Addons>>): NextPreview<InferTypes<Addons>>;
|
package/dist/index.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
preview_exports
|
|
3
|
-
} from "./_browser-chunks/chunk-
|
|
3
|
+
} from "./_browser-chunks/chunk-342N7CWU.js";
|
|
4
4
|
import {
|
|
5
5
|
__commonJS,
|
|
6
6
|
__export,
|
|
7
7
|
__toESM
|
|
8
|
-
} from "./_browser-chunks/chunk-
|
|
8
|
+
} from "./_browser-chunks/chunk-UAWMPV5J.js";
|
|
9
9
|
|
|
10
10
|
// ../../../node_modules/estraverse/estraverse.js
|
|
11
11
|
var require_estraverse = __commonJS({
|
|
@@ -5968,8 +5968,8 @@ var require_dist = __commonJS({
|
|
|
5968
5968
|
var require_react_is_production_min = __commonJS({
|
|
5969
5969
|
"../../../node_modules/react-element-to-jsx-string/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
5970
5970
|
"use strict";
|
|
5971
|
-
var b = Symbol.for("react.element"), c = Symbol.for("react.portal"), d = Symbol.for("react.fragment"), e = Symbol.for("react.strict_mode"), f = Symbol.for("react.profiler"), g = Symbol.for("react.provider"), h = Symbol.for("react.context"), k = Symbol.for("react.server_context"), l = Symbol.for("react.forward_ref"), m = Symbol.for("react.suspense"), n = Symbol.for("react.suspense_list"), p = Symbol.for("react.memo"), q = Symbol.for("react.lazy"), t = Symbol.for("react.offscreen"), u;
|
|
5972
|
-
u = Symbol.for("react.module.reference");
|
|
5971
|
+
var b = /* @__PURE__ */ Symbol.for("react.element"), c = /* @__PURE__ */ Symbol.for("react.portal"), d = /* @__PURE__ */ Symbol.for("react.fragment"), e = /* @__PURE__ */ Symbol.for("react.strict_mode"), f = /* @__PURE__ */ Symbol.for("react.profiler"), g = /* @__PURE__ */ Symbol.for("react.provider"), h = /* @__PURE__ */ Symbol.for("react.context"), k = /* @__PURE__ */ Symbol.for("react.server_context"), l = /* @__PURE__ */ Symbol.for("react.forward_ref"), m = /* @__PURE__ */ Symbol.for("react.suspense"), n = /* @__PURE__ */ Symbol.for("react.suspense_list"), p = /* @__PURE__ */ Symbol.for("react.memo"), q = /* @__PURE__ */ Symbol.for("react.lazy"), t = /* @__PURE__ */ Symbol.for("react.offscreen"), u;
|
|
5972
|
+
u = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
5973
5973
|
function v(a) {
|
|
5974
5974
|
if (typeof a == "object" && a !== null) {
|
|
5975
5975
|
var r = a.$$typeof;
|
|
@@ -6067,8 +6067,8 @@ var require_react_is_development = __commonJS({
|
|
|
6067
6067
|
"use strict";
|
|
6068
6068
|
process.env.NODE_ENV !== "production" && (function() {
|
|
6069
6069
|
"use strict";
|
|
6070
|
-
var enableScopeAPI = !1, enableCacheElement = !1, enableTransitionTracing = !1, enableLegacyHidden = !1, enableDebugTracing = !1, REACT_ELEMENT_TYPE = Symbol.for("react.element"), REACT_PORTAL_TYPE = Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = Symbol.for("react.provider"), REACT_CONTEXT_TYPE = Symbol.for("react.context"), REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context"), REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = Symbol.for("react.memo"), REACT_LAZY_TYPE = Symbol.for("react.lazy"), REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen"), REACT_MODULE_REFERENCE;
|
|
6071
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
6070
|
+
var enableScopeAPI = !1, enableCacheElement = !1, enableTransitionTracing = !1, enableLegacyHidden = !1, enableDebugTracing = !1, REACT_ELEMENT_TYPE = /* @__PURE__ */ Symbol.for("react.element"), REACT_PORTAL_TYPE = /* @__PURE__ */ Symbol.for("react.portal"), REACT_FRAGMENT_TYPE = /* @__PURE__ */ Symbol.for("react.fragment"), REACT_STRICT_MODE_TYPE = /* @__PURE__ */ Symbol.for("react.strict_mode"), REACT_PROFILER_TYPE = /* @__PURE__ */ Symbol.for("react.profiler"), REACT_PROVIDER_TYPE = /* @__PURE__ */ Symbol.for("react.provider"), REACT_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.context"), REACT_SERVER_CONTEXT_TYPE = /* @__PURE__ */ Symbol.for("react.server_context"), REACT_FORWARD_REF_TYPE = /* @__PURE__ */ Symbol.for("react.forward_ref"), REACT_SUSPENSE_TYPE = /* @__PURE__ */ Symbol.for("react.suspense"), REACT_SUSPENSE_LIST_TYPE = /* @__PURE__ */ Symbol.for("react.suspense_list"), REACT_MEMO_TYPE = /* @__PURE__ */ Symbol.for("react.memo"), REACT_LAZY_TYPE = /* @__PURE__ */ Symbol.for("react.lazy"), REACT_OFFSCREEN_TYPE = /* @__PURE__ */ Symbol.for("react.offscreen"), REACT_MODULE_REFERENCE;
|
|
6071
|
+
REACT_MODULE_REFERENCE = /* @__PURE__ */ Symbol.for("react.module.reference");
|
|
6072
6072
|
function isValidElementType(type) {
|
|
6073
6073
|
return !!(typeof type == "string" || typeof type == "function" || type === REACT_FRAGMENT_TYPE || type === REACT_PROFILER_TYPE || enableDebugTracing || type === REACT_STRICT_MODE_TYPE || type === REACT_SUSPENSE_TYPE || type === REACT_SUSPENSE_LIST_TYPE || enableLegacyHidden || type === REACT_OFFSCREEN_TYPE || enableScopeAPI || enableCacheElement || enableTransitionTracing || typeof type == "object" && type !== null && (type.$$typeof === REACT_LAZY_TYPE || type.$$typeof === REACT_MEMO_TYPE || type.$$typeof === REACT_PROVIDER_TYPE || type.$$typeof === REACT_CONTEXT_TYPE || type.$$typeof === REACT_FORWARD_REF_TYPE || // This needs to include all possible module reference object
|
|
6074
6074
|
// types supported by any Flight configuration anywhere since
|
|
@@ -6309,7 +6309,7 @@ async function renderToCanvas({
|
|
|
6309
6309
|
showException,
|
|
6310
6310
|
forceRemount
|
|
6311
6311
|
}, canvasElement) {
|
|
6312
|
-
let { renderElement, unmountElement } = await import("./_browser-chunks/react-18-
|
|
6312
|
+
let { renderElement, unmountElement } = await import("./_browser-chunks/react-18-ODWMAYZK.js"), Story = unboundStoryFn, content = storyContext.parameters.__isPortableStory ? React3.createElement(Story, { ...storyContext }) : React3.createElement(ErrorBoundary, { key: storyContext.id, showMain, showException }, React3.createElement(Story, { ...storyContext })), element = Wrapper ? React3.createElement(Wrapper, null, content) : content;
|
|
6313
6313
|
forceRemount && unmountElement(canvasElement);
|
|
6314
6314
|
let act = await getAct({ disableAct: storyContext.viewMode === "docs" });
|
|
6315
6315
|
return await new Promise(async (resolve, reject) => {
|
|
@@ -6411,7 +6411,7 @@ import {
|
|
|
6411
6411
|
} from "storybook/internal/docs-tools";
|
|
6412
6412
|
|
|
6413
6413
|
// ../../renderers/react/src/docs/lib/componentTypes.ts
|
|
6414
|
-
var isMemo = (component) => component.$$typeof === Symbol.for("react.memo");
|
|
6414
|
+
var isMemo = (component) => component.$$typeof === /* @__PURE__ */ Symbol.for("react.memo");
|
|
6415
6415
|
|
|
6416
6416
|
// ../../renderers/react/src/docs/lib/defaultValues/createDefaultValue.ts
|
|
6417
6417
|
import {
|
|
@@ -6854,14 +6854,9 @@ function parse(value) {
|
|
|
6854
6854
|
};
|
|
6855
6855
|
if (ast.body[0] != null) {
|
|
6856
6856
|
let rootNode = ast.body[0];
|
|
6857
|
-
|
|
6858
|
-
|
|
6859
|
-
|
|
6860
|
-
expressionResult != null && (parsingResult = expressionResult);
|
|
6861
|
-
break;
|
|
6862
|
-
}
|
|
6863
|
-
default:
|
|
6864
|
-
break;
|
|
6857
|
+
if (rootNode.type === "ExpressionStatement") {
|
|
6858
|
+
let expressionResult = parseExpression(rootNode.expression);
|
|
6859
|
+
expressionResult != null && (parsingResult = expressionResult);
|
|
6865
6860
|
}
|
|
6866
6861
|
}
|
|
6867
6862
|
return parsingResult;
|
|
@@ -7232,7 +7227,7 @@ var defaultFunctionValue = inlineFunction, formatFunction = (function(fn, option
|
|
|
7232
7227
|
var usedValue = hasValue ? value : defaultValue, useBooleanShorthandSyntax = options.useBooleanShorthandSyntax, tabStop = options.tabStop, formattedPropValue = formatPropValue(usedValue, inline, lvl, options), attributeFormattedInline = " ", attributeFormattedMultiline = `
|
|
7233
7228
|
`.concat(spacer(lvl + 1, tabStop)), isMultilineAttribute = formattedPropValue.includes(`
|
|
7234
7229
|
`);
|
|
7235
|
-
return useBooleanShorthandSyntax && formattedPropValue === "{
|
|
7230
|
+
return useBooleanShorthandSyntax && formattedPropValue === "{true}" ? (attributeFormattedInline += "".concat(name), attributeFormattedMultiline += "".concat(name)) : (attributeFormattedInline += "".concat(name, "=").concat(formattedPropValue), attributeFormattedMultiline += "".concat(name, "=").concat(formattedPropValue)), {
|
|
7236
7231
|
attributeFormattedInline,
|
|
7237
7232
|
attributeFormattedMultiline,
|
|
7238
7233
|
isMultilineAttribute
|
package/dist/node/index.js
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zr6linfu4po from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zr6linfu4po from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zr6linfu4po from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zr6linfu4po.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zr6linfu4po.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zr6linfu4po.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-7G5KYCPZ.js";
|
|
13
13
|
|
|
14
14
|
// src/node/index.ts
|
|
15
15
|
function defineMain(config) {
|
package/dist/preset.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zr6linfu4po from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zr6linfu4po from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zr6linfu4po from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zr6linfu4po.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zr6linfu4po.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zr6linfu4po.createRequire(import.meta.url);
|
|
8
8
|
|
|
9
9
|
// ------------------------------------------------------------
|
|
10
10
|
// end of CJS compatibility banner, injected by Storybook's esbuild configuration
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
__commonJS,
|
|
14
14
|
__require,
|
|
15
15
|
__toESM
|
|
16
|
-
} from "./_node-chunks/chunk-
|
|
16
|
+
} from "./_node-chunks/chunk-7G5KYCPZ.js";
|
|
17
17
|
|
|
18
18
|
// ../../../node_modules/semver/internal/constants.js
|
|
19
19
|
var require_constants = __commonJS({
|
|
@@ -776,7 +776,7 @@ var require_range = __commonJS({
|
|
|
776
776
|
var require_comparator = __commonJS({
|
|
777
777
|
"../../../node_modules/semver/classes/comparator.js"(exports, module) {
|
|
778
778
|
"use strict";
|
|
779
|
-
var ANY = Symbol("SemVer ANY"), Comparator = class _Comparator {
|
|
779
|
+
var ANY = /* @__PURE__ */ Symbol("SemVer ANY"), Comparator = class _Comparator {
|
|
780
780
|
static get ANY() {
|
|
781
781
|
return ANY;
|
|
782
782
|
}
|
|
@@ -1469,7 +1469,7 @@ var require_req = __commonJS({
|
|
|
1469
1469
|
}
|
|
1470
1470
|
if (tsx === void 0)
|
|
1471
1471
|
try {
|
|
1472
|
-
tsx = await import("./_node-chunks/api-
|
|
1472
|
+
tsx = await import("./_node-chunks/api-WERSIAUS.js");
|
|
1473
1473
|
} catch (error) {
|
|
1474
1474
|
importError.push(error);
|
|
1475
1475
|
}
|
|
@@ -1479,7 +1479,7 @@ var require_req = __commonJS({
|
|
|
1479
1479
|
}
|
|
1480
1480
|
if (jiti === void 0)
|
|
1481
1481
|
try {
|
|
1482
|
-
jiti = (await import("./_node-chunks/jiti-
|
|
1482
|
+
jiti = (await import("./_node-chunks/jiti-ZCHSXSBE.js")).default;
|
|
1483
1483
|
} catch (error) {
|
|
1484
1484
|
importError.push(error);
|
|
1485
1485
|
}
|
|
@@ -1596,7 +1596,7 @@ var require_src2 = __commonJS({
|
|
|
1596
1596
|
async function yamlLoader(_, content) {
|
|
1597
1597
|
if (!yaml)
|
|
1598
1598
|
try {
|
|
1599
|
-
yaml = await import("./_node-chunks/dist-
|
|
1599
|
+
yaml = await import("./_node-chunks/dist-J64YAQZR.js");
|
|
1600
1600
|
} catch (e) {
|
|
1601
1601
|
throw new Error(
|
|
1602
1602
|
`'yaml' is required for the YAML configuration files. Make sure it is installed
|
|
@@ -1954,6 +1954,7 @@ var require3 = createRequire3(import.meta.url), vitePluginStorybookNextjs = requ
|
|
|
1954
1954
|
], nextjsVersion = getNextjsVersion();
|
|
1955
1955
|
return import_semver.default.gte(nextjsVersion, "16.0.0") || annotations.push(fileURLToPath2(import.meta.resolve("@storybook/nextjs-vite/config/preview"))), annotations;
|
|
1956
1956
|
}, optimizeViteDeps = [
|
|
1957
|
+
"@storybook/nextjs-vite/link.mock",
|
|
1957
1958
|
"@storybook/nextjs-vite/navigation.mock",
|
|
1958
1959
|
"@storybook/nextjs-vite/router.mock",
|
|
1959
1960
|
"@storybook/nextjs-vite > styled-jsx",
|
package/dist/preview.js
CHANGED
|
@@ -2,8 +2,8 @@ import {
|
|
|
2
2
|
decorators,
|
|
3
3
|
loaders,
|
|
4
4
|
parameters
|
|
5
|
-
} from "./_browser-chunks/chunk-
|
|
6
|
-
import "./_browser-chunks/chunk-
|
|
5
|
+
} from "./_browser-chunks/chunk-342N7CWU.js";
|
|
6
|
+
import "./_browser-chunks/chunk-UAWMPV5J.js";
|
|
7
7
|
export {
|
|
8
8
|
decorators,
|
|
9
9
|
loaders,
|
|
@@ -1,15 +1,15 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import
|
|
1
|
+
import CJS_COMPAT_NODE_URL_zr6linfu4po from 'node:url';
|
|
2
|
+
import CJS_COMPAT_NODE_PATH_zr6linfu4po from 'node:path';
|
|
3
|
+
import CJS_COMPAT_NODE_MODULE_zr6linfu4po from "node:module";
|
|
4
4
|
|
|
5
|
-
var __filename =
|
|
6
|
-
var __dirname =
|
|
7
|
-
var require =
|
|
5
|
+
var __filename = CJS_COMPAT_NODE_URL_zr6linfu4po.fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = CJS_COMPAT_NODE_PATH_zr6linfu4po.dirname(__filename);
|
|
7
|
+
var require = CJS_COMPAT_NODE_MODULE_zr6linfu4po.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-7G5KYCPZ.js";
|
|
13
13
|
|
|
14
14
|
// src/vite-plugin/index.ts
|
|
15
15
|
import { createRequire } from "node:module";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@storybook/nextjs-vite",
|
|
3
|
-
"version": "10.5.0-alpha.
|
|
3
|
+
"version": "10.5.0-alpha.10",
|
|
4
4
|
"description": "Storybook for Next.js and Vite: Develop, document, and test UI components in isolation",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"storybook",
|
|
@@ -43,6 +43,11 @@
|
|
|
43
43
|
"code": "./src/export-mocks/headers/index.ts",
|
|
44
44
|
"default": "./dist/export-mocks/headers/index.js"
|
|
45
45
|
},
|
|
46
|
+
"./link.mock": {
|
|
47
|
+
"types": "./dist/export-mocks/link/index.d.ts",
|
|
48
|
+
"code": "./src/export-mocks/link/index.tsx",
|
|
49
|
+
"default": "./dist/export-mocks/link/index.js"
|
|
50
|
+
},
|
|
46
51
|
"./navigation.mock": {
|
|
47
52
|
"types": "./dist/export-mocks/navigation/index.d.ts",
|
|
48
53
|
"code": "./src/export-mocks/navigation/index.ts",
|
|
@@ -83,11 +88,11 @@
|
|
|
83
88
|
"!src/**/*"
|
|
84
89
|
],
|
|
85
90
|
"dependencies": {
|
|
86
|
-
"@storybook/builder-vite": "10.5.0-alpha.
|
|
87
|
-
"@storybook/react": "10.5.0-alpha.
|
|
88
|
-
"@storybook/react-vite": "10.5.0-alpha.
|
|
91
|
+
"@storybook/builder-vite": "10.5.0-alpha.10",
|
|
92
|
+
"@storybook/react": "10.5.0-alpha.10",
|
|
93
|
+
"@storybook/react-vite": "10.5.0-alpha.10",
|
|
89
94
|
"styled-jsx": "5.1.6",
|
|
90
|
-
"vite-plugin-storybook-nextjs": "^3.
|
|
95
|
+
"vite-plugin-storybook-nextjs": "^3.3.0"
|
|
91
96
|
},
|
|
92
97
|
"devDependencies": {
|
|
93
98
|
"@types/node": "^22.19.1",
|
|
@@ -103,7 +108,7 @@
|
|
|
103
108
|
"next": "^14.1.0 || ^15.0.0 || ^16.0.0",
|
|
104
109
|
"react": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
105
110
|
"react-dom": "^16.8.0 || ^17.0.0 || ^18.0.0 || ^19.0.0",
|
|
106
|
-
"storybook": "^10.5.0-alpha.
|
|
111
|
+
"storybook": "^10.5.0-alpha.10",
|
|
107
112
|
"vite": "^5.0.0 || ^6.0.0 || ^7.0.0 || ^8.0.0"
|
|
108
113
|
},
|
|
109
114
|
"peerDependenciesMeta": {
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
},
|
|
13
13
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
14
14
|
tags: ['autodocs'],
|
|
15
|
-
// More on argTypes: https://storybook.js.org/docs/api/
|
|
15
|
+
// More on argTypes: https://storybook.js.org/docs/api/arg-types
|
|
16
16
|
argTypes: {
|
|
17
17
|
backgroundColor: { control: 'color' },
|
|
18
18
|
},
|
|
@@ -14,7 +14,7 @@ const meta = {
|
|
|
14
14
|
},
|
|
15
15
|
// This component will have an automatically generated Autodocs entry: https://storybook.js.org/docs/writing-docs/autodocs
|
|
16
16
|
tags: ['autodocs'],
|
|
17
|
-
// More on argTypes: https://storybook.js.org/docs/api/
|
|
17
|
+
// More on argTypes: https://storybook.js.org/docs/api/arg-types
|
|
18
18
|
argTypes: {
|
|
19
19
|
backgroundColor: { control: 'color' },
|
|
20
20
|
},
|