@storybook/react 9.2.0-alpha.3 → 10.0.0-beta.0
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/README.md +2 -0
- package/dist/_browser-chunks/chunk-BUAOEMNB.js +14 -0
- package/dist/_browser-chunks/chunk-HBQ5Y6GW.js +209 -0
- package/dist/_browser-chunks/chunk-I3XJ5JHI.js +43 -0
- package/dist/_browser-chunks/chunk-L5NVL7MD.js +37 -0
- package/dist/_browser-chunks/chunk-V6XFC4HM.js +18819 -0
- package/dist/_browser-chunks/chunk-VVH2AMAL.js +1075 -0
- package/dist/_browser-chunks/chunk-XNNKYNNU.js +2187 -0
- package/dist/entry-preview-argtypes.js +10 -45
- package/dist/entry-preview-docs.js +13 -17
- package/dist/entry-preview-rsc.js +11 -1
- package/dist/entry-preview.js +21 -1
- package/dist/index.d.ts +447 -10
- package/dist/index.js +79 -46
- package/dist/playwright.js +7 -1
- package/dist/preset.js +203 -1
- package/dist/preview.d.ts +3 -202
- package/dist/preview.d.tsx +420 -0
- package/dist/preview.js +12 -46
- package/package.json +20 -54
- package/preset.js +1 -1
- package/preview.js +1 -0
- package/dist/chunk-6BNVLEVL.mjs +0 -22
- package/dist/chunk-6PSAWJ36.mjs +0 -12
- package/dist/chunk-JQQVJC7C.mjs +0 -36
- package/dist/chunk-MNKU3DTE.mjs +0 -9
- package/dist/chunk-OZUYIFQK.mjs +0 -8
- package/dist/chunk-XLZBPYSH.mjs +0 -6
- package/dist/chunk-XP5HYGXS.mjs +0 -3
- package/dist/entry-preview-argtypes.d.ts +0 -16
- package/dist/entry-preview-argtypes.mjs +0 -3
- package/dist/entry-preview-docs.d.ts +0 -18
- package/dist/entry-preview-docs.mjs +0 -4
- package/dist/entry-preview-rsc.d.ts +0 -7
- package/dist/entry-preview-rsc.mjs +0 -5
- package/dist/entry-preview.d.ts +0 -21
- package/dist/entry-preview.mjs +0 -3
- package/dist/index.mjs +0 -14
- package/dist/playwright.mjs +0 -2
- package/dist/preset.d.ts +0 -19
- package/dist/preview.mjs +0 -7
- package/dist/public-types-d899d203.d.ts +0 -230
- package/dist/types-7abe74eb.d.ts +0 -28
|
@@ -0,0 +1,1075 @@
|
|
|
1
|
+
import {
|
|
2
|
+
__commonJS,
|
|
3
|
+
__name,
|
|
4
|
+
__toESM
|
|
5
|
+
} from "./chunk-L5NVL7MD.js";
|
|
6
|
+
|
|
7
|
+
// ../../node_modules/@base2/pretty-print-object/dist/index.js
|
|
8
|
+
var require_dist = __commonJS({
|
|
9
|
+
"../../node_modules/@base2/pretty-print-object/dist/index.js"(exports) {
|
|
10
|
+
"use strict";
|
|
11
|
+
var __assign = exports && exports.__assign || function() {
|
|
12
|
+
__assign = Object.assign || function(t) {
|
|
13
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
14
|
+
s = arguments[i];
|
|
15
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
16
|
+
t[p] = s[p];
|
|
17
|
+
}
|
|
18
|
+
return t;
|
|
19
|
+
};
|
|
20
|
+
return __assign.apply(this, arguments);
|
|
21
|
+
};
|
|
22
|
+
var __spreadArrays = exports && exports.__spreadArrays || function() {
|
|
23
|
+
for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;
|
|
24
|
+
for (var r = Array(s), k = 0, i = 0; i < il; i++)
|
|
25
|
+
for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)
|
|
26
|
+
r[k] = a[j];
|
|
27
|
+
return r;
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
var seen = [];
|
|
31
|
+
function isObj(value) {
|
|
32
|
+
var type = typeof value;
|
|
33
|
+
return value !== null && (type === "object" || type === "function");
|
|
34
|
+
}
|
|
35
|
+
__name(isObj, "isObj");
|
|
36
|
+
function isRegexp(value) {
|
|
37
|
+
return Object.prototype.toString.call(value) === "[object RegExp]";
|
|
38
|
+
}
|
|
39
|
+
__name(isRegexp, "isRegexp");
|
|
40
|
+
function getOwnEnumPropSymbols(object) {
|
|
41
|
+
return Object.getOwnPropertySymbols(object).filter(function(keySymbol) {
|
|
42
|
+
return Object.prototype.propertyIsEnumerable.call(object, keySymbol);
|
|
43
|
+
});
|
|
44
|
+
}
|
|
45
|
+
__name(getOwnEnumPropSymbols, "getOwnEnumPropSymbols");
|
|
46
|
+
function prettyPrint2(input, options, pad) {
|
|
47
|
+
if (pad === void 0) {
|
|
48
|
+
pad = "";
|
|
49
|
+
}
|
|
50
|
+
var defaultOptions = {
|
|
51
|
+
indent: " ",
|
|
52
|
+
singleQuotes: true
|
|
53
|
+
};
|
|
54
|
+
var combinedOptions = __assign(__assign({}, defaultOptions), options);
|
|
55
|
+
var tokens;
|
|
56
|
+
if (combinedOptions.inlineCharacterLimit === void 0) {
|
|
57
|
+
tokens = {
|
|
58
|
+
newLine: "\n",
|
|
59
|
+
newLineOrSpace: "\n",
|
|
60
|
+
pad,
|
|
61
|
+
indent: pad + combinedOptions.indent
|
|
62
|
+
};
|
|
63
|
+
} else {
|
|
64
|
+
tokens = {
|
|
65
|
+
newLine: "@@__PRETTY_PRINT_NEW_LINE__@@",
|
|
66
|
+
newLineOrSpace: "@@__PRETTY_PRINT_NEW_LINE_OR_SPACE__@@",
|
|
67
|
+
pad: "@@__PRETTY_PRINT_PAD__@@",
|
|
68
|
+
indent: "@@__PRETTY_PRINT_INDENT__@@"
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
var expandWhiteSpace = /* @__PURE__ */ __name(function(string) {
|
|
72
|
+
if (combinedOptions.inlineCharacterLimit === void 0) {
|
|
73
|
+
return string;
|
|
74
|
+
}
|
|
75
|
+
var oneLined = string.replace(new RegExp(tokens.newLine, "g"), "").replace(new RegExp(tokens.newLineOrSpace, "g"), " ").replace(new RegExp(tokens.pad + "|" + tokens.indent, "g"), "");
|
|
76
|
+
if (oneLined.length <= combinedOptions.inlineCharacterLimit) {
|
|
77
|
+
return oneLined;
|
|
78
|
+
}
|
|
79
|
+
return string.replace(new RegExp(tokens.newLine + "|" + tokens.newLineOrSpace, "g"), "\n").replace(new RegExp(tokens.pad, "g"), pad).replace(new RegExp(tokens.indent, "g"), pad + combinedOptions.indent);
|
|
80
|
+
}, "expandWhiteSpace");
|
|
81
|
+
if (seen.indexOf(input) !== -1) {
|
|
82
|
+
return '"[Circular]"';
|
|
83
|
+
}
|
|
84
|
+
if (input === null || input === void 0 || typeof input === "number" || typeof input === "boolean" || typeof input === "function" || typeof input === "symbol" || isRegexp(input)) {
|
|
85
|
+
return String(input);
|
|
86
|
+
}
|
|
87
|
+
if (input instanceof Date) {
|
|
88
|
+
return "new Date('" + input.toISOString() + "')";
|
|
89
|
+
}
|
|
90
|
+
if (Array.isArray(input)) {
|
|
91
|
+
if (input.length === 0) {
|
|
92
|
+
return "[]";
|
|
93
|
+
}
|
|
94
|
+
seen.push(input);
|
|
95
|
+
var ret = "[" + tokens.newLine + input.map(function(el, i) {
|
|
96
|
+
var eol = input.length - 1 === i ? tokens.newLine : "," + tokens.newLineOrSpace;
|
|
97
|
+
var value = prettyPrint2(el, combinedOptions, pad + combinedOptions.indent);
|
|
98
|
+
if (combinedOptions.transform) {
|
|
99
|
+
value = combinedOptions.transform(input, i, value);
|
|
100
|
+
}
|
|
101
|
+
return tokens.indent + value + eol;
|
|
102
|
+
}).join("") + tokens.pad + "]";
|
|
103
|
+
seen.pop();
|
|
104
|
+
return expandWhiteSpace(ret);
|
|
105
|
+
}
|
|
106
|
+
if (isObj(input)) {
|
|
107
|
+
var objKeys_1 = __spreadArrays(Object.keys(input), getOwnEnumPropSymbols(input));
|
|
108
|
+
if (combinedOptions.filter) {
|
|
109
|
+
objKeys_1 = objKeys_1.filter(function(el) {
|
|
110
|
+
return combinedOptions.filter && combinedOptions.filter(input, el);
|
|
111
|
+
});
|
|
112
|
+
}
|
|
113
|
+
if (objKeys_1.length === 0) {
|
|
114
|
+
return "{}";
|
|
115
|
+
}
|
|
116
|
+
seen.push(input);
|
|
117
|
+
var ret = "{" + tokens.newLine + objKeys_1.map(function(el, i) {
|
|
118
|
+
var eol = objKeys_1.length - 1 === i ? tokens.newLine : "," + tokens.newLineOrSpace;
|
|
119
|
+
var isSymbol = typeof el === "symbol";
|
|
120
|
+
var isClassic = !isSymbol && /^[a-z$_][a-z$_0-9]*$/i.test(el.toString());
|
|
121
|
+
var key = isSymbol || isClassic ? el : prettyPrint2(el, combinedOptions);
|
|
122
|
+
var value = prettyPrint2(input[el], combinedOptions, pad + combinedOptions.indent);
|
|
123
|
+
if (combinedOptions.transform) {
|
|
124
|
+
value = combinedOptions.transform(input, el, value);
|
|
125
|
+
}
|
|
126
|
+
return tokens.indent + String(key) + ": " + value + eol;
|
|
127
|
+
}).join("") + tokens.pad + "}";
|
|
128
|
+
seen.pop();
|
|
129
|
+
return expandWhiteSpace(ret);
|
|
130
|
+
}
|
|
131
|
+
input = String(input).replace(/[\r\n]/g, function(x) {
|
|
132
|
+
return x === "\n" ? "\\n" : "\\r";
|
|
133
|
+
});
|
|
134
|
+
if (!combinedOptions.singleQuotes) {
|
|
135
|
+
input = input.replace(/"/g, '\\"');
|
|
136
|
+
return '"' + input + '"';
|
|
137
|
+
}
|
|
138
|
+
input = input.replace(/\\?'/g, "\\'");
|
|
139
|
+
return "'" + input + "'";
|
|
140
|
+
}
|
|
141
|
+
__name(prettyPrint2, "prettyPrint");
|
|
142
|
+
exports.prettyPrint = prettyPrint2;
|
|
143
|
+
}
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
// ../../node_modules/react-element-to-jsx-string/node_modules/react-is/cjs/react-is.production.min.js
|
|
147
|
+
var require_react_is_production_min = __commonJS({
|
|
148
|
+
"../../node_modules/react-element-to-jsx-string/node_modules/react-is/cjs/react-is.production.min.js"(exports) {
|
|
149
|
+
"use strict";
|
|
150
|
+
var b = Symbol.for("react.element");
|
|
151
|
+
var c = Symbol.for("react.portal");
|
|
152
|
+
var d = Symbol.for("react.fragment");
|
|
153
|
+
var e = Symbol.for("react.strict_mode");
|
|
154
|
+
var f = Symbol.for("react.profiler");
|
|
155
|
+
var g = Symbol.for("react.provider");
|
|
156
|
+
var h = Symbol.for("react.context");
|
|
157
|
+
var k = Symbol.for("react.server_context");
|
|
158
|
+
var l = Symbol.for("react.forward_ref");
|
|
159
|
+
var m = Symbol.for("react.suspense");
|
|
160
|
+
var n = Symbol.for("react.suspense_list");
|
|
161
|
+
var p = Symbol.for("react.memo");
|
|
162
|
+
var q = Symbol.for("react.lazy");
|
|
163
|
+
var t = Symbol.for("react.offscreen");
|
|
164
|
+
var u;
|
|
165
|
+
u = Symbol.for("react.module.reference");
|
|
166
|
+
function v(a) {
|
|
167
|
+
if ("object" === typeof a && null !== a) {
|
|
168
|
+
var r = a.$$typeof;
|
|
169
|
+
switch (r) {
|
|
170
|
+
case b:
|
|
171
|
+
switch (a = a.type, a) {
|
|
172
|
+
case d:
|
|
173
|
+
case f:
|
|
174
|
+
case e:
|
|
175
|
+
case m:
|
|
176
|
+
case n:
|
|
177
|
+
return a;
|
|
178
|
+
default:
|
|
179
|
+
switch (a = a && a.$$typeof, a) {
|
|
180
|
+
case k:
|
|
181
|
+
case h:
|
|
182
|
+
case l:
|
|
183
|
+
case q:
|
|
184
|
+
case p:
|
|
185
|
+
case g:
|
|
186
|
+
return a;
|
|
187
|
+
default:
|
|
188
|
+
return r;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
case c:
|
|
192
|
+
return r;
|
|
193
|
+
}
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
__name(v, "v");
|
|
197
|
+
exports.ContextConsumer = h;
|
|
198
|
+
exports.ContextProvider = g;
|
|
199
|
+
exports.Element = b;
|
|
200
|
+
exports.ForwardRef = l;
|
|
201
|
+
exports.Fragment = d;
|
|
202
|
+
exports.Lazy = q;
|
|
203
|
+
exports.Memo = p;
|
|
204
|
+
exports.Portal = c;
|
|
205
|
+
exports.Profiler = f;
|
|
206
|
+
exports.StrictMode = e;
|
|
207
|
+
exports.Suspense = m;
|
|
208
|
+
exports.SuspenseList = n;
|
|
209
|
+
exports.isAsyncMode = function() {
|
|
210
|
+
return false;
|
|
211
|
+
};
|
|
212
|
+
exports.isConcurrentMode = function() {
|
|
213
|
+
return false;
|
|
214
|
+
};
|
|
215
|
+
exports.isContextConsumer = function(a) {
|
|
216
|
+
return v(a) === h;
|
|
217
|
+
};
|
|
218
|
+
exports.isContextProvider = function(a) {
|
|
219
|
+
return v(a) === g;
|
|
220
|
+
};
|
|
221
|
+
exports.isElement = function(a) {
|
|
222
|
+
return "object" === typeof a && null !== a && a.$$typeof === b;
|
|
223
|
+
};
|
|
224
|
+
exports.isForwardRef = function(a) {
|
|
225
|
+
return v(a) === l;
|
|
226
|
+
};
|
|
227
|
+
exports.isFragment = function(a) {
|
|
228
|
+
return v(a) === d;
|
|
229
|
+
};
|
|
230
|
+
exports.isLazy = function(a) {
|
|
231
|
+
return v(a) === q;
|
|
232
|
+
};
|
|
233
|
+
exports.isMemo = function(a) {
|
|
234
|
+
return v(a) === p;
|
|
235
|
+
};
|
|
236
|
+
exports.isPortal = function(a) {
|
|
237
|
+
return v(a) === c;
|
|
238
|
+
};
|
|
239
|
+
exports.isProfiler = function(a) {
|
|
240
|
+
return v(a) === f;
|
|
241
|
+
};
|
|
242
|
+
exports.isStrictMode = function(a) {
|
|
243
|
+
return v(a) === e;
|
|
244
|
+
};
|
|
245
|
+
exports.isSuspense = function(a) {
|
|
246
|
+
return v(a) === m;
|
|
247
|
+
};
|
|
248
|
+
exports.isSuspenseList = function(a) {
|
|
249
|
+
return v(a) === n;
|
|
250
|
+
};
|
|
251
|
+
exports.isValidElementType = function(a) {
|
|
252
|
+
return "string" === typeof a || "function" === typeof a || a === d || a === f || a === e || a === m || a === n || a === t || "object" === typeof a && null !== a && (a.$$typeof === q || a.$$typeof === p || a.$$typeof === g || a.$$typeof === h || a.$$typeof === l || a.$$typeof === u || void 0 !== a.getModuleId) ? true : false;
|
|
253
|
+
};
|
|
254
|
+
exports.typeOf = v;
|
|
255
|
+
}
|
|
256
|
+
});
|
|
257
|
+
|
|
258
|
+
// ../../node_modules/react-element-to-jsx-string/node_modules/react-is/cjs/react-is.development.js
|
|
259
|
+
var require_react_is_development = __commonJS({
|
|
260
|
+
"../../node_modules/react-element-to-jsx-string/node_modules/react-is/cjs/react-is.development.js"(exports) {
|
|
261
|
+
"use strict";
|
|
262
|
+
if (process.env.NODE_ENV !== "production") {
|
|
263
|
+
(function() {
|
|
264
|
+
"use strict";
|
|
265
|
+
var enableScopeAPI = false;
|
|
266
|
+
var enableCacheElement = false;
|
|
267
|
+
var enableTransitionTracing = false;
|
|
268
|
+
var enableLegacyHidden = false;
|
|
269
|
+
var enableDebugTracing = false;
|
|
270
|
+
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
271
|
+
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
272
|
+
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
273
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
274
|
+
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
275
|
+
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
276
|
+
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
277
|
+
var REACT_SERVER_CONTEXT_TYPE = Symbol.for("react.server_context");
|
|
278
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
279
|
+
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
280
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
281
|
+
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
282
|
+
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
283
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
284
|
+
var REACT_MODULE_REFERENCE;
|
|
285
|
+
{
|
|
286
|
+
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
287
|
+
}
|
|
288
|
+
function isValidElementType(type) {
|
|
289
|
+
if (typeof type === "string" || typeof type === "function") {
|
|
290
|
+
return true;
|
|
291
|
+
}
|
|
292
|
+
if (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) {
|
|
293
|
+
return true;
|
|
294
|
+
}
|
|
295
|
+
if (typeof type === "object" && type !== null) {
|
|
296
|
+
if (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
|
|
297
|
+
// types supported by any Flight configuration anywhere since
|
|
298
|
+
// we don't know which Flight build this will end up being used
|
|
299
|
+
// with.
|
|
300
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== void 0) {
|
|
301
|
+
return true;
|
|
302
|
+
}
|
|
303
|
+
}
|
|
304
|
+
return false;
|
|
305
|
+
}
|
|
306
|
+
__name(isValidElementType, "isValidElementType");
|
|
307
|
+
function typeOf(object) {
|
|
308
|
+
if (typeof object === "object" && object !== null) {
|
|
309
|
+
var $$typeof = object.$$typeof;
|
|
310
|
+
switch ($$typeof) {
|
|
311
|
+
case REACT_ELEMENT_TYPE:
|
|
312
|
+
var type = object.type;
|
|
313
|
+
switch (type) {
|
|
314
|
+
case REACT_FRAGMENT_TYPE:
|
|
315
|
+
case REACT_PROFILER_TYPE:
|
|
316
|
+
case REACT_STRICT_MODE_TYPE:
|
|
317
|
+
case REACT_SUSPENSE_TYPE:
|
|
318
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
319
|
+
return type;
|
|
320
|
+
default:
|
|
321
|
+
var $$typeofType = type && type.$$typeof;
|
|
322
|
+
switch ($$typeofType) {
|
|
323
|
+
case REACT_SERVER_CONTEXT_TYPE:
|
|
324
|
+
case REACT_CONTEXT_TYPE:
|
|
325
|
+
case REACT_FORWARD_REF_TYPE:
|
|
326
|
+
case REACT_LAZY_TYPE:
|
|
327
|
+
case REACT_MEMO_TYPE:
|
|
328
|
+
case REACT_PROVIDER_TYPE:
|
|
329
|
+
return $$typeofType;
|
|
330
|
+
default:
|
|
331
|
+
return $$typeof;
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
case REACT_PORTAL_TYPE:
|
|
335
|
+
return $$typeof;
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
return void 0;
|
|
339
|
+
}
|
|
340
|
+
__name(typeOf, "typeOf");
|
|
341
|
+
var ContextConsumer = REACT_CONTEXT_TYPE;
|
|
342
|
+
var ContextProvider = REACT_PROVIDER_TYPE;
|
|
343
|
+
var Element = REACT_ELEMENT_TYPE;
|
|
344
|
+
var ForwardRef2 = REACT_FORWARD_REF_TYPE;
|
|
345
|
+
var Fragment2 = REACT_FRAGMENT_TYPE;
|
|
346
|
+
var Lazy = REACT_LAZY_TYPE;
|
|
347
|
+
var Memo2 = REACT_MEMO_TYPE;
|
|
348
|
+
var Portal = REACT_PORTAL_TYPE;
|
|
349
|
+
var Profiler = REACT_PROFILER_TYPE;
|
|
350
|
+
var StrictMode = REACT_STRICT_MODE_TYPE;
|
|
351
|
+
var Suspense = REACT_SUSPENSE_TYPE;
|
|
352
|
+
var SuspenseList = REACT_SUSPENSE_LIST_TYPE;
|
|
353
|
+
var hasWarnedAboutDeprecatedIsAsyncMode = false;
|
|
354
|
+
var hasWarnedAboutDeprecatedIsConcurrentMode = false;
|
|
355
|
+
function isAsyncMode(object) {
|
|
356
|
+
{
|
|
357
|
+
if (!hasWarnedAboutDeprecatedIsAsyncMode) {
|
|
358
|
+
hasWarnedAboutDeprecatedIsAsyncMode = true;
|
|
359
|
+
console["warn"]("The ReactIs.isAsyncMode() alias has been deprecated, and will be removed in React 18+.");
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
return false;
|
|
363
|
+
}
|
|
364
|
+
__name(isAsyncMode, "isAsyncMode");
|
|
365
|
+
function isConcurrentMode(object) {
|
|
366
|
+
{
|
|
367
|
+
if (!hasWarnedAboutDeprecatedIsConcurrentMode) {
|
|
368
|
+
hasWarnedAboutDeprecatedIsConcurrentMode = true;
|
|
369
|
+
console["warn"]("The ReactIs.isConcurrentMode() alias has been deprecated, and will be removed in React 18+.");
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return false;
|
|
373
|
+
}
|
|
374
|
+
__name(isConcurrentMode, "isConcurrentMode");
|
|
375
|
+
function isContextConsumer2(object) {
|
|
376
|
+
return typeOf(object) === REACT_CONTEXT_TYPE;
|
|
377
|
+
}
|
|
378
|
+
__name(isContextConsumer2, "isContextConsumer");
|
|
379
|
+
function isContextProvider2(object) {
|
|
380
|
+
return typeOf(object) === REACT_PROVIDER_TYPE;
|
|
381
|
+
}
|
|
382
|
+
__name(isContextProvider2, "isContextProvider");
|
|
383
|
+
function isElement(object) {
|
|
384
|
+
return typeof object === "object" && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
385
|
+
}
|
|
386
|
+
__name(isElement, "isElement");
|
|
387
|
+
function isForwardRef3(object) {
|
|
388
|
+
return typeOf(object) === REACT_FORWARD_REF_TYPE;
|
|
389
|
+
}
|
|
390
|
+
__name(isForwardRef3, "isForwardRef");
|
|
391
|
+
function isFragment(object) {
|
|
392
|
+
return typeOf(object) === REACT_FRAGMENT_TYPE;
|
|
393
|
+
}
|
|
394
|
+
__name(isFragment, "isFragment");
|
|
395
|
+
function isLazy2(object) {
|
|
396
|
+
return typeOf(object) === REACT_LAZY_TYPE;
|
|
397
|
+
}
|
|
398
|
+
__name(isLazy2, "isLazy");
|
|
399
|
+
function isMemo3(object) {
|
|
400
|
+
return typeOf(object) === REACT_MEMO_TYPE;
|
|
401
|
+
}
|
|
402
|
+
__name(isMemo3, "isMemo");
|
|
403
|
+
function isPortal(object) {
|
|
404
|
+
return typeOf(object) === REACT_PORTAL_TYPE;
|
|
405
|
+
}
|
|
406
|
+
__name(isPortal, "isPortal");
|
|
407
|
+
function isProfiler2(object) {
|
|
408
|
+
return typeOf(object) === REACT_PROFILER_TYPE;
|
|
409
|
+
}
|
|
410
|
+
__name(isProfiler2, "isProfiler");
|
|
411
|
+
function isStrictMode2(object) {
|
|
412
|
+
return typeOf(object) === REACT_STRICT_MODE_TYPE;
|
|
413
|
+
}
|
|
414
|
+
__name(isStrictMode2, "isStrictMode");
|
|
415
|
+
function isSuspense2(object) {
|
|
416
|
+
return typeOf(object) === REACT_SUSPENSE_TYPE;
|
|
417
|
+
}
|
|
418
|
+
__name(isSuspense2, "isSuspense");
|
|
419
|
+
function isSuspenseList(object) {
|
|
420
|
+
return typeOf(object) === REACT_SUSPENSE_LIST_TYPE;
|
|
421
|
+
}
|
|
422
|
+
__name(isSuspenseList, "isSuspenseList");
|
|
423
|
+
exports.ContextConsumer = ContextConsumer;
|
|
424
|
+
exports.ContextProvider = ContextProvider;
|
|
425
|
+
exports.Element = Element;
|
|
426
|
+
exports.ForwardRef = ForwardRef2;
|
|
427
|
+
exports.Fragment = Fragment2;
|
|
428
|
+
exports.Lazy = Lazy;
|
|
429
|
+
exports.Memo = Memo2;
|
|
430
|
+
exports.Portal = Portal;
|
|
431
|
+
exports.Profiler = Profiler;
|
|
432
|
+
exports.StrictMode = StrictMode;
|
|
433
|
+
exports.Suspense = Suspense;
|
|
434
|
+
exports.SuspenseList = SuspenseList;
|
|
435
|
+
exports.isAsyncMode = isAsyncMode;
|
|
436
|
+
exports.isConcurrentMode = isConcurrentMode;
|
|
437
|
+
exports.isContextConsumer = isContextConsumer2;
|
|
438
|
+
exports.isContextProvider = isContextProvider2;
|
|
439
|
+
exports.isElement = isElement;
|
|
440
|
+
exports.isForwardRef = isForwardRef3;
|
|
441
|
+
exports.isFragment = isFragment;
|
|
442
|
+
exports.isLazy = isLazy2;
|
|
443
|
+
exports.isMemo = isMemo3;
|
|
444
|
+
exports.isPortal = isPortal;
|
|
445
|
+
exports.isProfiler = isProfiler2;
|
|
446
|
+
exports.isStrictMode = isStrictMode2;
|
|
447
|
+
exports.isSuspense = isSuspense2;
|
|
448
|
+
exports.isSuspenseList = isSuspenseList;
|
|
449
|
+
exports.isValidElementType = isValidElementType;
|
|
450
|
+
exports.typeOf = typeOf;
|
|
451
|
+
})();
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
|
|
456
|
+
// ../../node_modules/react-element-to-jsx-string/node_modules/react-is/index.js
|
|
457
|
+
var require_react_is = __commonJS({
|
|
458
|
+
"../../node_modules/react-element-to-jsx-string/node_modules/react-is/index.js"(exports, module) {
|
|
459
|
+
"use strict";
|
|
460
|
+
if (process.env.NODE_ENV === "production") {
|
|
461
|
+
module.exports = require_react_is_production_min();
|
|
462
|
+
} else {
|
|
463
|
+
module.exports = require_react_is_development();
|
|
464
|
+
}
|
|
465
|
+
}
|
|
466
|
+
});
|
|
467
|
+
|
|
468
|
+
// src/docs/lib/componentTypes.ts
|
|
469
|
+
var isMemo = /* @__PURE__ */ __name((component) => component.$$typeof === Symbol.for("react.memo"), "isMemo");
|
|
470
|
+
var isForwardRef = /* @__PURE__ */ __name((component) => component.$$typeof === Symbol.for("react.forward_ref"), "isForwardRef");
|
|
471
|
+
|
|
472
|
+
// ../../node_modules/is-plain-object/dist/is-plain-object.mjs
|
|
473
|
+
function isObject(o) {
|
|
474
|
+
return Object.prototype.toString.call(o) === "[object Object]";
|
|
475
|
+
}
|
|
476
|
+
__name(isObject, "isObject");
|
|
477
|
+
function isPlainObject(o) {
|
|
478
|
+
var ctor, prot;
|
|
479
|
+
if (isObject(o) === false) return false;
|
|
480
|
+
ctor = o.constructor;
|
|
481
|
+
if (ctor === void 0) return true;
|
|
482
|
+
prot = ctor.prototype;
|
|
483
|
+
if (isObject(prot) === false) return false;
|
|
484
|
+
if (prot.hasOwnProperty("isPrototypeOf") === false) {
|
|
485
|
+
return false;
|
|
486
|
+
}
|
|
487
|
+
return true;
|
|
488
|
+
}
|
|
489
|
+
__name(isPlainObject, "isPlainObject");
|
|
490
|
+
|
|
491
|
+
// ../../node_modules/react-element-to-jsx-string/dist/esm/index.js
|
|
492
|
+
var import_pretty_print_object = __toESM(require_dist());
|
|
493
|
+
var import_react_is = __toESM(require_react_is());
|
|
494
|
+
import * as React from "react";
|
|
495
|
+
import React__default, { Fragment, isValidElement as isValidElement2 } from "react";
|
|
496
|
+
var spacer = /* @__PURE__ */ __name(function(times, tabStop) {
|
|
497
|
+
if (times === 0) {
|
|
498
|
+
return "";
|
|
499
|
+
}
|
|
500
|
+
return new Array(times * tabStop).fill(" ").join("");
|
|
501
|
+
}, "spacer");
|
|
502
|
+
function _arrayLikeToArray(r, a) {
|
|
503
|
+
(null == a || a > r.length) && (a = r.length);
|
|
504
|
+
for (var e = 0, n = Array(a); e < a; e++) n[e] = r[e];
|
|
505
|
+
return n;
|
|
506
|
+
}
|
|
507
|
+
__name(_arrayLikeToArray, "_arrayLikeToArray");
|
|
508
|
+
function _arrayWithoutHoles(r) {
|
|
509
|
+
if (Array.isArray(r)) return _arrayLikeToArray(r);
|
|
510
|
+
}
|
|
511
|
+
__name(_arrayWithoutHoles, "_arrayWithoutHoles");
|
|
512
|
+
function _defineProperty(e, r, t) {
|
|
513
|
+
return (r = _toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
514
|
+
value: t,
|
|
515
|
+
enumerable: true,
|
|
516
|
+
configurable: true,
|
|
517
|
+
writable: true
|
|
518
|
+
}) : e[r] = t, e;
|
|
519
|
+
}
|
|
520
|
+
__name(_defineProperty, "_defineProperty");
|
|
521
|
+
function _iterableToArray(r) {
|
|
522
|
+
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
523
|
+
}
|
|
524
|
+
__name(_iterableToArray, "_iterableToArray");
|
|
525
|
+
function _nonIterableSpread() {
|
|
526
|
+
throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.");
|
|
527
|
+
}
|
|
528
|
+
__name(_nonIterableSpread, "_nonIterableSpread");
|
|
529
|
+
function ownKeys(e, r) {
|
|
530
|
+
var t = Object.keys(e);
|
|
531
|
+
if (Object.getOwnPropertySymbols) {
|
|
532
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
533
|
+
r && (o = o.filter(function(r2) {
|
|
534
|
+
return Object.getOwnPropertyDescriptor(e, r2).enumerable;
|
|
535
|
+
})), t.push.apply(t, o);
|
|
536
|
+
}
|
|
537
|
+
return t;
|
|
538
|
+
}
|
|
539
|
+
__name(ownKeys, "ownKeys");
|
|
540
|
+
function _objectSpread2(e) {
|
|
541
|
+
for (var r = 1; r < arguments.length; r++) {
|
|
542
|
+
var t = null != arguments[r] ? arguments[r] : {};
|
|
543
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r2) {
|
|
544
|
+
_defineProperty(e, r2, t[r2]);
|
|
545
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r2) {
|
|
546
|
+
Object.defineProperty(e, r2, Object.getOwnPropertyDescriptor(t, r2));
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
return e;
|
|
550
|
+
}
|
|
551
|
+
__name(_objectSpread2, "_objectSpread2");
|
|
552
|
+
function _toConsumableArray(r) {
|
|
553
|
+
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
554
|
+
}
|
|
555
|
+
__name(_toConsumableArray, "_toConsumableArray");
|
|
556
|
+
function _toPrimitive(t, r) {
|
|
557
|
+
if ("object" != typeof t || !t) return t;
|
|
558
|
+
var e = t[Symbol.toPrimitive];
|
|
559
|
+
if (void 0 !== e) {
|
|
560
|
+
var i = e.call(t, r || "default");
|
|
561
|
+
if ("object" != typeof i) return i;
|
|
562
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
563
|
+
}
|
|
564
|
+
return ("string" === r ? String : Number)(t);
|
|
565
|
+
}
|
|
566
|
+
__name(_toPrimitive, "_toPrimitive");
|
|
567
|
+
function _toPropertyKey(t) {
|
|
568
|
+
var i = _toPrimitive(t, "string");
|
|
569
|
+
return "symbol" == typeof i ? i : i + "";
|
|
570
|
+
}
|
|
571
|
+
__name(_toPropertyKey, "_toPropertyKey");
|
|
572
|
+
function _typeof(o) {
|
|
573
|
+
"@babel/helpers - typeof";
|
|
574
|
+
return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function(o2) {
|
|
575
|
+
return typeof o2;
|
|
576
|
+
} : function(o2) {
|
|
577
|
+
return o2 && "function" == typeof Symbol && o2.constructor === Symbol && o2 !== Symbol.prototype ? "symbol" : typeof o2;
|
|
578
|
+
}, _typeof(o);
|
|
579
|
+
}
|
|
580
|
+
__name(_typeof, "_typeof");
|
|
581
|
+
function _unsupportedIterableToArray(r, a) {
|
|
582
|
+
if (r) {
|
|
583
|
+
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
584
|
+
var t = {}.toString.call(r).slice(8, -1);
|
|
585
|
+
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
586
|
+
}
|
|
587
|
+
}
|
|
588
|
+
__name(_unsupportedIterableToArray, "_unsupportedIterableToArray");
|
|
589
|
+
function safeSortObject(value, seen) {
|
|
590
|
+
if (value === null || _typeof(value) !== "object") {
|
|
591
|
+
return value;
|
|
592
|
+
}
|
|
593
|
+
if (value instanceof Date || value instanceof RegExp) {
|
|
594
|
+
return value;
|
|
595
|
+
}
|
|
596
|
+
if (React.isValidElement(value)) {
|
|
597
|
+
var copyObj = _objectSpread2({}, value);
|
|
598
|
+
delete copyObj._owner;
|
|
599
|
+
return copyObj;
|
|
600
|
+
}
|
|
601
|
+
seen.add(value);
|
|
602
|
+
if (Array.isArray(value)) {
|
|
603
|
+
return value.map(function(v) {
|
|
604
|
+
return safeSortObject(v, seen);
|
|
605
|
+
});
|
|
606
|
+
}
|
|
607
|
+
return Object.keys(value).sort().reduce(function(result, key) {
|
|
608
|
+
if (key === "current" || seen.has(value[key])) {
|
|
609
|
+
result[key] = "[Circular]";
|
|
610
|
+
} else {
|
|
611
|
+
result[key] = safeSortObject(value[key], seen);
|
|
612
|
+
}
|
|
613
|
+
return result;
|
|
614
|
+
}, {});
|
|
615
|
+
}
|
|
616
|
+
__name(safeSortObject, "safeSortObject");
|
|
617
|
+
function sortObject(value) {
|
|
618
|
+
return safeSortObject(value, /* @__PURE__ */ new WeakSet());
|
|
619
|
+
}
|
|
620
|
+
__name(sortObject, "sortObject");
|
|
621
|
+
var createStringTreeNode = /* @__PURE__ */ __name(function createStringTreeNode2(value) {
|
|
622
|
+
return {
|
|
623
|
+
type: "string",
|
|
624
|
+
value
|
|
625
|
+
};
|
|
626
|
+
}, "createStringTreeNode");
|
|
627
|
+
var createNumberTreeNode = /* @__PURE__ */ __name(function createNumberTreeNode2(value) {
|
|
628
|
+
return {
|
|
629
|
+
type: "number",
|
|
630
|
+
value
|
|
631
|
+
};
|
|
632
|
+
}, "createNumberTreeNode");
|
|
633
|
+
var createReactElementTreeNode = /* @__PURE__ */ __name(function createReactElementTreeNode2(displayName, props, defaultProps, childrens) {
|
|
634
|
+
return {
|
|
635
|
+
type: "ReactElement",
|
|
636
|
+
displayName,
|
|
637
|
+
props,
|
|
638
|
+
defaultProps,
|
|
639
|
+
childrens
|
|
640
|
+
};
|
|
641
|
+
}, "createReactElementTreeNode");
|
|
642
|
+
var createReactFragmentTreeNode = /* @__PURE__ */ __name(function createReactFragmentTreeNode2(key, childrens) {
|
|
643
|
+
return {
|
|
644
|
+
type: "ReactFragment",
|
|
645
|
+
key,
|
|
646
|
+
childrens
|
|
647
|
+
};
|
|
648
|
+
}, "createReactFragmentTreeNode");
|
|
649
|
+
var supportFragment = Boolean(Fragment);
|
|
650
|
+
var getFunctionTypeName = /* @__PURE__ */ __name(function getFunctionTypeName2(functionType) {
|
|
651
|
+
if (!functionType.name || functionType.name === "_default") {
|
|
652
|
+
return "No Display Name";
|
|
653
|
+
}
|
|
654
|
+
return functionType.name;
|
|
655
|
+
}, "getFunctionTypeName");
|
|
656
|
+
var _getWrappedComponentDisplayName = /* @__PURE__ */ __name(function getWrappedComponentDisplayName(Component) {
|
|
657
|
+
switch (true) {
|
|
658
|
+
case Boolean(Component.displayName):
|
|
659
|
+
return Component.displayName;
|
|
660
|
+
case Component.$$typeof === import_react_is.Memo:
|
|
661
|
+
return _getWrappedComponentDisplayName(Component.type);
|
|
662
|
+
case Component.$$typeof === import_react_is.ForwardRef:
|
|
663
|
+
return _getWrappedComponentDisplayName(Component.render);
|
|
664
|
+
default:
|
|
665
|
+
return getFunctionTypeName(Component);
|
|
666
|
+
}
|
|
667
|
+
}, "getWrappedComponentDisplayName");
|
|
668
|
+
var getReactElementDisplayName = /* @__PURE__ */ __name(function getReactElementDisplayName2(element) {
|
|
669
|
+
switch (true) {
|
|
670
|
+
case typeof element.type === "string":
|
|
671
|
+
return element.type;
|
|
672
|
+
case typeof element.type === "function":
|
|
673
|
+
if (element.type.displayName) {
|
|
674
|
+
return element.type.displayName;
|
|
675
|
+
}
|
|
676
|
+
return getFunctionTypeName(element.type);
|
|
677
|
+
case (0, import_react_is.isForwardRef)(element):
|
|
678
|
+
case (0, import_react_is.isMemo)(element):
|
|
679
|
+
return _getWrappedComponentDisplayName(element.type);
|
|
680
|
+
case (0, import_react_is.isContextConsumer)(element):
|
|
681
|
+
return "".concat(element.type._context.displayName || "Context", ".Consumer");
|
|
682
|
+
case (0, import_react_is.isContextProvider)(element):
|
|
683
|
+
return "".concat(element.type._context.displayName || "Context", ".Provider");
|
|
684
|
+
case (0, import_react_is.isLazy)(element):
|
|
685
|
+
return "Lazy";
|
|
686
|
+
case (0, import_react_is.isProfiler)(element):
|
|
687
|
+
return "Profiler";
|
|
688
|
+
case (0, import_react_is.isStrictMode)(element):
|
|
689
|
+
return "StrictMode";
|
|
690
|
+
case (0, import_react_is.isSuspense)(element):
|
|
691
|
+
return "Suspense";
|
|
692
|
+
default:
|
|
693
|
+
return "UnknownElementType";
|
|
694
|
+
}
|
|
695
|
+
}, "getReactElementDisplayName");
|
|
696
|
+
var noChildren = /* @__PURE__ */ __name(function noChildren2(propsValue, propName) {
|
|
697
|
+
return propName !== "children";
|
|
698
|
+
}, "noChildren");
|
|
699
|
+
var onlyMeaningfulChildren = /* @__PURE__ */ __name(function onlyMeaningfulChildren2(children) {
|
|
700
|
+
return children !== true && children !== false && children !== null && children !== "";
|
|
701
|
+
}, "onlyMeaningfulChildren");
|
|
702
|
+
var filterProps = /* @__PURE__ */ __name(function filterProps2(originalProps, cb) {
|
|
703
|
+
var filteredProps = {};
|
|
704
|
+
Object.keys(originalProps).filter(function(key) {
|
|
705
|
+
return cb(originalProps[key], key);
|
|
706
|
+
}).forEach(function(key) {
|
|
707
|
+
return filteredProps[key] = originalProps[key];
|
|
708
|
+
});
|
|
709
|
+
return filteredProps;
|
|
710
|
+
}, "filterProps");
|
|
711
|
+
var _parseReactElement = /* @__PURE__ */ __name(function parseReactElement(element, options) {
|
|
712
|
+
var _options$displayName = options.displayName, displayNameFn = _options$displayName === void 0 ? getReactElementDisplayName : _options$displayName;
|
|
713
|
+
if (typeof element === "string") {
|
|
714
|
+
return createStringTreeNode(element);
|
|
715
|
+
} else if (typeof element === "number") {
|
|
716
|
+
return createNumberTreeNode(element);
|
|
717
|
+
} else if (!React__default.isValidElement(element)) {
|
|
718
|
+
throw new Error("react-element-to-jsx-string: Expected a React.Element, got `".concat(_typeof(element), "`"));
|
|
719
|
+
}
|
|
720
|
+
var displayName = displayNameFn(element);
|
|
721
|
+
var props = filterProps(element.props, noChildren);
|
|
722
|
+
if (element.ref !== null) {
|
|
723
|
+
props.ref = element.ref;
|
|
724
|
+
}
|
|
725
|
+
var key = element.key;
|
|
726
|
+
if (typeof key === "string" && key.search(/^\./)) {
|
|
727
|
+
props.key = key;
|
|
728
|
+
}
|
|
729
|
+
var defaultProps = filterProps(element.type.defaultProps || {}, noChildren);
|
|
730
|
+
var childrens = React__default.Children.toArray(element.props.children).filter(onlyMeaningfulChildren).map(function(child) {
|
|
731
|
+
return _parseReactElement(child, options);
|
|
732
|
+
});
|
|
733
|
+
if (supportFragment && element.type === Fragment) {
|
|
734
|
+
return createReactFragmentTreeNode(key, childrens);
|
|
735
|
+
}
|
|
736
|
+
return createReactElementTreeNode(displayName, props, defaultProps, childrens);
|
|
737
|
+
}, "parseReactElement");
|
|
738
|
+
function noRefCheck() {
|
|
739
|
+
}
|
|
740
|
+
__name(noRefCheck, "noRefCheck");
|
|
741
|
+
var inlineFunction = /* @__PURE__ */ __name(function inlineFunction2(fn) {
|
|
742
|
+
return fn.toString().split("\n").map(function(line) {
|
|
743
|
+
return line.trim();
|
|
744
|
+
}).join("");
|
|
745
|
+
}, "inlineFunction");
|
|
746
|
+
var defaultFunctionValue = inlineFunction;
|
|
747
|
+
var formatFunction = /* @__PURE__ */ __name(function(fn, options) {
|
|
748
|
+
var _options$functionValu = options.functionValue, functionValue = _options$functionValu === void 0 ? defaultFunctionValue : _options$functionValu, showFunctions = options.showFunctions;
|
|
749
|
+
if (!showFunctions && functionValue === defaultFunctionValue) {
|
|
750
|
+
return functionValue(noRefCheck);
|
|
751
|
+
}
|
|
752
|
+
return functionValue(fn);
|
|
753
|
+
}, "formatFunction");
|
|
754
|
+
var formatComplexDataStructure = /* @__PURE__ */ __name(function(value, inline, lvl, options) {
|
|
755
|
+
var normalizedValue = sortObject(value);
|
|
756
|
+
var stringifiedValue = (0, import_pretty_print_object.prettyPrint)(normalizedValue, {
|
|
757
|
+
transform: /* @__PURE__ */ __name(function transform(currentObj, prop, originalResult) {
|
|
758
|
+
var currentValue = currentObj[prop];
|
|
759
|
+
if (currentValue && isValidElement2(currentValue)) {
|
|
760
|
+
return formatTreeNode(_parseReactElement(currentValue, options), true, lvl, options);
|
|
761
|
+
}
|
|
762
|
+
if (typeof currentValue === "function") {
|
|
763
|
+
return formatFunction(currentValue, options);
|
|
764
|
+
}
|
|
765
|
+
return originalResult;
|
|
766
|
+
}, "transform")
|
|
767
|
+
});
|
|
768
|
+
if (inline) {
|
|
769
|
+
return stringifiedValue.replace(/\s+/g, " ").replace(/{ /g, "{").replace(/ }/g, "}").replace(/\[ /g, "[").replace(/ ]/g, "]");
|
|
770
|
+
}
|
|
771
|
+
return stringifiedValue.replace(/\t/g, spacer(1, options.tabStop)).replace(/\n([^$])/g, "\n".concat(spacer(lvl + 1, options.tabStop), "$1"));
|
|
772
|
+
}, "formatComplexDataStructure");
|
|
773
|
+
var escape$1 = /* @__PURE__ */ __name(function escape(s) {
|
|
774
|
+
return s.replace(/"/g, """);
|
|
775
|
+
}, "escape");
|
|
776
|
+
var formatPropValue = /* @__PURE__ */ __name(function formatPropValue2(propValue, inline, lvl, options) {
|
|
777
|
+
if (typeof propValue === "number") {
|
|
778
|
+
return "{".concat(String(propValue), "}");
|
|
779
|
+
}
|
|
780
|
+
if (typeof propValue === "string") {
|
|
781
|
+
return '"'.concat(escape$1(propValue), '"');
|
|
782
|
+
}
|
|
783
|
+
if (_typeof(propValue) === "symbol") {
|
|
784
|
+
var symbolDescription = propValue.valueOf().toString().replace(/Symbol\((.*)\)/, "$1");
|
|
785
|
+
if (!symbolDescription) {
|
|
786
|
+
return "{Symbol()}";
|
|
787
|
+
}
|
|
788
|
+
return "{Symbol('".concat(symbolDescription, "')}");
|
|
789
|
+
}
|
|
790
|
+
if (typeof propValue === "function") {
|
|
791
|
+
return "{".concat(formatFunction(propValue, options), "}");
|
|
792
|
+
}
|
|
793
|
+
if (isValidElement2(propValue)) {
|
|
794
|
+
return "{".concat(formatTreeNode(_parseReactElement(propValue, options), true, lvl, options), "}");
|
|
795
|
+
}
|
|
796
|
+
if (propValue instanceof Date) {
|
|
797
|
+
if (isNaN(propValue.valueOf())) {
|
|
798
|
+
return "{new Date(NaN)}";
|
|
799
|
+
}
|
|
800
|
+
return '{new Date("'.concat(propValue.toISOString(), '")}');
|
|
801
|
+
}
|
|
802
|
+
if (isPlainObject(propValue) || Array.isArray(propValue)) {
|
|
803
|
+
return "{".concat(formatComplexDataStructure(propValue, inline, lvl, options), "}");
|
|
804
|
+
}
|
|
805
|
+
return "{".concat(String(propValue), "}");
|
|
806
|
+
}, "formatPropValue");
|
|
807
|
+
var formatProp = /* @__PURE__ */ __name(function(name, hasValue, value, hasDefaultValue, defaultValue, inline, lvl, options) {
|
|
808
|
+
if (!hasValue && !hasDefaultValue) {
|
|
809
|
+
throw new Error('The prop "'.concat(name, '" has no value and no default: could not be formatted'));
|
|
810
|
+
}
|
|
811
|
+
var usedValue = hasValue ? value : defaultValue;
|
|
812
|
+
var useBooleanShorthandSyntax = options.useBooleanShorthandSyntax, tabStop = options.tabStop;
|
|
813
|
+
var formattedPropValue = formatPropValue(usedValue, inline, lvl, options);
|
|
814
|
+
var attributeFormattedInline = " ";
|
|
815
|
+
var attributeFormattedMultiline = "\n".concat(spacer(lvl + 1, tabStop));
|
|
816
|
+
var isMultilineAttribute = formattedPropValue.includes("\n");
|
|
817
|
+
if (useBooleanShorthandSyntax && formattedPropValue === "{false}" && !hasDefaultValue) {
|
|
818
|
+
attributeFormattedInline = "";
|
|
819
|
+
attributeFormattedMultiline = "";
|
|
820
|
+
} else if (useBooleanShorthandSyntax && formattedPropValue === "{true}") {
|
|
821
|
+
attributeFormattedInline += "".concat(name);
|
|
822
|
+
attributeFormattedMultiline += "".concat(name);
|
|
823
|
+
} else {
|
|
824
|
+
attributeFormattedInline += "".concat(name, "=").concat(formattedPropValue);
|
|
825
|
+
attributeFormattedMultiline += "".concat(name, "=").concat(formattedPropValue);
|
|
826
|
+
}
|
|
827
|
+
return {
|
|
828
|
+
attributeFormattedInline,
|
|
829
|
+
attributeFormattedMultiline,
|
|
830
|
+
isMultilineAttribute
|
|
831
|
+
};
|
|
832
|
+
}, "formatProp");
|
|
833
|
+
var mergeSiblingPlainStringChildrenReducer = /* @__PURE__ */ __name(function(previousNodes, currentNode) {
|
|
834
|
+
var nodes = previousNodes.slice(0, previousNodes.length > 0 ? previousNodes.length - 1 : 0);
|
|
835
|
+
var previousNode = previousNodes[previousNodes.length - 1];
|
|
836
|
+
if (previousNode && (currentNode.type === "string" || currentNode.type === "number") && (previousNode.type === "string" || previousNode.type === "number")) {
|
|
837
|
+
nodes.push(createStringTreeNode(String(previousNode.value) + String(currentNode.value)));
|
|
838
|
+
} else {
|
|
839
|
+
if (previousNode) {
|
|
840
|
+
nodes.push(previousNode);
|
|
841
|
+
}
|
|
842
|
+
nodes.push(currentNode);
|
|
843
|
+
}
|
|
844
|
+
return nodes;
|
|
845
|
+
}, "mergeSiblingPlainStringChildrenReducer");
|
|
846
|
+
var isKeyOrRefProps = /* @__PURE__ */ __name(function isKeyOrRefProps2(propName) {
|
|
847
|
+
return ["key", "ref"].includes(propName);
|
|
848
|
+
}, "isKeyOrRefProps");
|
|
849
|
+
var sortPropsByNames = /* @__PURE__ */ __name(function(shouldSortUserProps) {
|
|
850
|
+
return function(props) {
|
|
851
|
+
var haveKeyProp = props.includes("key");
|
|
852
|
+
var haveRefProp = props.includes("ref");
|
|
853
|
+
var userPropsOnly = props.filter(function(oneProp) {
|
|
854
|
+
return !isKeyOrRefProps(oneProp);
|
|
855
|
+
});
|
|
856
|
+
var sortedProps = shouldSortUserProps ? _toConsumableArray(userPropsOnly.sort()) : _toConsumableArray(userPropsOnly);
|
|
857
|
+
if (haveRefProp) {
|
|
858
|
+
sortedProps.unshift("ref");
|
|
859
|
+
}
|
|
860
|
+
if (haveKeyProp) {
|
|
861
|
+
sortedProps.unshift("key");
|
|
862
|
+
}
|
|
863
|
+
return sortedProps;
|
|
864
|
+
};
|
|
865
|
+
}, "sortPropsByNames");
|
|
866
|
+
function createPropFilter(props, filter) {
|
|
867
|
+
if (Array.isArray(filter)) {
|
|
868
|
+
return function(key) {
|
|
869
|
+
return filter.indexOf(key) === -1;
|
|
870
|
+
};
|
|
871
|
+
} else {
|
|
872
|
+
return function(key) {
|
|
873
|
+
return filter(props[key], key);
|
|
874
|
+
};
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
__name(createPropFilter, "createPropFilter");
|
|
878
|
+
var compensateMultilineStringElementIndentation = /* @__PURE__ */ __name(function compensateMultilineStringElementIndentation2(element, formattedElement, inline, lvl, options) {
|
|
879
|
+
var tabStop = options.tabStop;
|
|
880
|
+
if (element.type === "string") {
|
|
881
|
+
return formattedElement.split("\n").map(function(line, offset) {
|
|
882
|
+
if (offset === 0) {
|
|
883
|
+
return line;
|
|
884
|
+
}
|
|
885
|
+
return "".concat(spacer(lvl, tabStop)).concat(line);
|
|
886
|
+
}).join("\n");
|
|
887
|
+
}
|
|
888
|
+
return formattedElement;
|
|
889
|
+
}, "compensateMultilineStringElementIndentation");
|
|
890
|
+
var formatOneChildren = /* @__PURE__ */ __name(function formatOneChildren2(inline, lvl, options) {
|
|
891
|
+
return function(element) {
|
|
892
|
+
return compensateMultilineStringElementIndentation(element, formatTreeNode(element, inline, lvl, options), inline, lvl, options);
|
|
893
|
+
};
|
|
894
|
+
}, "formatOneChildren");
|
|
895
|
+
var onlyPropsWithOriginalValue = /* @__PURE__ */ __name(function onlyPropsWithOriginalValue2(defaultProps, props) {
|
|
896
|
+
return function(propName) {
|
|
897
|
+
var haveDefaultValue = Object.keys(defaultProps).includes(propName);
|
|
898
|
+
return !haveDefaultValue || haveDefaultValue && defaultProps[propName] !== props[propName];
|
|
899
|
+
};
|
|
900
|
+
}, "onlyPropsWithOriginalValue");
|
|
901
|
+
var isInlineAttributeTooLong = /* @__PURE__ */ __name(function isInlineAttributeTooLong2(attributes, inlineAttributeString, lvl, tabStop, maxInlineAttributesLineLength) {
|
|
902
|
+
if (!maxInlineAttributesLineLength) {
|
|
903
|
+
return attributes.length > 1;
|
|
904
|
+
}
|
|
905
|
+
return spacer(lvl, tabStop).length + inlineAttributeString.length > maxInlineAttributesLineLength;
|
|
906
|
+
}, "isInlineAttributeTooLong");
|
|
907
|
+
var shouldRenderMultilineAttr = /* @__PURE__ */ __name(function shouldRenderMultilineAttr2(attributes, inlineAttributeString, containsMultilineAttr, inline, lvl, tabStop, maxInlineAttributesLineLength) {
|
|
908
|
+
return (isInlineAttributeTooLong(attributes, inlineAttributeString, lvl, tabStop, maxInlineAttributesLineLength) || containsMultilineAttr) && !inline;
|
|
909
|
+
}, "shouldRenderMultilineAttr");
|
|
910
|
+
var formatReactElementNode = /* @__PURE__ */ __name(function(node, inline, lvl, options) {
|
|
911
|
+
var type = node.type, _node$displayName = node.displayName, displayName = _node$displayName === void 0 ? "" : _node$displayName, childrens = node.childrens, _node$props = node.props, props = _node$props === void 0 ? {} : _node$props, _node$defaultProps = node.defaultProps, defaultProps = _node$defaultProps === void 0 ? {} : _node$defaultProps;
|
|
912
|
+
if (type !== "ReactElement") {
|
|
913
|
+
throw new Error('The "formatReactElementNode" function could only format node of type "ReactElement". Given: '.concat(type));
|
|
914
|
+
}
|
|
915
|
+
var filterProps3 = options.filterProps, maxInlineAttributesLineLength = options.maxInlineAttributesLineLength, showDefaultProps = options.showDefaultProps, sortProps = options.sortProps, tabStop = options.tabStop;
|
|
916
|
+
var out = "<".concat(displayName);
|
|
917
|
+
var outInlineAttr = out;
|
|
918
|
+
var outMultilineAttr = out;
|
|
919
|
+
var containsMultilineAttr = false;
|
|
920
|
+
var visibleAttributeNames = [];
|
|
921
|
+
var propFilter = createPropFilter(props, filterProps3);
|
|
922
|
+
Object.keys(props).filter(propFilter).filter(onlyPropsWithOriginalValue(defaultProps, props)).forEach(function(propName) {
|
|
923
|
+
return visibleAttributeNames.push(propName);
|
|
924
|
+
});
|
|
925
|
+
Object.keys(defaultProps).filter(propFilter).filter(function() {
|
|
926
|
+
return showDefaultProps;
|
|
927
|
+
}).filter(function(defaultPropName) {
|
|
928
|
+
return !visibleAttributeNames.includes(defaultPropName);
|
|
929
|
+
}).forEach(function(defaultPropName) {
|
|
930
|
+
return visibleAttributeNames.push(defaultPropName);
|
|
931
|
+
});
|
|
932
|
+
var attributes = sortPropsByNames(sortProps)(visibleAttributeNames);
|
|
933
|
+
attributes.forEach(function(attributeName) {
|
|
934
|
+
var _formatProp = formatProp(attributeName, Object.keys(props).includes(attributeName), props[attributeName], Object.keys(defaultProps).includes(attributeName), defaultProps[attributeName], inline, lvl, options), attributeFormattedInline = _formatProp.attributeFormattedInline, attributeFormattedMultiline = _formatProp.attributeFormattedMultiline, isMultilineAttribute = _formatProp.isMultilineAttribute;
|
|
935
|
+
if (isMultilineAttribute) {
|
|
936
|
+
containsMultilineAttr = true;
|
|
937
|
+
}
|
|
938
|
+
outInlineAttr += attributeFormattedInline;
|
|
939
|
+
outMultilineAttr += attributeFormattedMultiline;
|
|
940
|
+
});
|
|
941
|
+
outMultilineAttr += "\n".concat(spacer(lvl, tabStop));
|
|
942
|
+
if (shouldRenderMultilineAttr(attributes, outInlineAttr, containsMultilineAttr, inline, lvl, tabStop, maxInlineAttributesLineLength)) {
|
|
943
|
+
out = outMultilineAttr;
|
|
944
|
+
} else {
|
|
945
|
+
out = outInlineAttr;
|
|
946
|
+
}
|
|
947
|
+
if (childrens && childrens.length > 0) {
|
|
948
|
+
var newLvl = lvl + 1;
|
|
949
|
+
out += ">";
|
|
950
|
+
if (!inline) {
|
|
951
|
+
out += "\n";
|
|
952
|
+
out += spacer(newLvl, tabStop);
|
|
953
|
+
}
|
|
954
|
+
out += childrens.reduce(mergeSiblingPlainStringChildrenReducer, []).map(formatOneChildren(inline, newLvl, options)).join(!inline ? "\n".concat(spacer(newLvl, tabStop)) : "");
|
|
955
|
+
if (!inline) {
|
|
956
|
+
out += "\n";
|
|
957
|
+
out += spacer(newLvl - 1, tabStop);
|
|
958
|
+
}
|
|
959
|
+
out += "</".concat(displayName, ">");
|
|
960
|
+
} else {
|
|
961
|
+
if (!isInlineAttributeTooLong(attributes, outInlineAttr, lvl, tabStop, maxInlineAttributesLineLength)) {
|
|
962
|
+
out += " ";
|
|
963
|
+
}
|
|
964
|
+
out += "/>";
|
|
965
|
+
}
|
|
966
|
+
return out;
|
|
967
|
+
}, "formatReactElementNode");
|
|
968
|
+
var REACT_FRAGMENT_TAG_NAME_SHORT_SYNTAX = "";
|
|
969
|
+
var REACT_FRAGMENT_TAG_NAME_EXPLICIT_SYNTAX = "React.Fragment";
|
|
970
|
+
var toReactElementTreeNode = /* @__PURE__ */ __name(function toReactElementTreeNode2(displayName, key, childrens) {
|
|
971
|
+
var props = {};
|
|
972
|
+
if (key) {
|
|
973
|
+
props = {
|
|
974
|
+
key
|
|
975
|
+
};
|
|
976
|
+
}
|
|
977
|
+
return {
|
|
978
|
+
type: "ReactElement",
|
|
979
|
+
displayName,
|
|
980
|
+
props,
|
|
981
|
+
defaultProps: {},
|
|
982
|
+
childrens
|
|
983
|
+
};
|
|
984
|
+
}, "toReactElementTreeNode");
|
|
985
|
+
var isKeyedFragment = /* @__PURE__ */ __name(function isKeyedFragment2(_ref) {
|
|
986
|
+
var key = _ref.key;
|
|
987
|
+
return Boolean(key);
|
|
988
|
+
}, "isKeyedFragment");
|
|
989
|
+
var hasNoChildren = /* @__PURE__ */ __name(function hasNoChildren2(_ref2) {
|
|
990
|
+
var childrens = _ref2.childrens;
|
|
991
|
+
return childrens.length === 0;
|
|
992
|
+
}, "hasNoChildren");
|
|
993
|
+
var formatReactFragmentNode = /* @__PURE__ */ __name(function(node, inline, lvl, options) {
|
|
994
|
+
var type = node.type, key = node.key, childrens = node.childrens;
|
|
995
|
+
if (type !== "ReactFragment") {
|
|
996
|
+
throw new Error('The "formatReactFragmentNode" function could only format node of type "ReactFragment". Given: '.concat(type));
|
|
997
|
+
}
|
|
998
|
+
var useFragmentShortSyntax = options.useFragmentShortSyntax;
|
|
999
|
+
var displayName;
|
|
1000
|
+
if (useFragmentShortSyntax) {
|
|
1001
|
+
if (hasNoChildren(node) || isKeyedFragment(node)) {
|
|
1002
|
+
displayName = REACT_FRAGMENT_TAG_NAME_EXPLICIT_SYNTAX;
|
|
1003
|
+
} else {
|
|
1004
|
+
displayName = REACT_FRAGMENT_TAG_NAME_SHORT_SYNTAX;
|
|
1005
|
+
}
|
|
1006
|
+
} else {
|
|
1007
|
+
displayName = REACT_FRAGMENT_TAG_NAME_EXPLICIT_SYNTAX;
|
|
1008
|
+
}
|
|
1009
|
+
return formatReactElementNode(toReactElementTreeNode(displayName, key, childrens), inline, lvl, options);
|
|
1010
|
+
}, "formatReactFragmentNode");
|
|
1011
|
+
var jsxStopChars = ["<", ">", "{", "}"];
|
|
1012
|
+
var shouldBeEscaped = /* @__PURE__ */ __name(function shouldBeEscaped2(s) {
|
|
1013
|
+
return jsxStopChars.some(function(jsxStopChar) {
|
|
1014
|
+
return s.includes(jsxStopChar);
|
|
1015
|
+
});
|
|
1016
|
+
}, "shouldBeEscaped");
|
|
1017
|
+
var escape2 = /* @__PURE__ */ __name(function escape3(s) {
|
|
1018
|
+
if (!shouldBeEscaped(s)) {
|
|
1019
|
+
return s;
|
|
1020
|
+
}
|
|
1021
|
+
return "{`".concat(s, "`}");
|
|
1022
|
+
}, "escape");
|
|
1023
|
+
var preserveTrailingSpace = /* @__PURE__ */ __name(function preserveTrailingSpace2(s) {
|
|
1024
|
+
var result = s;
|
|
1025
|
+
if (result.endsWith(" ")) {
|
|
1026
|
+
result = result.replace(/^(.*?)(\s+)$/, "$1{'$2'}");
|
|
1027
|
+
}
|
|
1028
|
+
if (result.startsWith(" ")) {
|
|
1029
|
+
result = result.replace(/^(\s+)(.*)$/, "{'$1'}$2");
|
|
1030
|
+
}
|
|
1031
|
+
return result;
|
|
1032
|
+
}, "preserveTrailingSpace");
|
|
1033
|
+
var formatTreeNode = /* @__PURE__ */ __name(function(node, inline, lvl, options) {
|
|
1034
|
+
if (node.type === "number") {
|
|
1035
|
+
return String(node.value);
|
|
1036
|
+
}
|
|
1037
|
+
if (node.type === "string") {
|
|
1038
|
+
return node.value ? "".concat(preserveTrailingSpace(escape2(String(node.value)))) : "";
|
|
1039
|
+
}
|
|
1040
|
+
if (node.type === "ReactElement") {
|
|
1041
|
+
return formatReactElementNode(node, inline, lvl, options);
|
|
1042
|
+
}
|
|
1043
|
+
if (node.type === "ReactFragment") {
|
|
1044
|
+
return formatReactFragmentNode(node, inline, lvl, options);
|
|
1045
|
+
}
|
|
1046
|
+
throw new TypeError('Unknow format type "'.concat(node.type, '"'));
|
|
1047
|
+
}, "formatTreeNode");
|
|
1048
|
+
var formatTree = /* @__PURE__ */ __name(function(node, options) {
|
|
1049
|
+
return formatTreeNode(node, false, 0, options);
|
|
1050
|
+
}, "formatTree");
|
|
1051
|
+
var reactElementToJsxString = /* @__PURE__ */ __name(function reactElementToJsxString2(element) {
|
|
1052
|
+
var _ref = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : {}, _ref$filterProps = _ref.filterProps, filterProps3 = _ref$filterProps === void 0 ? [] : _ref$filterProps, _ref$showDefaultProps = _ref.showDefaultProps, showDefaultProps = _ref$showDefaultProps === void 0 ? true : _ref$showDefaultProps, _ref$showFunctions = _ref.showFunctions, showFunctions = _ref$showFunctions === void 0 ? false : _ref$showFunctions, functionValue = _ref.functionValue, _ref$tabStop = _ref.tabStop, tabStop = _ref$tabStop === void 0 ? 2 : _ref$tabStop, _ref$useBooleanShorth = _ref.useBooleanShorthandSyntax, useBooleanShorthandSyntax = _ref$useBooleanShorth === void 0 ? true : _ref$useBooleanShorth, _ref$useFragmentShort = _ref.useFragmentShortSyntax, useFragmentShortSyntax = _ref$useFragmentShort === void 0 ? true : _ref$useFragmentShort, _ref$sortProps = _ref.sortProps, sortProps = _ref$sortProps === void 0 ? true : _ref$sortProps, maxInlineAttributesLineLength = _ref.maxInlineAttributesLineLength, displayName = _ref.displayName;
|
|
1053
|
+
if (!element) {
|
|
1054
|
+
throw new Error("react-element-to-jsx-string: Expected a ReactElement");
|
|
1055
|
+
}
|
|
1056
|
+
var options = {
|
|
1057
|
+
filterProps: filterProps3,
|
|
1058
|
+
showDefaultProps,
|
|
1059
|
+
showFunctions,
|
|
1060
|
+
functionValue,
|
|
1061
|
+
tabStop,
|
|
1062
|
+
useBooleanShorthandSyntax,
|
|
1063
|
+
useFragmentShortSyntax,
|
|
1064
|
+
sortProps,
|
|
1065
|
+
maxInlineAttributesLineLength,
|
|
1066
|
+
displayName
|
|
1067
|
+
};
|
|
1068
|
+
return formatTree(_parseReactElement(element, options), options);
|
|
1069
|
+
}, "reactElementToJsxString");
|
|
1070
|
+
|
|
1071
|
+
export {
|
|
1072
|
+
isMemo,
|
|
1073
|
+
isForwardRef,
|
|
1074
|
+
reactElementToJsxString
|
|
1075
|
+
};
|