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