jbx 2.5.0 → 2.7.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 +5 -6
- package/dist/index.d.ts +141 -0
- package/dist/{index.esm.js → index.js} +1219 -1384
- package/package.json +24 -13
- package/.editorconfig +0 -12
- package/.nvmrc +0 -1
- package/.prettierrc +0 -13
- package/CHANGELOG.md +0 -58
- package/dist/index.cjs +0 -3001
- package/dist/index.mjs +0 -2968
- package/dist/main.css +0 -256
- package/dist/main.css.map +0 -1
- package/dist/main.js +0 -238
- package/dist/main.js.map +0 -1
- package/dist/types/index.d.ts +0 -233
- package/pnpm-global/5/pnpm-lock.yaml +0 -621
- package/roll.js +0 -235
- package/src/components/Layout.tsx +0 -29
- package/src/components/MoreExperiments.tsx +0 -110
- package/src/index.tsx +0 -243
- package/src/style.css +0 -359
- package/tsconfig.json +0 -20
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
'use strict';
|
|
1
2
|
function getDefaultExportFromCjs (x) {
|
|
2
3
|
return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
|
|
3
4
|
}
|
|
@@ -6,39 +7,59 @@ var react = {exports: {}};
|
|
|
6
7
|
|
|
7
8
|
var react_production_min = {};
|
|
8
9
|
|
|
9
|
-
/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
14
|
-
*
|
|
15
|
-
* This source code is licensed under the MIT license found in the
|
|
16
|
-
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/ var _typeof$1 = function(obj) {
|
|
18
|
-
"@swc/helpers - typeof";
|
|
19
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
20
|
-
};
|
|
21
10
|
var hasRequiredReact_production_min;
|
|
22
11
|
function requireReact_production_min() {
|
|
23
|
-
|
|
12
|
+
if (hasRequiredReact_production_min) return react_production_min;
|
|
13
|
+
hasRequiredReact_production_min = 1;
|
|
14
|
+
var l = Symbol.for("react.element"), n = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), u = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), z = Symbol.iterator;
|
|
15
|
+
function A(a) {
|
|
24
16
|
if (null === a || "object" !== typeof a) return null;
|
|
25
17
|
a = z && a[z] || a["@@iterator"];
|
|
26
18
|
return "function" === typeof a ? a : null;
|
|
27
|
-
}
|
|
28
|
-
var
|
|
19
|
+
}
|
|
20
|
+
var B = {
|
|
21
|
+
isMounted: function() {
|
|
22
|
+
return !1;
|
|
23
|
+
},
|
|
24
|
+
enqueueForceUpdate: function() {},
|
|
25
|
+
enqueueReplaceState: function() {},
|
|
26
|
+
enqueueSetState: function() {}
|
|
27
|
+
}, C = Object.assign, D = {};
|
|
28
|
+
function E(a, b, e) {
|
|
29
29
|
this.props = a;
|
|
30
30
|
this.context = b;
|
|
31
31
|
this.refs = D;
|
|
32
32
|
this.updater = e || B;
|
|
33
|
+
}
|
|
34
|
+
E.prototype.isReactComponent = {};
|
|
35
|
+
E.prototype.setState = function(a, b) {
|
|
36
|
+
if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
37
|
+
this.updater.enqueueSetState(this, a, b, "setState");
|
|
38
|
+
};
|
|
39
|
+
E.prototype.forceUpdate = function(a) {
|
|
40
|
+
this.updater.enqueueForceUpdate(this, a, "forceUpdate");
|
|
33
41
|
};
|
|
34
|
-
|
|
35
|
-
|
|
42
|
+
function F() {}
|
|
43
|
+
F.prototype = E.prototype;
|
|
44
|
+
function G(a, b, e) {
|
|
36
45
|
this.props = a;
|
|
37
46
|
this.context = b;
|
|
38
47
|
this.refs = D;
|
|
39
48
|
this.updater = e || B;
|
|
49
|
+
}
|
|
50
|
+
var H = G.prototype = new F;
|
|
51
|
+
H.constructor = G;
|
|
52
|
+
C(H, E.prototype);
|
|
53
|
+
H.isPureReactComponent = !0;
|
|
54
|
+
var I = Array.isArray, J = Object.prototype.hasOwnProperty, K = {
|
|
55
|
+
current: null
|
|
56
|
+
}, L = {
|
|
57
|
+
key: !0,
|
|
58
|
+
ref: !0,
|
|
59
|
+
__self: !0,
|
|
60
|
+
__source: !0
|
|
40
61
|
};
|
|
41
|
-
|
|
62
|
+
function M(a, b, e) {
|
|
42
63
|
var d, c = {}, k = null, h = null;
|
|
43
64
|
if (null != b) for(d in void 0 !== b.ref && (h = b.ref), void 0 !== b.key && (k = "" + b.key), b)J.call(b, d) && !L.hasOwnProperty(d) && (c[d] = b[d]);
|
|
44
65
|
var g = arguments.length - 2;
|
|
@@ -56,8 +77,8 @@ function requireReact_production_min() {
|
|
|
56
77
|
props: c,
|
|
57
78
|
_owner: K.current
|
|
58
79
|
};
|
|
59
|
-
}
|
|
60
|
-
|
|
80
|
+
}
|
|
81
|
+
function N(a, b) {
|
|
61
82
|
return {
|
|
62
83
|
$$typeof: l,
|
|
63
84
|
type: a.type,
|
|
@@ -66,11 +87,11 @@ function requireReact_production_min() {
|
|
|
66
87
|
props: a.props,
|
|
67
88
|
_owner: a._owner
|
|
68
89
|
};
|
|
69
|
-
}
|
|
70
|
-
|
|
90
|
+
}
|
|
91
|
+
function O(a) {
|
|
71
92
|
return "object" === typeof a && null !== a && a.$$typeof === l;
|
|
72
|
-
}
|
|
73
|
-
|
|
93
|
+
}
|
|
94
|
+
function escape(a) {
|
|
74
95
|
var b = {
|
|
75
96
|
"=": "=0",
|
|
76
97
|
":": "=2"
|
|
@@ -78,67 +99,13 @@ function requireReact_production_min() {
|
|
|
78
99
|
return "$" + a.replace(/[=:]/g, function(a) {
|
|
79
100
|
return b[a];
|
|
80
101
|
});
|
|
81
|
-
}
|
|
82
|
-
var Q = function Q(a, b) {
|
|
83
|
-
return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
|
|
84
|
-
};
|
|
85
|
-
var S = function S(a, b, e) {
|
|
86
|
-
if (null == a) return a;
|
|
87
|
-
var d = [], c = 0;
|
|
88
|
-
R(a, d, "", "", function(a) {
|
|
89
|
-
return b.call(e, a, c++);
|
|
90
|
-
});
|
|
91
|
-
return d;
|
|
92
|
-
};
|
|
93
|
-
var T = function T(a) {
|
|
94
|
-
if (-1 === a._status) {
|
|
95
|
-
var b = a._result;
|
|
96
|
-
b = b();
|
|
97
|
-
b.then(function(b) {
|
|
98
|
-
if (0 === a._status || -1 === a._status) a._status = 1, a._result = b;
|
|
99
|
-
}, function(b) {
|
|
100
|
-
if (0 === a._status || -1 === a._status) a._status = 2, a._result = b;
|
|
101
|
-
});
|
|
102
|
-
-1 === a._status && (a._status = 0, a._result = b);
|
|
103
|
-
}
|
|
104
|
-
if (1 === a._status) return a._result.default;
|
|
105
|
-
throw a._result;
|
|
106
|
-
};
|
|
107
|
-
if (hasRequiredReact_production_min) return react_production_min;
|
|
108
|
-
hasRequiredReact_production_min = 1;
|
|
109
|
-
var l = Symbol.for("react.element"), n = Symbol.for("react.portal"), p = Symbol.for("react.fragment"), q = Symbol.for("react.strict_mode"), r = Symbol.for("react.profiler"), t = Symbol.for("react.provider"), u = Symbol.for("react.context"), v = Symbol.for("react.forward_ref"), w = Symbol.for("react.suspense"), x = Symbol.for("react.memo"), y = Symbol.for("react.lazy"), z = Symbol.iterator;
|
|
110
|
-
var B = {
|
|
111
|
-
isMounted: function isMounted() {
|
|
112
|
-
return !1;
|
|
113
|
-
},
|
|
114
|
-
enqueueForceUpdate: function enqueueForceUpdate() {},
|
|
115
|
-
enqueueReplaceState: function enqueueReplaceState() {},
|
|
116
|
-
enqueueSetState: function enqueueSetState() {}
|
|
117
|
-
}, C = Object.assign, D = {};
|
|
118
|
-
E.prototype.isReactComponent = {};
|
|
119
|
-
E.prototype.setState = function(a, b) {
|
|
120
|
-
if ("object" !== typeof a && "function" !== typeof a && null != a) throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");
|
|
121
|
-
this.updater.enqueueSetState(this, a, b, "setState");
|
|
122
|
-
};
|
|
123
|
-
E.prototype.forceUpdate = function(a) {
|
|
124
|
-
this.updater.enqueueForceUpdate(this, a, "forceUpdate");
|
|
125
|
-
};
|
|
126
|
-
F.prototype = E.prototype;
|
|
127
|
-
var H = G.prototype = new F;
|
|
128
|
-
H.constructor = G;
|
|
129
|
-
C(H, E.prototype);
|
|
130
|
-
H.isPureReactComponent = !0;
|
|
131
|
-
var I = Array.isArray, J = Object.prototype.hasOwnProperty, K = {
|
|
132
|
-
current: null
|
|
133
|
-
}, L = {
|
|
134
|
-
key: !0,
|
|
135
|
-
ref: !0,
|
|
136
|
-
__self: !0,
|
|
137
|
-
__source: !0
|
|
138
|
-
};
|
|
102
|
+
}
|
|
139
103
|
var P = /\/+/g;
|
|
104
|
+
function Q(a, b) {
|
|
105
|
+
return "object" === typeof a && null !== a && null != a.key ? escape("" + a.key) : b.toString(36);
|
|
106
|
+
}
|
|
140
107
|
function R(a, b, e, d, c) {
|
|
141
|
-
var k = typeof a
|
|
108
|
+
var k = typeof a;
|
|
142
109
|
if ("undefined" === k || "boolean" === k) a = null;
|
|
143
110
|
var h = !1;
|
|
144
111
|
if (null === a) h = !0;
|
|
@@ -168,6 +135,28 @@ function requireReact_production_min() {
|
|
|
168
135
|
else if ("object" === k) throw b = String(a), Error("Objects are not valid as a React child (found: " + ("[object Object]" === b ? "object with keys {" + Object.keys(a).join(", ") + "}" : b) + "). If you meant to render a collection of children, use an array instead.");
|
|
169
136
|
return h;
|
|
170
137
|
}
|
|
138
|
+
function S(a, b, e) {
|
|
139
|
+
if (null == a) return a;
|
|
140
|
+
var d = [], c = 0;
|
|
141
|
+
R(a, d, "", "", function(a) {
|
|
142
|
+
return b.call(e, a, c++);
|
|
143
|
+
});
|
|
144
|
+
return d;
|
|
145
|
+
}
|
|
146
|
+
function T(a) {
|
|
147
|
+
if (-1 === a._status) {
|
|
148
|
+
var b = a._result;
|
|
149
|
+
b = b();
|
|
150
|
+
b.then(function(b) {
|
|
151
|
+
if (0 === a._status || -1 === a._status) a._status = 1, a._result = b;
|
|
152
|
+
}, function(b) {
|
|
153
|
+
if (0 === a._status || -1 === a._status) a._status = 2, a._result = b;
|
|
154
|
+
});
|
|
155
|
+
-1 === a._status && (a._status = 0, a._result = b);
|
|
156
|
+
}
|
|
157
|
+
if (1 === a._status) return a._result.default;
|
|
158
|
+
throw a._result;
|
|
159
|
+
}
|
|
171
160
|
var U = {
|
|
172
161
|
current: null
|
|
173
162
|
}, V = {
|
|
@@ -179,24 +168,24 @@ function requireReact_production_min() {
|
|
|
179
168
|
};
|
|
180
169
|
react_production_min.Children = {
|
|
181
170
|
map: S,
|
|
182
|
-
forEach: function
|
|
171
|
+
forEach: function(a, b, e) {
|
|
183
172
|
S(a, function() {
|
|
184
173
|
b.apply(this, arguments);
|
|
185
174
|
}, e);
|
|
186
175
|
},
|
|
187
|
-
count: function
|
|
176
|
+
count: function(a) {
|
|
188
177
|
var b = 0;
|
|
189
178
|
S(a, function() {
|
|
190
179
|
b++;
|
|
191
180
|
});
|
|
192
181
|
return b;
|
|
193
182
|
},
|
|
194
|
-
toArray: function
|
|
183
|
+
toArray: function(a) {
|
|
195
184
|
return S(a, function(a) {
|
|
196
185
|
return a;
|
|
197
186
|
}) || [];
|
|
198
187
|
},
|
|
199
|
-
only: function
|
|
188
|
+
only: function(a) {
|
|
200
189
|
if (!O(a)) throw Error("React.Children.only expected to receive a single React element child.");
|
|
201
190
|
return a;
|
|
202
191
|
}
|
|
@@ -346,25 +335,6 @@ function requireReact_production_min() {
|
|
|
346
335
|
|
|
347
336
|
var react_development = {exports: {}};
|
|
348
337
|
|
|
349
|
-
/**
|
|
350
|
-
* @license React
|
|
351
|
-
* react.development.js
|
|
352
|
-
*
|
|
353
|
-
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
354
|
-
*
|
|
355
|
-
* This source code is licensed under the MIT license found in the
|
|
356
|
-
* LICENSE file in the root directory of this source tree.
|
|
357
|
-
*/ function _instanceof(left, right) {
|
|
358
|
-
if (right != null && typeof Symbol !== "undefined" && right[Symbol.hasInstance]) {
|
|
359
|
-
return !!right[Symbol.hasInstance](left);
|
|
360
|
-
} else {
|
|
361
|
-
return left instanceof right;
|
|
362
|
-
}
|
|
363
|
-
}
|
|
364
|
-
var _typeof = function(obj) {
|
|
365
|
-
"@swc/helpers - typeof";
|
|
366
|
-
return obj && typeof Symbol !== "undefined" && obj.constructor === Symbol ? "symbol" : typeof obj;
|
|
367
|
-
};
|
|
368
338
|
var hasRequiredReact_development;
|
|
369
339
|
function requireReact_development() {
|
|
370
340
|
if (hasRequiredReact_development) return react_development.exports;
|
|
@@ -372,22 +342,114 @@ function requireReact_development() {
|
|
|
372
342
|
(function(module, exports) {
|
|
373
343
|
if (process.env.NODE_ENV !== "production") {
|
|
374
344
|
(function() {
|
|
375
|
-
|
|
376
|
-
|
|
345
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === 'function') {
|
|
346
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
347
|
+
}
|
|
348
|
+
var ReactVersion = '18.2.0';
|
|
349
|
+
// ATTENTION
|
|
350
|
+
// When adding new symbols to this file,
|
|
351
|
+
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
352
|
+
// The Symbol used to tag the ReactElement-like types.
|
|
353
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
354
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
355
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
356
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
357
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
358
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
359
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
360
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
361
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
362
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
363
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
364
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
365
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
366
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
367
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
368
|
+
function getIteratorFn(maybeIterable) {
|
|
369
|
+
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
377
370
|
return null;
|
|
378
371
|
}
|
|
379
372
|
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
380
|
-
if (typeof maybeIterator ===
|
|
373
|
+
if (typeof maybeIterator === 'function') {
|
|
381
374
|
return maybeIterator;
|
|
382
375
|
}
|
|
383
376
|
return null;
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Keeps track of the current dispatcher.
|
|
380
|
+
*/ var ReactCurrentDispatcher = {
|
|
381
|
+
/**
|
|
382
|
+
* @internal
|
|
383
|
+
* @type {ReactComponent}
|
|
384
|
+
*/ current: null
|
|
384
385
|
};
|
|
385
|
-
|
|
386
|
+
/**
|
|
387
|
+
* Keeps track of the current batch's configuration such as how long an update
|
|
388
|
+
* should suspend for if it needs to.
|
|
389
|
+
*/ var ReactCurrentBatchConfig = {
|
|
390
|
+
transition: null
|
|
391
|
+
};
|
|
392
|
+
var ReactCurrentActQueue = {
|
|
393
|
+
current: null,
|
|
394
|
+
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
|
395
|
+
isBatchingLegacy: false,
|
|
396
|
+
didScheduleLegacyUpdate: false
|
|
397
|
+
};
|
|
398
|
+
/**
|
|
399
|
+
* Keeps track of the current owner.
|
|
400
|
+
*
|
|
401
|
+
* The current owner is the component who should own any components that are
|
|
402
|
+
* currently being constructed.
|
|
403
|
+
*/ var ReactCurrentOwner = {
|
|
404
|
+
/**
|
|
405
|
+
* @internal
|
|
406
|
+
* @type {ReactComponent}
|
|
407
|
+
*/ current: null
|
|
408
|
+
};
|
|
409
|
+
var ReactDebugCurrentFrame = {};
|
|
410
|
+
var currentExtraStackFrame = null;
|
|
411
|
+
function setExtraStackFrame(stack) {
|
|
386
412
|
{
|
|
387
413
|
currentExtraStackFrame = stack;
|
|
388
414
|
}
|
|
415
|
+
}
|
|
416
|
+
{
|
|
417
|
+
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
|
|
418
|
+
{
|
|
419
|
+
currentExtraStackFrame = stack;
|
|
420
|
+
}
|
|
421
|
+
}; // Stack implementation injected by the current renderer.
|
|
422
|
+
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
423
|
+
ReactDebugCurrentFrame.getStackAddendum = function() {
|
|
424
|
+
var stack = ''; // Add an extra top frame while an element is being validated
|
|
425
|
+
if (currentExtraStackFrame) {
|
|
426
|
+
stack += currentExtraStackFrame;
|
|
427
|
+
} // Delegate to the injected renderer-specific implementation
|
|
428
|
+
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
429
|
+
if (impl) {
|
|
430
|
+
stack += impl() || '';
|
|
431
|
+
}
|
|
432
|
+
return stack;
|
|
433
|
+
};
|
|
434
|
+
}
|
|
435
|
+
// -----------------------------------------------------------------------------
|
|
436
|
+
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
437
|
+
var enableCacheElement = false;
|
|
438
|
+
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
439
|
+
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
440
|
+
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
441
|
+
// issues in DEV builds.
|
|
442
|
+
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
443
|
+
var ReactSharedInternals = {
|
|
444
|
+
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
445
|
+
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
446
|
+
ReactCurrentOwner: ReactCurrentOwner
|
|
389
447
|
};
|
|
390
|
-
|
|
448
|
+
{
|
|
449
|
+
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
450
|
+
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
|
451
|
+
}
|
|
452
|
+
// by calls to these methods by a Babel plugin.
|
|
391
453
|
//
|
|
392
454
|
// In PROD (or in packages without access to React internals),
|
|
393
455
|
// they are left as they are instead.
|
|
@@ -397,28 +459,28 @@ function requireReact_development() {
|
|
|
397
459
|
for(var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++){
|
|
398
460
|
args[_key - 1] = arguments[_key];
|
|
399
461
|
}
|
|
400
|
-
printWarning(
|
|
462
|
+
printWarning('warn', format, args);
|
|
401
463
|
}
|
|
402
464
|
}
|
|
403
|
-
}
|
|
404
|
-
|
|
465
|
+
}
|
|
466
|
+
function error(format) {
|
|
405
467
|
{
|
|
406
468
|
{
|
|
407
469
|
for(var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++){
|
|
408
470
|
args[_key2 - 1] = arguments[_key2];
|
|
409
471
|
}
|
|
410
|
-
printWarning(
|
|
472
|
+
printWarning('error', format, args);
|
|
411
473
|
}
|
|
412
474
|
}
|
|
413
|
-
}
|
|
414
|
-
|
|
475
|
+
}
|
|
476
|
+
function printWarning(level, format, args) {
|
|
415
477
|
// When changing this logic, you might want to also
|
|
416
478
|
// update consoleWithStackDev.www.js as well.
|
|
417
479
|
{
|
|
418
480
|
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
419
481
|
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
420
|
-
if (stack !==
|
|
421
|
-
format +=
|
|
482
|
+
if (stack !== '') {
|
|
483
|
+
format += '%s';
|
|
422
484
|
args = args.concat([
|
|
423
485
|
stack
|
|
424
486
|
]);
|
|
@@ -426,25 +488,90 @@ function requireReact_development() {
|
|
|
426
488
|
var argsWithFormat = args.map(function(item) {
|
|
427
489
|
return String(item);
|
|
428
490
|
}); // Careful: RN currently depends on this prefix
|
|
429
|
-
argsWithFormat.unshift(
|
|
491
|
+
argsWithFormat.unshift('Warning: ' + format); // We intentionally don't use spread (or .apply) directly because it
|
|
430
492
|
// breaks IE9: https://github.com/facebook/react/issues/13610
|
|
431
493
|
// eslint-disable-next-line react-internal/no-production-logging
|
|
432
494
|
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
433
495
|
}
|
|
434
|
-
}
|
|
435
|
-
var
|
|
496
|
+
}
|
|
497
|
+
var didWarnStateUpdateForUnmountedComponent = {};
|
|
498
|
+
function warnNoop(publicInstance, callerName) {
|
|
436
499
|
{
|
|
437
500
|
var _constructor = publicInstance.constructor;
|
|
438
|
-
var componentName = _constructor && (_constructor.displayName || _constructor.name) ||
|
|
501
|
+
var componentName = _constructor && (_constructor.displayName || _constructor.name) || 'ReactClass';
|
|
439
502
|
var warningKey = componentName + "." + callerName;
|
|
440
503
|
if (didWarnStateUpdateForUnmountedComponent[warningKey]) {
|
|
441
504
|
return;
|
|
442
505
|
}
|
|
443
|
-
error("Can't call %s on a component that is not yet mounted. " +
|
|
506
|
+
error("Can't call %s on a component that is not yet mounted. " + 'This is a no-op, but it might indicate a bug in your application. ' + 'Instead, assign to `this.state` directly or define a `state = {};` ' + 'class property with the desired state in the %s component.', callerName, componentName);
|
|
444
507
|
didWarnStateUpdateForUnmountedComponent[warningKey] = true;
|
|
445
508
|
}
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* This is the abstract API for an update queue.
|
|
512
|
+
*/ var ReactNoopUpdateQueue = {
|
|
513
|
+
/**
|
|
514
|
+
* Checks whether or not this composite component is mounted.
|
|
515
|
+
* @param {ReactClass} publicInstance The instance we want to test.
|
|
516
|
+
* @return {boolean} True if mounted, false otherwise.
|
|
517
|
+
* @protected
|
|
518
|
+
* @final
|
|
519
|
+
*/ isMounted: function(publicInstance) {
|
|
520
|
+
return false;
|
|
521
|
+
},
|
|
522
|
+
/**
|
|
523
|
+
* Forces an update. This should only be invoked when it is known with
|
|
524
|
+
* certainty that we are **not** in a DOM transaction.
|
|
525
|
+
*
|
|
526
|
+
* You may want to call this when you know that some deeper aspect of the
|
|
527
|
+
* component's state has changed but `setState` was not called.
|
|
528
|
+
*
|
|
529
|
+
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
530
|
+
* `componentWillUpdate` and `componentDidUpdate`.
|
|
531
|
+
*
|
|
532
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
533
|
+
* @param {?function} callback Called after component is updated.
|
|
534
|
+
* @param {?string} callerName name of the calling function in the public API.
|
|
535
|
+
* @internal
|
|
536
|
+
*/ enqueueForceUpdate: function(publicInstance, callback, callerName) {
|
|
537
|
+
warnNoop(publicInstance, 'forceUpdate');
|
|
538
|
+
},
|
|
539
|
+
/**
|
|
540
|
+
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
541
|
+
* You should treat `this.state` as immutable.
|
|
542
|
+
*
|
|
543
|
+
* There is no guarantee that `this.state` will be immediately updated, so
|
|
544
|
+
* accessing `this.state` after calling this method may return the old value.
|
|
545
|
+
*
|
|
546
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
547
|
+
* @param {object} completeState Next state.
|
|
548
|
+
* @param {?function} callback Called after component is updated.
|
|
549
|
+
* @param {?string} callerName name of the calling function in the public API.
|
|
550
|
+
* @internal
|
|
551
|
+
*/ enqueueReplaceState: function(publicInstance, completeState, callback, callerName) {
|
|
552
|
+
warnNoop(publicInstance, 'replaceState');
|
|
553
|
+
},
|
|
554
|
+
/**
|
|
555
|
+
* Sets a subset of the state. This only exists because _pendingState is
|
|
556
|
+
* internal. This provides a merging strategy that is not available to deep
|
|
557
|
+
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
558
|
+
* during the merge.
|
|
559
|
+
*
|
|
560
|
+
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
561
|
+
* @param {object} partialState Next partial state to be merged with state.
|
|
562
|
+
* @param {?function} callback Called after component is updated.
|
|
563
|
+
* @param {?string} Name of the calling function in the public API.
|
|
564
|
+
* @internal
|
|
565
|
+
*/ enqueueSetState: function(publicInstance, partialState, callback, callerName) {
|
|
566
|
+
warnNoop(publicInstance, 'setState');
|
|
567
|
+
}
|
|
446
568
|
};
|
|
447
|
-
var
|
|
569
|
+
var assign = Object.assign;
|
|
570
|
+
var emptyObject = {};
|
|
571
|
+
{
|
|
572
|
+
Object.freeze(emptyObject);
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
448
575
|
* Base class helpers for the updating state of a component.
|
|
449
576
|
*/ function Component(props, context, updater) {
|
|
450
577
|
this.props = props;
|
|
@@ -452,17 +579,98 @@ function requireReact_development() {
|
|
|
452
579
|
this.refs = emptyObject; // We initialize the default updater but the real one gets injected by the
|
|
453
580
|
// renderer.
|
|
454
581
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
*
|
|
459
|
-
|
|
460
|
-
|
|
582
|
+
}
|
|
583
|
+
Component.prototype.isReactComponent = {};
|
|
584
|
+
/**
|
|
585
|
+
* Sets a subset of the state. Always use this to mutate
|
|
586
|
+
* state. You should treat `this.state` as immutable.
|
|
587
|
+
*
|
|
588
|
+
* There is no guarantee that `this.state` will be immediately updated, so
|
|
589
|
+
* accessing `this.state` after calling this method may return the old value.
|
|
590
|
+
*
|
|
591
|
+
* There is no guarantee that calls to `setState` will run synchronously,
|
|
592
|
+
* as they may eventually be batched together. You can provide an optional
|
|
593
|
+
* callback that will be executed when the call to setState is actually
|
|
594
|
+
* completed.
|
|
595
|
+
*
|
|
596
|
+
* When a function is provided to setState, it will be called at some point in
|
|
597
|
+
* the future (not synchronously). It will be called with the up to date
|
|
598
|
+
* component arguments (state, props, context). These values can be different
|
|
599
|
+
* from this.* because your function may be called after receiveProps but before
|
|
600
|
+
* shouldComponentUpdate, and this new state, props, and context will not yet be
|
|
601
|
+
* assigned to this.
|
|
602
|
+
*
|
|
603
|
+
* @param {object|function} partialState Next partial state or function to
|
|
604
|
+
* produce next partial state to be merged with current state.
|
|
605
|
+
* @param {?function} callback Called after state is updated.
|
|
606
|
+
* @final
|
|
607
|
+
* @protected
|
|
608
|
+
*/ Component.prototype.setState = function(partialState, callback) {
|
|
609
|
+
if (typeof partialState !== 'object' && typeof partialState !== 'function' && partialState != null) {
|
|
610
|
+
throw new Error('setState(...): takes an object of state variables to update or a ' + 'function which returns an object of state variables.');
|
|
611
|
+
}
|
|
612
|
+
this.updater.enqueueSetState(this, partialState, callback, 'setState');
|
|
613
|
+
};
|
|
614
|
+
/**
|
|
615
|
+
* Forces an update. This should only be invoked when it is known with
|
|
616
|
+
* certainty that we are **not** in a DOM transaction.
|
|
617
|
+
*
|
|
618
|
+
* You may want to call this when you know that some deeper aspect of the
|
|
619
|
+
* component's state has changed but `setState` was not called.
|
|
620
|
+
*
|
|
621
|
+
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
622
|
+
* `componentWillUpdate` and `componentDidUpdate`.
|
|
623
|
+
*
|
|
624
|
+
* @param {?function} callback Called after update is complete.
|
|
625
|
+
* @final
|
|
626
|
+
* @protected
|
|
627
|
+
*/ Component.prototype.forceUpdate = function(callback) {
|
|
628
|
+
this.updater.enqueueForceUpdate(this, callback, 'forceUpdate');
|
|
629
|
+
};
|
|
630
|
+
/**
|
|
631
|
+
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
632
|
+
* we would like to deprecate them, we're not going to move them over to this
|
|
633
|
+
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
634
|
+
*/ {
|
|
635
|
+
var deprecatedAPIs = {
|
|
636
|
+
isMounted: [
|
|
637
|
+
'isMounted',
|
|
638
|
+
'Instead, make sure to clean up subscriptions and pending requests in ' + 'componentWillUnmount to prevent memory leaks.'
|
|
639
|
+
],
|
|
640
|
+
replaceState: [
|
|
641
|
+
'replaceState',
|
|
642
|
+
'Refactor your code to use setState instead (see ' + 'https://github.com/facebook/react/issues/3236).'
|
|
643
|
+
]
|
|
644
|
+
};
|
|
645
|
+
var defineDeprecationWarning = function(methodName, info) {
|
|
646
|
+
Object.defineProperty(Component.prototype, methodName, {
|
|
647
|
+
get: function() {
|
|
648
|
+
warn('%s(...) is deprecated in plain JavaScript React classes. %s', info[0], info[1]);
|
|
649
|
+
return undefined;
|
|
650
|
+
}
|
|
651
|
+
});
|
|
652
|
+
};
|
|
653
|
+
for(var fnName in deprecatedAPIs){
|
|
654
|
+
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
655
|
+
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
656
|
+
}
|
|
657
|
+
}
|
|
658
|
+
}
|
|
659
|
+
function ComponentDummy() {}
|
|
660
|
+
ComponentDummy.prototype = Component.prototype;
|
|
661
|
+
/**
|
|
662
|
+
* Convenience component with default shallow equality check for sCU.
|
|
663
|
+
*/ function PureComponent(props, context, updater) {
|
|
664
|
+
this.props = props;
|
|
461
665
|
this.context = context; // If a component has string refs, we will assign a different object later.
|
|
462
666
|
this.refs = emptyObject;
|
|
463
667
|
this.updater = updater || ReactNoopUpdateQueue;
|
|
464
|
-
}
|
|
465
|
-
var
|
|
668
|
+
}
|
|
669
|
+
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
670
|
+
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
671
|
+
assign(pureComponentPrototype, Component.prototype);
|
|
672
|
+
pureComponentPrototype.isPureReactComponent = true;
|
|
673
|
+
// an immutable object with a single mutable value
|
|
466
674
|
function createRef() {
|
|
467
675
|
var refObject = {
|
|
468
676
|
current: null
|
|
@@ -471,11 +679,12 @@ function requireReact_development() {
|
|
|
471
679
|
Object.seal(refObject);
|
|
472
680
|
}
|
|
473
681
|
return refObject;
|
|
474
|
-
}
|
|
475
|
-
var
|
|
682
|
+
}
|
|
683
|
+
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
684
|
+
function isArray(a) {
|
|
476
685
|
return isArrayImpl(a);
|
|
477
|
-
}
|
|
478
|
-
|
|
686
|
+
}
|
|
687
|
+
/*
|
|
479
688
|
* The `'' + value` pattern (used in in perf-sensitive code) throws for Symbol
|
|
480
689
|
* and Temporal.* types. See https://github.com/facebook/react/pull/22064.
|
|
481
690
|
*
|
|
@@ -487,13 +696,12 @@ function requireReact_development() {
|
|
|
487
696
|
function typeName(value) {
|
|
488
697
|
{
|
|
489
698
|
// toStringTag is needed for namespaced types like Temporal.Instant
|
|
490
|
-
var hasToStringTag = typeof Symbol ===
|
|
491
|
-
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name ||
|
|
699
|
+
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
700
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
492
701
|
return type;
|
|
493
702
|
}
|
|
494
703
|
} // $FlowFixMe only called in DEV, so void return is not possible.
|
|
495
|
-
|
|
496
|
-
var willCoercionThrow = function willCoercionThrow(value) {
|
|
704
|
+
function willCoercionThrow(value) {
|
|
497
705
|
{
|
|
498
706
|
try {
|
|
499
707
|
testStringCoercion(value);
|
|
@@ -502,8 +710,8 @@ function requireReact_development() {
|
|
|
502
710
|
return true;
|
|
503
711
|
}
|
|
504
712
|
}
|
|
505
|
-
}
|
|
506
|
-
|
|
713
|
+
}
|
|
714
|
+
function testStringCoercion(value) {
|
|
507
715
|
// If you ended up here by following an exception call stack, here's what's
|
|
508
716
|
// happened: you supplied an object or symbol value to React (as a prop, key,
|
|
509
717
|
// DOM attribute, CSS property, string ref, etc.) and when React tried to
|
|
@@ -527,93 +735,229 @@ function requireReact_development() {
|
|
|
527
735
|
// ancestor components where the exception happened.
|
|
528
736
|
//
|
|
529
737
|
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
530
|
-
return
|
|
531
|
-
}
|
|
532
|
-
|
|
738
|
+
return '' + value;
|
|
739
|
+
}
|
|
740
|
+
function checkKeyStringCoercion(value) {
|
|
533
741
|
{
|
|
534
742
|
if (willCoercionThrow(value)) {
|
|
535
|
-
error(
|
|
743
|
+
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
536
744
|
return testStringCoercion(value); // throw (to help callers find troubleshooting comments)
|
|
537
745
|
}
|
|
538
746
|
}
|
|
539
|
-
}
|
|
540
|
-
|
|
747
|
+
}
|
|
748
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
541
749
|
var displayName = outerType.displayName;
|
|
542
750
|
if (displayName) {
|
|
543
751
|
return displayName;
|
|
544
752
|
}
|
|
545
|
-
var functionName = innerType.displayName || innerType.name ||
|
|
546
|
-
return functionName !==
|
|
753
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
754
|
+
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
547
755
|
} // Keep in sync with react-reconciler/getComponentNameFromFiber
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
return type.displayName || "Context";
|
|
756
|
+
function getContextName(type) {
|
|
757
|
+
return type.displayName || 'Context';
|
|
551
758
|
} // Note that the reconciler package should generally prefer to use getComponentNameFromFiber() instead.
|
|
552
|
-
|
|
553
|
-
|
|
759
|
+
function getComponentNameFromType(type) {
|
|
760
|
+
if (type == null) {
|
|
761
|
+
// Host root, text node or just invalid type.
|
|
762
|
+
return null;
|
|
763
|
+
}
|
|
764
|
+
{
|
|
765
|
+
if (typeof type.tag === 'number') {
|
|
766
|
+
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
767
|
+
}
|
|
768
|
+
}
|
|
769
|
+
if (typeof type === 'function') {
|
|
770
|
+
return type.displayName || type.name || null;
|
|
771
|
+
}
|
|
772
|
+
if (typeof type === 'string') {
|
|
773
|
+
return type;
|
|
774
|
+
}
|
|
775
|
+
switch(type){
|
|
776
|
+
case REACT_FRAGMENT_TYPE:
|
|
777
|
+
return 'Fragment';
|
|
778
|
+
case REACT_PORTAL_TYPE:
|
|
779
|
+
return 'Portal';
|
|
780
|
+
case REACT_PROFILER_TYPE:
|
|
781
|
+
return 'Profiler';
|
|
782
|
+
case REACT_STRICT_MODE_TYPE:
|
|
783
|
+
return 'StrictMode';
|
|
784
|
+
case REACT_SUSPENSE_TYPE:
|
|
785
|
+
return 'Suspense';
|
|
786
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
787
|
+
return 'SuspenseList';
|
|
788
|
+
}
|
|
789
|
+
if (typeof type === 'object') {
|
|
790
|
+
switch(type.$$typeof){
|
|
791
|
+
case REACT_CONTEXT_TYPE:
|
|
792
|
+
var context = type;
|
|
793
|
+
return getContextName(context) + '.Consumer';
|
|
794
|
+
case REACT_PROVIDER_TYPE:
|
|
795
|
+
var provider = type;
|
|
796
|
+
return getContextName(provider._context) + '.Provider';
|
|
797
|
+
case REACT_FORWARD_REF_TYPE:
|
|
798
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
799
|
+
case REACT_MEMO_TYPE:
|
|
800
|
+
var outerName = type.displayName || null;
|
|
801
|
+
if (outerName !== null) {
|
|
802
|
+
return outerName;
|
|
803
|
+
}
|
|
804
|
+
return getComponentNameFromType(type.type) || 'Memo';
|
|
805
|
+
case REACT_LAZY_TYPE:
|
|
806
|
+
{
|
|
807
|
+
var lazyComponent = type;
|
|
808
|
+
var payload = lazyComponent._payload;
|
|
809
|
+
var init = lazyComponent._init;
|
|
810
|
+
try {
|
|
811
|
+
return getComponentNameFromType(init(payload));
|
|
812
|
+
} catch (x) {
|
|
813
|
+
return null;
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return null;
|
|
819
|
+
}
|
|
820
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
821
|
+
var RESERVED_PROPS = {
|
|
822
|
+
key: true,
|
|
823
|
+
ref: true,
|
|
824
|
+
__self: true,
|
|
825
|
+
__source: true
|
|
826
|
+
};
|
|
827
|
+
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
828
|
+
{
|
|
829
|
+
didWarnAboutStringRefs = {};
|
|
830
|
+
}
|
|
831
|
+
function hasValidRef(config) {
|
|
554
832
|
{
|
|
555
|
-
if (hasOwnProperty.call(config,
|
|
556
|
-
var getter = Object.getOwnPropertyDescriptor(config,
|
|
833
|
+
if (hasOwnProperty.call(config, 'ref')) {
|
|
834
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
557
835
|
if (getter && getter.isReactWarning) {
|
|
558
836
|
return false;
|
|
559
837
|
}
|
|
560
838
|
}
|
|
561
839
|
}
|
|
562
840
|
return config.ref !== undefined;
|
|
563
|
-
}
|
|
564
|
-
|
|
841
|
+
}
|
|
842
|
+
function hasValidKey(config) {
|
|
565
843
|
{
|
|
566
|
-
if (hasOwnProperty.call(config,
|
|
567
|
-
var getter = Object.getOwnPropertyDescriptor(config,
|
|
844
|
+
if (hasOwnProperty.call(config, 'key')) {
|
|
845
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
568
846
|
if (getter && getter.isReactWarning) {
|
|
569
847
|
return false;
|
|
570
848
|
}
|
|
571
849
|
}
|
|
572
850
|
}
|
|
573
851
|
return config.key !== undefined;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
var warnAboutAccessingKey = function
|
|
852
|
+
}
|
|
853
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
854
|
+
var warnAboutAccessingKey = function() {
|
|
577
855
|
{
|
|
578
856
|
if (!specialPropKeyWarningShown) {
|
|
579
857
|
specialPropKeyWarningShown = true;
|
|
580
|
-
error(
|
|
858
|
+
error('%s: `key` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
581
859
|
}
|
|
582
860
|
}
|
|
583
861
|
};
|
|
584
862
|
warnAboutAccessingKey.isReactWarning = true;
|
|
585
|
-
Object.defineProperty(props,
|
|
863
|
+
Object.defineProperty(props, 'key', {
|
|
586
864
|
get: warnAboutAccessingKey,
|
|
587
865
|
configurable: true
|
|
588
866
|
});
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
var warnAboutAccessingRef = function
|
|
867
|
+
}
|
|
868
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
869
|
+
var warnAboutAccessingRef = function() {
|
|
592
870
|
{
|
|
593
871
|
if (!specialPropRefWarningShown) {
|
|
594
872
|
specialPropRefWarningShown = true;
|
|
595
|
-
error(
|
|
873
|
+
error('%s: `ref` is not a prop. Trying to access it will result ' + 'in `undefined` being returned. If you need to access the same ' + 'value within the child component, you should pass it as a different ' + 'prop. (https://reactjs.org/link/special-props)', displayName);
|
|
596
874
|
}
|
|
597
875
|
}
|
|
598
876
|
};
|
|
599
877
|
warnAboutAccessingRef.isReactWarning = true;
|
|
600
|
-
Object.defineProperty(props,
|
|
878
|
+
Object.defineProperty(props, 'ref', {
|
|
601
879
|
get: warnAboutAccessingRef,
|
|
602
880
|
configurable: true
|
|
603
881
|
});
|
|
604
|
-
}
|
|
605
|
-
|
|
882
|
+
}
|
|
883
|
+
function warnIfStringRefCannotBeAutoConverted(config) {
|
|
606
884
|
{
|
|
607
|
-
if (typeof config.ref ===
|
|
885
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && config.__self && ReactCurrentOwner.current.stateNode !== config.__self) {
|
|
608
886
|
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
609
887
|
if (!didWarnAboutStringRefs[componentName]) {
|
|
610
|
-
error('Component "%s" contains the string ref "%s". ' +
|
|
888
|
+
error('Component "%s" contains the string ref "%s". ' + 'Support for string refs will be removed in a future major release. ' + 'This case cannot be automatically converted to an arrow function. ' + 'We ask you to manually fix this case by using useRef() or createRef() instead. ' + 'Learn more about using refs safely here: ' + 'https://reactjs.org/link/strict-mode-string-ref', componentName, config.ref);
|
|
611
889
|
didWarnAboutStringRefs[componentName] = true;
|
|
612
890
|
}
|
|
613
891
|
}
|
|
614
892
|
}
|
|
893
|
+
}
|
|
894
|
+
/**
|
|
895
|
+
* Factory method to create a new React element. This no longer adheres to
|
|
896
|
+
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
897
|
+
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
898
|
+
* if something is a React Element.
|
|
899
|
+
*
|
|
900
|
+
* @param {*} type
|
|
901
|
+
* @param {*} props
|
|
902
|
+
* @param {*} key
|
|
903
|
+
* @param {string|object} ref
|
|
904
|
+
* @param {*} owner
|
|
905
|
+
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
906
|
+
* different from the `owner` when React.createElement is called, so that we
|
|
907
|
+
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
908
|
+
* functions, and as long as `this` and owner are the same, there will be no
|
|
909
|
+
* change in behavior.
|
|
910
|
+
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
911
|
+
* indicating filename, line number, and/or other information.
|
|
912
|
+
* @internal
|
|
913
|
+
*/ var ReactElement = function(type, key, ref, self, source, owner, props) {
|
|
914
|
+
var element = {
|
|
915
|
+
// This tag allows us to uniquely identify this as a React Element
|
|
916
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
917
|
+
// Built-in properties that belong on the element
|
|
918
|
+
type: type,
|
|
919
|
+
key: key,
|
|
920
|
+
ref: ref,
|
|
921
|
+
props: props,
|
|
922
|
+
// Record the component responsible for creating this element.
|
|
923
|
+
_owner: owner
|
|
924
|
+
};
|
|
925
|
+
{
|
|
926
|
+
// The validation flag is currently mutative. We put it on
|
|
927
|
+
// an external backing store so that we can freeze the whole object.
|
|
928
|
+
// This can be replaced with a WeakMap once they are implemented in
|
|
929
|
+
// commonly used development environments.
|
|
930
|
+
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
931
|
+
// the validation flag non-enumerable (where possible, which should
|
|
932
|
+
// include every environment we run tests in), so the test framework
|
|
933
|
+
// ignores it.
|
|
934
|
+
Object.defineProperty(element._store, 'validated', {
|
|
935
|
+
configurable: false,
|
|
936
|
+
enumerable: false,
|
|
937
|
+
writable: true,
|
|
938
|
+
value: false
|
|
939
|
+
}); // self and source are DEV only properties.
|
|
940
|
+
Object.defineProperty(element, '_self', {
|
|
941
|
+
configurable: false,
|
|
942
|
+
enumerable: false,
|
|
943
|
+
writable: false,
|
|
944
|
+
value: self
|
|
945
|
+
}); // Two elements created in two different places should be considered
|
|
946
|
+
// equal for testing purposes and therefore we hide it from enumeration.
|
|
947
|
+
Object.defineProperty(element, '_source', {
|
|
948
|
+
configurable: false,
|
|
949
|
+
enumerable: false,
|
|
950
|
+
writable: false,
|
|
951
|
+
value: source
|
|
952
|
+
});
|
|
953
|
+
if (Object.freeze) {
|
|
954
|
+
Object.freeze(element.props);
|
|
955
|
+
Object.freeze(element);
|
|
956
|
+
}
|
|
957
|
+
}
|
|
958
|
+
return element;
|
|
615
959
|
};
|
|
616
|
-
|
|
960
|
+
/**
|
|
617
961
|
* Create and return a new ReactElement of the given type.
|
|
618
962
|
* See https://reactjs.org/docs/react-api.html#createelement
|
|
619
963
|
*/ function createElement(type, config, children) {
|
|
@@ -634,7 +978,7 @@ function requireReact_development() {
|
|
|
634
978
|
{
|
|
635
979
|
checkKeyStringCoercion(config.key);
|
|
636
980
|
}
|
|
637
|
-
key =
|
|
981
|
+
key = '' + config.key;
|
|
638
982
|
}
|
|
639
983
|
self = config.__self === undefined ? null : config.__self;
|
|
640
984
|
source = config.__source === undefined ? null : config.__source; // Remaining properties are added to a new props object
|
|
@@ -670,7 +1014,7 @@ function requireReact_development() {
|
|
|
670
1014
|
}
|
|
671
1015
|
{
|
|
672
1016
|
if (key || ref) {
|
|
673
|
-
var displayName = typeof type ===
|
|
1017
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
674
1018
|
if (key) {
|
|
675
1019
|
defineKeyPropWarningGetter(props, displayName);
|
|
676
1020
|
}
|
|
@@ -680,12 +1024,12 @@ function requireReact_development() {
|
|
|
680
1024
|
}
|
|
681
1025
|
}
|
|
682
1026
|
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
683
|
-
}
|
|
684
|
-
|
|
1027
|
+
}
|
|
1028
|
+
function cloneAndReplaceKey(oldElement, newKey) {
|
|
685
1029
|
var newElement = ReactElement(oldElement.type, newKey, oldElement.ref, oldElement._self, oldElement._source, oldElement._owner, oldElement.props);
|
|
686
1030
|
return newElement;
|
|
687
|
-
}
|
|
688
|
-
|
|
1031
|
+
}
|
|
1032
|
+
/**
|
|
689
1033
|
* Clone and return a new ReactElement using element as the starting point.
|
|
690
1034
|
* See https://reactjs.org/docs/react-api.html#cloneelement
|
|
691
1035
|
*/ function cloneElement(element, config, children) {
|
|
@@ -711,7 +1055,7 @@ function requireReact_development() {
|
|
|
711
1055
|
{
|
|
712
1056
|
checkKeyStringCoercion(config.key);
|
|
713
1057
|
}
|
|
714
|
-
key =
|
|
1058
|
+
key = '' + config.key;
|
|
715
1059
|
} // Remaining properties override existing props
|
|
716
1060
|
var defaultProps;
|
|
717
1061
|
if (element.type && element.type.defaultProps) {
|
|
@@ -740,17 +1084,19 @@ function requireReact_development() {
|
|
|
740
1084
|
props.children = childArray;
|
|
741
1085
|
}
|
|
742
1086
|
return ReactElement(element.type, key, ref, self, source, owner, props);
|
|
743
|
-
}
|
|
744
|
-
|
|
1087
|
+
}
|
|
1088
|
+
/**
|
|
745
1089
|
* Verifies the object is a ReactElement.
|
|
746
1090
|
* See https://reactjs.org/docs/react-api.html#isvalidelement
|
|
747
1091
|
* @param {?object} object
|
|
748
1092
|
* @return {boolean} True if `object` is a ReactElement.
|
|
749
1093
|
* @final
|
|
750
1094
|
*/ function isValidElement(object) {
|
|
751
|
-
return typeof object ===
|
|
752
|
-
}
|
|
753
|
-
var
|
|
1095
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
1096
|
+
}
|
|
1097
|
+
var SEPARATOR = '.';
|
|
1098
|
+
var SUBSEPARATOR = ':';
|
|
1099
|
+
/**
|
|
754
1100
|
* Escape and wrap key so it is safe to use as a reactid
|
|
755
1101
|
*
|
|
756
1102
|
* @param {string} key to be escaped.
|
|
@@ -758,18 +1104,23 @@ function requireReact_development() {
|
|
|
758
1104
|
*/ function escape(key) {
|
|
759
1105
|
var escapeRegex = /[=:]/g;
|
|
760
1106
|
var escaperLookup = {
|
|
761
|
-
|
|
762
|
-
|
|
1107
|
+
'=': '=0',
|
|
1108
|
+
':': '=2'
|
|
763
1109
|
};
|
|
764
1110
|
var escapedString = key.replace(escapeRegex, function(match) {
|
|
765
1111
|
return escaperLookup[match];
|
|
766
1112
|
});
|
|
767
|
-
return
|
|
768
|
-
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
1113
|
+
return '$' + escapedString;
|
|
1114
|
+
}
|
|
1115
|
+
/**
|
|
1116
|
+
* TODO: Test that a single child and an array with one item have the same key
|
|
1117
|
+
* pattern.
|
|
1118
|
+
*/ var didWarnAboutMaps = false;
|
|
1119
|
+
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
1120
|
+
function escapeUserProvidedKey(text) {
|
|
1121
|
+
return text.replace(userProvidedKeyEscapeRegex, '$&/');
|
|
1122
|
+
}
|
|
1123
|
+
/**
|
|
773
1124
|
* Generate a key string that identifies a element within a set.
|
|
774
1125
|
*
|
|
775
1126
|
* @param {*} element A element that could contain a manual key.
|
|
@@ -778,39 +1129,132 @@ function requireReact_development() {
|
|
|
778
1129
|
*/ function getElementKey(element, index) {
|
|
779
1130
|
// Do some typechecking here since we call this blindly. We want to ensure
|
|
780
1131
|
// that we don't block potential future ES APIs.
|
|
781
|
-
if (typeof element ===
|
|
1132
|
+
if (typeof element === 'object' && element !== null && element.key != null) {
|
|
782
1133
|
// Explicit key
|
|
783
1134
|
{
|
|
784
1135
|
checkKeyStringCoercion(element.key);
|
|
785
1136
|
}
|
|
786
|
-
return escape(
|
|
1137
|
+
return escape('' + element.key);
|
|
787
1138
|
} // Implicit key determined by the index in the set
|
|
788
1139
|
return index.toString(36);
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
1140
|
+
}
|
|
1141
|
+
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
1142
|
+
var type = typeof children;
|
|
1143
|
+
if (type === 'undefined' || type === 'boolean') {
|
|
1144
|
+
// All of the above are perceived as null.
|
|
1145
|
+
children = null;
|
|
1146
|
+
}
|
|
1147
|
+
var invokeCallback = false;
|
|
1148
|
+
if (children === null) {
|
|
1149
|
+
invokeCallback = true;
|
|
1150
|
+
} else {
|
|
1151
|
+
switch(type){
|
|
1152
|
+
case 'string':
|
|
1153
|
+
case 'number':
|
|
1154
|
+
invokeCallback = true;
|
|
1155
|
+
break;
|
|
1156
|
+
case 'object':
|
|
1157
|
+
switch(children.$$typeof){
|
|
1158
|
+
case REACT_ELEMENT_TYPE:
|
|
1159
|
+
case REACT_PORTAL_TYPE:
|
|
1160
|
+
invokeCallback = true;
|
|
1161
|
+
}
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
if (invokeCallback) {
|
|
1165
|
+
var _child = children;
|
|
1166
|
+
var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
|
|
1167
|
+
// so that it's consistent if the number of children grows:
|
|
1168
|
+
var childKey = nameSoFar === '' ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
1169
|
+
if (isArray(mappedChild)) {
|
|
1170
|
+
var escapedChildKey = '';
|
|
1171
|
+
if (childKey != null) {
|
|
1172
|
+
escapedChildKey = escapeUserProvidedKey(childKey) + '/';
|
|
1173
|
+
}
|
|
1174
|
+
mapIntoArray(mappedChild, array, escapedChildKey, '', function(c) {
|
|
1175
|
+
return c;
|
|
1176
|
+
});
|
|
1177
|
+
} else if (mappedChild != null) {
|
|
1178
|
+
if (isValidElement(mappedChild)) {
|
|
1179
|
+
{
|
|
1180
|
+
// The `if` statement here prevents auto-disabling of the safe
|
|
1181
|
+
// coercion ESLint rule, so we must manually disable it below.
|
|
1182
|
+
// $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
1183
|
+
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
|
1184
|
+
checkKeyStringCoercion(mappedChild.key);
|
|
1185
|
+
}
|
|
1186
|
+
}
|
|
1187
|
+
mappedChild = cloneAndReplaceKey(mappedChild, // traverseAllChildren used to do for objects as children
|
|
1188
|
+
escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // eslint-disable-next-line react-internal/safe-string-coercion
|
|
1189
|
+
escapeUserProvidedKey('' + mappedChild.key) + '/' : '') + childKey);
|
|
1190
|
+
}
|
|
1191
|
+
array.push(mappedChild);
|
|
1192
|
+
}
|
|
1193
|
+
return 1;
|
|
1194
|
+
}
|
|
1195
|
+
var child;
|
|
1196
|
+
var nextName;
|
|
1197
|
+
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
1198
|
+
var nextNamePrefix = nameSoFar === '' ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
1199
|
+
if (isArray(children)) {
|
|
1200
|
+
for(var i = 0; i < children.length; i++){
|
|
1201
|
+
child = children[i];
|
|
1202
|
+
nextName = nextNamePrefix + getElementKey(child, i);
|
|
1203
|
+
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1204
|
+
}
|
|
1205
|
+
} else {
|
|
1206
|
+
var iteratorFn = getIteratorFn(children);
|
|
1207
|
+
if (typeof iteratorFn === 'function') {
|
|
1208
|
+
var iterableChildren = children;
|
|
1209
|
+
{
|
|
1210
|
+
// Warn about using Maps as children
|
|
1211
|
+
if (iteratorFn === iterableChildren.entries) {
|
|
1212
|
+
if (!didWarnAboutMaps) {
|
|
1213
|
+
warn('Using Maps as children is not supported. ' + 'Use an array of keyed ReactElements instead.');
|
|
1214
|
+
}
|
|
1215
|
+
didWarnAboutMaps = true;
|
|
1216
|
+
}
|
|
1217
|
+
}
|
|
1218
|
+
var iterator = iteratorFn.call(iterableChildren);
|
|
1219
|
+
var step;
|
|
1220
|
+
var ii = 0;
|
|
1221
|
+
while(!(step = iterator.next()).done){
|
|
1222
|
+
child = step.value;
|
|
1223
|
+
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
1224
|
+
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
1225
|
+
}
|
|
1226
|
+
} else if (type === 'object') {
|
|
1227
|
+
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
1228
|
+
var childrenString = String(children);
|
|
1229
|
+
throw new Error("Objects are not valid as a React child (found: " + (childrenString === '[object Object]' ? 'object with keys {' + Object.keys(children).join(', ') + '}' : childrenString) + "). " + 'If you meant to render a collection of children, use an array ' + 'instead.');
|
|
1230
|
+
}
|
|
1231
|
+
}
|
|
1232
|
+
return subtreeCount;
|
|
1233
|
+
}
|
|
1234
|
+
/**
|
|
1235
|
+
* Maps children that are typically specified as `props.children`.
|
|
1236
|
+
*
|
|
1237
|
+
* See https://reactjs.org/docs/react-api.html#reactchildrenmap
|
|
1238
|
+
*
|
|
1239
|
+
* The provided mapFunction(child, index) will be called for each
|
|
1240
|
+
* leaf child.
|
|
1241
|
+
*
|
|
1242
|
+
* @param {?*} children Children tree container.
|
|
1243
|
+
* @param {function(*, int)} func The map function.
|
|
1244
|
+
* @param {*} context Context for mapFunction.
|
|
1245
|
+
* @return {object} Object containing the ordered map of results.
|
|
1246
|
+
*/ function mapChildren(children, func, context) {
|
|
1247
|
+
if (children == null) {
|
|
1248
|
+
return children;
|
|
805
1249
|
}
|
|
806
1250
|
var result = [];
|
|
807
1251
|
var count = 0;
|
|
808
|
-
mapIntoArray(children, result,
|
|
1252
|
+
mapIntoArray(children, result, '', '', function(child) {
|
|
809
1253
|
return func.call(context, child, count++);
|
|
810
1254
|
});
|
|
811
1255
|
return result;
|
|
812
|
-
}
|
|
813
|
-
|
|
1256
|
+
}
|
|
1257
|
+
/**
|
|
814
1258
|
* Count the number of children that are typically specified as
|
|
815
1259
|
* `props.children`.
|
|
816
1260
|
*
|
|
@@ -824,8 +1268,8 @@ function requireReact_development() {
|
|
|
824
1268
|
n++; // Don't return anything
|
|
825
1269
|
});
|
|
826
1270
|
return n;
|
|
827
|
-
}
|
|
828
|
-
|
|
1271
|
+
}
|
|
1272
|
+
/**
|
|
829
1273
|
* Iterates through children that are typically specified as `props.children`.
|
|
830
1274
|
*
|
|
831
1275
|
* See https://reactjs.org/docs/react-api.html#reactchildrenforeach
|
|
@@ -840,8 +1284,8 @@ function requireReact_development() {
|
|
|
840
1284
|
mapChildren(children, function() {
|
|
841
1285
|
forEachFunc.apply(this, arguments); // Don't return anything.
|
|
842
1286
|
}, forEachContext);
|
|
843
|
-
}
|
|
844
|
-
|
|
1287
|
+
}
|
|
1288
|
+
/**
|
|
845
1289
|
* Flatten a children object (typically specified as `props.children`) and
|
|
846
1290
|
* return an array with appropriately re-keyed children.
|
|
847
1291
|
*
|
|
@@ -850,8 +1294,8 @@ function requireReact_development() {
|
|
|
850
1294
|
return mapChildren(children, function(child) {
|
|
851
1295
|
return child;
|
|
852
1296
|
}) || [];
|
|
853
|
-
}
|
|
854
|
-
|
|
1297
|
+
}
|
|
1298
|
+
/**
|
|
855
1299
|
* Returns the first child in a collection of children and verifies that there
|
|
856
1300
|
* is only one child in the collection.
|
|
857
1301
|
*
|
|
@@ -866,11 +1310,11 @@ function requireReact_development() {
|
|
|
866
1310
|
* structure.
|
|
867
1311
|
*/ function onlyChild(children) {
|
|
868
1312
|
if (!isValidElement(children)) {
|
|
869
|
-
throw new Error(
|
|
1313
|
+
throw new Error('React.Children.only expected to receive a single React element child.');
|
|
870
1314
|
}
|
|
871
1315
|
return children;
|
|
872
|
-
}
|
|
873
|
-
|
|
1316
|
+
}
|
|
1317
|
+
function createContext(defaultValue) {
|
|
874
1318
|
// TODO: Second argument used to be an optional `calculateChangedBits`
|
|
875
1319
|
// function. Warn to reserve for future use?
|
|
876
1320
|
var context = {
|
|
@@ -909,57 +1353,57 @@ function requireReact_development() {
|
|
|
909
1353
|
}; // $FlowFixMe: Flow complains about not setting a value, which is intentional here
|
|
910
1354
|
Object.defineProperties(Consumer, {
|
|
911
1355
|
Provider: {
|
|
912
|
-
get: function
|
|
1356
|
+
get: function() {
|
|
913
1357
|
if (!hasWarnedAboutUsingConsumerProvider) {
|
|
914
1358
|
hasWarnedAboutUsingConsumerProvider = true;
|
|
915
|
-
error(
|
|
1359
|
+
error('Rendering <Context.Consumer.Provider> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Provider> instead?');
|
|
916
1360
|
}
|
|
917
1361
|
return context.Provider;
|
|
918
1362
|
},
|
|
919
|
-
set: function
|
|
1363
|
+
set: function(_Provider) {
|
|
920
1364
|
context.Provider = _Provider;
|
|
921
1365
|
}
|
|
922
1366
|
},
|
|
923
1367
|
_currentValue: {
|
|
924
|
-
get: function
|
|
1368
|
+
get: function() {
|
|
925
1369
|
return context._currentValue;
|
|
926
1370
|
},
|
|
927
|
-
set: function
|
|
1371
|
+
set: function(_currentValue) {
|
|
928
1372
|
context._currentValue = _currentValue;
|
|
929
1373
|
}
|
|
930
1374
|
},
|
|
931
1375
|
_currentValue2: {
|
|
932
|
-
get: function
|
|
1376
|
+
get: function() {
|
|
933
1377
|
return context._currentValue2;
|
|
934
1378
|
},
|
|
935
|
-
set: function
|
|
1379
|
+
set: function(_currentValue2) {
|
|
936
1380
|
context._currentValue2 = _currentValue2;
|
|
937
1381
|
}
|
|
938
1382
|
},
|
|
939
1383
|
_threadCount: {
|
|
940
|
-
get: function
|
|
1384
|
+
get: function() {
|
|
941
1385
|
return context._threadCount;
|
|
942
1386
|
},
|
|
943
|
-
set: function
|
|
1387
|
+
set: function(_threadCount) {
|
|
944
1388
|
context._threadCount = _threadCount;
|
|
945
1389
|
}
|
|
946
1390
|
},
|
|
947
1391
|
Consumer: {
|
|
948
|
-
get: function
|
|
1392
|
+
get: function() {
|
|
949
1393
|
if (!hasWarnedAboutUsingNestedContextConsumers) {
|
|
950
1394
|
hasWarnedAboutUsingNestedContextConsumers = true;
|
|
951
|
-
error(
|
|
1395
|
+
error('Rendering <Context.Consumer.Consumer> is not supported and will be removed in ' + 'a future major release. Did you mean to render <Context.Consumer> instead?');
|
|
952
1396
|
}
|
|
953
1397
|
return context.Consumer;
|
|
954
1398
|
}
|
|
955
1399
|
},
|
|
956
1400
|
displayName: {
|
|
957
|
-
get: function
|
|
1401
|
+
get: function() {
|
|
958
1402
|
return context.displayName;
|
|
959
1403
|
},
|
|
960
|
-
set: function
|
|
1404
|
+
set: function(displayName) {
|
|
961
1405
|
if (!hasWarnedAboutDisplayNameOnConsumer) {
|
|
962
|
-
warn(
|
|
1406
|
+
warn('Setting `displayName` on Context.Consumer has no effect. ' + "You should set it directly on the context with Context.displayName = '%s'.", displayName);
|
|
963
1407
|
hasWarnedAboutDisplayNameOnConsumer = true;
|
|
964
1408
|
}
|
|
965
1409
|
}
|
|
@@ -972,8 +1416,12 @@ function requireReact_development() {
|
|
|
972
1416
|
context._currentRenderer2 = null;
|
|
973
1417
|
}
|
|
974
1418
|
return context;
|
|
975
|
-
}
|
|
976
|
-
var
|
|
1419
|
+
}
|
|
1420
|
+
var Uninitialized = -1;
|
|
1421
|
+
var Pending = 0;
|
|
1422
|
+
var Resolved = 1;
|
|
1423
|
+
var Rejected = 2;
|
|
1424
|
+
function lazyInitializer(payload) {
|
|
977
1425
|
if (payload._status === Uninitialized) {
|
|
978
1426
|
var ctor = payload._result;
|
|
979
1427
|
var thenable = ctor(); // Transition to the next state.
|
|
@@ -1008,22 +1456,22 @@ function requireReact_development() {
|
|
|
1008
1456
|
var moduleObject = payload._result;
|
|
1009
1457
|
{
|
|
1010
1458
|
if (moduleObject === undefined) {
|
|
1011
|
-
error(
|
|
1012
|
-
|
|
1459
|
+
error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1460
|
+
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))\n\n" + 'Did you accidentally put curly braces around the import?', moduleObject);
|
|
1013
1461
|
}
|
|
1014
1462
|
}
|
|
1015
1463
|
{
|
|
1016
|
-
if (!(
|
|
1017
|
-
error(
|
|
1018
|
-
|
|
1464
|
+
if (!('default' in moduleObject)) {
|
|
1465
|
+
error('lazy: Expected the result of a dynamic imp' + 'ort() call. ' + 'Instead received: %s\n\nYour code should look like: \n ' + // Break up imports to avoid accidentally parsing them as dependencies.
|
|
1466
|
+
'const MyComponent = lazy(() => imp' + "ort('./MyComponent'))", moduleObject);
|
|
1019
1467
|
}
|
|
1020
1468
|
}
|
|
1021
1469
|
return moduleObject.default;
|
|
1022
1470
|
} else {
|
|
1023
1471
|
throw payload._result;
|
|
1024
1472
|
}
|
|
1025
|
-
}
|
|
1026
|
-
|
|
1473
|
+
}
|
|
1474
|
+
function lazy(ctor) {
|
|
1027
1475
|
var payload = {
|
|
1028
1476
|
// We use these fields to store the result.
|
|
1029
1477
|
_status: Uninitialized,
|
|
@@ -1041,28 +1489,28 @@ function requireReact_development() {
|
|
|
1041
1489
|
Object.defineProperties(lazyType, {
|
|
1042
1490
|
defaultProps: {
|
|
1043
1491
|
configurable: true,
|
|
1044
|
-
get: function
|
|
1492
|
+
get: function() {
|
|
1045
1493
|
return defaultProps;
|
|
1046
1494
|
},
|
|
1047
|
-
set: function
|
|
1048
|
-
error(
|
|
1495
|
+
set: function(newDefaultProps) {
|
|
1496
|
+
error('React.lazy(...): It is not supported to assign `defaultProps` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
1049
1497
|
defaultProps = newDefaultProps; // Match production behavior more closely:
|
|
1050
1498
|
// $FlowFixMe
|
|
1051
|
-
Object.defineProperty(lazyType,
|
|
1499
|
+
Object.defineProperty(lazyType, 'defaultProps', {
|
|
1052
1500
|
enumerable: true
|
|
1053
1501
|
});
|
|
1054
1502
|
}
|
|
1055
1503
|
},
|
|
1056
1504
|
propTypes: {
|
|
1057
1505
|
configurable: true,
|
|
1058
|
-
get: function
|
|
1506
|
+
get: function() {
|
|
1059
1507
|
return propTypes;
|
|
1060
1508
|
},
|
|
1061
|
-
set: function
|
|
1062
|
-
error(
|
|
1509
|
+
set: function(newPropTypes) {
|
|
1510
|
+
error('React.lazy(...): It is not supported to assign `propTypes` to ' + 'a lazy component import. Either specify them where the component ' + 'is defined, or create a wrapping component around it.');
|
|
1063
1511
|
propTypes = newPropTypes; // Match production behavior more closely:
|
|
1064
1512
|
// $FlowFixMe
|
|
1065
|
-
Object.defineProperty(lazyType,
|
|
1513
|
+
Object.defineProperty(lazyType, 'propTypes', {
|
|
1066
1514
|
enumerable: true
|
|
1067
1515
|
});
|
|
1068
1516
|
}
|
|
@@ -1070,21 +1518,21 @@ function requireReact_development() {
|
|
|
1070
1518
|
});
|
|
1071
1519
|
}
|
|
1072
1520
|
return lazyType;
|
|
1073
|
-
}
|
|
1074
|
-
|
|
1521
|
+
}
|
|
1522
|
+
function forwardRef(render) {
|
|
1075
1523
|
{
|
|
1076
1524
|
if (render != null && render.$$typeof === REACT_MEMO_TYPE) {
|
|
1077
|
-
error(
|
|
1078
|
-
} else if (typeof render !==
|
|
1079
|
-
error(
|
|
1525
|
+
error('forwardRef requires a render function but received a `memo` ' + 'component. Instead of forwardRef(memo(...)), use ' + 'memo(forwardRef(...)).');
|
|
1526
|
+
} else if (typeof render !== 'function') {
|
|
1527
|
+
error('forwardRef requires a render function but was given %s.', render === null ? 'null' : typeof render);
|
|
1080
1528
|
} else {
|
|
1081
1529
|
if (render.length !== 0 && render.length !== 2) {
|
|
1082
|
-
error(
|
|
1530
|
+
error('forwardRef render functions accept exactly two parameters: props and ref. %s', render.length === 1 ? 'Did you forget to use the ref parameter?' : 'Any additional parameter will be undefined.');
|
|
1083
1531
|
}
|
|
1084
1532
|
}
|
|
1085
1533
|
if (render != null) {
|
|
1086
1534
|
if (render.defaultProps != null || render.propTypes != null) {
|
|
1087
|
-
error(
|
|
1535
|
+
error('forwardRef render functions do not support propTypes or defaultProps. ' + 'Did you accidentally pass a React component?');
|
|
1088
1536
|
}
|
|
1089
1537
|
}
|
|
1090
1538
|
}
|
|
@@ -1094,13 +1542,13 @@ function requireReact_development() {
|
|
|
1094
1542
|
};
|
|
1095
1543
|
{
|
|
1096
1544
|
var ownName;
|
|
1097
|
-
Object.defineProperty(elementType,
|
|
1545
|
+
Object.defineProperty(elementType, 'displayName', {
|
|
1098
1546
|
enumerable: false,
|
|
1099
1547
|
configurable: true,
|
|
1100
|
-
get: function
|
|
1548
|
+
get: function() {
|
|
1101
1549
|
return ownName;
|
|
1102
1550
|
},
|
|
1103
|
-
set: function
|
|
1551
|
+
set: function(name) {
|
|
1104
1552
|
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
|
1105
1553
|
// because the component may be used elsewhere.
|
|
1106
1554
|
// But it's nice for anonymous functions to inherit the name,
|
|
@@ -1115,15 +1563,19 @@ function requireReact_development() {
|
|
|
1115
1563
|
});
|
|
1116
1564
|
}
|
|
1117
1565
|
return elementType;
|
|
1118
|
-
}
|
|
1119
|
-
var
|
|
1120
|
-
|
|
1566
|
+
}
|
|
1567
|
+
var REACT_MODULE_REFERENCE;
|
|
1568
|
+
{
|
|
1569
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
1570
|
+
}
|
|
1571
|
+
function isValidElementType(type) {
|
|
1572
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
1121
1573
|
return true;
|
|
1122
1574
|
} // Note: typeof might be other than 'symbol' or 'number' (e.g. if it's a polyfill).
|
|
1123
1575
|
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) {
|
|
1124
1576
|
return true;
|
|
1125
1577
|
}
|
|
1126
|
-
if (typeof type ===
|
|
1578
|
+
if (typeof type === 'object' && type !== null) {
|
|
1127
1579
|
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
|
|
1128
1580
|
// types supported by any Flight configuration anywhere since
|
|
1129
1581
|
// we don't know which Flight build this will end up being used
|
|
@@ -1133,11 +1585,11 @@ function requireReact_development() {
|
|
|
1133
1585
|
}
|
|
1134
1586
|
}
|
|
1135
1587
|
return false;
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1588
|
+
}
|
|
1589
|
+
function memo(type, compare) {
|
|
1138
1590
|
{
|
|
1139
1591
|
if (!isValidElementType(type)) {
|
|
1140
|
-
error(
|
|
1592
|
+
error('memo: The first argument must be a component. Instead ' + 'received: %s', type === null ? 'null' : typeof type);
|
|
1141
1593
|
}
|
|
1142
1594
|
}
|
|
1143
1595
|
var elementType = {
|
|
@@ -1147,13 +1599,13 @@ function requireReact_development() {
|
|
|
1147
1599
|
};
|
|
1148
1600
|
{
|
|
1149
1601
|
var ownName;
|
|
1150
|
-
Object.defineProperty(elementType,
|
|
1602
|
+
Object.defineProperty(elementType, 'displayName', {
|
|
1151
1603
|
enumerable: false,
|
|
1152
1604
|
configurable: true,
|
|
1153
|
-
get: function
|
|
1605
|
+
get: function() {
|
|
1154
1606
|
return ownName;
|
|
1155
1607
|
},
|
|
1156
|
-
set: function
|
|
1608
|
+
set: function(name) {
|
|
1157
1609
|
ownName = name; // The inner component shouldn't inherit this display name in most cases,
|
|
1158
1610
|
// because the component may be used elsewhere.
|
|
1159
1611
|
// But it's nice for anonymous functions to inherit the name,
|
|
@@ -1168,19 +1620,19 @@ function requireReact_development() {
|
|
|
1168
1620
|
});
|
|
1169
1621
|
}
|
|
1170
1622
|
return elementType;
|
|
1171
|
-
}
|
|
1172
|
-
|
|
1623
|
+
}
|
|
1624
|
+
function resolveDispatcher() {
|
|
1173
1625
|
var dispatcher = ReactCurrentDispatcher.current;
|
|
1174
1626
|
{
|
|
1175
1627
|
if (dispatcher === null) {
|
|
1176
|
-
error(
|
|
1628
|
+
error('Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for' + ' one of the following reasons:\n' + '1. You might have mismatching versions of React and the renderer (such as React DOM)\n' + '2. You might be breaking the Rules of Hooks\n' + '3. You might have more than one copy of React in the same app\n' + 'See https://reactjs.org/link/invalid-hook-call for tips about how to debug and fix this problem.');
|
|
1177
1629
|
}
|
|
1178
1630
|
}
|
|
1179
1631
|
// intentionally don't throw our own error because this is in a hot path.
|
|
1180
1632
|
// Also helps ensure this is inlined.
|
|
1181
1633
|
return dispatcher;
|
|
1182
|
-
}
|
|
1183
|
-
|
|
1634
|
+
}
|
|
1635
|
+
function useContext(Context) {
|
|
1184
1636
|
var dispatcher = resolveDispatcher();
|
|
1185
1637
|
{
|
|
1186
1638
|
// TODO: add a more generic warning for invalid values.
|
|
@@ -1188,74 +1640,87 @@ function requireReact_development() {
|
|
|
1188
1640
|
var realContext = Context._context; // Don't deduplicate because this legitimately causes bugs
|
|
1189
1641
|
// and nobody should be using this in existing code.
|
|
1190
1642
|
if (realContext.Consumer === Context) {
|
|
1191
|
-
error(
|
|
1643
|
+
error('Calling useContext(Context.Consumer) is not supported, may cause bugs, and will be ' + 'removed in a future major release. Did you mean to call useContext(Context) instead?');
|
|
1192
1644
|
} else if (realContext.Provider === Context) {
|
|
1193
|
-
error(
|
|
1645
|
+
error('Calling useContext(Context.Provider) is not supported. ' + 'Did you mean to call useContext(Context) instead?');
|
|
1194
1646
|
}
|
|
1195
1647
|
}
|
|
1196
1648
|
}
|
|
1197
1649
|
return dispatcher.useContext(Context);
|
|
1198
|
-
}
|
|
1199
|
-
|
|
1650
|
+
}
|
|
1651
|
+
function useState(initialState) {
|
|
1200
1652
|
var dispatcher = resolveDispatcher();
|
|
1201
1653
|
return dispatcher.useState(initialState);
|
|
1202
|
-
}
|
|
1203
|
-
|
|
1654
|
+
}
|
|
1655
|
+
function useReducer(reducer, initialArg, init) {
|
|
1204
1656
|
var dispatcher = resolveDispatcher();
|
|
1205
1657
|
return dispatcher.useReducer(reducer, initialArg, init);
|
|
1206
|
-
}
|
|
1207
|
-
|
|
1658
|
+
}
|
|
1659
|
+
function useRef(initialValue) {
|
|
1208
1660
|
var dispatcher = resolveDispatcher();
|
|
1209
1661
|
return dispatcher.useRef(initialValue);
|
|
1210
|
-
}
|
|
1211
|
-
|
|
1662
|
+
}
|
|
1663
|
+
function useEffect(create, deps) {
|
|
1212
1664
|
var dispatcher = resolveDispatcher();
|
|
1213
1665
|
return dispatcher.useEffect(create, deps);
|
|
1214
|
-
}
|
|
1215
|
-
|
|
1666
|
+
}
|
|
1667
|
+
function useInsertionEffect(create, deps) {
|
|
1216
1668
|
var dispatcher = resolveDispatcher();
|
|
1217
1669
|
return dispatcher.useInsertionEffect(create, deps);
|
|
1218
|
-
}
|
|
1219
|
-
|
|
1670
|
+
}
|
|
1671
|
+
function useLayoutEffect(create, deps) {
|
|
1220
1672
|
var dispatcher = resolveDispatcher();
|
|
1221
1673
|
return dispatcher.useLayoutEffect(create, deps);
|
|
1222
|
-
}
|
|
1223
|
-
|
|
1674
|
+
}
|
|
1675
|
+
function useCallback(callback, deps) {
|
|
1224
1676
|
var dispatcher = resolveDispatcher();
|
|
1225
1677
|
return dispatcher.useCallback(callback, deps);
|
|
1226
|
-
}
|
|
1227
|
-
|
|
1678
|
+
}
|
|
1679
|
+
function useMemo(create, deps) {
|
|
1228
1680
|
var dispatcher = resolveDispatcher();
|
|
1229
1681
|
return dispatcher.useMemo(create, deps);
|
|
1230
|
-
}
|
|
1231
|
-
|
|
1682
|
+
}
|
|
1683
|
+
function useImperativeHandle(ref, create, deps) {
|
|
1232
1684
|
var dispatcher = resolveDispatcher();
|
|
1233
1685
|
return dispatcher.useImperativeHandle(ref, create, deps);
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1686
|
+
}
|
|
1687
|
+
function useDebugValue(value, formatterFn) {
|
|
1236
1688
|
{
|
|
1237
1689
|
var dispatcher = resolveDispatcher();
|
|
1238
1690
|
return dispatcher.useDebugValue(value, formatterFn);
|
|
1239
1691
|
}
|
|
1240
|
-
}
|
|
1241
|
-
|
|
1692
|
+
}
|
|
1693
|
+
function useTransition() {
|
|
1242
1694
|
var dispatcher = resolveDispatcher();
|
|
1243
1695
|
return dispatcher.useTransition();
|
|
1244
|
-
}
|
|
1245
|
-
|
|
1696
|
+
}
|
|
1697
|
+
function useDeferredValue(value) {
|
|
1246
1698
|
var dispatcher = resolveDispatcher();
|
|
1247
1699
|
return dispatcher.useDeferredValue(value);
|
|
1248
|
-
}
|
|
1249
|
-
|
|
1700
|
+
}
|
|
1701
|
+
function useId() {
|
|
1250
1702
|
var dispatcher = resolveDispatcher();
|
|
1251
1703
|
return dispatcher.useId();
|
|
1252
|
-
}
|
|
1253
|
-
|
|
1704
|
+
}
|
|
1705
|
+
function useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot) {
|
|
1254
1706
|
var dispatcher = resolveDispatcher();
|
|
1255
1707
|
return dispatcher.useSyncExternalStore(subscribe, getSnapshot, getServerSnapshot);
|
|
1256
|
-
}
|
|
1257
|
-
|
|
1258
|
-
|
|
1708
|
+
}
|
|
1709
|
+
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
1710
|
+
// replaying on render function. This currently only patches the object
|
|
1711
|
+
// lazily which won't cover if the log function was extracted eagerly.
|
|
1712
|
+
// We could also eagerly patch the method.
|
|
1713
|
+
var disabledDepth = 0;
|
|
1714
|
+
var prevLog;
|
|
1715
|
+
var prevInfo;
|
|
1716
|
+
var prevWarn;
|
|
1717
|
+
var prevError;
|
|
1718
|
+
var prevGroup;
|
|
1719
|
+
var prevGroupCollapsed;
|
|
1720
|
+
var prevGroupEnd;
|
|
1721
|
+
function disabledLog() {}
|
|
1722
|
+
disabledLog.__reactDisabledLog = true;
|
|
1723
|
+
function disableLogs() {
|
|
1259
1724
|
{
|
|
1260
1725
|
if (disabledDepth === 0) {
|
|
1261
1726
|
/* eslint-disable react-internal/no-production-logging */ prevLog = console.log;
|
|
@@ -1283,8 +1748,8 @@ function requireReact_development() {
|
|
|
1283
1748
|
/* eslint-enable react-internal/no-production-logging */ }
|
|
1284
1749
|
disabledDepth++;
|
|
1285
1750
|
}
|
|
1286
|
-
}
|
|
1287
|
-
|
|
1751
|
+
}
|
|
1752
|
+
function reenableLogs() {
|
|
1288
1753
|
{
|
|
1289
1754
|
disabledDepth--;
|
|
1290
1755
|
if (disabledDepth === 0) {
|
|
@@ -1318,11 +1783,13 @@ function requireReact_development() {
|
|
|
1318
1783
|
});
|
|
1319
1784
|
/* eslint-enable react-internal/no-production-logging */ }
|
|
1320
1785
|
if (disabledDepth < 0) {
|
|
1321
|
-
error(
|
|
1786
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
1322
1787
|
}
|
|
1323
1788
|
}
|
|
1324
|
-
}
|
|
1325
|
-
var
|
|
1789
|
+
}
|
|
1790
|
+
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
1791
|
+
var prefix;
|
|
1792
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
1326
1793
|
{
|
|
1327
1794
|
if (prefix === undefined) {
|
|
1328
1795
|
// Extract the VM specific prefix used by each line.
|
|
@@ -1330,16 +1797,22 @@ function requireReact_development() {
|
|
|
1330
1797
|
throw Error();
|
|
1331
1798
|
} catch (x) {
|
|
1332
1799
|
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
1333
|
-
prefix = match && match[1] ||
|
|
1800
|
+
prefix = match && match[1] || '';
|
|
1334
1801
|
}
|
|
1335
1802
|
} // We use the prefix to ensure our stacks line up with native stack frames.
|
|
1336
|
-
return
|
|
1803
|
+
return '\n' + prefix + name;
|
|
1337
1804
|
}
|
|
1338
|
-
}
|
|
1339
|
-
var
|
|
1805
|
+
}
|
|
1806
|
+
var reentry = false;
|
|
1807
|
+
var componentFrameCache;
|
|
1808
|
+
{
|
|
1809
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
1810
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
1811
|
+
}
|
|
1812
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
1340
1813
|
// If something asked for a stack inside a fake render, it should get ignored.
|
|
1341
1814
|
if (!fn || reentry) {
|
|
1342
|
-
return
|
|
1815
|
+
return '';
|
|
1343
1816
|
}
|
|
1344
1817
|
{
|
|
1345
1818
|
var frame = componentFrameCache.get(fn);
|
|
@@ -1362,17 +1835,17 @@ function requireReact_development() {
|
|
|
1362
1835
|
// This should throw.
|
|
1363
1836
|
if (construct) {
|
|
1364
1837
|
// Something should be setting the props in the constructor.
|
|
1365
|
-
var Fake = function
|
|
1838
|
+
var Fake = function() {
|
|
1366
1839
|
throw Error();
|
|
1367
1840
|
}; // $FlowFixMe
|
|
1368
|
-
Object.defineProperty(Fake.prototype,
|
|
1369
|
-
set: function
|
|
1841
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
1842
|
+
set: function() {
|
|
1370
1843
|
// We use a throwing setter instead of frozen or non-writable props
|
|
1371
1844
|
// because that won't throw in a non-strict mode function.
|
|
1372
1845
|
throw Error();
|
|
1373
1846
|
}
|
|
1374
1847
|
});
|
|
1375
|
-
if (typeof Reflect ===
|
|
1848
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
1376
1849
|
// We construct a different control for this case to include any extra
|
|
1377
1850
|
// frames added by the construct call.
|
|
1378
1851
|
try {
|
|
@@ -1384,26 +1857,26 @@ function requireReact_development() {
|
|
|
1384
1857
|
} else {
|
|
1385
1858
|
try {
|
|
1386
1859
|
Fake.call();
|
|
1387
|
-
} catch (
|
|
1388
|
-
control =
|
|
1860
|
+
} catch (x) {
|
|
1861
|
+
control = x;
|
|
1389
1862
|
}
|
|
1390
1863
|
fn.call(Fake.prototype);
|
|
1391
1864
|
}
|
|
1392
1865
|
} else {
|
|
1393
1866
|
try {
|
|
1394
1867
|
throw Error();
|
|
1395
|
-
} catch (
|
|
1396
|
-
control =
|
|
1868
|
+
} catch (x) {
|
|
1869
|
+
control = x;
|
|
1397
1870
|
}
|
|
1398
1871
|
fn();
|
|
1399
1872
|
}
|
|
1400
1873
|
} catch (sample) {
|
|
1401
1874
|
// This is inlined manually because closure doesn't do it for us.
|
|
1402
|
-
if (sample && control && typeof sample.stack ===
|
|
1875
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
1403
1876
|
// This extracts the first frame from the sample that isn't also in the control.
|
|
1404
1877
|
// Skipping one frame that we assume is the frame that calls the two.
|
|
1405
|
-
var sampleLines = sample.stack.split(
|
|
1406
|
-
var controlLines = control.stack.split(
|
|
1878
|
+
var sampleLines = sample.stack.split('\n');
|
|
1879
|
+
var controlLines = control.stack.split('\n');
|
|
1407
1880
|
var s = sampleLines.length - 1;
|
|
1408
1881
|
var c = controlLines.length - 1;
|
|
1409
1882
|
while(s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]){
|
|
@@ -1431,20 +1904,20 @@ function requireReact_development() {
|
|
|
1431
1904
|
// The next one that isn't the same should be our match though.
|
|
1432
1905
|
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
1433
1906
|
// V8 adds a "new" prefix for native classes. Let's remove it to make it prettier.
|
|
1434
|
-
var _frame =
|
|
1907
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at '); // If our component frame is labeled "<anonymous>"
|
|
1435
1908
|
// but we have a user-provided "displayName"
|
|
1436
1909
|
// splice it in to make the stack more readable.
|
|
1437
|
-
if (fn.displayName && _frame.includes(
|
|
1438
|
-
_frame = _frame.replace(
|
|
1910
|
+
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
1911
|
+
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
1439
1912
|
}
|
|
1440
1913
|
{
|
|
1441
|
-
if (typeof fn ===
|
|
1914
|
+
if (typeof fn === 'function') {
|
|
1442
1915
|
componentFrameCache.set(fn, _frame);
|
|
1443
1916
|
}
|
|
1444
1917
|
}
|
|
1445
1918
|
return _frame;
|
|
1446
1919
|
}
|
|
1447
|
-
}while (s >= 1 && c >= 0)
|
|
1920
|
+
}while (s >= 1 && c >= 0)
|
|
1448
1921
|
}
|
|
1449
1922
|
break;
|
|
1450
1923
|
}
|
|
@@ -1458,25 +1931,66 @@ function requireReact_development() {
|
|
|
1458
1931
|
}
|
|
1459
1932
|
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
1460
1933
|
} // Fallback to just using the name if we couldn't make it throw.
|
|
1461
|
-
var name = fn ? fn.displayName || fn.name :
|
|
1462
|
-
var syntheticFrame = name ? describeBuiltInComponentFrame(name) :
|
|
1934
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
1935
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
1463
1936
|
{
|
|
1464
|
-
if (typeof fn ===
|
|
1937
|
+
if (typeof fn === 'function') {
|
|
1465
1938
|
componentFrameCache.set(fn, syntheticFrame);
|
|
1466
1939
|
}
|
|
1467
1940
|
}
|
|
1468
1941
|
return syntheticFrame;
|
|
1469
|
-
}
|
|
1470
|
-
|
|
1942
|
+
}
|
|
1943
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
1471
1944
|
{
|
|
1472
1945
|
return describeNativeComponentFrame(fn, false);
|
|
1473
1946
|
}
|
|
1474
|
-
}
|
|
1475
|
-
|
|
1947
|
+
}
|
|
1948
|
+
function shouldConstruct(Component) {
|
|
1476
1949
|
var prototype = Component.prototype;
|
|
1477
1950
|
return !!(prototype && prototype.isReactComponent);
|
|
1478
|
-
}
|
|
1479
|
-
|
|
1951
|
+
}
|
|
1952
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
1953
|
+
if (type == null) {
|
|
1954
|
+
return '';
|
|
1955
|
+
}
|
|
1956
|
+
if (typeof type === 'function') {
|
|
1957
|
+
{
|
|
1958
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
1959
|
+
}
|
|
1960
|
+
}
|
|
1961
|
+
if (typeof type === 'string') {
|
|
1962
|
+
return describeBuiltInComponentFrame(type);
|
|
1963
|
+
}
|
|
1964
|
+
switch(type){
|
|
1965
|
+
case REACT_SUSPENSE_TYPE:
|
|
1966
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
1967
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
1968
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
1969
|
+
}
|
|
1970
|
+
if (typeof type === 'object') {
|
|
1971
|
+
switch(type.$$typeof){
|
|
1972
|
+
case REACT_FORWARD_REF_TYPE:
|
|
1973
|
+
return describeFunctionComponentFrame(type.render);
|
|
1974
|
+
case REACT_MEMO_TYPE:
|
|
1975
|
+
// Memo may contain any component type so we recursively resolve it.
|
|
1976
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
1977
|
+
case REACT_LAZY_TYPE:
|
|
1978
|
+
{
|
|
1979
|
+
var lazyComponent = type;
|
|
1980
|
+
var payload = lazyComponent._payload;
|
|
1981
|
+
var init = lazyComponent._init;
|
|
1982
|
+
try {
|
|
1983
|
+
// Lazy may contain any component type so we recursively resolve it.
|
|
1984
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
1985
|
+
} catch (x) {}
|
|
1986
|
+
}
|
|
1987
|
+
}
|
|
1988
|
+
}
|
|
1989
|
+
return '';
|
|
1990
|
+
}
|
|
1991
|
+
var loggedTypeFailures = {};
|
|
1992
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
1993
|
+
function setCurrentlyValidatingElement(element) {
|
|
1480
1994
|
{
|
|
1481
1995
|
if (element) {
|
|
1482
1996
|
var owner = element._owner;
|
|
@@ -1486,8 +2000,8 @@ function requireReact_development() {
|
|
|
1486
2000
|
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
1487
2001
|
}
|
|
1488
2002
|
}
|
|
1489
|
-
}
|
|
1490
|
-
|
|
2003
|
+
}
|
|
2004
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
1491
2005
|
{
|
|
1492
2006
|
// $FlowFixMe This is okay but Flow doesn't know it.
|
|
1493
2007
|
var has = Function.call.bind(hasOwnProperty);
|
|
@@ -1499,34 +2013,34 @@ function requireReact_development() {
|
|
|
1499
2013
|
try {
|
|
1500
2014
|
// This is intentionally an invariant that gets caught. It's the same
|
|
1501
2015
|
// behavior as without this statement except with a better message.
|
|
1502
|
-
if (typeof typeSpecs[typeSpecName] !==
|
|
2016
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
1503
2017
|
// eslint-disable-next-line react-internal/prod-error-codes
|
|
1504
|
-
var err = Error((componentName ||
|
|
1505
|
-
err.name =
|
|
2018
|
+
var err = Error((componentName || 'React class') + ': ' + location + ' type `' + typeSpecName + '` is invalid; ' + 'it must be a function, usually from the `prop-types` package, but received `' + typeof typeSpecs[typeSpecName] + '`.' + 'This often happens because of typos such as `PropTypes.function` instead of `PropTypes.func`.');
|
|
2019
|
+
err.name = 'Invariant Violation';
|
|
1506
2020
|
throw err;
|
|
1507
2021
|
}
|
|
1508
|
-
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null,
|
|
2022
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
1509
2023
|
} catch (ex) {
|
|
1510
2024
|
error$1 = ex;
|
|
1511
2025
|
}
|
|
1512
|
-
if (error$1 && !
|
|
2026
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
1513
2027
|
setCurrentlyValidatingElement(element);
|
|
1514
|
-
error(
|
|
2028
|
+
error('%s: type specification of %s' + ' `%s` is invalid; the type checker ' + 'function must return `null` or an `Error` but returned a %s. ' + 'You may have forgotten to pass an argument to the type checker ' + 'creator (arrayOf, instanceOf, objectOf, oneOf, oneOfType, and ' + 'shape all require an argument).', componentName || 'React class', location, typeSpecName, typeof error$1);
|
|
1515
2029
|
setCurrentlyValidatingElement(null);
|
|
1516
2030
|
}
|
|
1517
|
-
if (
|
|
2031
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
1518
2032
|
// Only monitor this failure once because there tends to be a lot of the
|
|
1519
2033
|
// same error.
|
|
1520
2034
|
loggedTypeFailures[error$1.message] = true;
|
|
1521
2035
|
setCurrentlyValidatingElement(element);
|
|
1522
|
-
error(
|
|
2036
|
+
error('Failed %s type: %s', location, error$1.message);
|
|
1523
2037
|
setCurrentlyValidatingElement(null);
|
|
1524
2038
|
}
|
|
1525
2039
|
}
|
|
1526
2040
|
}
|
|
1527
2041
|
}
|
|
1528
|
-
}
|
|
1529
|
-
|
|
2042
|
+
}
|
|
2043
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
1530
2044
|
{
|
|
1531
2045
|
if (element) {
|
|
1532
2046
|
var owner = element._owner;
|
|
@@ -1536,41 +2050,50 @@ function requireReact_development() {
|
|
|
1536
2050
|
setExtraStackFrame(null);
|
|
1537
2051
|
}
|
|
1538
2052
|
}
|
|
1539
|
-
}
|
|
1540
|
-
var
|
|
2053
|
+
}
|
|
2054
|
+
var propTypesMisspellWarningShown;
|
|
2055
|
+
{
|
|
2056
|
+
propTypesMisspellWarningShown = false;
|
|
2057
|
+
}
|
|
2058
|
+
function getDeclarationErrorAddendum() {
|
|
1541
2059
|
if (ReactCurrentOwner.current) {
|
|
1542
2060
|
var name = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
1543
2061
|
if (name) {
|
|
1544
|
-
return
|
|
2062
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
1545
2063
|
}
|
|
1546
2064
|
}
|
|
1547
|
-
return
|
|
1548
|
-
}
|
|
1549
|
-
|
|
2065
|
+
return '';
|
|
2066
|
+
}
|
|
2067
|
+
function getSourceInfoErrorAddendum(source) {
|
|
1550
2068
|
if (source !== undefined) {
|
|
1551
|
-
var fileName = source.fileName.replace(/^.*[\\\/]/,
|
|
2069
|
+
var fileName = source.fileName.replace(/^.*[\\\/]/, '');
|
|
1552
2070
|
var lineNumber = source.lineNumber;
|
|
1553
|
-
return
|
|
2071
|
+
return '\n\nCheck your code at ' + fileName + ':' + lineNumber + '.';
|
|
1554
2072
|
}
|
|
1555
|
-
return
|
|
1556
|
-
}
|
|
1557
|
-
|
|
2073
|
+
return '';
|
|
2074
|
+
}
|
|
2075
|
+
function getSourceInfoErrorAddendumForProps(elementProps) {
|
|
1558
2076
|
if (elementProps !== null && elementProps !== undefined) {
|
|
1559
2077
|
return getSourceInfoErrorAddendum(elementProps.__source);
|
|
1560
2078
|
}
|
|
1561
|
-
return
|
|
1562
|
-
}
|
|
1563
|
-
|
|
2079
|
+
return '';
|
|
2080
|
+
}
|
|
2081
|
+
/**
|
|
2082
|
+
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
2083
|
+
* object keys are not valid. This allows us to keep track of children between
|
|
2084
|
+
* updates.
|
|
2085
|
+
*/ var ownerHasKeyUseWarning = {};
|
|
2086
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
1564
2087
|
var info = getDeclarationErrorAddendum();
|
|
1565
2088
|
if (!info) {
|
|
1566
|
-
var parentName = typeof parentType ===
|
|
2089
|
+
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
1567
2090
|
if (parentName) {
|
|
1568
2091
|
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
1569
2092
|
}
|
|
1570
2093
|
}
|
|
1571
2094
|
return info;
|
|
1572
|
-
}
|
|
1573
|
-
|
|
2095
|
+
}
|
|
2096
|
+
/**
|
|
1574
2097
|
* Warn if the element doesn't have an explicit key assigned to it.
|
|
1575
2098
|
* This element is in an array. The array could grow and shrink or be
|
|
1576
2099
|
* reordered. All children that haven't already been validated are required to
|
|
@@ -1592,18 +2115,18 @@ function requireReact_development() {
|
|
|
1592
2115
|
ownerHasKeyUseWarning[currentComponentErrorInfo] = true; // Usually the current owner is the offender, but if it accepts children as a
|
|
1593
2116
|
// property, it may be the creator of the child that's responsible for
|
|
1594
2117
|
// assigning it a key.
|
|
1595
|
-
var childOwner =
|
|
2118
|
+
var childOwner = '';
|
|
1596
2119
|
if (element && element._owner && element._owner !== ReactCurrentOwner.current) {
|
|
1597
2120
|
// Give the component that originally created this child.
|
|
1598
2121
|
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
1599
2122
|
}
|
|
1600
2123
|
{
|
|
1601
2124
|
setCurrentlyValidatingElement$1(element);
|
|
1602
|
-
error('Each child in a list should have a unique "key" prop.' +
|
|
2125
|
+
error('Each child in a list should have a unique "key" prop.' + '%s%s See https://reactjs.org/link/warning-keys for more information.', currentComponentErrorInfo, childOwner);
|
|
1603
2126
|
setCurrentlyValidatingElement$1(null);
|
|
1604
2127
|
}
|
|
1605
|
-
}
|
|
1606
|
-
|
|
2128
|
+
}
|
|
2129
|
+
/**
|
|
1607
2130
|
* Ensure that every element either is passed in a static location, in an
|
|
1608
2131
|
* array with an explicit keys property defined, or in an object literal
|
|
1609
2132
|
* with valid key property.
|
|
@@ -1612,7 +2135,7 @@ function requireReact_development() {
|
|
|
1612
2135
|
* @param {ReactNode} node Statically passed child of any type.
|
|
1613
2136
|
* @param {*} parentType node's parent's type.
|
|
1614
2137
|
*/ function validateChildKeys(node, parentType) {
|
|
1615
|
-
if (typeof node !==
|
|
2138
|
+
if (typeof node !== 'object') {
|
|
1616
2139
|
return;
|
|
1617
2140
|
}
|
|
1618
2141
|
if (isArray(node)) {
|
|
@@ -1629,7 +2152,7 @@ function requireReact_development() {
|
|
|
1629
2152
|
}
|
|
1630
2153
|
} else if (node) {
|
|
1631
2154
|
var iteratorFn = getIteratorFn(node);
|
|
1632
|
-
if (typeof iteratorFn ===
|
|
2155
|
+
if (typeof iteratorFn === 'function') {
|
|
1633
2156
|
// Entry iterators used to provide implicit keys,
|
|
1634
2157
|
// but now we print a separate warning for them later.
|
|
1635
2158
|
if (iteratorFn !== node.entries) {
|
|
@@ -1643,8 +2166,8 @@ function requireReact_development() {
|
|
|
1643
2166
|
}
|
|
1644
2167
|
}
|
|
1645
2168
|
}
|
|
1646
|
-
}
|
|
1647
|
-
|
|
2169
|
+
}
|
|
2170
|
+
/**
|
|
1648
2171
|
* Given an element, validate that its props follow the propTypes definition,
|
|
1649
2172
|
* provided by the type.
|
|
1650
2173
|
*
|
|
@@ -1652,13 +2175,13 @@ function requireReact_development() {
|
|
|
1652
2175
|
*/ function validatePropTypes(element) {
|
|
1653
2176
|
{
|
|
1654
2177
|
var type = element.type;
|
|
1655
|
-
if (type === null || type === undefined || typeof type ===
|
|
2178
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
1656
2179
|
return;
|
|
1657
2180
|
}
|
|
1658
2181
|
var propTypes;
|
|
1659
|
-
if (typeof type ===
|
|
2182
|
+
if (typeof type === 'function') {
|
|
1660
2183
|
propTypes = type.propTypes;
|
|
1661
|
-
} else if (typeof type ===
|
|
2184
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE || // Note: Memo only checks outer props here.
|
|
1662
2185
|
// Inner props are checked in the reconciler.
|
|
1663
2186
|
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
1664
2187
|
propTypes = type.propTypes;
|
|
@@ -1668,46 +2191,46 @@ function requireReact_development() {
|
|
|
1668
2191
|
if (propTypes) {
|
|
1669
2192
|
// Intentionally inside to avoid triggering lazy initializers:
|
|
1670
2193
|
var name = getComponentNameFromType(type);
|
|
1671
|
-
checkPropTypes(propTypes, element.props,
|
|
2194
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
1672
2195
|
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
1673
2196
|
propTypesMisspellWarningShown = true; // Intentionally inside to avoid triggering lazy initializers:
|
|
1674
2197
|
var _name = getComponentNameFromType(type);
|
|
1675
|
-
error(
|
|
2198
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
1676
2199
|
}
|
|
1677
|
-
if (typeof type.getDefaultProps ===
|
|
1678
|
-
error(
|
|
2200
|
+
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
2201
|
+
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
1679
2202
|
}
|
|
1680
2203
|
}
|
|
1681
|
-
}
|
|
1682
|
-
|
|
1683
|
-
* Given a fragment, validate that it can only be provided with fragment props
|
|
2204
|
+
}
|
|
2205
|
+
/**
|
|
2206
|
+
* Given a fragment, validate that it can only be provided with fragment props
|
|
1684
2207
|
* @param {ReactElement} fragment
|
|
1685
2208
|
*/ function validateFragmentProps(fragment) {
|
|
1686
2209
|
{
|
|
1687
2210
|
var keys = Object.keys(fragment.props);
|
|
1688
2211
|
for(var i = 0; i < keys.length; i++){
|
|
1689
2212
|
var key = keys[i];
|
|
1690
|
-
if (key !==
|
|
2213
|
+
if (key !== 'children' && key !== 'key') {
|
|
1691
2214
|
setCurrentlyValidatingElement$1(fragment);
|
|
1692
|
-
error(
|
|
2215
|
+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
1693
2216
|
setCurrentlyValidatingElement$1(null);
|
|
1694
2217
|
break;
|
|
1695
2218
|
}
|
|
1696
2219
|
}
|
|
1697
2220
|
if (fragment.ref !== null) {
|
|
1698
2221
|
setCurrentlyValidatingElement$1(fragment);
|
|
1699
|
-
error(
|
|
2222
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
1700
2223
|
setCurrentlyValidatingElement$1(null);
|
|
1701
2224
|
}
|
|
1702
2225
|
}
|
|
1703
|
-
}
|
|
1704
|
-
|
|
2226
|
+
}
|
|
2227
|
+
function createElementWithValidation(type, props, children) {
|
|
1705
2228
|
var validType = isValidElementType(type); // We warn in this case but don't throw. We expect the element creation to
|
|
1706
2229
|
// succeed and there will likely be errors in render.
|
|
1707
2230
|
if (!validType) {
|
|
1708
|
-
var info =
|
|
1709
|
-
if (type === undefined || typeof type ===
|
|
1710
|
-
info +=
|
|
2231
|
+
var info = '';
|
|
2232
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
2233
|
+
info += ' You likely forgot to export your component from the file ' + "it's defined in, or you might have mixed up default and named imports.";
|
|
1711
2234
|
}
|
|
1712
2235
|
var sourceInfo = getSourceInfoErrorAddendumForProps(props);
|
|
1713
2236
|
if (sourceInfo) {
|
|
@@ -1717,17 +2240,17 @@ function requireReact_development() {
|
|
|
1717
2240
|
}
|
|
1718
2241
|
var typeString;
|
|
1719
2242
|
if (type === null) {
|
|
1720
|
-
typeString =
|
|
2243
|
+
typeString = 'null';
|
|
1721
2244
|
} else if (isArray(type)) {
|
|
1722
|
-
typeString =
|
|
2245
|
+
typeString = 'array';
|
|
1723
2246
|
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
1724
|
-
typeString = "<" + (getComponentNameFromType(type.type) ||
|
|
1725
|
-
info =
|
|
2247
|
+
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
2248
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
1726
2249
|
} else {
|
|
1727
|
-
typeString = typeof type
|
|
2250
|
+
typeString = typeof type;
|
|
1728
2251
|
}
|
|
1729
2252
|
{
|
|
1730
|
-
error(
|
|
2253
|
+
error('React.createElement: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
1731
2254
|
}
|
|
1732
2255
|
}
|
|
1733
2256
|
var element = createElement.apply(this, arguments); // The result can be nullish if a mock or a custom function is used.
|
|
@@ -1750,20 +2273,21 @@ function requireReact_development() {
|
|
|
1750
2273
|
validatePropTypes(element);
|
|
1751
2274
|
}
|
|
1752
2275
|
return element;
|
|
1753
|
-
}
|
|
1754
|
-
var
|
|
2276
|
+
}
|
|
2277
|
+
var didWarnAboutDeprecatedCreateFactory = false;
|
|
2278
|
+
function createFactoryWithValidation(type) {
|
|
1755
2279
|
var validatedFactory = createElementWithValidation.bind(null, type);
|
|
1756
2280
|
validatedFactory.type = type;
|
|
1757
2281
|
{
|
|
1758
2282
|
if (!didWarnAboutDeprecatedCreateFactory) {
|
|
1759
2283
|
didWarnAboutDeprecatedCreateFactory = true;
|
|
1760
|
-
warn(
|
|
2284
|
+
warn('React.createFactory() is deprecated and will be removed in ' + 'a future major release. Consider using JSX ' + 'or use React.createElement() directly instead.');
|
|
1761
2285
|
} // Legacy hook: remove it
|
|
1762
|
-
Object.defineProperty(validatedFactory,
|
|
2286
|
+
Object.defineProperty(validatedFactory, 'type', {
|
|
1763
2287
|
enumerable: false,
|
|
1764
|
-
get: function
|
|
1765
|
-
warn(
|
|
1766
|
-
Object.defineProperty(this,
|
|
2288
|
+
get: function() {
|
|
2289
|
+
warn('Factory.type is deprecated. Access the class directly ' + 'before passing it to createFactory.');
|
|
2290
|
+
Object.defineProperty(this, 'type', {
|
|
1767
2291
|
value: type
|
|
1768
2292
|
});
|
|
1769
2293
|
return type;
|
|
@@ -1771,16 +2295,16 @@ function requireReact_development() {
|
|
|
1771
2295
|
});
|
|
1772
2296
|
}
|
|
1773
2297
|
return validatedFactory;
|
|
1774
|
-
}
|
|
1775
|
-
|
|
2298
|
+
}
|
|
2299
|
+
function cloneElementWithValidation(element, props, children) {
|
|
1776
2300
|
var newElement = cloneElement.apply(this, arguments);
|
|
1777
2301
|
for(var i = 2; i < arguments.length; i++){
|
|
1778
2302
|
validateChildKeys(arguments[i], newElement.type);
|
|
1779
2303
|
}
|
|
1780
2304
|
validatePropTypes(newElement);
|
|
1781
2305
|
return newElement;
|
|
1782
|
-
}
|
|
1783
|
-
|
|
2306
|
+
}
|
|
2307
|
+
function startTransition(scope, options) {
|
|
1784
2308
|
var prevTransition = ReactCurrentBatchConfig.transition;
|
|
1785
2309
|
ReactCurrentBatchConfig.transition = {};
|
|
1786
2310
|
var currentTransition = ReactCurrentBatchConfig.transition;
|
|
@@ -1795,32 +2319,34 @@ function requireReact_development() {
|
|
|
1795
2319
|
if (prevTransition === null && currentTransition._updatedFibers) {
|
|
1796
2320
|
var updatedFibersCount = currentTransition._updatedFibers.size;
|
|
1797
2321
|
if (updatedFibersCount > 10) {
|
|
1798
|
-
warn(
|
|
2322
|
+
warn('Detected a large number of updates inside startTransition. ' + 'If this is due to a subscription please re-write it to use React provided hooks. ' + 'Otherwise concurrent mode guarantees are off the table.');
|
|
1799
2323
|
}
|
|
1800
2324
|
currentTransition._updatedFibers.clear();
|
|
1801
2325
|
}
|
|
1802
2326
|
}
|
|
1803
2327
|
}
|
|
1804
|
-
}
|
|
1805
|
-
var
|
|
2328
|
+
}
|
|
2329
|
+
var didWarnAboutMessageChannel = false;
|
|
2330
|
+
var enqueueTaskImpl = null;
|
|
2331
|
+
function enqueueTask(task) {
|
|
1806
2332
|
if (enqueueTaskImpl === null) {
|
|
1807
2333
|
try {
|
|
1808
2334
|
// read require off the module object to get around the bundlers.
|
|
1809
2335
|
// we don't want them to detect a require and bundle a Node polyfill.
|
|
1810
|
-
var requireString = (
|
|
2336
|
+
var requireString = ('require' + Math.random()).slice(0, 7);
|
|
1811
2337
|
var nodeRequire = module && module[requireString]; // assuming we're in node, let's try to get node's
|
|
1812
2338
|
// version of setImmediate, bypassing fake timers if any.
|
|
1813
|
-
enqueueTaskImpl = nodeRequire.call(module,
|
|
2339
|
+
enqueueTaskImpl = nodeRequire.call(module, 'timers').setImmediate;
|
|
1814
2340
|
} catch (_err) {
|
|
1815
2341
|
// we're in a browser
|
|
1816
2342
|
// we can't use regular timers because they may still be faked
|
|
1817
2343
|
// so we try MessageChannel+postMessage instead
|
|
1818
|
-
enqueueTaskImpl = function
|
|
2344
|
+
enqueueTaskImpl = function(callback) {
|
|
1819
2345
|
{
|
|
1820
2346
|
if (didWarnAboutMessageChannel === false) {
|
|
1821
2347
|
didWarnAboutMessageChannel = true;
|
|
1822
|
-
if (typeof MessageChannel ===
|
|
1823
|
-
error(
|
|
2348
|
+
if (typeof MessageChannel === 'undefined') {
|
|
2349
|
+
error('This browser does not have a MessageChannel implementation, ' + 'so enqueuing tasks via await act(async () => ...) will fail. ' + 'Please file an issue at https://github.com/facebook/react/issues ' + 'if you encounter this warning.');
|
|
1824
2350
|
}
|
|
1825
2351
|
}
|
|
1826
2352
|
}
|
|
@@ -1831,8 +2357,10 @@ function requireReact_development() {
|
|
|
1831
2357
|
}
|
|
1832
2358
|
}
|
|
1833
2359
|
return enqueueTaskImpl(task);
|
|
1834
|
-
}
|
|
1835
|
-
var
|
|
2360
|
+
}
|
|
2361
|
+
var actScopeDepth = 0;
|
|
2362
|
+
var didWarnNoAwaitAct = false;
|
|
2363
|
+
function act(callback) {
|
|
1836
2364
|
{
|
|
1837
2365
|
// `act` calls can be nested, so we track the depth. This represents the
|
|
1838
2366
|
// number of `act` scopes on the stack.
|
|
@@ -1861,18 +2389,18 @@ function requireReact_development() {
|
|
|
1861
2389
|
flushActQueue(queue);
|
|
1862
2390
|
}
|
|
1863
2391
|
}
|
|
1864
|
-
} catch (
|
|
2392
|
+
} catch (error) {
|
|
1865
2393
|
popActScope(prevActScopeDepth);
|
|
1866
|
-
throw
|
|
2394
|
+
throw error;
|
|
1867
2395
|
} finally{
|
|
1868
2396
|
ReactCurrentActQueue.isBatchingLegacy = prevIsBatchingLegacy;
|
|
1869
2397
|
}
|
|
1870
|
-
if (result !== null && typeof result ===
|
|
2398
|
+
if (result !== null && typeof result === 'object' && typeof result.then === 'function') {
|
|
1871
2399
|
var thenableResult = result; // The callback is an async function (i.e. returned a promise). Wait
|
|
1872
2400
|
// for it to resolve before exiting the current scope.
|
|
1873
2401
|
var wasAwaited = false;
|
|
1874
2402
|
var thenable = {
|
|
1875
|
-
then: function
|
|
2403
|
+
then: function(resolve, reject) {
|
|
1876
2404
|
wasAwaited = true;
|
|
1877
2405
|
thenableResult.then(function(returnValue) {
|
|
1878
2406
|
popActScope(prevActScopeDepth);
|
|
@@ -1891,12 +2419,12 @@ function requireReact_development() {
|
|
|
1891
2419
|
}
|
|
1892
2420
|
};
|
|
1893
2421
|
{
|
|
1894
|
-
if (!didWarnNoAwaitAct && typeof Promise !==
|
|
2422
|
+
if (!didWarnNoAwaitAct && typeof Promise !== 'undefined') {
|
|
1895
2423
|
// eslint-disable-next-line no-undef
|
|
1896
2424
|
Promise.resolve().then(function() {}).then(function() {
|
|
1897
2425
|
if (!wasAwaited) {
|
|
1898
2426
|
didWarnNoAwaitAct = true;
|
|
1899
|
-
error(
|
|
2427
|
+
error('You called act(async () => ...) without await. ' + 'This could lead to unexpected testing behaviour, ' + 'interleaving multiple act calls and mixing their ' + 'scopes. ' + 'You should - await act(async () => ...);');
|
|
1900
2428
|
}
|
|
1901
2429
|
});
|
|
1902
2430
|
}
|
|
@@ -1915,7 +2443,7 @@ function requireReact_development() {
|
|
|
1915
2443
|
} // Return a thenable. If the user awaits it, we'll flush again in
|
|
1916
2444
|
// case additional work was scheduled by a microtask.
|
|
1917
2445
|
var _thenable = {
|
|
1918
|
-
then: function
|
|
2446
|
+
then: function(resolve, reject) {
|
|
1919
2447
|
// Confirm we haven't re-entered another `act` scope, in case
|
|
1920
2448
|
// the user does something weird like await the thenable
|
|
1921
2449
|
// multiple times.
|
|
@@ -1933,7 +2461,7 @@ function requireReact_development() {
|
|
|
1933
2461
|
// Since we're inside a nested `act` scope, the returned thenable
|
|
1934
2462
|
// immediately resolves. The outer scope will flush the queue.
|
|
1935
2463
|
var _thenable2 = {
|
|
1936
|
-
then: function
|
|
2464
|
+
then: function(resolve, reject) {
|
|
1937
2465
|
resolve(returnValue);
|
|
1938
2466
|
}
|
|
1939
2467
|
};
|
|
@@ -1941,16 +2469,41 @@ function requireReact_development() {
|
|
|
1941
2469
|
}
|
|
1942
2470
|
}
|
|
1943
2471
|
}
|
|
1944
|
-
}
|
|
1945
|
-
|
|
2472
|
+
}
|
|
2473
|
+
function popActScope(prevActScopeDepth) {
|
|
1946
2474
|
{
|
|
1947
2475
|
if (prevActScopeDepth !== actScopeDepth - 1) {
|
|
1948
|
-
error(
|
|
2476
|
+
error('You seem to have overlapping act() calls, this is not supported. ' + 'Be sure to await previous act() calls before making a new one. ');
|
|
1949
2477
|
}
|
|
1950
2478
|
actScopeDepth = prevActScopeDepth;
|
|
1951
2479
|
}
|
|
1952
|
-
}
|
|
1953
|
-
|
|
2480
|
+
}
|
|
2481
|
+
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2482
|
+
{
|
|
2483
|
+
var queue = ReactCurrentActQueue.current;
|
|
2484
|
+
if (queue !== null) {
|
|
2485
|
+
try {
|
|
2486
|
+
flushActQueue(queue);
|
|
2487
|
+
enqueueTask(function() {
|
|
2488
|
+
if (queue.length === 0) {
|
|
2489
|
+
// No additional work was scheduled. Finish.
|
|
2490
|
+
ReactCurrentActQueue.current = null;
|
|
2491
|
+
resolve(returnValue);
|
|
2492
|
+
} else {
|
|
2493
|
+
// Keep flushing work until there's none left.
|
|
2494
|
+
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2495
|
+
}
|
|
2496
|
+
});
|
|
2497
|
+
} catch (error) {
|
|
2498
|
+
reject(error);
|
|
2499
|
+
}
|
|
2500
|
+
} else {
|
|
2501
|
+
resolve(returnValue);
|
|
2502
|
+
}
|
|
2503
|
+
}
|
|
2504
|
+
}
|
|
2505
|
+
var isFlushing = false;
|
|
2506
|
+
function flushActQueue(queue) {
|
|
1954
2507
|
{
|
|
1955
2508
|
if (!isFlushing) {
|
|
1956
2509
|
// Prevent re-entrance.
|
|
@@ -1961,7 +2514,7 @@ function requireReact_development() {
|
|
|
1961
2514
|
var callback = queue[i];
|
|
1962
2515
|
do {
|
|
1963
2516
|
callback = callback(true);
|
|
1964
|
-
}while (callback !== null)
|
|
2517
|
+
}while (callback !== null)
|
|
1965
2518
|
}
|
|
1966
2519
|
queue.length = 0;
|
|
1967
2520
|
} catch (error) {
|
|
@@ -1973,640 +2526,54 @@ function requireReact_development() {
|
|
|
1973
2526
|
}
|
|
1974
2527
|
}
|
|
1975
2528
|
}
|
|
1976
|
-
};
|
|
1977
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart === "function") {
|
|
1978
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(new Error());
|
|
1979
|
-
}
|
|
1980
|
-
var ReactVersion = "18.2.0";
|
|
1981
|
-
// ATTENTION
|
|
1982
|
-
// When adding new symbols to this file,
|
|
1983
|
-
// Please consider also adding to 'react-devtools-shared/src/backend/ReactSymbols'
|
|
1984
|
-
// The Symbol used to tag the ReactElement-like types.
|
|
1985
|
-
var REACT_ELEMENT_TYPE = Symbol.for("react.element");
|
|
1986
|
-
var REACT_PORTAL_TYPE = Symbol.for("react.portal");
|
|
1987
|
-
var REACT_FRAGMENT_TYPE = Symbol.for("react.fragment");
|
|
1988
|
-
var REACT_STRICT_MODE_TYPE = Symbol.for("react.strict_mode");
|
|
1989
|
-
var REACT_PROFILER_TYPE = Symbol.for("react.profiler");
|
|
1990
|
-
var REACT_PROVIDER_TYPE = Symbol.for("react.provider");
|
|
1991
|
-
var REACT_CONTEXT_TYPE = Symbol.for("react.context");
|
|
1992
|
-
var REACT_FORWARD_REF_TYPE = Symbol.for("react.forward_ref");
|
|
1993
|
-
var REACT_SUSPENSE_TYPE = Symbol.for("react.suspense");
|
|
1994
|
-
var REACT_SUSPENSE_LIST_TYPE = Symbol.for("react.suspense_list");
|
|
1995
|
-
var REACT_MEMO_TYPE = Symbol.for("react.memo");
|
|
1996
|
-
var REACT_LAZY_TYPE = Symbol.for("react.lazy");
|
|
1997
|
-
var REACT_OFFSCREEN_TYPE = Symbol.for("react.offscreen");
|
|
1998
|
-
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
1999
|
-
var FAUX_ITERATOR_SYMBOL = "@@iterator";
|
|
2000
|
-
/**
|
|
2001
|
-
* Keeps track of the current dispatcher.
|
|
2002
|
-
*/ var ReactCurrentDispatcher = {
|
|
2003
|
-
/**
|
|
2004
|
-
* @internal
|
|
2005
|
-
* @type {ReactComponent}
|
|
2006
|
-
*/ current: null
|
|
2007
|
-
};
|
|
2008
|
-
/**
|
|
2009
|
-
* Keeps track of the current batch's configuration such as how long an update
|
|
2010
|
-
* should suspend for if it needs to.
|
|
2011
|
-
*/ var ReactCurrentBatchConfig = {
|
|
2012
|
-
transition: null
|
|
2013
|
-
};
|
|
2014
|
-
var ReactCurrentActQueue = {
|
|
2015
|
-
current: null,
|
|
2016
|
-
// Used to reproduce behavior of `batchedUpdates` in legacy mode.
|
|
2017
|
-
isBatchingLegacy: false,
|
|
2018
|
-
didScheduleLegacyUpdate: false
|
|
2019
|
-
};
|
|
2020
|
-
/**
|
|
2021
|
-
* Keeps track of the current owner.
|
|
2022
|
-
*
|
|
2023
|
-
* The current owner is the component who should own any components that are
|
|
2024
|
-
* currently being constructed.
|
|
2025
|
-
*/ var ReactCurrentOwner = {
|
|
2026
|
-
/**
|
|
2027
|
-
* @internal
|
|
2028
|
-
* @type {ReactComponent}
|
|
2029
|
-
*/ current: null
|
|
2030
|
-
};
|
|
2031
|
-
var ReactDebugCurrentFrame = {};
|
|
2032
|
-
var currentExtraStackFrame = null;
|
|
2033
|
-
{
|
|
2034
|
-
ReactDebugCurrentFrame.setExtraStackFrame = function(stack) {
|
|
2035
|
-
{
|
|
2036
|
-
currentExtraStackFrame = stack;
|
|
2037
|
-
}
|
|
2038
|
-
}; // Stack implementation injected by the current renderer.
|
|
2039
|
-
ReactDebugCurrentFrame.getCurrentStack = null;
|
|
2040
|
-
ReactDebugCurrentFrame.getStackAddendum = function() {
|
|
2041
|
-
var stack = ""; // Add an extra top frame while an element is being validated
|
|
2042
|
-
if (currentExtraStackFrame) {
|
|
2043
|
-
stack += currentExtraStackFrame;
|
|
2044
|
-
} // Delegate to the injected renderer-specific implementation
|
|
2045
|
-
var impl = ReactDebugCurrentFrame.getCurrentStack;
|
|
2046
|
-
if (impl) {
|
|
2047
|
-
stack += impl() || "";
|
|
2048
|
-
}
|
|
2049
|
-
return stack;
|
|
2050
|
-
};
|
|
2051
|
-
}
|
|
2052
|
-
// -----------------------------------------------------------------------------
|
|
2053
|
-
var enableScopeAPI = false; // Experimental Create Event Handle API.
|
|
2054
|
-
var enableCacheElement = false;
|
|
2055
|
-
var enableTransitionTracing = false; // No known bugs, but needs performance testing
|
|
2056
|
-
var enableLegacyHidden = false; // Enables unstable_avoidThisFallback feature in Fiber
|
|
2057
|
-
// stuff. Intended to enable React core members to more easily debug scheduling
|
|
2058
|
-
// issues in DEV builds.
|
|
2059
|
-
var enableDebugTracing = false; // Track which Fiber(s) schedule render work.
|
|
2060
|
-
var ReactSharedInternals = {
|
|
2061
|
-
ReactCurrentDispatcher: ReactCurrentDispatcher,
|
|
2062
|
-
ReactCurrentBatchConfig: ReactCurrentBatchConfig,
|
|
2063
|
-
ReactCurrentOwner: ReactCurrentOwner
|
|
2064
|
-
};
|
|
2065
|
-
{
|
|
2066
|
-
ReactSharedInternals.ReactDebugCurrentFrame = ReactDebugCurrentFrame;
|
|
2067
|
-
ReactSharedInternals.ReactCurrentActQueue = ReactCurrentActQueue;
|
|
2068
2529
|
}
|
|
2069
|
-
var
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
* @final
|
|
2079
|
-
*/ isMounted: function isMounted(publicInstance) {
|
|
2080
|
-
return false;
|
|
2081
|
-
},
|
|
2082
|
-
/**
|
|
2083
|
-
* Forces an update. This should only be invoked when it is known with
|
|
2084
|
-
* certainty that we are **not** in a DOM transaction.
|
|
2085
|
-
*
|
|
2086
|
-
* You may want to call this when you know that some deeper aspect of the
|
|
2087
|
-
* component's state has changed but `setState` was not called.
|
|
2088
|
-
*
|
|
2089
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
2090
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
|
2091
|
-
*
|
|
2092
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
2093
|
-
* @param {?function} callback Called after component is updated.
|
|
2094
|
-
* @param {?string} callerName name of the calling function in the public API.
|
|
2095
|
-
* @internal
|
|
2096
|
-
*/ enqueueForceUpdate: function enqueueForceUpdate(publicInstance, callback, callerName) {
|
|
2097
|
-
warnNoop(publicInstance, "forceUpdate");
|
|
2098
|
-
},
|
|
2099
|
-
/**
|
|
2100
|
-
* Replaces all of the state. Always use this or `setState` to mutate state.
|
|
2101
|
-
* You should treat `this.state` as immutable.
|
|
2102
|
-
*
|
|
2103
|
-
* There is no guarantee that `this.state` will be immediately updated, so
|
|
2104
|
-
* accessing `this.state` after calling this method may return the old value.
|
|
2105
|
-
*
|
|
2106
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
2107
|
-
* @param {object} completeState Next state.
|
|
2108
|
-
* @param {?function} callback Called after component is updated.
|
|
2109
|
-
* @param {?string} callerName name of the calling function in the public API.
|
|
2110
|
-
* @internal
|
|
2111
|
-
*/ enqueueReplaceState: function enqueueReplaceState(publicInstance, completeState, callback, callerName) {
|
|
2112
|
-
warnNoop(publicInstance, "replaceState");
|
|
2113
|
-
},
|
|
2114
|
-
/**
|
|
2115
|
-
* Sets a subset of the state. This only exists because _pendingState is
|
|
2116
|
-
* internal. This provides a merging strategy that is not available to deep
|
|
2117
|
-
* properties which is confusing. TODO: Expose pendingState or don't use it
|
|
2118
|
-
* during the merge.
|
|
2119
|
-
*
|
|
2120
|
-
* @param {ReactClass} publicInstance The instance that should rerender.
|
|
2121
|
-
* @param {object} partialState Next partial state to be merged with state.
|
|
2122
|
-
* @param {?function} callback Called after component is updated.
|
|
2123
|
-
* @param {?string} Name of the calling function in the public API.
|
|
2124
|
-
* @internal
|
|
2125
|
-
*/ enqueueSetState: function enqueueSetState(publicInstance, partialState, callback, callerName) {
|
|
2126
|
-
warnNoop(publicInstance, "setState");
|
|
2127
|
-
}
|
|
2530
|
+
var createElement$1 = createElementWithValidation;
|
|
2531
|
+
var cloneElement$1 = cloneElementWithValidation;
|
|
2532
|
+
var createFactory = createFactoryWithValidation;
|
|
2533
|
+
var Children = {
|
|
2534
|
+
map: mapChildren,
|
|
2535
|
+
forEach: forEachChildren,
|
|
2536
|
+
count: countChildren,
|
|
2537
|
+
toArray: toArray,
|
|
2538
|
+
only: onlyChild
|
|
2128
2539
|
};
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2149
|
-
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
|
|
2159
|
-
|
|
2160
|
-
|
|
2161
|
-
|
|
2162
|
-
|
|
2163
|
-
|
|
2164
|
-
|
|
2165
|
-
|
|
2166
|
-
* Forces an update. This should only be invoked when it is known with
|
|
2167
|
-
* certainty that we are **not** in a DOM transaction.
|
|
2168
|
-
*
|
|
2169
|
-
* You may want to call this when you know that some deeper aspect of the
|
|
2170
|
-
* component's state has changed but `setState` was not called.
|
|
2171
|
-
*
|
|
2172
|
-
* This will not invoke `shouldComponentUpdate`, but it will invoke
|
|
2173
|
-
* `componentWillUpdate` and `componentDidUpdate`.
|
|
2174
|
-
*
|
|
2175
|
-
* @param {?function} callback Called after update is complete.
|
|
2176
|
-
* @final
|
|
2177
|
-
* @protected
|
|
2178
|
-
*/ Component.prototype.forceUpdate = function(callback) {
|
|
2179
|
-
this.updater.enqueueForceUpdate(this, callback, "forceUpdate");
|
|
2180
|
-
};
|
|
2181
|
-
/**
|
|
2182
|
-
* Deprecated APIs. These APIs used to exist on classic React classes but since
|
|
2183
|
-
* we would like to deprecate them, we're not going to move them over to this
|
|
2184
|
-
* modern base class. Instead, we define a getter that warns if it's accessed.
|
|
2185
|
-
*/ {
|
|
2186
|
-
var deprecatedAPIs = {
|
|
2187
|
-
isMounted: [
|
|
2188
|
-
"isMounted",
|
|
2189
|
-
"Instead, make sure to clean up subscriptions and pending requests in " + "componentWillUnmount to prevent memory leaks."
|
|
2190
|
-
],
|
|
2191
|
-
replaceState: [
|
|
2192
|
-
"replaceState",
|
|
2193
|
-
"Refactor your code to use setState instead (see " + "https://github.com/facebook/react/issues/3236)."
|
|
2194
|
-
]
|
|
2195
|
-
};
|
|
2196
|
-
var defineDeprecationWarning = function defineDeprecationWarning(methodName, info) {
|
|
2197
|
-
Object.defineProperty(Component.prototype, methodName, {
|
|
2198
|
-
get: function get() {
|
|
2199
|
-
warn("%s(...) is deprecated in plain JavaScript React classes. %s", info[0], info[1]);
|
|
2200
|
-
return undefined;
|
|
2201
|
-
}
|
|
2202
|
-
});
|
|
2203
|
-
};
|
|
2204
|
-
for(var fnName in deprecatedAPIs){
|
|
2205
|
-
if (deprecatedAPIs.hasOwnProperty(fnName)) {
|
|
2206
|
-
defineDeprecationWarning(fnName, deprecatedAPIs[fnName]);
|
|
2207
|
-
}
|
|
2208
|
-
}
|
|
2209
|
-
}
|
|
2210
|
-
ComponentDummy.prototype = Component.prototype;
|
|
2211
|
-
var pureComponentPrototype = PureComponent.prototype = new ComponentDummy();
|
|
2212
|
-
pureComponentPrototype.constructor = PureComponent; // Avoid an extra prototype jump for these methods.
|
|
2213
|
-
assign(pureComponentPrototype, Component.prototype);
|
|
2214
|
-
pureComponentPrototype.isPureReactComponent = true;
|
|
2215
|
-
var isArrayImpl = Array.isArray; // eslint-disable-next-line no-redeclare
|
|
2216
|
-
function getComponentNameFromType(type) {
|
|
2217
|
-
if (type == null) {
|
|
2218
|
-
// Host root, text node or just invalid type.
|
|
2219
|
-
return null;
|
|
2220
|
-
}
|
|
2221
|
-
{
|
|
2222
|
-
if (typeof type.tag === "number") {
|
|
2223
|
-
error("Received an unexpected object in getComponentNameFromType(). " + "This is likely a bug in React. Please file an issue.");
|
|
2224
|
-
}
|
|
2225
|
-
}
|
|
2226
|
-
if (typeof type === "function") {
|
|
2227
|
-
return type.displayName || type.name || null;
|
|
2228
|
-
}
|
|
2229
|
-
if (typeof type === "string") {
|
|
2230
|
-
return type;
|
|
2231
|
-
}
|
|
2232
|
-
switch(type){
|
|
2233
|
-
case REACT_FRAGMENT_TYPE:
|
|
2234
|
-
return "Fragment";
|
|
2235
|
-
case REACT_PORTAL_TYPE:
|
|
2236
|
-
return "Portal";
|
|
2237
|
-
case REACT_PROFILER_TYPE:
|
|
2238
|
-
return "Profiler";
|
|
2239
|
-
case REACT_STRICT_MODE_TYPE:
|
|
2240
|
-
return "StrictMode";
|
|
2241
|
-
case REACT_SUSPENSE_TYPE:
|
|
2242
|
-
return "Suspense";
|
|
2243
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
2244
|
-
return "SuspenseList";
|
|
2245
|
-
}
|
|
2246
|
-
if (typeof type === "object") {
|
|
2247
|
-
switch(type.$$typeof){
|
|
2248
|
-
case REACT_CONTEXT_TYPE:
|
|
2249
|
-
var context = type;
|
|
2250
|
-
return getContextName(context) + ".Consumer";
|
|
2251
|
-
case REACT_PROVIDER_TYPE:
|
|
2252
|
-
var provider = type;
|
|
2253
|
-
return getContextName(provider._context) + ".Provider";
|
|
2254
|
-
case REACT_FORWARD_REF_TYPE:
|
|
2255
|
-
return getWrappedName(type, type.render, "ForwardRef");
|
|
2256
|
-
case REACT_MEMO_TYPE:
|
|
2257
|
-
var outerName = type.displayName || null;
|
|
2258
|
-
if (outerName !== null) {
|
|
2259
|
-
return outerName;
|
|
2260
|
-
}
|
|
2261
|
-
return getComponentNameFromType(type.type) || "Memo";
|
|
2262
|
-
case REACT_LAZY_TYPE:
|
|
2263
|
-
{
|
|
2264
|
-
var lazyComponent = type;
|
|
2265
|
-
var payload = lazyComponent._payload;
|
|
2266
|
-
var init = lazyComponent._init;
|
|
2267
|
-
try {
|
|
2268
|
-
return getComponentNameFromType(init(payload));
|
|
2269
|
-
} catch (x) {
|
|
2270
|
-
return null;
|
|
2271
|
-
}
|
|
2272
|
-
}
|
|
2273
|
-
}
|
|
2274
|
-
}
|
|
2275
|
-
return null;
|
|
2276
|
-
}
|
|
2277
|
-
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
2278
|
-
var RESERVED_PROPS = {
|
|
2279
|
-
key: true,
|
|
2280
|
-
ref: true,
|
|
2281
|
-
__self: true,
|
|
2282
|
-
__source: true
|
|
2283
|
-
};
|
|
2284
|
-
var specialPropKeyWarningShown, specialPropRefWarningShown, didWarnAboutStringRefs;
|
|
2285
|
-
{
|
|
2286
|
-
didWarnAboutStringRefs = {};
|
|
2287
|
-
}
|
|
2288
|
-
/**
|
|
2289
|
-
* Factory method to create a new React element. This no longer adheres to
|
|
2290
|
-
* the class pattern, so do not use new to call it. Also, instanceof check
|
|
2291
|
-
* will not work. Instead test $$typeof field against Symbol.for('react.element') to check
|
|
2292
|
-
* if something is a React Element.
|
|
2293
|
-
*
|
|
2294
|
-
* @param {*} type
|
|
2295
|
-
* @param {*} props
|
|
2296
|
-
* @param {*} key
|
|
2297
|
-
* @param {string|object} ref
|
|
2298
|
-
* @param {*} owner
|
|
2299
|
-
* @param {*} self A *temporary* helper to detect places where `this` is
|
|
2300
|
-
* different from the `owner` when React.createElement is called, so that we
|
|
2301
|
-
* can warn. We want to get rid of owner and replace string `ref`s with arrow
|
|
2302
|
-
* functions, and as long as `this` and owner are the same, there will be no
|
|
2303
|
-
* change in behavior.
|
|
2304
|
-
* @param {*} source An annotation object (added by a transpiler or otherwise)
|
|
2305
|
-
* indicating filename, line number, and/or other information.
|
|
2306
|
-
* @internal
|
|
2307
|
-
*/ var ReactElement = function ReactElement(type, key, ref, self, source, owner, props) {
|
|
2308
|
-
var element = {
|
|
2309
|
-
// This tag allows us to uniquely identify this as a React Element
|
|
2310
|
-
$$typeof: REACT_ELEMENT_TYPE,
|
|
2311
|
-
// Built-in properties that belong on the element
|
|
2312
|
-
type: type,
|
|
2313
|
-
key: key,
|
|
2314
|
-
ref: ref,
|
|
2315
|
-
props: props,
|
|
2316
|
-
// Record the component responsible for creating this element.
|
|
2317
|
-
_owner: owner
|
|
2318
|
-
};
|
|
2319
|
-
{
|
|
2320
|
-
// The validation flag is currently mutative. We put it on
|
|
2321
|
-
// an external backing store so that we can freeze the whole object.
|
|
2322
|
-
// This can be replaced with a WeakMap once they are implemented in
|
|
2323
|
-
// commonly used development environments.
|
|
2324
|
-
element._store = {}; // To make comparing ReactElements easier for testing purposes, we make
|
|
2325
|
-
// the validation flag non-enumerable (where possible, which should
|
|
2326
|
-
// include every environment we run tests in), so the test framework
|
|
2327
|
-
// ignores it.
|
|
2328
|
-
Object.defineProperty(element._store, "validated", {
|
|
2329
|
-
configurable: false,
|
|
2330
|
-
enumerable: false,
|
|
2331
|
-
writable: true,
|
|
2332
|
-
value: false
|
|
2333
|
-
}); // self and source are DEV only properties.
|
|
2334
|
-
Object.defineProperty(element, "_self", {
|
|
2335
|
-
configurable: false,
|
|
2336
|
-
enumerable: false,
|
|
2337
|
-
writable: false,
|
|
2338
|
-
value: self
|
|
2339
|
-
}); // Two elements created in two different places should be considered
|
|
2340
|
-
// equal for testing purposes and therefore we hide it from enumeration.
|
|
2341
|
-
Object.defineProperty(element, "_source", {
|
|
2342
|
-
configurable: false,
|
|
2343
|
-
enumerable: false,
|
|
2344
|
-
writable: false,
|
|
2345
|
-
value: source
|
|
2346
|
-
});
|
|
2347
|
-
if (Object.freeze) {
|
|
2348
|
-
Object.freeze(element.props);
|
|
2349
|
-
Object.freeze(element);
|
|
2350
|
-
}
|
|
2351
|
-
}
|
|
2352
|
-
return element;
|
|
2353
|
-
};
|
|
2354
|
-
var SEPARATOR = ".";
|
|
2355
|
-
var SUBSEPARATOR = ":";
|
|
2356
|
-
/**
|
|
2357
|
-
* TODO: Test that a single child and an array with one item have the same key
|
|
2358
|
-
* pattern.
|
|
2359
|
-
*/ var didWarnAboutMaps = false;
|
|
2360
|
-
var userProvidedKeyEscapeRegex = /\/+/g;
|
|
2361
|
-
function mapIntoArray(children, array, escapedPrefix, nameSoFar, callback) {
|
|
2362
|
-
var type = typeof children === "undefined" ? "undefined" : _typeof(children);
|
|
2363
|
-
if (type === "undefined" || type === "boolean") {
|
|
2364
|
-
// All of the above are perceived as null.
|
|
2365
|
-
children = null;
|
|
2366
|
-
}
|
|
2367
|
-
var invokeCallback = false;
|
|
2368
|
-
if (children === null) {
|
|
2369
|
-
invokeCallback = true;
|
|
2370
|
-
} else {
|
|
2371
|
-
switch(type){
|
|
2372
|
-
case "string":
|
|
2373
|
-
case "number":
|
|
2374
|
-
invokeCallback = true;
|
|
2375
|
-
break;
|
|
2376
|
-
case "object":
|
|
2377
|
-
switch(children.$$typeof){
|
|
2378
|
-
case REACT_ELEMENT_TYPE:
|
|
2379
|
-
case REACT_PORTAL_TYPE:
|
|
2380
|
-
invokeCallback = true;
|
|
2381
|
-
}
|
|
2382
|
-
}
|
|
2383
|
-
}
|
|
2384
|
-
if (invokeCallback) {
|
|
2385
|
-
var _child = children;
|
|
2386
|
-
var mappedChild = callback(_child); // If it's the only child, treat the name as if it was wrapped in an array
|
|
2387
|
-
// so that it's consistent if the number of children grows:
|
|
2388
|
-
var childKey = nameSoFar === "" ? SEPARATOR + getElementKey(_child, 0) : nameSoFar;
|
|
2389
|
-
if (isArray(mappedChild)) {
|
|
2390
|
-
var escapedChildKey = "";
|
|
2391
|
-
if (childKey != null) {
|
|
2392
|
-
escapedChildKey = escapeUserProvidedKey(childKey) + "/";
|
|
2393
|
-
}
|
|
2394
|
-
mapIntoArray(mappedChild, array, escapedChildKey, "", function(c) {
|
|
2395
|
-
return c;
|
|
2396
|
-
});
|
|
2397
|
-
} else if (mappedChild != null) {
|
|
2398
|
-
if (isValidElement(mappedChild)) {
|
|
2399
|
-
{
|
|
2400
|
-
// The `if` statement here prevents auto-disabling of the safe
|
|
2401
|
-
// coercion ESLint rule, so we must manually disable it below.
|
|
2402
|
-
// $FlowFixMe Flow incorrectly thinks React.Portal doesn't have a key
|
|
2403
|
-
if (mappedChild.key && (!_child || _child.key !== mappedChild.key)) {
|
|
2404
|
-
checkKeyStringCoercion(mappedChild.key);
|
|
2405
|
-
}
|
|
2406
|
-
}
|
|
2407
|
-
mappedChild = cloneAndReplaceKey(mappedChild, // traverseAllChildren used to do for objects as children
|
|
2408
|
-
escapedPrefix + (mappedChild.key && (!_child || _child.key !== mappedChild.key) ? // eslint-disable-next-line react-internal/safe-string-coercion
|
|
2409
|
-
escapeUserProvidedKey("" + mappedChild.key) + "/" : "") + childKey);
|
|
2410
|
-
}
|
|
2411
|
-
array.push(mappedChild);
|
|
2412
|
-
}
|
|
2413
|
-
return 1;
|
|
2414
|
-
}
|
|
2415
|
-
var child;
|
|
2416
|
-
var nextName;
|
|
2417
|
-
var subtreeCount = 0; // Count of children found in the current subtree.
|
|
2418
|
-
var nextNamePrefix = nameSoFar === "" ? SEPARATOR : nameSoFar + SUBSEPARATOR;
|
|
2419
|
-
if (isArray(children)) {
|
|
2420
|
-
for(var i = 0; i < children.length; i++){
|
|
2421
|
-
child = children[i];
|
|
2422
|
-
nextName = nextNamePrefix + getElementKey(child, i);
|
|
2423
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
2424
|
-
}
|
|
2425
|
-
} else {
|
|
2426
|
-
var iteratorFn = getIteratorFn(children);
|
|
2427
|
-
if (typeof iteratorFn === "function") {
|
|
2428
|
-
var iterableChildren = children;
|
|
2429
|
-
{
|
|
2430
|
-
// Warn about using Maps as children
|
|
2431
|
-
if (iteratorFn === iterableChildren.entries) {
|
|
2432
|
-
if (!didWarnAboutMaps) {
|
|
2433
|
-
warn("Using Maps as children is not supported. " + "Use an array of keyed ReactElements instead.");
|
|
2434
|
-
}
|
|
2435
|
-
didWarnAboutMaps = true;
|
|
2436
|
-
}
|
|
2437
|
-
}
|
|
2438
|
-
var iterator = iteratorFn.call(iterableChildren);
|
|
2439
|
-
var step;
|
|
2440
|
-
var ii = 0;
|
|
2441
|
-
while(!(step = iterator.next()).done){
|
|
2442
|
-
child = step.value;
|
|
2443
|
-
nextName = nextNamePrefix + getElementKey(child, ii++);
|
|
2444
|
-
subtreeCount += mapIntoArray(child, array, escapedPrefix, nextName, callback);
|
|
2445
|
-
}
|
|
2446
|
-
} else if (type === "object") {
|
|
2447
|
-
// eslint-disable-next-line react-internal/safe-string-coercion
|
|
2448
|
-
var childrenString = String(children);
|
|
2449
|
-
throw new Error("Objects are not valid as a React child (found: " + (childrenString === "[object Object]" ? "object with keys {" + Object.keys(children).join(", ") + "}" : childrenString) + "). " + "If you meant to render a collection of children, use an array " + "instead.");
|
|
2450
|
-
}
|
|
2451
|
-
}
|
|
2452
|
-
return subtreeCount;
|
|
2453
|
-
}
|
|
2454
|
-
var Uninitialized = -1;
|
|
2455
|
-
var Pending = 0;
|
|
2456
|
-
var Resolved = 1;
|
|
2457
|
-
var Rejected = 2;
|
|
2458
|
-
var REACT_MODULE_REFERENCE;
|
|
2459
|
-
{
|
|
2460
|
-
REACT_MODULE_REFERENCE = Symbol.for("react.module.reference");
|
|
2461
|
-
}
|
|
2462
|
-
// Helpers to patch console.logs to avoid logging during side-effect free
|
|
2463
|
-
// replaying on render function. This currently only patches the object
|
|
2464
|
-
// lazily which won't cover if the log function was extracted eagerly.
|
|
2465
|
-
// We could also eagerly patch the method.
|
|
2466
|
-
var disabledDepth = 0;
|
|
2467
|
-
var prevLog;
|
|
2468
|
-
var prevInfo;
|
|
2469
|
-
var prevWarn;
|
|
2470
|
-
var prevError;
|
|
2471
|
-
var prevGroup;
|
|
2472
|
-
var prevGroupCollapsed;
|
|
2473
|
-
var prevGroupEnd;
|
|
2474
|
-
disabledLog.__reactDisabledLog = true;
|
|
2475
|
-
var ReactCurrentDispatcher$1 = ReactSharedInternals.ReactCurrentDispatcher;
|
|
2476
|
-
var prefix;
|
|
2477
|
-
var reentry = false;
|
|
2478
|
-
var componentFrameCache;
|
|
2479
|
-
{
|
|
2480
|
-
var PossiblyWeakMap = typeof WeakMap === "function" ? WeakMap : Map;
|
|
2481
|
-
componentFrameCache = new PossiblyWeakMap();
|
|
2482
|
-
}
|
|
2483
|
-
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
2484
|
-
if (type == null) {
|
|
2485
|
-
return "";
|
|
2486
|
-
}
|
|
2487
|
-
if (typeof type === "function") {
|
|
2488
|
-
{
|
|
2489
|
-
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
2490
|
-
}
|
|
2491
|
-
}
|
|
2492
|
-
if (typeof type === "string") {
|
|
2493
|
-
return describeBuiltInComponentFrame(type);
|
|
2494
|
-
}
|
|
2495
|
-
switch(type){
|
|
2496
|
-
case REACT_SUSPENSE_TYPE:
|
|
2497
|
-
return describeBuiltInComponentFrame("Suspense");
|
|
2498
|
-
case REACT_SUSPENSE_LIST_TYPE:
|
|
2499
|
-
return describeBuiltInComponentFrame("SuspenseList");
|
|
2500
|
-
}
|
|
2501
|
-
if (typeof type === "object") {
|
|
2502
|
-
switch(type.$$typeof){
|
|
2503
|
-
case REACT_FORWARD_REF_TYPE:
|
|
2504
|
-
return describeFunctionComponentFrame(type.render);
|
|
2505
|
-
case REACT_MEMO_TYPE:
|
|
2506
|
-
// Memo may contain any component type so we recursively resolve it.
|
|
2507
|
-
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
2508
|
-
case REACT_LAZY_TYPE:
|
|
2509
|
-
{
|
|
2510
|
-
var lazyComponent = type;
|
|
2511
|
-
var payload = lazyComponent._payload;
|
|
2512
|
-
var init = lazyComponent._init;
|
|
2513
|
-
try {
|
|
2514
|
-
// Lazy may contain any component type so we recursively resolve it.
|
|
2515
|
-
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
2516
|
-
} catch (x) {}
|
|
2517
|
-
}
|
|
2518
|
-
}
|
|
2519
|
-
}
|
|
2520
|
-
return "";
|
|
2521
|
-
}
|
|
2522
|
-
var loggedTypeFailures = {};
|
|
2523
|
-
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
2524
|
-
var propTypesMisspellWarningShown;
|
|
2525
|
-
{
|
|
2526
|
-
propTypesMisspellWarningShown = false;
|
|
2527
|
-
}
|
|
2528
|
-
/**
|
|
2529
|
-
* Warn if there's no key explicitly set on dynamic arrays of children or
|
|
2530
|
-
* object keys are not valid. This allows us to keep track of children between
|
|
2531
|
-
* updates.
|
|
2532
|
-
*/ var ownerHasKeyUseWarning = {};
|
|
2533
|
-
var didWarnAboutDeprecatedCreateFactory = false;
|
|
2534
|
-
var didWarnAboutMessageChannel = false;
|
|
2535
|
-
var enqueueTaskImpl = null;
|
|
2536
|
-
var actScopeDepth = 0;
|
|
2537
|
-
var didWarnNoAwaitAct = false;
|
|
2538
|
-
function recursivelyFlushAsyncActWork(returnValue, resolve, reject) {
|
|
2539
|
-
{
|
|
2540
|
-
var queue = ReactCurrentActQueue.current;
|
|
2541
|
-
if (queue !== null) {
|
|
2542
|
-
try {
|
|
2543
|
-
flushActQueue(queue);
|
|
2544
|
-
enqueueTask(function() {
|
|
2545
|
-
if (queue.length === 0) {
|
|
2546
|
-
// No additional work was scheduled. Finish.
|
|
2547
|
-
ReactCurrentActQueue.current = null;
|
|
2548
|
-
resolve(returnValue);
|
|
2549
|
-
} else {
|
|
2550
|
-
// Keep flushing work until there's none left.
|
|
2551
|
-
recursivelyFlushAsyncActWork(returnValue, resolve, reject);
|
|
2552
|
-
}
|
|
2553
|
-
});
|
|
2554
|
-
} catch (error) {
|
|
2555
|
-
reject(error);
|
|
2556
|
-
}
|
|
2557
|
-
} else {
|
|
2558
|
-
resolve(returnValue);
|
|
2559
|
-
}
|
|
2560
|
-
}
|
|
2561
|
-
}
|
|
2562
|
-
var isFlushing = false;
|
|
2563
|
-
var createElement$1 = createElementWithValidation;
|
|
2564
|
-
var cloneElement$1 = cloneElementWithValidation;
|
|
2565
|
-
var createFactory = createFactoryWithValidation;
|
|
2566
|
-
var Children = {
|
|
2567
|
-
map: mapChildren,
|
|
2568
|
-
forEach: forEachChildren,
|
|
2569
|
-
count: countChildren,
|
|
2570
|
-
toArray: toArray,
|
|
2571
|
-
only: onlyChild
|
|
2572
|
-
};
|
|
2573
|
-
exports.Children = Children;
|
|
2574
|
-
exports.Component = Component;
|
|
2575
|
-
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2576
|
-
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2577
|
-
exports.PureComponent = PureComponent;
|
|
2578
|
-
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2579
|
-
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2580
|
-
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2581
|
-
exports.cloneElement = cloneElement$1;
|
|
2582
|
-
exports.createContext = createContext;
|
|
2583
|
-
exports.createElement = createElement$1;
|
|
2584
|
-
exports.createFactory = createFactory;
|
|
2585
|
-
exports.createRef = createRef;
|
|
2586
|
-
exports.forwardRef = forwardRef;
|
|
2587
|
-
exports.isValidElement = isValidElement;
|
|
2588
|
-
exports.lazy = lazy;
|
|
2589
|
-
exports.memo = memo;
|
|
2590
|
-
exports.startTransition = startTransition;
|
|
2591
|
-
exports.unstable_act = act;
|
|
2592
|
-
exports.useCallback = useCallback;
|
|
2593
|
-
exports.useContext = useContext;
|
|
2594
|
-
exports.useDebugValue = useDebugValue;
|
|
2595
|
-
exports.useDeferredValue = useDeferredValue;
|
|
2596
|
-
exports.useEffect = useEffect;
|
|
2597
|
-
exports.useId = useId;
|
|
2598
|
-
exports.useImperativeHandle = useImperativeHandle;
|
|
2599
|
-
exports.useInsertionEffect = useInsertionEffect;
|
|
2600
|
-
exports.useLayoutEffect = useLayoutEffect;
|
|
2601
|
-
exports.useMemo = useMemo;
|
|
2602
|
-
exports.useReducer = useReducer;
|
|
2603
|
-
exports.useRef = useRef;
|
|
2604
|
-
exports.useState = useState;
|
|
2605
|
-
exports.useSyncExternalStore = useSyncExternalStore;
|
|
2606
|
-
exports.useTransition = useTransition;
|
|
2607
|
-
exports.version = ReactVersion;
|
|
2608
|
-
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== "undefined" && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === "function") {
|
|
2609
|
-
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2540
|
+
exports.Children = Children;
|
|
2541
|
+
exports.Component = Component;
|
|
2542
|
+
exports.Fragment = REACT_FRAGMENT_TYPE;
|
|
2543
|
+
exports.Profiler = REACT_PROFILER_TYPE;
|
|
2544
|
+
exports.PureComponent = PureComponent;
|
|
2545
|
+
exports.StrictMode = REACT_STRICT_MODE_TYPE;
|
|
2546
|
+
exports.Suspense = REACT_SUSPENSE_TYPE;
|
|
2547
|
+
exports.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED = ReactSharedInternals;
|
|
2548
|
+
exports.cloneElement = cloneElement$1;
|
|
2549
|
+
exports.createContext = createContext;
|
|
2550
|
+
exports.createElement = createElement$1;
|
|
2551
|
+
exports.createFactory = createFactory;
|
|
2552
|
+
exports.createRef = createRef;
|
|
2553
|
+
exports.forwardRef = forwardRef;
|
|
2554
|
+
exports.isValidElement = isValidElement;
|
|
2555
|
+
exports.lazy = lazy;
|
|
2556
|
+
exports.memo = memo;
|
|
2557
|
+
exports.startTransition = startTransition;
|
|
2558
|
+
exports.unstable_act = act;
|
|
2559
|
+
exports.useCallback = useCallback;
|
|
2560
|
+
exports.useContext = useContext;
|
|
2561
|
+
exports.useDebugValue = useDebugValue;
|
|
2562
|
+
exports.useDeferredValue = useDeferredValue;
|
|
2563
|
+
exports.useEffect = useEffect;
|
|
2564
|
+
exports.useId = useId;
|
|
2565
|
+
exports.useImperativeHandle = useImperativeHandle;
|
|
2566
|
+
exports.useInsertionEffect = useInsertionEffect;
|
|
2567
|
+
exports.useLayoutEffect = useLayoutEffect;
|
|
2568
|
+
exports.useMemo = useMemo;
|
|
2569
|
+
exports.useReducer = useReducer;
|
|
2570
|
+
exports.useRef = useRef;
|
|
2571
|
+
exports.useState = useState;
|
|
2572
|
+
exports.useSyncExternalStore = useSyncExternalStore;
|
|
2573
|
+
exports.useTransition = useTransition;
|
|
2574
|
+
exports.version = ReactVersion;
|
|
2575
|
+
/* global __REACT_DEVTOOLS_GLOBAL_HOOK__ */ if (typeof __REACT_DEVTOOLS_GLOBAL_HOOK__ !== 'undefined' && typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop === 'function') {
|
|
2576
|
+
__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(new Error());
|
|
2610
2577
|
}
|
|
2611
2578
|
})();
|
|
2612
2579
|
}
|
|
@@ -2614,350 +2581,218 @@ function requireReact_development() {
|
|
|
2614
2581
|
return react_development.exports;
|
|
2615
2582
|
}
|
|
2616
2583
|
|
|
2617
|
-
(
|
|
2618
|
-
|
|
2619
|
-
|
|
2620
|
-
|
|
2621
|
-
module.exports = requireReact_development();
|
|
2622
|
-
}
|
|
2623
|
-
})(react);
|
|
2624
|
-
var React = /*@__PURE__*/ getDefaultExportFromCjs(react.exports);
|
|
2625
|
-
|
|
2626
|
-
function _extends$1() {
|
|
2627
|
-
_extends$1 = Object.assign || function(target) {
|
|
2628
|
-
for(var i = 1; i < arguments.length; i++){
|
|
2629
|
-
var source = arguments[i];
|
|
2630
|
-
for(var key in source){
|
|
2631
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2632
|
-
target[key] = source[key];
|
|
2633
|
-
}
|
|
2634
|
-
}
|
|
2635
|
-
}
|
|
2636
|
-
return target;
|
|
2637
|
-
};
|
|
2638
|
-
return _extends$1.apply(this, arguments);
|
|
2639
|
-
}
|
|
2640
|
-
function Box(param) {
|
|
2641
|
-
var children = param.children, smallText = param.smallText, padding = param.padding, flex = param.flex, style = param.style;
|
|
2642
|
-
var styles = _extends$1({
|
|
2643
|
-
flex: flex
|
|
2644
|
-
}, layoutPropsToStyles({
|
|
2645
|
-
padding: padding
|
|
2646
|
-
}), style);
|
|
2647
|
-
var className = classList({
|
|
2648
|
-
"jb-box": true,
|
|
2649
|
-
"jbx-small-text": smallText
|
|
2650
|
-
});
|
|
2651
|
-
return /*#__PURE__*/ React.createElement("div", {
|
|
2652
|
-
className: className,
|
|
2653
|
-
style: styles
|
|
2654
|
-
}, children);
|
|
2584
|
+
if (process.env.NODE_ENV === 'production') {
|
|
2585
|
+
react.exports = requireReact_production_min();
|
|
2586
|
+
} else {
|
|
2587
|
+
react.exports = requireReact_development();
|
|
2655
2588
|
}
|
|
2589
|
+
var reactExports = react.exports;
|
|
2590
|
+
var React = /*@__PURE__*/ getDefaultExportFromCjs(reactExports);
|
|
2656
2591
|
|
|
2657
|
-
|
|
2658
|
-
|
|
2659
|
-
|
|
2660
|
-
name: "PINTR",
|
|
2661
|
-
description: "Tool that turns your images into plotter-like line drawings",
|
|
2662
|
-
url: "https://javier.xyz/pintr/"
|
|
2663
|
-
},
|
|
2664
|
-
{
|
|
2665
|
-
name: "Visual Center",
|
|
2666
|
-
description: "Tool that help you visually center objects in a container",
|
|
2667
|
-
url: "https://javier.xyz/visual-center/"
|
|
2668
|
-
},
|
|
2669
|
-
{
|
|
2670
|
-
name: "Brutalita",
|
|
2671
|
-
description: "Grid based font editor and font. Create fonts in the browser and export OpenType files",
|
|
2672
|
-
url: "https://brutalita.com/"
|
|
2673
|
-
},
|
|
2674
|
-
{
|
|
2675
|
-
name: "Morphin",
|
|
2676
|
-
description: "Create animated CSS transitions. Add sprites and get the code ready to paste in your site",
|
|
2677
|
-
url: "https://javier.xyz/morphin/"
|
|
2678
|
-
},
|
|
2679
|
-
{
|
|
2680
|
-
name: "Droste Creator",
|
|
2681
|
-
description: "Create recursive images with the droste effect",
|
|
2682
|
-
url: "https://javier.xyz/droste-creator/"
|
|
2683
|
-
},
|
|
2684
|
-
{
|
|
2685
|
-
name: "Sombras.app",
|
|
2686
|
-
description: "Create art with shadows. Draw shadows and get 3D objects that project them.",
|
|
2687
|
-
url: "https://sombras.app/"
|
|
2688
|
-
},
|
|
2689
|
-
{
|
|
2690
|
-
name: "Cohesive Colors",
|
|
2691
|
-
description: "Tool that can help you to create cohesive color palettes",
|
|
2692
|
-
url: "https://javier.xyz/cohesive-colors/"
|
|
2693
|
-
}
|
|
2694
|
-
];
|
|
2695
|
-
var projects = PROJECT_DATA.filter(function(project) {
|
|
2696
|
-
return !project.url.includes(document.location.pathname);
|
|
2697
|
-
});
|
|
2698
|
-
var projectIndex = PROJECT_DATA.findIndex(function(project) {
|
|
2699
|
-
return !project.url.includes(document.location.pathname);
|
|
2700
|
-
});
|
|
2701
|
-
var seed = Math.floor(new Date().getTime() / (60 * 60 * 1000)) + projectIndex;
|
|
2702
|
-
function MoreExperiments() {
|
|
2703
|
-
var items = new Array(4).fill("").map(function(_0, idx) {
|
|
2704
|
-
var project = projects[(seed + idx) % projects.length];
|
|
2705
|
-
return /*#__PURE__*/ React.createElement(Li, {
|
|
2706
|
-
key: project.url
|
|
2707
|
-
}, /*#__PURE__*/ React.createElement(A, {
|
|
2708
|
-
href: project.url
|
|
2709
|
-
}, project.name), ", ", project.description, ".");
|
|
2710
|
-
});
|
|
2711
|
-
return /*#__PURE__*/ React.createElement(react.exports.Fragment, null, /*#__PURE__*/ React.createElement(Text, null, "More experiments"), /*#__PURE__*/ React.createElement(Space, {
|
|
2712
|
-
h: 1
|
|
2713
|
-
}), /*#__PURE__*/ React.createElement(Ul, null, items));
|
|
2714
|
-
}
|
|
2592
|
+
const SIZE = 16;
|
|
2593
|
+
const BASE_RADIUS = SIZE / 3;
|
|
2594
|
+
const BASE_FONT_SIZE = SIZE;
|
|
2715
2595
|
|
|
2716
|
-
|
|
2717
|
-
|
|
2718
|
-
|
|
2719
|
-
|
|
2720
|
-
var source = arguments[i];
|
|
2721
|
-
for(var key in source){
|
|
2722
|
-
if (Object.prototype.hasOwnProperty.call(source, key)) {
|
|
2723
|
-
target[key] = source[key];
|
|
2724
|
-
}
|
|
2725
|
-
}
|
|
2726
|
-
}
|
|
2727
|
-
return target;
|
|
2728
|
-
};
|
|
2729
|
-
return _extends.apply(this, arguments);
|
|
2730
|
-
}
|
|
2731
|
-
function _objectWithoutPropertiesLoose(source, excluded) {
|
|
2732
|
-
if (source == null) return {};
|
|
2733
|
-
var target = {};
|
|
2734
|
-
var sourceKeys = Object.keys(source);
|
|
2735
|
-
var key, i;
|
|
2736
|
-
for(i = 0; i < sourceKeys.length; i++){
|
|
2737
|
-
key = sourceKeys[i];
|
|
2738
|
-
if (excluded.indexOf(key) >= 0) continue;
|
|
2739
|
-
target[key] = source[key];
|
|
2596
|
+
function layoutPropsToStyles({ padding }) {
|
|
2597
|
+
let newStyles = {};
|
|
2598
|
+
if (padding) {
|
|
2599
|
+
newStyles.padding = `${SIZE * padding}px`;
|
|
2740
2600
|
}
|
|
2741
|
-
return
|
|
2742
|
-
}
|
|
2743
|
-
var SIZE = getSettings().size;
|
|
2744
|
-
var BASE_RADIUS = SIZE / 3;
|
|
2745
|
-
var BASE_FONT_SIZE = SIZE;
|
|
2746
|
-
function getSettings() {
|
|
2747
|
-
var sizeSrc = getComputedStyle(document.documentElement).getPropertyValue("--size");
|
|
2748
|
-
return {
|
|
2749
|
-
size: parseInt(sizeSrc)
|
|
2750
|
-
};
|
|
2601
|
+
return newStyles;
|
|
2751
2602
|
}
|
|
2603
|
+
|
|
2752
2604
|
function classList(classes) {
|
|
2753
2605
|
if (Array.isArray(classes)) {
|
|
2754
|
-
return classes.filter(
|
|
2755
|
-
return e;
|
|
2756
|
-
}).join(" ");
|
|
2606
|
+
return classes.filter((e)=>e).join(' ');
|
|
2757
2607
|
} else {
|
|
2758
|
-
return Object.keys(classes).filter(
|
|
2759
|
-
return classes[e];
|
|
2760
|
-
}).join(" ");
|
|
2608
|
+
return Object.keys(classes).filter((e)=>classes[e]).join(' ');
|
|
2761
2609
|
}
|
|
2762
2610
|
}
|
|
2763
|
-
|
|
2764
|
-
|
|
2765
|
-
|
|
2766
|
-
|
|
2767
|
-
|
|
2768
|
-
|
|
2769
|
-
|
|
2611
|
+
|
|
2612
|
+
function Box({ children, smallText, padding, flex, style }) {
|
|
2613
|
+
const styles = {
|
|
2614
|
+
flex,
|
|
2615
|
+
...layoutPropsToStyles({
|
|
2616
|
+
padding
|
|
2617
|
+
}),
|
|
2618
|
+
...style
|
|
2619
|
+
};
|
|
2620
|
+
const className = classList({
|
|
2621
|
+
'jb-box': true,
|
|
2622
|
+
'jbx-small-text': smallText
|
|
2623
|
+
});
|
|
2624
|
+
return /*#__PURE__*/ React.createElement("div", {
|
|
2625
|
+
className: className,
|
|
2626
|
+
style: styles
|
|
2627
|
+
}, children);
|
|
2770
2628
|
}
|
|
2771
|
-
|
|
2772
|
-
|
|
2773
|
-
|
|
2774
|
-
|
|
2775
|
-
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2779
|
-
|
|
2780
|
-
|
|
2781
|
-
|
|
2782
|
-
|
|
2783
|
-
|
|
2784
|
-
|
|
2785
|
-
}, {}) : props;
|
|
2786
|
-
var calculatedStyle = typeof styleSrc === "function" ? styleSrc(props) : styleSrc;
|
|
2787
|
-
return /*#__PURE__*/ React.createElement(element, _extends({
|
|
2788
|
-
className: className,
|
|
2789
|
-
style: _extends({}, style, calculatedStyle)
|
|
2790
|
-
}, passProps), children);
|
|
2629
|
+
|
|
2630
|
+
function Component(className, styleSrc = {}, config = {}) {
|
|
2631
|
+
const { element = `div`, props: otherProps } = config;
|
|
2632
|
+
return function MakeComponent({ children, style = {}, ...props }) {
|
|
2633
|
+
const calculatedStyle = typeof styleSrc === 'function' ? styleSrc(props) : styleSrc;
|
|
2634
|
+
return /*#__PURE__*/ reactExports.createElement(element, {
|
|
2635
|
+
className,
|
|
2636
|
+
style: {
|
|
2637
|
+
...style,
|
|
2638
|
+
...calculatedStyle
|
|
2639
|
+
},
|
|
2640
|
+
...otherProps,
|
|
2641
|
+
...props
|
|
2642
|
+
}, children);
|
|
2791
2643
|
};
|
|
2792
2644
|
}
|
|
2793
|
-
|
|
2794
|
-
|
|
2795
|
-
|
|
2796
|
-
|
|
2797
|
-
element:
|
|
2798
|
-
});
|
|
2799
|
-
var Input = Component("jbx-input", null, {
|
|
2800
|
-
element: "input"
|
|
2645
|
+
const Container = Component(`jbx-container`);
|
|
2646
|
+
const Text = Component(`jbx-text`);
|
|
2647
|
+
const SmallText = Component(`jbx-small-text`);
|
|
2648
|
+
const Button = Component(`jbx-button`, {}, {
|
|
2649
|
+
element: 'button'
|
|
2801
2650
|
});
|
|
2802
|
-
|
|
2803
|
-
element:
|
|
2651
|
+
const Input = Component(`jbx-input`, {}, {
|
|
2652
|
+
element: 'input'
|
|
2804
2653
|
});
|
|
2805
|
-
|
|
2806
|
-
element:
|
|
2654
|
+
const Range = Component(`jbx-range`, {}, {
|
|
2655
|
+
element: 'input',
|
|
2656
|
+
props: {
|
|
2657
|
+
type: 'range'
|
|
2658
|
+
}
|
|
2807
2659
|
});
|
|
2808
|
-
|
|
2809
|
-
element:
|
|
2660
|
+
const HeaderH1 = Component(`jbx-h${1}`, {}, {
|
|
2661
|
+
element: 'h1'
|
|
2810
2662
|
});
|
|
2811
|
-
|
|
2812
|
-
element:
|
|
2663
|
+
const HeaderH2 = Component(`jbx-h${2}`, {}, {
|
|
2664
|
+
element: 'h2'
|
|
2813
2665
|
});
|
|
2814
|
-
|
|
2815
|
-
element:
|
|
2666
|
+
const HeaderH3 = Component(`jbx-h${3}`, {}, {
|
|
2667
|
+
element: 'h3'
|
|
2816
2668
|
});
|
|
2817
|
-
|
|
2818
|
-
element:
|
|
2669
|
+
const HeaderH4 = Component(`jbx-h${4}`, {}, {
|
|
2670
|
+
element: 'h4'
|
|
2819
2671
|
});
|
|
2820
|
-
|
|
2821
|
-
|
|
2822
|
-
var content = String(children).split(" ");
|
|
2823
|
-
return /*#__PURE__*/ React.createElement(react.exports.Fragment, {}, content.map(function(word) {
|
|
2824
|
-
return /*#__PURE__*/ React.createElement(HeaderH1, {
|
|
2825
|
-
key: word,
|
|
2826
|
-
style: _extends({
|
|
2827
|
-
display: "inline-block",
|
|
2828
|
-
width: "auto",
|
|
2829
|
-
padding: "6px",
|
|
2830
|
-
margin: 0,
|
|
2831
|
-
backgroundColor: "var(--accent-color)"
|
|
2832
|
-
}, style)
|
|
2833
|
-
}, word);
|
|
2834
|
-
}));
|
|
2835
|
-
};
|
|
2836
|
-
var A = Component("jbx-a", null, {
|
|
2837
|
-
element: "a"
|
|
2672
|
+
const HR = Component(`jbx-hr`, {}, {
|
|
2673
|
+
element: 'hr'
|
|
2838
2674
|
});
|
|
2839
|
-
|
|
2840
|
-
|
|
2841
|
-
display: props.inline ? "inline-block" : "block",
|
|
2842
|
-
height: "" + SIZE * props.h + "px",
|
|
2843
|
-
width: "" + SIZE * props.w + "px"
|
|
2844
|
-
};
|
|
2845
|
-
});
|
|
2846
|
-
var Inline = Component("jbx-inline", function(param) {
|
|
2847
|
-
var v = param.v, h = param.h, gap = param.gap, _wrap = param.wrap, wrap = _wrap === void 0 ? false : _wrap;
|
|
2848
|
-
return {
|
|
2849
|
-
marginLeft: "" + h * SIZE + "px",
|
|
2850
|
-
marginRight: "" + h * SIZE + "px",
|
|
2851
|
-
marginTop: "" + v * SIZE + "px",
|
|
2852
|
-
marginBottom: "" + v * SIZE + "px",
|
|
2853
|
-
gap: "" + gap * SIZE + "px",
|
|
2854
|
-
flexWrap: wrap ? "wrap" : "no-wrap"
|
|
2855
|
-
};
|
|
2675
|
+
const MainHeader = Component(`jbx-main-h1`, {}, {
|
|
2676
|
+
element: 'h1'
|
|
2856
2677
|
});
|
|
2857
|
-
|
|
2858
|
-
|
|
2859
|
-
return {
|
|
2860
|
-
marginLeft: "" + h * SIZE + "px",
|
|
2861
|
-
marginRight: "" + h * SIZE + "px",
|
|
2862
|
-
marginTop: "" + v * SIZE + "px",
|
|
2863
|
-
marginBottom: "" + v * SIZE + "px",
|
|
2864
|
-
gap: "" + gap * SIZE + "px"
|
|
2865
|
-
};
|
|
2678
|
+
const A = Component(`jbx-a`, {}, {
|
|
2679
|
+
element: 'a'
|
|
2866
2680
|
});
|
|
2867
|
-
|
|
2868
|
-
|
|
2681
|
+
const Space = Component(`jbx-space`, ({ inline, h, w })=>({
|
|
2682
|
+
display: inline ? 'inline-block' : 'block',
|
|
2683
|
+
height: h ? `${SIZE * h}px` : undefined,
|
|
2684
|
+
width: w ? `${SIZE * w}px` : undefined
|
|
2685
|
+
}));
|
|
2686
|
+
const Inline = Component(`jbx-inline`, ({ v, h, gap, wrap = false })=>({
|
|
2687
|
+
marginLeft: h ? `${h * SIZE}px` : undefined,
|
|
2688
|
+
marginRight: h ? `${h * SIZE}px` : undefined,
|
|
2689
|
+
marginTop: v ? `${v * SIZE}px` : undefined,
|
|
2690
|
+
marginBottom: v ? `${v * SIZE}px` : undefined,
|
|
2691
|
+
gap: gap ? `${gap * SIZE}px` : undefined,
|
|
2692
|
+
flexWrap: wrap ? 'wrap' : 'no-wrap'
|
|
2693
|
+
}));
|
|
2694
|
+
const Stack = Component(`jbx-stack`, ({ v, h, gap })=>({
|
|
2695
|
+
marginLeft: h ? `${h * SIZE}px` : undefined,
|
|
2696
|
+
marginRight: h ? `${h * SIZE}px` : undefined,
|
|
2697
|
+
marginTop: v ? `${v * SIZE}px` : undefined,
|
|
2698
|
+
marginBottom: v ? `${v * SIZE}px` : undefined,
|
|
2699
|
+
gap: gap ? `${gap * SIZE}px` : undefined
|
|
2700
|
+
}));
|
|
2701
|
+
const Dropzone = Component(`jbx-dropzone`);
|
|
2702
|
+
const Ul = Component(`jbx-ul`, {
|
|
2869
2703
|
margin: 0,
|
|
2870
|
-
padding:
|
|
2704
|
+
padding: `0 0 0 ${BASE_FONT_SIZE / 4}px`
|
|
2871
2705
|
}, {
|
|
2872
|
-
element:
|
|
2706
|
+
element: 'ul'
|
|
2873
2707
|
});
|
|
2874
|
-
|
|
2875
|
-
margin:
|
|
2876
|
-
padding:
|
|
2708
|
+
const Li = Component(`jbx-li`, {
|
|
2709
|
+
margin: `0 0 0 ${SIZE}px`,
|
|
2710
|
+
padding: `${SIZE / 4}px 0`
|
|
2877
2711
|
}, {
|
|
2878
|
-
element:
|
|
2712
|
+
element: 'li'
|
|
2879
2713
|
});
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
backgroundColor: active ? "#000" : info ? "#fff" : "#ecf0f1",
|
|
2887
|
-
color: active ? "#fff" : "#000",
|
|
2714
|
+
const Tabs = Component(`jbx-tabs`);
|
|
2715
|
+
const Tab = Component(`jbx-tabs--tab`, ({ info, active })=>({
|
|
2716
|
+
userSelect: 'none',
|
|
2717
|
+
cursor: 'pointer',
|
|
2718
|
+
backgroundColor: active ? '#000' : info ? '#fff' : '#ecf0f1',
|
|
2719
|
+
color: active ? '#fff' : '#000',
|
|
2888
2720
|
padding: SIZE / 2,
|
|
2889
2721
|
paddingLeft: info ? 0 : SIZE / 2
|
|
2890
|
-
};
|
|
2891
|
-
}, {
|
|
2892
|
-
|
|
2893
|
-
"info",
|
|
2894
|
-
"active"
|
|
2895
|
-
]
|
|
2896
|
-
});
|
|
2897
|
-
var CodeSnippet = Component("jbx-code-snippet", null, {
|
|
2898
|
-
element: "pre"
|
|
2722
|
+
}));
|
|
2723
|
+
const CodeSnippet = Component(`jbx-code-snippet`, {}, {
|
|
2724
|
+
element: 'pre'
|
|
2899
2725
|
});
|
|
2900
|
-
|
|
2901
|
-
element:
|
|
2726
|
+
const CodeTextarea = Component(`jbx-code-area`, {}, {
|
|
2727
|
+
element: 'textarea'
|
|
2902
2728
|
});
|
|
2903
|
-
|
|
2904
|
-
var checked = param.checked;
|
|
2729
|
+
const CheckboxHidden = Component(`jbx-checkbox-hidden`, ({ checked })=>{
|
|
2905
2730
|
return {
|
|
2906
2731
|
height: SIZE * 2 - 4,
|
|
2907
2732
|
width: SIZE * 2 - 4,
|
|
2908
2733
|
paddingTop: 2,
|
|
2909
2734
|
paddingLeft: 2,
|
|
2910
|
-
backgroundColor: checked ?
|
|
2735
|
+
backgroundColor: checked ? 'var(--accent-color)' : 'white',
|
|
2911
2736
|
borderRadius: BASE_RADIUS,
|
|
2912
|
-
boxShadow: checked ?
|
|
2913
|
-
cursor:
|
|
2737
|
+
boxShadow: checked ? 'inset rgba(0, 0, 0, 0.07) 0 0 0 1px' : 'inset rgba(0, 0, 0, 0.33) 0 0 0 1.5px',
|
|
2738
|
+
cursor: 'pointer'
|
|
2914
2739
|
};
|
|
2915
2740
|
});
|
|
2916
|
-
|
|
2917
|
-
|
|
2918
|
-
|
|
2919
|
-
|
|
2920
|
-
|
|
2921
|
-
|
|
2922
|
-
|
|
2923
|
-
|
|
2924
|
-
|
|
2925
|
-
|
|
2926
|
-
|
|
2927
|
-
|
|
2928
|
-
|
|
2929
|
-
|
|
2930
|
-
|
|
2931
|
-
|
|
2932
|
-
|
|
2933
|
-
|
|
2934
|
-
|
|
2935
|
-
|
|
2936
|
-
|
|
2937
|
-
|
|
2938
|
-
|
|
2939
|
-
|
|
2940
|
-
|
|
2941
|
-
|
|
2942
|
-
|
|
2943
|
-
|
|
2944
|
-
|
|
2945
|
-
|
|
2946
|
-
|
|
2947
|
-
|
|
2948
|
-
|
|
2949
|
-
|
|
2950
|
-
|
|
2951
|
-
|
|
2952
|
-
|
|
2953
|
-
|
|
2954
|
-
|
|
2955
|
-
|
|
2956
|
-
|
|
2957
|
-
|
|
2958
|
-
|
|
2959
|
-
|
|
2960
|
-
|
|
2741
|
+
// export const Checkbox = function Checkbox({
|
|
2742
|
+
// label,
|
|
2743
|
+
// checked,
|
|
2744
|
+
// onChange
|
|
2745
|
+
// }: {
|
|
2746
|
+
// label: string;
|
|
2747
|
+
// checked: boolean;
|
|
2748
|
+
// onChange?: (value: boolean) => void;
|
|
2749
|
+
// }) {
|
|
2750
|
+
// return React.createElement(
|
|
2751
|
+
// Inline,
|
|
2752
|
+
// {
|
|
2753
|
+
// onClick: () => {
|
|
2754
|
+
// if (onChange) {
|
|
2755
|
+
// onChange(!checked);
|
|
2756
|
+
// }
|
|
2757
|
+
// },
|
|
2758
|
+
// style: {
|
|
2759
|
+
// alignItems: 'center',
|
|
2760
|
+
// cursor: 'pointer'
|
|
2761
|
+
// }
|
|
2762
|
+
// },
|
|
2763
|
+
// [
|
|
2764
|
+
// React.createElement(
|
|
2765
|
+
// CheckboxHidden,
|
|
2766
|
+
// {
|
|
2767
|
+
// key: 0,
|
|
2768
|
+
// checked
|
|
2769
|
+
// },
|
|
2770
|
+
// React.createElement(
|
|
2771
|
+
// 'svg',
|
|
2772
|
+
// {
|
|
2773
|
+
// xmlns: 'http://www.w3.org/2000/svg',
|
|
2774
|
+
// width: SIZE * 2 - 8,
|
|
2775
|
+
// height: SIZE * 2 - 8,
|
|
2776
|
+
// fill: 'none',
|
|
2777
|
+
// stroke: 'currentColor',
|
|
2778
|
+
// strokeLinecap: 'round',
|
|
2779
|
+
// strokeLinejoin: 'round',
|
|
2780
|
+
// strokeWidth: '2',
|
|
2781
|
+
// className: 'feather feather-check',
|
|
2782
|
+
// viewBox: '0 0 24 24',
|
|
2783
|
+
// color: checked ? 'white' : '#ddd'
|
|
2784
|
+
// },
|
|
2785
|
+
// React.createElement('path', {
|
|
2786
|
+
// d: 'M20 6L9 17 4 12'
|
|
2787
|
+
// })
|
|
2788
|
+
// )
|
|
2789
|
+
// ),
|
|
2790
|
+
// React.createElement(Space, { key: 1, w: 0.5 }),
|
|
2791
|
+
// React.createElement(Text, { key: 2, style: { userSelect: 'none' } }, label)
|
|
2792
|
+
// ]
|
|
2793
|
+
// );
|
|
2794
|
+
// };
|
|
2795
|
+
function Bullet({ value }) {
|
|
2961
2796
|
return /*#__PURE__*/ React.createElement("div", {
|
|
2962
2797
|
className: "jbx-bullet-container"
|
|
2963
2798
|
}, /*#__PURE__*/ React.createElement("div", {
|
|
@@ -2965,4 +2800,4 @@ function Bullet(param) {
|
|
|
2965
2800
|
}, value));
|
|
2966
2801
|
}
|
|
2967
2802
|
|
|
2968
|
-
export { A, Box, Bullet, Button,
|
|
2803
|
+
export { A, Box, Bullet, Button, CheckboxHidden, CodeSnippet, CodeTextarea, Component, Container, Dropzone, HR, HeaderH1, HeaderH2, HeaderH3, HeaderH4, Inline, Input, Li, MainHeader, Range, SmallText, Space, Stack, Tab, Tabs, Text, Ul };
|