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