@blocklet/pages-kit-inner-components 0.4.84 → 0.4.85
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/setting.js +3 -3
- package/lib/es/setting.js +562 -562
- package/package.json +3 -3
package/lib/es/setting.js
CHANGED
|
@@ -1,34 +1,34 @@
|
|
|
1
1
|
import { jsx as t, jsxs as S, Fragment as H } from "react/jsx-runtime";
|
|
2
|
-
import { t as
|
|
2
|
+
import { t as xe, g as oe, i as Je, b as $e, h as ae, E as yt, n as Me, j as ge } from "./chunks/state-DqChB5ys.js";
|
|
3
3
|
import Z from "@arcblock/ux/lib/Empty";
|
|
4
4
|
import { useLocaleContext as N } from "@arcblock/ux/lib/Locale/context";
|
|
5
|
-
import { CodeEditor as
|
|
5
|
+
import { CodeEditor as we } from "@blocklet/code-editor";
|
|
6
6
|
import vt from "@mui/icons-material/AddRounded";
|
|
7
7
|
import xt from "@mui/icons-material/ArrowDownward";
|
|
8
8
|
import gt from "@mui/icons-material/ArrowUpward";
|
|
9
|
-
import
|
|
10
|
-
import { Typography as J, TextField as D, Stack as
|
|
9
|
+
import wt from "@mui/icons-material/DeleteOutline";
|
|
10
|
+
import { Typography as J, TextField as D, Stack as z, FormLabel as ne, Box as j, TableContainer as kt, Paper as ee, Table as He, TableHead as Ye, TableRow as le, TableCell as se, TableBody as Le, Button as T, IconButton as ue, FormControlLabel as Ge, Switch as qe, InputAdornment as pe, Dialog as ke, DialogTitle as Qe, DialogContent as Xe, DialogActions as Ze, alpha as Pt, Tooltip as X, buttonClasses as It, Autocomplete as et, MenuItem as me, Collapse as St, Divider as Ot, Popper as jt } from "@mui/material";
|
|
11
11
|
import V from "lodash/sortBy";
|
|
12
|
-
import { useCallback as A, useMemo as ce, forwardRef as
|
|
13
|
-
import { useUpdate as
|
|
12
|
+
import { useCallback as A, useMemo as ce, forwardRef as tt, useState as $, useEffect as M, useImperativeHandle as rt, lazy as zt, Suspense as Rt, useRef as F, useId as Ct } from "react";
|
|
13
|
+
import { useUpdate as it, useDebounce as Dt } from "react-use";
|
|
14
14
|
import { styled as Nt } from "@arcblock/ux/lib/Theme";
|
|
15
15
|
import { cx as At } from "@emotion/css";
|
|
16
16
|
import { useReactive as Tt, useBoolean as Vt, useUpdate as Et } from "ahooks";
|
|
17
|
-
import
|
|
17
|
+
import We from "gradient-parser";
|
|
18
18
|
import "lodash/without";
|
|
19
19
|
import Ut from "tinycolor2";
|
|
20
20
|
import { red as Wt, pink as Bt, purple as Kt, indigo as Ft, blue as _t, cyan as Jt, teal as $t, green as Mt, lime as Ht, yellow as Yt, amber as Lt, orange as Gt, brown as qt, grey as Qt, blueGrey as Xt } from "@mui/material/colors";
|
|
21
|
-
import { getImageSize as fe, getVideoSize as he, UploaderButton as
|
|
21
|
+
import { getImageSize as fe, getVideoSize as he, UploaderButton as Pe, UploaderProvider as Ie, useUploader as Zt } from "./uploader.js";
|
|
22
22
|
import { Icon as er } from "@iconify-icon/react";
|
|
23
|
-
import
|
|
24
|
-
import
|
|
23
|
+
import ot from "lodash/isEmpty";
|
|
24
|
+
import nt from "lodash/set";
|
|
25
25
|
import * as be from "yaml";
|
|
26
26
|
import { cloneDeep as tr } from "lodash";
|
|
27
|
-
import
|
|
28
|
-
import { CustomComponentRenderer as
|
|
27
|
+
import Be from "@arcblock/ux/lib/Toast";
|
|
28
|
+
import { CustomComponentRenderer as lt, transpileAndLoadScript as rr, getPropertiesFromCode as ir } from "@blocklet/pages-kit/components";
|
|
29
29
|
import { unstable_useNumberInput as or, ClickAwayListener as nr } from "@mui/base";
|
|
30
|
-
import { VisibilityOffRounded as lr, VisibilityRounded as sr, DeleteOutlineRounded as cr, DragIndicatorRounded as dr, TranslateRounded as
|
|
31
|
-
import { alpha as
|
|
30
|
+
import { VisibilityOffRounded as lr, VisibilityRounded as sr, DeleteOutlineRounded as cr, DragIndicatorRounded as dr, TranslateRounded as st, AddRounded as ct, InfoRounded as dt, StarRounded as ar, SettingsRounded as at } from "@mui/icons-material";
|
|
31
|
+
import { alpha as Ke } from "@mui/material/styles";
|
|
32
32
|
import { getYjsValue as te } from "@syncedstore/core";
|
|
33
33
|
import ur from "lodash/assign";
|
|
34
34
|
import pr from "lodash/has";
|
|
@@ -38,18 +38,18 @@ import fr from "lodash/keyBy";
|
|
|
38
38
|
import hr from "lodash/omit";
|
|
39
39
|
import br from "lodash/pick";
|
|
40
40
|
import yr from "lodash/reduce";
|
|
41
|
-
import { usePopupState as
|
|
41
|
+
import { usePopupState as Se, bindTrigger as Oe, bindDialog as ut, bindPopper as vr } from "material-ui-popup-state/hooks";
|
|
42
42
|
import { ErrorBoundary as xr } from "react-error-boundary";
|
|
43
|
-
import { useDrop as
|
|
44
|
-
function
|
|
43
|
+
import { useDrop as pt, useDrag as gr } from "react-dnd";
|
|
44
|
+
function wr({
|
|
45
45
|
onClick: e,
|
|
46
46
|
disabled: r,
|
|
47
47
|
sx: o,
|
|
48
48
|
...i
|
|
49
49
|
}) {
|
|
50
|
-
return /* @__PURE__ */ t(ue, { size: "small", color: "warning", variant: "outlined", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(
|
|
50
|
+
return /* @__PURE__ */ t(ue, { size: "small", color: "warning", variant: "outlined", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(wt, { fontSize: "small" }) });
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function kr({
|
|
53
53
|
onClick: e,
|
|
54
54
|
disabled: r,
|
|
55
55
|
sx: o,
|
|
@@ -70,75 +70,75 @@ function Ir({
|
|
|
70
70
|
value: r,
|
|
71
71
|
onChange: o,
|
|
72
72
|
disabled: i = !1,
|
|
73
|
-
itemLabel:
|
|
73
|
+
itemLabel: u = "",
|
|
74
74
|
emptyHeight: p = 40,
|
|
75
75
|
property: d,
|
|
76
76
|
renderItem: m,
|
|
77
|
-
...
|
|
77
|
+
...w
|
|
78
78
|
}) {
|
|
79
|
-
const { t:
|
|
80
|
-
(
|
|
81
|
-
o(
|
|
79
|
+
const { t: x, locale: g } = N(), h = it(), n = A(
|
|
80
|
+
(f) => {
|
|
81
|
+
o(xe(f, d.type));
|
|
82
82
|
},
|
|
83
83
|
[o, d.type]
|
|
84
84
|
), s = ce(() => Array.isArray(r) ? r : [], [r]), l = A(() => {
|
|
85
|
-
const
|
|
86
|
-
n(
|
|
87
|
-
}, [s, n,
|
|
85
|
+
const f = [...s, ""];
|
|
86
|
+
n(f), h();
|
|
87
|
+
}, [s, n, h]), a = A(() => {
|
|
88
88
|
if (!d || !d.subProperties)
|
|
89
89
|
return l();
|
|
90
|
-
const
|
|
90
|
+
const f = {};
|
|
91
91
|
V(Object.values(d.subProperties), "index").forEach(({ data: C }) => {
|
|
92
92
|
var U, W;
|
|
93
93
|
if (!C.key) return;
|
|
94
94
|
const E = ((W = (U = C.locales) == null ? void 0 : U[g]) == null ? void 0 : W.defaultValue) ?? "";
|
|
95
|
-
|
|
95
|
+
f[C.key] = E;
|
|
96
96
|
});
|
|
97
|
-
const R = [...s,
|
|
98
|
-
n(R),
|
|
99
|
-
}, [s, n,
|
|
100
|
-
(
|
|
97
|
+
const R = [...s, f];
|
|
98
|
+
n(R), h();
|
|
99
|
+
}, [s, n, h, d, g, l]), b = A(
|
|
100
|
+
(f) => {
|
|
101
101
|
try {
|
|
102
|
-
const I = JSON.parse(
|
|
102
|
+
const I = JSON.parse(f);
|
|
103
103
|
Array.isArray(I) ? n(I) : console.error("JSON解析结果不是数组");
|
|
104
104
|
} catch (I) {
|
|
105
105
|
console.error("JSON解析错误:", I);
|
|
106
106
|
}
|
|
107
107
|
},
|
|
108
108
|
[n]
|
|
109
|
-
),
|
|
110
|
-
(
|
|
111
|
-
const I = s.filter((R, C) => C !==
|
|
112
|
-
n(I),
|
|
109
|
+
), P = A(
|
|
110
|
+
(f) => {
|
|
111
|
+
const I = s.filter((R, C) => C !== f);
|
|
112
|
+
n(I), h();
|
|
113
113
|
},
|
|
114
|
-
[s, n,
|
|
114
|
+
[s, n, h]
|
|
115
115
|
), c = A(
|
|
116
|
-
(
|
|
117
|
-
if (
|
|
118
|
-
const I = [...s], R = I[
|
|
119
|
-
I[
|
|
116
|
+
(f) => {
|
|
117
|
+
if (f <= 0) return;
|
|
118
|
+
const I = [...s], R = I[f];
|
|
119
|
+
I[f] = I[f - 1], I[f - 1] = R, n(I), h();
|
|
120
120
|
},
|
|
121
|
-
[s, n,
|
|
122
|
-
),
|
|
123
|
-
(
|
|
124
|
-
if (
|
|
125
|
-
const I = [...s], R = I[
|
|
126
|
-
I[
|
|
121
|
+
[s, n, h]
|
|
122
|
+
), v = A(
|
|
123
|
+
(f) => {
|
|
124
|
+
if (f >= s.length - 1) return;
|
|
125
|
+
const I = [...s], R = I[f];
|
|
126
|
+
I[f] = I[f + 1], I[f + 1] = R, n(I), h();
|
|
127
127
|
},
|
|
128
|
-
[s, n,
|
|
129
|
-
),
|
|
130
|
-
(
|
|
128
|
+
[s, n, h]
|
|
129
|
+
), y = A(
|
|
130
|
+
(f, I) => {
|
|
131
131
|
const R = [...s];
|
|
132
|
-
R[
|
|
132
|
+
R[f] = I, n(R);
|
|
133
133
|
},
|
|
134
134
|
[s, n]
|
|
135
|
-
),
|
|
135
|
+
), k = d && d.subProperties && Object.keys(d.subProperties).length > 0, O = ce(() => [
|
|
136
136
|
{
|
|
137
137
|
field: "index",
|
|
138
138
|
headerName: "#",
|
|
139
139
|
width: 40,
|
|
140
140
|
align: "center",
|
|
141
|
-
renderCell: ({ index:
|
|
141
|
+
renderCell: ({ index: f }) => /* @__PURE__ */ t(
|
|
142
142
|
J,
|
|
143
143
|
{
|
|
144
144
|
variant: "body1",
|
|
@@ -152,28 +152,28 @@ function Ir({
|
|
|
152
152
|
justifyContent: "center",
|
|
153
153
|
color: "text.secondary"
|
|
154
154
|
},
|
|
155
|
-
children:
|
|
155
|
+
children: f + 1
|
|
156
156
|
}
|
|
157
157
|
)
|
|
158
158
|
},
|
|
159
159
|
{
|
|
160
160
|
field: "content",
|
|
161
161
|
headerName: "",
|
|
162
|
-
renderCell: ({ row:
|
|
163
|
-
item:
|
|
162
|
+
renderCell: ({ row: f, index: I }) => m && k ? m({
|
|
163
|
+
item: f,
|
|
164
164
|
index: I,
|
|
165
165
|
property: d,
|
|
166
|
-
onChange: (R) =>
|
|
166
|
+
onChange: (R) => y(I, R)
|
|
167
167
|
}) : /* @__PURE__ */ t(
|
|
168
168
|
D,
|
|
169
169
|
{
|
|
170
170
|
fullWidth: !0,
|
|
171
171
|
size: "small",
|
|
172
172
|
disabled: i,
|
|
173
|
-
value:
|
|
174
|
-
placeholder:
|
|
175
|
-
onChange: (R) =>
|
|
176
|
-
...
|
|
173
|
+
value: f,
|
|
174
|
+
placeholder: u || `${x("item")} ${I + 1}`,
|
|
175
|
+
onChange: (R) => y(I, R.target.value),
|
|
176
|
+
...w
|
|
177
177
|
}
|
|
178
178
|
)
|
|
179
179
|
},
|
|
@@ -183,36 +183,36 @@ function Ir({
|
|
|
183
183
|
width: 30,
|
|
184
184
|
// 增加宽度以容纳更多按钮
|
|
185
185
|
align: "center",
|
|
186
|
-
renderCell: ({ index:
|
|
187
|
-
/* @__PURE__ */ t(
|
|
186
|
+
renderCell: ({ index: f }) => /* @__PURE__ */ S(z, { direction: "column", spacing: 0.25, children: [
|
|
187
|
+
/* @__PURE__ */ t(kr, { disabled: i || f === 0, onClick: () => c(f) }),
|
|
188
188
|
/* @__PURE__ */ t(
|
|
189
189
|
Pr,
|
|
190
190
|
{
|
|
191
|
-
disabled: i ||
|
|
192
|
-
onClick: () =>
|
|
191
|
+
disabled: i || f === s.length - 1,
|
|
192
|
+
onClick: () => v(f)
|
|
193
193
|
}
|
|
194
194
|
),
|
|
195
|
-
/* @__PURE__ */ t(
|
|
195
|
+
/* @__PURE__ */ t(wr, { disabled: i, onClick: () => P(f) })
|
|
196
196
|
] })
|
|
197
197
|
}
|
|
198
198
|
], [
|
|
199
199
|
m,
|
|
200
|
-
|
|
200
|
+
k,
|
|
201
201
|
d,
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
202
|
+
y,
|
|
203
|
+
u,
|
|
204
|
+
x,
|
|
205
205
|
i,
|
|
206
|
-
k,
|
|
207
206
|
w,
|
|
207
|
+
P,
|
|
208
208
|
c,
|
|
209
|
-
|
|
209
|
+
v,
|
|
210
210
|
s.length
|
|
211
211
|
]);
|
|
212
|
-
return
|
|
212
|
+
return k ? /* @__PURE__ */ S(z, { width: "100%", gap: 1, children: [
|
|
213
213
|
e && /* @__PURE__ */ t(ne, { children: e }),
|
|
214
|
-
s.length > 0 ? /* @__PURE__ */ t(
|
|
215
|
-
|
|
214
|
+
s.length > 0 ? /* @__PURE__ */ t(kt, { component: ee, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ S(
|
|
215
|
+
He,
|
|
216
216
|
{
|
|
217
217
|
size: "small",
|
|
218
218
|
sx: {
|
|
@@ -229,17 +229,17 @@ function Ir({
|
|
|
229
229
|
borderCollapse: "collapse"
|
|
230
230
|
},
|
|
231
231
|
children: [
|
|
232
|
-
/* @__PURE__ */ t(
|
|
232
|
+
/* @__PURE__ */ t(Ye, { sx: { display: "none" }, children: /* @__PURE__ */ t(le, { children: O.map((f) => /* @__PURE__ */ t(
|
|
233
233
|
se,
|
|
234
234
|
{
|
|
235
|
-
width:
|
|
236
|
-
align:
|
|
235
|
+
width: f.width,
|
|
236
|
+
align: f.align || "left",
|
|
237
237
|
sx: { fontWeight: "bold" },
|
|
238
|
-
children:
|
|
238
|
+
children: f.renderHeader ? f.renderHeader() : f.headerName
|
|
239
239
|
},
|
|
240
|
-
|
|
240
|
+
f.field
|
|
241
241
|
)) }) }),
|
|
242
|
-
/* @__PURE__ */ t(
|
|
242
|
+
/* @__PURE__ */ t(Le, { children: s.map((f, I, R) => /* @__PURE__ */ t(
|
|
243
243
|
le,
|
|
244
244
|
{
|
|
245
245
|
sx: {
|
|
@@ -258,9 +258,9 @@ function Ir({
|
|
|
258
258
|
borderBottom: "none"
|
|
259
259
|
},
|
|
260
260
|
children: C.renderCell({
|
|
261
|
-
row:
|
|
261
|
+
row: f,
|
|
262
262
|
index: I,
|
|
263
|
-
onChange: (E) =>
|
|
263
|
+
onChange: (E) => y(I, E)
|
|
264
264
|
})
|
|
265
265
|
},
|
|
266
266
|
`${I}-${C.field}`
|
|
@@ -270,7 +270,7 @@ function Ir({
|
|
|
270
270
|
)) })
|
|
271
271
|
]
|
|
272
272
|
}
|
|
273
|
-
) }) : /* @__PURE__ */ t(Z, { style: { fontSize: 12, height: p }, children:
|
|
273
|
+
) }) : /* @__PURE__ */ t(Z, { style: { fontSize: 12, height: p }, children: x("maker.properties.arrayEmpty") }),
|
|
274
274
|
/* @__PURE__ */ t(
|
|
275
275
|
T,
|
|
276
276
|
{
|
|
@@ -279,20 +279,20 @@ function Ir({
|
|
|
279
279
|
variant: "outlined",
|
|
280
280
|
disabled: i,
|
|
281
281
|
startIcon: /* @__PURE__ */ t(vt, {}),
|
|
282
|
-
onClick:
|
|
283
|
-
children:
|
|
282
|
+
onClick: a,
|
|
283
|
+
children: x("maker.properties.addArrayItem")
|
|
284
284
|
}
|
|
285
285
|
)
|
|
286
|
-
] }) : /* @__PURE__ */ S(
|
|
286
|
+
] }) : /* @__PURE__ */ S(z, { width: "100%", gap: 1, children: [
|
|
287
287
|
e && /* @__PURE__ */ t(ne, { children: e }),
|
|
288
|
-
/* @__PURE__ */ t(
|
|
289
|
-
|
|
288
|
+
/* @__PURE__ */ t(j, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ t(
|
|
289
|
+
we,
|
|
290
290
|
{
|
|
291
291
|
keyId: d.id,
|
|
292
292
|
locale: g,
|
|
293
293
|
language: "json",
|
|
294
294
|
value: JSON.stringify(s, null, 2),
|
|
295
|
-
onChange: (
|
|
295
|
+
onChange: (f) => b(f || "")
|
|
296
296
|
},
|
|
297
297
|
d.id
|
|
298
298
|
) })
|
|
@@ -303,11 +303,11 @@ Ft[300], _t[300], // lightBlue['300'],
|
|
|
303
303
|
Jt[300], $t[300], Mt[300], // lightGreen['300'],
|
|
304
304
|
Ht[300], Yt[300], Lt[300], Gt[300], // deepOrange['300'],
|
|
305
305
|
qt[300], Qt[300], Xt[300];
|
|
306
|
-
const Sr =
|
|
307
|
-
const [g,
|
|
306
|
+
const Sr = tt(function({ showMarkdown: r, markdown: o, onMarkdownChange: i, showUploader: u, value: p, meta: d, onChange: m, ...w }, x) {
|
|
307
|
+
const [g, h] = $("");
|
|
308
308
|
M(() => {
|
|
309
|
-
|
|
310
|
-
}, [p,
|
|
309
|
+
h(p || "");
|
|
310
|
+
}, [p, h]);
|
|
311
311
|
const n = async () => {
|
|
312
312
|
if (g !== p) {
|
|
313
313
|
const l = oe(g);
|
|
@@ -315,9 +315,9 @@ const Sr = et(function({ showMarkdown: r, markdown: o, onMarkdownChange: i, show
|
|
|
315
315
|
m(g, void 0);
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const a = await fe(l).catch(() => he(l)).catch(() => {
|
|
319
319
|
});
|
|
320
|
-
m(g, { ...
|
|
320
|
+
m(g, { ...a, filename: g });
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
Dt(
|
|
@@ -326,23 +326,23 @@ const Sr = et(function({ showMarkdown: r, markdown: o, onMarkdownChange: i, show
|
|
|
326
326
|
},
|
|
327
327
|
300,
|
|
328
328
|
[g]
|
|
329
|
-
),
|
|
329
|
+
), rt(x, () => ({
|
|
330
330
|
submit: n
|
|
331
331
|
}));
|
|
332
332
|
const s = {};
|
|
333
|
-
return
|
|
333
|
+
return u && (s.InputProps = {
|
|
334
334
|
sx: { pr: 0 },
|
|
335
335
|
endAdornment: /* @__PURE__ */ t(pe, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ t(
|
|
336
|
-
|
|
336
|
+
Pe,
|
|
337
337
|
{
|
|
338
338
|
onChange: async ({ response: l }) => {
|
|
339
339
|
var c;
|
|
340
|
-
const
|
|
341
|
-
let
|
|
342
|
-
|
|
343
|
-
})), m(
|
|
344
|
-
...
|
|
345
|
-
filename:
|
|
340
|
+
const a = (c = l == null ? void 0 : l.data) == null ? void 0 : c.filename, b = oe(a) || "";
|
|
341
|
+
let P = {};
|
|
342
|
+
b && (P = await fe(b).catch(() => he(b)).catch(() => {
|
|
343
|
+
})), m(a, {
|
|
344
|
+
...P,
|
|
345
|
+
filename: a
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
348
|
}
|
|
@@ -352,39 +352,39 @@ const Sr = et(function({ showMarkdown: r, markdown: o, onMarkdownChange: i, show
|
|
|
352
352
|
{
|
|
353
353
|
size: "small",
|
|
354
354
|
fullWidth: !0,
|
|
355
|
-
...
|
|
356
|
-
label: /* @__PURE__ */ S(
|
|
357
|
-
|
|
355
|
+
...w,
|
|
356
|
+
label: /* @__PURE__ */ S(z, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
357
|
+
w.label,
|
|
358
358
|
r && /* @__PURE__ */ S(H, { children: [
|
|
359
359
|
" (",
|
|
360
360
|
/* @__PURE__ */ t(
|
|
361
|
-
|
|
361
|
+
Ge,
|
|
362
362
|
{
|
|
363
363
|
checked: o,
|
|
364
|
-
label: /* @__PURE__ */ t(
|
|
364
|
+
label: /* @__PURE__ */ t(j, { component: er, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
|
|
365
365
|
labelPlacement: "start",
|
|
366
|
-
control: /* @__PURE__ */ t(
|
|
366
|
+
control: /* @__PURE__ */ t(qe, { size: "small" }),
|
|
367
367
|
sx: { ml: 0.25, pr: 1 },
|
|
368
|
-
onChange: (l,
|
|
368
|
+
onChange: (l, a) => i == null ? void 0 : i(a)
|
|
369
369
|
}
|
|
370
370
|
),
|
|
371
371
|
")"
|
|
372
372
|
] })
|
|
373
373
|
] }),
|
|
374
|
-
InputLabelProps: { shrink: !0, ...
|
|
374
|
+
InputLabelProps: { shrink: !0, ...w.InputLabelProps },
|
|
375
375
|
value: g,
|
|
376
|
-
onChange: (l) =>
|
|
376
|
+
onChange: (l) => h(l.target.value),
|
|
377
377
|
...s,
|
|
378
378
|
onKeyDown: (l) => {
|
|
379
379
|
l.keyCode !== 229 && l.key === "Enter" && n();
|
|
380
380
|
}
|
|
381
381
|
}
|
|
382
382
|
);
|
|
383
|
-
}), Or =
|
|
384
|
-
function
|
|
383
|
+
}), Or = zt(() => import("react-best-gradient-color-picker"));
|
|
384
|
+
function jr(e) {
|
|
385
385
|
try {
|
|
386
|
-
const o =
|
|
387
|
-
const p =
|
|
386
|
+
const o = We.parse(e).map((u) => {
|
|
387
|
+
const p = u.colorStops.map((d) => {
|
|
388
388
|
if (d.type !== "rgba") {
|
|
389
389
|
const m = Ut(d.value).toRgb();
|
|
390
390
|
return {
|
|
@@ -396,20 +396,20 @@ function zr(e) {
|
|
|
396
396
|
return d;
|
|
397
397
|
});
|
|
398
398
|
return {
|
|
399
|
-
...
|
|
399
|
+
...u,
|
|
400
400
|
colorStops: p
|
|
401
401
|
};
|
|
402
402
|
});
|
|
403
|
-
return
|
|
403
|
+
return We.stringify(o);
|
|
404
404
|
} catch {
|
|
405
|
-
return
|
|
405
|
+
return $e(e) ? e : "";
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
function
|
|
409
|
-
|
|
408
|
+
function zr({ color: e, sx: r = {}, ...o }) {
|
|
409
|
+
$e(e);
|
|
410
410
|
const i = {};
|
|
411
|
-
return
|
|
412
|
-
|
|
411
|
+
return Je(e) ? i.backgroundImage = e : i.backgroundColor = e, /* @__PURE__ */ t(
|
|
412
|
+
j,
|
|
413
413
|
{
|
|
414
414
|
sx: {
|
|
415
415
|
...r,
|
|
@@ -428,35 +428,35 @@ function jr({ color: e, sx: r = {}, ...o }) {
|
|
|
428
428
|
}
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const Rr =
|
|
431
|
+
const Rr = tt(function({ onSave: r }, o) {
|
|
432
432
|
const i = Tt({
|
|
433
433
|
value: ""
|
|
434
|
-
}), { t:
|
|
435
|
-
i.value ?
|
|
436
|
-
const [d, { setFalse: m, setTrue:
|
|
434
|
+
}), { t: u } = N(), p = {};
|
|
435
|
+
i.value ? Je(i.value) ? p.backgroundImage = i.value : p.backgroundColor = i.value : p.border = "1px solid #ccc";
|
|
436
|
+
const [d, { setFalse: m, setTrue: w }] = Vt(!1), x = A(() => {
|
|
437
437
|
m();
|
|
438
438
|
}, [m]), g = () => {
|
|
439
|
-
r({ value: i.value },
|
|
439
|
+
r({ value: i.value }, x);
|
|
440
440
|
};
|
|
441
|
-
return
|
|
442
|
-
open({ value:
|
|
443
|
-
i.value =
|
|
441
|
+
return rt(o, () => ({
|
|
442
|
+
open({ value: h } = { value: "" }) {
|
|
443
|
+
i.value = h, w();
|
|
444
444
|
},
|
|
445
445
|
close() {
|
|
446
|
-
|
|
446
|
+
x();
|
|
447
447
|
}
|
|
448
|
-
})), /* @__PURE__ */ S(ke, { open: d, onClose:
|
|
449
|
-
/* @__PURE__ */ t(
|
|
450
|
-
/* @__PURE__ */ t(
|
|
451
|
-
/* @__PURE__ */ t(
|
|
448
|
+
})), /* @__PURE__ */ S(ke, { open: d, onClose: x, hideBackdrop: !0, children: [
|
|
449
|
+
/* @__PURE__ */ t(Qe, { children: u("maker.configBackground") }),
|
|
450
|
+
/* @__PURE__ */ t(Xe, { sx: { width: 600 }, children: /* @__PURE__ */ S(j, { width: "100%", display: "flex", children: [
|
|
451
|
+
/* @__PURE__ */ t(j, { flex: 1, mr: 1, sx: p, children: !i.value && /* @__PURE__ */ t(Z, { children: u("error.notConfig") }) }),
|
|
452
452
|
/* @__PURE__ */ t(Rt, { children: /* @__PURE__ */ t(
|
|
453
453
|
Or,
|
|
454
454
|
{
|
|
455
455
|
width: 200,
|
|
456
456
|
height: 200,
|
|
457
|
-
value:
|
|
458
|
-
onChange: (
|
|
459
|
-
i.value =
|
|
457
|
+
value: jr(i.value),
|
|
458
|
+
onChange: (h) => {
|
|
459
|
+
i.value = h;
|
|
460
460
|
},
|
|
461
461
|
hidePresets: !0,
|
|
462
462
|
hideAdvancedSliders: !0,
|
|
@@ -465,13 +465,13 @@ const Rr = et(function({ onSave: r }, o) {
|
|
|
465
465
|
}
|
|
466
466
|
) })
|
|
467
467
|
] }) }),
|
|
468
|
-
/* @__PURE__ */ S(
|
|
469
|
-
/* @__PURE__ */ t(T, { variant: "outlined", size: "small", onClick:
|
|
470
|
-
/* @__PURE__ */ t(T, { variant: "contained", size: "small", onClick: g, children:
|
|
468
|
+
/* @__PURE__ */ S(Ze, { children: [
|
|
469
|
+
/* @__PURE__ */ t(T, { variant: "outlined", size: "small", onClick: x, children: u("common.cancel") }),
|
|
470
|
+
/* @__PURE__ */ t(T, { variant: "contained", size: "small", onClick: g, children: u("maker.save") })
|
|
471
471
|
] })
|
|
472
472
|
] });
|
|
473
473
|
});
|
|
474
|
-
Nt(
|
|
474
|
+
Nt(j)`
|
|
475
475
|
.color-item {
|
|
476
476
|
position: relative;
|
|
477
477
|
}
|
|
@@ -507,13 +507,13 @@ function Cr({
|
|
|
507
507
|
onChange: r,
|
|
508
508
|
InputProps: {
|
|
509
509
|
endAdornment: /* @__PURE__ */ t(pe, { position: "end", children: /* @__PURE__ */ t(
|
|
510
|
-
|
|
510
|
+
zr,
|
|
511
511
|
{
|
|
512
512
|
color: e ?? "",
|
|
513
513
|
style: { width: "1.5rem", height: "1.5rem", padding: 0 },
|
|
514
514
|
onClick: () => {
|
|
515
|
-
var
|
|
516
|
-
(
|
|
515
|
+
var u;
|
|
516
|
+
(u = i.current) == null || u.open({ value: e ?? "" });
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
) })
|
|
@@ -524,8 +524,8 @@ function Cr({
|
|
|
524
524
|
Rr,
|
|
525
525
|
{
|
|
526
526
|
ref: i,
|
|
527
|
-
onSave: ({ value:
|
|
528
|
-
r(
|
|
527
|
+
onSave: ({ value: u }, p) => {
|
|
528
|
+
r(u), p();
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
)
|
|
@@ -536,28 +536,28 @@ function Dr({
|
|
|
536
536
|
value: r,
|
|
537
537
|
onChange: o,
|
|
538
538
|
property: i,
|
|
539
|
-
component:
|
|
539
|
+
component: u,
|
|
540
540
|
defaultLocale: p,
|
|
541
541
|
allComponents: d,
|
|
542
542
|
PropertyValueField: m,
|
|
543
|
-
onUpload:
|
|
543
|
+
onUpload: w
|
|
544
544
|
}) {
|
|
545
|
-
const { locale:
|
|
546
|
-
if (!
|
|
545
|
+
const { locale: x } = N(), g = F(null);
|
|
546
|
+
if (!ot(i.subProperties)) {
|
|
547
547
|
const n = V(Object.values(i.subProperties || {}), "index").filter(
|
|
548
548
|
(s) => s.data.visible !== !1 && s.data.key
|
|
549
549
|
);
|
|
550
|
-
return /* @__PURE__ */ S(
|
|
550
|
+
return /* @__PURE__ */ S(z, { width: "100%", children: [
|
|
551
551
|
/* @__PURE__ */ t(ne, { sx: { px: 0.25, py: 0.5 }, children: e }),
|
|
552
|
-
/* @__PURE__ */ t(
|
|
553
|
-
const { data:
|
|
552
|
+
/* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(j, { sx: { position: "relative" }, children: n.map((s, l) => {
|
|
553
|
+
const { data: a } = s, b = a.key ?? a.id, P = l === n.length - 1;
|
|
554
554
|
let c = null;
|
|
555
555
|
try {
|
|
556
|
-
r && typeof r == "object" ? c = r[
|
|
556
|
+
r && typeof r == "object" ? c = r[b] : typeof r == "string" && (c = (i.type === "yaml" ? be.parse(r || "") : JSON.parse(r || "{}"))[b]);
|
|
557
557
|
} catch {
|
|
558
558
|
}
|
|
559
|
-
c == null && (
|
|
560
|
-
const
|
|
559
|
+
c == null && (a.locales && x && a.locales[x] ? c = a.locales[x].defaultValue : a.locales && p && a.locales[p] && (c = a.locales[p].defaultValue));
|
|
560
|
+
const v = (k) => {
|
|
561
561
|
try {
|
|
562
562
|
let O = {};
|
|
563
563
|
if (typeof r == "string")
|
|
@@ -566,25 +566,25 @@ function Dr({
|
|
|
566
566
|
} catch {
|
|
567
567
|
}
|
|
568
568
|
else typeof r == "object" && r !== null && (O = { ...r });
|
|
569
|
-
|
|
570
|
-
const
|
|
571
|
-
o == null || o(
|
|
569
|
+
nt(O, b, k);
|
|
570
|
+
const f = xe(O, i.type);
|
|
571
|
+
o == null || o(f);
|
|
572
572
|
} catch (O) {
|
|
573
573
|
console.error("Error updating property:", O);
|
|
574
574
|
}
|
|
575
|
-
},
|
|
575
|
+
}, y = 8;
|
|
576
576
|
return /* @__PURE__ */ S(
|
|
577
|
-
|
|
577
|
+
j,
|
|
578
578
|
{
|
|
579
579
|
sx: {
|
|
580
|
-
mb:
|
|
580
|
+
mb: P ? 0 : 1,
|
|
581
581
|
// 底部边距,最后一项不需要
|
|
582
582
|
display: "flex",
|
|
583
583
|
flexDirection: "row"
|
|
584
584
|
},
|
|
585
585
|
children: [
|
|
586
586
|
/* @__PURE__ */ S(
|
|
587
|
-
|
|
587
|
+
j,
|
|
588
588
|
{
|
|
589
589
|
sx: {
|
|
590
590
|
position: "relative",
|
|
@@ -593,11 +593,11 @@ function Dr({
|
|
|
593
593
|
},
|
|
594
594
|
children: [
|
|
595
595
|
/* @__PURE__ */ t(
|
|
596
|
-
|
|
596
|
+
j,
|
|
597
597
|
{
|
|
598
598
|
sx: {
|
|
599
599
|
position: "absolute",
|
|
600
|
-
left:
|
|
600
|
+
left: y,
|
|
601
601
|
top: 0,
|
|
602
602
|
height: 16,
|
|
603
603
|
// 连接到字段中点的高度
|
|
@@ -608,11 +608,11 @@ function Dr({
|
|
|
608
608
|
}
|
|
609
609
|
),
|
|
610
610
|
/* @__PURE__ */ t(
|
|
611
|
-
|
|
611
|
+
j,
|
|
612
612
|
{
|
|
613
613
|
sx: {
|
|
614
614
|
position: "absolute",
|
|
615
|
-
left:
|
|
615
|
+
left: y,
|
|
616
616
|
top: 16,
|
|
617
617
|
// 连接到字段中点
|
|
618
618
|
width: 12,
|
|
@@ -622,12 +622,12 @@ function Dr({
|
|
|
622
622
|
}
|
|
623
623
|
}
|
|
624
624
|
),
|
|
625
|
-
!
|
|
626
|
-
|
|
625
|
+
!P && /* @__PURE__ */ t(
|
|
626
|
+
j,
|
|
627
627
|
{
|
|
628
628
|
sx: {
|
|
629
629
|
position: "absolute",
|
|
630
|
-
left:
|
|
630
|
+
left: y,
|
|
631
631
|
top: 16,
|
|
632
632
|
// 从当前项中点
|
|
633
633
|
bottom: -8,
|
|
@@ -641,13 +641,13 @@ function Dr({
|
|
|
641
641
|
]
|
|
642
642
|
}
|
|
643
643
|
),
|
|
644
|
-
/* @__PURE__ */ t(
|
|
644
|
+
/* @__PURE__ */ t(j, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ t(
|
|
645
645
|
m,
|
|
646
646
|
{
|
|
647
|
-
component:
|
|
648
|
-
property:
|
|
647
|
+
component: u,
|
|
648
|
+
property: a,
|
|
649
649
|
value: c,
|
|
650
|
-
onChange:
|
|
650
|
+
onChange: v,
|
|
651
651
|
size: "small",
|
|
652
652
|
fullWidth: !0,
|
|
653
653
|
defaultLocale: p,
|
|
@@ -656,13 +656,13 @@ function Dr({
|
|
|
656
656
|
) })
|
|
657
657
|
]
|
|
658
658
|
},
|
|
659
|
-
|
|
659
|
+
a.id
|
|
660
660
|
);
|
|
661
661
|
}) }) })
|
|
662
662
|
] });
|
|
663
663
|
}
|
|
664
|
-
return /* @__PURE__ */ t(
|
|
665
|
-
|
|
664
|
+
return /* @__PURE__ */ t(z, { width: "100%", gap: 2, children: /* @__PURE__ */ S(
|
|
665
|
+
z,
|
|
666
666
|
{
|
|
667
667
|
sx: {
|
|
668
668
|
width: "100%",
|
|
@@ -687,23 +687,23 @@ function Dr({
|
|
|
687
687
|
}
|
|
688
688
|
),
|
|
689
689
|
/* @__PURE__ */ t(
|
|
690
|
-
|
|
690
|
+
we,
|
|
691
691
|
{
|
|
692
692
|
keyId: i.id,
|
|
693
|
-
locale:
|
|
693
|
+
locale: x,
|
|
694
694
|
language: i.type === "yaml" ? "yaml" : "json",
|
|
695
695
|
value: typeof r == "string" ? r : "",
|
|
696
696
|
onChange: (n) => {
|
|
697
697
|
o == null || o(n);
|
|
698
698
|
},
|
|
699
699
|
onUpload: (n) => {
|
|
700
|
-
g.current = n,
|
|
700
|
+
g.current = n, w && w(n);
|
|
701
701
|
}
|
|
702
702
|
},
|
|
703
703
|
i.id
|
|
704
704
|
),
|
|
705
705
|
/* @__PURE__ */ t(
|
|
706
|
-
|
|
706
|
+
j,
|
|
707
707
|
{
|
|
708
708
|
component: "fieldset",
|
|
709
709
|
sx: {
|
|
@@ -719,7 +719,7 @@ function Dr({
|
|
|
719
719
|
px: 1,
|
|
720
720
|
py: 0
|
|
721
721
|
},
|
|
722
|
-
children: /* @__PURE__ */ t(
|
|
722
|
+
children: /* @__PURE__ */ t(j, { component: "legend", sx: { fontSize: "0.75em" }, children: /* @__PURE__ */ t(j, { component: "span", sx: { opacity: 0 }, children: e }) })
|
|
723
723
|
}
|
|
724
724
|
)
|
|
725
725
|
]
|
|
@@ -727,63 +727,63 @@ function Dr({
|
|
|
727
727
|
) });
|
|
728
728
|
}
|
|
729
729
|
const Nr = ["string", "multiline", "json", "yaml", "url", "component", "custom"];
|
|
730
|
-
function
|
|
730
|
+
function Fe(e) {
|
|
731
731
|
return e.type ? !Nr.includes(e.type) : !1;
|
|
732
732
|
}
|
|
733
|
-
function
|
|
733
|
+
function mt({
|
|
734
734
|
disabled: e,
|
|
735
735
|
list: r,
|
|
736
736
|
renderItem: o,
|
|
737
737
|
...i
|
|
738
738
|
}) {
|
|
739
|
-
const
|
|
739
|
+
const u = F(null), p = Ct(), d = Et(), m = V(Object.entries(r), (s) => s[1].index).map((s) => s[0]), w = F(m), x = A(
|
|
740
740
|
(s) => {
|
|
741
|
-
|
|
741
|
+
w.current = s, d();
|
|
742
742
|
},
|
|
743
743
|
[d]
|
|
744
744
|
), g = A(
|
|
745
745
|
({ index: s }, { index: l }) => {
|
|
746
|
-
const
|
|
747
|
-
|
|
746
|
+
const a = [...w.current];
|
|
747
|
+
a.splice(l, 0, ...a.splice(s, 1)), x(a);
|
|
748
748
|
},
|
|
749
|
-
[
|
|
749
|
+
[x]
|
|
750
750
|
);
|
|
751
751
|
M(() => {
|
|
752
|
-
|
|
752
|
+
x(m);
|
|
753
753
|
}, [m.join("-")]);
|
|
754
|
-
const [{ isOver:
|
|
754
|
+
const [{ isOver: h }, n] = pt({
|
|
755
755
|
accept: p,
|
|
756
756
|
collect: (s) => ({
|
|
757
757
|
isOver: s.isOver()
|
|
758
758
|
}),
|
|
759
759
|
canDrop: () => !e,
|
|
760
760
|
drop: () => {
|
|
761
|
-
var
|
|
761
|
+
var a;
|
|
762
762
|
const s = () => {
|
|
763
|
-
|
|
764
|
-
const c = r[
|
|
765
|
-
c && (c.index =
|
|
763
|
+
w.current.forEach((b, P) => {
|
|
764
|
+
const c = r[b];
|
|
765
|
+
c && (c.index = P);
|
|
766
766
|
});
|
|
767
|
-
}, l = (
|
|
767
|
+
}, l = (a = te(r)) == null ? void 0 : a.doc;
|
|
768
768
|
l ? l.transact(() => {
|
|
769
769
|
s();
|
|
770
770
|
}) : s();
|
|
771
771
|
}
|
|
772
772
|
});
|
|
773
773
|
return M(() => {
|
|
774
|
-
|
|
775
|
-
}, [
|
|
774
|
+
h || x(m);
|
|
775
|
+
}, [h]), n(u), /* @__PURE__ */ t(j, { ...i, ref: u, className: At(h && "isDragging"), children: w.current.map((s, l) => /* @__PURE__ */ t(
|
|
776
776
|
Ar,
|
|
777
777
|
{
|
|
778
778
|
type: p,
|
|
779
779
|
disabled: e,
|
|
780
780
|
id: s,
|
|
781
781
|
index: l,
|
|
782
|
-
itemIndex: (
|
|
782
|
+
itemIndex: (a) => w.current.indexOf(a),
|
|
783
783
|
move: g,
|
|
784
|
-
children: (
|
|
785
|
-
const
|
|
786
|
-
return
|
|
784
|
+
children: (a) => {
|
|
785
|
+
const b = r[s];
|
|
786
|
+
return b ? o(b.data, l, a) : null;
|
|
787
787
|
}
|
|
788
788
|
},
|
|
789
789
|
s
|
|
@@ -794,67 +794,67 @@ function Ar({
|
|
|
794
794
|
id: r,
|
|
795
795
|
index: o,
|
|
796
796
|
type: i,
|
|
797
|
-
children:
|
|
797
|
+
children: u,
|
|
798
798
|
itemIndex: p,
|
|
799
799
|
move: d
|
|
800
800
|
}) {
|
|
801
|
-
const m = F(), [{ isDragging:
|
|
801
|
+
const m = F(), [{ isDragging: w }, x, g] = gr({
|
|
802
802
|
type: i,
|
|
803
803
|
item: () => ({ id: r }),
|
|
804
804
|
canDrag: () => !e,
|
|
805
805
|
collect: (n) => ({ isDragging: n.isDragging() })
|
|
806
|
-
}), [,
|
|
806
|
+
}), [, h] = pt({
|
|
807
807
|
accept: i,
|
|
808
808
|
canDrop: () => !e,
|
|
809
809
|
hover(n, s) {
|
|
810
|
-
var
|
|
810
|
+
var y;
|
|
811
811
|
if (!m.current)
|
|
812
812
|
return;
|
|
813
|
-
const l = p(n.id),
|
|
814
|
-
if (l ===
|
|
813
|
+
const l = p(n.id), a = o;
|
|
814
|
+
if (l === a)
|
|
815
815
|
return;
|
|
816
|
-
const
|
|
817
|
-
l <
|
|
816
|
+
const b = (y = m.current) == null ? void 0 : y.getBoundingClientRect(), P = (b.bottom - b.top) / 2, v = s.getClientOffset().y - b.top;
|
|
817
|
+
l < a && v < P || l > a && v > P || d({ id: n.id, index: l }, { id: r, index: o });
|
|
818
818
|
}
|
|
819
819
|
});
|
|
820
|
-
return typeof
|
|
821
|
-
isDragging:
|
|
822
|
-
drag:
|
|
823
|
-
drop: (n) => (m.current = n,
|
|
820
|
+
return typeof u == "function" ? u({
|
|
821
|
+
isDragging: w,
|
|
822
|
+
drag: x,
|
|
823
|
+
drop: (n) => (m.current = n, h(n)),
|
|
824
824
|
preview: g
|
|
825
|
-
}) : (
|
|
825
|
+
}) : (x(h(g(m))), /* @__PURE__ */ t(j, { ref: m, children: u }));
|
|
826
826
|
}
|
|
827
827
|
function Tr({
|
|
828
828
|
drop: e,
|
|
829
829
|
preview: r,
|
|
830
830
|
drag: o,
|
|
831
831
|
disabled: i,
|
|
832
|
-
isDragging:
|
|
832
|
+
isDragging: u,
|
|
833
833
|
children: p,
|
|
834
834
|
onDelete: d,
|
|
835
835
|
onVisibilityChange: m,
|
|
836
|
-
visible:
|
|
837
|
-
actions:
|
|
836
|
+
visible: w = !0,
|
|
837
|
+
actions: x,
|
|
838
838
|
alwaysShowActions: g = !1
|
|
839
839
|
}) {
|
|
840
|
-
const { t:
|
|
840
|
+
const { t: h } = N();
|
|
841
841
|
return /* @__PURE__ */ t(
|
|
842
|
-
|
|
842
|
+
j,
|
|
843
843
|
{
|
|
844
844
|
ref: e,
|
|
845
845
|
sx: {
|
|
846
846
|
":hover .hover-visible": { maxWidth: "100%" },
|
|
847
|
-
opacity:
|
|
847
|
+
opacity: w ? 1 : 0.5
|
|
848
848
|
},
|
|
849
|
-
children: /* @__PURE__ */ S(
|
|
849
|
+
children: /* @__PURE__ */ S(j, { sx: { position: "relative" }, children: [
|
|
850
850
|
/* @__PURE__ */ t(
|
|
851
|
-
|
|
851
|
+
j,
|
|
852
852
|
{
|
|
853
853
|
ref: r,
|
|
854
854
|
sx: {
|
|
855
855
|
flex: 1,
|
|
856
856
|
borderRadius: 0.5,
|
|
857
|
-
bgcolor:
|
|
857
|
+
bgcolor: u ? "action.hover" : "background.paper",
|
|
858
858
|
opacity: 0.9999
|
|
859
859
|
// NOTE: make preview effective
|
|
860
860
|
},
|
|
@@ -862,7 +862,7 @@ function Tr({
|
|
|
862
862
|
}
|
|
863
863
|
),
|
|
864
864
|
!i && /* @__PURE__ */ t(
|
|
865
|
-
|
|
865
|
+
j,
|
|
866
866
|
{
|
|
867
867
|
className: g ? "" : "hover-visible",
|
|
868
868
|
sx: {
|
|
@@ -874,7 +874,7 @@ function Tr({
|
|
|
874
874
|
transition: "max-width 0.3s ease-in-out"
|
|
875
875
|
},
|
|
876
876
|
children: /* @__PURE__ */ S(
|
|
877
|
-
|
|
877
|
+
z,
|
|
878
878
|
{
|
|
879
879
|
direction: "row",
|
|
880
880
|
sx: {
|
|
@@ -889,10 +889,10 @@ function Tr({
|
|
|
889
889
|
}
|
|
890
890
|
},
|
|
891
891
|
children: [
|
|
892
|
-
|
|
893
|
-
m && /* @__PURE__ */ t(X, { title:
|
|
894
|
-
d && /* @__PURE__ */ t(X, { title:
|
|
895
|
-
/* @__PURE__ */ t(X, { title:
|
|
892
|
+
x,
|
|
893
|
+
m && /* @__PURE__ */ t(X, { title: h(w ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: () => m(!w), children: w ? /* @__PURE__ */ t(lr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(sr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
894
|
+
d && /* @__PURE__ */ t(X, { title: h("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: d, children: /* @__PURE__ */ t(cr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
895
|
+
/* @__PURE__ */ t(X, { title: h("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { ref: o, children: /* @__PURE__ */ t(dr, { sx: { color: "grey.500" } }) }) })
|
|
896
896
|
]
|
|
897
897
|
}
|
|
898
898
|
)
|
|
@@ -907,8 +907,8 @@ function Vr({
|
|
|
907
907
|
value: r,
|
|
908
908
|
onChange: o
|
|
909
909
|
}) {
|
|
910
|
-
const [i,
|
|
911
|
-
return /* @__PURE__ */ S(
|
|
910
|
+
const [i, u] = $(!1);
|
|
911
|
+
return /* @__PURE__ */ S(z, { gap: 1, children: [
|
|
912
912
|
/* @__PURE__ */ t(
|
|
913
913
|
D,
|
|
914
914
|
{
|
|
@@ -918,7 +918,7 @@ function Vr({
|
|
|
918
918
|
onChange: (p) => o == null ? void 0 : o(p.target.value),
|
|
919
919
|
InputProps: {
|
|
920
920
|
endAdornment: /* @__PURE__ */ t(
|
|
921
|
-
|
|
921
|
+
Pe,
|
|
922
922
|
{
|
|
923
923
|
onChange: ({ response: p }) => {
|
|
924
924
|
var m;
|
|
@@ -931,7 +931,7 @@ function Vr({
|
|
|
931
931
|
}
|
|
932
932
|
),
|
|
933
933
|
r && /* @__PURE__ */ t(
|
|
934
|
-
|
|
934
|
+
j,
|
|
935
935
|
{
|
|
936
936
|
component: "img",
|
|
937
937
|
sx: { objectFit: "contain", borderRadius: 1, cursor: "pointer" },
|
|
@@ -940,17 +940,17 @@ function Vr({
|
|
|
940
940
|
maxWidth: 100,
|
|
941
941
|
maxHeight: 100,
|
|
942
942
|
width: "100%",
|
|
943
|
-
onClick: () =>
|
|
943
|
+
onClick: () => u(!0)
|
|
944
944
|
}
|
|
945
945
|
),
|
|
946
|
-
/* @__PURE__ */ t(ke, { open: i, onClose: () =>
|
|
946
|
+
/* @__PURE__ */ t(ke, { open: i, onClose: () => u(!1), children: /* @__PURE__ */ t(j, { component: "img", sx: { objectFit: "contain" }, src: oe(r), alt: e }) })
|
|
947
947
|
] });
|
|
948
948
|
}
|
|
949
949
|
function ye(e, r = "") {
|
|
950
950
|
return yr(
|
|
951
951
|
e,
|
|
952
|
-
(o, i,
|
|
953
|
-
const p = r ? `${r}.${
|
|
952
|
+
(o, i, u) => {
|
|
953
|
+
const p = r ? `${r}.${u}` : u;
|
|
954
954
|
return mr(i) ? ur(o, ye(i, p)) : o[p] = i, o;
|
|
955
955
|
},
|
|
956
956
|
{}
|
|
@@ -973,7 +973,7 @@ const Er = [
|
|
|
973
973
|
function ie(e, r, o) {
|
|
974
974
|
return !e || !o ? !1 : Object.values(e).some(({ data: i }) => i.id !== r && i.key === o);
|
|
975
975
|
}
|
|
976
|
-
function
|
|
976
|
+
function ve(e, r) {
|
|
977
977
|
var o;
|
|
978
978
|
return !e || !r ? !1 : ((o = e[r]) == null ? void 0 : o.data.visible) ?? !0;
|
|
979
979
|
}
|
|
@@ -981,34 +981,34 @@ function Ui({ componentId: e }) {
|
|
|
981
981
|
const {
|
|
982
982
|
state: { components: r }
|
|
983
983
|
} = ae(), o = r[e], i = o == null ? void 0 : o.data;
|
|
984
|
-
return i ? /* @__PURE__ */ t(
|
|
984
|
+
return i ? /* @__PURE__ */ t(z, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ t(j, { p: 2, children: /* @__PURE__ */ t(xr, { FallbackComponent: yt, resetKeys: [e], children: /* @__PURE__ */ t(Ur, { value: i }) }) }) }) : null;
|
|
985
985
|
}
|
|
986
986
|
function Ur({ value: e }) {
|
|
987
|
-
var
|
|
987
|
+
var w, x, g;
|
|
988
988
|
const { t: r } = N(), {
|
|
989
989
|
localState: { currentLocale: o, componentDebugProps: i },
|
|
990
990
|
state: {
|
|
991
|
-
config: { defaultLocale:
|
|
991
|
+
config: { defaultLocale: u }
|
|
992
992
|
},
|
|
993
993
|
localActions: { setComponentDebugProps: p }
|
|
994
|
-
} = ae(), d = te(e).doc, m =
|
|
995
|
-
return /* @__PURE__ */ t(
|
|
994
|
+
} = ae(), d = te(e).doc, m = ge();
|
|
995
|
+
return /* @__PURE__ */ t(z, { height: "100%", children: /* @__PURE__ */ S(z, { gap: 2, children: [
|
|
996
996
|
/* @__PURE__ */ t(Wr, { config: e }),
|
|
997
997
|
/* @__PURE__ */ t(
|
|
998
998
|
Kr,
|
|
999
999
|
{
|
|
1000
1000
|
config: e,
|
|
1001
1001
|
currentLocale: o,
|
|
1002
|
-
defaultLocale:
|
|
1002
|
+
defaultLocale: u,
|
|
1003
1003
|
allComponents: m,
|
|
1004
|
-
onUpdateConfig: (
|
|
1004
|
+
onUpdateConfig: (h) => {
|
|
1005
1005
|
d.transact(() => {
|
|
1006
|
-
|
|
1006
|
+
h(e);
|
|
1007
1007
|
});
|
|
1008
1008
|
}
|
|
1009
1009
|
}
|
|
1010
1010
|
),
|
|
1011
|
-
/* @__PURE__ */ S(
|
|
1011
|
+
/* @__PURE__ */ S(z, { gap: 2, direction: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
1012
1012
|
/* @__PURE__ */ t(J, { variant: "subtitle1", children: r("renderer") }),
|
|
1013
1013
|
/* @__PURE__ */ S(
|
|
1014
1014
|
D,
|
|
@@ -1017,10 +1017,10 @@ function Ur({ value: e }) {
|
|
|
1017
1017
|
size: "small",
|
|
1018
1018
|
select: !0,
|
|
1019
1019
|
SelectProps: { autoWidth: !0 },
|
|
1020
|
-
value: ((
|
|
1021
|
-
onChange: (
|
|
1020
|
+
value: ((w = e.renderer) == null ? void 0 : w.type) || "react-component",
|
|
1021
|
+
onChange: (h) => {
|
|
1022
1022
|
d.transact(() => {
|
|
1023
|
-
const n =
|
|
1023
|
+
const n = h.target.value;
|
|
1024
1024
|
e.renderer ?? (e.renderer = { type: n }), e.renderer.type = n;
|
|
1025
1025
|
});
|
|
1026
1026
|
},
|
|
@@ -1031,17 +1031,17 @@ function Ur({ value: e }) {
|
|
|
1031
1031
|
}
|
|
1032
1032
|
)
|
|
1033
1033
|
] }),
|
|
1034
|
-
((
|
|
1034
|
+
((x = e.renderer) == null ? void 0 : x.type) === "component" ? /* @__PURE__ */ t(Lr, { value: e }) : ((g = e.renderer) == null ? void 0 : g.type) === "react-component" ? /* @__PURE__ */ t(Yr, { value: e }) : null,
|
|
1035
1035
|
/* @__PURE__ */ t(
|
|
1036
1036
|
bt,
|
|
1037
1037
|
{
|
|
1038
1038
|
config: e,
|
|
1039
1039
|
currentLocale: o,
|
|
1040
|
-
defaultLocale:
|
|
1040
|
+
defaultLocale: u,
|
|
1041
1041
|
allComponents: m,
|
|
1042
|
-
onChange: ({ key:
|
|
1042
|
+
onChange: ({ key: h, value: n }) => {
|
|
1043
1043
|
p({
|
|
1044
|
-
[
|
|
1044
|
+
[h]: n.value
|
|
1045
1045
|
});
|
|
1046
1046
|
},
|
|
1047
1047
|
props: {
|
|
@@ -1053,7 +1053,7 @@ function Ur({ value: e }) {
|
|
|
1053
1053
|
}
|
|
1054
1054
|
function Wr({ config: e }) {
|
|
1055
1055
|
const { t: r } = N();
|
|
1056
|
-
return /* @__PURE__ */ t(
|
|
1056
|
+
return /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ S(z, { gap: 2, children: [
|
|
1057
1057
|
/* @__PURE__ */ t(J, { variant: "subtitle1", children: r("basicInfo") }),
|
|
1058
1058
|
/* @__PURE__ */ t(
|
|
1059
1059
|
D,
|
|
@@ -1078,7 +1078,7 @@ function Wr({ config: e }) {
|
|
|
1078
1078
|
}
|
|
1079
1079
|
),
|
|
1080
1080
|
/* @__PURE__ */ t(
|
|
1081
|
-
|
|
1081
|
+
et,
|
|
1082
1082
|
{
|
|
1083
1083
|
size: "small",
|
|
1084
1084
|
options: [],
|
|
@@ -1104,13 +1104,13 @@ function ft({
|
|
|
1104
1104
|
params: r,
|
|
1105
1105
|
visible: o,
|
|
1106
1106
|
config: i,
|
|
1107
|
-
currentLocale:
|
|
1107
|
+
currentLocale: u,
|
|
1108
1108
|
defaultLocale: p,
|
|
1109
1109
|
allComponents: d,
|
|
1110
1110
|
onUpdateConfig: m
|
|
1111
1111
|
}) {
|
|
1112
|
-
var g,
|
|
1113
|
-
const { t:
|
|
1112
|
+
var g, h, n, s, l, a;
|
|
1113
|
+
const { t: w } = N(), x = ce(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? Jr : _, [e.type]);
|
|
1114
1114
|
return /* @__PURE__ */ t(
|
|
1115
1115
|
Tr,
|
|
1116
1116
|
{
|
|
@@ -1119,28 +1119,28 @@ function ft({
|
|
|
1119
1119
|
drag: r.drag,
|
|
1120
1120
|
isDragging: r.isDragging,
|
|
1121
1121
|
onDelete: () => {
|
|
1122
|
-
m((
|
|
1123
|
-
if (
|
|
1124
|
-
const c = Object.entries(
|
|
1125
|
-
delete
|
|
1126
|
-
|
|
1122
|
+
m((b) => {
|
|
1123
|
+
if (b.properties) {
|
|
1124
|
+
const c = Object.entries(b.properties).sort(([, y], [, k]) => y.index - k.index);
|
|
1125
|
+
delete b.properties[e.id], c.filter(([y]) => y !== e.id).forEach(([, y], k) => {
|
|
1126
|
+
y.index = k;
|
|
1127
1127
|
});
|
|
1128
1128
|
}
|
|
1129
1129
|
});
|
|
1130
1130
|
},
|
|
1131
1131
|
visible: o,
|
|
1132
|
-
onVisibilityChange: (
|
|
1133
|
-
m((
|
|
1134
|
-
const c =
|
|
1135
|
-
c.visible =
|
|
1132
|
+
onVisibilityChange: (b) => {
|
|
1133
|
+
m((P) => {
|
|
1134
|
+
const c = P.properties[e.id].data;
|
|
1135
|
+
c.visible = b;
|
|
1136
1136
|
});
|
|
1137
1137
|
},
|
|
1138
1138
|
alwaysShowActions: !0,
|
|
1139
|
-
children: /* @__PURE__ */ S(
|
|
1139
|
+
children: /* @__PURE__ */ S(z, { direction: "column", gap: 2, children: [
|
|
1140
1140
|
/* @__PURE__ */ t(
|
|
1141
1141
|
D,
|
|
1142
1142
|
{
|
|
1143
|
-
label:
|
|
1143
|
+
label: w("key"),
|
|
1144
1144
|
size: "small",
|
|
1145
1145
|
required: !0,
|
|
1146
1146
|
sx: {
|
|
@@ -1157,10 +1157,10 @@ function ft({
|
|
|
1157
1157
|
}
|
|
1158
1158
|
},
|
|
1159
1159
|
value: e.key || "",
|
|
1160
|
-
onChange: (
|
|
1161
|
-
m((
|
|
1162
|
-
const c =
|
|
1163
|
-
c.key =
|
|
1160
|
+
onChange: (b) => {
|
|
1161
|
+
m((P) => {
|
|
1162
|
+
const c = P.properties[e.id].data;
|
|
1163
|
+
c.key = b.target.value.trim();
|
|
1164
1164
|
});
|
|
1165
1165
|
},
|
|
1166
1166
|
InputProps: {
|
|
@@ -1172,8 +1172,8 @@ function ft({
|
|
|
1172
1172
|
width: 16,
|
|
1173
1173
|
ml: 0
|
|
1174
1174
|
},
|
|
1175
|
-
children: /* @__PURE__ */ t(X, { title: e.key ?
|
|
1176
|
-
|
|
1175
|
+
children: /* @__PURE__ */ t(X, { title: e.key ? w("duplicateKey") : w("requiredKey"), children: /* @__PURE__ */ t(
|
|
1176
|
+
dt,
|
|
1177
1177
|
{
|
|
1178
1178
|
sx: {
|
|
1179
1179
|
color: e.key ? "warning.main" : "error.main",
|
|
@@ -1186,19 +1186,19 @@ function ft({
|
|
|
1186
1186
|
}
|
|
1187
1187
|
}
|
|
1188
1188
|
),
|
|
1189
|
-
/* @__PURE__ */ S(
|
|
1189
|
+
/* @__PURE__ */ S(z, { direction: "row", gap: 1, children: [
|
|
1190
1190
|
/* @__PURE__ */ t(
|
|
1191
1191
|
D,
|
|
1192
1192
|
{
|
|
1193
|
-
label:
|
|
1193
|
+
label: w("label"),
|
|
1194
1194
|
size: "small",
|
|
1195
1195
|
sx: { flex: 1 },
|
|
1196
|
-
value: (((
|
|
1197
|
-
onChange: (
|
|
1198
|
-
m((
|
|
1199
|
-
var
|
|
1200
|
-
const c =
|
|
1201
|
-
c.locales ?? (c.locales = {}), (
|
|
1196
|
+
value: (((h = (g = e.locales) == null ? void 0 : g[u]) == null ? void 0 : h.name) ?? ((s = (n = e.locales) == null ? void 0 : n[p]) == null ? void 0 : s.name)) || "",
|
|
1197
|
+
onChange: (b) => {
|
|
1198
|
+
m((P) => {
|
|
1199
|
+
var v;
|
|
1200
|
+
const c = P.properties[e.id].data;
|
|
1201
|
+
c.locales ?? (c.locales = {}), (v = c.locales)[u] ?? (v[u] = {}), c.locales[u].name = b.target.value;
|
|
1202
1202
|
});
|
|
1203
1203
|
}
|
|
1204
1204
|
}
|
|
@@ -1206,53 +1206,53 @@ function ft({
|
|
|
1206
1206
|
/* @__PURE__ */ t(
|
|
1207
1207
|
D,
|
|
1208
1208
|
{
|
|
1209
|
-
label:
|
|
1209
|
+
label: w("type"),
|
|
1210
1210
|
size: "small",
|
|
1211
1211
|
select: !0,
|
|
1212
1212
|
sx: { flex: 1 },
|
|
1213
1213
|
value: e.type === "string" && e.multiline ? "multiline" : e.type || "string",
|
|
1214
|
-
onChange: (
|
|
1215
|
-
m((
|
|
1216
|
-
const c =
|
|
1214
|
+
onChange: (b) => {
|
|
1215
|
+
m((P) => {
|
|
1216
|
+
const c = P.properties[e.id].data;
|
|
1217
1217
|
if (c.locales)
|
|
1218
|
-
for (const
|
|
1219
|
-
c.locales[
|
|
1220
|
-
const
|
|
1221
|
-
|
|
1218
|
+
for (const y of Object.keys(c.locales))
|
|
1219
|
+
c.locales[y].defaultValue = void 0;
|
|
1220
|
+
const v = b.target.value;
|
|
1221
|
+
v === "multiline" ? (c.type = "string", c.multiline = !0) : (typeof c.multiline < "u" && delete c.multiline, c.type = v);
|
|
1222
1222
|
});
|
|
1223
1223
|
},
|
|
1224
|
-
children: Er.map((
|
|
1224
|
+
children: Er.map((b) => /* @__PURE__ */ t(me, { value: b.value, children: b.label }, b.value))
|
|
1225
1225
|
}
|
|
1226
1226
|
)
|
|
1227
1227
|
] }),
|
|
1228
|
-
/* @__PURE__ */ S(
|
|
1228
|
+
/* @__PURE__ */ S(z, { direction: "row", gap: 1, children: [
|
|
1229
1229
|
/* @__PURE__ */ t(
|
|
1230
|
-
|
|
1230
|
+
x,
|
|
1231
1231
|
{
|
|
1232
1232
|
allComponents: d,
|
|
1233
1233
|
defaultLocale: p,
|
|
1234
1234
|
component: i,
|
|
1235
1235
|
property: e,
|
|
1236
|
-
label:
|
|
1236
|
+
label: w("defaultValue"),
|
|
1237
1237
|
size: "small",
|
|
1238
1238
|
fullWidth: !0,
|
|
1239
|
-
value: (
|
|
1240
|
-
onChange: (
|
|
1239
|
+
value: (a = (l = e.locales) == null ? void 0 : l[u]) == null ? void 0 : a.defaultValue,
|
|
1240
|
+
onChange: (b, P) => {
|
|
1241
1241
|
m((c) => {
|
|
1242
|
-
var
|
|
1243
|
-
const
|
|
1244
|
-
if (
|
|
1245
|
-
const
|
|
1246
|
-
Object.keys(O).forEach((
|
|
1247
|
-
|
|
1242
|
+
var y;
|
|
1243
|
+
const v = c.properties[e.id].data;
|
|
1244
|
+
if (P != null && P.forceUpdateProperty) {
|
|
1245
|
+
const k = ye(v), O = ye(b);
|
|
1246
|
+
Object.keys(O).forEach((f) => {
|
|
1247
|
+
k[f] || nt(v, f, O[f]);
|
|
1248
1248
|
});
|
|
1249
1249
|
} else
|
|
1250
|
-
|
|
1250
|
+
v.locales ?? (v.locales = {}), (y = v.locales)[u] ?? (y[u] = {}), v.locales[u].defaultValue = b;
|
|
1251
1251
|
});
|
|
1252
1252
|
}
|
|
1253
1253
|
}
|
|
1254
1254
|
),
|
|
1255
|
-
e.type === "custom" ? /* @__PURE__ */ t(
|
|
1255
|
+
e.type === "custom" ? /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(Fr, { property: e, allComponents: d }) }) : null
|
|
1256
1256
|
] })
|
|
1257
1257
|
] })
|
|
1258
1258
|
}
|
|
@@ -1277,24 +1277,24 @@ function Kr({
|
|
|
1277
1277
|
currentLocale: r,
|
|
1278
1278
|
defaultLocale: o,
|
|
1279
1279
|
allComponents: i,
|
|
1280
|
-
onUpdateConfig:
|
|
1280
|
+
onUpdateConfig: u,
|
|
1281
1281
|
useI18nEditor: p = !0
|
|
1282
1282
|
}) {
|
|
1283
|
-
const { t: d } = N(), m =
|
|
1284
|
-
return /* @__PURE__ */ t(
|
|
1285
|
-
/* @__PURE__ */ S(
|
|
1283
|
+
const { t: d } = N(), m = Se({ variant: "dialog" }), w = e.properties && V(Object.values(e.properties), "index");
|
|
1284
|
+
return /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ S(z, { gap: 2, children: [
|
|
1285
|
+
/* @__PURE__ */ S(z, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between", children: [
|
|
1286
1286
|
/* @__PURE__ */ t(J, { variant: "subtitle1", children: d("properties") }),
|
|
1287
|
-
/* @__PURE__ */ t(
|
|
1288
|
-
p && /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...
|
|
1287
|
+
/* @__PURE__ */ t(j, { flex: 1 }),
|
|
1288
|
+
p && /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Oe(m), children: /* @__PURE__ */ t(st, { fontSize: "small" }) })
|
|
1289
1289
|
] }),
|
|
1290
1290
|
e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ t(
|
|
1291
|
-
|
|
1291
|
+
mt,
|
|
1292
1292
|
{
|
|
1293
|
-
component:
|
|
1293
|
+
component: z,
|
|
1294
1294
|
gap: 2,
|
|
1295
1295
|
list: e.properties,
|
|
1296
|
-
renderItem: (
|
|
1297
|
-
const n =
|
|
1296
|
+
renderItem: (x, g, h) => {
|
|
1297
|
+
const n = ve(e.properties, x.id);
|
|
1298
1298
|
return /* @__PURE__ */ t(
|
|
1299
1299
|
ee,
|
|
1300
1300
|
{
|
|
@@ -1306,21 +1306,21 @@ function Kr({
|
|
|
1306
1306
|
border: n ? "1px solid" : "1px dashed",
|
|
1307
1307
|
borderColor: "divider"
|
|
1308
1308
|
},
|
|
1309
|
-
children: /* @__PURE__ */ t(
|
|
1309
|
+
children: /* @__PURE__ */ t(z, { gap: 2, children: /* @__PURE__ */ t(
|
|
1310
1310
|
ft,
|
|
1311
1311
|
{
|
|
1312
|
-
data:
|
|
1313
|
-
params:
|
|
1312
|
+
data: x,
|
|
1313
|
+
params: h,
|
|
1314
1314
|
visible: n,
|
|
1315
1315
|
config: e,
|
|
1316
1316
|
currentLocale: r,
|
|
1317
1317
|
defaultLocale: o,
|
|
1318
1318
|
allComponents: i,
|
|
1319
|
-
onUpdateConfig:
|
|
1319
|
+
onUpdateConfig: u
|
|
1320
1320
|
}
|
|
1321
1321
|
) })
|
|
1322
1322
|
},
|
|
1323
|
-
|
|
1323
|
+
x.id
|
|
1324
1324
|
);
|
|
1325
1325
|
}
|
|
1326
1326
|
}
|
|
@@ -1332,31 +1332,31 @@ function Kr({
|
|
|
1332
1332
|
variant: "outlined",
|
|
1333
1333
|
className: "ignore-style-override",
|
|
1334
1334
|
onClick: () => {
|
|
1335
|
-
|
|
1336
|
-
var
|
|
1337
|
-
const g =
|
|
1338
|
-
|
|
1335
|
+
u((x) => {
|
|
1336
|
+
var h;
|
|
1337
|
+
const g = Me();
|
|
1338
|
+
x.properties ?? (x.properties = {}), (h = x.properties)[g] ?? (h[g] = { index: (w == null ? void 0 : w.length) || 0, data: { id: g } });
|
|
1339
1339
|
});
|
|
1340
1340
|
},
|
|
1341
|
-
startIcon: /* @__PURE__ */ t(
|
|
1341
|
+
startIcon: /* @__PURE__ */ t(ct, {}),
|
|
1342
1342
|
children: d("addObject", { object: d("property") })
|
|
1343
1343
|
}
|
|
1344
1344
|
),
|
|
1345
|
-
p && /* @__PURE__ */ t(ht, { ...
|
|
1345
|
+
p && /* @__PURE__ */ t(ht, { ...ut(m), component: e })
|
|
1346
1346
|
] }) });
|
|
1347
1347
|
}
|
|
1348
1348
|
function Fr({
|
|
1349
1349
|
property: e,
|
|
1350
1350
|
allComponents: r
|
|
1351
1351
|
}) {
|
|
1352
|
-
const o =
|
|
1352
|
+
const o = Se({ variant: "popper" });
|
|
1353
1353
|
return /* @__PURE__ */ S(H, { children: [
|
|
1354
|
-
/* @__PURE__ */ t(T, { sx: { minWidth: 0 }, ...
|
|
1355
|
-
/* @__PURE__ */ t(
|
|
1356
|
-
|
|
1354
|
+
/* @__PURE__ */ t(T, { sx: { minWidth: 0 }, ...Oe(o), children: /* @__PURE__ */ t(at, { fontSize: "small" }) }),
|
|
1355
|
+
/* @__PURE__ */ t(jt, { ...vr(o), children: /* @__PURE__ */ t(nr, { onClickAway: o.close, children: /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(j, { width: 500, p: 2, children: /* @__PURE__ */ t(
|
|
1356
|
+
je,
|
|
1357
1357
|
{
|
|
1358
1358
|
value: e.componentId,
|
|
1359
|
-
onChange: (i,
|
|
1359
|
+
onChange: (i, u) => e.componentId = u,
|
|
1360
1360
|
allComponents: r
|
|
1361
1361
|
}
|
|
1362
1362
|
) }) }) }) })
|
|
@@ -1367,20 +1367,20 @@ function _r({
|
|
|
1367
1367
|
valueImmutable: r,
|
|
1368
1368
|
onChange: o,
|
|
1369
1369
|
defaultLocale: i,
|
|
1370
|
-
allComponents:
|
|
1370
|
+
allComponents: u
|
|
1371
1371
|
}) {
|
|
1372
1372
|
var g;
|
|
1373
|
-
const [p, d] = $(!1), { t: m, locale:
|
|
1374
|
-
return
|
|
1373
|
+
const [p, d] = $(!1), { t: m, locale: w } = N(), x = typeof (e == null ? void 0 : e.componentId) == "string" ? (g = u[e.componentId]) == null ? void 0 : g.data : void 0;
|
|
1374
|
+
return x ? /* @__PURE__ */ S(j, { sx: { width: "100%", position: "relative" }, children: [
|
|
1375
1375
|
/* @__PURE__ */ t(
|
|
1376
1376
|
ue,
|
|
1377
1377
|
{
|
|
1378
1378
|
sx: { minWidth: 0 },
|
|
1379
|
-
disabled: !
|
|
1379
|
+
disabled: !x,
|
|
1380
1380
|
size: "small",
|
|
1381
1381
|
onClick: () => d(!p),
|
|
1382
1382
|
color: p ? "primary" : "default",
|
|
1383
|
-
children: /* @__PURE__ */ t(
|
|
1383
|
+
children: /* @__PURE__ */ t(at, { fontSize: "small" })
|
|
1384
1384
|
}
|
|
1385
1385
|
),
|
|
1386
1386
|
/* @__PURE__ */ t(St, { in: p, timeout: "auto", unmountOnExit: !0, sx: { width: "100%", zIndex: 10 }, children: /* @__PURE__ */ S(
|
|
@@ -1396,17 +1396,17 @@ function _r({
|
|
|
1396
1396
|
width: "100%"
|
|
1397
1397
|
},
|
|
1398
1398
|
children: [
|
|
1399
|
-
/* @__PURE__ */ t(
|
|
1399
|
+
/* @__PURE__ */ t(j, { width: "100%", mb: 2, children: /* @__PURE__ */ t(
|
|
1400
1400
|
bt,
|
|
1401
1401
|
{
|
|
1402
|
-
config:
|
|
1403
|
-
currentLocale:
|
|
1402
|
+
config: x,
|
|
1403
|
+
currentLocale: w,
|
|
1404
1404
|
defaultLocale: i,
|
|
1405
|
-
allComponents:
|
|
1405
|
+
allComponents: u,
|
|
1406
1406
|
propertiesValue: e == null ? void 0 : e.properties,
|
|
1407
|
-
onChange: ({ id:
|
|
1407
|
+
onChange: ({ id: h, value: n }) => {
|
|
1408
1408
|
const s = tr(n.value), l = JSON.parse(JSON.stringify(e));
|
|
1409
|
-
r ? o == null || o({ ...l, properties: { ...l.properties, [
|
|
1409
|
+
r ? o == null || o({ ...l, properties: { ...l.properties, [h]: { value: s } } }) : (l.properties = l.properties ?? {}, l.properties[h] = { value: s }, o == null || o(l));
|
|
1410
1410
|
}
|
|
1411
1411
|
}
|
|
1412
1412
|
) }),
|
|
@@ -1421,24 +1421,24 @@ function ht({
|
|
|
1421
1421
|
component: r,
|
|
1422
1422
|
...o
|
|
1423
1423
|
}) {
|
|
1424
|
-
var
|
|
1424
|
+
var h, n, s;
|
|
1425
1425
|
const { t: i } = N(), {
|
|
1426
1426
|
state: {
|
|
1427
|
-
components:
|
|
1427
|
+
components: u,
|
|
1428
1428
|
supportedLocales: p,
|
|
1429
1429
|
config: { defaultLocale: d }
|
|
1430
1430
|
}
|
|
1431
|
-
} = ae(), m =
|
|
1431
|
+
} = ae(), m = ge(), w = te(r).doc, x = e === "properties" ? r.properties : e === "parameters" && ((h = r.renderer) == null ? void 0 : h.type) === "component" ? (n = u[r.renderer.componentId]) == null ? void 0 : n.data.properties : void 0, g = ((s = r.renderer) == null ? void 0 : s.type) === "component" ? r : void 0;
|
|
1432
1432
|
return /* @__PURE__ */ S(ke, { ...o, fullWidth: !0, maxWidth: "lg", children: [
|
|
1433
|
-
/* @__PURE__ */ t(
|
|
1434
|
-
/* @__PURE__ */ t(
|
|
1435
|
-
/* @__PURE__ */ t(
|
|
1436
|
-
|
|
1433
|
+
/* @__PURE__ */ t(Qe, { children: i("i18nEditorTitle") }),
|
|
1434
|
+
/* @__PURE__ */ t(Xe, { children: x && /* @__PURE__ */ t(z, { children: /* @__PURE__ */ S(He, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
|
|
1435
|
+
/* @__PURE__ */ t(Ye, { children: /* @__PURE__ */ t(le, { children: p.map(({ locale: l, name: a }) => /* @__PURE__ */ S(se, { children: [
|
|
1436
|
+
a,
|
|
1437
1437
|
d === l && /* @__PURE__ */ t(ar, { sx: { fontSize: 12, color: "text.secondary" } })
|
|
1438
1438
|
] }, l)) }) }),
|
|
1439
|
-
/* @__PURE__ */ t(
|
|
1440
|
-
var
|
|
1441
|
-
return /* @__PURE__ */ t(se, { children: /* @__PURE__ */ t(
|
|
1439
|
+
/* @__PURE__ */ t(Le, { children: V(Object.values(x), "index").map(({ data: l }) => /* @__PURE__ */ t(le, { children: p.map(({ locale: a }) => {
|
|
1440
|
+
var b, P, c, v, y, k, O, f, I, R, C, E, U, W, re, Y, L, G, q, Q, ze, Re, Ce, De, Ne, Ae;
|
|
1441
|
+
return /* @__PURE__ */ t(se, { children: /* @__PURE__ */ t(z, { gap: 1, children: e === "properties" ? /* @__PURE__ */ S(H, { children: [
|
|
1442
1442
|
/* @__PURE__ */ t(
|
|
1443
1443
|
D,
|
|
1444
1444
|
{
|
|
@@ -1446,7 +1446,7 @@ function ht({
|
|
|
1446
1446
|
label: "Key",
|
|
1447
1447
|
value: l.key || "",
|
|
1448
1448
|
onChange: (K) => {
|
|
1449
|
-
|
|
1449
|
+
w.transact(() => {
|
|
1450
1450
|
l.key = K.target.value.trim();
|
|
1451
1451
|
});
|
|
1452
1452
|
}
|
|
@@ -1457,16 +1457,16 @@ function ht({
|
|
|
1457
1457
|
{
|
|
1458
1458
|
size: "small",
|
|
1459
1459
|
label: i("label"),
|
|
1460
|
-
value: (((
|
|
1460
|
+
value: (((P = (b = l.locales) == null ? void 0 : b[a]) == null ? void 0 : P.name) ?? ((v = (c = l.locales) == null ? void 0 : c[d]) == null ? void 0 : v.name)) || "",
|
|
1461
1461
|
onChange: (K) => {
|
|
1462
|
-
|
|
1462
|
+
w.transact(() => {
|
|
1463
1463
|
var B;
|
|
1464
|
-
l.locales ?? (l.locales = {}), (B = l.locales)[
|
|
1464
|
+
l.locales ?? (l.locales = {}), (B = l.locales)[a] ?? (B[a] = {}), l.locales[a].name = K.target.value;
|
|
1465
1465
|
});
|
|
1466
1466
|
}
|
|
1467
1467
|
}
|
|
1468
1468
|
),
|
|
1469
|
-
/* @__PURE__ */ t(
|
|
1469
|
+
/* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
|
|
1470
1470
|
_,
|
|
1471
1471
|
{
|
|
1472
1472
|
allComponents: m,
|
|
@@ -1476,17 +1476,17 @@ function ht({
|
|
|
1476
1476
|
size: "small",
|
|
1477
1477
|
fullWidth: !0,
|
|
1478
1478
|
label: "Default Value",
|
|
1479
|
-
valueImmutable: de((
|
|
1480
|
-
value: ((
|
|
1479
|
+
valueImmutable: de((k = (y = l.locales) == null ? void 0 : y[a]) == null ? void 0 : k.defaultValue),
|
|
1480
|
+
value: ((f = (O = l.locales) == null ? void 0 : O[a]) == null ? void 0 : f.defaultValue) ?? ((R = (I = l.locales) == null ? void 0 : I[d]) == null ? void 0 : R.defaultValue),
|
|
1481
1481
|
onChange: (K) => {
|
|
1482
|
-
|
|
1482
|
+
w.transact(() => {
|
|
1483
1483
|
var B;
|
|
1484
|
-
l.locales ?? (l.locales = {}), (B = l.locales)[
|
|
1484
|
+
l.locales ?? (l.locales = {}), (B = l.locales)[a] ?? (B[a] = {}), l.locales[a].defaultValue = K;
|
|
1485
1485
|
});
|
|
1486
1486
|
}
|
|
1487
1487
|
}
|
|
1488
1488
|
) })
|
|
1489
|
-
] }) : e === "parameters" && g ? /* @__PURE__ */ t(
|
|
1489
|
+
] }) : e === "parameters" && g ? /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
|
|
1490
1490
|
_,
|
|
1491
1491
|
{
|
|
1492
1492
|
allComponents: m,
|
|
@@ -1496,33 +1496,33 @@ function ht({
|
|
|
1496
1496
|
size: "small",
|
|
1497
1497
|
fullWidth: !0,
|
|
1498
1498
|
valueImmutable: de(
|
|
1499
|
-
(W = (U = (E = (C = g.renderer.properties) == null ? void 0 : C[l.id]) == null ? void 0 : E.locales) == null ? void 0 : U[
|
|
1499
|
+
(W = (U = (E = (C = g.renderer.properties) == null ? void 0 : C[l.id]) == null ? void 0 : E.locales) == null ? void 0 : U[a]) == null ? void 0 : W.value
|
|
1500
1500
|
),
|
|
1501
|
-
value: ((G = (L = (Y = (re = g.renderer.properties) == null ? void 0 : re[l.id]) == null ? void 0 : Y.locales) == null ? void 0 : L[
|
|
1501
|
+
value: ((G = (L = (Y = (re = g.renderer.properties) == null ? void 0 : re[l.id]) == null ? void 0 : Y.locales) == null ? void 0 : L[a]) == null ? void 0 : G.value) ?? ((Re = (ze = (Q = (q = g.renderer.properties) == null ? void 0 : q[l.id]) == null ? void 0 : Q.locales) == null ? void 0 : ze[d]) == null ? void 0 : Re.value) ?? ((De = (Ce = l.locales) == null ? void 0 : Ce[a]) == null ? void 0 : De.defaultValue) ?? ((Ae = (Ne = l.locales) == null ? void 0 : Ne[d]) == null ? void 0 : Ae.defaultValue),
|
|
1502
1502
|
onChange: (K) => {
|
|
1503
|
-
|
|
1504
|
-
var B,
|
|
1505
|
-
(B = g.renderer).properties ?? (B.properties = {}), (
|
|
1503
|
+
w.transact(() => {
|
|
1504
|
+
var B, Te, Ve, Ee, Ue;
|
|
1505
|
+
(B = g.renderer).properties ?? (B.properties = {}), (Te = g.renderer.properties)[Ve = l.id] ?? (Te[Ve] = {}), (Ee = g.renderer.properties[l.id]).locales ?? (Ee.locales = {}), (Ue = g.renderer.properties[l.id].locales)[a] ?? (Ue[a] = {}), g.renderer.properties[l.id].locales[a].value = K;
|
|
1506
1506
|
});
|
|
1507
1507
|
}
|
|
1508
1508
|
}
|
|
1509
|
-
) }) : null }, l.id) },
|
|
1509
|
+
) }) : null }, l.id) }, a);
|
|
1510
1510
|
}) }, l.id)) })
|
|
1511
1511
|
] }) }) }),
|
|
1512
|
-
/* @__PURE__ */ t(
|
|
1513
|
-
var
|
|
1514
|
-
return (
|
|
1512
|
+
/* @__PURE__ */ t(Ze, { children: /* @__PURE__ */ t(T, { onClick: (l) => {
|
|
1513
|
+
var a;
|
|
1514
|
+
return (a = o.onClose) == null ? void 0 : a.call(o, l, "escapeKeyDown");
|
|
1515
1515
|
}, children: i("close") }) })
|
|
1516
1516
|
] });
|
|
1517
1517
|
}
|
|
1518
|
-
const
|
|
1518
|
+
const _e = (e, r) => (o) => {
|
|
1519
1519
|
const i = [
|
|
1520
1520
|
o.palette.info.main,
|
|
1521
1521
|
o.palette.primary.main,
|
|
1522
1522
|
o.palette.secondary.main,
|
|
1523
1523
|
o.palette.success.main,
|
|
1524
1524
|
o.palette.warning.main
|
|
1525
|
-
],
|
|
1525
|
+
], u = Math.min(i.length - 1, e), p = i[u], d = Ke(p, 0.5), m = Ke(p, 1);
|
|
1526
1526
|
return {
|
|
1527
1527
|
// 保留原有的边框样式
|
|
1528
1528
|
borderColor: `${d} !important`,
|
|
@@ -1540,16 +1540,16 @@ function Jr({
|
|
|
1540
1540
|
defaultLocale: o,
|
|
1541
1541
|
allComponents: i
|
|
1542
1542
|
}) {
|
|
1543
|
-
const { t:
|
|
1543
|
+
const { t: u, locale: p } = N(), d = F(null), m = Br(d, e), w = A(() => {
|
|
1544
1544
|
if (!(e.type !== "json" && e.type !== "yaml" && e.type !== "array") && e.subProperties)
|
|
1545
1545
|
try {
|
|
1546
|
-
const
|
|
1546
|
+
const x = {};
|
|
1547
1547
|
V(Object.values(e.subProperties), "index").filter(
|
|
1548
1548
|
(n) => n.data.visible !== !1 && n.data.key
|
|
1549
1549
|
).forEach(({ data: n }) => {
|
|
1550
|
-
var l,
|
|
1550
|
+
var l, a, b, P;
|
|
1551
1551
|
if (!n.key) return;
|
|
1552
|
-
let s = ((
|
|
1552
|
+
let s = ((a = (l = n.locales) == null ? void 0 : l[p]) == null ? void 0 : a.defaultValue) ?? ((P = (b = n.locales) == null ? void 0 : b[o]) == null ? void 0 : P.defaultValue);
|
|
1553
1553
|
if (n.type === "number")
|
|
1554
1554
|
s = Number(s);
|
|
1555
1555
|
else if (n.type === "boolean")
|
|
@@ -1560,24 +1560,24 @@ function Jr({
|
|
|
1560
1560
|
} catch (c) {
|
|
1561
1561
|
console.error("Error parsing nested value", s, c), s = {};
|
|
1562
1562
|
}
|
|
1563
|
-
|
|
1563
|
+
x[n.key] = s;
|
|
1564
1564
|
});
|
|
1565
|
-
const
|
|
1566
|
-
r == null || r(
|
|
1567
|
-
} catch (
|
|
1568
|
-
console.error("Error converting structure to text:",
|
|
1565
|
+
const h = xe(x, e.type);
|
|
1566
|
+
r == null || r(h);
|
|
1567
|
+
} catch (x) {
|
|
1568
|
+
console.error("Error converting structure to text:", x);
|
|
1569
1569
|
}
|
|
1570
1570
|
}, [e, p, o, r]);
|
|
1571
|
-
return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(
|
|
1572
|
-
/* @__PURE__ */ t(Ot, { sx: { mt: -1 }, children: /* @__PURE__ */ t(J, { variant: "caption", color: "text.secondary", children:
|
|
1571
|
+
return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(z, { direction: "column", gap: 1.5, sx: { width: "100%" }, ref: d, children: [
|
|
1572
|
+
/* @__PURE__ */ t(Ot, { sx: { mt: -1 }, children: /* @__PURE__ */ t(J, { variant: "caption", color: "text.secondary", children: u("maker.properties.subProperties") }) }),
|
|
1573
1573
|
e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ t(
|
|
1574
|
-
|
|
1574
|
+
mt,
|
|
1575
1575
|
{
|
|
1576
|
-
component:
|
|
1576
|
+
component: z,
|
|
1577
1577
|
gap: 2,
|
|
1578
1578
|
list: e.subProperties,
|
|
1579
|
-
renderItem: (
|
|
1580
|
-
const n =
|
|
1579
|
+
renderItem: (x, g, h) => {
|
|
1580
|
+
const n = x.visible !== !1;
|
|
1581
1581
|
return /* @__PURE__ */ t(
|
|
1582
1582
|
ee,
|
|
1583
1583
|
{
|
|
@@ -1587,13 +1587,13 @@ function Jr({
|
|
|
1587
1587
|
p: 1.25,
|
|
1588
1588
|
borderRadius: 1,
|
|
1589
1589
|
border: n ? "1px solid" : "1px dashed",
|
|
1590
|
-
"&":
|
|
1590
|
+
"&": _e(m)
|
|
1591
1591
|
},
|
|
1592
|
-
children: /* @__PURE__ */ t(
|
|
1592
|
+
children: /* @__PURE__ */ t(z, { gap: 2, children: /* @__PURE__ */ t(
|
|
1593
1593
|
ft,
|
|
1594
1594
|
{
|
|
1595
|
-
data:
|
|
1596
|
-
params:
|
|
1595
|
+
data: x,
|
|
1596
|
+
params: h,
|
|
1597
1597
|
visible: n,
|
|
1598
1598
|
config: {
|
|
1599
1599
|
properties: e.subProperties
|
|
@@ -1605,11 +1605,11 @@ function Jr({
|
|
|
1605
1605
|
try {
|
|
1606
1606
|
const l = { properties: e.subProperties || {} };
|
|
1607
1607
|
s(l);
|
|
1608
|
-
const
|
|
1608
|
+
const a = {
|
|
1609
1609
|
...e,
|
|
1610
1610
|
subProperties: l.properties
|
|
1611
1611
|
};
|
|
1612
|
-
r == null || r(
|
|
1612
|
+
r == null || r(a, { forceUpdateProperty: !0 }), w();
|
|
1613
1613
|
} catch (l) {
|
|
1614
1614
|
console.error("Error updating property:", l);
|
|
1615
1615
|
}
|
|
@@ -1617,11 +1617,11 @@ function Jr({
|
|
|
1617
1617
|
}
|
|
1618
1618
|
) })
|
|
1619
1619
|
},
|
|
1620
|
-
|
|
1620
|
+
x.id
|
|
1621
1621
|
);
|
|
1622
1622
|
}
|
|
1623
1623
|
}
|
|
1624
|
-
) : /* @__PURE__ */ t(Z, { style: { fontSize: 12, height: 100 }, children:
|
|
1624
|
+
) : /* @__PURE__ */ t(Z, { style: { fontSize: 12, height: 100 }, children: u("maker.properties.noSubProperties") }),
|
|
1625
1625
|
/* @__PURE__ */ t(
|
|
1626
1626
|
T,
|
|
1627
1627
|
{
|
|
@@ -1629,11 +1629,11 @@ function Jr({
|
|
|
1629
1629
|
variant: "outlined",
|
|
1630
1630
|
className: "ignore-style-override",
|
|
1631
1631
|
size: "small",
|
|
1632
|
-
startIcon: /* @__PURE__ */ t(
|
|
1632
|
+
startIcon: /* @__PURE__ */ t(ct, {}),
|
|
1633
1633
|
onClick: () => {
|
|
1634
1634
|
try {
|
|
1635
|
-
const
|
|
1636
|
-
index: Object.values(
|
|
1635
|
+
const x = e.subProperties || {}, g = Me(), n = {
|
|
1636
|
+
index: Object.values(x).length,
|
|
1637
1637
|
data: {
|
|
1638
1638
|
id: g,
|
|
1639
1639
|
key: "",
|
|
@@ -1651,21 +1651,21 @@ function Jr({
|
|
|
1651
1651
|
}, s = {
|
|
1652
1652
|
...e,
|
|
1653
1653
|
subProperties: {
|
|
1654
|
-
...
|
|
1654
|
+
...x,
|
|
1655
1655
|
[g]: n
|
|
1656
1656
|
}
|
|
1657
1657
|
};
|
|
1658
|
-
r == null || r(s, { forceUpdateProperty: !0 }),
|
|
1659
|
-
} catch (
|
|
1660
|
-
console.error("Error adding property:",
|
|
1658
|
+
r == null || r(s, { forceUpdateProperty: !0 }), w();
|
|
1659
|
+
} catch (x) {
|
|
1660
|
+
console.error("Error adding property:", x);
|
|
1661
1661
|
}
|
|
1662
1662
|
},
|
|
1663
1663
|
sx: {
|
|
1664
|
-
"&":
|
|
1664
|
+
"&": _e(m, {
|
|
1665
1665
|
// borderLeft: undefined,
|
|
1666
1666
|
})
|
|
1667
1667
|
},
|
|
1668
|
-
children:
|
|
1668
|
+
children: u("maker.properties.addSubProperty")
|
|
1669
1669
|
}
|
|
1670
1670
|
)
|
|
1671
1671
|
] });
|
|
@@ -1675,21 +1675,21 @@ function _({
|
|
|
1675
1675
|
property: r,
|
|
1676
1676
|
value: o,
|
|
1677
1677
|
onChange: i,
|
|
1678
|
-
valueImmutable:
|
|
1678
|
+
valueImmutable: u,
|
|
1679
1679
|
defaultLocale: p,
|
|
1680
1680
|
allComponents: d,
|
|
1681
1681
|
...m
|
|
1682
1682
|
}) {
|
|
1683
|
-
var s, l,
|
|
1684
|
-
const { locale:
|
|
1685
|
-
var
|
|
1686
|
-
const c = (
|
|
1687
|
-
c == null || c.open(), g.current && c.onceUploadSuccess(({ response:
|
|
1688
|
-
var O,
|
|
1689
|
-
let
|
|
1690
|
-
|
|
1683
|
+
var s, l, a, b, P;
|
|
1684
|
+
const { locale: w } = N(), x = Zt(), g = F(null), h = () => {
|
|
1685
|
+
var v;
|
|
1686
|
+
const c = (v = x == null ? void 0 : x.current) == null ? void 0 : v.getUploader();
|
|
1687
|
+
c == null || c.open(), g.current && c.onceUploadSuccess(({ response: y }) => {
|
|
1688
|
+
var O, f;
|
|
1689
|
+
let k = ((O = y == null ? void 0 : y.data) == null ? void 0 : O.filename) || "";
|
|
1690
|
+
k && (k = `mediakit://${k}`, o && !o.includes("mediakit://") && (k += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), (f = g.current) == null || f.call(g, k);
|
|
1691
1691
|
});
|
|
1692
|
-
}, n = m.label ?? (((l = (s = r.locales) == null ? void 0 : s[
|
|
1692
|
+
}, n = m.label ?? (((l = (s = r.locales) == null ? void 0 : s[w]) == null ? void 0 : l.name) || ((b = (a = r.locales) == null ? void 0 : a[p]) == null ? void 0 : b.name) || r.key || r.id);
|
|
1693
1693
|
if (r.type === "number")
|
|
1694
1694
|
return /* @__PURE__ */ t(
|
|
1695
1695
|
$r,
|
|
@@ -1698,7 +1698,7 @@ function _({
|
|
|
1698
1698
|
label: n,
|
|
1699
1699
|
NumberProps: {
|
|
1700
1700
|
value: ["number", "string"].includes(typeof o) ? o : null,
|
|
1701
|
-
onChange: (c,
|
|
1701
|
+
onChange: (c, v) => i == null ? void 0 : i(v)
|
|
1702
1702
|
}
|
|
1703
1703
|
}
|
|
1704
1704
|
);
|
|
@@ -1711,25 +1711,25 @@ function _({
|
|
|
1711
1711
|
type: "text",
|
|
1712
1712
|
value: o ?? "",
|
|
1713
1713
|
onChange: (c) => {
|
|
1714
|
-
const
|
|
1715
|
-
if (
|
|
1716
|
-
i == null || i(
|
|
1714
|
+
const v = c.target.value;
|
|
1715
|
+
if (v === "" || v === "-") {
|
|
1716
|
+
i == null || i(v);
|
|
1717
1717
|
return;
|
|
1718
1718
|
}
|
|
1719
|
-
if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(
|
|
1720
|
-
let
|
|
1721
|
-
/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(
|
|
1719
|
+
if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(v)) {
|
|
1720
|
+
let k = v;
|
|
1721
|
+
/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(k) && (k = Number(k)), i == null || i(k);
|
|
1722
1722
|
}
|
|
1723
1723
|
}
|
|
1724
1724
|
}
|
|
1725
1725
|
);
|
|
1726
1726
|
if (r.type === "boolean")
|
|
1727
1727
|
return /* @__PURE__ */ t(
|
|
1728
|
-
|
|
1728
|
+
Ge,
|
|
1729
1729
|
{
|
|
1730
1730
|
label: n,
|
|
1731
1731
|
labelPlacement: "start",
|
|
1732
|
-
control: /* @__PURE__ */ t(
|
|
1732
|
+
control: /* @__PURE__ */ t(qe, { checked: o === !0, onChange: (c, v) => i == null ? void 0 : i(v) })
|
|
1733
1733
|
}
|
|
1734
1734
|
);
|
|
1735
1735
|
if (r.type === "color")
|
|
@@ -1758,18 +1758,18 @@ function _({
|
|
|
1758
1758
|
allComponents: d,
|
|
1759
1759
|
PropertyValueField: _,
|
|
1760
1760
|
onUpload: (c) => {
|
|
1761
|
-
g.current = c,
|
|
1761
|
+
g.current = c, h();
|
|
1762
1762
|
}
|
|
1763
1763
|
}
|
|
1764
1764
|
);
|
|
1765
1765
|
if (r.type === "custom") {
|
|
1766
|
-
const c = (
|
|
1767
|
-
return c ? /* @__PURE__ */ t(
|
|
1768
|
-
|
|
1766
|
+
const c = (P = d[r.componentId]) == null ? void 0 : P.data;
|
|
1767
|
+
return c ? /* @__PURE__ */ t(j, { width: "100%", children: /* @__PURE__ */ t(
|
|
1768
|
+
lt,
|
|
1769
1769
|
{
|
|
1770
1770
|
componentId: c.id,
|
|
1771
1771
|
props: { label: n, value: o, onChange: i },
|
|
1772
|
-
locale:
|
|
1772
|
+
locale: w,
|
|
1773
1773
|
dev: {
|
|
1774
1774
|
mode: "draft",
|
|
1775
1775
|
components: d,
|
|
@@ -1779,15 +1779,15 @@ function _({
|
|
|
1779
1779
|
) }) : /* @__PURE__ */ t(D, { ...m, label: n, disabled: !0, placeholder: "Click right button select a component" });
|
|
1780
1780
|
}
|
|
1781
1781
|
if (r.type === "component")
|
|
1782
|
-
return /* @__PURE__ */ S(
|
|
1782
|
+
return /* @__PURE__ */ S(z, { width: "100%", direction: "column", gap: 1, children: [
|
|
1783
1783
|
/* @__PURE__ */ t(
|
|
1784
|
-
|
|
1784
|
+
je,
|
|
1785
1785
|
{
|
|
1786
1786
|
allComponents: d,
|
|
1787
1787
|
label: n,
|
|
1788
1788
|
value: o == null ? void 0 : o.componentId,
|
|
1789
|
-
onChange: (c,
|
|
1790
|
-
|
|
1789
|
+
onChange: (c, v) => {
|
|
1790
|
+
u || !o ? i == null || i({ ...o && JSON.parse(JSON.stringify(o)), componentId: v }) : typeof o == "object" && (o.componentId = v, i == null || i({ ...o && JSON.parse(JSON.stringify(o)), componentId: v }));
|
|
1791
1791
|
}
|
|
1792
1792
|
}
|
|
1793
1793
|
),
|
|
@@ -1795,7 +1795,7 @@ function _({
|
|
|
1795
1795
|
_r,
|
|
1796
1796
|
{
|
|
1797
1797
|
value: o,
|
|
1798
|
-
valueImmutable:
|
|
1798
|
+
valueImmutable: u,
|
|
1799
1799
|
onChange: i,
|
|
1800
1800
|
defaultLocale: p,
|
|
1801
1801
|
allComponents: d
|
|
@@ -1803,42 +1803,42 @@ function _({
|
|
|
1803
1803
|
)
|
|
1804
1804
|
] });
|
|
1805
1805
|
if (!r.type || ["string", "url"].includes(r.type)) {
|
|
1806
|
-
const c = r.type === "string" ? r.multiline : void 0,
|
|
1806
|
+
const c = r.type === "string" ? r.multiline : void 0, v = r.type === "url" ? o == null ? void 0 : o.url : o;
|
|
1807
1807
|
return /* @__PURE__ */ t(
|
|
1808
1808
|
D,
|
|
1809
1809
|
{
|
|
1810
1810
|
...m,
|
|
1811
1811
|
label: n,
|
|
1812
|
-
value: typeof
|
|
1812
|
+
value: typeof v == "string" ? v : "",
|
|
1813
1813
|
multiline: c,
|
|
1814
1814
|
minRows: c ? 2 : void 0,
|
|
1815
1815
|
maxRows: c ? 10 : void 0,
|
|
1816
|
-
onChange: (
|
|
1817
|
-
r.type === "url" ? { ...o, url:
|
|
1816
|
+
onChange: (y) => i == null ? void 0 : i(
|
|
1817
|
+
r.type === "url" ? { ...o, url: y.target.value, mediaKitUrl: y.target.value } : y.target.value
|
|
1818
1818
|
),
|
|
1819
1819
|
InputProps: r.type === "url" ? {
|
|
1820
1820
|
sx: { pr: 0 },
|
|
1821
1821
|
endAdornment: /* @__PURE__ */ S(pe, { position: "end", children: [
|
|
1822
1822
|
/* @__PURE__ */ t(
|
|
1823
|
-
|
|
1823
|
+
Pe,
|
|
1824
1824
|
{
|
|
1825
|
-
onChange: async ({ response:
|
|
1825
|
+
onChange: async ({ response: y }) => {
|
|
1826
1826
|
var I, R, C;
|
|
1827
|
-
const
|
|
1827
|
+
const k = ((I = y == null ? void 0 : y.data) == null ? void 0 : I.url) || ((R = y == null ? void 0 : y.data) == null ? void 0 : R.fileUrl);
|
|
1828
1828
|
let O;
|
|
1829
|
-
|
|
1829
|
+
k && (O = await fe(k).catch(() => he(k)).catch(() => {
|
|
1830
1830
|
}));
|
|
1831
|
-
let
|
|
1832
|
-
|
|
1833
|
-
url:
|
|
1834
|
-
mediaKitUrl:
|
|
1831
|
+
let f = ((C = y == null ? void 0 : y.data) == null ? void 0 : C.filename) || "";
|
|
1832
|
+
f && (f = `mediakit://${f}`), i == null || i({
|
|
1833
|
+
url: k,
|
|
1834
|
+
mediaKitUrl: f,
|
|
1835
1835
|
width: O == null ? void 0 : O.naturalWidth,
|
|
1836
1836
|
height: O == null ? void 0 : O.naturalHeight
|
|
1837
1837
|
});
|
|
1838
1838
|
}
|
|
1839
1839
|
}
|
|
1840
1840
|
),
|
|
1841
|
-
/* @__PURE__ */ t(X, { 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__ */ t(
|
|
1841
|
+
/* @__PURE__ */ t(X, { 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__ */ t(dt, { sx: { cursor: "default" }, fontSize: "small" }) })
|
|
1842
1842
|
] })
|
|
1843
1843
|
} : void 0
|
|
1844
1844
|
}
|
|
@@ -1851,23 +1851,23 @@ function _({
|
|
|
1851
1851
|
value: Array.isArray(o) ? o : [],
|
|
1852
1852
|
onChange: (c) => i == null ? void 0 : i(c),
|
|
1853
1853
|
property: r,
|
|
1854
|
-
renderItem: ({ item: c, index:
|
|
1854
|
+
renderItem: ({ item: c, index: v, onChange: y }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(z, { gap: 1, width: "100%", children: V(Object.values(r.subProperties), "index").filter((k) => k.data.visible !== !1).map(({ data: k }) => k.key ? /* @__PURE__ */ t(
|
|
1855
1855
|
_,
|
|
1856
1856
|
{
|
|
1857
1857
|
component: e,
|
|
1858
|
-
property:
|
|
1859
|
-
value: c[
|
|
1858
|
+
property: k,
|
|
1859
|
+
value: c[k.key],
|
|
1860
1860
|
onChange: (O) => {
|
|
1861
|
-
const
|
|
1862
|
-
|
|
1861
|
+
const f = { ...c, [k.key]: O };
|
|
1862
|
+
y(f);
|
|
1863
1863
|
},
|
|
1864
1864
|
size: "small",
|
|
1865
1865
|
fullWidth: !0,
|
|
1866
1866
|
defaultLocale: p,
|
|
1867
1867
|
allComponents: d
|
|
1868
1868
|
},
|
|
1869
|
-
|
|
1870
|
-
) : null) },
|
|
1869
|
+
k.id
|
|
1870
|
+
) : null) }, v) : /* @__PURE__ */ t(D, { size: m.size, fullWidth: !0, value: c, onChange: (k) => y(k.target.value) })
|
|
1871
1871
|
}
|
|
1872
1872
|
) : (console.error("Unsupported property type", r.type), null);
|
|
1873
1873
|
}
|
|
@@ -1892,38 +1892,38 @@ export default function () {
|
|
|
1892
1892
|
function Yr({
|
|
1893
1893
|
value: e
|
|
1894
1894
|
}) {
|
|
1895
|
-
const { locale: r } = N(), o =
|
|
1895
|
+
const { locale: r } = N(), o = it(), i = te(e).doc;
|
|
1896
1896
|
return M(() => {
|
|
1897
|
-
var
|
|
1898
|
-
(
|
|
1897
|
+
var u;
|
|
1898
|
+
(u = e.renderer) != null && u.script || (i.transact(() => {
|
|
1899
1899
|
e.renderer.script = e.renderer.type === "react-component" ? Mr : Hr;
|
|
1900
1900
|
}), o());
|
|
1901
|
-
}, [e]), /* @__PURE__ */ t(
|
|
1902
|
-
|
|
1901
|
+
}, [e]), /* @__PURE__ */ t(j, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ t(
|
|
1902
|
+
we,
|
|
1903
1903
|
{
|
|
1904
1904
|
keyId: e.id,
|
|
1905
1905
|
locale: r,
|
|
1906
1906
|
language: "typescript",
|
|
1907
1907
|
value: e.renderer.script || "",
|
|
1908
|
-
onChange: (
|
|
1908
|
+
onChange: (u) => e.renderer.script = u,
|
|
1909
1909
|
typeScriptNoValidation: !1
|
|
1910
1910
|
},
|
|
1911
1911
|
e.id
|
|
1912
1912
|
) });
|
|
1913
1913
|
}
|
|
1914
1914
|
function Lr({ value: e }) {
|
|
1915
|
-
var g,
|
|
1915
|
+
var g, h, n;
|
|
1916
1916
|
const { t: r } = N(), o = te(e).doc, {
|
|
1917
1917
|
state: {
|
|
1918
1918
|
components: i,
|
|
1919
|
-
config: { defaultLocale:
|
|
1919
|
+
config: { defaultLocale: u },
|
|
1920
1920
|
resources: p
|
|
1921
1921
|
},
|
|
1922
1922
|
localState: { currentLocale: d }
|
|
1923
|
-
} = ae(), m =
|
|
1924
|
-
return /* @__PURE__ */ S(
|
|
1923
|
+
} = ae(), m = ge(), w = ((g = i[e.renderer.componentId]) == null ? void 0 : g.data) ?? ((n = (h = p.components) == null ? void 0 : h[e.renderer.componentId]) == null ? void 0 : n.component), x = Se({ variant: "dialog" });
|
|
1924
|
+
return /* @__PURE__ */ S(z, { gap: 1, children: [
|
|
1925
1925
|
/* @__PURE__ */ t(
|
|
1926
|
-
|
|
1926
|
+
je,
|
|
1927
1927
|
{
|
|
1928
1928
|
allComponents: m,
|
|
1929
1929
|
excludes: [e.id],
|
|
@@ -1931,24 +1931,24 @@ function Lr({ value: e }) {
|
|
|
1931
1931
|
onChange: (s, l) => e.renderer.componentId = l
|
|
1932
1932
|
}
|
|
1933
1933
|
),
|
|
1934
|
-
|
|
1935
|
-
/* @__PURE__ */ S(
|
|
1934
|
+
w && /* @__PURE__ */ S(H, { children: [
|
|
1935
|
+
/* @__PURE__ */ S(z, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
1936
1936
|
/* @__PURE__ */ t(J, { variant: "subtitle2", children: r("parameters") }),
|
|
1937
|
-
/* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...
|
|
1937
|
+
/* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Oe(x), children: /* @__PURE__ */ t(st, { fontSize: "small" }) })
|
|
1938
1938
|
] }),
|
|
1939
|
-
|
|
1940
|
-
var l,
|
|
1941
|
-
return /* @__PURE__ */ t(
|
|
1939
|
+
w.properties && V(Object.values(w.properties), "index").map(({ data: s }) => {
|
|
1940
|
+
var l, a, b, P, c, v, y, k, O, f, I, R, C, E, U, W;
|
|
1941
|
+
return /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
|
|
1942
1942
|
_,
|
|
1943
1943
|
{
|
|
1944
1944
|
allComponents: m,
|
|
1945
|
-
defaultLocale:
|
|
1946
|
-
component:
|
|
1945
|
+
defaultLocale: u,
|
|
1946
|
+
component: w,
|
|
1947
1947
|
property: s,
|
|
1948
1948
|
fullWidth: !0,
|
|
1949
1949
|
size: "small",
|
|
1950
|
-
valueImmutable: de((
|
|
1951
|
-
value: ((
|
|
1950
|
+
valueImmutable: de((P = (b = (a = (l = e.renderer.properties) == null ? void 0 : l[s.id]) == null ? void 0 : a.locales) == null ? void 0 : b[d]) == null ? void 0 : P.value),
|
|
1951
|
+
value: ((k = (y = (v = (c = e.renderer.properties) == null ? void 0 : c[s.id]) == null ? void 0 : v.locales) == null ? void 0 : y[d]) == null ? void 0 : k.value) ?? ((R = (I = (f = (O = e.renderer.properties) == null ? void 0 : O[s.id]) == null ? void 0 : f.locales) == null ? void 0 : I[u]) == null ? void 0 : R.value) ?? ((E = (C = s.locales) == null ? void 0 : C[d]) == null ? void 0 : E.defaultValue) ?? ((W = (U = s.locales) == null ? void 0 : U[u]) == null ? void 0 : W.defaultValue),
|
|
1952
1952
|
onChange: (re) => {
|
|
1953
1953
|
o.transact(() => {
|
|
1954
1954
|
var Y, L, G, q, Q;
|
|
@@ -1958,41 +1958,41 @@ function Lr({ value: e }) {
|
|
|
1958
1958
|
}
|
|
1959
1959
|
) }, s.id);
|
|
1960
1960
|
}),
|
|
1961
|
-
/* @__PURE__ */ t(ht, { ...
|
|
1961
|
+
/* @__PURE__ */ t(ht, { ...ut(x), component: e, type: "parameters" })
|
|
1962
1962
|
] })
|
|
1963
1963
|
] });
|
|
1964
1964
|
}
|
|
1965
|
-
function
|
|
1965
|
+
function je({
|
|
1966
1966
|
label: e,
|
|
1967
1967
|
options: r,
|
|
1968
1968
|
excludes: o,
|
|
1969
1969
|
value: i,
|
|
1970
|
-
onChange:
|
|
1970
|
+
onChange: u,
|
|
1971
1971
|
allComponents: p,
|
|
1972
1972
|
...d
|
|
1973
1973
|
}) {
|
|
1974
1974
|
var g;
|
|
1975
|
-
const { t: m } = N(),
|
|
1975
|
+
const { t: m } = N(), w = r ?? V(Object.values(hr(p, ...o ?? [])), "index").map((h) => h.data), x = (typeof i == "string" ? (g = p[i]) == null ? void 0 : g.data : void 0) ?? null;
|
|
1976
1976
|
return /* @__PURE__ */ t(
|
|
1977
|
-
|
|
1977
|
+
et,
|
|
1978
1978
|
{
|
|
1979
1979
|
...d,
|
|
1980
1980
|
size: "small",
|
|
1981
|
-
options:
|
|
1981
|
+
options: w,
|
|
1982
1982
|
autoHighlight: !0,
|
|
1983
|
-
isOptionEqualToValue: (
|
|
1984
|
-
getOptionKey: (
|
|
1985
|
-
getOptionLabel: (
|
|
1986
|
-
renderInput: (
|
|
1987
|
-
value:
|
|
1988
|
-
onChange: (
|
|
1989
|
-
var l,
|
|
1983
|
+
isOptionEqualToValue: (h, n) => h.id === n.id,
|
|
1984
|
+
getOptionKey: (h) => h.id,
|
|
1985
|
+
getOptionLabel: (h) => h.name || h.id,
|
|
1986
|
+
renderInput: (h) => /* @__PURE__ */ t(D, { label: e || m("component"), ...h }),
|
|
1987
|
+
value: x,
|
|
1988
|
+
onChange: (h, n) => {
|
|
1989
|
+
var l, a, b, P, c, v;
|
|
1990
1990
|
let s = {};
|
|
1991
1991
|
n && (s = {
|
|
1992
1992
|
blockletId: (l = p[n == null ? void 0 : n.id]) == null ? void 0 : l.blockletId,
|
|
1993
|
-
blockletTitle: (
|
|
1994
|
-
componentName: ((
|
|
1995
|
-
}),
|
|
1993
|
+
blockletTitle: (a = p[n == null ? void 0 : n.id]) == null ? void 0 : a.blockletTitle,
|
|
1994
|
+
componentName: ((P = (b = p[n == null ? void 0 : n.id]) == null ? void 0 : b.data) == null ? void 0 : P.name) || ((v = (c = p[n == null ? void 0 : n.id]) == null ? void 0 : c.data) == null ? void 0 : v.id)
|
|
1995
|
+
}), u == null || u(h, n == null ? void 0 : n.id, s);
|
|
1996
1996
|
}
|
|
1997
1997
|
}
|
|
1998
1998
|
);
|
|
@@ -2002,52 +2002,52 @@ function bt({
|
|
|
2002
2002
|
allComponents: r,
|
|
2003
2003
|
defaultLocale: o,
|
|
2004
2004
|
propertiesValue: i,
|
|
2005
|
-
currentLocale:
|
|
2005
|
+
currentLocale: u,
|
|
2006
2006
|
onChange: p,
|
|
2007
2007
|
props: d
|
|
2008
2008
|
}) {
|
|
2009
|
-
const { t: m } = N(), [
|
|
2009
|
+
const { t: m } = N(), [w, x] = $(e == null ? void 0 : e.properties), [g, h] = $(null);
|
|
2010
2010
|
M(() => {
|
|
2011
2011
|
(() => {
|
|
2012
|
-
var
|
|
2013
|
-
((
|
|
2014
|
-
const
|
|
2015
|
-
|
|
2016
|
-
}) :
|
|
2012
|
+
var P, c;
|
|
2013
|
+
((P = e == null ? void 0 : e.renderer) == null ? void 0 : P.type) === "react-component" && ot(e == null ? void 0 : e.properties) ? rr((c = e == null ? void 0 : e.renderer) == null ? void 0 : c.script).then((v) => {
|
|
2014
|
+
const y = ir(v);
|
|
2015
|
+
x(y);
|
|
2016
|
+
}) : x(e == null ? void 0 : e.properties);
|
|
2017
2017
|
})();
|
|
2018
2018
|
}, [JSON.stringify(e)]);
|
|
2019
|
-
const n = A(() => !e || !
|
|
2020
|
-
(
|
|
2021
|
-
var
|
|
2022
|
-
const c =
|
|
2023
|
-
return
|
|
2019
|
+
const n = A(() => !e || !w ? {} : Object.values(w).reduce(
|
|
2020
|
+
(b, { data: P }) => {
|
|
2021
|
+
var v, y, k, O, f;
|
|
2022
|
+
const c = P.key || P.id;
|
|
2023
|
+
return b[P.id] = {
|
|
2024
2024
|
key: c,
|
|
2025
|
-
value: (d == null ? void 0 : d[c]) ?? ((
|
|
2026
|
-
id:
|
|
2027
|
-
type:
|
|
2028
|
-
},
|
|
2025
|
+
value: (d == null ? void 0 : d[c]) ?? ((v = i == null ? void 0 : i[P.id]) == null ? void 0 : v.value) ?? ((k = (y = P.locales) == null ? void 0 : y[u]) == null ? void 0 : k.defaultValue) ?? ((f = (O = P.locales) == null ? void 0 : O[o]) == null ? void 0 : f.defaultValue),
|
|
2026
|
+
id: P.id,
|
|
2027
|
+
type: P.type
|
|
2028
|
+
}, b;
|
|
2029
2029
|
},
|
|
2030
2030
|
{}
|
|
2031
|
-
), [JSON.stringify(
|
|
2032
|
-
if (!
|
|
2031
|
+
), [JSON.stringify(w), e, i, u, o]), s = ce(() => {
|
|
2032
|
+
if (!w)
|
|
2033
2033
|
return {
|
|
2034
2034
|
canUseProperties: [],
|
|
2035
2035
|
visibleProperties: [],
|
|
2036
2036
|
canUsePropertiesKeys: []
|
|
2037
2037
|
};
|
|
2038
|
-
const
|
|
2038
|
+
const b = V(Object.values(w), "index"), P = b.filter(({ data: y }) => y.key && ve(w, y.id)), c = b.filter(({ data: y }) => y.key && y.type !== "component"), v = c.map(({ data: y }) => y.key);
|
|
2039
2039
|
return {
|
|
2040
2040
|
canUseProperties: c,
|
|
2041
|
-
visibleProperties:
|
|
2042
|
-
canUsePropertiesKeys:
|
|
2041
|
+
visibleProperties: P,
|
|
2042
|
+
canUsePropertiesKeys: v
|
|
2043
2043
|
};
|
|
2044
|
-
}, [JSON.stringify(
|
|
2045
|
-
return /* @__PURE__ */ t(
|
|
2044
|
+
}, [JSON.stringify(w)]), l = n(), a = fr(l, "key");
|
|
2045
|
+
return /* @__PURE__ */ t(Ie, { children: /* @__PURE__ */ S(z, { gap: 2, children: [
|
|
2046
2046
|
/* @__PURE__ */ t(J, { variant: "subtitle1", children: m("maker.properties.parameters") }),
|
|
2047
2047
|
!e || s.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ t(Z, { style: { fontSize: 12 }, children: m("maker.properties.noParameters") }) : /* @__PURE__ */ S(H, { children: [
|
|
2048
|
-
/* @__PURE__ */ t(
|
|
2049
|
-
var
|
|
2050
|
-
return /* @__PURE__ */ t(
|
|
2048
|
+
/* @__PURE__ */ t(z, { gap: 2, children: s.visibleProperties.map(({ data: b }) => {
|
|
2049
|
+
var P, c;
|
|
2050
|
+
return /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(
|
|
2051
2051
|
_,
|
|
2052
2052
|
{
|
|
2053
2053
|
allComponents: r,
|
|
@@ -2055,64 +2055,64 @@ function bt({
|
|
|
2055
2055
|
size: "small",
|
|
2056
2056
|
fullWidth: !0,
|
|
2057
2057
|
component: e,
|
|
2058
|
-
property:
|
|
2059
|
-
valueImmutable: de((
|
|
2060
|
-
value: (d == null ? void 0 : d[
|
|
2061
|
-
onChange: (
|
|
2058
|
+
property: b,
|
|
2059
|
+
valueImmutable: de((P = i == null ? void 0 : i[b.id]) == null ? void 0 : P.value),
|
|
2060
|
+
value: (d == null ? void 0 : d[b.key || b.id]) ?? ((c = l[b.id]) == null ? void 0 : c.value),
|
|
2061
|
+
onChange: (v) => {
|
|
2062
2062
|
p({
|
|
2063
|
-
path: ["properties",
|
|
2064
|
-
id:
|
|
2065
|
-
value: { value:
|
|
2066
|
-
shouldSync:
|
|
2063
|
+
path: ["properties", b.id],
|
|
2064
|
+
id: b.id,
|
|
2065
|
+
value: { value: v },
|
|
2066
|
+
shouldSync: Fe(b),
|
|
2067
2067
|
excludeKeys: [],
|
|
2068
|
-
key:
|
|
2068
|
+
key: b.key || b.id
|
|
2069
2069
|
});
|
|
2070
2070
|
}
|
|
2071
2071
|
}
|
|
2072
|
-
) },
|
|
2072
|
+
) }, b.id);
|
|
2073
2073
|
}) }),
|
|
2074
|
-
/* @__PURE__ */ t(
|
|
2075
|
-
|
|
2074
|
+
/* @__PURE__ */ t(z, { gap: 2, sx: { width: "100%" }, children: /* @__PURE__ */ t(
|
|
2075
|
+
lt,
|
|
2076
2076
|
{
|
|
2077
2077
|
componentId: (e == null ? void 0 : e.id) || "",
|
|
2078
2078
|
renderType: "setting",
|
|
2079
|
-
locale:
|
|
2079
|
+
locale: u,
|
|
2080
2080
|
properties: l,
|
|
2081
2081
|
dev: { mode: "draft", components: r, defaultLocale: o },
|
|
2082
2082
|
props: {
|
|
2083
2083
|
...br(d ?? {}, s.canUsePropertiesKeys),
|
|
2084
|
-
onChange: (
|
|
2085
|
-
const { canUsePropertiesKeys:
|
|
2086
|
-
Object.keys(
|
|
2087
|
-
var
|
|
2088
|
-
return
|
|
2089
|
-
}).filter((
|
|
2090
|
-
var
|
|
2091
|
-
return !(
|
|
2092
|
-
}).reduce((
|
|
2093
|
-
const
|
|
2094
|
-
if (
|
|
2084
|
+
onChange: (b) => {
|
|
2085
|
+
const { canUsePropertiesKeys: P } = s;
|
|
2086
|
+
Object.keys(b).filter((v) => {
|
|
2087
|
+
var y;
|
|
2088
|
+
return b[v] !== ((y = a == null ? void 0 : a[v]) == null ? void 0 : y.value);
|
|
2089
|
+
}).filter((v) => {
|
|
2090
|
+
var y, k, O, f;
|
|
2091
|
+
return !(v === "locale" && !pr(a[v], "locale") || ((y = a[v]) == null ? void 0 : y.type) === "component" || (((k = a[v]) == null ? void 0 : k.type) === "yaml" || ((O = a[v]) == null ? void 0 : O.type) === "json") && ve(w, (f = a[v]) == null ? void 0 : f.id));
|
|
2092
|
+
}).reduce((v, y) => v.then(() => {
|
|
2093
|
+
const k = a[y], O = P.includes(y);
|
|
2094
|
+
if (k != null && k.id && O)
|
|
2095
2095
|
return p({
|
|
2096
|
-
path: ["properties",
|
|
2097
|
-
id:
|
|
2098
|
-
value: { value:
|
|
2099
|
-
shouldSync:
|
|
2096
|
+
path: ["properties", k.id],
|
|
2097
|
+
id: k.id,
|
|
2098
|
+
value: { value: b[y] },
|
|
2099
|
+
shouldSync: Fe(k),
|
|
2100
2100
|
excludeKeys: [],
|
|
2101
|
-
key:
|
|
2101
|
+
key: k.key || k.id
|
|
2102
2102
|
}), Promise.resolve();
|
|
2103
|
-
const
|
|
2104
|
-
if (g ===
|
|
2103
|
+
const f = `propertyNotFound${y}`;
|
|
2104
|
+
if (g === f)
|
|
2105
2105
|
return Promise.resolve();
|
|
2106
|
-
|
|
2107
|
-
const I =
|
|
2106
|
+
Be.close(g);
|
|
2107
|
+
const I = Be.warning(
|
|
2108
2108
|
m("maker.properties.propertyNotFound", {
|
|
2109
|
-
key:
|
|
2109
|
+
key: y
|
|
2110
2110
|
}),
|
|
2111
2111
|
{
|
|
2112
|
-
key:
|
|
2112
|
+
key: f
|
|
2113
2113
|
}
|
|
2114
2114
|
);
|
|
2115
|
-
return
|
|
2115
|
+
return h(I), Promise.resolve();
|
|
2116
2116
|
}), Promise.resolve());
|
|
2117
2117
|
}
|
|
2118
2118
|
}
|
|
@@ -2123,7 +2123,7 @@ function bt({
|
|
|
2123
2123
|
}
|
|
2124
2124
|
export {
|
|
2125
2125
|
Wr as BasicInfo,
|
|
2126
|
-
|
|
2126
|
+
je as CustomComponentAutocomplete,
|
|
2127
2127
|
Ui as CustomComponentSettings,
|
|
2128
2128
|
Mr as DefaultReactComponentScriptTemplate,
|
|
2129
2129
|
Hr as DefaultWebComponentScriptTemplate,
|