@easy-editor/react-renderer 0.0.17 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/adapter/index.d.ts +17 -0
- package/dist/{renderer-core/base.d.ts → base.d.ts} +2 -2
- package/dist/component.d.ts +2 -0
- package/dist/components/FaultComponent.d.ts +4 -0
- package/dist/components/NotFoundComponent.d.ts +4 -0
- package/dist/{renderer-core/hoc → hoc}/leaf.d.ts +2 -1
- package/dist/{cjs/index.js → index.cjs} +374 -583
- package/dist/index.d.ts +10 -3
- package/dist/index.js +324 -516
- package/dist/page.d.ts +2 -0
- package/dist/renderer.d.ts +2 -0
- package/dist/setting-renderer/context.d.ts +8 -0
- package/dist/setting-renderer/index.d.ts +8 -0
- package/dist/types.d.ts +7 -0
- package/dist/utils/index.d.ts +2 -0
- package/dist/utils/is.d.ts +3 -0
- package/package.json +16 -21
- package/dist/cjs/index.development.js +0 -2734
- package/dist/cjs/index.development.js.map +0 -1
- package/dist/cjs/index.js.map +0 -1
- package/dist/cjs/index.production.js +0 -2734
- package/dist/cjs/index.production.js.map +0 -1
- package/dist/configure-renderer/context.d.ts +0 -13
- package/dist/configure-renderer/index.d.ts +0 -10
- package/dist/esm/index.development.js +0 -2699
- package/dist/esm/index.development.js.map +0 -1
- package/dist/esm/index.js +0 -2699
- package/dist/esm/index.js.map +0 -1
- package/dist/esm/index.production.js +0 -2699
- package/dist/esm/index.production.js.map +0 -1
- package/dist/renderer-core/adapter/index.d.ts +0 -17
- package/dist/renderer-core/component.d.ts +0 -2
- package/dist/renderer-core/components/FaultComponent.d.ts +0 -7
- package/dist/renderer-core/components/NotFoundComponent.d.ts +0 -7
- package/dist/renderer-core/index.d.ts +0 -9
- package/dist/renderer-core/page.d.ts +0 -2
- package/dist/renderer-core/renderer.d.ts +0 -2
- package/dist/renderer-core/types.d.ts +0 -187
- package/dist/renderer-core/utils/classnames.d.ts +0 -1
- package/dist/renderer-core/utils/common.d.ts +0 -53
- package/dist/renderer-core/utils/index.d.ts +0 -4
- package/dist/renderer-core/utils/logger.d.ts +0 -5
- /package/dist/{renderer-core/context.d.ts → context.d.ts} +0 -0
- /package/dist/{renderer-core/hoc → hoc}/comp.d.ts +0 -0
- /package/dist/{renderer-core/hoc → hoc}/index.d.ts +0 -0
- /package/dist/{configure-renderer → setting-renderer}/SettingSetter.d.ts +0 -0
- /package/dist/{renderer-core/utils → utils}/hoc.d.ts +0 -0
package/dist/index.js
CHANGED
|
@@ -1,261 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
1
|
+
import { DESIGNER_EVENT, TRANSFORM_STAGE, isJSExpression, isJSFunction, isSetterConfig } from '@easy-editor/core';
|
|
2
|
+
import { logger, isSchema, getValue as getValue$1, parseExpression, parseData, DataHelper, isUseLoop, transformArrayToMap, transformStringToFunction, classnames, getFileCssName, checkPropTypes } from '@easy-editor/renderer-core';
|
|
3
|
+
import { createContext, useContext, forwardRef, createElement, Component, PureComponent, useMemo } from 'react';
|
|
4
4
|
import { jsx, jsxs, Fragment } from 'react/jsx-runtime';
|
|
5
|
-
|
|
6
|
-
const SettingRendererContext = /*#__PURE__*/createContext({});
|
|
7
|
-
const useSettingRendererContext = () => {
|
|
8
|
-
try {
|
|
9
|
-
return useContext(SettingRendererContext);
|
|
10
|
-
} catch (error) {
|
|
11
|
-
console.warn('useSettingRendererContext must be used within a SettingRendererContextProvider');
|
|
12
|
-
}
|
|
13
|
-
return {};
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
const getSetterInfo = field => {
|
|
17
|
-
const {
|
|
18
|
-
extraProps,
|
|
19
|
-
setter
|
|
20
|
-
} = field;
|
|
21
|
-
const {
|
|
22
|
-
defaultValue
|
|
23
|
-
} = extraProps;
|
|
24
|
-
let setterProps = {};
|
|
25
|
-
let setterType;
|
|
26
|
-
let initialValue = null;
|
|
27
|
-
if (isSetterConfig(setter)) {
|
|
28
|
-
setterType = setter.componentName;
|
|
29
|
-
if (setter.props) {
|
|
30
|
-
setterProps = setter.props;
|
|
31
|
-
if (typeof setterProps === 'function') {
|
|
32
|
-
setterProps = setterProps(field);
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
if (setter.defaultValue != null) {
|
|
36
|
-
initialValue = setter.defaultValue;
|
|
37
|
-
}
|
|
38
|
-
} else if (setter) {
|
|
39
|
-
setterType = setter;
|
|
40
|
-
}
|
|
41
|
-
if (defaultValue != null && !('defaultValue' in setterProps)) {
|
|
42
|
-
setterProps.defaultValue = defaultValue;
|
|
43
|
-
if (initialValue == null) {
|
|
44
|
-
initialValue = defaultValue;
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
if (field.valueState === -1) {
|
|
48
|
-
setterProps.multiValue = true;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// 根据是否支持变量配置做相应的更改
|
|
52
|
-
const supportVariable = field.extraProps?.supportVariable;
|
|
53
|
-
const isUseVariableSetter = supportVariable;
|
|
54
|
-
if (isUseVariableSetter === false) {
|
|
55
|
-
return {
|
|
56
|
-
setterProps,
|
|
57
|
-
initialValue,
|
|
58
|
-
setterType
|
|
59
|
-
};
|
|
60
|
-
}
|
|
61
|
-
return {
|
|
62
|
-
setterProps,
|
|
63
|
-
setterType,
|
|
64
|
-
initialValue
|
|
65
|
-
};
|
|
66
|
-
};
|
|
67
|
-
const SettingSetter = observer(({
|
|
68
|
-
field,
|
|
69
|
-
children
|
|
70
|
-
}) => {
|
|
71
|
-
const {
|
|
72
|
-
setterManager
|
|
73
|
-
} = useSettingRendererContext();
|
|
74
|
-
const {
|
|
75
|
-
extraProps
|
|
76
|
-
} = field;
|
|
77
|
-
const visible = extraProps?.condition && typeof extraProps.condition === 'function' ? extraProps.condition(field) !== false : true;
|
|
78
|
-
if (!visible) {
|
|
79
|
-
return null;
|
|
80
|
-
}
|
|
81
|
-
const {
|
|
82
|
-
setterProps = {},
|
|
83
|
-
setterType,
|
|
84
|
-
initialValue = null
|
|
85
|
-
} = getSetterInfo(field);
|
|
86
|
-
const onChange = extraProps?.onChange;
|
|
87
|
-
const value = field.valueState === -1 ? null : field.getValue();
|
|
88
|
-
const {
|
|
89
|
-
component: SetterComponent,
|
|
90
|
-
props: mixedSetterProps
|
|
91
|
-
} = setterManager.createSetterContent(setterType, setterProps);
|
|
92
|
-
return /*#__PURE__*/jsx(SetterComponent, {
|
|
93
|
-
field: field,
|
|
94
|
-
selected: field.top?.getNode(),
|
|
95
|
-
initialValue: initialValue,
|
|
96
|
-
value: value,
|
|
97
|
-
onChange: newVal => {
|
|
98
|
-
field.setValue(newVal);
|
|
99
|
-
onChange?.(field, newVal);
|
|
100
|
-
},
|
|
101
|
-
onInitial: () => {
|
|
102
|
-
if (initialValue == null) {
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
const value = typeof initialValue === 'function' ? initialValue(field) : initialValue;
|
|
106
|
-
field.setValue(value, true);
|
|
107
|
-
},
|
|
108
|
-
removeProp: () => {
|
|
109
|
-
if (field.name) {
|
|
110
|
-
field.parent.clearPropValue(field.name);
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
...mixedSetterProps,
|
|
114
|
-
children: children
|
|
115
|
-
}, field.id);
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
const SettingFieldItem = observer(({
|
|
119
|
-
field
|
|
120
|
-
}) => {
|
|
121
|
-
const {
|
|
122
|
-
customFieldItem
|
|
123
|
-
} = useSettingRendererContext();
|
|
124
|
-
if (customFieldItem) {
|
|
125
|
-
return customFieldItem(field, /*#__PURE__*/jsx(SettingSetter, {
|
|
126
|
-
field: field
|
|
127
|
-
}));
|
|
128
|
-
}
|
|
129
|
-
return /*#__PURE__*/jsxs("div", {
|
|
130
|
-
className: "space-y-2",
|
|
131
|
-
children: [/*#__PURE__*/jsx("label", {
|
|
132
|
-
htmlFor: field.id,
|
|
133
|
-
className: "block text-sm font-medium text-gray-700",
|
|
134
|
-
children: field.title
|
|
135
|
-
}), /*#__PURE__*/jsx(SettingSetter, {
|
|
136
|
-
field: field
|
|
137
|
-
})]
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
const SettingFieldGroup = observer(({
|
|
141
|
-
field
|
|
142
|
-
}) => {
|
|
143
|
-
const {
|
|
144
|
-
customFieldGroup
|
|
145
|
-
} = useSettingRendererContext();
|
|
146
|
-
if (customFieldGroup) {
|
|
147
|
-
return customFieldGroup(field, /*#__PURE__*/jsx(SettingSetter, {
|
|
148
|
-
field: field,
|
|
149
|
-
children: field.items?.map(item => /*#__PURE__*/jsx(SettingFieldView, {
|
|
150
|
-
field: item
|
|
151
|
-
}, item.id))
|
|
152
|
-
}));
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
// 如果 field 没有 setter,则理解为其 父级 field 的 items 数据
|
|
156
|
-
if (!field.setter) {
|
|
157
|
-
return field.items?.map(item => /*#__PURE__*/jsx(SettingFieldView, {
|
|
158
|
-
field: item
|
|
159
|
-
}, item.id));
|
|
160
|
-
}
|
|
161
|
-
return /*#__PURE__*/jsx(SettingSetter, {
|
|
162
|
-
field: field,
|
|
163
|
-
children: field.items?.map(item => /*#__PURE__*/jsx(SettingFieldView, {
|
|
164
|
-
field: item
|
|
165
|
-
}, item.id))
|
|
166
|
-
});
|
|
167
|
-
});
|
|
168
|
-
const SettingFieldView = ({
|
|
169
|
-
field
|
|
170
|
-
}) => {
|
|
171
|
-
if (field.isGroup) {
|
|
172
|
-
return /*#__PURE__*/jsx(SettingFieldGroup, {
|
|
173
|
-
field: field
|
|
174
|
-
}, field.id);
|
|
175
|
-
} else {
|
|
176
|
-
return /*#__PURE__*/jsx(SettingFieldItem, {
|
|
177
|
-
field: field
|
|
178
|
-
}, field.id);
|
|
179
|
-
}
|
|
180
|
-
};
|
|
181
|
-
const SettingRender = observer(props => {
|
|
182
|
-
const {
|
|
183
|
-
editor,
|
|
184
|
-
customFieldItem,
|
|
185
|
-
customFieldGroup
|
|
186
|
-
} = props;
|
|
187
|
-
const designer = editor.get('designer');
|
|
188
|
-
const setterManager = editor.get('setterManager');
|
|
189
|
-
const {
|
|
190
|
-
settingsManager
|
|
191
|
-
} = designer;
|
|
192
|
-
const {
|
|
193
|
-
settings
|
|
194
|
-
} = settingsManager;
|
|
195
|
-
const items = settings?.items;
|
|
196
|
-
const ctx = useMemo(() => {
|
|
197
|
-
const ctx = {};
|
|
198
|
-
ctx.setterManager = setterManager;
|
|
199
|
-
ctx.settingsManager = settingsManager;
|
|
200
|
-
ctx.customFieldItem = customFieldItem;
|
|
201
|
-
ctx.customFieldGroup = customFieldGroup;
|
|
202
|
-
return ctx;
|
|
203
|
-
}, [setterManager, settingsManager, customFieldItem, customFieldGroup]);
|
|
204
|
-
if (!settings) {
|
|
205
|
-
// 未选中节点,提示选中 或者 显示根节点设置
|
|
206
|
-
return /*#__PURE__*/jsx("div", {
|
|
207
|
-
className: "lc-settings-main",
|
|
208
|
-
children: /*#__PURE__*/jsx("div", {
|
|
209
|
-
className: "lc-settings-notice",
|
|
210
|
-
children: /*#__PURE__*/jsx("p", {
|
|
211
|
-
children: "Please select a node in canvas"
|
|
212
|
-
})
|
|
213
|
-
})
|
|
214
|
-
});
|
|
215
|
-
}
|
|
216
|
-
|
|
217
|
-
// 当节点被锁定,且未开启锁定后容器可设置属性
|
|
218
|
-
if (settings.isLocked) {
|
|
219
|
-
return /*#__PURE__*/jsx("div", {
|
|
220
|
-
className: "lc-settings-main",
|
|
221
|
-
children: /*#__PURE__*/jsx("div", {
|
|
222
|
-
className: "lc-settings-notice",
|
|
223
|
-
children: /*#__PURE__*/jsx("p", {
|
|
224
|
-
children: "Current node is locked"
|
|
225
|
-
})
|
|
226
|
-
})
|
|
227
|
-
});
|
|
228
|
-
}
|
|
229
|
-
if (Array.isArray(settings.items) && settings.items.length === 0) {
|
|
230
|
-
return /*#__PURE__*/jsx("div", {
|
|
231
|
-
className: "lc-settings-main",
|
|
232
|
-
children: /*#__PURE__*/jsx("div", {
|
|
233
|
-
className: "lc-settings-notice",
|
|
234
|
-
children: /*#__PURE__*/jsx("p", {
|
|
235
|
-
children: "No config found for this type of component"
|
|
236
|
-
})
|
|
237
|
-
})
|
|
238
|
-
});
|
|
239
|
-
}
|
|
240
|
-
if (!settings.isSameComponent) {
|
|
241
|
-
// TODO: future support 获取设置项交集编辑
|
|
242
|
-
return /*#__PURE__*/jsx("div", {
|
|
243
|
-
className: "lc-settings-main",
|
|
244
|
-
children: /*#__PURE__*/jsx("div", {
|
|
245
|
-
className: "lc-settings-notice",
|
|
246
|
-
children: /*#__PURE__*/jsx("p", {
|
|
247
|
-
children: "Please select same kind of components"
|
|
248
|
-
})
|
|
249
|
-
})
|
|
250
|
-
});
|
|
251
|
-
}
|
|
252
|
-
return /*#__PURE__*/jsx(SettingRendererContext.Provider, {
|
|
253
|
-
value: ctx,
|
|
254
|
-
children: items?.map(item => /*#__PURE__*/jsx(SettingFieldView, {
|
|
255
|
-
field: item
|
|
256
|
-
}, item.id))
|
|
257
|
-
});
|
|
258
|
-
});
|
|
5
|
+
import { observer } from 'mobx-react';
|
|
259
6
|
|
|
260
7
|
class Adapter {
|
|
261
8
|
renderers = {};
|
|
@@ -429,12 +176,12 @@ function baseIsNative(value) {
|
|
|
429
176
|
return pattern.test(toSource(value));
|
|
430
177
|
}
|
|
431
178
|
|
|
432
|
-
function getValue
|
|
179
|
+
function getValue(object, key) {
|
|
433
180
|
return object == null ? undefined : object[key];
|
|
434
181
|
}
|
|
435
182
|
|
|
436
183
|
function getNative(object, key) {
|
|
437
|
-
var value = getValue
|
|
184
|
+
var value = getValue(object, key);
|
|
438
185
|
return baseIsNative(value) ? value : undefined;
|
|
439
186
|
}
|
|
440
187
|
|
|
@@ -855,195 +602,6 @@ function contextFactory() {
|
|
|
855
602
|
return context;
|
|
856
603
|
}
|
|
857
604
|
|
|
858
|
-
const classnames = (...args) => {
|
|
859
|
-
return args.filter(Boolean).join(' ');
|
|
860
|
-
};
|
|
861
|
-
|
|
862
|
-
const logger = createLogger('Renderer');
|
|
863
|
-
|
|
864
|
-
const PropTypes2 = true;
|
|
865
|
-
function inSameDomain() {
|
|
866
|
-
try {
|
|
867
|
-
return window.parent !== window && window.parent.location.host === window.location.host;
|
|
868
|
-
} catch (e) {
|
|
869
|
-
return false;
|
|
870
|
-
}
|
|
871
|
-
}
|
|
872
|
-
function getFileCssName(fileName) {
|
|
873
|
-
if (!fileName) {
|
|
874
|
-
return;
|
|
875
|
-
}
|
|
876
|
-
const name = fileName.replace(/([A-Z])/g, '-$1').toLowerCase();
|
|
877
|
-
return `lce-${name}`.split('-').filter(p => !!p).join('-');
|
|
878
|
-
}
|
|
879
|
-
const isSchema = schema => {
|
|
880
|
-
if (!schema) {
|
|
881
|
-
return false;
|
|
882
|
-
}
|
|
883
|
-
if (schema.componentName === 'Leaf' || schema.componentName === 'Slot') {
|
|
884
|
-
return true;
|
|
885
|
-
}
|
|
886
|
-
if (Array.isArray(schema)) {
|
|
887
|
-
return schema.every(item => isSchema(item));
|
|
888
|
-
}
|
|
889
|
-
const isValidProps = props => {
|
|
890
|
-
if (!props) {
|
|
891
|
-
return false;
|
|
892
|
-
}
|
|
893
|
-
return typeof schema.props === 'object' && !Array.isArray(props);
|
|
894
|
-
};
|
|
895
|
-
return !!(schema.componentName && isValidProps(schema.props));
|
|
896
|
-
};
|
|
897
|
-
const getValue = (obj, path, defaultValue = {}) => {
|
|
898
|
-
if (Array.isArray(obj)) {
|
|
899
|
-
return defaultValue;
|
|
900
|
-
}
|
|
901
|
-
if (!obj || typeof obj !== 'object') {
|
|
902
|
-
return defaultValue;
|
|
903
|
-
}
|
|
904
|
-
const res = path.split('.').reduce((pre, cur) => {
|
|
905
|
-
return pre && pre[cur];
|
|
906
|
-
}, obj);
|
|
907
|
-
if (res === undefined) {
|
|
908
|
-
return defaultValue;
|
|
909
|
-
}
|
|
910
|
-
return res;
|
|
911
|
-
};
|
|
912
|
-
function transformArrayToMap(arr, key, overwrite = true) {
|
|
913
|
-
if (!arr || !Array.isArray(arr)) {
|
|
914
|
-
return {};
|
|
915
|
-
}
|
|
916
|
-
const res = {};
|
|
917
|
-
arr.forEach(item => {
|
|
918
|
-
const curKey = item[key];
|
|
919
|
-
if (item[key] === undefined) {
|
|
920
|
-
return;
|
|
921
|
-
}
|
|
922
|
-
if (res[curKey] && !overwrite) {
|
|
923
|
-
return;
|
|
924
|
-
}
|
|
925
|
-
res[curKey] = item;
|
|
926
|
-
});
|
|
927
|
-
return res;
|
|
928
|
-
}
|
|
929
|
-
const parseData = (schema, self, options = {}) => {
|
|
930
|
-
if (isJSExpression(schema)) {
|
|
931
|
-
return parseExpression({
|
|
932
|
-
str: schema,
|
|
933
|
-
self,
|
|
934
|
-
thisRequired: true,
|
|
935
|
-
logScope: options.logScope
|
|
936
|
-
});
|
|
937
|
-
}
|
|
938
|
-
if (typeof schema === 'string') {
|
|
939
|
-
return schema.trim();
|
|
940
|
-
} else if (Array.isArray(schema)) {
|
|
941
|
-
return schema.map(item => parseData(item, self, options));
|
|
942
|
-
} else if (typeof schema === 'function') {
|
|
943
|
-
return schema.bind(self);
|
|
944
|
-
} else if (typeof schema === 'object') {
|
|
945
|
-
if (!schema) {
|
|
946
|
-
return schema;
|
|
947
|
-
}
|
|
948
|
-
const res = {};
|
|
949
|
-
Object.entries(schema).forEach(([key, val]) => {
|
|
950
|
-
if (key.startsWith('__')) {
|
|
951
|
-
return;
|
|
952
|
-
}
|
|
953
|
-
res[key] = parseData(val, self, options);
|
|
954
|
-
});
|
|
955
|
-
return res;
|
|
956
|
-
}
|
|
957
|
-
return schema;
|
|
958
|
-
};
|
|
959
|
-
const isUseLoop = (loop, isDesignMode) => {
|
|
960
|
-
if (!isDesignMode) {
|
|
961
|
-
return true;
|
|
962
|
-
}
|
|
963
|
-
if (!Array.isArray(loop)) {
|
|
964
|
-
return false;
|
|
965
|
-
}
|
|
966
|
-
return loop.length > 0;
|
|
967
|
-
};
|
|
968
|
-
function checkPropTypes(value, name, rule, componentName) {
|
|
969
|
-
let ruleFunction = rule;
|
|
970
|
-
if (typeof rule === 'string') {
|
|
971
|
-
ruleFunction = new Function(`"use strict"; const PropTypes = arguments[0]; return ${rule}`)(PropTypes2);
|
|
972
|
-
}
|
|
973
|
-
if (!ruleFunction || typeof ruleFunction !== 'function') {
|
|
974
|
-
logger.warn('checkPropTypes should have a function type rule argument');
|
|
975
|
-
return true;
|
|
976
|
-
}
|
|
977
|
-
const err = ruleFunction({
|
|
978
|
-
[name]: value
|
|
979
|
-
}, name, componentName, 'prop', null
|
|
980
|
-
);
|
|
981
|
-
if (err) {
|
|
982
|
-
logger.warn(err);
|
|
983
|
-
}
|
|
984
|
-
return !err;
|
|
985
|
-
}
|
|
986
|
-
function transformStringToFunction(str) {
|
|
987
|
-
if (typeof str !== 'string') {
|
|
988
|
-
return str;
|
|
989
|
-
}
|
|
990
|
-
if (inSameDomain() && window.parent.__newFunc) {
|
|
991
|
-
return window.parent.__newFunc(`"use strict"; return ${str}`)();
|
|
992
|
-
} else {
|
|
993
|
-
return new Function(`"use strict"; return ${str}`)();
|
|
994
|
-
}
|
|
995
|
-
}
|
|
996
|
-
function parseExpression(a, b, c = false) {
|
|
997
|
-
let str;
|
|
998
|
-
let self;
|
|
999
|
-
let thisRequired;
|
|
1000
|
-
let logScope;
|
|
1001
|
-
if (typeof a === 'object' && b === undefined) {
|
|
1002
|
-
str = a.str;
|
|
1003
|
-
self = a.self;
|
|
1004
|
-
thisRequired = a.thisRequired;
|
|
1005
|
-
logScope = a.logScope;
|
|
1006
|
-
} else {
|
|
1007
|
-
str = a;
|
|
1008
|
-
self = b;
|
|
1009
|
-
thisRequired = c;
|
|
1010
|
-
}
|
|
1011
|
-
try {
|
|
1012
|
-
const contextArr = ['"use strict";', 'var __self = arguments[0];'];
|
|
1013
|
-
contextArr.push('return ');
|
|
1014
|
-
let tarStr;
|
|
1015
|
-
tarStr = (str.value || '').trim();
|
|
1016
|
-
tarStr = tarStr.replace(/this(\W|$)/g, (_a, b) => `__self${b}`);
|
|
1017
|
-
tarStr = contextArr.join('\n') + tarStr;
|
|
1018
|
-
if (inSameDomain() && window.parent.__newFunc) {
|
|
1019
|
-
return window.parent.__newFunc(tarStr)(self);
|
|
1020
|
-
}
|
|
1021
|
-
const code = `with(${thisRequired ? '{}' : '$scope || {}'}) { ${tarStr} }`;
|
|
1022
|
-
return new Function('$scope', code)(self);
|
|
1023
|
-
} catch (err) {
|
|
1024
|
-
logger.error(`${logScope || ''} parseExpression.error`, err, str, self?.__self ?? self);
|
|
1025
|
-
return undefined;
|
|
1026
|
-
}
|
|
1027
|
-
}
|
|
1028
|
-
function parseThisRequiredExpression(str, self) {
|
|
1029
|
-
return parseExpression(str, self, true);
|
|
1030
|
-
}
|
|
1031
|
-
function isString(str) {
|
|
1032
|
-
return {}.toString.call(str) === '[object String]';
|
|
1033
|
-
}
|
|
1034
|
-
function capitalizeFirstLetter(word) {
|
|
1035
|
-
if (!word || !isString(word) || word.length === 0) {
|
|
1036
|
-
return word;
|
|
1037
|
-
}
|
|
1038
|
-
return word[0].toUpperCase() + word.slice(1);
|
|
1039
|
-
}
|
|
1040
|
-
const isReactClass = obj => {
|
|
1041
|
-
return obj && obj.prototype && (obj.prototype.isReactComponent || obj.prototype instanceof Component);
|
|
1042
|
-
};
|
|
1043
|
-
function isReactComponent(obj) {
|
|
1044
|
-
return obj && (isReactClass(obj) || typeof obj === 'function');
|
|
1045
|
-
}
|
|
1046
|
-
|
|
1047
605
|
const excludePropertyNames = ['$$typeof', 'render', 'defaultProps', 'props', 'length', 'prototype', 'name', 'caller', 'callee', 'arguments'];
|
|
1048
606
|
const cloneEnumerableProperty = (target, origin, excludes = excludePropertyNames) => {
|
|
1049
607
|
const compExtraPropertyNames = Object.keys(origin).filter(d => !excludes.includes(d));
|
|
@@ -1063,6 +621,13 @@ const createForwardRefHocElement = (Wrapper, Comp) => {
|
|
|
1063
621
|
return WrapperComponent;
|
|
1064
622
|
};
|
|
1065
623
|
|
|
624
|
+
const isReactClass = obj => {
|
|
625
|
+
return obj && obj.prototype && (obj.prototype.isReactComponent || obj.prototype instanceof Component);
|
|
626
|
+
};
|
|
627
|
+
const isReactComponent = obj => {
|
|
628
|
+
return obj && (isReactClass(obj) || typeof obj === 'function');
|
|
629
|
+
};
|
|
630
|
+
|
|
1066
631
|
const patchDidCatch = (Comp, {
|
|
1067
632
|
baseRenderer
|
|
1068
633
|
}) => {
|
|
@@ -1592,7 +1157,7 @@ const leafWrapper = (Comp, {
|
|
|
1592
1157
|
__id: this.leaf?.id,
|
|
1593
1158
|
ref: forwardRef
|
|
1594
1159
|
};
|
|
1595
|
-
|
|
1160
|
+
compProps.__inner__ = undefined;
|
|
1596
1161
|
if (this.hasChildren) {
|
|
1597
1162
|
return engine.createElement(Comp, compProps, this.children);
|
|
1598
1163
|
}
|
|
@@ -1607,11 +1172,14 @@ const leafWrapper = (Comp, {
|
|
|
1607
1172
|
return LeafWrapper;
|
|
1608
1173
|
};
|
|
1609
1174
|
|
|
1175
|
+
/**
|
|
1176
|
+
* execute method in schema.lifeCycles with context
|
|
1177
|
+
*/
|
|
1610
1178
|
function executeLifeCycleMethod(context, schema, method, args) {
|
|
1611
1179
|
if (!context || !isSchema(schema) || !method) {
|
|
1612
1180
|
return;
|
|
1613
1181
|
}
|
|
1614
|
-
const lifeCycleMethods = getValue(schema, 'lifeCycles', {});
|
|
1182
|
+
const lifeCycleMethods = getValue$1(schema, 'lifeCycles', {});
|
|
1615
1183
|
let fn = lifeCycleMethods[method];
|
|
1616
1184
|
if (!fn) {
|
|
1617
1185
|
return;
|
|
@@ -1832,60 +1400,49 @@ function baseRendererFactory() {
|
|
|
1832
1400
|
if (!props) {
|
|
1833
1401
|
return;
|
|
1834
1402
|
}
|
|
1835
|
-
|
|
1836
|
-
|
|
1837
|
-
|
|
1838
|
-
|
|
1839
|
-
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
|
|
1843
|
-
|
|
1844
|
-
|
|
1845
|
-
|
|
1846
|
-
|
|
1847
|
-
|
|
1848
|
-
|
|
1849
|
-
|
|
1850
|
-
|
|
1851
|
-
|
|
1852
|
-
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1866
|
-
|
|
1867
|
-
|
|
1868
|
-
|
|
1869
|
-
|
|
1870
|
-
|
|
1871
|
-
|
|
1872
|
-
|
|
1873
|
-
|
|
1874
|
-
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1878
|
-
// .then((res: any) => {
|
|
1879
|
-
// if (isEmpty(res)) {
|
|
1880
|
-
// return resolve({})
|
|
1881
|
-
// }
|
|
1882
|
-
// this.setState(res, resolve as () => void)
|
|
1883
|
-
// })
|
|
1884
|
-
// .catch((err: Error) => {
|
|
1885
|
-
// reject(err)
|
|
1886
|
-
// })
|
|
1887
|
-
// })
|
|
1888
|
-
// }
|
|
1403
|
+
const schema = props.__schema || {};
|
|
1404
|
+
const defaultDataSource = {
|
|
1405
|
+
list: []
|
|
1406
|
+
};
|
|
1407
|
+
const dataSource = schema.dataSource || defaultDataSource;
|
|
1408
|
+
const useDataSourceEngine = !!props.__appHelper?.dataSourceEngine;
|
|
1409
|
+
if (useDataSourceEngine) {
|
|
1410
|
+
const dataSourceEngine = props.__appHelper?.dataSourceEngine;
|
|
1411
|
+
// TODO: 优化
|
|
1412
|
+
if (!dataSourceEngine || !dataSourceEngine.createDataSourceEngine) {
|
|
1413
|
+
logger.error('dataSourceEngine is not found in appHelper, please check your configuration');
|
|
1414
|
+
return;
|
|
1415
|
+
}
|
|
1416
|
+
const {
|
|
1417
|
+
createDataSourceEngine
|
|
1418
|
+
} = dataSourceEngine;
|
|
1419
|
+
this.__dataHelper = {
|
|
1420
|
+
updateConfig: updateDataSource => {
|
|
1421
|
+
const {
|
|
1422
|
+
dataSourceMap,
|
|
1423
|
+
reloadDataSource
|
|
1424
|
+
} = createDataSourceEngine(updateDataSource ?? {}, this);
|
|
1425
|
+
this.reloadDataSource = () => new Promise(resolve => {
|
|
1426
|
+
logger.log('reload data source');
|
|
1427
|
+
reloadDataSource().then(() => {
|
|
1428
|
+
resolve({});
|
|
1429
|
+
});
|
|
1430
|
+
});
|
|
1431
|
+
return dataSourceMap;
|
|
1432
|
+
}
|
|
1433
|
+
};
|
|
1434
|
+
this.dataSourceMap = this.__dataHelper.updateConfig(dataSource);
|
|
1435
|
+
} else {
|
|
1436
|
+
const appHelper = props.__appHelper || {};
|
|
1437
|
+
this.__dataHelper = new DataHelper(this, dataSource, appHelper, config => this.__parseData(config));
|
|
1438
|
+
this.dataSourceMap = this.__dataHelper.dataSourceMap;
|
|
1439
|
+
this.reloadDataSource = () => new Promise(resolve => {
|
|
1440
|
+
logger.log('reload data source');
|
|
1441
|
+
this.__dataHelper.reloadDataSource().then(() => {
|
|
1442
|
+
resolve({});
|
|
1443
|
+
});
|
|
1444
|
+
});
|
|
1445
|
+
}
|
|
1889
1446
|
};
|
|
1890
1447
|
|
|
1891
1448
|
/**
|
|
@@ -1894,7 +1451,7 @@ function baseRendererFactory() {
|
|
|
1894
1451
|
* @PRIVATE
|
|
1895
1452
|
*/
|
|
1896
1453
|
__writeCss = props => {
|
|
1897
|
-
const css = getValue(props.__schema, 'css', '');
|
|
1454
|
+
const css = getValue$1(props.__schema, 'css', '');
|
|
1898
1455
|
logger.log('create this.styleElement with css', css);
|
|
1899
1456
|
let style = this.__styleElement;
|
|
1900
1457
|
if (!this.__styleElement) {
|
|
@@ -2237,7 +1794,7 @@ function baseRendererFactory() {
|
|
|
2237
1794
|
Comp,
|
|
2238
1795
|
componentInfo = {}
|
|
2239
1796
|
} = info;
|
|
2240
|
-
const propInfo = getValue(componentInfo.props, path);
|
|
1797
|
+
const propInfo = getValue$1(componentInfo.props, path);
|
|
2241
1798
|
// FIXME: 将这行逻辑外置,解耦,线上环境不要验证参数,调试环境可以有,通过传参自定义
|
|
2242
1799
|
const propType = propInfo?.extra?.propType;
|
|
2243
1800
|
const checkProps = value => {
|
|
@@ -2426,8 +1983,8 @@ function baseRendererFactory() {
|
|
|
2426
1983
|
get appHelper() {
|
|
2427
1984
|
return this.props.__appHelper;
|
|
2428
1985
|
}
|
|
2429
|
-
get
|
|
2430
|
-
return this.appHelper?.
|
|
1986
|
+
get dataSourceEngine() {
|
|
1987
|
+
return this.appHelper?.dataSourceEngine;
|
|
2431
1988
|
}
|
|
2432
1989
|
get utils() {
|
|
2433
1990
|
return this.appHelper?.utils;
|
|
@@ -2608,16 +2165,16 @@ function rendererFactory() {
|
|
|
2608
2165
|
constructor(props) {
|
|
2609
2166
|
super(props);
|
|
2610
2167
|
this.state = {};
|
|
2611
|
-
logger
|
|
2168
|
+
logger.log(`entry.constructor - ${props?.schema?.componentName}`);
|
|
2612
2169
|
}
|
|
2613
2170
|
async componentDidMount() {
|
|
2614
|
-
logger
|
|
2171
|
+
logger.log(`entry.componentDidMount - ${this.props.schema && this.props.schema.componentName}`);
|
|
2615
2172
|
}
|
|
2616
2173
|
async componentDidUpdate() {
|
|
2617
|
-
logger
|
|
2174
|
+
logger.log(`entry.componentDidUpdate - ${this.props?.schema?.componentName}`);
|
|
2618
2175
|
}
|
|
2619
2176
|
async componentWillUnmount() {
|
|
2620
|
-
logger
|
|
2177
|
+
logger.log(`entry.componentWillUnmount - ${this.props?.schema?.componentName}`);
|
|
2621
2178
|
}
|
|
2622
2179
|
componentDidCatch(error) {
|
|
2623
2180
|
this.state.engineRenderError = true;
|
|
@@ -2655,10 +2212,10 @@ function rendererFactory() {
|
|
|
2655
2212
|
return null;
|
|
2656
2213
|
}
|
|
2657
2214
|
if (!isSchema(schema)) {
|
|
2658
|
-
logger
|
|
2215
|
+
logger.error('The root component name needs to be one of Page、Block、Component, please check the schema: ', schema);
|
|
2659
2216
|
return '模型结构异常';
|
|
2660
2217
|
}
|
|
2661
|
-
logger
|
|
2218
|
+
logger.log('entry.render');
|
|
2662
2219
|
const allComponents = {
|
|
2663
2220
|
...components,
|
|
2664
2221
|
...RENDERER_COMPS
|
|
@@ -2693,6 +2250,257 @@ function rendererFactory() {
|
|
|
2693
2250
|
};
|
|
2694
2251
|
}
|
|
2695
2252
|
|
|
2696
|
-
const
|
|
2253
|
+
const SettingRendererContext = /*#__PURE__*/createContext({});
|
|
2254
|
+
const useSettingRendererContext = () => {
|
|
2255
|
+
try {
|
|
2256
|
+
return useContext(SettingRendererContext);
|
|
2257
|
+
} catch (error) {
|
|
2258
|
+
console.warn('useSettingRendererContext must be used within a SettingRendererContextProvider');
|
|
2259
|
+
}
|
|
2260
|
+
return {};
|
|
2261
|
+
};
|
|
2262
|
+
|
|
2263
|
+
const getSetterInfo = field => {
|
|
2264
|
+
const {
|
|
2265
|
+
extraProps,
|
|
2266
|
+
setter
|
|
2267
|
+
} = field;
|
|
2268
|
+
const {
|
|
2269
|
+
defaultValue
|
|
2270
|
+
} = extraProps;
|
|
2271
|
+
let setterProps = {};
|
|
2272
|
+
let setterType;
|
|
2273
|
+
let initialValue = null;
|
|
2274
|
+
if (isSetterConfig(setter)) {
|
|
2275
|
+
setterType = setter.componentName;
|
|
2276
|
+
if (setter.props) {
|
|
2277
|
+
setterProps = setter.props;
|
|
2278
|
+
if (typeof setterProps === 'function') {
|
|
2279
|
+
setterProps = setterProps(field);
|
|
2280
|
+
}
|
|
2281
|
+
}
|
|
2282
|
+
if (setter.defaultValue != null) {
|
|
2283
|
+
initialValue = setter.defaultValue;
|
|
2284
|
+
}
|
|
2285
|
+
} else if (setter) {
|
|
2286
|
+
setterType = setter;
|
|
2287
|
+
}
|
|
2288
|
+
if (defaultValue != null && !('defaultValue' in setterProps)) {
|
|
2289
|
+
setterProps.defaultValue = defaultValue;
|
|
2290
|
+
if (initialValue == null) {
|
|
2291
|
+
initialValue = defaultValue;
|
|
2292
|
+
}
|
|
2293
|
+
}
|
|
2294
|
+
if (field.valueState === -1) {
|
|
2295
|
+
setterProps.multiValue = true;
|
|
2296
|
+
}
|
|
2297
|
+
|
|
2298
|
+
// 根据是否支持变量配置做相应的更改
|
|
2299
|
+
const supportVariable = field.extraProps?.supportVariable;
|
|
2300
|
+
const isUseVariableSetter = supportVariable;
|
|
2301
|
+
if (isUseVariableSetter === false) {
|
|
2302
|
+
return {
|
|
2303
|
+
setterProps,
|
|
2304
|
+
initialValue,
|
|
2305
|
+
setterType
|
|
2306
|
+
};
|
|
2307
|
+
}
|
|
2308
|
+
return {
|
|
2309
|
+
setterProps,
|
|
2310
|
+
setterType,
|
|
2311
|
+
initialValue
|
|
2312
|
+
};
|
|
2313
|
+
};
|
|
2314
|
+
const SettingSetter = observer(({
|
|
2315
|
+
field,
|
|
2316
|
+
children
|
|
2317
|
+
}) => {
|
|
2318
|
+
const {
|
|
2319
|
+
setters
|
|
2320
|
+
} = useSettingRendererContext();
|
|
2321
|
+
const {
|
|
2322
|
+
extraProps
|
|
2323
|
+
} = field;
|
|
2324
|
+
const visible = extraProps?.condition && typeof extraProps.condition === 'function' ? extraProps.condition(field) !== false : true;
|
|
2325
|
+
if (!visible) {
|
|
2326
|
+
return null;
|
|
2327
|
+
}
|
|
2328
|
+
const {
|
|
2329
|
+
setterProps = {},
|
|
2330
|
+
setterType,
|
|
2331
|
+
initialValue = null
|
|
2332
|
+
} = getSetterInfo(field);
|
|
2333
|
+
const onChange = extraProps?.onChange;
|
|
2334
|
+
const value = field.valueState === -1 ? null : field.getValue();
|
|
2335
|
+
const {
|
|
2336
|
+
component: SetterComponent,
|
|
2337
|
+
props: mixedSetterProps
|
|
2338
|
+
} = setters.createSetterContent(setterType, setterProps);
|
|
2339
|
+
return /*#__PURE__*/jsx(SetterComponent, {
|
|
2340
|
+
field: field,
|
|
2341
|
+
selected: field.top?.getNode(),
|
|
2342
|
+
initialValue: initialValue,
|
|
2343
|
+
value: value,
|
|
2344
|
+
onChange: newVal => {
|
|
2345
|
+
field.setValue(newVal);
|
|
2346
|
+
onChange?.(field, newVal);
|
|
2347
|
+
},
|
|
2348
|
+
onInitial: () => {
|
|
2349
|
+
if (initialValue == null) {
|
|
2350
|
+
return;
|
|
2351
|
+
}
|
|
2352
|
+
const value = typeof initialValue === 'function' ? initialValue(field) : initialValue;
|
|
2353
|
+
field.setValue(value, true);
|
|
2354
|
+
},
|
|
2355
|
+
removeProp: () => {
|
|
2356
|
+
if (field.name) {
|
|
2357
|
+
field.parent.clearPropValue(field.name);
|
|
2358
|
+
}
|
|
2359
|
+
},
|
|
2360
|
+
...mixedSetterProps,
|
|
2361
|
+
children: children
|
|
2362
|
+
}, field.id);
|
|
2363
|
+
});
|
|
2364
|
+
|
|
2365
|
+
const SettingFieldItem = observer(({
|
|
2366
|
+
field
|
|
2367
|
+
}) => {
|
|
2368
|
+
const {
|
|
2369
|
+
customFieldItem
|
|
2370
|
+
} = useSettingRendererContext();
|
|
2371
|
+
if (customFieldItem) {
|
|
2372
|
+
return customFieldItem(field, /*#__PURE__*/jsx(SettingSetter, {
|
|
2373
|
+
field: field
|
|
2374
|
+
}));
|
|
2375
|
+
}
|
|
2376
|
+
return /*#__PURE__*/jsxs("div", {
|
|
2377
|
+
className: "space-y-2",
|
|
2378
|
+
children: [/*#__PURE__*/jsx("label", {
|
|
2379
|
+
htmlFor: field.id,
|
|
2380
|
+
className: "block text-sm font-medium text-gray-700",
|
|
2381
|
+
children: field.title
|
|
2382
|
+
}), /*#__PURE__*/jsx(SettingSetter, {
|
|
2383
|
+
field: field
|
|
2384
|
+
})]
|
|
2385
|
+
});
|
|
2386
|
+
});
|
|
2387
|
+
const SettingFieldGroup = observer(({
|
|
2388
|
+
field
|
|
2389
|
+
}) => {
|
|
2390
|
+
const {
|
|
2391
|
+
customFieldGroup
|
|
2392
|
+
} = useSettingRendererContext();
|
|
2393
|
+
if (customFieldGroup) {
|
|
2394
|
+
return customFieldGroup(field, /*#__PURE__*/jsx(SettingSetter, {
|
|
2395
|
+
field: field,
|
|
2396
|
+
children: field.items?.map(item => /*#__PURE__*/jsx(SettingFieldView, {
|
|
2397
|
+
field: item
|
|
2398
|
+
}, item.id))
|
|
2399
|
+
}));
|
|
2400
|
+
}
|
|
2401
|
+
|
|
2402
|
+
// 如果 field 没有 setter,则理解为其 父级 field 的 items 数据
|
|
2403
|
+
if (!field.setter) {
|
|
2404
|
+
return field.items?.map(item => /*#__PURE__*/jsx(SettingFieldView, {
|
|
2405
|
+
field: item
|
|
2406
|
+
}, item.id));
|
|
2407
|
+
}
|
|
2408
|
+
return /*#__PURE__*/jsx(SettingSetter, {
|
|
2409
|
+
field: field,
|
|
2410
|
+
children: field.items?.map(item => /*#__PURE__*/jsx(SettingFieldView, {
|
|
2411
|
+
field: item
|
|
2412
|
+
}, item.id))
|
|
2413
|
+
});
|
|
2414
|
+
});
|
|
2415
|
+
const SettingFieldView = ({
|
|
2416
|
+
field
|
|
2417
|
+
}) => {
|
|
2418
|
+
if (field.isGroup) {
|
|
2419
|
+
return /*#__PURE__*/jsx(SettingFieldGroup, {
|
|
2420
|
+
field: field
|
|
2421
|
+
}, field.id);
|
|
2422
|
+
} else {
|
|
2423
|
+
return /*#__PURE__*/jsx(SettingFieldItem, {
|
|
2424
|
+
field: field
|
|
2425
|
+
}, field.id);
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
const SettingRenderer = observer(props => {
|
|
2429
|
+
const {
|
|
2430
|
+
designer,
|
|
2431
|
+
customFieldItem,
|
|
2432
|
+
customFieldGroup
|
|
2433
|
+
} = props;
|
|
2434
|
+
const setters = designer.editor.get('setters');
|
|
2435
|
+
const {
|
|
2436
|
+
settingsManager
|
|
2437
|
+
} = designer;
|
|
2438
|
+
const {
|
|
2439
|
+
settings
|
|
2440
|
+
} = settingsManager;
|
|
2441
|
+
const items = settings?.items;
|
|
2442
|
+
const ctx = useMemo(() => {
|
|
2443
|
+
const ctx = {};
|
|
2444
|
+
ctx.setters = setters;
|
|
2445
|
+
ctx.settingsManager = settingsManager;
|
|
2446
|
+
ctx.customFieldItem = customFieldItem;
|
|
2447
|
+
ctx.customFieldGroup = customFieldGroup;
|
|
2448
|
+
return ctx;
|
|
2449
|
+
}, [setters, settingsManager, customFieldItem, customFieldGroup]);
|
|
2450
|
+
if (!settings) {
|
|
2451
|
+
// 未选中节点,提示选中 或者 显示根节点设置
|
|
2452
|
+
return /*#__PURE__*/jsx("div", {
|
|
2453
|
+
className: "lc-settings-main",
|
|
2454
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2455
|
+
className: "lc-settings-notice",
|
|
2456
|
+
children: /*#__PURE__*/jsx("p", {
|
|
2457
|
+
children: "Please select a node in canvas"
|
|
2458
|
+
})
|
|
2459
|
+
})
|
|
2460
|
+
});
|
|
2461
|
+
}
|
|
2462
|
+
|
|
2463
|
+
// 当节点被锁定,且未开启锁定后容器可设置属性
|
|
2464
|
+
if (settings.isLocked) {
|
|
2465
|
+
return /*#__PURE__*/jsx("div", {
|
|
2466
|
+
className: "lc-settings-main",
|
|
2467
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2468
|
+
className: "lc-settings-notice",
|
|
2469
|
+
children: /*#__PURE__*/jsx("p", {
|
|
2470
|
+
children: "Current node is locked"
|
|
2471
|
+
})
|
|
2472
|
+
})
|
|
2473
|
+
});
|
|
2474
|
+
}
|
|
2475
|
+
if (Array.isArray(settings.items) && settings.items.length === 0) {
|
|
2476
|
+
return /*#__PURE__*/jsx("div", {
|
|
2477
|
+
className: "lc-settings-main",
|
|
2478
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2479
|
+
className: "lc-settings-notice",
|
|
2480
|
+
children: /*#__PURE__*/jsx("p", {
|
|
2481
|
+
children: "No config found for this type of component"
|
|
2482
|
+
})
|
|
2483
|
+
})
|
|
2484
|
+
});
|
|
2485
|
+
}
|
|
2486
|
+
if (!settings.isSameComponent) {
|
|
2487
|
+
// TODO: future support 获取设置项交集编辑
|
|
2488
|
+
return /*#__PURE__*/jsx("div", {
|
|
2489
|
+
className: "lc-settings-main",
|
|
2490
|
+
children: /*#__PURE__*/jsx("div", {
|
|
2491
|
+
className: "lc-settings-notice",
|
|
2492
|
+
children: /*#__PURE__*/jsx("p", {
|
|
2493
|
+
children: "Please select same kind of components"
|
|
2494
|
+
})
|
|
2495
|
+
})
|
|
2496
|
+
});
|
|
2497
|
+
}
|
|
2498
|
+
return /*#__PURE__*/jsx(SettingRendererContext.Provider, {
|
|
2499
|
+
value: ctx,
|
|
2500
|
+
children: items?.map(item => /*#__PURE__*/jsx(SettingFieldView, {
|
|
2501
|
+
field: item
|
|
2502
|
+
}, item.id))
|
|
2503
|
+
});
|
|
2504
|
+
});
|
|
2697
2505
|
|
|
2698
|
-
export {
|
|
2506
|
+
export { RendererContext, SettingFieldView, SettingRenderer, adapter, baseRendererFactory, cloneEnumerableProperty, compWrapper, componentRendererFactory, contextFactory, createForwardRefHocElement, executeLifeCycleMethod, getSchemaChildren, isReactClass, isReactComponent, leafWrapper, pageRendererFactory, rendererFactory, useRendererContext };
|