@easy-editor/react-renderer 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cjs/index.development.js +1086 -116
- package/dist/cjs/index.development.js.map +1 -1
- package/dist/cjs/index.js +1086 -116
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.production.js +1086 -116
- package/dist/cjs/index.production.js.map +1 -1
- package/dist/esm/index.development.js +1068 -98
- package/dist/esm/index.development.js.map +1 -1
- package/dist/esm/index.js +1068 -98
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.production.js +1068 -98
- package/dist/esm/index.production.js.map +1 -1
- package/dist/index.js +1068 -98
- package/package.json +5 -4
package/dist/index.js
CHANGED
|
@@ -1,18 +1,8 @@
|
|
|
1
1
|
import { observer } from 'mobx-react';
|
|
2
|
-
import { createContext, useContext, useMemo, Component, forwardRef, createElement, PureComponent } from 'react';
|
|
2
|
+
import require$$0, { createContext, useContext, useMemo, Component, forwardRef, createElement, PureComponent } from 'react';
|
|
3
3
|
import { isSetterConfig, createLogger, isJSExpression, TRANSFORM_STAGE, DESIGNER_EVENT, isJSFunction, logger as logger$1 } from '@easy-editor/core';
|
|
4
4
|
import { debounce, isEmpty, forEach } from 'lodash-es';
|
|
5
5
|
|
|
6
|
-
function _extends() {
|
|
7
|
-
return _extends = Object.assign ? Object.assign.bind() : function (n) {
|
|
8
|
-
for (var e = 1; e < arguments.length; e++) {
|
|
9
|
-
var t = arguments[e];
|
|
10
|
-
for (var r in t) ({}).hasOwnProperty.call(t, r) && (n[r] = t[r]);
|
|
11
|
-
}
|
|
12
|
-
return n;
|
|
13
|
-
}, _extends.apply(null, arguments);
|
|
14
|
-
}
|
|
15
|
-
|
|
16
6
|
const SettingRendererContext = /*#__PURE__*/createContext({});
|
|
17
7
|
const useSettingRendererContext = () => {
|
|
18
8
|
try {
|
|
@@ -23,6 +13,964 @@ const useSettingRendererContext = () => {
|
|
|
23
13
|
return {};
|
|
24
14
|
};
|
|
25
15
|
|
|
16
|
+
var jsxRuntime = {exports: {}};
|
|
17
|
+
|
|
18
|
+
var reactJsxRuntime_production_min = {};
|
|
19
|
+
|
|
20
|
+
/**
|
|
21
|
+
* @license React
|
|
22
|
+
* react-jsx-runtime.production.min.js
|
|
23
|
+
*
|
|
24
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
25
|
+
*
|
|
26
|
+
* This source code is licensed under the MIT license found in the
|
|
27
|
+
* LICENSE file in the root directory of this source tree.
|
|
28
|
+
*/
|
|
29
|
+
var hasRequiredReactJsxRuntime_production_min;
|
|
30
|
+
function requireReactJsxRuntime_production_min() {
|
|
31
|
+
if (hasRequiredReactJsxRuntime_production_min) return reactJsxRuntime_production_min;
|
|
32
|
+
hasRequiredReactJsxRuntime_production_min = 1;
|
|
33
|
+
var f = require$$0,
|
|
34
|
+
k = Symbol.for("react.element"),
|
|
35
|
+
l = Symbol.for("react.fragment"),
|
|
36
|
+
m = Object.prototype.hasOwnProperty,
|
|
37
|
+
n = f.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,
|
|
38
|
+
p = {
|
|
39
|
+
key: !0,
|
|
40
|
+
ref: !0,
|
|
41
|
+
__self: !0,
|
|
42
|
+
__source: !0
|
|
43
|
+
};
|
|
44
|
+
function q(c, a, g) {
|
|
45
|
+
var b,
|
|
46
|
+
d = {},
|
|
47
|
+
e = null,
|
|
48
|
+
h = null;
|
|
49
|
+
void 0 !== g && (e = "" + g);
|
|
50
|
+
void 0 !== a.key && (e = "" + a.key);
|
|
51
|
+
void 0 !== a.ref && (h = a.ref);
|
|
52
|
+
for (b in a) m.call(a, b) && !p.hasOwnProperty(b) && (d[b] = a[b]);
|
|
53
|
+
if (c && c.defaultProps) for (b in a = c.defaultProps, a) void 0 === d[b] && (d[b] = a[b]);
|
|
54
|
+
return {
|
|
55
|
+
$$typeof: k,
|
|
56
|
+
type: c,
|
|
57
|
+
key: e,
|
|
58
|
+
ref: h,
|
|
59
|
+
props: d,
|
|
60
|
+
_owner: n.current
|
|
61
|
+
};
|
|
62
|
+
}
|
|
63
|
+
reactJsxRuntime_production_min.Fragment = l;
|
|
64
|
+
reactJsxRuntime_production_min.jsx = q;
|
|
65
|
+
reactJsxRuntime_production_min.jsxs = q;
|
|
66
|
+
return reactJsxRuntime_production_min;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
var reactJsxRuntime_development = {};
|
|
70
|
+
|
|
71
|
+
/**
|
|
72
|
+
* @license React
|
|
73
|
+
* react-jsx-runtime.development.js
|
|
74
|
+
*
|
|
75
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
76
|
+
*
|
|
77
|
+
* This source code is licensed under the MIT license found in the
|
|
78
|
+
* LICENSE file in the root directory of this source tree.
|
|
79
|
+
*/
|
|
80
|
+
var hasRequiredReactJsxRuntime_development;
|
|
81
|
+
function requireReactJsxRuntime_development() {
|
|
82
|
+
if (hasRequiredReactJsxRuntime_development) return reactJsxRuntime_development;
|
|
83
|
+
hasRequiredReactJsxRuntime_development = 1;
|
|
84
|
+
if (process.env.NODE_ENV !== "production") {
|
|
85
|
+
(function () {
|
|
86
|
+
var React = require$$0;
|
|
87
|
+
var REACT_ELEMENT_TYPE = Symbol.for('react.element');
|
|
88
|
+
var REACT_PORTAL_TYPE = Symbol.for('react.portal');
|
|
89
|
+
var REACT_FRAGMENT_TYPE = Symbol.for('react.fragment');
|
|
90
|
+
var REACT_STRICT_MODE_TYPE = Symbol.for('react.strict_mode');
|
|
91
|
+
var REACT_PROFILER_TYPE = Symbol.for('react.profiler');
|
|
92
|
+
var REACT_PROVIDER_TYPE = Symbol.for('react.provider');
|
|
93
|
+
var REACT_CONTEXT_TYPE = Symbol.for('react.context');
|
|
94
|
+
var REACT_FORWARD_REF_TYPE = Symbol.for('react.forward_ref');
|
|
95
|
+
var REACT_SUSPENSE_TYPE = Symbol.for('react.suspense');
|
|
96
|
+
var REACT_SUSPENSE_LIST_TYPE = Symbol.for('react.suspense_list');
|
|
97
|
+
var REACT_MEMO_TYPE = Symbol.for('react.memo');
|
|
98
|
+
var REACT_LAZY_TYPE = Symbol.for('react.lazy');
|
|
99
|
+
var REACT_OFFSCREEN_TYPE = Symbol.for('react.offscreen');
|
|
100
|
+
var MAYBE_ITERATOR_SYMBOL = Symbol.iterator;
|
|
101
|
+
var FAUX_ITERATOR_SYMBOL = '@@iterator';
|
|
102
|
+
function getIteratorFn(maybeIterable) {
|
|
103
|
+
if (maybeIterable === null || typeof maybeIterable !== 'object') {
|
|
104
|
+
return null;
|
|
105
|
+
}
|
|
106
|
+
var maybeIterator = MAYBE_ITERATOR_SYMBOL && maybeIterable[MAYBE_ITERATOR_SYMBOL] || maybeIterable[FAUX_ITERATOR_SYMBOL];
|
|
107
|
+
if (typeof maybeIterator === 'function') {
|
|
108
|
+
return maybeIterator;
|
|
109
|
+
}
|
|
110
|
+
return null;
|
|
111
|
+
}
|
|
112
|
+
var ReactSharedInternals = React.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED;
|
|
113
|
+
function error(format) {
|
|
114
|
+
{
|
|
115
|
+
{
|
|
116
|
+
for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
|
|
117
|
+
args[_key2 - 1] = arguments[_key2];
|
|
118
|
+
}
|
|
119
|
+
printWarning('error', format, args);
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
function printWarning(level, format, args) {
|
|
124
|
+
{
|
|
125
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
126
|
+
var stack = ReactDebugCurrentFrame.getStackAddendum();
|
|
127
|
+
if (stack !== '') {
|
|
128
|
+
format += '%s';
|
|
129
|
+
args = args.concat([stack]);
|
|
130
|
+
}
|
|
131
|
+
var argsWithFormat = args.map(function (item) {
|
|
132
|
+
return String(item);
|
|
133
|
+
});
|
|
134
|
+
argsWithFormat.unshift('Warning: ' + format);
|
|
135
|
+
Function.prototype.apply.call(console[level], console, argsWithFormat);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
var enableScopeAPI = false;
|
|
139
|
+
var enableCacheElement = false;
|
|
140
|
+
var enableTransitionTracing = false;
|
|
141
|
+
var enableLegacyHidden = false;
|
|
142
|
+
var enableDebugTracing = false;
|
|
143
|
+
var REACT_MODULE_REFERENCE;
|
|
144
|
+
{
|
|
145
|
+
REACT_MODULE_REFERENCE = Symbol.for('react.module.reference');
|
|
146
|
+
}
|
|
147
|
+
function isValidElementType(type) {
|
|
148
|
+
if (typeof type === 'string' || typeof type === 'function') {
|
|
149
|
+
return true;
|
|
150
|
+
}
|
|
151
|
+
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) {
|
|
152
|
+
return true;
|
|
153
|
+
}
|
|
154
|
+
if (typeof type === 'object' && type !== null) {
|
|
155
|
+
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 ||
|
|
156
|
+
type.$$typeof === REACT_MODULE_REFERENCE || type.getModuleId !== undefined) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
return false;
|
|
161
|
+
}
|
|
162
|
+
function getWrappedName(outerType, innerType, wrapperName) {
|
|
163
|
+
var displayName = outerType.displayName;
|
|
164
|
+
if (displayName) {
|
|
165
|
+
return displayName;
|
|
166
|
+
}
|
|
167
|
+
var functionName = innerType.displayName || innerType.name || '';
|
|
168
|
+
return functionName !== '' ? wrapperName + "(" + functionName + ")" : wrapperName;
|
|
169
|
+
}
|
|
170
|
+
function getContextName(type) {
|
|
171
|
+
return type.displayName || 'Context';
|
|
172
|
+
}
|
|
173
|
+
function getComponentNameFromType(type) {
|
|
174
|
+
if (type == null) {
|
|
175
|
+
return null;
|
|
176
|
+
}
|
|
177
|
+
{
|
|
178
|
+
if (typeof type.tag === 'number') {
|
|
179
|
+
error('Received an unexpected object in getComponentNameFromType(). ' + 'This is likely a bug in React. Please file an issue.');
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
if (typeof type === 'function') {
|
|
183
|
+
return type.displayName || type.name || null;
|
|
184
|
+
}
|
|
185
|
+
if (typeof type === 'string') {
|
|
186
|
+
return type;
|
|
187
|
+
}
|
|
188
|
+
switch (type) {
|
|
189
|
+
case REACT_FRAGMENT_TYPE:
|
|
190
|
+
return 'Fragment';
|
|
191
|
+
case REACT_PORTAL_TYPE:
|
|
192
|
+
return 'Portal';
|
|
193
|
+
case REACT_PROFILER_TYPE:
|
|
194
|
+
return 'Profiler';
|
|
195
|
+
case REACT_STRICT_MODE_TYPE:
|
|
196
|
+
return 'StrictMode';
|
|
197
|
+
case REACT_SUSPENSE_TYPE:
|
|
198
|
+
return 'Suspense';
|
|
199
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
200
|
+
return 'SuspenseList';
|
|
201
|
+
}
|
|
202
|
+
if (typeof type === 'object') {
|
|
203
|
+
switch (type.$$typeof) {
|
|
204
|
+
case REACT_CONTEXT_TYPE:
|
|
205
|
+
var context = type;
|
|
206
|
+
return getContextName(context) + '.Consumer';
|
|
207
|
+
case REACT_PROVIDER_TYPE:
|
|
208
|
+
var provider = type;
|
|
209
|
+
return getContextName(provider._context) + '.Provider';
|
|
210
|
+
case REACT_FORWARD_REF_TYPE:
|
|
211
|
+
return getWrappedName(type, type.render, 'ForwardRef');
|
|
212
|
+
case REACT_MEMO_TYPE:
|
|
213
|
+
var outerName = type.displayName || null;
|
|
214
|
+
if (outerName !== null) {
|
|
215
|
+
return outerName;
|
|
216
|
+
}
|
|
217
|
+
return getComponentNameFromType(type.type) || 'Memo';
|
|
218
|
+
case REACT_LAZY_TYPE:
|
|
219
|
+
{
|
|
220
|
+
var lazyComponent = type;
|
|
221
|
+
var payload = lazyComponent._payload;
|
|
222
|
+
var init = lazyComponent._init;
|
|
223
|
+
try {
|
|
224
|
+
return getComponentNameFromType(init(payload));
|
|
225
|
+
} catch (x) {
|
|
226
|
+
return null;
|
|
227
|
+
}
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
}
|
|
231
|
+
return null;
|
|
232
|
+
}
|
|
233
|
+
var assign = Object.assign;
|
|
234
|
+
var disabledDepth = 0;
|
|
235
|
+
var prevLog;
|
|
236
|
+
var prevInfo;
|
|
237
|
+
var prevWarn;
|
|
238
|
+
var prevError;
|
|
239
|
+
var prevGroup;
|
|
240
|
+
var prevGroupCollapsed;
|
|
241
|
+
var prevGroupEnd;
|
|
242
|
+
function disabledLog() {}
|
|
243
|
+
disabledLog.__reactDisabledLog = true;
|
|
244
|
+
function disableLogs() {
|
|
245
|
+
{
|
|
246
|
+
if (disabledDepth === 0) {
|
|
247
|
+
prevLog = console.log;
|
|
248
|
+
prevInfo = console.info;
|
|
249
|
+
prevWarn = console.warn;
|
|
250
|
+
prevError = console.error;
|
|
251
|
+
prevGroup = console.group;
|
|
252
|
+
prevGroupCollapsed = console.groupCollapsed;
|
|
253
|
+
prevGroupEnd = console.groupEnd;
|
|
254
|
+
var props = {
|
|
255
|
+
configurable: true,
|
|
256
|
+
enumerable: true,
|
|
257
|
+
value: disabledLog,
|
|
258
|
+
writable: true
|
|
259
|
+
};
|
|
260
|
+
Object.defineProperties(console, {
|
|
261
|
+
info: props,
|
|
262
|
+
log: props,
|
|
263
|
+
warn: props,
|
|
264
|
+
error: props,
|
|
265
|
+
group: props,
|
|
266
|
+
groupCollapsed: props,
|
|
267
|
+
groupEnd: props
|
|
268
|
+
});
|
|
269
|
+
}
|
|
270
|
+
disabledDepth++;
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
function reenableLogs() {
|
|
274
|
+
{
|
|
275
|
+
disabledDepth--;
|
|
276
|
+
if (disabledDepth === 0) {
|
|
277
|
+
var props = {
|
|
278
|
+
configurable: true,
|
|
279
|
+
enumerable: true,
|
|
280
|
+
writable: true
|
|
281
|
+
};
|
|
282
|
+
Object.defineProperties(console, {
|
|
283
|
+
log: assign({}, props, {
|
|
284
|
+
value: prevLog
|
|
285
|
+
}),
|
|
286
|
+
info: assign({}, props, {
|
|
287
|
+
value: prevInfo
|
|
288
|
+
}),
|
|
289
|
+
warn: assign({}, props, {
|
|
290
|
+
value: prevWarn
|
|
291
|
+
}),
|
|
292
|
+
error: assign({}, props, {
|
|
293
|
+
value: prevError
|
|
294
|
+
}),
|
|
295
|
+
group: assign({}, props, {
|
|
296
|
+
value: prevGroup
|
|
297
|
+
}),
|
|
298
|
+
groupCollapsed: assign({}, props, {
|
|
299
|
+
value: prevGroupCollapsed
|
|
300
|
+
}),
|
|
301
|
+
groupEnd: assign({}, props, {
|
|
302
|
+
value: prevGroupEnd
|
|
303
|
+
})
|
|
304
|
+
});
|
|
305
|
+
}
|
|
306
|
+
if (disabledDepth < 0) {
|
|
307
|
+
error('disabledDepth fell below zero. ' + 'This is a bug in React. Please file an issue.');
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
var ReactCurrentDispatcher = ReactSharedInternals.ReactCurrentDispatcher;
|
|
312
|
+
var prefix;
|
|
313
|
+
function describeBuiltInComponentFrame(name, source, ownerFn) {
|
|
314
|
+
{
|
|
315
|
+
if (prefix === undefined) {
|
|
316
|
+
try {
|
|
317
|
+
throw Error();
|
|
318
|
+
} catch (x) {
|
|
319
|
+
var match = x.stack.trim().match(/\n( *(at )?)/);
|
|
320
|
+
prefix = match && match[1] || '';
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
return '\n' + prefix + name;
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
var reentry = false;
|
|
327
|
+
var componentFrameCache;
|
|
328
|
+
{
|
|
329
|
+
var PossiblyWeakMap = typeof WeakMap === 'function' ? WeakMap : Map;
|
|
330
|
+
componentFrameCache = new PossiblyWeakMap();
|
|
331
|
+
}
|
|
332
|
+
function describeNativeComponentFrame(fn, construct) {
|
|
333
|
+
if (!fn || reentry) {
|
|
334
|
+
return '';
|
|
335
|
+
}
|
|
336
|
+
{
|
|
337
|
+
var frame = componentFrameCache.get(fn);
|
|
338
|
+
if (frame !== undefined) {
|
|
339
|
+
return frame;
|
|
340
|
+
}
|
|
341
|
+
}
|
|
342
|
+
var control;
|
|
343
|
+
reentry = true;
|
|
344
|
+
var previousPrepareStackTrace = Error.prepareStackTrace;
|
|
345
|
+
Error.prepareStackTrace = undefined;
|
|
346
|
+
var previousDispatcher;
|
|
347
|
+
{
|
|
348
|
+
previousDispatcher = ReactCurrentDispatcher.current;
|
|
349
|
+
ReactCurrentDispatcher.current = null;
|
|
350
|
+
disableLogs();
|
|
351
|
+
}
|
|
352
|
+
try {
|
|
353
|
+
if (construct) {
|
|
354
|
+
var Fake = function () {
|
|
355
|
+
throw Error();
|
|
356
|
+
};
|
|
357
|
+
Object.defineProperty(Fake.prototype, 'props', {
|
|
358
|
+
set: function () {
|
|
359
|
+
throw Error();
|
|
360
|
+
}
|
|
361
|
+
});
|
|
362
|
+
if (typeof Reflect === 'object' && Reflect.construct) {
|
|
363
|
+
try {
|
|
364
|
+
Reflect.construct(Fake, []);
|
|
365
|
+
} catch (x) {
|
|
366
|
+
control = x;
|
|
367
|
+
}
|
|
368
|
+
Reflect.construct(fn, [], Fake);
|
|
369
|
+
} else {
|
|
370
|
+
try {
|
|
371
|
+
Fake.call();
|
|
372
|
+
} catch (x) {
|
|
373
|
+
control = x;
|
|
374
|
+
}
|
|
375
|
+
fn.call(Fake.prototype);
|
|
376
|
+
}
|
|
377
|
+
} else {
|
|
378
|
+
try {
|
|
379
|
+
throw Error();
|
|
380
|
+
} catch (x) {
|
|
381
|
+
control = x;
|
|
382
|
+
}
|
|
383
|
+
fn();
|
|
384
|
+
}
|
|
385
|
+
} catch (sample) {
|
|
386
|
+
if (sample && control && typeof sample.stack === 'string') {
|
|
387
|
+
var sampleLines = sample.stack.split('\n');
|
|
388
|
+
var controlLines = control.stack.split('\n');
|
|
389
|
+
var s = sampleLines.length - 1;
|
|
390
|
+
var c = controlLines.length - 1;
|
|
391
|
+
while (s >= 1 && c >= 0 && sampleLines[s] !== controlLines[c]) {
|
|
392
|
+
c--;
|
|
393
|
+
}
|
|
394
|
+
for (; s >= 1 && c >= 0; s--, c--) {
|
|
395
|
+
if (sampleLines[s] !== controlLines[c]) {
|
|
396
|
+
if (s !== 1 || c !== 1) {
|
|
397
|
+
do {
|
|
398
|
+
s--;
|
|
399
|
+
c--;
|
|
400
|
+
if (c < 0 || sampleLines[s] !== controlLines[c]) {
|
|
401
|
+
var _frame = '\n' + sampleLines[s].replace(' at new ', ' at ');
|
|
402
|
+
if (fn.displayName && _frame.includes('<anonymous>')) {
|
|
403
|
+
_frame = _frame.replace('<anonymous>', fn.displayName);
|
|
404
|
+
}
|
|
405
|
+
{
|
|
406
|
+
if (typeof fn === 'function') {
|
|
407
|
+
componentFrameCache.set(fn, _frame);
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
return _frame;
|
|
411
|
+
}
|
|
412
|
+
} while (s >= 1 && c >= 0);
|
|
413
|
+
}
|
|
414
|
+
break;
|
|
415
|
+
}
|
|
416
|
+
}
|
|
417
|
+
}
|
|
418
|
+
} finally {
|
|
419
|
+
reentry = false;
|
|
420
|
+
{
|
|
421
|
+
ReactCurrentDispatcher.current = previousDispatcher;
|
|
422
|
+
reenableLogs();
|
|
423
|
+
}
|
|
424
|
+
Error.prepareStackTrace = previousPrepareStackTrace;
|
|
425
|
+
}
|
|
426
|
+
var name = fn ? fn.displayName || fn.name : '';
|
|
427
|
+
var syntheticFrame = name ? describeBuiltInComponentFrame(name) : '';
|
|
428
|
+
{
|
|
429
|
+
if (typeof fn === 'function') {
|
|
430
|
+
componentFrameCache.set(fn, syntheticFrame);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
return syntheticFrame;
|
|
434
|
+
}
|
|
435
|
+
function describeFunctionComponentFrame(fn, source, ownerFn) {
|
|
436
|
+
{
|
|
437
|
+
return describeNativeComponentFrame(fn, false);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
function shouldConstruct(Component) {
|
|
441
|
+
var prototype = Component.prototype;
|
|
442
|
+
return !!(prototype && prototype.isReactComponent);
|
|
443
|
+
}
|
|
444
|
+
function describeUnknownElementTypeFrameInDEV(type, source, ownerFn) {
|
|
445
|
+
if (type == null) {
|
|
446
|
+
return '';
|
|
447
|
+
}
|
|
448
|
+
if (typeof type === 'function') {
|
|
449
|
+
{
|
|
450
|
+
return describeNativeComponentFrame(type, shouldConstruct(type));
|
|
451
|
+
}
|
|
452
|
+
}
|
|
453
|
+
if (typeof type === 'string') {
|
|
454
|
+
return describeBuiltInComponentFrame(type);
|
|
455
|
+
}
|
|
456
|
+
switch (type) {
|
|
457
|
+
case REACT_SUSPENSE_TYPE:
|
|
458
|
+
return describeBuiltInComponentFrame('Suspense');
|
|
459
|
+
case REACT_SUSPENSE_LIST_TYPE:
|
|
460
|
+
return describeBuiltInComponentFrame('SuspenseList');
|
|
461
|
+
}
|
|
462
|
+
if (typeof type === 'object') {
|
|
463
|
+
switch (type.$$typeof) {
|
|
464
|
+
case REACT_FORWARD_REF_TYPE:
|
|
465
|
+
return describeFunctionComponentFrame(type.render);
|
|
466
|
+
case REACT_MEMO_TYPE:
|
|
467
|
+
return describeUnknownElementTypeFrameInDEV(type.type, source, ownerFn);
|
|
468
|
+
case REACT_LAZY_TYPE:
|
|
469
|
+
{
|
|
470
|
+
var lazyComponent = type;
|
|
471
|
+
var payload = lazyComponent._payload;
|
|
472
|
+
var init = lazyComponent._init;
|
|
473
|
+
try {
|
|
474
|
+
return describeUnknownElementTypeFrameInDEV(init(payload), source, ownerFn);
|
|
475
|
+
} catch (x) {}
|
|
476
|
+
}
|
|
477
|
+
}
|
|
478
|
+
}
|
|
479
|
+
return '';
|
|
480
|
+
}
|
|
481
|
+
var hasOwnProperty = Object.prototype.hasOwnProperty;
|
|
482
|
+
var loggedTypeFailures = {};
|
|
483
|
+
var ReactDebugCurrentFrame = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
484
|
+
function setCurrentlyValidatingElement(element) {
|
|
485
|
+
{
|
|
486
|
+
if (element) {
|
|
487
|
+
var owner = element._owner;
|
|
488
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
489
|
+
ReactDebugCurrentFrame.setExtraStackFrame(stack);
|
|
490
|
+
} else {
|
|
491
|
+
ReactDebugCurrentFrame.setExtraStackFrame(null);
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
function checkPropTypes(typeSpecs, values, location, componentName, element) {
|
|
496
|
+
{
|
|
497
|
+
var has = Function.call.bind(hasOwnProperty);
|
|
498
|
+
for (var typeSpecName in typeSpecs) {
|
|
499
|
+
if (has(typeSpecs, typeSpecName)) {
|
|
500
|
+
var error$1 = void 0;
|
|
501
|
+
try {
|
|
502
|
+
if (typeof typeSpecs[typeSpecName] !== 'function') {
|
|
503
|
+
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`.');
|
|
504
|
+
err.name = 'Invariant Violation';
|
|
505
|
+
throw err;
|
|
506
|
+
}
|
|
507
|
+
error$1 = typeSpecs[typeSpecName](values, typeSpecName, componentName, location, null, 'SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED');
|
|
508
|
+
} catch (ex) {
|
|
509
|
+
error$1 = ex;
|
|
510
|
+
}
|
|
511
|
+
if (error$1 && !(error$1 instanceof Error)) {
|
|
512
|
+
setCurrentlyValidatingElement(element);
|
|
513
|
+
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);
|
|
514
|
+
setCurrentlyValidatingElement(null);
|
|
515
|
+
}
|
|
516
|
+
if (error$1 instanceof Error && !(error$1.message in loggedTypeFailures)) {
|
|
517
|
+
loggedTypeFailures[error$1.message] = true;
|
|
518
|
+
setCurrentlyValidatingElement(element);
|
|
519
|
+
error('Failed %s type: %s', location, error$1.message);
|
|
520
|
+
setCurrentlyValidatingElement(null);
|
|
521
|
+
}
|
|
522
|
+
}
|
|
523
|
+
}
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
var isArrayImpl = Array.isArray;
|
|
527
|
+
function isArray(a) {
|
|
528
|
+
return isArrayImpl(a);
|
|
529
|
+
}
|
|
530
|
+
function typeName(value) {
|
|
531
|
+
{
|
|
532
|
+
var hasToStringTag = typeof Symbol === 'function' && Symbol.toStringTag;
|
|
533
|
+
var type = hasToStringTag && value[Symbol.toStringTag] || value.constructor.name || 'Object';
|
|
534
|
+
return type;
|
|
535
|
+
}
|
|
536
|
+
}
|
|
537
|
+
function willCoercionThrow(value) {
|
|
538
|
+
{
|
|
539
|
+
try {
|
|
540
|
+
testStringCoercion(value);
|
|
541
|
+
return false;
|
|
542
|
+
} catch (e) {
|
|
543
|
+
return true;
|
|
544
|
+
}
|
|
545
|
+
}
|
|
546
|
+
}
|
|
547
|
+
function testStringCoercion(value) {
|
|
548
|
+
return '' + value;
|
|
549
|
+
}
|
|
550
|
+
function checkKeyStringCoercion(value) {
|
|
551
|
+
{
|
|
552
|
+
if (willCoercionThrow(value)) {
|
|
553
|
+
error('The provided key is an unsupported type %s.' + ' This value must be coerced to a string before before using it here.', typeName(value));
|
|
554
|
+
return testStringCoercion(value);
|
|
555
|
+
}
|
|
556
|
+
}
|
|
557
|
+
}
|
|
558
|
+
var ReactCurrentOwner = ReactSharedInternals.ReactCurrentOwner;
|
|
559
|
+
var RESERVED_PROPS = {
|
|
560
|
+
key: true,
|
|
561
|
+
ref: true,
|
|
562
|
+
__self: true,
|
|
563
|
+
__source: true
|
|
564
|
+
};
|
|
565
|
+
var specialPropKeyWarningShown;
|
|
566
|
+
var specialPropRefWarningShown;
|
|
567
|
+
var didWarnAboutStringRefs;
|
|
568
|
+
{
|
|
569
|
+
didWarnAboutStringRefs = {};
|
|
570
|
+
}
|
|
571
|
+
function hasValidRef(config) {
|
|
572
|
+
{
|
|
573
|
+
if (hasOwnProperty.call(config, 'ref')) {
|
|
574
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'ref').get;
|
|
575
|
+
if (getter && getter.isReactWarning) {
|
|
576
|
+
return false;
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
return config.ref !== undefined;
|
|
581
|
+
}
|
|
582
|
+
function hasValidKey(config) {
|
|
583
|
+
{
|
|
584
|
+
if (hasOwnProperty.call(config, 'key')) {
|
|
585
|
+
var getter = Object.getOwnPropertyDescriptor(config, 'key').get;
|
|
586
|
+
if (getter && getter.isReactWarning) {
|
|
587
|
+
return false;
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
return config.key !== undefined;
|
|
592
|
+
}
|
|
593
|
+
function warnIfStringRefCannotBeAutoConverted(config, self) {
|
|
594
|
+
{
|
|
595
|
+
if (typeof config.ref === 'string' && ReactCurrentOwner.current && self && ReactCurrentOwner.current.stateNode !== self) {
|
|
596
|
+
var componentName = getComponentNameFromType(ReactCurrentOwner.current.type);
|
|
597
|
+
if (!didWarnAboutStringRefs[componentName]) {
|
|
598
|
+
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', getComponentNameFromType(ReactCurrentOwner.current.type), config.ref);
|
|
599
|
+
didWarnAboutStringRefs[componentName] = true;
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
function defineKeyPropWarningGetter(props, displayName) {
|
|
605
|
+
{
|
|
606
|
+
var warnAboutAccessingKey = function () {
|
|
607
|
+
if (!specialPropKeyWarningShown) {
|
|
608
|
+
specialPropKeyWarningShown = true;
|
|
609
|
+
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);
|
|
610
|
+
}
|
|
611
|
+
};
|
|
612
|
+
warnAboutAccessingKey.isReactWarning = true;
|
|
613
|
+
Object.defineProperty(props, 'key', {
|
|
614
|
+
get: warnAboutAccessingKey,
|
|
615
|
+
configurable: true
|
|
616
|
+
});
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
function defineRefPropWarningGetter(props, displayName) {
|
|
620
|
+
{
|
|
621
|
+
var warnAboutAccessingRef = function () {
|
|
622
|
+
if (!specialPropRefWarningShown) {
|
|
623
|
+
specialPropRefWarningShown = true;
|
|
624
|
+
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);
|
|
625
|
+
}
|
|
626
|
+
};
|
|
627
|
+
warnAboutAccessingRef.isReactWarning = true;
|
|
628
|
+
Object.defineProperty(props, 'ref', {
|
|
629
|
+
get: warnAboutAccessingRef,
|
|
630
|
+
configurable: true
|
|
631
|
+
});
|
|
632
|
+
}
|
|
633
|
+
}
|
|
634
|
+
var ReactElement = function (type, key, ref, self, source, owner, props) {
|
|
635
|
+
var element = {
|
|
636
|
+
$$typeof: REACT_ELEMENT_TYPE,
|
|
637
|
+
type: type,
|
|
638
|
+
key: key,
|
|
639
|
+
ref: ref,
|
|
640
|
+
props: props,
|
|
641
|
+
_owner: owner
|
|
642
|
+
};
|
|
643
|
+
{
|
|
644
|
+
element._store = {};
|
|
645
|
+
Object.defineProperty(element._store, 'validated', {
|
|
646
|
+
configurable: false,
|
|
647
|
+
enumerable: false,
|
|
648
|
+
writable: true,
|
|
649
|
+
value: false
|
|
650
|
+
});
|
|
651
|
+
Object.defineProperty(element, '_self', {
|
|
652
|
+
configurable: false,
|
|
653
|
+
enumerable: false,
|
|
654
|
+
writable: false,
|
|
655
|
+
value: self
|
|
656
|
+
});
|
|
657
|
+
Object.defineProperty(element, '_source', {
|
|
658
|
+
configurable: false,
|
|
659
|
+
enumerable: false,
|
|
660
|
+
writable: false,
|
|
661
|
+
value: source
|
|
662
|
+
});
|
|
663
|
+
if (Object.freeze) {
|
|
664
|
+
Object.freeze(element.props);
|
|
665
|
+
Object.freeze(element);
|
|
666
|
+
}
|
|
667
|
+
}
|
|
668
|
+
return element;
|
|
669
|
+
};
|
|
670
|
+
function jsxDEV(type, config, maybeKey, source, self) {
|
|
671
|
+
{
|
|
672
|
+
var propName;
|
|
673
|
+
var props = {};
|
|
674
|
+
var key = null;
|
|
675
|
+
var ref = null;
|
|
676
|
+
if (maybeKey !== undefined) {
|
|
677
|
+
{
|
|
678
|
+
checkKeyStringCoercion(maybeKey);
|
|
679
|
+
}
|
|
680
|
+
key = '' + maybeKey;
|
|
681
|
+
}
|
|
682
|
+
if (hasValidKey(config)) {
|
|
683
|
+
{
|
|
684
|
+
checkKeyStringCoercion(config.key);
|
|
685
|
+
}
|
|
686
|
+
key = '' + config.key;
|
|
687
|
+
}
|
|
688
|
+
if (hasValidRef(config)) {
|
|
689
|
+
ref = config.ref;
|
|
690
|
+
warnIfStringRefCannotBeAutoConverted(config, self);
|
|
691
|
+
}
|
|
692
|
+
for (propName in config) {
|
|
693
|
+
if (hasOwnProperty.call(config, propName) && !RESERVED_PROPS.hasOwnProperty(propName)) {
|
|
694
|
+
props[propName] = config[propName];
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
if (type && type.defaultProps) {
|
|
698
|
+
var defaultProps = type.defaultProps;
|
|
699
|
+
for (propName in defaultProps) {
|
|
700
|
+
if (props[propName] === undefined) {
|
|
701
|
+
props[propName] = defaultProps[propName];
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
}
|
|
705
|
+
if (key || ref) {
|
|
706
|
+
var displayName = typeof type === 'function' ? type.displayName || type.name || 'Unknown' : type;
|
|
707
|
+
if (key) {
|
|
708
|
+
defineKeyPropWarningGetter(props, displayName);
|
|
709
|
+
}
|
|
710
|
+
if (ref) {
|
|
711
|
+
defineRefPropWarningGetter(props, displayName);
|
|
712
|
+
}
|
|
713
|
+
}
|
|
714
|
+
return ReactElement(type, key, ref, self, source, ReactCurrentOwner.current, props);
|
|
715
|
+
}
|
|
716
|
+
}
|
|
717
|
+
var ReactCurrentOwner$1 = ReactSharedInternals.ReactCurrentOwner;
|
|
718
|
+
var ReactDebugCurrentFrame$1 = ReactSharedInternals.ReactDebugCurrentFrame;
|
|
719
|
+
function setCurrentlyValidatingElement$1(element) {
|
|
720
|
+
{
|
|
721
|
+
if (element) {
|
|
722
|
+
var owner = element._owner;
|
|
723
|
+
var stack = describeUnknownElementTypeFrameInDEV(element.type, element._source, owner ? owner.type : null);
|
|
724
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(stack);
|
|
725
|
+
} else {
|
|
726
|
+
ReactDebugCurrentFrame$1.setExtraStackFrame(null);
|
|
727
|
+
}
|
|
728
|
+
}
|
|
729
|
+
}
|
|
730
|
+
var propTypesMisspellWarningShown;
|
|
731
|
+
{
|
|
732
|
+
propTypesMisspellWarningShown = false;
|
|
733
|
+
}
|
|
734
|
+
function isValidElement(object) {
|
|
735
|
+
{
|
|
736
|
+
return typeof object === 'object' && object !== null && object.$$typeof === REACT_ELEMENT_TYPE;
|
|
737
|
+
}
|
|
738
|
+
}
|
|
739
|
+
function getDeclarationErrorAddendum() {
|
|
740
|
+
{
|
|
741
|
+
if (ReactCurrentOwner$1.current) {
|
|
742
|
+
var name = getComponentNameFromType(ReactCurrentOwner$1.current.type);
|
|
743
|
+
if (name) {
|
|
744
|
+
return '\n\nCheck the render method of `' + name + '`.';
|
|
745
|
+
}
|
|
746
|
+
}
|
|
747
|
+
return '';
|
|
748
|
+
}
|
|
749
|
+
}
|
|
750
|
+
function getSourceInfoErrorAddendum(source) {
|
|
751
|
+
{
|
|
752
|
+
return '';
|
|
753
|
+
}
|
|
754
|
+
}
|
|
755
|
+
var ownerHasKeyUseWarning = {};
|
|
756
|
+
function getCurrentComponentErrorInfo(parentType) {
|
|
757
|
+
{
|
|
758
|
+
var info = getDeclarationErrorAddendum();
|
|
759
|
+
if (!info) {
|
|
760
|
+
var parentName = typeof parentType === 'string' ? parentType : parentType.displayName || parentType.name;
|
|
761
|
+
if (parentName) {
|
|
762
|
+
info = "\n\nCheck the top-level render call using <" + parentName + ">.";
|
|
763
|
+
}
|
|
764
|
+
}
|
|
765
|
+
return info;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
function validateExplicitKey(element, parentType) {
|
|
769
|
+
{
|
|
770
|
+
if (!element._store || element._store.validated || element.key != null) {
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
element._store.validated = true;
|
|
774
|
+
var currentComponentErrorInfo = getCurrentComponentErrorInfo(parentType);
|
|
775
|
+
if (ownerHasKeyUseWarning[currentComponentErrorInfo]) {
|
|
776
|
+
return;
|
|
777
|
+
}
|
|
778
|
+
ownerHasKeyUseWarning[currentComponentErrorInfo] = true;
|
|
779
|
+
var childOwner = '';
|
|
780
|
+
if (element && element._owner && element._owner !== ReactCurrentOwner$1.current) {
|
|
781
|
+
childOwner = " It was passed a child from " + getComponentNameFromType(element._owner.type) + ".";
|
|
782
|
+
}
|
|
783
|
+
setCurrentlyValidatingElement$1(element);
|
|
784
|
+
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);
|
|
785
|
+
setCurrentlyValidatingElement$1(null);
|
|
786
|
+
}
|
|
787
|
+
}
|
|
788
|
+
function validateChildKeys(node, parentType) {
|
|
789
|
+
{
|
|
790
|
+
if (typeof node !== 'object') {
|
|
791
|
+
return;
|
|
792
|
+
}
|
|
793
|
+
if (isArray(node)) {
|
|
794
|
+
for (var i = 0; i < node.length; i++) {
|
|
795
|
+
var child = node[i];
|
|
796
|
+
if (isValidElement(child)) {
|
|
797
|
+
validateExplicitKey(child, parentType);
|
|
798
|
+
}
|
|
799
|
+
}
|
|
800
|
+
} else if (isValidElement(node)) {
|
|
801
|
+
if (node._store) {
|
|
802
|
+
node._store.validated = true;
|
|
803
|
+
}
|
|
804
|
+
} else if (node) {
|
|
805
|
+
var iteratorFn = getIteratorFn(node);
|
|
806
|
+
if (typeof iteratorFn === 'function') {
|
|
807
|
+
if (iteratorFn !== node.entries) {
|
|
808
|
+
var iterator = iteratorFn.call(node);
|
|
809
|
+
var step;
|
|
810
|
+
while (!(step = iterator.next()).done) {
|
|
811
|
+
if (isValidElement(step.value)) {
|
|
812
|
+
validateExplicitKey(step.value, parentType);
|
|
813
|
+
}
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
function validatePropTypes(element) {
|
|
821
|
+
{
|
|
822
|
+
var type = element.type;
|
|
823
|
+
if (type === null || type === undefined || typeof type === 'string') {
|
|
824
|
+
return;
|
|
825
|
+
}
|
|
826
|
+
var propTypes;
|
|
827
|
+
if (typeof type === 'function') {
|
|
828
|
+
propTypes = type.propTypes;
|
|
829
|
+
} else if (typeof type === 'object' && (type.$$typeof === REACT_FORWARD_REF_TYPE ||
|
|
830
|
+
type.$$typeof === REACT_MEMO_TYPE)) {
|
|
831
|
+
propTypes = type.propTypes;
|
|
832
|
+
} else {
|
|
833
|
+
return;
|
|
834
|
+
}
|
|
835
|
+
if (propTypes) {
|
|
836
|
+
var name = getComponentNameFromType(type);
|
|
837
|
+
checkPropTypes(propTypes, element.props, 'prop', name, element);
|
|
838
|
+
} else if (type.PropTypes !== undefined && !propTypesMisspellWarningShown) {
|
|
839
|
+
propTypesMisspellWarningShown = true;
|
|
840
|
+
var _name = getComponentNameFromType(type);
|
|
841
|
+
error('Component %s declared `PropTypes` instead of `propTypes`. Did you misspell the property assignment?', _name || 'Unknown');
|
|
842
|
+
}
|
|
843
|
+
if (typeof type.getDefaultProps === 'function' && !type.getDefaultProps.isReactClassApproved) {
|
|
844
|
+
error('getDefaultProps is only used on classic React.createClass ' + 'definitions. Use a static property named `defaultProps` instead.');
|
|
845
|
+
}
|
|
846
|
+
}
|
|
847
|
+
}
|
|
848
|
+
function validateFragmentProps(fragment) {
|
|
849
|
+
{
|
|
850
|
+
var keys = Object.keys(fragment.props);
|
|
851
|
+
for (var i = 0; i < keys.length; i++) {
|
|
852
|
+
var key = keys[i];
|
|
853
|
+
if (key !== 'children' && key !== 'key') {
|
|
854
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
855
|
+
error('Invalid prop `%s` supplied to `React.Fragment`. ' + 'React.Fragment can only have `key` and `children` props.', key);
|
|
856
|
+
setCurrentlyValidatingElement$1(null);
|
|
857
|
+
break;
|
|
858
|
+
}
|
|
859
|
+
}
|
|
860
|
+
if (fragment.ref !== null) {
|
|
861
|
+
setCurrentlyValidatingElement$1(fragment);
|
|
862
|
+
error('Invalid attribute `ref` supplied to `React.Fragment`.');
|
|
863
|
+
setCurrentlyValidatingElement$1(null);
|
|
864
|
+
}
|
|
865
|
+
}
|
|
866
|
+
}
|
|
867
|
+
var didWarnAboutKeySpread = {};
|
|
868
|
+
function jsxWithValidation(type, props, key, isStaticChildren, source, self) {
|
|
869
|
+
{
|
|
870
|
+
var validType = isValidElementType(type);
|
|
871
|
+
if (!validType) {
|
|
872
|
+
var info = '';
|
|
873
|
+
if (type === undefined || typeof type === 'object' && type !== null && Object.keys(type).length === 0) {
|
|
874
|
+
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.";
|
|
875
|
+
}
|
|
876
|
+
var sourceInfo = getSourceInfoErrorAddendum();
|
|
877
|
+
if (sourceInfo) {
|
|
878
|
+
info += sourceInfo;
|
|
879
|
+
} else {
|
|
880
|
+
info += getDeclarationErrorAddendum();
|
|
881
|
+
}
|
|
882
|
+
var typeString;
|
|
883
|
+
if (type === null) {
|
|
884
|
+
typeString = 'null';
|
|
885
|
+
} else if (isArray(type)) {
|
|
886
|
+
typeString = 'array';
|
|
887
|
+
} else if (type !== undefined && type.$$typeof === REACT_ELEMENT_TYPE) {
|
|
888
|
+
typeString = "<" + (getComponentNameFromType(type.type) || 'Unknown') + " />";
|
|
889
|
+
info = ' Did you accidentally export a JSX literal instead of a component?';
|
|
890
|
+
} else {
|
|
891
|
+
typeString = typeof type;
|
|
892
|
+
}
|
|
893
|
+
error('React.jsx: type is invalid -- expected a string (for ' + 'built-in components) or a class/function (for composite ' + 'components) but got: %s.%s', typeString, info);
|
|
894
|
+
}
|
|
895
|
+
var element = jsxDEV(type, props, key, source, self);
|
|
896
|
+
if (element == null) {
|
|
897
|
+
return element;
|
|
898
|
+
}
|
|
899
|
+
if (validType) {
|
|
900
|
+
var children = props.children;
|
|
901
|
+
if (children !== undefined) {
|
|
902
|
+
if (isStaticChildren) {
|
|
903
|
+
if (isArray(children)) {
|
|
904
|
+
for (var i = 0; i < children.length; i++) {
|
|
905
|
+
validateChildKeys(children[i], type);
|
|
906
|
+
}
|
|
907
|
+
if (Object.freeze) {
|
|
908
|
+
Object.freeze(children);
|
|
909
|
+
}
|
|
910
|
+
} else {
|
|
911
|
+
error('React.jsx: Static children should always be an array. ' + 'You are likely explicitly calling React.jsxs or React.jsxDEV. ' + 'Use the Babel transform instead.');
|
|
912
|
+
}
|
|
913
|
+
} else {
|
|
914
|
+
validateChildKeys(children, type);
|
|
915
|
+
}
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
{
|
|
919
|
+
if (hasOwnProperty.call(props, 'key')) {
|
|
920
|
+
var componentName = getComponentNameFromType(type);
|
|
921
|
+
var keys = Object.keys(props).filter(function (k) {
|
|
922
|
+
return k !== 'key';
|
|
923
|
+
});
|
|
924
|
+
var beforeExample = keys.length > 0 ? '{key: someKey, ' + keys.join(': ..., ') + ': ...}' : '{key: someKey}';
|
|
925
|
+
if (!didWarnAboutKeySpread[componentName + beforeExample]) {
|
|
926
|
+
var afterExample = keys.length > 0 ? '{' + keys.join(': ..., ') + ': ...}' : '{}';
|
|
927
|
+
error('A props object containing a "key" prop is being spread into JSX:\n' + ' let props = %s;\n' + ' <%s {...props} />\n' + 'React keys must be passed directly to JSX without using spread:\n' + ' let props = %s;\n' + ' <%s key={someKey} {...props} />', beforeExample, componentName, afterExample, componentName);
|
|
928
|
+
didWarnAboutKeySpread[componentName + beforeExample] = true;
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
if (type === REACT_FRAGMENT_TYPE) {
|
|
933
|
+
validateFragmentProps(element);
|
|
934
|
+
} else {
|
|
935
|
+
validatePropTypes(element);
|
|
936
|
+
}
|
|
937
|
+
return element;
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
function jsxWithValidationStatic(type, props, key) {
|
|
941
|
+
{
|
|
942
|
+
return jsxWithValidation(type, props, key, true);
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
function jsxWithValidationDynamic(type, props, key) {
|
|
946
|
+
{
|
|
947
|
+
return jsxWithValidation(type, props, key, false);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
var jsx = jsxWithValidationDynamic;
|
|
951
|
+
var jsxs = jsxWithValidationStatic;
|
|
952
|
+
reactJsxRuntime_development.Fragment = REACT_FRAGMENT_TYPE;
|
|
953
|
+
reactJsxRuntime_development.jsx = jsx;
|
|
954
|
+
reactJsxRuntime_development.jsxs = jsxs;
|
|
955
|
+
})();
|
|
956
|
+
}
|
|
957
|
+
return reactJsxRuntime_development;
|
|
958
|
+
}
|
|
959
|
+
|
|
960
|
+
var hasRequiredJsxRuntime;
|
|
961
|
+
function requireJsxRuntime() {
|
|
962
|
+
if (hasRequiredJsxRuntime) return jsxRuntime.exports;
|
|
963
|
+
hasRequiredJsxRuntime = 1;
|
|
964
|
+
if (process.env.NODE_ENV === 'production') {
|
|
965
|
+
jsxRuntime.exports = requireReactJsxRuntime_production_min();
|
|
966
|
+
} else {
|
|
967
|
+
jsxRuntime.exports = requireReactJsxRuntime_development();
|
|
968
|
+
}
|
|
969
|
+
return jsxRuntime.exports;
|
|
970
|
+
}
|
|
971
|
+
|
|
972
|
+
var jsxRuntimeExports = requireJsxRuntime();
|
|
973
|
+
|
|
26
974
|
const getSetterInfo = field => {
|
|
27
975
|
const {
|
|
28
976
|
extraProps,
|
|
@@ -99,8 +1047,7 @@ const SettingSetter = observer(({
|
|
|
99
1047
|
component: SetterComponent,
|
|
100
1048
|
props: mixedSetterProps
|
|
101
1049
|
} = setterManager.createSetterContent(setterType, setterProps);
|
|
102
|
-
return /*#__PURE__*/
|
|
103
|
-
key: field.id,
|
|
1050
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SetterComponent, {
|
|
104
1051
|
field: field,
|
|
105
1052
|
selected: field.top?.getNode(),
|
|
106
1053
|
initialValue: initialValue,
|
|
@@ -120,8 +1067,10 @@ const SettingSetter = observer(({
|
|
|
120
1067
|
if (field.name) {
|
|
121
1068
|
field.parent.clearPropValue(field.name);
|
|
122
1069
|
}
|
|
123
|
-
}
|
|
124
|
-
|
|
1070
|
+
},
|
|
1071
|
+
...mixedSetterProps,
|
|
1072
|
+
children: children
|
|
1073
|
+
}, field.id);
|
|
125
1074
|
});
|
|
126
1075
|
|
|
127
1076
|
const SettingFieldItem = observer(({
|
|
@@ -131,18 +1080,20 @@ const SettingFieldItem = observer(({
|
|
|
131
1080
|
customFieldItem
|
|
132
1081
|
} = useSettingRendererContext();
|
|
133
1082
|
if (customFieldItem) {
|
|
134
|
-
return customFieldItem(field, /*#__PURE__*/
|
|
1083
|
+
return customFieldItem(field, /*#__PURE__*/jsxRuntimeExports.jsx(SettingSetter, {
|
|
135
1084
|
field: field
|
|
136
1085
|
}));
|
|
137
1086
|
}
|
|
138
|
-
return /*#__PURE__*/
|
|
139
|
-
className: "space-y-2"
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
1087
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
1088
|
+
className: "space-y-2",
|
|
1089
|
+
children: [/*#__PURE__*/jsxRuntimeExports.jsx("label", {
|
|
1090
|
+
htmlFor: field.id,
|
|
1091
|
+
className: "block text-sm font-medium text-gray-700",
|
|
1092
|
+
children: field.title
|
|
1093
|
+
}), /*#__PURE__*/jsxRuntimeExports.jsx(SettingSetter, {
|
|
1094
|
+
field: field
|
|
1095
|
+
})]
|
|
1096
|
+
});
|
|
146
1097
|
});
|
|
147
1098
|
const SettingFieldGroup = observer(({
|
|
148
1099
|
field
|
|
@@ -151,33 +1102,31 @@ const SettingFieldGroup = observer(({
|
|
|
151
1102
|
customFieldGroup
|
|
152
1103
|
} = useSettingRendererContext();
|
|
153
1104
|
if (customFieldGroup) {
|
|
154
|
-
return customFieldGroup(field, /*#__PURE__*/
|
|
155
|
-
field: field
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
}))
|
|
1105
|
+
return customFieldGroup(field, /*#__PURE__*/jsxRuntimeExports.jsx(SettingSetter, {
|
|
1106
|
+
field: field,
|
|
1107
|
+
children: field.items?.map(item => /*#__PURE__*/jsxRuntimeExports.jsx(SettingFieldView, {
|
|
1108
|
+
field: item
|
|
1109
|
+
}, item.id))
|
|
1110
|
+
}));
|
|
160
1111
|
}
|
|
161
|
-
return /*#__PURE__*/
|
|
162
|
-
field: field
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
})
|
|
1112
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SettingSetter, {
|
|
1113
|
+
field: field,
|
|
1114
|
+
children: field.items?.map(item => /*#__PURE__*/jsxRuntimeExports.jsx(SettingFieldView, {
|
|
1115
|
+
field: item
|
|
1116
|
+
}, item.id))
|
|
1117
|
+
});
|
|
167
1118
|
});
|
|
168
1119
|
const SettingFieldView = ({
|
|
169
1120
|
field
|
|
170
1121
|
}) => {
|
|
171
1122
|
if (field.isGroup) {
|
|
172
|
-
return /*#__PURE__*/
|
|
173
|
-
field: field
|
|
174
|
-
|
|
175
|
-
});
|
|
1123
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SettingFieldGroup, {
|
|
1124
|
+
field: field
|
|
1125
|
+
}, field.id);
|
|
176
1126
|
} else {
|
|
177
|
-
return /*#__PURE__*/
|
|
178
|
-
field: field
|
|
179
|
-
|
|
180
|
-
});
|
|
1127
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SettingFieldItem, {
|
|
1128
|
+
field: field
|
|
1129
|
+
}, field.id);
|
|
181
1130
|
}
|
|
182
1131
|
};
|
|
183
1132
|
const SettingRender = observer(props => {
|
|
@@ -205,42 +1154,58 @@ const SettingRender = observer(props => {
|
|
|
205
1154
|
}, [setterManager, settingsManager, customFieldItem, customFieldGroup]);
|
|
206
1155
|
if (!settings) {
|
|
207
1156
|
// 未选中节点,提示选中 或者 显示根节点设置
|
|
208
|
-
return /*#__PURE__*/
|
|
209
|
-
className: "lc-settings-main"
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
1157
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1158
|
+
className: "lc-settings-main",
|
|
1159
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1160
|
+
className: "lc-settings-notice",
|
|
1161
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("p", {
|
|
1162
|
+
children: "Please select a node in canvas"
|
|
1163
|
+
})
|
|
1164
|
+
})
|
|
1165
|
+
});
|
|
213
1166
|
}
|
|
214
1167
|
|
|
215
1168
|
// 当节点被锁定,且未开启锁定后容器可设置属性
|
|
216
1169
|
if (settings.isLocked) {
|
|
217
|
-
return /*#__PURE__*/
|
|
218
|
-
className: "lc-settings-main"
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
1170
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1171
|
+
className: "lc-settings-main",
|
|
1172
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1173
|
+
className: "lc-settings-notice",
|
|
1174
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("p", {
|
|
1175
|
+
children: "Current node is locked"
|
|
1176
|
+
})
|
|
1177
|
+
})
|
|
1178
|
+
});
|
|
222
1179
|
}
|
|
223
1180
|
if (Array.isArray(settings.items) && settings.items.length === 0) {
|
|
224
|
-
return /*#__PURE__*/
|
|
225
|
-
className: "lc-settings-main"
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
1181
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1182
|
+
className: "lc-settings-main",
|
|
1183
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1184
|
+
className: "lc-settings-notice",
|
|
1185
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("p", {
|
|
1186
|
+
children: "No config found for this type of component"
|
|
1187
|
+
})
|
|
1188
|
+
})
|
|
1189
|
+
});
|
|
229
1190
|
}
|
|
230
1191
|
if (!settings.isSameComponent) {
|
|
231
1192
|
// TODO: future support 获取设置项交集编辑
|
|
232
|
-
return /*#__PURE__*/
|
|
233
|
-
className: "lc-settings-main"
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
1193
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1194
|
+
className: "lc-settings-main",
|
|
1195
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1196
|
+
className: "lc-settings-notice",
|
|
1197
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx("p", {
|
|
1198
|
+
children: "Please select same kind of components"
|
|
1199
|
+
})
|
|
1200
|
+
})
|
|
1201
|
+
});
|
|
237
1202
|
}
|
|
238
|
-
return /*#__PURE__*/
|
|
239
|
-
value: ctx
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
})
|
|
1203
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(SettingRendererContext.Provider, {
|
|
1204
|
+
value: ctx,
|
|
1205
|
+
children: items?.map(item => /*#__PURE__*/jsxRuntimeExports.jsx(SettingFieldView, {
|
|
1206
|
+
field: item
|
|
1207
|
+
}, item.id))
|
|
1208
|
+
});
|
|
244
1209
|
});
|
|
245
1210
|
|
|
246
1211
|
class Adapter {
|
|
@@ -1033,9 +1998,6 @@ const leafWrapper = (Comp, {
|
|
|
1033
1998
|
return LeafWrapper;
|
|
1034
1999
|
};
|
|
1035
2000
|
|
|
1036
|
-
/**
|
|
1037
|
-
* execute method in schema.lifeCycles with context
|
|
1038
|
-
*/
|
|
1039
2001
|
function executeLifeCycleMethod(context, schema, method, args) {
|
|
1040
2002
|
if (!context || !isSchema(schema) || !method) {
|
|
1041
2003
|
return;
|
|
@@ -1748,16 +2710,19 @@ function baseRendererFactory() {
|
|
|
1748
2710
|
return this.__instanceMap[id];
|
|
1749
2711
|
}
|
|
1750
2712
|
__renderContextProvider = (customProps, children) => {
|
|
1751
|
-
return /*#__PURE__*/
|
|
2713
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(RendererContext.Provider, {
|
|
1752
2714
|
value: {
|
|
1753
2715
|
...this.context,
|
|
1754
2716
|
blockContext: this,
|
|
1755
2717
|
...(customProps || {})
|
|
1756
|
-
}
|
|
1757
|
-
|
|
2718
|
+
},
|
|
2719
|
+
children: children || this.__createDom()
|
|
2720
|
+
});
|
|
1758
2721
|
};
|
|
1759
2722
|
__renderContextConsumer = children => {
|
|
1760
|
-
return /*#__PURE__*/
|
|
2723
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(RendererContext.Consumer, {
|
|
2724
|
+
children: children
|
|
2725
|
+
});
|
|
1761
2726
|
};
|
|
1762
2727
|
__getHOCWrappedComponent(OriginalComp, info) {
|
|
1763
2728
|
let Comp = OriginalComp;
|
|
@@ -1821,12 +2786,13 @@ function baseRendererFactory() {
|
|
|
1821
2786
|
...(typeof this.props.style === 'object' ? this.props.style : {})
|
|
1822
2787
|
};
|
|
1823
2788
|
const id = this.props.id || parsedProps.id;
|
|
1824
|
-
return /*#__PURE__*/
|
|
2789
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1825
2790
|
ref: this.__getRef,
|
|
1826
2791
|
className: className,
|
|
1827
2792
|
id: id,
|
|
1828
|
-
style: style
|
|
1829
|
-
|
|
2793
|
+
style: style,
|
|
2794
|
+
children: children
|
|
2795
|
+
});
|
|
1830
2796
|
}
|
|
1831
2797
|
__checkSchema = (schema, originalExtraComponents = []) => {
|
|
1832
2798
|
let extraComponents = originalExtraComponents;
|
|
@@ -1962,7 +2928,7 @@ const FaultComponent = ({
|
|
|
1962
2928
|
error
|
|
1963
2929
|
}) => {
|
|
1964
2930
|
logger.error(`${componentName} 组件渲染异常, 异常原因: ${error?.message || error || '未知'}`);
|
|
1965
|
-
return /*#__PURE__*/
|
|
2931
|
+
return /*#__PURE__*/jsxRuntimeExports.jsxs("div", {
|
|
1966
2932
|
role: "alert",
|
|
1967
2933
|
"aria-label": `${componentName} 组件渲染异常`,
|
|
1968
2934
|
style: {
|
|
@@ -1973,8 +2939,9 @@ const FaultComponent = ({
|
|
|
1973
2939
|
fontSize: '15px',
|
|
1974
2940
|
color: '#ef4444',
|
|
1975
2941
|
border: '2px solid #ef4444'
|
|
1976
|
-
}
|
|
1977
|
-
|
|
2942
|
+
},
|
|
2943
|
+
children: [componentName, " \u7EC4\u4EF6\u6E32\u67D3\u5F02\u5E38\uFF0C\u8BF7\u67E5\u770B\u63A7\u5236\u53F0\u65E5\u5FD7"]
|
|
2944
|
+
});
|
|
1978
2945
|
};
|
|
1979
2946
|
|
|
1980
2947
|
const NotFoundComponent = ({
|
|
@@ -1984,9 +2951,11 @@ const NotFoundComponent = ({
|
|
|
1984
2951
|
}) => {
|
|
1985
2952
|
logger.warn(`Component ${componentName} not found`);
|
|
1986
2953
|
if (enableStrictNotFoundMode) {
|
|
1987
|
-
return /*#__PURE__*/
|
|
2954
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(jsxRuntimeExports.Fragment, {
|
|
2955
|
+
children: `${componentName} Component Not Found`
|
|
2956
|
+
});
|
|
1988
2957
|
}
|
|
1989
|
-
return /*#__PURE__*/
|
|
2958
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx("div", {
|
|
1990
2959
|
role: "alert",
|
|
1991
2960
|
"aria-label": `${componentName} component not found`,
|
|
1992
2961
|
style: {
|
|
@@ -1997,8 +2966,9 @@ const NotFoundComponent = ({
|
|
|
1997
2966
|
fontSize: '15px',
|
|
1998
2967
|
color: '#eab308',
|
|
1999
2968
|
border: '2px solid #eab308'
|
|
2000
|
-
}
|
|
2001
|
-
|
|
2969
|
+
},
|
|
2970
|
+
children: `${componentName} Component Not Found`
|
|
2971
|
+
});
|
|
2002
2972
|
};
|
|
2003
2973
|
|
|
2004
2974
|
function rendererFactory() {
|
|
@@ -2085,21 +3055,21 @@ function rendererFactory() {
|
|
|
2085
3055
|
if (!Comp) {
|
|
2086
3056
|
return null;
|
|
2087
3057
|
}
|
|
2088
|
-
return /*#__PURE__*/
|
|
3058
|
+
return /*#__PURE__*/jsxRuntimeExports.jsx(RendererContext.Provider, {
|
|
2089
3059
|
value: {
|
|
2090
3060
|
appHelper,
|
|
2091
3061
|
components: allComponents,
|
|
2092
3062
|
engine: this
|
|
2093
|
-
}
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
}
|
|
3063
|
+
},
|
|
3064
|
+
children: /*#__PURE__*/jsxRuntimeExports.jsx(Comp, {
|
|
3065
|
+
// ref={this.__getRef}
|
|
3066
|
+
__appHelper: appHelper,
|
|
3067
|
+
__components: allComponents,
|
|
3068
|
+
__schema: schema,
|
|
3069
|
+
__designMode: designMode,
|
|
3070
|
+
...this.props
|
|
3071
|
+
}, schema.__ctx && `${schema.__ctx.lceKey}_${schema.__ctx.idx || '0'}`)
|
|
3072
|
+
});
|
|
2103
3073
|
}
|
|
2104
3074
|
};
|
|
2105
3075
|
}
|