@blocklet/pages-kit-inner-components 0.6.72 → 0.6.73
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/lib/cjs/add-component.js +12 -12
- package/lib/cjs/chunks/{draft-data-DfZ81oCU.js → draft-data-1hI-ev3X.js} +1 -1
- package/lib/cjs/chunks/{home-CP3WKJ_e.js → home-ymdnbwRQ.js} +2 -2
- package/lib/cjs/chunks/{index-BqynZDZ3.js → index-BAiZumV7.js} +1 -1
- package/lib/cjs/chunks/{publish-button-t3lAZwFy.js → publish-button-45a3egG-.js} +1 -1
- package/lib/cjs/chunks/{site-state-BRYYpS9Q.js → site-state-CcYU6tKv.js} +1 -1
- package/lib/cjs/chunks/state-BAjDjwwp.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/locales.js +2 -2
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +3 -3
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/add-component.js +274 -242
- package/lib/es/chunks/{draft-data-BtzZ0_tq.js → draft-data--WtLtXxy.js} +1 -1
- package/lib/es/chunks/{home-DBOWtpCK.js → home-BIH-BNIG.js} +3 -3
- package/lib/es/chunks/{index-CjNVgrdz.js → index-Cj977HLf.js} +1 -1
- package/lib/es/chunks/{publish-button-CFzWcpJ3.js → publish-button-Dn3ikSo5.js} +3 -3
- package/lib/es/chunks/{site-state-DYm1fKT3.js → site-state-BXM-5tZw.js} +5 -1
- package/lib/es/chunks/state-DS2djQbR.js +873 -0
- package/lib/es/home.js +3 -3
- package/lib/es/locales.js +20 -4
- package/lib/es/resources.js +1 -1
- package/lib/es/setting.js +829 -799
- package/lib/es/site-state.js +1 -1
- package/package.json +3 -3
- package/lib/cjs/chunks/state-BP5DoD6I.js +0 -1
- package/lib/es/chunks/state-Biqa_a5U.js +0 -685
package/lib/es/setting.js
CHANGED
|
@@ -1,137 +1,137 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { Box as P, Alert as
|
|
3
|
-
import { t as
|
|
1
|
+
import { jsx as e, jsxs as x, Fragment as L } from "react/jsx-runtime";
|
|
2
|
+
import { Box as P, Alert as Xe, Typography as D, TextField as R, Stack as k, FormLabel as re, TableContainer as Ze, Paper as _, Table as Ne, TableHead as ze, TableRow as te, TableCell as ne, TableBody as je, Button as E, IconButton as G, FormControlLabel as ge, Switch as Re, InputAdornment as H, alpha as de, Tooltip as B, buttonClasses as er, Dialog as ye, DialogTitle as Ve, DialogContent as Ae, DialogActions as Ee, Checkbox as rr, Autocomplete as De, MenuItem as Z, Collapse as tr, Divider as nr, Popper as ir } from "@mui/material";
|
|
3
|
+
import { t as ve, f as ie, a as le, h as xe } from "./chunks/state-DS2djQbR.js";
|
|
4
4
|
import Y from "@arcblock/ux/lib/Empty";
|
|
5
|
-
import { useLocaleContext as
|
|
5
|
+
import { useLocaleContext as V } from "@arcblock/ux/lib/Locale/context";
|
|
6
6
|
import { CodeEditor as Ce } from "@blocklet/code-editor";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
7
|
+
import or from "@mui/icons-material/AddRounded";
|
|
8
|
+
import lr from "@mui/icons-material/ArrowDownward";
|
|
9
|
+
import sr from "@mui/icons-material/ArrowUpward";
|
|
10
|
+
import ar from "@mui/icons-material/DeleteOutline";
|
|
11
11
|
import T from "lodash/sortBy";
|
|
12
|
-
import { useCallback as W, useMemo as $, useState as K, useEffect as
|
|
13
|
-
import { useUpdate as
|
|
14
|
-
import { ColorItem as
|
|
15
|
-
import { getImageSize as ue, getVideoSize as pe, UploaderButton as Pe, UploaderProvider as
|
|
16
|
-
import { Icon as
|
|
12
|
+
import { useCallback as W, useMemo as $, useState as K, useEffect as M, useImperativeHandle as cr, useRef as se } from "react";
|
|
13
|
+
import { useUpdate as Te, useDebounce as dr } from "react-use";
|
|
14
|
+
import { ColorItem as ur, ConfigColorDialog as pr } from "@blocklet/pages-kit/builtin/color-picker";
|
|
15
|
+
import { getImageSize as ue, getVideoSize as pe, UploaderButton as Pe, UploaderProvider as ae, useUploader as mr } from "@blocklet/pages-kit/builtin/uploader";
|
|
16
|
+
import { Icon as hr } from "@iconify-icon/react";
|
|
17
17
|
import U from "lodash/isEmpty";
|
|
18
|
-
import
|
|
18
|
+
import We from "lodash/set";
|
|
19
19
|
import * as me from "yaml";
|
|
20
20
|
import he from "lodash/cloneDeep";
|
|
21
21
|
import fe from "@arcblock/ux/lib/Toast";
|
|
22
|
-
import { CustomComponentRenderer as
|
|
23
|
-
import { parsePropertyValue as
|
|
24
|
-
import { unstable_useNumberInput as
|
|
25
|
-
import { SyncRounded as
|
|
22
|
+
import { CustomComponentRenderer as Ke, transpileAndLoadScript as fr, getPropertiesFromCode as br } from "@blocklet/pages-kit/components";
|
|
23
|
+
import { parsePropertyValue as gr } from "@blocklet/pages-kit/utils/property";
|
|
24
|
+
import { unstable_useNumberInput as yr, ClickAwayListener as vr } from "@mui/base";
|
|
25
|
+
import { SyncRounded as xr, SyncDisabledRounded as Cr, VisibilityOffRounded as Pr, VisibilityRounded as kr, DeleteOutlineRounded as wr, DragIndicatorRounded as Sr, TranslateRounded as Ue, AddRounded as Le, InfoRounded as Be, PsychologyAlt as Ir, StarRounded as Or, SettingsRounded as Me } from "@mui/icons-material";
|
|
26
26
|
import { getYjsValue as q } from "@syncedstore/core";
|
|
27
|
-
import { useReactive as
|
|
28
|
-
import
|
|
29
|
-
import
|
|
27
|
+
import { useReactive as Nr } from "ahooks";
|
|
28
|
+
import zr from "lodash/assign";
|
|
29
|
+
import jr from "lodash/get";
|
|
30
30
|
import Rr from "lodash/has";
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import { usePopupState as ke, bindTrigger as we, bindDialog as
|
|
39
|
-
import { ErrorBoundary as
|
|
40
|
-
import { useSensors as Lr, useSensor as
|
|
41
|
-
import { SortableContext as
|
|
42
|
-
import { CSS as
|
|
43
|
-
import { nextId as
|
|
44
|
-
function
|
|
45
|
-
return /* @__PURE__ */
|
|
31
|
+
import Vr from "lodash/isEqual";
|
|
32
|
+
import oe from "lodash/isNil";
|
|
33
|
+
import Ar from "lodash/isObject";
|
|
34
|
+
import Er from "lodash/keyBy";
|
|
35
|
+
import Dr from "lodash/omit";
|
|
36
|
+
import Tr from "lodash/pick";
|
|
37
|
+
import Wr from "lodash/reduce";
|
|
38
|
+
import { usePopupState as ke, bindTrigger as we, bindDialog as Fe, bindPopper as Kr } from "material-ui-popup-state/hooks";
|
|
39
|
+
import { ErrorBoundary as Ur } from "react-error-boundary";
|
|
40
|
+
import { useSensors as Lr, useSensor as Br, PointerSensor as Mr, DndContext as Fr, closestCorners as Jr, DragOverlay as Hr } from "@dnd-kit/core";
|
|
41
|
+
import { SortableContext as $r, verticalListSortingStrategy as _r, useSortable as Gr } from "@dnd-kit/sortable";
|
|
42
|
+
import { CSS as Yr } from "@dnd-kit/utilities";
|
|
43
|
+
import { nextId as Je } from "@blocklet/pages-kit/utils/common";
|
|
44
|
+
function qr({ error: r }) {
|
|
45
|
+
return /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(Xe, { severity: "error", children: r.message }) });
|
|
46
46
|
}
|
|
47
|
-
function
|
|
48
|
-
onClick:
|
|
47
|
+
function Qr({
|
|
48
|
+
onClick: r,
|
|
49
49
|
disabled: t,
|
|
50
50
|
sx: i,
|
|
51
51
|
...s
|
|
52
52
|
}) {
|
|
53
|
-
return /* @__PURE__ */
|
|
53
|
+
return /* @__PURE__ */ e(G, { size: "small", color: "warning", variant: "outlined", disabled: t, onClick: r, ...s, children: /* @__PURE__ */ e(ar, { fontSize: "small" }) });
|
|
54
54
|
}
|
|
55
|
-
function
|
|
56
|
-
onClick:
|
|
55
|
+
function Xr({
|
|
56
|
+
onClick: r,
|
|
57
57
|
disabled: t,
|
|
58
58
|
sx: i,
|
|
59
59
|
...s
|
|
60
60
|
}) {
|
|
61
|
-
return /* @__PURE__ */
|
|
61
|
+
return /* @__PURE__ */ e(G, { size: "small", color: "primary", disabled: t, onClick: r, ...s, children: /* @__PURE__ */ e(sr, { fontSize: "small" }) });
|
|
62
62
|
}
|
|
63
|
-
function
|
|
64
|
-
onClick:
|
|
63
|
+
function Zr({
|
|
64
|
+
onClick: r,
|
|
65
65
|
disabled: t,
|
|
66
66
|
sx: i,
|
|
67
67
|
...s
|
|
68
68
|
}) {
|
|
69
|
-
return /* @__PURE__ */
|
|
69
|
+
return /* @__PURE__ */ e(G, { size: "small", color: "primary", disabled: t, onClick: r, ...s, children: /* @__PURE__ */ e(lr, { fontSize: "small" }) });
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
label:
|
|
71
|
+
function et({
|
|
72
|
+
label: r,
|
|
73
73
|
value: t,
|
|
74
74
|
onChange: i,
|
|
75
75
|
disabled: s = !1,
|
|
76
|
-
itemLabel:
|
|
76
|
+
itemLabel: f = "",
|
|
77
77
|
emptyHeight: p = 40,
|
|
78
78
|
property: u,
|
|
79
79
|
renderItem: y,
|
|
80
|
-
...
|
|
80
|
+
...h
|
|
81
81
|
}) {
|
|
82
|
-
const { t:
|
|
82
|
+
const { t: a, locale: d } = V(), l = Te(), o = W(
|
|
83
83
|
(g) => {
|
|
84
|
-
i(
|
|
84
|
+
i(ve(g, u.type));
|
|
85
85
|
},
|
|
86
86
|
[i, u.type]
|
|
87
|
-
), n = $(() => Array.isArray(t) ? t : [], [t]),
|
|
87
|
+
), n = $(() => Array.isArray(t) ? t : [], [t]), m = W(() => {
|
|
88
88
|
const g = [...n, ""];
|
|
89
89
|
o(g), l();
|
|
90
90
|
}, [n, o, l]), b = W(() => {
|
|
91
91
|
if (!u || !u.subProperties)
|
|
92
|
-
return
|
|
92
|
+
return m();
|
|
93
93
|
const g = {};
|
|
94
94
|
T(Object.values(u.subProperties), "index").forEach(({ data: j }) => {
|
|
95
95
|
if (!j.key) return;
|
|
96
|
-
const
|
|
97
|
-
g[j.key] =
|
|
96
|
+
const A = j.locales?.[d]?.defaultValue ?? "";
|
|
97
|
+
g[j.key] = A;
|
|
98
98
|
});
|
|
99
99
|
const O = [...n, g];
|
|
100
100
|
o(O), l();
|
|
101
|
-
}, [n, o, l, u,
|
|
101
|
+
}, [n, o, l, u, d, m]), c = W(
|
|
102
102
|
(g) => {
|
|
103
103
|
try {
|
|
104
|
-
const
|
|
105
|
-
Array.isArray(
|
|
106
|
-
} catch (
|
|
107
|
-
console.error("JSON解析错误:",
|
|
104
|
+
const C = JSON.parse(g);
|
|
105
|
+
Array.isArray(C) ? o(C) : console.error("JSON解析结果不是数组");
|
|
106
|
+
} catch (C) {
|
|
107
|
+
console.error("JSON解析错误:", C);
|
|
108
108
|
}
|
|
109
109
|
},
|
|
110
110
|
[o]
|
|
111
|
-
),
|
|
111
|
+
), v = W(
|
|
112
112
|
(g) => {
|
|
113
|
-
const
|
|
114
|
-
o(
|
|
113
|
+
const C = n.filter((O, j) => j !== g);
|
|
114
|
+
o(C), l();
|
|
115
115
|
},
|
|
116
116
|
[n, o, l]
|
|
117
117
|
), w = W(
|
|
118
118
|
(g) => {
|
|
119
119
|
if (g <= 0) return;
|
|
120
|
-
const
|
|
121
|
-
|
|
120
|
+
const C = [...n], O = C[g];
|
|
121
|
+
C[g] = C[g - 1], C[g - 1] = O, o(C), l();
|
|
122
122
|
},
|
|
123
123
|
[n, o, l]
|
|
124
124
|
), N = W(
|
|
125
125
|
(g) => {
|
|
126
126
|
if (g >= n.length - 1) return;
|
|
127
|
-
const
|
|
128
|
-
|
|
127
|
+
const C = [...n], O = C[g];
|
|
128
|
+
C[g] = C[g + 1], C[g + 1] = O, o(C), l();
|
|
129
129
|
},
|
|
130
130
|
[n, o, l]
|
|
131
131
|
), S = W(
|
|
132
|
-
(g,
|
|
132
|
+
(g, C) => {
|
|
133
133
|
const O = [...n];
|
|
134
|
-
O[g] =
|
|
134
|
+
O[g] = C, o(O);
|
|
135
135
|
},
|
|
136
136
|
[n, o]
|
|
137
137
|
), I = u && u.subProperties && Object.keys(u.subProperties).length > 0, z = $(() => [
|
|
@@ -140,8 +140,8 @@ function rt({
|
|
|
140
140
|
headerName: "#",
|
|
141
141
|
width: 40,
|
|
142
142
|
align: "center",
|
|
143
|
-
renderCell: ({ index: g }) => /* @__PURE__ */
|
|
144
|
-
|
|
143
|
+
renderCell: ({ index: g }) => /* @__PURE__ */ e(
|
|
144
|
+
D,
|
|
145
145
|
{
|
|
146
146
|
variant: "body1",
|
|
147
147
|
sx: {
|
|
@@ -161,21 +161,21 @@ function rt({
|
|
|
161
161
|
{
|
|
162
162
|
field: "content",
|
|
163
163
|
headerName: "",
|
|
164
|
-
renderCell: ({ row: g, index:
|
|
164
|
+
renderCell: ({ row: g, index: C }) => y && I ? y({
|
|
165
165
|
item: g,
|
|
166
|
-
index:
|
|
166
|
+
index: C,
|
|
167
167
|
property: u,
|
|
168
|
-
onChange: (O) => S(
|
|
169
|
-
}) : /* @__PURE__ */
|
|
170
|
-
|
|
168
|
+
onChange: (O) => S(C, O)
|
|
169
|
+
}) : /* @__PURE__ */ e(
|
|
170
|
+
R,
|
|
171
171
|
{
|
|
172
172
|
fullWidth: !0,
|
|
173
173
|
size: "small",
|
|
174
174
|
disabled: s,
|
|
175
175
|
value: g,
|
|
176
|
-
placeholder:
|
|
177
|
-
onChange: (O) => S(
|
|
178
|
-
...
|
|
176
|
+
placeholder: f || `${a("item")} ${C + 1}`,
|
|
177
|
+
onChange: (O) => S(C, O.target.value),
|
|
178
|
+
...h
|
|
179
179
|
}
|
|
180
180
|
)
|
|
181
181
|
},
|
|
@@ -185,16 +185,16 @@ function rt({
|
|
|
185
185
|
width: 30,
|
|
186
186
|
// 增加宽度以容纳更多按钮
|
|
187
187
|
align: "center",
|
|
188
|
-
renderCell: ({ index: g }) => /* @__PURE__ */
|
|
189
|
-
/* @__PURE__ */
|
|
190
|
-
/* @__PURE__ */
|
|
191
|
-
|
|
188
|
+
renderCell: ({ index: g }) => /* @__PURE__ */ x(k, { direction: "column", spacing: 0.25, children: [
|
|
189
|
+
/* @__PURE__ */ e(Xr, { disabled: s || g === 0, onClick: () => w(g) }),
|
|
190
|
+
/* @__PURE__ */ e(
|
|
191
|
+
Zr,
|
|
192
192
|
{
|
|
193
193
|
disabled: s || g === n.length - 1,
|
|
194
194
|
onClick: () => N(g)
|
|
195
195
|
}
|
|
196
196
|
),
|
|
197
|
-
/* @__PURE__ */
|
|
197
|
+
/* @__PURE__ */ e(Qr, { disabled: s, onClick: () => v(g) })
|
|
198
198
|
] })
|
|
199
199
|
}
|
|
200
200
|
], [
|
|
@@ -202,16 +202,16 @@ function rt({
|
|
|
202
202
|
I,
|
|
203
203
|
u,
|
|
204
204
|
S,
|
|
205
|
-
|
|
206
|
-
|
|
205
|
+
f,
|
|
206
|
+
a,
|
|
207
207
|
s,
|
|
208
|
-
|
|
209
|
-
|
|
208
|
+
h,
|
|
209
|
+
v,
|
|
210
210
|
w,
|
|
211
211
|
N,
|
|
212
212
|
n.length
|
|
213
213
|
]);
|
|
214
|
-
return I ? /* @__PURE__ */
|
|
214
|
+
return I ? /* @__PURE__ */ x(
|
|
215
215
|
k,
|
|
216
216
|
{
|
|
217
217
|
sx: {
|
|
@@ -219,9 +219,9 @@ function rt({
|
|
|
219
219
|
gap: 1
|
|
220
220
|
},
|
|
221
221
|
children: [
|
|
222
|
-
|
|
223
|
-
n.length > 0 ? /* @__PURE__ */
|
|
224
|
-
|
|
222
|
+
r && /* @__PURE__ */ e(re, { children: r }),
|
|
223
|
+
n.length > 0 ? /* @__PURE__ */ e(Ze, { component: _, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ x(
|
|
224
|
+
Ne,
|
|
225
225
|
{
|
|
226
226
|
size: "small",
|
|
227
227
|
sx: {
|
|
@@ -238,8 +238,8 @@ function rt({
|
|
|
238
238
|
borderCollapse: "collapse"
|
|
239
239
|
},
|
|
240
240
|
children: [
|
|
241
|
-
/* @__PURE__ */
|
|
242
|
-
|
|
241
|
+
/* @__PURE__ */ e(ze, { sx: { display: "none" }, children: /* @__PURE__ */ e(te, { children: z.map((g) => /* @__PURE__ */ e(
|
|
242
|
+
ne,
|
|
243
243
|
{
|
|
244
244
|
width: g.width,
|
|
245
245
|
align: g.align || "left",
|
|
@@ -248,18 +248,18 @@ function rt({
|
|
|
248
248
|
},
|
|
249
249
|
g.field
|
|
250
250
|
)) }) }),
|
|
251
|
-
/* @__PURE__ */
|
|
252
|
-
|
|
251
|
+
/* @__PURE__ */ e(je, { children: n.map((g, C, O) => /* @__PURE__ */ e(
|
|
252
|
+
te,
|
|
253
253
|
{
|
|
254
254
|
sx: {
|
|
255
|
-
borderBottom:
|
|
255
|
+
borderBottom: C < O.length - 1 ? "1px solid" : "none",
|
|
256
256
|
borderColor: "divider",
|
|
257
257
|
"&:hover": {
|
|
258
258
|
backgroundColor: "action.hover"
|
|
259
259
|
}
|
|
260
260
|
},
|
|
261
|
-
children: z.map((j) => /* @__PURE__ */
|
|
262
|
-
|
|
261
|
+
children: z.map((j) => /* @__PURE__ */ e(
|
|
262
|
+
ne,
|
|
263
263
|
{
|
|
264
264
|
width: j.width,
|
|
265
265
|
align: j.align || "left",
|
|
@@ -268,33 +268,33 @@ function rt({
|
|
|
268
268
|
},
|
|
269
269
|
children: j.renderCell({
|
|
270
270
|
row: g,
|
|
271
|
-
index:
|
|
272
|
-
onChange: (
|
|
271
|
+
index: C,
|
|
272
|
+
onChange: (A) => S(C, A)
|
|
273
273
|
})
|
|
274
274
|
},
|
|
275
|
-
`${
|
|
275
|
+
`${C}-${j.field}`
|
|
276
276
|
))
|
|
277
277
|
},
|
|
278
|
-
|
|
278
|
+
C
|
|
279
279
|
)) })
|
|
280
280
|
]
|
|
281
281
|
}
|
|
282
|
-
) }) : /* @__PURE__ */
|
|
283
|
-
/* @__PURE__ */
|
|
284
|
-
|
|
282
|
+
) }) : /* @__PURE__ */ e(Y, { style: { fontSize: 12, height: p }, children: a("maker.properties.arrayEmpty") }),
|
|
283
|
+
/* @__PURE__ */ e(
|
|
284
|
+
E,
|
|
285
285
|
{
|
|
286
286
|
fullWidth: !0,
|
|
287
287
|
size: "small",
|
|
288
288
|
variant: "outlined",
|
|
289
289
|
disabled: s,
|
|
290
|
-
startIcon: /* @__PURE__ */
|
|
290
|
+
startIcon: /* @__PURE__ */ e(or, {}),
|
|
291
291
|
onClick: b,
|
|
292
|
-
children:
|
|
292
|
+
children: a("maker.properties.addArrayItem")
|
|
293
293
|
}
|
|
294
294
|
)
|
|
295
295
|
]
|
|
296
296
|
}
|
|
297
|
-
) : /* @__PURE__ */
|
|
297
|
+
) : /* @__PURE__ */ x(
|
|
298
298
|
k,
|
|
299
299
|
{
|
|
300
300
|
sx: {
|
|
@@ -302,15 +302,15 @@ function rt({
|
|
|
302
302
|
gap: 1
|
|
303
303
|
},
|
|
304
304
|
children: [
|
|
305
|
-
|
|
306
|
-
/* @__PURE__ */
|
|
305
|
+
r && /* @__PURE__ */ e(re, { children: r }),
|
|
306
|
+
/* @__PURE__ */ e(P, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ e(
|
|
307
307
|
Ce,
|
|
308
308
|
{
|
|
309
309
|
keyId: u.id,
|
|
310
|
-
locale:
|
|
310
|
+
locale: d,
|
|
311
311
|
language: "json",
|
|
312
312
|
value: JSON.stringify(n, null, 2),
|
|
313
|
-
onChange: (g) =>
|
|
313
|
+
onChange: (g) => c(g || ""),
|
|
314
314
|
fullScreenOptions: {
|
|
315
315
|
enableEscExit: !0,
|
|
316
316
|
targetContainer: () => document.getElementById("parameters-config-dialog") || null
|
|
@@ -322,66 +322,66 @@ function rt({
|
|
|
322
322
|
}
|
|
323
323
|
);
|
|
324
324
|
}
|
|
325
|
-
function
|
|
326
|
-
ref:
|
|
325
|
+
function rt({
|
|
326
|
+
ref: r,
|
|
327
327
|
showMarkdown: t,
|
|
328
328
|
markdown: i,
|
|
329
329
|
onMarkdownChange: s,
|
|
330
|
-
showUploader:
|
|
330
|
+
showUploader: f,
|
|
331
331
|
value: p,
|
|
332
332
|
meta: u,
|
|
333
333
|
onChange: y,
|
|
334
|
-
...
|
|
334
|
+
...h
|
|
335
335
|
}) {
|
|
336
|
-
const [
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
}, [p,
|
|
336
|
+
const [a, d] = K("");
|
|
337
|
+
M(() => {
|
|
338
|
+
d(p || "");
|
|
339
|
+
}, [p, d]);
|
|
340
340
|
const l = async () => {
|
|
341
|
-
if (
|
|
342
|
-
const n =
|
|
341
|
+
if (a !== p) {
|
|
342
|
+
const n = ie(a);
|
|
343
343
|
if (!n) {
|
|
344
|
-
y(
|
|
344
|
+
y(a, void 0);
|
|
345
345
|
return;
|
|
346
346
|
}
|
|
347
|
-
const
|
|
347
|
+
const m = await ue(n).catch(() => pe(n)).catch(() => {
|
|
348
348
|
});
|
|
349
|
-
y(
|
|
349
|
+
y(a, { ...m, filename: a });
|
|
350
350
|
}
|
|
351
351
|
};
|
|
352
|
-
|
|
352
|
+
dr(
|
|
353
353
|
() => {
|
|
354
|
-
|
|
354
|
+
a !== p && y(a);
|
|
355
355
|
},
|
|
356
356
|
300,
|
|
357
|
-
[
|
|
358
|
-
),
|
|
357
|
+
[a]
|
|
358
|
+
), cr(r, () => ({
|
|
359
359
|
submit: l
|
|
360
360
|
}));
|
|
361
361
|
const o = {};
|
|
362
|
-
return
|
|
362
|
+
return f && (o.InputProps = {
|
|
363
363
|
sx: { pr: 0 },
|
|
364
|
-
endAdornment: /* @__PURE__ */
|
|
364
|
+
endAdornment: /* @__PURE__ */ e(H, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ e(
|
|
365
365
|
Pe,
|
|
366
366
|
{
|
|
367
367
|
onChange: async ({ response: n }) => {
|
|
368
|
-
const
|
|
369
|
-
let
|
|
370
|
-
b && (
|
|
371
|
-
})), y(
|
|
372
|
-
...
|
|
373
|
-
filename:
|
|
368
|
+
const m = n?.data?.filename, b = ie(m) || "";
|
|
369
|
+
let c = {};
|
|
370
|
+
b && (c = await ue(b).catch(() => pe(b)).catch(() => {
|
|
371
|
+
})), y(m, {
|
|
372
|
+
...c,
|
|
373
|
+
filename: m
|
|
374
374
|
});
|
|
375
375
|
}
|
|
376
376
|
}
|
|
377
377
|
) })
|
|
378
|
-
}), /* @__PURE__ */
|
|
379
|
-
|
|
378
|
+
}), /* @__PURE__ */ e(
|
|
379
|
+
R,
|
|
380
380
|
{
|
|
381
381
|
size: "small",
|
|
382
382
|
fullWidth: !0,
|
|
383
|
-
...
|
|
384
|
-
label: /* @__PURE__ */
|
|
383
|
+
...h,
|
|
384
|
+
label: /* @__PURE__ */ x(
|
|
385
385
|
k,
|
|
386
386
|
{
|
|
387
387
|
direction: "row",
|
|
@@ -390,18 +390,18 @@ function tt({
|
|
|
390
390
|
alignItems: "center"
|
|
391
391
|
},
|
|
392
392
|
children: [
|
|
393
|
-
|
|
394
|
-
t && /* @__PURE__ */
|
|
393
|
+
h.label,
|
|
394
|
+
t && /* @__PURE__ */ x(L, { children: [
|
|
395
395
|
" (",
|
|
396
|
-
/* @__PURE__ */
|
|
396
|
+
/* @__PURE__ */ e(
|
|
397
397
|
ge,
|
|
398
398
|
{
|
|
399
399
|
checked: i,
|
|
400
|
-
label: /* @__PURE__ */
|
|
400
|
+
label: /* @__PURE__ */ e(P, { component: hr, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
|
|
401
401
|
labelPlacement: "start",
|
|
402
|
-
control: /* @__PURE__ */
|
|
402
|
+
control: /* @__PURE__ */ e(Re, { size: "small" }),
|
|
403
403
|
sx: { ml: 0.25, pr: 1 },
|
|
404
|
-
onChange: (n,
|
|
404
|
+
onChange: (n, m) => s?.(m)
|
|
405
405
|
}
|
|
406
406
|
),
|
|
407
407
|
")"
|
|
@@ -409,50 +409,50 @@ function tt({
|
|
|
409
409
|
]
|
|
410
410
|
}
|
|
411
411
|
),
|
|
412
|
-
value:
|
|
413
|
-
onChange: (n) =>
|
|
412
|
+
value: a,
|
|
413
|
+
onChange: (n) => d(n.target.value),
|
|
414
414
|
...o,
|
|
415
415
|
onKeyDown: (n) => {
|
|
416
416
|
n.keyCode !== 229 && n.key === "Enter" && l();
|
|
417
417
|
},
|
|
418
418
|
slotProps: {
|
|
419
|
-
inputLabel: { shrink: !0, ...
|
|
419
|
+
inputLabel: { shrink: !0, ...h.InputLabelProps }
|
|
420
420
|
}
|
|
421
421
|
}
|
|
422
422
|
);
|
|
423
423
|
}
|
|
424
|
-
function
|
|
425
|
-
value:
|
|
424
|
+
function tt({
|
|
425
|
+
value: r,
|
|
426
426
|
onChange: t,
|
|
427
427
|
disableGradient: i = !1,
|
|
428
428
|
...s
|
|
429
429
|
}) {
|
|
430
|
-
const
|
|
431
|
-
return /* @__PURE__ */
|
|
432
|
-
/* @__PURE__ */
|
|
433
|
-
|
|
430
|
+
const f = se(null);
|
|
431
|
+
return /* @__PURE__ */ x(L, { children: [
|
|
432
|
+
/* @__PURE__ */ e(
|
|
433
|
+
rt,
|
|
434
434
|
{
|
|
435
435
|
...s,
|
|
436
|
-
value:
|
|
436
|
+
value: r,
|
|
437
437
|
onChange: t,
|
|
438
438
|
InputProps: {
|
|
439
|
-
endAdornment: /* @__PURE__ */
|
|
440
|
-
|
|
439
|
+
endAdornment: /* @__PURE__ */ e(H, { position: "end", children: /* @__PURE__ */ e(
|
|
440
|
+
ur,
|
|
441
441
|
{
|
|
442
|
-
color:
|
|
442
|
+
color: r ?? "",
|
|
443
443
|
style: { width: "1.5rem", height: "1.5rem", padding: 0 },
|
|
444
444
|
onClick: () => {
|
|
445
|
-
|
|
445
|
+
f.current?.open({ value: r ?? "" });
|
|
446
446
|
}
|
|
447
447
|
}
|
|
448
448
|
) })
|
|
449
449
|
}
|
|
450
450
|
}
|
|
451
451
|
),
|
|
452
|
-
/* @__PURE__ */
|
|
453
|
-
|
|
452
|
+
/* @__PURE__ */ e(
|
|
453
|
+
pr,
|
|
454
454
|
{
|
|
455
|
-
ref:
|
|
455
|
+
ref: f,
|
|
456
456
|
onSave: ({ value: p }, u) => {
|
|
457
457
|
t(p), u();
|
|
458
458
|
},
|
|
@@ -461,38 +461,38 @@ function nt({
|
|
|
461
461
|
)
|
|
462
462
|
] });
|
|
463
463
|
}
|
|
464
|
-
function
|
|
465
|
-
label:
|
|
464
|
+
function nt({
|
|
465
|
+
label: r,
|
|
466
466
|
value: t,
|
|
467
467
|
onChange: i,
|
|
468
468
|
property: s,
|
|
469
|
-
component:
|
|
469
|
+
component: f,
|
|
470
470
|
defaultLocale: p,
|
|
471
471
|
allComponents: u,
|
|
472
472
|
PropertyValueField: y,
|
|
473
|
-
onUpload:
|
|
473
|
+
onUpload: h
|
|
474
474
|
}) {
|
|
475
|
-
const { locale:
|
|
475
|
+
const { locale: a } = V(), d = se(null);
|
|
476
476
|
if (!U(s.subProperties)) {
|
|
477
477
|
const o = T(Object.values(s.subProperties || {}), "index").filter(
|
|
478
478
|
(n) => n.data.visible !== !1 && n.data.key
|
|
479
479
|
);
|
|
480
|
-
return /* @__PURE__ */
|
|
480
|
+
return /* @__PURE__ */ x(
|
|
481
481
|
k,
|
|
482
482
|
{
|
|
483
483
|
sx: {
|
|
484
484
|
width: "100%"
|
|
485
485
|
},
|
|
486
486
|
children: [
|
|
487
|
-
/* @__PURE__ */
|
|
488
|
-
/* @__PURE__ */
|
|
489
|
-
const { data: b } = n,
|
|
487
|
+
/* @__PURE__ */ e(re, { sx: { px: 0.25, py: 0.5 }, children: r }),
|
|
488
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(P, { sx: { position: "relative" }, children: o.map((n, m) => {
|
|
489
|
+
const { data: b } = n, c = b.key ?? b.id, v = m === o.length - 1;
|
|
490
490
|
let w = null;
|
|
491
491
|
try {
|
|
492
|
-
t && typeof t == "object" ? w = t[
|
|
492
|
+
t && typeof t == "object" ? w = t[c] : typeof t == "string" && (w = (s.type === "yaml" ? me.parse(t || "") : JSON.parse(t || "{}"))[c]);
|
|
493
493
|
} catch {
|
|
494
494
|
}
|
|
495
|
-
w == null && (b.locales &&
|
|
495
|
+
w == null && (b.locales && a && b.locales[a] ? w = b.locales[a].defaultValue : b.locales && p && b.locales[p] && (w = b.locales[p].defaultValue));
|
|
496
496
|
const N = (I) => {
|
|
497
497
|
try {
|
|
498
498
|
let z = {};
|
|
@@ -502,24 +502,24 @@ function it({
|
|
|
502
502
|
} catch {
|
|
503
503
|
}
|
|
504
504
|
else typeof t == "object" && t !== null && (z = { ...t });
|
|
505
|
-
|
|
506
|
-
const g =
|
|
505
|
+
We(z, c, I);
|
|
506
|
+
const g = ve(z, s.type);
|
|
507
507
|
i?.(g);
|
|
508
508
|
} catch (z) {
|
|
509
509
|
console.error("Error updating property:", z);
|
|
510
510
|
}
|
|
511
511
|
}, S = 8;
|
|
512
|
-
return /* @__PURE__ */
|
|
512
|
+
return /* @__PURE__ */ x(
|
|
513
513
|
P,
|
|
514
514
|
{
|
|
515
515
|
sx: {
|
|
516
|
-
mb:
|
|
516
|
+
mb: v ? 0 : 1,
|
|
517
517
|
// 底部边距,最后一项不需要
|
|
518
518
|
display: "flex",
|
|
519
519
|
flexDirection: "row"
|
|
520
520
|
},
|
|
521
521
|
children: [
|
|
522
|
-
/* @__PURE__ */
|
|
522
|
+
/* @__PURE__ */ x(
|
|
523
523
|
P,
|
|
524
524
|
{
|
|
525
525
|
sx: {
|
|
@@ -528,7 +528,7 @@ function it({
|
|
|
528
528
|
flexShrink: 0
|
|
529
529
|
},
|
|
530
530
|
children: [
|
|
531
|
-
/* @__PURE__ */
|
|
531
|
+
/* @__PURE__ */ e(
|
|
532
532
|
P,
|
|
533
533
|
{
|
|
534
534
|
sx: {
|
|
@@ -543,7 +543,7 @@ function it({
|
|
|
543
543
|
}
|
|
544
544
|
}
|
|
545
545
|
),
|
|
546
|
-
/* @__PURE__ */
|
|
546
|
+
/* @__PURE__ */ e(
|
|
547
547
|
P,
|
|
548
548
|
{
|
|
549
549
|
sx: {
|
|
@@ -558,7 +558,7 @@ function it({
|
|
|
558
558
|
}
|
|
559
559
|
}
|
|
560
560
|
),
|
|
561
|
-
!
|
|
561
|
+
!v && /* @__PURE__ */ e(
|
|
562
562
|
P,
|
|
563
563
|
{
|
|
564
564
|
sx: {
|
|
@@ -577,10 +577,10 @@ function it({
|
|
|
577
577
|
]
|
|
578
578
|
}
|
|
579
579
|
),
|
|
580
|
-
/* @__PURE__ */
|
|
580
|
+
/* @__PURE__ */ e(P, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ e(
|
|
581
581
|
y,
|
|
582
582
|
{
|
|
583
|
-
component:
|
|
583
|
+
component: f,
|
|
584
584
|
property: b,
|
|
585
585
|
value: w,
|
|
586
586
|
onChange: N,
|
|
@@ -599,14 +599,14 @@ function it({
|
|
|
599
599
|
}
|
|
600
600
|
);
|
|
601
601
|
}
|
|
602
|
-
return /* @__PURE__ */
|
|
602
|
+
return /* @__PURE__ */ e(
|
|
603
603
|
k,
|
|
604
604
|
{
|
|
605
605
|
sx: {
|
|
606
606
|
width: "100%",
|
|
607
607
|
gap: 2
|
|
608
608
|
},
|
|
609
|
-
children: /* @__PURE__ */
|
|
609
|
+
children: /* @__PURE__ */ x(
|
|
610
610
|
k,
|
|
611
611
|
{
|
|
612
612
|
sx: {
|
|
@@ -619,8 +619,8 @@ function it({
|
|
|
619
619
|
".monaco-editor,.overflow-guard": { borderRadius: 1 }
|
|
620
620
|
},
|
|
621
621
|
children: [
|
|
622
|
-
/* @__PURE__ */
|
|
623
|
-
|
|
622
|
+
/* @__PURE__ */ e(
|
|
623
|
+
re,
|
|
624
624
|
{
|
|
625
625
|
sx: {
|
|
626
626
|
position: "absolute",
|
|
@@ -628,21 +628,21 @@ function it({
|
|
|
628
628
|
top: 0,
|
|
629
629
|
transform: "translate(0px, -7px) scale(0.75)"
|
|
630
630
|
},
|
|
631
|
-
children:
|
|
631
|
+
children: r
|
|
632
632
|
}
|
|
633
633
|
),
|
|
634
|
-
/* @__PURE__ */
|
|
634
|
+
/* @__PURE__ */ e(
|
|
635
635
|
Ce,
|
|
636
636
|
{
|
|
637
637
|
keyId: s.id,
|
|
638
|
-
locale:
|
|
638
|
+
locale: a,
|
|
639
639
|
language: s.type === "yaml" ? "yaml" : "json",
|
|
640
640
|
value: typeof t == "string" ? t : "",
|
|
641
641
|
onChange: (o) => {
|
|
642
642
|
i?.(o);
|
|
643
643
|
},
|
|
644
644
|
onUpload: (o) => {
|
|
645
|
-
|
|
645
|
+
d.current = o, h && h(o);
|
|
646
646
|
},
|
|
647
647
|
fullScreenOptions: {
|
|
648
648
|
enableEscExit: !0,
|
|
@@ -651,7 +651,7 @@ function it({
|
|
|
651
651
|
},
|
|
652
652
|
s.id
|
|
653
653
|
),
|
|
654
|
-
/* @__PURE__ */
|
|
654
|
+
/* @__PURE__ */ e(
|
|
655
655
|
P,
|
|
656
656
|
{
|
|
657
657
|
component: "fieldset",
|
|
@@ -668,7 +668,7 @@ function it({
|
|
|
668
668
|
px: 1,
|
|
669
669
|
py: 0
|
|
670
670
|
},
|
|
671
|
-
children: /* @__PURE__ */
|
|
671
|
+
children: /* @__PURE__ */ e(P, { component: "legend", sx: { fontSize: "0.75em" }, children: /* @__PURE__ */ e(P, { component: "span", sx: { opacity: 0 }, children: r }) })
|
|
672
672
|
}
|
|
673
673
|
)
|
|
674
674
|
]
|
|
@@ -677,45 +677,50 @@ function it({
|
|
|
677
677
|
}
|
|
678
678
|
);
|
|
679
679
|
}
|
|
680
|
-
function
|
|
681
|
-
return !!
|
|
680
|
+
function Ie(r) {
|
|
681
|
+
return !!r.shared;
|
|
682
682
|
}
|
|
683
|
-
|
|
684
|
-
|
|
683
|
+
const it = {
|
|
684
|
+
setActivatorNodeRef: () => {
|
|
685
|
+
},
|
|
686
|
+
attributes: {},
|
|
687
|
+
listeners: {}
|
|
688
|
+
};
|
|
689
|
+
function He({
|
|
690
|
+
disabled: r,
|
|
685
691
|
list: t,
|
|
686
692
|
renderItem: i,
|
|
687
693
|
...s
|
|
688
694
|
}) {
|
|
689
|
-
const
|
|
690
|
-
|
|
695
|
+
const f = T(Object.entries(t), ([, m]) => m.index), p = f.map(([m]) => m), [u, y] = K(null), [h, a] = K(null), d = Lr(
|
|
696
|
+
Br(Mr, {
|
|
691
697
|
activationConstraint: {
|
|
692
698
|
distance: 8
|
|
693
699
|
// 8px movement required to start drag
|
|
694
700
|
}
|
|
695
|
-
})
|
|
696
|
-
Ie(Fr)
|
|
701
|
+
})
|
|
697
702
|
);
|
|
698
|
-
return /* @__PURE__ */
|
|
699
|
-
|
|
703
|
+
return /* @__PURE__ */ x(
|
|
704
|
+
Fr,
|
|
700
705
|
{
|
|
701
|
-
sensors:
|
|
702
|
-
collisionDetection:
|
|
703
|
-
onDragStart: (
|
|
704
|
-
const { active: b } =
|
|
705
|
-
|
|
706
|
+
sensors: d,
|
|
707
|
+
collisionDetection: Jr,
|
|
708
|
+
onDragStart: (m) => {
|
|
709
|
+
const { active: b } = m, c = t[b.id];
|
|
710
|
+
c && (a(b.id), y(c.data));
|
|
706
711
|
},
|
|
707
712
|
onDragOver: () => {
|
|
708
713
|
},
|
|
709
|
-
onDragEnd: (
|
|
710
|
-
const { active: b, over:
|
|
711
|
-
if (
|
|
714
|
+
onDragEnd: (m) => {
|
|
715
|
+
const { active: b, over: c } = m;
|
|
716
|
+
if (a(null), y(null), !c || b.id === c.id)
|
|
712
717
|
return;
|
|
713
|
-
const
|
|
714
|
-
if (t[
|
|
718
|
+
const v = b.id, w = c.id;
|
|
719
|
+
if (t[v] && t[w]) {
|
|
715
720
|
const N = () => {
|
|
716
|
-
const z = Object.entries(t).sort(([, j], [,
|
|
717
|
-
O && z.splice(
|
|
718
|
-
j.index =
|
|
721
|
+
const z = Object.entries(t).sort(([, j], [, A]) => j.index - A.index), g = z.findIndex(([j]) => j === v), C = z.findIndex(([j]) => j === w), [O] = z.splice(g, 1);
|
|
722
|
+
O && z.splice(C, 0, O), z.forEach(([, j], A) => {
|
|
723
|
+
j.index = A;
|
|
719
724
|
});
|
|
720
725
|
}, S = q(t)?.doc;
|
|
721
726
|
S ? S.transact(() => {
|
|
@@ -724,16 +729,17 @@ function $e({
|
|
|
724
729
|
}
|
|
725
730
|
},
|
|
726
731
|
children: [
|
|
727
|
-
/* @__PURE__ */ r
|
|
728
|
-
isDragging:
|
|
732
|
+
/* @__PURE__ */ e($r, { items: p, strategy: _r, children: /* @__PURE__ */ e(k, { ...s, children: f.map(([m, b], c) => /* @__PURE__ */ e(ot, { id: m, disabled: r, isDragging: h === m, children: ({ dragHandle: v }) => i(b.data, c, {
|
|
733
|
+
isDragging: h === m,
|
|
734
|
+
dragHandle: v,
|
|
729
735
|
drag: null,
|
|
730
736
|
// Legacy compatibility
|
|
731
737
|
drop: null,
|
|
732
738
|
// Legacy compatibility
|
|
733
739
|
preview: null
|
|
734
740
|
// Legacy compatibility
|
|
735
|
-
}) },
|
|
736
|
-
/* @__PURE__ */
|
|
741
|
+
}) }, m)) }) }),
|
|
742
|
+
/* @__PURE__ */ e(Hr, { children: u && h ? /* @__PURE__ */ e(
|
|
737
743
|
P,
|
|
738
744
|
{
|
|
739
745
|
sx: {
|
|
@@ -747,6 +753,7 @@ function $e({
|
|
|
747
753
|
},
|
|
748
754
|
children: i(u, 0, {
|
|
749
755
|
isDragging: !0,
|
|
756
|
+
dragHandle: it,
|
|
750
757
|
drag: null,
|
|
751
758
|
drop: null,
|
|
752
759
|
preview: null
|
|
@@ -758,43 +765,50 @@ function $e({
|
|
|
758
765
|
);
|
|
759
766
|
}
|
|
760
767
|
function ot({
|
|
761
|
-
id:
|
|
768
|
+
id: r,
|
|
762
769
|
disabled: t,
|
|
763
770
|
isDragging: i,
|
|
764
771
|
children: s
|
|
765
772
|
}) {
|
|
766
|
-
const { attributes:
|
|
767
|
-
id:
|
|
773
|
+
const { attributes: f, listeners: p, setNodeRef: u, setActivatorNodeRef: y, transform: h, transition: a } = Gr({
|
|
774
|
+
id: r,
|
|
768
775
|
disabled: t
|
|
769
|
-
}),
|
|
770
|
-
transform:
|
|
771
|
-
transition:
|
|
776
|
+
}), d = {
|
|
777
|
+
transform: Yr.Transform.toString(h),
|
|
778
|
+
transition: a,
|
|
772
779
|
opacity: i ? 0.5 : 1
|
|
773
780
|
};
|
|
774
|
-
return /* @__PURE__ */
|
|
781
|
+
return /* @__PURE__ */ e(P, { ref: u, style: d, children: s({
|
|
782
|
+
dragHandle: {
|
|
783
|
+
setActivatorNodeRef: y,
|
|
784
|
+
attributes: f ?? {},
|
|
785
|
+
listeners: { ...p ?? {} }
|
|
786
|
+
}
|
|
787
|
+
}) });
|
|
775
788
|
}
|
|
776
789
|
function lt({
|
|
777
|
-
disabled:
|
|
790
|
+
disabled: r,
|
|
778
791
|
isDragging: t,
|
|
779
792
|
children: i,
|
|
780
793
|
onDelete: s,
|
|
781
|
-
onVisibilityChange:
|
|
794
|
+
onVisibilityChange: f,
|
|
782
795
|
visible: p = !0,
|
|
783
796
|
onSharedChange: u,
|
|
784
797
|
shared: y = !1,
|
|
785
|
-
actions:
|
|
786
|
-
alwaysShowActions:
|
|
798
|
+
actions: h,
|
|
799
|
+
alwaysShowActions: a = !1,
|
|
800
|
+
dragHandle: d
|
|
787
801
|
}) {
|
|
788
|
-
const { t:
|
|
789
|
-
return /* @__PURE__ */
|
|
802
|
+
const { t: l } = V(), o = d?.attributes ?? {}, n = d?.listeners ?? {}, m = d?.setActivatorNodeRef;
|
|
803
|
+
return /* @__PURE__ */ e(
|
|
790
804
|
P,
|
|
791
805
|
{
|
|
792
806
|
sx: {
|
|
793
807
|
":hover .hover-visible": { maxWidth: "100%" },
|
|
794
808
|
opacity: p ? 1 : 0.5
|
|
795
809
|
},
|
|
796
|
-
children: /* @__PURE__ */
|
|
797
|
-
/* @__PURE__ */
|
|
810
|
+
children: /* @__PURE__ */ x(P, { sx: { position: "relative" }, children: [
|
|
811
|
+
/* @__PURE__ */ e(
|
|
798
812
|
P,
|
|
799
813
|
{
|
|
800
814
|
sx: {
|
|
@@ -807,27 +821,27 @@ function lt({
|
|
|
807
821
|
children: i
|
|
808
822
|
}
|
|
809
823
|
),
|
|
810
|
-
!
|
|
824
|
+
!r && /* @__PURE__ */ e(
|
|
811
825
|
P,
|
|
812
826
|
{
|
|
813
|
-
className:
|
|
827
|
+
className: a ? "" : "hover-visible",
|
|
814
828
|
sx: {
|
|
815
|
-
maxWidth:
|
|
829
|
+
maxWidth: a ? "100%" : 0,
|
|
816
830
|
overflow: "hidden",
|
|
817
831
|
position: "absolute",
|
|
818
832
|
right: 2,
|
|
819
833
|
top: 2,
|
|
820
834
|
transition: "max-width 0.3s ease-in-out"
|
|
821
835
|
},
|
|
822
|
-
children: /* @__PURE__ */
|
|
836
|
+
children: /* @__PURE__ */ x(
|
|
823
837
|
k,
|
|
824
838
|
{
|
|
825
839
|
direction: "row",
|
|
826
840
|
sx: {
|
|
827
|
-
bgcolor: (
|
|
841
|
+
bgcolor: (b) => de(b.palette.grey[200], 0.9),
|
|
828
842
|
borderRadius: 1,
|
|
829
843
|
p: 0.5,
|
|
830
|
-
[`.${
|
|
844
|
+
[`.${er.root}`]: {
|
|
831
845
|
minWidth: 24,
|
|
832
846
|
width: 24,
|
|
833
847
|
height: 24,
|
|
@@ -835,11 +849,11 @@ function lt({
|
|
|
835
849
|
}
|
|
836
850
|
},
|
|
837
851
|
children: [
|
|
838
|
-
|
|
839
|
-
u && /* @__PURE__ */
|
|
840
|
-
|
|
841
|
-
s && /* @__PURE__ */
|
|
842
|
-
/* @__PURE__ */
|
|
852
|
+
h,
|
|
853
|
+
u && /* @__PURE__ */ e(B, { title: l(y ? "disableSharing" : "enableSharing"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(E, { onClick: () => u(!y), children: y ? /* @__PURE__ */ e(xr, { sx: { fontSize: "1.25rem", color: "primary.main" } }) : /* @__PURE__ */ e(Cr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
854
|
+
f && /* @__PURE__ */ e(B, { title: l(p ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(E, { onClick: () => f(!p), children: p ? /* @__PURE__ */ e(Pr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ e(kr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
855
|
+
s && /* @__PURE__ */ e(B, { title: l("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(E, { onClick: s, children: /* @__PURE__ */ e(wr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
856
|
+
/* @__PURE__ */ e(B, { title: l("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(E, { ref: m, ...o, ...n, children: /* @__PURE__ */ e(Sr, { sx: { color: "grey.500" } }) }) })
|
|
843
857
|
]
|
|
844
858
|
}
|
|
845
859
|
)
|
|
@@ -849,122 +863,122 @@ function lt({
|
|
|
849
863
|
}
|
|
850
864
|
);
|
|
851
865
|
}
|
|
852
|
-
function st(
|
|
866
|
+
function st(r) {
|
|
853
867
|
const t = ["string", "json", "array", "url", "multiline"], i = ["style", "fontSize", "color", "content", "type"];
|
|
854
|
-
return !!(t.includes(
|
|
868
|
+
return !!(t.includes(r.type || "") && !i.includes(r.key || ""));
|
|
855
869
|
}
|
|
856
|
-
function at(
|
|
857
|
-
return
|
|
870
|
+
function at(r, t, i) {
|
|
871
|
+
return r.locales && r.locales[t] && r.locales[t].name ? r.locales[t].name : i && r.locales && r.locales[i] && r.locales[i].name ? r.locales[i].name : r.key ? r.key : r.id;
|
|
858
872
|
}
|
|
859
|
-
const
|
|
860
|
-
const
|
|
861
|
-
return T(Object.entries(
|
|
862
|
-
const
|
|
863
|
-
if (!
|
|
864
|
-
const
|
|
865
|
-
key:
|
|
866
|
-
isNeedGenerate: l?.isNeedGenerate ?? st(
|
|
873
|
+
const $e = (r, t, i, s) => {
|
|
874
|
+
const f = {};
|
|
875
|
+
return T(Object.entries(r), ([, u]) => u.index).forEach(([u, y]) => {
|
|
876
|
+
const h = y.data;
|
|
877
|
+
if (!h) return;
|
|
878
|
+
const a = h.key || h.id, d = i ? at(h, i, s || "") : a, l = t?.[h.id], o = {
|
|
879
|
+
key: a,
|
|
880
|
+
isNeedGenerate: l?.isNeedGenerate ?? st(h),
|
|
867
881
|
// 如果存在使用现有值,否则默认勾选
|
|
868
882
|
describe: l?.describe ?? "",
|
|
869
|
-
displayName:
|
|
883
|
+
displayName: d
|
|
870
884
|
};
|
|
871
|
-
|
|
872
|
-
|
|
885
|
+
h.subProperties && !U(h.subProperties) && (o.subProperties = $e(
|
|
886
|
+
h.subProperties,
|
|
873
887
|
l?.subProperties,
|
|
874
888
|
i,
|
|
875
889
|
s
|
|
876
|
-
)), h
|
|
877
|
-
}),
|
|
890
|
+
)), f[h.id] = o;
|
|
891
|
+
}), f;
|
|
878
892
|
};
|
|
879
893
|
function ct({
|
|
880
|
-
open:
|
|
894
|
+
open: r,
|
|
881
895
|
onClose: t,
|
|
882
896
|
onConfirm: i,
|
|
883
897
|
component: s,
|
|
884
|
-
initialConfig:
|
|
898
|
+
initialConfig: f,
|
|
885
899
|
locale: p,
|
|
886
900
|
defaultLocale: u,
|
|
887
901
|
title: y,
|
|
888
|
-
loading:
|
|
902
|
+
loading: h = !1
|
|
889
903
|
}) {
|
|
890
|
-
const { t:
|
|
891
|
-
|
|
892
|
-
if (
|
|
893
|
-
const
|
|
904
|
+
const { t: a } = V(), [d, l] = K(null);
|
|
905
|
+
M(() => {
|
|
906
|
+
if (r && s) {
|
|
907
|
+
const c = { properties: {} };
|
|
894
908
|
if (s.properties) {
|
|
895
|
-
const
|
|
896
|
-
|
|
909
|
+
const v = f?.properties;
|
|
910
|
+
c.properties = $e(s.properties, v, p, u);
|
|
897
911
|
}
|
|
898
|
-
l(
|
|
912
|
+
l(c);
|
|
899
913
|
}
|
|
900
|
-
}, [
|
|
914
|
+
}, [r, s, f, p, u]);
|
|
901
915
|
const o = () => {
|
|
902
916
|
t();
|
|
903
917
|
}, n = () => {
|
|
904
|
-
|
|
905
|
-
},
|
|
906
|
-
if (!
|
|
907
|
-
const N = JSON.parse(JSON.stringify(
|
|
918
|
+
d && (i(d), t());
|
|
919
|
+
}, m = (c, v, w) => {
|
|
920
|
+
if (!d || !c.length) return;
|
|
921
|
+
const N = JSON.parse(JSON.stringify(d));
|
|
908
922
|
let S = N.properties, I = null;
|
|
909
|
-
for (let g = 0; g <
|
|
910
|
-
const
|
|
911
|
-
if (!
|
|
923
|
+
for (let g = 0; g < c.length - 1; g++) {
|
|
924
|
+
const C = c[g];
|
|
925
|
+
if (!C || !S[C])
|
|
912
926
|
return;
|
|
913
927
|
I = S;
|
|
914
|
-
const O = S[
|
|
928
|
+
const O = S[C];
|
|
915
929
|
O.subProperties || (O.subProperties = {}), S = O.subProperties;
|
|
916
930
|
}
|
|
917
|
-
const z =
|
|
931
|
+
const z = c[c.length - 1];
|
|
918
932
|
if (z) {
|
|
919
933
|
if ("isNeedGenerate" in w) {
|
|
920
|
-
const g = w.isNeedGenerate,
|
|
921
|
-
...
|
|
934
|
+
const g = w.isNeedGenerate, C = {
|
|
935
|
+
...v,
|
|
922
936
|
...w
|
|
923
937
|
};
|
|
924
|
-
if (
|
|
925
|
-
const O = (j,
|
|
938
|
+
if (v.subProperties && !U(v.subProperties)) {
|
|
939
|
+
const O = (j, A) => {
|
|
926
940
|
const J = {};
|
|
927
|
-
return Object.entries(j).forEach(([
|
|
928
|
-
const
|
|
929
|
-
|
|
941
|
+
return Object.entries(j).forEach(([Qe, Q]) => {
|
|
942
|
+
const ce = { ...Q };
|
|
943
|
+
A !== null && (ce.isNeedGenerate = A), Q.subProperties && !U(Q.subProperties) && (ce.subProperties = O(
|
|
930
944
|
Q.subProperties,
|
|
931
|
-
|
|
932
|
-
)), J[
|
|
945
|
+
A !== null ? A : null
|
|
946
|
+
)), J[Qe] = ce;
|
|
933
947
|
}), J;
|
|
934
948
|
};
|
|
935
|
-
|
|
936
|
-
|
|
949
|
+
C.subProperties = O(
|
|
950
|
+
v.subProperties,
|
|
937
951
|
g === !1 ? !1 : null
|
|
938
952
|
);
|
|
939
953
|
}
|
|
940
|
-
if (
|
|
941
|
-
N.properties[z] =
|
|
942
|
-
else if (I &&
|
|
943
|
-
const O =
|
|
944
|
-
O && I[O] && (I[O].subProperties || (I[O].subProperties = {}), I[O].subProperties[z] =
|
|
954
|
+
if (c.length === 1)
|
|
955
|
+
N.properties[z] = C;
|
|
956
|
+
else if (I && c.length >= 2) {
|
|
957
|
+
const O = c[c.length - 2];
|
|
958
|
+
O && I[O] && (I[O].subProperties || (I[O].subProperties = {}), I[O].subProperties[z] = C);
|
|
945
959
|
}
|
|
946
|
-
} else if (
|
|
960
|
+
} else if (c.length === 1)
|
|
947
961
|
N.properties[z] = {
|
|
948
|
-
...
|
|
962
|
+
...v,
|
|
949
963
|
...w
|
|
950
964
|
};
|
|
951
|
-
else if (I &&
|
|
952
|
-
const g =
|
|
965
|
+
else if (I && c.length >= 2) {
|
|
966
|
+
const g = c[c.length - 2];
|
|
953
967
|
g && I[g] && I[g].subProperties && (I[g].subProperties[z] = {
|
|
954
|
-
...
|
|
968
|
+
...v,
|
|
955
969
|
...w
|
|
956
970
|
});
|
|
957
971
|
}
|
|
958
972
|
l(N);
|
|
959
973
|
}
|
|
960
|
-
}, b = (
|
|
961
|
-
if (!
|
|
962
|
-
return /* @__PURE__ */
|
|
963
|
-
const N = T(Object.entries(
|
|
964
|
-
return /* @__PURE__ */
|
|
965
|
-
const g = [...
|
|
966
|
-
return /* @__PURE__ */
|
|
967
|
-
|
|
974
|
+
}, b = (c, v = [], w = !0) => {
|
|
975
|
+
if (!c || U(c))
|
|
976
|
+
return /* @__PURE__ */ e(Y, { children: a("maker.properties.noProperties") });
|
|
977
|
+
const N = T(Object.entries(c), ([, S]) => S.displayName);
|
|
978
|
+
return /* @__PURE__ */ e(k, { spacing: 1.5, children: N.map(([S, I], z) => {
|
|
979
|
+
const g = [...v, S], C = z === N.length - 1, O = I.subProperties && !U(I.subProperties), j = I.displayName || S, A = !w;
|
|
980
|
+
return /* @__PURE__ */ e(P, { sx: { position: "relative" }, children: /* @__PURE__ */ x(k, { direction: "row", children: [
|
|
981
|
+
v.length > 0 && /* @__PURE__ */ x(
|
|
968
982
|
P,
|
|
969
983
|
{
|
|
970
984
|
sx: {
|
|
@@ -973,7 +987,7 @@ function ct({
|
|
|
973
987
|
flexShrink: 0
|
|
974
988
|
},
|
|
975
989
|
children: [
|
|
976
|
-
/* @__PURE__ */
|
|
990
|
+
/* @__PURE__ */ e(
|
|
977
991
|
P,
|
|
978
992
|
{
|
|
979
993
|
sx: {
|
|
@@ -987,7 +1001,7 @@ function ct({
|
|
|
987
1001
|
}
|
|
988
1002
|
}
|
|
989
1003
|
),
|
|
990
|
-
/* @__PURE__ */
|
|
1004
|
+
/* @__PURE__ */ e(
|
|
991
1005
|
P,
|
|
992
1006
|
{
|
|
993
1007
|
sx: {
|
|
@@ -1001,7 +1015,7 @@ function ct({
|
|
|
1001
1015
|
}
|
|
1002
1016
|
}
|
|
1003
1017
|
),
|
|
1004
|
-
!
|
|
1018
|
+
!C && /* @__PURE__ */ e(
|
|
1005
1019
|
P,
|
|
1006
1020
|
{
|
|
1007
1021
|
sx: {
|
|
@@ -1018,8 +1032,8 @@ function ct({
|
|
|
1018
1032
|
]
|
|
1019
1033
|
}
|
|
1020
1034
|
),
|
|
1021
|
-
/* @__PURE__ */
|
|
1022
|
-
/* @__PURE__ */
|
|
1035
|
+
/* @__PURE__ */ x(k, { spacing: 1.5, sx: { flexGrow: 1 }, children: [
|
|
1036
|
+
/* @__PURE__ */ x(
|
|
1023
1037
|
k,
|
|
1024
1038
|
{
|
|
1025
1039
|
direction: { xs: "column", md: "row" },
|
|
@@ -1029,16 +1043,16 @@ function ct({
|
|
|
1029
1043
|
width: "100%"
|
|
1030
1044
|
},
|
|
1031
1045
|
children: [
|
|
1032
|
-
/* @__PURE__ */
|
|
1046
|
+
/* @__PURE__ */ e(
|
|
1033
1047
|
ge,
|
|
1034
1048
|
{
|
|
1035
|
-
control: /* @__PURE__ */
|
|
1036
|
-
|
|
1049
|
+
control: /* @__PURE__ */ e(
|
|
1050
|
+
rr,
|
|
1037
1051
|
{
|
|
1038
1052
|
checked: I.isNeedGenerate,
|
|
1039
|
-
disabled:
|
|
1053
|
+
disabled: A,
|
|
1040
1054
|
onChange: (J) => {
|
|
1041
|
-
|
|
1055
|
+
m(g, I, {
|
|
1042
1056
|
isNeedGenerate: J.target.checked
|
|
1043
1057
|
});
|
|
1044
1058
|
}
|
|
@@ -1055,15 +1069,15 @@ function ct({
|
|
|
1055
1069
|
}
|
|
1056
1070
|
}
|
|
1057
1071
|
),
|
|
1058
|
-
/* @__PURE__ */
|
|
1059
|
-
|
|
1072
|
+
/* @__PURE__ */ e(
|
|
1073
|
+
R,
|
|
1060
1074
|
{
|
|
1061
1075
|
size: "small",
|
|
1062
1076
|
fullWidth: !0,
|
|
1063
|
-
label:
|
|
1077
|
+
label: a("maker.properties.llmPropertyDescribe"),
|
|
1064
1078
|
value: I.describe,
|
|
1065
1079
|
onChange: (J) => {
|
|
1066
|
-
|
|
1080
|
+
m(g, I, {
|
|
1067
1081
|
describe: J.target.value
|
|
1068
1082
|
});
|
|
1069
1083
|
},
|
|
@@ -1073,7 +1087,7 @@ function ct({
|
|
|
1073
1087
|
]
|
|
1074
1088
|
}
|
|
1075
1089
|
),
|
|
1076
|
-
O && /* @__PURE__ */
|
|
1090
|
+
O && /* @__PURE__ */ e(P, { sx: { ml: 3 }, children: b(
|
|
1077
1091
|
I.subProperties,
|
|
1078
1092
|
g,
|
|
1079
1093
|
I.isNeedGenerate && w
|
|
@@ -1082,43 +1096,43 @@ function ct({
|
|
|
1082
1096
|
] }) }, S);
|
|
1083
1097
|
}) });
|
|
1084
1098
|
};
|
|
1085
|
-
return /* @__PURE__ */
|
|
1086
|
-
/* @__PURE__ */
|
|
1087
|
-
/* @__PURE__ */
|
|
1099
|
+
return /* @__PURE__ */ x(ye, { open: r, onClose: o, maxWidth: "lg", fullWidth: !0, children: [
|
|
1100
|
+
/* @__PURE__ */ e(Ve, { children: y || a("maker.properties.llmConfigTitle") }),
|
|
1101
|
+
/* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(
|
|
1088
1102
|
P,
|
|
1089
1103
|
{
|
|
1090
1104
|
sx: {
|
|
1091
1105
|
my: 3
|
|
1092
1106
|
},
|
|
1093
|
-
children:
|
|
1094
|
-
/* @__PURE__ */
|
|
1095
|
-
b(
|
|
1096
|
-
] }) : /* @__PURE__ */
|
|
1107
|
+
children: h ? /* @__PURE__ */ e(D, { children: a("maker.properties.loading") }) : s ? d ? /* @__PURE__ */ x(k, { spacing: 3, children: [
|
|
1108
|
+
/* @__PURE__ */ e(D, { variant: "subtitle2", children: a("maker.properties.llmConfigInstructions") }),
|
|
1109
|
+
b(d.properties)
|
|
1110
|
+
] }) : /* @__PURE__ */ e(D, { children: a("maker.properties.loading") }) : /* @__PURE__ */ e(D, { color: "error", children: a("maker.properties.componentNotFound") })
|
|
1097
1111
|
}
|
|
1098
1112
|
) }),
|
|
1099
|
-
/* @__PURE__ */
|
|
1100
|
-
/* @__PURE__ */
|
|
1101
|
-
/* @__PURE__ */
|
|
1113
|
+
/* @__PURE__ */ x(Ee, { children: [
|
|
1114
|
+
/* @__PURE__ */ e(E, { onClick: o, children: a("common.cancel") }),
|
|
1115
|
+
/* @__PURE__ */ e(E, { variant: "contained", onClick: n, disabled: !d || h, children: a("common.confirm") })
|
|
1102
1116
|
] })
|
|
1103
1117
|
] });
|
|
1104
1118
|
}
|
|
1105
1119
|
function dt({
|
|
1106
|
-
label:
|
|
1120
|
+
label: r,
|
|
1107
1121
|
value: t,
|
|
1108
1122
|
onChange: i
|
|
1109
1123
|
}) {
|
|
1110
|
-
const [s,
|
|
1111
|
-
return /* @__PURE__ */
|
|
1124
|
+
const [s, f] = K(!1);
|
|
1125
|
+
return /* @__PURE__ */ x(
|
|
1112
1126
|
k,
|
|
1113
1127
|
{
|
|
1114
1128
|
sx: {
|
|
1115
1129
|
gap: 1
|
|
1116
1130
|
},
|
|
1117
1131
|
children: [
|
|
1118
|
-
/* @__PURE__ */
|
|
1119
|
-
|
|
1132
|
+
/* @__PURE__ */ e(
|
|
1133
|
+
R,
|
|
1120
1134
|
{
|
|
1121
|
-
label:
|
|
1135
|
+
label: r,
|
|
1122
1136
|
size: "small",
|
|
1123
1137
|
value: t,
|
|
1124
1138
|
onChange: (p) => i?.(p.target.value),
|
|
@@ -1127,7 +1141,7 @@ function dt({
|
|
|
1127
1141
|
sx: {
|
|
1128
1142
|
pr: 0
|
|
1129
1143
|
},
|
|
1130
|
-
endAdornment: /* @__PURE__ */
|
|
1144
|
+
endAdornment: /* @__PURE__ */ e(H, { position: "end", children: /* @__PURE__ */ e(
|
|
1131
1145
|
Pe,
|
|
1132
1146
|
{
|
|
1133
1147
|
onChange: ({ response: p }) => {
|
|
@@ -1140,13 +1154,13 @@ function dt({
|
|
|
1140
1154
|
}
|
|
1141
1155
|
}
|
|
1142
1156
|
),
|
|
1143
|
-
t && /* @__PURE__ */
|
|
1157
|
+
t && /* @__PURE__ */ e(
|
|
1144
1158
|
P,
|
|
1145
1159
|
{
|
|
1146
1160
|
component: "img",
|
|
1147
|
-
src:
|
|
1148
|
-
alt:
|
|
1149
|
-
onClick: () =>
|
|
1161
|
+
src: ie(t),
|
|
1162
|
+
alt: r,
|
|
1163
|
+
onClick: () => f(!0),
|
|
1150
1164
|
sx: {
|
|
1151
1165
|
maxWidth: 100,
|
|
1152
1166
|
maxHeight: 100,
|
|
@@ -1157,15 +1171,15 @@ function dt({
|
|
|
1157
1171
|
}
|
|
1158
1172
|
}
|
|
1159
1173
|
),
|
|
1160
|
-
/* @__PURE__ */
|
|
1174
|
+
/* @__PURE__ */ e(ye, { open: s, onClose: () => f(!1), children: /* @__PURE__ */ e(P, { component: "img", sx: { objectFit: "contain" }, src: ie(t), alt: r }) })
|
|
1161
1175
|
]
|
|
1162
1176
|
}
|
|
1163
1177
|
);
|
|
1164
1178
|
}
|
|
1165
|
-
function be(
|
|
1166
|
-
return
|
|
1167
|
-
const p = t ? `${t}.${
|
|
1168
|
-
return
|
|
1179
|
+
function be(r, t = "") {
|
|
1180
|
+
return Wr(r, (i, s, f) => {
|
|
1181
|
+
const p = t ? `${t}.${f}` : f;
|
|
1182
|
+
return Ar(s) ? zr(i, be(s, p)) : i[p] = s, i;
|
|
1169
1183
|
}, {});
|
|
1170
1184
|
}
|
|
1171
1185
|
const ut = [
|
|
@@ -1182,249 +1196,265 @@ const ut = [
|
|
|
1182
1196
|
{ value: "component", label: "Component" },
|
|
1183
1197
|
{ value: "custom", label: "Custom (Render by a Component)" }
|
|
1184
1198
|
];
|
|
1185
|
-
function X(
|
|
1186
|
-
return !
|
|
1199
|
+
function X(r, t, i) {
|
|
1200
|
+
return !r || !i ? !1 : Object.values(r).some(({ data: s }) => s.id !== t && s.key === i);
|
|
1187
1201
|
}
|
|
1188
|
-
function
|
|
1189
|
-
return !
|
|
1202
|
+
function ee(r, t) {
|
|
1203
|
+
return !r || !t ? !1 : r[t]?.data.visible ?? !0;
|
|
1190
1204
|
}
|
|
1191
|
-
function
|
|
1192
|
-
return !
|
|
1205
|
+
function _e(r, t) {
|
|
1206
|
+
return !r || !t ? !1 : r[t]?.data.shared ?? !1;
|
|
1193
1207
|
}
|
|
1194
|
-
function hn({ componentId:
|
|
1195
|
-
const { state: { components: t } } =
|
|
1196
|
-
return s ? /* @__PURE__ */
|
|
1208
|
+
function hn({ componentId: r }) {
|
|
1209
|
+
const { state: { components: t } } = le(), s = t[r]?.data;
|
|
1210
|
+
return s ? /* @__PURE__ */ e(k, {
|
|
1197
1211
|
sx: {
|
|
1198
1212
|
maxHeight: "100%",
|
|
1199
1213
|
overflow: "auto"
|
|
1200
1214
|
},
|
|
1201
|
-
children: /* @__PURE__ */
|
|
1215
|
+
children: /* @__PURE__ */ e(P, {
|
|
1202
1216
|
sx: {
|
|
1203
1217
|
p: 2
|
|
1204
1218
|
},
|
|
1205
|
-
children: /* @__PURE__ */
|
|
1219
|
+
children: /* @__PURE__ */ e(Ur, { FallbackComponent: qr, resetKeys: [r], children: /* @__PURE__ */ e(pt, { value: s, componentId: r }) })
|
|
1206
1220
|
})
|
|
1207
1221
|
}) : null;
|
|
1208
1222
|
}
|
|
1209
|
-
function pt({ value:
|
|
1210
|
-
const { t: i } =
|
|
1223
|
+
function pt({ value: r, componentId: t }) {
|
|
1224
|
+
const { t: i } = V(), { localState: { currentLocale: s, customComponentPreviewerProperties: f }, state: { config: { defaultLocale: p } }, localActions: { setCustomComponentPreviewerProperties: u } } = le(), y = q(r).doc, h = xe(), a = $(() => f?.[t] ?? {}, [t, f]), d = r.renderer?.type || "react-component", l = d === "component-template", o = Nr({
|
|
1211
1225
|
componentId: t,
|
|
1212
1226
|
propertiesValue: {
|
|
1213
|
-
...
|
|
1227
|
+
...a
|
|
1214
1228
|
}
|
|
1215
1229
|
});
|
|
1216
|
-
return
|
|
1217
|
-
|
|
1218
|
-
...
|
|
1230
|
+
return M(() => {
|
|
1231
|
+
o.componentId !== t && (o.componentId = t, o.propertiesValue = {
|
|
1232
|
+
...a
|
|
1219
1233
|
});
|
|
1220
|
-
}, [t,
|
|
1221
|
-
if (
|
|
1234
|
+
}, [t, a, o]), M(() => {
|
|
1235
|
+
if (o.componentId !== t)
|
|
1222
1236
|
return;
|
|
1223
|
-
const
|
|
1224
|
-
|
|
1237
|
+
const n = Object.fromEntries(Object.values(r.properties ?? {}).map(({ data: m }) => [
|
|
1238
|
+
m.id,
|
|
1225
1239
|
{
|
|
1226
|
-
value:
|
|
1240
|
+
value: o.propertiesValue[m.id]?.value ?? gr(m, m.locales?.[s]?.defaultValue ?? m.locales?.[p]?.defaultValue, {
|
|
1227
1241
|
locale: s,
|
|
1228
1242
|
defaultLocale: p
|
|
1229
1243
|
})
|
|
1230
1244
|
}
|
|
1231
1245
|
]));
|
|
1232
|
-
u(t,
|
|
1233
|
-
}, [JSON.stringify(
|
|
1246
|
+
u(t, n);
|
|
1247
|
+
}, [JSON.stringify(o.propertiesValue), t, o.componentId]), /* @__PURE__ */ e(k, {
|
|
1234
1248
|
sx: {
|
|
1235
1249
|
height: "100%"
|
|
1236
1250
|
},
|
|
1237
|
-
children: /* @__PURE__ */
|
|
1251
|
+
children: /* @__PURE__ */ x(k, {
|
|
1238
1252
|
sx: {
|
|
1239
1253
|
gap: 2
|
|
1240
1254
|
},
|
|
1241
1255
|
children: [
|
|
1242
|
-
/* @__PURE__ */
|
|
1243
|
-
/* @__PURE__ */
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
+
/* @__PURE__ */ e(mt, { config: r }),
|
|
1257
|
+
!l && /* @__PURE__ */ x(L, { children: [
|
|
1258
|
+
/* @__PURE__ */ e(ft, {
|
|
1259
|
+
config: r,
|
|
1260
|
+
currentLocale: s,
|
|
1261
|
+
defaultLocale: p,
|
|
1262
|
+
allComponents: h,
|
|
1263
|
+
onUpdateConfig: (n) => {
|
|
1264
|
+
y.transact(() => {
|
|
1265
|
+
n(r);
|
|
1266
|
+
});
|
|
1267
|
+
}
|
|
1268
|
+
}),
|
|
1269
|
+
/* @__PURE__ */ x(k, {
|
|
1270
|
+
direction: "row",
|
|
1271
|
+
sx: {
|
|
1272
|
+
gap: 2,
|
|
1273
|
+
justifyContent: "space-between",
|
|
1274
|
+
alignItems: "center"
|
|
1275
|
+
},
|
|
1276
|
+
children: [
|
|
1277
|
+
/* @__PURE__ */ e(D, { variant: "subtitle1", children: i("renderer") }),
|
|
1278
|
+
/* @__PURE__ */ x(R, {
|
|
1279
|
+
hiddenLabel: !0,
|
|
1280
|
+
size: "small",
|
|
1281
|
+
select: !0,
|
|
1282
|
+
value: d,
|
|
1283
|
+
disabled: l,
|
|
1284
|
+
onChange: (n) => {
|
|
1285
|
+
y.transact(() => {
|
|
1286
|
+
const m = n.target.value;
|
|
1287
|
+
r.renderer ??= { type: m }, r.renderer.type = m;
|
|
1288
|
+
});
|
|
1289
|
+
},
|
|
1290
|
+
slotProps: {
|
|
1291
|
+
select: { autoWidth: !0 }
|
|
1292
|
+
},
|
|
1293
|
+
children: [
|
|
1294
|
+
/* @__PURE__ */ e(Z, { value: "component-template", disabled: !0, children: i("maker.components.componentTemplate") }),
|
|
1295
|
+
/* @__PURE__ */ e(Z, { value: "react-component", children: "React Component" }),
|
|
1296
|
+
/* @__PURE__ */ e(Z, { value: "component", children: "Custom Component" })
|
|
1297
|
+
]
|
|
1298
|
+
})
|
|
1299
|
+
]
|
|
1300
|
+
}),
|
|
1301
|
+
d === "component" && /* @__PURE__ */ e(kt, { value: r }),
|
|
1302
|
+
d === "react-component" && /* @__PURE__ */ e(Pt, { value: r }),
|
|
1303
|
+
/* @__PURE__ */ e(qe, {
|
|
1304
|
+
config: r,
|
|
1305
|
+
currentLocale: s,
|
|
1306
|
+
defaultLocale: p,
|
|
1307
|
+
allComponents: h,
|
|
1308
|
+
propertiesValue: o.propertiesValue,
|
|
1309
|
+
onChange: ({ value: n, id: m, path: b }) => {
|
|
1310
|
+
const c = [...b, "data"];
|
|
1311
|
+
if (!jr(r, c)) {
|
|
1312
|
+
fe.warning(i("cannotFindPropertyKey", {
|
|
1313
|
+
key: c.join(".")
|
|
1314
|
+
}));
|
|
1315
|
+
return;
|
|
1316
|
+
}
|
|
1317
|
+
o.propertiesValue[m] = {
|
|
1318
|
+
value: n.value
|
|
1319
|
+
};
|
|
1320
|
+
}
|
|
1321
|
+
})
|
|
1322
|
+
] }),
|
|
1323
|
+
l && /* @__PURE__ */ x(k, {
|
|
1324
|
+
direction: "column",
|
|
1325
|
+
spacing: 1,
|
|
1256
1326
|
sx: {
|
|
1257
|
-
|
|
1258
|
-
justifyContent: "space-between",
|
|
1259
|
-
alignItems: "center"
|
|
1327
|
+
mt: 1
|
|
1260
1328
|
},
|
|
1261
1329
|
children: [
|
|
1262
|
-
/* @__PURE__ */
|
|
1263
|
-
/* @__PURE__ */
|
|
1264
|
-
hiddenLabel: !0,
|
|
1265
|
-
size: "small",
|
|
1266
|
-
select: !0,
|
|
1267
|
-
value: e.renderer?.type || "react-component",
|
|
1268
|
-
onChange: (l) => {
|
|
1269
|
-
y.transact(() => {
|
|
1270
|
-
const o = l.target.value;
|
|
1271
|
-
e.renderer ??= { type: o }, e.renderer.type = o;
|
|
1272
|
-
});
|
|
1273
|
-
},
|
|
1274
|
-
slotProps: {
|
|
1275
|
-
select: { autoWidth: !0 }
|
|
1276
|
-
},
|
|
1277
|
-
children: [
|
|
1278
|
-
/* @__PURE__ */ r(de, { value: "react-component", children: "React Component" }),
|
|
1279
|
-
/* @__PURE__ */ r(de, { value: "component", children: "Custom Component" })
|
|
1280
|
-
]
|
|
1281
|
-
})
|
|
1330
|
+
/* @__PURE__ */ e(D, { variant: "subtitle1", children: i("renderer") }),
|
|
1331
|
+
/* @__PURE__ */ e(R, { hiddenLabel: !0, size: "small", value: i("maker.components.componentTemplate"), disabled: !0 })
|
|
1282
1332
|
]
|
|
1283
|
-
}),
|
|
1284
|
-
e.renderer?.type === "component" && /* @__PURE__ */ r(kt, { value: e }),
|
|
1285
|
-
e.renderer?.type === "react-component" && /* @__PURE__ */ r(Pt, { value: e }),
|
|
1286
|
-
/* @__PURE__ */ r(Qe, {
|
|
1287
|
-
config: e,
|
|
1288
|
-
currentLocale: s,
|
|
1289
|
-
defaultLocale: p,
|
|
1290
|
-
allComponents: m,
|
|
1291
|
-
propertiesValue: a.propertiesValue,
|
|
1292
|
-
onChange: ({ value: l, id: o, path: n }) => {
|
|
1293
|
-
const f = [...n, "data"];
|
|
1294
|
-
if (!Vr(e, f)) {
|
|
1295
|
-
fe.warning(i("cannotFindPropertyKey", {
|
|
1296
|
-
key: f.join(".")
|
|
1297
|
-
}));
|
|
1298
|
-
return;
|
|
1299
|
-
}
|
|
1300
|
-
a.propertiesValue[o] = {
|
|
1301
|
-
value: l.value
|
|
1302
|
-
};
|
|
1303
|
-
}
|
|
1304
1333
|
})
|
|
1305
1334
|
]
|
|
1306
1335
|
})
|
|
1307
1336
|
});
|
|
1308
1337
|
}
|
|
1309
|
-
function mt({ config:
|
|
1310
|
-
const { t } =
|
|
1311
|
-
return /* @__PURE__ */
|
|
1338
|
+
function mt({ config: r }) {
|
|
1339
|
+
const { t } = V();
|
|
1340
|
+
return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ x(k, {
|
|
1312
1341
|
sx: {
|
|
1313
1342
|
gap: 2
|
|
1314
1343
|
},
|
|
1315
1344
|
children: [
|
|
1316
|
-
/* @__PURE__ */
|
|
1317
|
-
/* @__PURE__ */
|
|
1345
|
+
/* @__PURE__ */ e(D, { variant: "subtitle1", children: t("basicInfo") }),
|
|
1346
|
+
/* @__PURE__ */ e(R, {
|
|
1318
1347
|
label: t("name"),
|
|
1319
1348
|
size: "small",
|
|
1320
|
-
value:
|
|
1321
|
-
onChange: (i) =>
|
|
1349
|
+
value: r.name || "",
|
|
1350
|
+
onChange: (i) => r.name = i.target.value
|
|
1322
1351
|
}),
|
|
1323
|
-
/* @__PURE__ */
|
|
1352
|
+
/* @__PURE__ */ e(R, {
|
|
1324
1353
|
label: t("description"),
|
|
1325
1354
|
size: "small",
|
|
1326
1355
|
multiline: !0,
|
|
1327
1356
|
minRows: 2,
|
|
1328
1357
|
maxRows: 10,
|
|
1329
|
-
value:
|
|
1330
|
-
onChange: (i) =>
|
|
1358
|
+
value: r.description || "",
|
|
1359
|
+
onChange: (i) => r.description = i.target.value,
|
|
1331
1360
|
slotProps: {
|
|
1332
1361
|
input: {
|
|
1333
|
-
endAdornment: /* @__PURE__ */
|
|
1362
|
+
endAdornment: /* @__PURE__ */ e(H, { position: "end", sx: { mt: -1.5 }, children: /* @__PURE__ */ e(wt, { config: r }) })
|
|
1334
1363
|
},
|
|
1335
1364
|
htmlInput: { maxLength: 200 }
|
|
1336
1365
|
}
|
|
1337
1366
|
}),
|
|
1338
|
-
/* @__PURE__ */
|
|
1367
|
+
/* @__PURE__ */ e(De, {
|
|
1339
1368
|
size: "small",
|
|
1340
1369
|
options: [],
|
|
1341
1370
|
multiple: !0,
|
|
1342
1371
|
freeSolo: !0,
|
|
1343
|
-
value:
|
|
1344
|
-
onChange: (i, s) =>
|
|
1345
|
-
renderInput: (i) => /* @__PURE__ */
|
|
1372
|
+
value: r.tags ?? [],
|
|
1373
|
+
onChange: (i, s) => r.tags = s,
|
|
1374
|
+
renderInput: (i) => /* @__PURE__ */ e(R, { label: t("tags"), ...i })
|
|
1346
1375
|
}),
|
|
1347
|
-
/* @__PURE__ */
|
|
1376
|
+
/* @__PURE__ */ e(dt, {
|
|
1348
1377
|
label: t("previewImage"),
|
|
1349
|
-
value:
|
|
1350
|
-
onChange: (i) =>
|
|
1378
|
+
value: r.previewImage || "",
|
|
1379
|
+
onChange: (i) => r.previewImage = i
|
|
1351
1380
|
})
|
|
1352
1381
|
]
|
|
1353
1382
|
}) });
|
|
1354
1383
|
}
|
|
1355
|
-
function
|
|
1356
|
-
const { t:
|
|
1357
|
-
return /* @__PURE__ */
|
|
1384
|
+
function Ge({ data: r, params: t, visible: i, shared: s, config: f, currentLocale: p, defaultLocale: u, allComponents: y, onUpdateConfig: h }) {
|
|
1385
|
+
const { t: a } = V(), d = $(() => r.type === "json" || r.type === "yaml" || r.type === "array" ? yt : F, [r.type]);
|
|
1386
|
+
return /* @__PURE__ */ e(lt, {
|
|
1358
1387
|
preview: t.preview,
|
|
1359
1388
|
drop: t.drop,
|
|
1360
1389
|
drag: t.drag,
|
|
1361
1390
|
isDragging: t.isDragging,
|
|
1391
|
+
dragHandle: t.dragHandle,
|
|
1362
1392
|
onDelete: () => {
|
|
1363
|
-
|
|
1393
|
+
h((l) => {
|
|
1364
1394
|
if (l.properties) {
|
|
1365
|
-
const n = Object.entries(l.properties).sort(([, b], [,
|
|
1366
|
-
delete l.properties[
|
|
1367
|
-
b.index =
|
|
1395
|
+
const n = Object.entries(l.properties).sort(([, b], [, c]) => b.index - c.index);
|
|
1396
|
+
delete l.properties[r.id], n.filter(([b]) => b !== r.id).forEach(([, b], c) => {
|
|
1397
|
+
b.index = c;
|
|
1368
1398
|
});
|
|
1369
1399
|
}
|
|
1370
1400
|
});
|
|
1371
1401
|
},
|
|
1372
1402
|
visible: i,
|
|
1373
1403
|
onVisibilityChange: (l) => {
|
|
1374
|
-
|
|
1375
|
-
const n = o.properties[
|
|
1404
|
+
h((o) => {
|
|
1405
|
+
const n = o.properties[r.id].data;
|
|
1376
1406
|
n.visible = l;
|
|
1377
1407
|
});
|
|
1378
1408
|
},
|
|
1379
1409
|
shared: s,
|
|
1380
1410
|
onSharedChange: (l) => {
|
|
1381
|
-
|
|
1382
|
-
const n = o.properties[
|
|
1411
|
+
h((o) => {
|
|
1412
|
+
const n = o.properties[r.id].data;
|
|
1383
1413
|
n.shared = l;
|
|
1384
1414
|
});
|
|
1385
1415
|
},
|
|
1386
1416
|
alwaysShowActions: !0,
|
|
1387
|
-
children: /* @__PURE__ */
|
|
1417
|
+
children: /* @__PURE__ */ x(k, {
|
|
1388
1418
|
direction: "column",
|
|
1389
1419
|
sx: {
|
|
1390
1420
|
gap: 2
|
|
1391
1421
|
},
|
|
1392
1422
|
children: [
|
|
1393
|
-
/* @__PURE__ */
|
|
1394
|
-
label:
|
|
1423
|
+
/* @__PURE__ */ e(R, {
|
|
1424
|
+
label: a("key"),
|
|
1395
1425
|
size: "small",
|
|
1396
1426
|
required: !0,
|
|
1397
1427
|
sx: {
|
|
1398
1428
|
width: "calc(100% - 104px - 8px)",
|
|
1399
1429
|
flex: 1,
|
|
1400
1430
|
"& .MuiOutlinedInput-root": {
|
|
1401
|
-
borderColor:
|
|
1431
|
+
borderColor: r.key ? X(f.properties, r.id, r.key) ? "warning.main" : void 0 : "error.main"
|
|
1402
1432
|
},
|
|
1403
1433
|
"& .MuiFormLabel-root": {
|
|
1404
|
-
color:
|
|
1434
|
+
color: r.key ? X(f.properties, r.id, r.key) ? "warning.main" : "text.secondary" : "error.main"
|
|
1405
1435
|
},
|
|
1406
1436
|
"& .MuiFormLabel-root.Mui-focused": {
|
|
1407
|
-
color:
|
|
1437
|
+
color: r.key ? X(f.properties, r.id, r.key) ? "warning.main" : "primary.main" : "error.main"
|
|
1408
1438
|
}
|
|
1409
1439
|
},
|
|
1410
|
-
value:
|
|
1440
|
+
value: r.key || "",
|
|
1411
1441
|
onChange: (l) => {
|
|
1412
|
-
|
|
1413
|
-
const n = o.properties[
|
|
1442
|
+
h((o) => {
|
|
1443
|
+
const n = o.properties[r.id].data;
|
|
1414
1444
|
n.key = l.target.value.trim();
|
|
1415
1445
|
});
|
|
1416
1446
|
},
|
|
1417
1447
|
slotProps: {
|
|
1418
1448
|
input: {
|
|
1419
|
-
endAdornment: !
|
|
1449
|
+
endAdornment: !r.key || r.key && X(f.properties, r.id, r.key) ? /* @__PURE__ */ e(H, {
|
|
1420
1450
|
position: "end",
|
|
1421
1451
|
sx: {
|
|
1422
1452
|
width: 16,
|
|
1423
1453
|
ml: 0
|
|
1424
1454
|
},
|
|
1425
|
-
children: /* @__PURE__ */
|
|
1455
|
+
children: /* @__PURE__ */ e(B, { title: r.key ? a("duplicateKey") : a("requiredKey"), children: /* @__PURE__ */ e(Be, {
|
|
1426
1456
|
sx: {
|
|
1427
|
-
color:
|
|
1457
|
+
color: r.key ? "warning.main" : "error.main",
|
|
1428
1458
|
fontSize: 16
|
|
1429
1459
|
}
|
|
1430
1460
|
}) })
|
|
@@ -1432,101 +1462,101 @@ function Ye({ data: e, params: t, visible: i, shared: s, config: h, currentLocal
|
|
|
1432
1462
|
}
|
|
1433
1463
|
}
|
|
1434
1464
|
}),
|
|
1435
|
-
/* @__PURE__ */
|
|
1465
|
+
/* @__PURE__ */ x(k, {
|
|
1436
1466
|
direction: "row",
|
|
1437
1467
|
sx: {
|
|
1438
1468
|
gap: 1
|
|
1439
1469
|
},
|
|
1440
1470
|
children: [
|
|
1441
|
-
/* @__PURE__ */
|
|
1442
|
-
label:
|
|
1471
|
+
/* @__PURE__ */ e(R, {
|
|
1472
|
+
label: a("label"),
|
|
1443
1473
|
size: "small",
|
|
1444
1474
|
sx: { flex: 1 },
|
|
1445
|
-
value: (
|
|
1475
|
+
value: (r.locales?.[p]?.name ?? r.locales?.[u]?.name) || "",
|
|
1446
1476
|
onChange: (l) => {
|
|
1447
|
-
|
|
1448
|
-
const n = o.properties[
|
|
1477
|
+
h((o) => {
|
|
1478
|
+
const n = o.properties[r.id].data;
|
|
1449
1479
|
n.locales ??= {}, n.locales[p] ??= {}, n.locales[p].name = l.target.value;
|
|
1450
1480
|
});
|
|
1451
1481
|
}
|
|
1452
1482
|
}),
|
|
1453
|
-
/* @__PURE__ */
|
|
1454
|
-
label:
|
|
1483
|
+
/* @__PURE__ */ e(R, {
|
|
1484
|
+
label: a("type"),
|
|
1455
1485
|
size: "small",
|
|
1456
1486
|
select: !0,
|
|
1457
1487
|
sx: { flex: 1 },
|
|
1458
|
-
value:
|
|
1488
|
+
value: r.type === "string" && r.multiline ? "multiline" : r.type || "string",
|
|
1459
1489
|
onChange: (l) => {
|
|
1460
|
-
|
|
1461
|
-
const n = o.properties[
|
|
1490
|
+
h((o) => {
|
|
1491
|
+
const n = o.properties[r.id].data;
|
|
1462
1492
|
if (n.locales)
|
|
1463
1493
|
for (const b of Object.keys(n.locales))
|
|
1464
1494
|
n.locales[b].defaultValue = void 0;
|
|
1465
|
-
const
|
|
1466
|
-
|
|
1495
|
+
const m = l.target.value;
|
|
1496
|
+
m === "multiline" ? (n.type = "string", n.multiline = !0) : (typeof n.multiline < "u" && delete n.multiline, n.type = m);
|
|
1467
1497
|
});
|
|
1468
1498
|
},
|
|
1469
|
-
children: ut.map((l) => /* @__PURE__ */
|
|
1499
|
+
children: ut.map((l) => /* @__PURE__ */ e(Z, { value: l.value, children: l.label }, l.value))
|
|
1470
1500
|
})
|
|
1471
1501
|
]
|
|
1472
1502
|
}),
|
|
1473
|
-
/* @__PURE__ */
|
|
1503
|
+
/* @__PURE__ */ x(k, {
|
|
1474
1504
|
direction: "row",
|
|
1475
1505
|
sx: {
|
|
1476
1506
|
gap: 1
|
|
1477
1507
|
},
|
|
1478
1508
|
children: [
|
|
1479
|
-
/* @__PURE__ */
|
|
1509
|
+
/* @__PURE__ */ e(d, {
|
|
1480
1510
|
allComponents: y,
|
|
1481
1511
|
defaultLocale: u,
|
|
1482
|
-
component:
|
|
1483
|
-
property:
|
|
1484
|
-
label:
|
|
1512
|
+
component: f,
|
|
1513
|
+
property: r,
|
|
1514
|
+
label: a("defaultValue"),
|
|
1485
1515
|
size: "small",
|
|
1486
1516
|
fullWidth: !0,
|
|
1487
|
-
value:
|
|
1517
|
+
value: r.locales?.[p]?.defaultValue,
|
|
1488
1518
|
onChange: (l, o) => {
|
|
1489
|
-
|
|
1490
|
-
const
|
|
1519
|
+
h((n) => {
|
|
1520
|
+
const m = n.properties[r.id].data;
|
|
1491
1521
|
if (o?.forceUpdateProperty) {
|
|
1492
|
-
const b = be(
|
|
1493
|
-
Object.keys(
|
|
1494
|
-
b[
|
|
1522
|
+
const b = be(m), c = be(l);
|
|
1523
|
+
Object.keys(c).forEach((v) => {
|
|
1524
|
+
b[v] || We(m, v, c[v]);
|
|
1495
1525
|
});
|
|
1496
1526
|
} else
|
|
1497
|
-
|
|
1527
|
+
m.locales ??= {}, m.locales[p] ??= {}, m.locales[p].defaultValue = l;
|
|
1498
1528
|
});
|
|
1499
1529
|
}
|
|
1500
1530
|
}),
|
|
1501
|
-
|
|
1531
|
+
r.type === "custom" ? /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(bt, { property: r, allComponents: y }) }) : null
|
|
1502
1532
|
]
|
|
1503
1533
|
})
|
|
1504
1534
|
]
|
|
1505
1535
|
})
|
|
1506
1536
|
});
|
|
1507
1537
|
}
|
|
1508
|
-
function ht(
|
|
1538
|
+
function ht(r, t) {
|
|
1509
1539
|
const [i, s] = K(0);
|
|
1510
|
-
return
|
|
1540
|
+
return M(() => {
|
|
1511
1541
|
const p = setTimeout(() => {
|
|
1512
|
-
if (
|
|
1513
|
-
let u =
|
|
1542
|
+
if (r.current) {
|
|
1543
|
+
let u = r.current.parentElement, y = 0;
|
|
1514
1544
|
for (; u; )
|
|
1515
1545
|
u.classList.contains("property-container") && y++, u = u.parentElement;
|
|
1516
1546
|
s(y);
|
|
1517
1547
|
}
|
|
1518
1548
|
}, 100);
|
|
1519
1549
|
return () => clearTimeout(p);
|
|
1520
|
-
}, [
|
|
1550
|
+
}, [r, t]), i;
|
|
1521
1551
|
}
|
|
1522
|
-
function ft({ config:
|
|
1523
|
-
const { t: u } =
|
|
1524
|
-
return /* @__PURE__ */
|
|
1552
|
+
function ft({ config: r, currentLocale: t, defaultLocale: i, allComponents: s, onUpdateConfig: f, useI18nEditor: p = !0 }) {
|
|
1553
|
+
const { t: u } = V(), y = ke({ variant: "dialog" }), h = r.properties && T(Object.values(r.properties), "index");
|
|
1554
|
+
return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ x(k, {
|
|
1525
1555
|
sx: {
|
|
1526
1556
|
gap: 2
|
|
1527
1557
|
},
|
|
1528
1558
|
children: [
|
|
1529
|
-
/* @__PURE__ */
|
|
1559
|
+
/* @__PURE__ */ x(k, {
|
|
1530
1560
|
direction: "row",
|
|
1531
1561
|
sx: {
|
|
1532
1562
|
gap: 1,
|
|
@@ -1534,22 +1564,22 @@ function ft({ config: e, currentLocale: t, defaultLocale: i, allComponents: s, o
|
|
|
1534
1564
|
justifyContent: "space-between"
|
|
1535
1565
|
},
|
|
1536
1566
|
children: [
|
|
1537
|
-
/* @__PURE__ */
|
|
1538
|
-
/* @__PURE__ */
|
|
1567
|
+
/* @__PURE__ */ e(D, { variant: "subtitle1", children: u("properties") }),
|
|
1568
|
+
/* @__PURE__ */ e(P, {
|
|
1539
1569
|
sx: {
|
|
1540
1570
|
flex: 1
|
|
1541
1571
|
}
|
|
1542
1572
|
}),
|
|
1543
|
-
p && /* @__PURE__ */
|
|
1573
|
+
p && /* @__PURE__ */ e(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...we(y), children: /* @__PURE__ */ e(Ue, { fontSize: "small" }) })
|
|
1544
1574
|
]
|
|
1545
1575
|
}),
|
|
1546
|
-
|
|
1576
|
+
r.properties && Object.keys(r.properties).length > 0 ? /* @__PURE__ */ e(He, {
|
|
1547
1577
|
component: k,
|
|
1548
1578
|
gap: 2,
|
|
1549
|
-
list:
|
|
1550
|
-
renderItem: (
|
|
1551
|
-
const o =
|
|
1552
|
-
return /* @__PURE__ */
|
|
1579
|
+
list: r.properties,
|
|
1580
|
+
renderItem: (a, d, l) => {
|
|
1581
|
+
const o = ee(r.properties, a.id), n = _e(r.properties, a.id);
|
|
1582
|
+
return /* @__PURE__ */ e(_, {
|
|
1553
1583
|
elevation: 0,
|
|
1554
1584
|
className: "property-container",
|
|
1555
1585
|
sx: {
|
|
@@ -1558,71 +1588,71 @@ function ft({ config: e, currentLocale: t, defaultLocale: i, allComponents: s, o
|
|
|
1558
1588
|
border: o ? "1px solid" : "1px dashed",
|
|
1559
1589
|
borderColor: "divider"
|
|
1560
1590
|
},
|
|
1561
|
-
children: /* @__PURE__ */
|
|
1591
|
+
children: /* @__PURE__ */ e(k, {
|
|
1562
1592
|
sx: {
|
|
1563
1593
|
gap: 2
|
|
1564
1594
|
},
|
|
1565
|
-
children: /* @__PURE__ */
|
|
1566
|
-
data:
|
|
1595
|
+
children: /* @__PURE__ */ e(Ge, {
|
|
1596
|
+
data: a,
|
|
1567
1597
|
params: l,
|
|
1568
1598
|
visible: o,
|
|
1569
1599
|
shared: n,
|
|
1570
|
-
config:
|
|
1600
|
+
config: r,
|
|
1571
1601
|
currentLocale: t,
|
|
1572
1602
|
defaultLocale: i,
|
|
1573
1603
|
allComponents: s,
|
|
1574
|
-
onUpdateConfig:
|
|
1604
|
+
onUpdateConfig: f
|
|
1575
1605
|
})
|
|
1576
1606
|
})
|
|
1577
|
-
},
|
|
1607
|
+
}, a.id);
|
|
1578
1608
|
}
|
|
1579
|
-
}) : /* @__PURE__ */
|
|
1580
|
-
/* @__PURE__ */
|
|
1609
|
+
}) : /* @__PURE__ */ e(Y, { style: { fontSize: 12 }, children: u("maker.properties.noProperties") }),
|
|
1610
|
+
/* @__PURE__ */ e(E, {
|
|
1581
1611
|
fullWidth: !0,
|
|
1582
1612
|
variant: "outlined",
|
|
1583
1613
|
className: "ignore-style-override",
|
|
1584
1614
|
onClick: () => {
|
|
1585
|
-
|
|
1586
|
-
const
|
|
1587
|
-
|
|
1615
|
+
f((a) => {
|
|
1616
|
+
const d = Je();
|
|
1617
|
+
a.properties ??= {}, a.properties[d] ??= { index: h?.length || 0, data: { id: d, shared: !1 } };
|
|
1588
1618
|
});
|
|
1589
1619
|
},
|
|
1590
|
-
startIcon: /* @__PURE__ */
|
|
1620
|
+
startIcon: /* @__PURE__ */ e(Le, {}),
|
|
1591
1621
|
children: u("addObject", { object: u("property") })
|
|
1592
1622
|
}),
|
|
1593
|
-
p && /* @__PURE__ */
|
|
1623
|
+
p && /* @__PURE__ */ e(Ye, { ...Fe(y), component: r })
|
|
1594
1624
|
]
|
|
1595
1625
|
}) });
|
|
1596
1626
|
}
|
|
1597
|
-
function bt({ property:
|
|
1627
|
+
function bt({ property: r, allComponents: t }) {
|
|
1598
1628
|
const i = ke({ variant: "popper" });
|
|
1599
|
-
return /* @__PURE__ */
|
|
1600
|
-
/* @__PURE__ */
|
|
1601
|
-
/* @__PURE__ */
|
|
1629
|
+
return /* @__PURE__ */ x(L, { children: [
|
|
1630
|
+
/* @__PURE__ */ e(E, { sx: { minWidth: 0 }, ...we(i), children: /* @__PURE__ */ e(Me, { fontSize: "small" }) }),
|
|
1631
|
+
/* @__PURE__ */ e(ir, { ...Kr(i), children: /* @__PURE__ */ e(vr, { onClickAway: i.close, children: /* @__PURE__ */ e(_, { children: /* @__PURE__ */ e(P, {
|
|
1602
1632
|
sx: {
|
|
1603
1633
|
width: 500,
|
|
1604
1634
|
p: 2
|
|
1605
1635
|
},
|
|
1606
|
-
children: /* @__PURE__ */
|
|
1607
|
-
value:
|
|
1608
|
-
onChange: (s,
|
|
1636
|
+
children: /* @__PURE__ */ e(Se, {
|
|
1637
|
+
value: r.componentId,
|
|
1638
|
+
onChange: (s, f) => r.componentId = f,
|
|
1609
1639
|
allComponents: t
|
|
1610
1640
|
})
|
|
1611
1641
|
}) }) }) })
|
|
1612
1642
|
] });
|
|
1613
1643
|
}
|
|
1614
|
-
function gt({ value:
|
|
1615
|
-
const [p, u] = K(!1), { t: y, locale:
|
|
1616
|
-
return
|
|
1617
|
-
/* @__PURE__ */
|
|
1644
|
+
function gt({ value: r, valueImmutable: t, onChange: i, defaultLocale: s, allComponents: f }) {
|
|
1645
|
+
const [p, u] = K(!1), { t: y, locale: h } = V(), a = typeof r?.componentId == "string" ? f[r.componentId]?.data : void 0;
|
|
1646
|
+
return a ? /* @__PURE__ */ x(P, { sx: { width: "100%", position: "relative" }, children: [
|
|
1647
|
+
/* @__PURE__ */ e(G, {
|
|
1618
1648
|
sx: { minWidth: 0 },
|
|
1619
|
-
disabled: !
|
|
1649
|
+
disabled: !a,
|
|
1620
1650
|
size: "small",
|
|
1621
1651
|
onClick: () => u(!p),
|
|
1622
1652
|
color: p ? "primary" : "default",
|
|
1623
|
-
children: /* @__PURE__ */
|
|
1653
|
+
children: /* @__PURE__ */ e(Me, { fontSize: "small" })
|
|
1624
1654
|
}),
|
|
1625
|
-
p && /* @__PURE__ */
|
|
1655
|
+
p && /* @__PURE__ */ e(tr, { in: p, timeout: "auto", unmountOnExit: !0, sx: { width: "100%", zIndex: 10 }, children: /* @__PURE__ */ x(_, {
|
|
1626
1656
|
elevation: 1,
|
|
1627
1657
|
sx: {
|
|
1628
1658
|
mt: 1,
|
|
@@ -1633,68 +1663,68 @@ function gt({ value: e, valueImmutable: t, onChange: i, defaultLocale: s, allCom
|
|
|
1633
1663
|
width: "100%"
|
|
1634
1664
|
},
|
|
1635
1665
|
children: [
|
|
1636
|
-
/* @__PURE__ */
|
|
1666
|
+
/* @__PURE__ */ e(P, {
|
|
1637
1667
|
sx: {
|
|
1638
1668
|
width: "100%",
|
|
1639
1669
|
mb: 2
|
|
1640
1670
|
},
|
|
1641
|
-
children: /* @__PURE__ */
|
|
1642
|
-
config:
|
|
1643
|
-
currentLocale:
|
|
1671
|
+
children: /* @__PURE__ */ e(qe, {
|
|
1672
|
+
config: a,
|
|
1673
|
+
currentLocale: h,
|
|
1644
1674
|
defaultLocale: s,
|
|
1645
|
-
allComponents:
|
|
1646
|
-
propertiesValue:
|
|
1647
|
-
onChange: ({ id:
|
|
1648
|
-
const o = he(l.value), n = JSON.parse(JSON.stringify(
|
|
1649
|
-
n?.componentId && (t ? i?.({ ...n, properties: { ...n.properties, [
|
|
1675
|
+
allComponents: f,
|
|
1676
|
+
propertiesValue: r?.properties,
|
|
1677
|
+
onChange: ({ id: d, value: l }) => {
|
|
1678
|
+
const o = he(l.value), n = JSON.parse(JSON.stringify(r));
|
|
1679
|
+
n?.componentId && (t ? i?.({ ...n, properties: { ...n.properties, [d]: { value: o } } }) : (n.properties = n.properties ?? {}, n.properties[d] = { value: o }, i?.(n)));
|
|
1650
1680
|
}
|
|
1651
1681
|
})
|
|
1652
1682
|
}),
|
|
1653
|
-
/* @__PURE__ */
|
|
1683
|
+
/* @__PURE__ */ e(E, { size: "small", onClick: () => u(!1), sx: { mt: 1 }, children: y("close") })
|
|
1654
1684
|
]
|
|
1655
1685
|
}) })
|
|
1656
1686
|
] }) : null;
|
|
1657
1687
|
}
|
|
1658
|
-
function
|
|
1659
|
-
const { t: s } =
|
|
1660
|
-
return /* @__PURE__ */
|
|
1661
|
-
/* @__PURE__ */
|
|
1662
|
-
/* @__PURE__ */
|
|
1663
|
-
/* @__PURE__ */
|
|
1688
|
+
function Ye({ type: r = "properties", component: t, ...i }) {
|
|
1689
|
+
const { t: s } = V(), { state: { components: f, supportedLocales: p, config: { defaultLocale: u } } } = le(), y = xe(), h = q(t).doc, a = r === "properties" ? t.properties : r === "parameters" && t.renderer?.type === "component" ? f[t.renderer.componentId]?.data.properties : void 0, d = t.renderer?.type === "component" ? t : void 0;
|
|
1690
|
+
return /* @__PURE__ */ x(ye, { ...i, fullWidth: !0, maxWidth: "lg", children: [
|
|
1691
|
+
/* @__PURE__ */ e(Ve, { children: s("i18nEditorTitle") }),
|
|
1692
|
+
/* @__PURE__ */ e(Ae, { children: a && /* @__PURE__ */ e(k, { children: /* @__PURE__ */ x(Ne, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
|
|
1693
|
+
/* @__PURE__ */ e(ze, { children: /* @__PURE__ */ e(te, { children: p.map(({ locale: l, name: o }) => /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ x(D, {
|
|
1664
1694
|
sx: {
|
|
1665
1695
|
color: "text.primary"
|
|
1666
1696
|
},
|
|
1667
1697
|
children: [
|
|
1668
1698
|
o,
|
|
1669
|
-
u === l && /* @__PURE__ */
|
|
1699
|
+
u === l && /* @__PURE__ */ e(Or, { sx: { fontSize: 12 } })
|
|
1670
1700
|
]
|
|
1671
1701
|
}) }, l)) }) }),
|
|
1672
|
-
/* @__PURE__ */
|
|
1702
|
+
/* @__PURE__ */ e(je, { children: T(Object.values(a), "index").map(({ data: l }) => /* @__PURE__ */ e(te, { children: p.map(({ locale: o }) => /* @__PURE__ */ e(ne, { children: /* @__PURE__ */ e(k, {
|
|
1673
1703
|
sx: {
|
|
1674
1704
|
gap: 1
|
|
1675
1705
|
},
|
|
1676
|
-
children:
|
|
1677
|
-
/* @__PURE__ */
|
|
1706
|
+
children: r === "properties" ? /* @__PURE__ */ x(L, { children: [
|
|
1707
|
+
/* @__PURE__ */ e(R, {
|
|
1678
1708
|
size: "small",
|
|
1679
1709
|
label: "Key",
|
|
1680
1710
|
value: l.key || "",
|
|
1681
1711
|
onChange: (n) => {
|
|
1682
|
-
|
|
1712
|
+
h.transact(() => {
|
|
1683
1713
|
l.key = n.target.value.trim();
|
|
1684
1714
|
});
|
|
1685
1715
|
}
|
|
1686
1716
|
}),
|
|
1687
|
-
/* @__PURE__ */
|
|
1717
|
+
/* @__PURE__ */ e(R, {
|
|
1688
1718
|
size: "small",
|
|
1689
1719
|
label: s("label"),
|
|
1690
1720
|
value: (l.locales?.[o]?.name ?? l.locales?.[u]?.name) || "",
|
|
1691
1721
|
onChange: (n) => {
|
|
1692
|
-
|
|
1722
|
+
h.transact(() => {
|
|
1693
1723
|
l.locales ??= {}, l.locales[o] ??= {}, l.locales[o].name = n.target.value;
|
|
1694
1724
|
});
|
|
1695
1725
|
}
|
|
1696
1726
|
}),
|
|
1697
|
-
/* @__PURE__ */
|
|
1727
|
+
/* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(F, {
|
|
1698
1728
|
allComponents: y,
|
|
1699
1729
|
defaultLocale: u,
|
|
1700
1730
|
component: t,
|
|
@@ -1702,42 +1732,42 @@ function qe({ type: e = "properties", component: t, ...i }) {
|
|
|
1702
1732
|
size: "small",
|
|
1703
1733
|
fullWidth: !0,
|
|
1704
1734
|
label: "Default Value",
|
|
1705
|
-
valueImmutable:
|
|
1735
|
+
valueImmutable: oe(l.locales?.[o]?.defaultValue),
|
|
1706
1736
|
value: l.locales?.[o]?.defaultValue ?? l.locales?.[u]?.defaultValue,
|
|
1707
1737
|
onChange: (n) => {
|
|
1708
|
-
|
|
1738
|
+
h.transact(() => {
|
|
1709
1739
|
l.locales ??= {}, l.locales[o] ??= {}, l.locales[o].defaultValue = n;
|
|
1710
1740
|
});
|
|
1711
1741
|
}
|
|
1712
1742
|
}) })
|
|
1713
|
-
] }) :
|
|
1743
|
+
] }) : r === "parameters" && d ? /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(F, {
|
|
1714
1744
|
allComponents: y,
|
|
1715
1745
|
defaultLocale: u,
|
|
1716
1746
|
component: t,
|
|
1717
1747
|
property: l,
|
|
1718
1748
|
size: "small",
|
|
1719
1749
|
fullWidth: !0,
|
|
1720
|
-
valueImmutable:
|
|
1721
|
-
value:
|
|
1750
|
+
valueImmutable: oe(d.renderer.properties?.[l.id]?.locales?.[o]?.value),
|
|
1751
|
+
value: d.renderer.properties?.[l.id]?.locales?.[o]?.value ?? d.renderer.properties?.[l.id]?.locales?.[u]?.value ?? l.locales?.[o]?.defaultValue ?? l.locales?.[u]?.defaultValue,
|
|
1722
1752
|
onChange: (n) => {
|
|
1723
|
-
|
|
1724
|
-
|
|
1753
|
+
h.transact(() => {
|
|
1754
|
+
d.renderer.properties ??= {}, d.renderer.properties[l.id] ??= {}, d.renderer.properties[l.id].locales ??= {}, d.renderer.properties[l.id].locales[o] ??= {}, d.renderer.properties[l.id].locales[o].value = n;
|
|
1725
1755
|
});
|
|
1726
1756
|
}
|
|
1727
1757
|
}) }) : null
|
|
1728
1758
|
}, l.id) }, o)) }, l.id)) })
|
|
1729
1759
|
] }) }) }),
|
|
1730
|
-
/* @__PURE__ */
|
|
1760
|
+
/* @__PURE__ */ e(Ee, { children: /* @__PURE__ */ e(E, { onClick: (l) => i.onClose?.(l, "escapeKeyDown"), children: s("close") }) })
|
|
1731
1761
|
] });
|
|
1732
1762
|
}
|
|
1733
|
-
const
|
|
1763
|
+
const Oe = (r, t) => (i) => {
|
|
1734
1764
|
const s = [
|
|
1735
1765
|
i.palette.info.main,
|
|
1736
1766
|
i.palette.primary.main,
|
|
1737
1767
|
i.palette.secondary.main,
|
|
1738
1768
|
i.palette.success.main,
|
|
1739
1769
|
i.palette.warning.main
|
|
1740
|
-
],
|
|
1770
|
+
], f = Math.min(s.length - 1, r), p = s[f], u = de(p, 0.5), y = de(p, 1);
|
|
1741
1771
|
return {
|
|
1742
1772
|
// 保留原有的边框样式
|
|
1743
1773
|
borderColor: `${u} !important`,
|
|
@@ -1749,12 +1779,12 @@ const Ne = (e, t) => (i) => {
|
|
|
1749
1779
|
...t
|
|
1750
1780
|
};
|
|
1751
1781
|
};
|
|
1752
|
-
function yt({ property:
|
|
1753
|
-
const { t:
|
|
1754
|
-
if (!(
|
|
1782
|
+
function yt({ property: r, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
1783
|
+
const { t: f, locale: p } = V(), u = se(null), y = ht(u, r), h = W(() => {
|
|
1784
|
+
if (!(r.type !== "json" && r.type !== "yaml" && r.type !== "array") && r.subProperties)
|
|
1755
1785
|
try {
|
|
1756
|
-
let
|
|
1757
|
-
T(Object.values(
|
|
1786
|
+
let a = {};
|
|
1787
|
+
T(Object.values(r.subProperties), "index").filter((o) => o.data.visible !== !1 && o.data.key).forEach(({ data: o }) => {
|
|
1758
1788
|
if (!o.key)
|
|
1759
1789
|
return;
|
|
1760
1790
|
let n = o.locales?.[p]?.defaultValue ?? o.locales?.[i]?.defaultValue;
|
|
@@ -1765,18 +1795,18 @@ function yt({ property: e, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
|
1765
1795
|
else if ((o.type === "json" || o.type === "yaml") && typeof n == "string")
|
|
1766
1796
|
try {
|
|
1767
1797
|
o.type === "json" ? n = JSON.parse(n) : n = me.parse(n);
|
|
1768
|
-
} catch (
|
|
1769
|
-
console.error("Error parsing nested value", n,
|
|
1798
|
+
} catch (m) {
|
|
1799
|
+
console.error("Error parsing nested value", n, m), n = {};
|
|
1770
1800
|
}
|
|
1771
|
-
|
|
1772
|
-
}),
|
|
1773
|
-
const l =
|
|
1801
|
+
a[o.key] = n;
|
|
1802
|
+
}), r.type === "array" && !Array.isArray(a) && (a = U(a) ? [] : [a]);
|
|
1803
|
+
const l = ve(a, r.type);
|
|
1774
1804
|
t?.(l);
|
|
1775
|
-
} catch (
|
|
1776
|
-
console.error("Error converting structure to text:",
|
|
1805
|
+
} catch (a) {
|
|
1806
|
+
console.error("Error converting structure to text:", a);
|
|
1777
1807
|
}
|
|
1778
|
-
}, [
|
|
1779
|
-
return
|
|
1808
|
+
}, [r, p, i, t]);
|
|
1809
|
+
return r.type !== "json" && r.type !== "yaml" && r.type !== "array" ? null : /* @__PURE__ */ x(k, {
|
|
1780
1810
|
direction: "column",
|
|
1781
1811
|
ref: u,
|
|
1782
1812
|
sx: {
|
|
@@ -1784,73 +1814,73 @@ function yt({ property: e, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
|
1784
1814
|
width: "100%"
|
|
1785
1815
|
},
|
|
1786
1816
|
children: [
|
|
1787
|
-
/* @__PURE__ */
|
|
1817
|
+
/* @__PURE__ */ e(nr, { sx: { mt: -1 }, children: /* @__PURE__ */ e(D, {
|
|
1788
1818
|
variant: "caption",
|
|
1789
1819
|
sx: {
|
|
1790
1820
|
color: "text.secondary"
|
|
1791
1821
|
},
|
|
1792
|
-
children:
|
|
1822
|
+
children: f("maker.properties.subProperties")
|
|
1793
1823
|
}) }),
|
|
1794
|
-
|
|
1824
|
+
r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ e(He, {
|
|
1795
1825
|
component: k,
|
|
1796
1826
|
gap: 2,
|
|
1797
|
-
list:
|
|
1798
|
-
renderItem: (
|
|
1799
|
-
const o =
|
|
1800
|
-
return /* @__PURE__ */
|
|
1827
|
+
list: r.subProperties,
|
|
1828
|
+
renderItem: (a, d, l) => {
|
|
1829
|
+
const o = a.visible !== !1, n = a.shared ?? !1;
|
|
1830
|
+
return /* @__PURE__ */ e(_, {
|
|
1801
1831
|
elevation: 0,
|
|
1802
1832
|
className: "property-container",
|
|
1803
1833
|
sx: {
|
|
1804
1834
|
p: 1.25,
|
|
1805
1835
|
borderRadius: 1,
|
|
1806
1836
|
border: o ? "1px solid" : "1px dashed",
|
|
1807
|
-
"&":
|
|
1837
|
+
"&": Oe(y)
|
|
1808
1838
|
},
|
|
1809
|
-
children: /* @__PURE__ */
|
|
1839
|
+
children: /* @__PURE__ */ e(k, {
|
|
1810
1840
|
sx: {
|
|
1811
1841
|
gap: 2
|
|
1812
1842
|
},
|
|
1813
|
-
children: /* @__PURE__ */
|
|
1814
|
-
data:
|
|
1843
|
+
children: /* @__PURE__ */ e(Ge, {
|
|
1844
|
+
data: a,
|
|
1815
1845
|
params: l,
|
|
1816
1846
|
visible: o,
|
|
1817
1847
|
shared: n,
|
|
1818
1848
|
config: {
|
|
1819
|
-
properties:
|
|
1849
|
+
properties: r.subProperties
|
|
1820
1850
|
},
|
|
1821
1851
|
currentLocale: p,
|
|
1822
1852
|
defaultLocale: i,
|
|
1823
1853
|
allComponents: s,
|
|
1824
|
-
onUpdateConfig: (
|
|
1854
|
+
onUpdateConfig: (m) => {
|
|
1825
1855
|
try {
|
|
1826
|
-
const b = { properties:
|
|
1827
|
-
|
|
1828
|
-
const
|
|
1829
|
-
...
|
|
1856
|
+
const b = { properties: r.subProperties || {} };
|
|
1857
|
+
m(b);
|
|
1858
|
+
const c = {
|
|
1859
|
+
...r,
|
|
1830
1860
|
subProperties: b.properties
|
|
1831
1861
|
};
|
|
1832
|
-
t?.(
|
|
1862
|
+
t?.(c, { forceUpdateProperty: !0 }), h();
|
|
1833
1863
|
} catch (b) {
|
|
1834
1864
|
console.error("Error updating property:", b);
|
|
1835
1865
|
}
|
|
1836
1866
|
}
|
|
1837
1867
|
})
|
|
1838
1868
|
})
|
|
1839
|
-
},
|
|
1869
|
+
}, a.id);
|
|
1840
1870
|
}
|
|
1841
|
-
}) : /* @__PURE__ */
|
|
1842
|
-
/* @__PURE__ */
|
|
1871
|
+
}) : /* @__PURE__ */ e(Y, { style: { fontSize: 12, height: 100 }, children: f("maker.properties.noSubProperties") }),
|
|
1872
|
+
/* @__PURE__ */ e(E, {
|
|
1843
1873
|
fullWidth: !0,
|
|
1844
1874
|
variant: "outlined",
|
|
1845
1875
|
className: "ignore-style-override",
|
|
1846
1876
|
size: "small",
|
|
1847
|
-
startIcon: /* @__PURE__ */
|
|
1877
|
+
startIcon: /* @__PURE__ */ e(Le, {}),
|
|
1848
1878
|
onClick: () => {
|
|
1849
1879
|
try {
|
|
1850
|
-
const
|
|
1851
|
-
index: Object.values(
|
|
1880
|
+
const a = r.subProperties || {}, d = Je(), o = {
|
|
1881
|
+
index: Object.values(a).length,
|
|
1852
1882
|
data: {
|
|
1853
|
-
id:
|
|
1883
|
+
id: d,
|
|
1854
1884
|
key: "",
|
|
1855
1885
|
type: "string",
|
|
1856
1886
|
visible: !0,
|
|
@@ -1865,70 +1895,70 @@ function yt({ property: e, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
|
1865
1895
|
subProperties: {}
|
|
1866
1896
|
}
|
|
1867
1897
|
}, n = {
|
|
1868
|
-
...
|
|
1898
|
+
...r,
|
|
1869
1899
|
subProperties: {
|
|
1870
|
-
...
|
|
1871
|
-
[
|
|
1900
|
+
...a,
|
|
1901
|
+
[d]: o
|
|
1872
1902
|
}
|
|
1873
1903
|
};
|
|
1874
|
-
t?.(n, { forceUpdateProperty: !0 }),
|
|
1875
|
-
} catch (
|
|
1876
|
-
console.error("Error adding property:",
|
|
1904
|
+
t?.(n, { forceUpdateProperty: !0 }), h();
|
|
1905
|
+
} catch (a) {
|
|
1906
|
+
console.error("Error adding property:", a);
|
|
1877
1907
|
}
|
|
1878
1908
|
},
|
|
1879
1909
|
sx: {
|
|
1880
|
-
"&":
|
|
1910
|
+
"&": Oe(y, {
|
|
1881
1911
|
// borderLeft: undefined,
|
|
1882
1912
|
})
|
|
1883
1913
|
},
|
|
1884
|
-
children:
|
|
1914
|
+
children: f("maker.properties.addSubProperty")
|
|
1885
1915
|
})
|
|
1886
1916
|
]
|
|
1887
1917
|
});
|
|
1888
1918
|
}
|
|
1889
|
-
function
|
|
1890
|
-
const { locale:
|
|
1891
|
-
const n =
|
|
1892
|
-
n?.open(),
|
|
1893
|
-
let b =
|
|
1894
|
-
b && (b = `mediakit://${b}`, i && !i.includes("mediakit://") && (b += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")),
|
|
1919
|
+
function F({ component: r, property: t, value: i, onChange: s, valueImmutable: f, defaultLocale: p, allComponents: u, ...y }) {
|
|
1920
|
+
const { locale: h } = V(), a = mr(), d = se(null), l = () => {
|
|
1921
|
+
const n = a?.current?.getUploader();
|
|
1922
|
+
n?.open(), d.current && n.onceUploadSuccess(({ response: m }) => {
|
|
1923
|
+
let b = m?.data?.filename || "";
|
|
1924
|
+
b && (b = `mediakit://${b}`, i && !i.includes("mediakit://") && (b += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), d.current?.(b);
|
|
1895
1925
|
});
|
|
1896
|
-
}, o = y.label ?? (t.locales?.[
|
|
1926
|
+
}, o = y.label ?? (t.locales?.[h]?.name || t.locales?.[p]?.name || t.key || t.id);
|
|
1897
1927
|
if (t.type === "number")
|
|
1898
|
-
return /* @__PURE__ */
|
|
1928
|
+
return /* @__PURE__ */ e(vt, {
|
|
1899
1929
|
...y,
|
|
1900
1930
|
label: o,
|
|
1901
1931
|
NumberProps: {
|
|
1902
1932
|
value: ["number", "string"].includes(typeof i) ? i : null,
|
|
1903
|
-
onChange: (n,
|
|
1933
|
+
onChange: (n, m) => s?.(m)
|
|
1904
1934
|
}
|
|
1905
1935
|
});
|
|
1906
1936
|
if (t.type === "decimal")
|
|
1907
|
-
return /* @__PURE__ */
|
|
1937
|
+
return /* @__PURE__ */ e(R, {
|
|
1908
1938
|
...y,
|
|
1909
1939
|
label: o,
|
|
1910
1940
|
type: "text",
|
|
1911
1941
|
value: i ?? "",
|
|
1912
1942
|
onChange: (n) => {
|
|
1913
|
-
const
|
|
1914
|
-
if (
|
|
1915
|
-
s?.(
|
|
1943
|
+
const m = n.target.value;
|
|
1944
|
+
if (m === "" || m === "-") {
|
|
1945
|
+
s?.(m);
|
|
1916
1946
|
return;
|
|
1917
1947
|
}
|
|
1918
|
-
if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(
|
|
1919
|
-
let
|
|
1920
|
-
/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(
|
|
1948
|
+
if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(m)) {
|
|
1949
|
+
let c = m;
|
|
1950
|
+
/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(c) && (c = Number(c)), s?.(c);
|
|
1921
1951
|
}
|
|
1922
1952
|
}
|
|
1923
1953
|
});
|
|
1924
1954
|
if (t.type === "boolean")
|
|
1925
|
-
return /* @__PURE__ */
|
|
1955
|
+
return /* @__PURE__ */ e(ge, {
|
|
1926
1956
|
label: o,
|
|
1927
1957
|
labelPlacement: "start",
|
|
1928
|
-
control: /* @__PURE__ */
|
|
1958
|
+
control: /* @__PURE__ */ e(Re, { checked: i === !0, onChange: (n, m) => s?.(m) })
|
|
1929
1959
|
});
|
|
1930
1960
|
if (t.type === "color")
|
|
1931
|
-
return /* @__PURE__ */
|
|
1961
|
+
return /* @__PURE__ */ e(tt, {
|
|
1932
1962
|
label: o,
|
|
1933
1963
|
value: i,
|
|
1934
1964
|
onChange: (n) => {
|
|
@@ -1936,58 +1966,58 @@ function M({ component: e, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
1936
1966
|
}
|
|
1937
1967
|
});
|
|
1938
1968
|
if (t.type === "json" || t.type === "yaml")
|
|
1939
|
-
return /* @__PURE__ */
|
|
1969
|
+
return /* @__PURE__ */ e(nt, {
|
|
1940
1970
|
label: o,
|
|
1941
1971
|
value: i,
|
|
1942
1972
|
onChange: (n) => {
|
|
1943
1973
|
s?.(n);
|
|
1944
1974
|
},
|
|
1945
1975
|
property: t,
|
|
1946
|
-
component:
|
|
1976
|
+
component: r,
|
|
1947
1977
|
defaultLocale: p,
|
|
1948
1978
|
allComponents: u,
|
|
1949
|
-
PropertyValueField:
|
|
1979
|
+
PropertyValueField: F,
|
|
1950
1980
|
onUpload: (n) => {
|
|
1951
|
-
|
|
1981
|
+
d.current = n, l();
|
|
1952
1982
|
}
|
|
1953
1983
|
});
|
|
1954
1984
|
if (t.type === "custom") {
|
|
1955
1985
|
const n = u[t.componentId]?.data;
|
|
1956
|
-
return n ? /* @__PURE__ */
|
|
1986
|
+
return n ? /* @__PURE__ */ e(P, {
|
|
1957
1987
|
sx: {
|
|
1958
1988
|
width: "100%"
|
|
1959
1989
|
},
|
|
1960
|
-
children: /* @__PURE__ */
|
|
1990
|
+
children: /* @__PURE__ */ e(Ke, {
|
|
1961
1991
|
componentId: n.id,
|
|
1962
1992
|
props: { label: o, value: i, onChange: s },
|
|
1963
|
-
locale:
|
|
1993
|
+
locale: h,
|
|
1964
1994
|
dev: {
|
|
1965
1995
|
mode: "draft",
|
|
1966
1996
|
components: u,
|
|
1967
1997
|
defaultLocale: p
|
|
1968
1998
|
}
|
|
1969
1999
|
})
|
|
1970
|
-
}) : /* @__PURE__ */
|
|
2000
|
+
}) : /* @__PURE__ */ e(R, { ...y, label: o, disabled: !0, placeholder: "Click right button select a component" });
|
|
1971
2001
|
}
|
|
1972
2002
|
if (t.type === "component")
|
|
1973
|
-
return /* @__PURE__ */
|
|
2003
|
+
return /* @__PURE__ */ x(k, {
|
|
1974
2004
|
direction: "column",
|
|
1975
2005
|
sx: {
|
|
1976
2006
|
width: "100%",
|
|
1977
2007
|
gap: 1
|
|
1978
2008
|
},
|
|
1979
2009
|
children: [
|
|
1980
|
-
/* @__PURE__ */
|
|
2010
|
+
/* @__PURE__ */ e(Se, {
|
|
1981
2011
|
allComponents: u,
|
|
1982
2012
|
label: o,
|
|
1983
2013
|
value: i?.componentId,
|
|
1984
|
-
onChange: (n,
|
|
1985
|
-
|
|
2014
|
+
onChange: (n, m) => {
|
|
2015
|
+
f || !i ? s?.({ ...i && JSON.parse(JSON.stringify(i)), componentId: m }) : typeof i == "object" && (i.componentId = m, s?.({ ...i && JSON.parse(JSON.stringify(i)), componentId: m }));
|
|
1986
2016
|
}
|
|
1987
2017
|
}),
|
|
1988
|
-
i?.componentId && /* @__PURE__ */
|
|
2018
|
+
i?.componentId && /* @__PURE__ */ e(gt, {
|
|
1989
2019
|
value: i,
|
|
1990
|
-
valueImmutable:
|
|
2020
|
+
valueImmutable: f,
|
|
1991
2021
|
onChange: s,
|
|
1992
2022
|
defaultLocale: p,
|
|
1993
2023
|
allComponents: u
|
|
@@ -1997,11 +2027,11 @@ function M({ component: e, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
1997
2027
|
if (!t.type || ["string", "url", "multiline"].includes(t.type)) {
|
|
1998
2028
|
let n = t.type === "string" ? t.multiline : void 0;
|
|
1999
2029
|
t.type === "multiline" && (n = !0);
|
|
2000
|
-
const
|
|
2001
|
-
return /* @__PURE__ */
|
|
2030
|
+
const m = t.type === "url" ? i?.url : i;
|
|
2031
|
+
return /* @__PURE__ */ e(R, {
|
|
2002
2032
|
...y,
|
|
2003
2033
|
label: o,
|
|
2004
|
-
value: typeof
|
|
2034
|
+
value: typeof m == "string" ? m : "",
|
|
2005
2035
|
multiline: n,
|
|
2006
2036
|
minRows: n ? 2 : void 0,
|
|
2007
2037
|
maxRows: n ? 10 : void 0,
|
|
@@ -2011,7 +2041,7 @@ function M({ component: e, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
2011
2041
|
sx: {
|
|
2012
2042
|
pr: 0
|
|
2013
2043
|
},
|
|
2014
|
-
endAdornment: /* @__PURE__ */
|
|
2044
|
+
endAdornment: /* @__PURE__ */ x(H, {
|
|
2015
2045
|
position: "end",
|
|
2016
2046
|
sx: {
|
|
2017
2047
|
display: "flex",
|
|
@@ -2019,64 +2049,64 @@ function M({ component: e, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
2019
2049
|
justifyContent: "center"
|
|
2020
2050
|
},
|
|
2021
2051
|
children: [
|
|
2022
|
-
/* @__PURE__ */
|
|
2052
|
+
/* @__PURE__ */ e(Pe, {
|
|
2023
2053
|
onChange: async ({ response: b }) => {
|
|
2024
|
-
const
|
|
2025
|
-
let
|
|
2026
|
-
|
|
2054
|
+
const c = b?.data?.url || b?.data?.fileUrl;
|
|
2055
|
+
let v;
|
|
2056
|
+
c && (v = await ue(c).catch(() => pe(c)).catch(() => {
|
|
2027
2057
|
}));
|
|
2028
2058
|
let w = b?.data?.filename || "";
|
|
2029
2059
|
w && (w = `mediakit://${w}`), s?.({
|
|
2030
|
-
url:
|
|
2060
|
+
url: c,
|
|
2031
2061
|
mediaKitUrl: w,
|
|
2032
|
-
width:
|
|
2033
|
-
height:
|
|
2062
|
+
width: v?.naturalWidth,
|
|
2063
|
+
height: v?.naturalHeight
|
|
2034
2064
|
});
|
|
2035
2065
|
}
|
|
2036
2066
|
}),
|
|
2037
|
-
/* @__PURE__ */
|
|
2067
|
+
/* @__PURE__ */ e(B, { title: "If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.", children: /* @__PURE__ */ e(Be, { sx: { cursor: "default", mr: 1 }, fontSize: "small" }) })
|
|
2038
2068
|
]
|
|
2039
2069
|
})
|
|
2040
2070
|
} : void 0
|
|
2041
2071
|
}
|
|
2042
2072
|
});
|
|
2043
2073
|
}
|
|
2044
|
-
return t.type === "array" ? /* @__PURE__ */
|
|
2074
|
+
return t.type === "array" ? /* @__PURE__ */ e(et, {
|
|
2045
2075
|
label: o,
|
|
2046
2076
|
value: Array.isArray(i) ? i : [],
|
|
2047
2077
|
onChange: (n) => s?.(n),
|
|
2048
2078
|
property: t,
|
|
2049
|
-
renderItem: ({ item: n, index:
|
|
2079
|
+
renderItem: ({ item: n, index: m, onChange: b }) => t.subProperties && Object.keys(t.subProperties).length > 0 ? /* @__PURE__ */ e(k, {
|
|
2050
2080
|
sx: {
|
|
2051
2081
|
gap: 1,
|
|
2052
2082
|
width: "100%"
|
|
2053
2083
|
},
|
|
2054
|
-
children: T(Object.values(t.subProperties), "index").filter((
|
|
2055
|
-
component:
|
|
2056
|
-
property:
|
|
2057
|
-
value: n[
|
|
2058
|
-
onChange: (
|
|
2059
|
-
const w = { ...n, [
|
|
2084
|
+
children: T(Object.values(t.subProperties), "index").filter((c) => c.data.visible !== !1).map(({ data: c }) => c.key ? /* @__PURE__ */ e(F, {
|
|
2085
|
+
component: r,
|
|
2086
|
+
property: c,
|
|
2087
|
+
value: n[c.key],
|
|
2088
|
+
onChange: (v) => {
|
|
2089
|
+
const w = { ...n, [c.key]: v };
|
|
2060
2090
|
b(w);
|
|
2061
2091
|
},
|
|
2062
2092
|
size: "small",
|
|
2063
2093
|
fullWidth: !0,
|
|
2064
2094
|
defaultLocale: p,
|
|
2065
2095
|
allComponents: u
|
|
2066
|
-
},
|
|
2067
|
-
},
|
|
2096
|
+
}, c.id) : null)
|
|
2097
|
+
}, m) : /* @__PURE__ */ e(R, { size: y.size, fullWidth: !0, value: n, onChange: (c) => b(c.target.value) })
|
|
2068
2098
|
}) : (console.error("Unsupported property type", t.type), null);
|
|
2069
2099
|
}
|
|
2070
|
-
function
|
|
2071
|
-
const { getInputProps: i } =
|
|
2072
|
-
return /* @__PURE__ */
|
|
2100
|
+
function vt({ NumberProps: r, ...t }) {
|
|
2101
|
+
const { getInputProps: i } = yr(r), s = i();
|
|
2102
|
+
return /* @__PURE__ */ e(R, {
|
|
2073
2103
|
...t,
|
|
2074
2104
|
slotProps: {
|
|
2075
2105
|
htmlInput: s
|
|
2076
2106
|
}
|
|
2077
2107
|
});
|
|
2078
2108
|
}
|
|
2079
|
-
const
|
|
2109
|
+
const xt = `import React from '@blocklet/pages-kit/builtin/react'
|
|
2080
2110
|
import { Box } from '@blocklet/pages-kit/builtin/mui/material'
|
|
2081
2111
|
|
|
2082
2112
|
export default function () {
|
|
@@ -2087,193 +2117,193 @@ export default function () {
|
|
|
2087
2117
|
)
|
|
2088
2118
|
}`, Ct = `console.log('hello')
|
|
2089
2119
|
`;
|
|
2090
|
-
function Pt({ value:
|
|
2091
|
-
const { locale: t } =
|
|
2092
|
-
return
|
|
2093
|
-
|
|
2094
|
-
|
|
2120
|
+
function Pt({ value: r }) {
|
|
2121
|
+
const { locale: t } = V(), i = Te(), s = q(r).doc;
|
|
2122
|
+
return M(() => {
|
|
2123
|
+
r.renderer?.script || (s.transact(() => {
|
|
2124
|
+
r.renderer.script = r.renderer.type === "react-component" ? xt : Ct;
|
|
2095
2125
|
}), i());
|
|
2096
|
-
}, [
|
|
2097
|
-
keyId:
|
|
2126
|
+
}, [r]), /* @__PURE__ */ e(P, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ e(Ce, {
|
|
2127
|
+
keyId: r.id,
|
|
2098
2128
|
locale: t,
|
|
2099
2129
|
language: "typescript",
|
|
2100
|
-
value:
|
|
2101
|
-
onChange: (
|
|
2130
|
+
value: r.renderer.script || "",
|
|
2131
|
+
onChange: (f) => r.renderer.script = f,
|
|
2102
2132
|
typeScriptNoValidation: !1,
|
|
2103
2133
|
fullScreenOptions: {
|
|
2104
2134
|
enableEscExit: !0
|
|
2105
2135
|
}
|
|
2106
|
-
},
|
|
2136
|
+
}, r.id) });
|
|
2107
2137
|
}
|
|
2108
|
-
function kt({ value:
|
|
2109
|
-
const { t } =
|
|
2110
|
-
return /* @__PURE__ */
|
|
2138
|
+
function kt({ value: r }) {
|
|
2139
|
+
const { t } = V(), i = q(r).doc, { state: { components: s, config: { defaultLocale: f }, resources: p }, localState: { currentLocale: u } } = le(), y = xe(), h = s[r.renderer.componentId]?.data ?? p.components?.[r.renderer.componentId]?.component, a = ke({ variant: "dialog" });
|
|
2140
|
+
return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ x(k, {
|
|
2111
2141
|
sx: {
|
|
2112
2142
|
gap: 1
|
|
2113
2143
|
},
|
|
2114
2144
|
children: [
|
|
2115
|
-
/* @__PURE__ */
|
|
2145
|
+
/* @__PURE__ */ e(Se, {
|
|
2116
2146
|
allComponents: y,
|
|
2117
|
-
excludes: [
|
|
2118
|
-
value:
|
|
2119
|
-
onChange: (
|
|
2147
|
+
excludes: [r.id],
|
|
2148
|
+
value: r.renderer.componentId,
|
|
2149
|
+
onChange: (d, l) => r.renderer.componentId = l
|
|
2120
2150
|
}),
|
|
2121
|
-
|
|
2122
|
-
/* @__PURE__ */
|
|
2151
|
+
h && /* @__PURE__ */ x(L, { children: [
|
|
2152
|
+
/* @__PURE__ */ x(k, {
|
|
2123
2153
|
direction: "row",
|
|
2124
2154
|
sx: {
|
|
2125
2155
|
justifyContent: "space-between",
|
|
2126
2156
|
alignItems: "center"
|
|
2127
2157
|
},
|
|
2128
2158
|
children: [
|
|
2129
|
-
/* @__PURE__ */
|
|
2130
|
-
/* @__PURE__ */
|
|
2159
|
+
/* @__PURE__ */ e(D, { variant: "subtitle2", children: t("parameters") }),
|
|
2160
|
+
/* @__PURE__ */ e(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...we(a), children: /* @__PURE__ */ e(Ue, { fontSize: "small" }) })
|
|
2131
2161
|
]
|
|
2132
2162
|
}),
|
|
2133
|
-
|
|
2163
|
+
h.properties && T(Object.values(h.properties), "index").map(({ data: d }) => /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(F, {
|
|
2134
2164
|
allComponents: y,
|
|
2135
|
-
defaultLocale:
|
|
2136
|
-
component:
|
|
2137
|
-
property:
|
|
2165
|
+
defaultLocale: f,
|
|
2166
|
+
component: h,
|
|
2167
|
+
property: d,
|
|
2138
2168
|
fullWidth: !0,
|
|
2139
2169
|
size: "small",
|
|
2140
|
-
valueImmutable:
|
|
2141
|
-
value:
|
|
2170
|
+
valueImmutable: oe(r.renderer.properties?.[d.id]?.locales?.[u]?.value),
|
|
2171
|
+
value: r.renderer.properties?.[d.id]?.locales?.[u]?.value ?? r.renderer.properties?.[d.id]?.locales?.[f]?.value ?? d.locales?.[u]?.defaultValue ?? d.locales?.[f]?.defaultValue,
|
|
2142
2172
|
onChange: (l) => {
|
|
2143
2173
|
i.transact(() => {
|
|
2144
|
-
|
|
2174
|
+
r.renderer.properties ??= {}, r.renderer.properties[d.id] ??= {}, r.renderer.properties[d.id].locales ??= {}, r.renderer.properties[d.id].locales[u] ??= {}, r.renderer.properties[d.id].locales[u].value = l;
|
|
2145
2175
|
});
|
|
2146
2176
|
}
|
|
2147
|
-
}) },
|
|
2148
|
-
/* @__PURE__ */
|
|
2177
|
+
}) }, d.id)),
|
|
2178
|
+
/* @__PURE__ */ e(Ye, { ...Fe(a), component: r, type: "parameters" })
|
|
2149
2179
|
] })
|
|
2150
2180
|
]
|
|
2151
2181
|
}) });
|
|
2152
2182
|
}
|
|
2153
|
-
function Se({ label:
|
|
2154
|
-
const { t: y } =
|
|
2155
|
-
return /* @__PURE__ */
|
|
2183
|
+
function Se({ label: r, options: t, excludes: i, value: s, onChange: f, allComponents: p, ...u }) {
|
|
2184
|
+
const { t: y } = V(), h = t ?? T(Object.values(Dr(p, ...i ?? [])), "index").map((d) => d.data), a = (typeof s == "string" ? p[s]?.data : void 0) ?? null;
|
|
2185
|
+
return /* @__PURE__ */ e(De, {
|
|
2156
2186
|
...u,
|
|
2157
2187
|
size: "small",
|
|
2158
|
-
options:
|
|
2188
|
+
options: h,
|
|
2159
2189
|
autoHighlight: !0,
|
|
2160
|
-
isOptionEqualToValue: (
|
|
2161
|
-
getOptionKey: (
|
|
2162
|
-
getOptionLabel: (
|
|
2163
|
-
renderInput: (
|
|
2164
|
-
value:
|
|
2165
|
-
onChange: (
|
|
2190
|
+
isOptionEqualToValue: (d, l) => d.id === l.id,
|
|
2191
|
+
getOptionKey: (d) => d.id,
|
|
2192
|
+
getOptionLabel: (d) => d.name || d.id,
|
|
2193
|
+
renderInput: (d) => /* @__PURE__ */ e(R, { label: r || y("component"), ...d }),
|
|
2194
|
+
value: a,
|
|
2195
|
+
onChange: (d, l) => {
|
|
2166
2196
|
let o = {};
|
|
2167
2197
|
l && (o = {
|
|
2168
2198
|
blockletId: p[l?.id]?.blockletId,
|
|
2169
2199
|
blockletTitle: p[l?.id]?.blockletTitle,
|
|
2170
2200
|
componentName: p[l?.id]?.data?.name || p[l?.id]?.data?.id
|
|
2171
|
-
}),
|
|
2201
|
+
}), f?.(d, l?.id, o);
|
|
2172
2202
|
}
|
|
2173
2203
|
});
|
|
2174
2204
|
}
|
|
2175
|
-
function
|
|
2176
|
-
const { t: y } =
|
|
2177
|
-
|
|
2205
|
+
function qe({ config: r, allComponents: t, defaultLocale: i, propertiesValue: s, currentLocale: f, onChange: p, props: u }) {
|
|
2206
|
+
const { t: y } = V(), [h, a] = K(he(r?.properties)), [d, l] = K(null);
|
|
2207
|
+
M(() => {
|
|
2178
2208
|
(() => {
|
|
2179
|
-
|
|
2180
|
-
const w =
|
|
2181
|
-
|
|
2182
|
-
}) :
|
|
2209
|
+
r?.renderer?.type === "react-component" && U(r?.properties) ? fr(r?.renderer?.script).then((v) => {
|
|
2210
|
+
const w = br(v);
|
|
2211
|
+
a(w);
|
|
2212
|
+
}) : a(he(r?.properties));
|
|
2183
2213
|
})();
|
|
2184
|
-
}, [JSON.stringify(
|
|
2185
|
-
const o = W(() => !
|
|
2186
|
-
const w =
|
|
2187
|
-
return
|
|
2214
|
+
}, [JSON.stringify(r)]);
|
|
2215
|
+
const o = W(() => !r || !h ? {} : Object.values(h).reduce((c, { data: v }) => {
|
|
2216
|
+
const w = v.key || v.id;
|
|
2217
|
+
return c[v.id] = {
|
|
2188
2218
|
key: w,
|
|
2189
|
-
value: u?.[w] ?? s?.[
|
|
2190
|
-
id:
|
|
2191
|
-
type:
|
|
2192
|
-
visible:
|
|
2193
|
-
shared:
|
|
2194
|
-
},
|
|
2195
|
-
}, {}), [JSON.stringify(
|
|
2196
|
-
if (!
|
|
2219
|
+
value: u?.[w] ?? s?.[v.id]?.value ?? v.locales?.[f]?.defaultValue ?? v.locales?.[i]?.defaultValue,
|
|
2220
|
+
id: v.id,
|
|
2221
|
+
type: v.type,
|
|
2222
|
+
visible: ee(h, v.id),
|
|
2223
|
+
shared: _e(h, v.id)
|
|
2224
|
+
}, c;
|
|
2225
|
+
}, {}), [JSON.stringify(h), r, s, f, i]), n = $(() => {
|
|
2226
|
+
if (!h)
|
|
2197
2227
|
return {
|
|
2198
2228
|
canUseProperties: [],
|
|
2199
2229
|
visibleProperties: [],
|
|
2200
2230
|
canUsePropertiesKeys: []
|
|
2201
2231
|
};
|
|
2202
|
-
const
|
|
2232
|
+
const c = T(Object.values(h), "index"), v = c.filter(({ data: S }) => S.key && ee(h, S.id)), w = c.filter(({ data: S }) => S.key && S.type !== "component"), N = w.map(({ data: S }) => S.key);
|
|
2203
2233
|
return {
|
|
2204
2234
|
canUseProperties: w,
|
|
2205
|
-
visibleProperties:
|
|
2235
|
+
visibleProperties: v,
|
|
2206
2236
|
canUsePropertiesKeys: N
|
|
2207
2237
|
};
|
|
2208
|
-
}, [JSON.stringify(
|
|
2209
|
-
return /* @__PURE__ */
|
|
2238
|
+
}, [JSON.stringify(h)]), m = o(), b = Er(m, "key");
|
|
2239
|
+
return /* @__PURE__ */ e(ae, { children: /* @__PURE__ */ x(k, {
|
|
2210
2240
|
sx: {
|
|
2211
2241
|
gap: 2
|
|
2212
2242
|
},
|
|
2213
2243
|
children: [
|
|
2214
|
-
/* @__PURE__ */
|
|
2215
|
-
!
|
|
2216
|
-
/* @__PURE__ */
|
|
2244
|
+
/* @__PURE__ */ e(D, { variant: "subtitle1", children: y("maker.properties.parameters") }),
|
|
2245
|
+
!r || n.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ e(Y, { style: { fontSize: 12 }, children: y("maker.properties.noParameters") }) : /* @__PURE__ */ x(L, { children: [
|
|
2246
|
+
/* @__PURE__ */ e(k, {
|
|
2217
2247
|
sx: {
|
|
2218
2248
|
gap: 2
|
|
2219
2249
|
},
|
|
2220
|
-
children: n.visibleProperties.map(({ data:
|
|
2250
|
+
children: n.visibleProperties.map(({ data: c }) => /* @__PURE__ */ e(P, { children: /* @__PURE__ */ e(F, {
|
|
2221
2251
|
allComponents: t,
|
|
2222
2252
|
defaultLocale: i,
|
|
2223
2253
|
size: "small",
|
|
2224
2254
|
fullWidth: !0,
|
|
2225
|
-
component:
|
|
2226
|
-
property:
|
|
2227
|
-
valueImmutable:
|
|
2228
|
-
value: u?.[
|
|
2229
|
-
onChange: (
|
|
2255
|
+
component: r,
|
|
2256
|
+
property: c,
|
|
2257
|
+
valueImmutable: oe(s?.[c.id]?.value),
|
|
2258
|
+
value: u?.[c.key || c.id] ?? m[c.id]?.value,
|
|
2259
|
+
onChange: (v) => {
|
|
2230
2260
|
p({
|
|
2231
|
-
path: ["properties",
|
|
2232
|
-
id:
|
|
2233
|
-
value: { value:
|
|
2234
|
-
shouldSync:
|
|
2261
|
+
path: ["properties", c.id],
|
|
2262
|
+
id: c.id,
|
|
2263
|
+
value: { value: v },
|
|
2264
|
+
shouldSync: Ie(c),
|
|
2235
2265
|
excludeKeys: [],
|
|
2236
|
-
key:
|
|
2266
|
+
key: c.key || c.id
|
|
2237
2267
|
});
|
|
2238
2268
|
}
|
|
2239
|
-
}) },
|
|
2269
|
+
}) }, c.id))
|
|
2240
2270
|
}),
|
|
2241
|
-
/* @__PURE__ */
|
|
2271
|
+
/* @__PURE__ */ e(k, {
|
|
2242
2272
|
sx: {
|
|
2243
2273
|
gap: 2,
|
|
2244
2274
|
width: "100%"
|
|
2245
2275
|
},
|
|
2246
|
-
children: /* @__PURE__ */
|
|
2247
|
-
componentId:
|
|
2276
|
+
children: /* @__PURE__ */ e(Ke, {
|
|
2277
|
+
componentId: r?.id || "",
|
|
2248
2278
|
renderType: "setting",
|
|
2249
|
-
locale:
|
|
2250
|
-
properties:
|
|
2279
|
+
locale: f,
|
|
2280
|
+
properties: m,
|
|
2251
2281
|
dev: { mode: "draft", components: t, defaultLocale: i },
|
|
2252
2282
|
props: {
|
|
2253
|
-
...
|
|
2254
|
-
onChange: (
|
|
2255
|
-
const { canUsePropertiesKeys:
|
|
2256
|
-
Object.keys(
|
|
2257
|
-
const I = b[S], z =
|
|
2283
|
+
...Tr(u ?? {}, n.canUsePropertiesKeys),
|
|
2284
|
+
onChange: (c) => {
|
|
2285
|
+
const { canUsePropertiesKeys: v } = n;
|
|
2286
|
+
Object.keys(c).filter((N) => !Vr(c[N], b?.[N]?.value)).filter((N) => !(N === "locale" && !Rr(b[N], "locale") || b[N]?.type === "component" || (b[N]?.type === "yaml" || b[N]?.type === "json") && ee(h, b[N]?.id))).reduce((N, S) => N.then(() => {
|
|
2287
|
+
const I = b[S], z = v.includes(S);
|
|
2258
2288
|
if (I?.id && z)
|
|
2259
2289
|
return p({
|
|
2260
2290
|
path: ["properties", I.id],
|
|
2261
2291
|
id: I.id,
|
|
2262
|
-
value: { value:
|
|
2263
|
-
shouldSync:
|
|
2292
|
+
value: { value: c[S] },
|
|
2293
|
+
shouldSync: Ie(I),
|
|
2264
2294
|
excludeKeys: [],
|
|
2265
2295
|
key: I.key || I.id
|
|
2266
2296
|
}), Promise.resolve();
|
|
2267
2297
|
const g = `propertyNotFound${S}`;
|
|
2268
|
-
if (
|
|
2298
|
+
if (d === g)
|
|
2269
2299
|
return Promise.resolve();
|
|
2270
|
-
fe.close(
|
|
2271
|
-
const
|
|
2300
|
+
fe.close(d);
|
|
2301
|
+
const C = fe.warning(y("maker.properties.propertyNotFound", {
|
|
2272
2302
|
key: S
|
|
2273
2303
|
}), {
|
|
2274
2304
|
key: g
|
|
2275
2305
|
});
|
|
2276
|
-
return l(
|
|
2306
|
+
return l(C), Promise.resolve();
|
|
2277
2307
|
}), Promise.resolve());
|
|
2278
2308
|
}
|
|
2279
2309
|
}
|
|
@@ -2281,20 +2311,20 @@ function Qe({ config: e, allComponents: t, defaultLocale: i, propertiesValue: s,
|
|
|
2281
2311
|
})
|
|
2282
2312
|
] })
|
|
2283
2313
|
]
|
|
2284
|
-
},
|
|
2314
|
+
}, f) });
|
|
2285
2315
|
}
|
|
2286
|
-
function wt({ config:
|
|
2287
|
-
const { t, locale: i } =
|
|
2288
|
-
|
|
2316
|
+
function wt({ config: r }) {
|
|
2317
|
+
const { t, locale: i } = V(), [s, f] = K(!1), p = (u) => {
|
|
2318
|
+
r.llmConfig = u;
|
|
2289
2319
|
};
|
|
2290
|
-
return /* @__PURE__ */
|
|
2291
|
-
/* @__PURE__ */
|
|
2292
|
-
s && /* @__PURE__ */
|
|
2320
|
+
return /* @__PURE__ */ x(L, { children: [
|
|
2321
|
+
/* @__PURE__ */ e(B, { title: t("maker.properties.configLLMDescription"), children: /* @__PURE__ */ e(G, { color: "primary", onClick: () => f(!0), size: "small", children: /* @__PURE__ */ e(Ir, {}) }) }),
|
|
2322
|
+
s && /* @__PURE__ */ e(ct, {
|
|
2293
2323
|
open: s,
|
|
2294
|
-
onClose: () =>
|
|
2324
|
+
onClose: () => f(!1),
|
|
2295
2325
|
onConfirm: p,
|
|
2296
|
-
component:
|
|
2297
|
-
initialConfig:
|
|
2326
|
+
component: r,
|
|
2327
|
+
initialConfig: r.llmConfig,
|
|
2298
2328
|
locale: i,
|
|
2299
2329
|
defaultLocale: "en",
|
|
2300
2330
|
title: t("maker.properties.llmConfigTitle")
|
|
@@ -2305,9 +2335,9 @@ export {
|
|
|
2305
2335
|
mt as BasicInfo,
|
|
2306
2336
|
Se as CustomComponentAutocomplete,
|
|
2307
2337
|
hn as CustomComponentSettings,
|
|
2308
|
-
|
|
2338
|
+
xt as DefaultReactComponentScriptTemplate,
|
|
2309
2339
|
Ct as DefaultWebComponentScriptTemplate,
|
|
2310
|
-
|
|
2340
|
+
qe as ParametersConfig,
|
|
2311
2341
|
ft as PropertiesConfig,
|
|
2312
|
-
|
|
2342
|
+
F as PropertyValueField
|
|
2313
2343
|
};
|