@blocklet/pages-kit-inner-components 0.4.43 → 0.4.44
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/{draft-data-kZlleQ4E.js → draft-data-CMqq2YH1.js} +1 -1
- package/lib/cjs/_chunks/{home-Ce3-4w2I.js → home-BFxAZSGy.js} +3 -3
- package/lib/cjs/_chunks/{publish-button-NBzp4nrV.js → publish-button-DFR8IHQq.js} +1 -1
- package/lib/cjs/_chunks/state-BjeG4kYg.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/setting.js +3 -3
- package/lib/es/_chunks/{draft-data-CkmH99IX.js → draft-data-vlK5oTGT.js} +1 -1
- package/lib/es/_chunks/{home-DDJ3wLld.js → home-BTLUdaL7.js} +3 -3
- package/lib/es/_chunks/{publish-button-Ca4oEKdb.js → publish-button-BWD3lOEM.js} +2 -2
- package/lib/es/_chunks/{state-kKXkQecK.js → state-DqChB5ys.js} +90 -89
- package/lib/es/home.js +2 -2
- package/lib/es/setting.js +525 -523
- package/package.json +3 -3
- package/lib/cjs/_chunks/state-B6B5oPws.js +0 -1
package/lib/es/setting.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { jsx as t, jsxs as S, Fragment as $ } from "react/jsx-runtime";
|
|
2
|
-
import { t as ge, g as ne, i as _e, b as Je, h as de, E as gt, n as $e, j as xe } from "./_chunks/state-
|
|
2
|
+
import { t as ge, g as ne, i as _e, b as Je, h as de, E as gt, n as $e, j as xe } from "./_chunks/state-DqChB5ys.js";
|
|
3
3
|
import te from "@arcblock/ux/lib/Empty";
|
|
4
4
|
import { useLocaleContext as A } from "@arcblock/ux/lib/Locale/context";
|
|
5
5
|
import { CodeEditor as ke } from "@blocklet/code-editor";
|
|
@@ -7,17 +7,17 @@ import xt from "@mui/icons-material/AddRounded";
|
|
|
7
7
|
import kt from "@mui/icons-material/ArrowDownward";
|
|
8
8
|
import wt from "@mui/icons-material/ArrowUpward";
|
|
9
9
|
import Pt from "@mui/icons-material/DeleteOutline";
|
|
10
|
-
import { Typography as F, TextField as D, Stack as j, FormLabel as oe, Box as O, TableContainer as It, Paper as re, Table as
|
|
11
|
-
import
|
|
12
|
-
import { useCallback as N, useMemo as ae, forwardRef as tt, useState as Z, useEffect as
|
|
10
|
+
import { Typography as F, TextField as D, Stack as j, FormLabel as oe, Box as O, TableContainer as It, Paper as re, Table as Me, TableHead as He, TableRow as se, TableCell as ce, TableBody as Ye, Button as T, IconButton as we, FormControlLabel as Ge, Switch as Le, InputAdornment as ue, Dialog as Pe, DialogTitle as qe, DialogContent as Qe, DialogActions as Xe, alpha as St, Tooltip as X, buttonClasses as Ot, Autocomplete as Ze, MenuItem as he, Popper as et, Divider as Ct } from "@mui/material";
|
|
11
|
+
import V from "lodash/sortBy";
|
|
12
|
+
import { useCallback as N, useMemo as ae, forwardRef as tt, useState as Z, useEffect as M, useImperativeHandle as rt, lazy as jt, Suspense as zt, useRef as J, useId as Rt } from "react";
|
|
13
13
|
import { useUpdate as it, useDebounce as Dt } from "react-use";
|
|
14
14
|
import { styled as At } from "@arcblock/ux/lib/Theme";
|
|
15
15
|
import { cx as Nt } from "@emotion/css";
|
|
16
|
-
import { useReactive as
|
|
16
|
+
import { useReactive as Tt, useBoolean as Vt, useUpdate as Et } from "ahooks";
|
|
17
17
|
import Ue from "gradient-parser";
|
|
18
18
|
import "lodash/without";
|
|
19
19
|
import Ut from "tinycolor2";
|
|
20
|
-
import { red as Wt, pink as Bt, purple as Kt, indigo as Ft, blue as _t, cyan as Jt, teal as $t, green as
|
|
20
|
+
import { red as Wt, pink as Bt, purple as Kt, indigo as Ft, blue as _t, cyan as Jt, teal as $t, green as Mt, lime as Ht, yellow as Yt, amber as Gt, orange as Lt, brown as qt, grey as Qt, blueGrey as Xt } from "@mui/material/colors";
|
|
21
21
|
import { getImageSize as fe, getVideoSize as be, UploaderButton as Ie, UploaderProvider as Se, useUploader as Zt } from "./uploader.js";
|
|
22
22
|
import { Icon as er } from "@iconify-icon/react";
|
|
23
23
|
import lt from "lodash/isEmpty";
|
|
@@ -29,7 +29,7 @@ import { CustomComponentRenderer as ot, transpileAndLoadScript as tr, getPropert
|
|
|
29
29
|
import { unstable_useNumberInput as ir, ClickAwayListener as st } from "@mui/base";
|
|
30
30
|
import { VisibilityOffRounded as lr, VisibilityRounded as nr, DeleteOutlineRounded as or, DragIndicatorRounded as sr, TranslateRounded as ct, AddRounded as at, InfoRounded as dt, StarRounded as cr, SettingsRounded as ut } from "@mui/icons-material";
|
|
31
31
|
import { alpha as Be } from "@mui/material/styles";
|
|
32
|
-
import { getYjsValue as
|
|
32
|
+
import { getYjsValue as H } from "@syncedstore/core";
|
|
33
33
|
import ar from "lodash/assign";
|
|
34
34
|
import dr from "lodash/has";
|
|
35
35
|
import ee from "lodash/isNil";
|
|
@@ -43,52 +43,52 @@ import { ErrorBoundary as br } from "react-error-boundary";
|
|
|
43
43
|
import { useDrop as ht, useDrag as yr } from "react-dnd";
|
|
44
44
|
function vr({
|
|
45
45
|
onClick: e,
|
|
46
|
-
disabled:
|
|
46
|
+
disabled: r,
|
|
47
47
|
sx: l,
|
|
48
|
-
...
|
|
48
|
+
...i
|
|
49
49
|
}) {
|
|
50
|
-
return /* @__PURE__ */ t(we, { size: "small", color: "warning", variant: "outlined", disabled:
|
|
50
|
+
return /* @__PURE__ */ t(we, { size: "small", color: "warning", variant: "outlined", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(Pt, { fontSize: "small" }) });
|
|
51
51
|
}
|
|
52
52
|
function gr({
|
|
53
53
|
onClick: e,
|
|
54
|
-
disabled:
|
|
54
|
+
disabled: r,
|
|
55
55
|
sx: l,
|
|
56
|
-
...
|
|
56
|
+
...i
|
|
57
57
|
}) {
|
|
58
|
-
return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled:
|
|
58
|
+
return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(wt, { fontSize: "small" }) });
|
|
59
59
|
}
|
|
60
60
|
function xr({
|
|
61
61
|
onClick: e,
|
|
62
|
-
disabled:
|
|
62
|
+
disabled: r,
|
|
63
63
|
sx: l,
|
|
64
|
-
...
|
|
64
|
+
...i
|
|
65
65
|
}) {
|
|
66
|
-
return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled:
|
|
66
|
+
return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(kt, { fontSize: "small" }) });
|
|
67
67
|
}
|
|
68
68
|
function kr({
|
|
69
69
|
label: e,
|
|
70
|
-
value:
|
|
70
|
+
value: r,
|
|
71
71
|
onChange: l,
|
|
72
|
-
disabled:
|
|
73
|
-
itemLabel:
|
|
74
|
-
emptyHeight:
|
|
75
|
-
property:
|
|
72
|
+
disabled: i = !1,
|
|
73
|
+
itemLabel: u = "",
|
|
74
|
+
emptyHeight: m = 40,
|
|
75
|
+
property: a,
|
|
76
76
|
renderItem: p,
|
|
77
77
|
...k
|
|
78
78
|
}) {
|
|
79
|
-
const { t:
|
|
79
|
+
const { t: h, locale: x } = A(), b = it(), n = N(
|
|
80
80
|
(y) => {
|
|
81
|
-
l(ge(y,
|
|
81
|
+
l(ge(y, a.type));
|
|
82
82
|
},
|
|
83
|
-
[l,
|
|
84
|
-
), o = ae(() => Array.isArray(
|
|
83
|
+
[l, a.type]
|
|
84
|
+
), o = ae(() => Array.isArray(r) ? r : [], [r]), s = N(() => {
|
|
85
85
|
const y = [...o, ""];
|
|
86
86
|
n(y), b();
|
|
87
|
-
}, [o, n, b]),
|
|
88
|
-
if (!
|
|
87
|
+
}, [o, n, b]), d = N(() => {
|
|
88
|
+
if (!a || !a.subProperties)
|
|
89
89
|
return s();
|
|
90
90
|
const y = {};
|
|
91
|
-
|
|
91
|
+
V(Object.values(a.subProperties), "index").forEach(({ data: R }) => {
|
|
92
92
|
var U, W;
|
|
93
93
|
if (!R.key) return;
|
|
94
94
|
const E = ((W = (U = R.locales) == null ? void 0 : U[x]) == null ? void 0 : W.defaultValue) ?? "";
|
|
@@ -96,7 +96,7 @@ function kr({
|
|
|
96
96
|
});
|
|
97
97
|
const z = [...o, y];
|
|
98
98
|
n(z), b();
|
|
99
|
-
}, [o, n, b,
|
|
99
|
+
}, [o, n, b, a, x, s]), f = N(
|
|
100
100
|
(y) => {
|
|
101
101
|
try {
|
|
102
102
|
const I = JSON.parse(y);
|
|
@@ -132,7 +132,7 @@ function kr({
|
|
|
132
132
|
z[y] = I, n(z);
|
|
133
133
|
},
|
|
134
134
|
[o, n]
|
|
135
|
-
), P =
|
|
135
|
+
), P = a && a.subProperties && Object.keys(a.subProperties).length > 0, C = ae(() => [
|
|
136
136
|
{
|
|
137
137
|
field: "index",
|
|
138
138
|
headerName: "#",
|
|
@@ -162,16 +162,16 @@ function kr({
|
|
|
162
162
|
renderCell: ({ row: y, index: I }) => p && P ? p({
|
|
163
163
|
item: y,
|
|
164
164
|
index: I,
|
|
165
|
-
property:
|
|
165
|
+
property: a,
|
|
166
166
|
onChange: (z) => g(I, z)
|
|
167
167
|
}) : /* @__PURE__ */ t(
|
|
168
168
|
D,
|
|
169
169
|
{
|
|
170
170
|
fullWidth: !0,
|
|
171
171
|
size: "small",
|
|
172
|
-
disabled:
|
|
172
|
+
disabled: i,
|
|
173
173
|
value: y,
|
|
174
|
-
placeholder:
|
|
174
|
+
placeholder: u || `${h("item")} ${I + 1}`,
|
|
175
175
|
onChange: (z) => g(I, z.target.value),
|
|
176
176
|
...k
|
|
177
177
|
}
|
|
@@ -184,25 +184,25 @@ function kr({
|
|
|
184
184
|
// 增加宽度以容纳更多按钮
|
|
185
185
|
align: "center",
|
|
186
186
|
renderCell: ({ index: y }) => /* @__PURE__ */ S(j, { direction: "column", spacing: 0.25, children: [
|
|
187
|
-
/* @__PURE__ */ t(gr, { disabled:
|
|
187
|
+
/* @__PURE__ */ t(gr, { disabled: i || y === 0, onClick: () => c(y) }),
|
|
188
188
|
/* @__PURE__ */ t(
|
|
189
189
|
xr,
|
|
190
190
|
{
|
|
191
|
-
disabled:
|
|
191
|
+
disabled: i || y === o.length - 1,
|
|
192
192
|
onClick: () => v(y)
|
|
193
193
|
}
|
|
194
194
|
),
|
|
195
|
-
/* @__PURE__ */ t(vr, { disabled:
|
|
195
|
+
/* @__PURE__ */ t(vr, { disabled: i, onClick: () => w(y) })
|
|
196
196
|
] })
|
|
197
197
|
}
|
|
198
198
|
], [
|
|
199
199
|
p,
|
|
200
200
|
P,
|
|
201
|
-
d,
|
|
202
|
-
g,
|
|
203
201
|
a,
|
|
204
|
-
|
|
205
|
-
|
|
202
|
+
g,
|
|
203
|
+
u,
|
|
204
|
+
h,
|
|
205
|
+
i,
|
|
206
206
|
k,
|
|
207
207
|
w,
|
|
208
208
|
c,
|
|
@@ -212,7 +212,7 @@ function kr({
|
|
|
212
212
|
return P ? /* @__PURE__ */ S(j, { width: "100%", gap: 1, children: [
|
|
213
213
|
e && /* @__PURE__ */ t(oe, { children: e }),
|
|
214
214
|
o.length > 0 ? /* @__PURE__ */ t(It, { component: re, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ S(
|
|
215
|
-
|
|
215
|
+
Me,
|
|
216
216
|
{
|
|
217
217
|
size: "small",
|
|
218
218
|
sx: {
|
|
@@ -229,7 +229,7 @@ function kr({
|
|
|
229
229
|
borderCollapse: "collapse"
|
|
230
230
|
},
|
|
231
231
|
children: [
|
|
232
|
-
/* @__PURE__ */ t(
|
|
232
|
+
/* @__PURE__ */ t(He, { sx: { display: "none" }, children: /* @__PURE__ */ t(se, { children: C.map((y) => /* @__PURE__ */ t(
|
|
233
233
|
ce,
|
|
234
234
|
{
|
|
235
235
|
width: y.width,
|
|
@@ -270,17 +270,17 @@ function kr({
|
|
|
270
270
|
)) })
|
|
271
271
|
]
|
|
272
272
|
}
|
|
273
|
-
) }) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height:
|
|
273
|
+
) }) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: m }, children: h("maker.properties.arrayEmpty") }),
|
|
274
274
|
/* @__PURE__ */ t(
|
|
275
|
-
|
|
275
|
+
T,
|
|
276
276
|
{
|
|
277
277
|
fullWidth: !0,
|
|
278
278
|
size: "small",
|
|
279
279
|
variant: "outlined",
|
|
280
|
-
disabled:
|
|
280
|
+
disabled: i,
|
|
281
281
|
startIcon: /* @__PURE__ */ t(xt, {}),
|
|
282
|
-
onClick:
|
|
283
|
-
children:
|
|
282
|
+
onClick: d,
|
|
283
|
+
children: h("maker.properties.addArrayItem")
|
|
284
284
|
}
|
|
285
285
|
)
|
|
286
286
|
] }) : /* @__PURE__ */ S(j, { width: "100%", gap: 1, children: [
|
|
@@ -288,61 +288,61 @@ function kr({
|
|
|
288
288
|
/* @__PURE__ */ t(O, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ t(
|
|
289
289
|
ke,
|
|
290
290
|
{
|
|
291
|
-
keyId:
|
|
291
|
+
keyId: a.id,
|
|
292
292
|
locale: x,
|
|
293
293
|
language: "json",
|
|
294
294
|
value: JSON.stringify(o, null, 2),
|
|
295
|
-
onChange: (y) =>
|
|
295
|
+
onChange: (y) => f(y || "")
|
|
296
296
|
},
|
|
297
|
-
|
|
297
|
+
a.id
|
|
298
298
|
) })
|
|
299
299
|
] });
|
|
300
300
|
}
|
|
301
301
|
Wt[300], Bt[300], Kt[300], // deepPurple['300'],
|
|
302
302
|
Ft[300], _t[300], // lightBlue['300'],
|
|
303
|
-
Jt[300], $t[300],
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
const wr = tt(function({ showMarkdown:
|
|
303
|
+
Jt[300], $t[300], Mt[300], // lightGreen['300'],
|
|
304
|
+
Ht[300], Yt[300], Gt[300], Lt[300], // deepOrange['300'],
|
|
305
|
+
qt[300], Qt[300], Xt[300];
|
|
306
|
+
const wr = tt(function({ showMarkdown: r, markdown: l, onMarkdownChange: i, showUploader: u, value: m, meta: a, onChange: p, ...k }, h) {
|
|
307
307
|
const [x, b] = Z("");
|
|
308
|
-
|
|
309
|
-
b(
|
|
310
|
-
}, [
|
|
308
|
+
M(() => {
|
|
309
|
+
b(m || "");
|
|
310
|
+
}, [m, b]);
|
|
311
311
|
const n = async () => {
|
|
312
|
-
if (x !==
|
|
312
|
+
if (x !== m) {
|
|
313
313
|
const s = ne(x);
|
|
314
314
|
if (!s) {
|
|
315
315
|
p(x, void 0);
|
|
316
316
|
return;
|
|
317
317
|
}
|
|
318
|
-
const
|
|
318
|
+
const d = await fe(s).catch(() => be(s)).catch(() => {
|
|
319
319
|
});
|
|
320
|
-
p(x, { ...
|
|
320
|
+
p(x, { ...d, filename: x });
|
|
321
321
|
}
|
|
322
322
|
};
|
|
323
323
|
Dt(
|
|
324
324
|
() => {
|
|
325
|
-
x !==
|
|
325
|
+
x !== m && p(x);
|
|
326
326
|
},
|
|
327
327
|
300,
|
|
328
328
|
[x]
|
|
329
|
-
), rt(
|
|
329
|
+
), rt(h, () => ({
|
|
330
330
|
submit: n
|
|
331
331
|
}));
|
|
332
332
|
const o = {};
|
|
333
|
-
return
|
|
333
|
+
return u && (o.InputProps = {
|
|
334
334
|
sx: { pr: 0 },
|
|
335
335
|
endAdornment: /* @__PURE__ */ t(ue, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ t(
|
|
336
336
|
Ie,
|
|
337
337
|
{
|
|
338
338
|
onChange: async ({ response: s }) => {
|
|
339
339
|
var c;
|
|
340
|
-
const
|
|
340
|
+
const d = (c = s == null ? void 0 : s.data) == null ? void 0 : c.filename, f = ne(d) || "";
|
|
341
341
|
let w = {};
|
|
342
|
-
|
|
343
|
-
})), p(
|
|
342
|
+
f && (w = await fe(f).catch(() => be(f)).catch(() => {
|
|
343
|
+
})), p(d, {
|
|
344
344
|
...w,
|
|
345
|
-
filename:
|
|
345
|
+
filename: d
|
|
346
346
|
});
|
|
347
347
|
}
|
|
348
348
|
}
|
|
@@ -355,7 +355,7 @@ const wr = tt(function({ showMarkdown: i, markdown: l, onMarkdownChange: r, show
|
|
|
355
355
|
...k,
|
|
356
356
|
label: /* @__PURE__ */ S(j, { direction: "row", spacing: 1, alignItems: "center", children: [
|
|
357
357
|
k.label,
|
|
358
|
-
|
|
358
|
+
r && /* @__PURE__ */ S($, { children: [
|
|
359
359
|
" (",
|
|
360
360
|
/* @__PURE__ */ t(
|
|
361
361
|
Ge,
|
|
@@ -363,9 +363,9 @@ const wr = tt(function({ showMarkdown: i, markdown: l, onMarkdownChange: r, show
|
|
|
363
363
|
checked: l,
|
|
364
364
|
label: /* @__PURE__ */ t(O, { component: er, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
|
|
365
365
|
labelPlacement: "start",
|
|
366
|
-
control: /* @__PURE__ */ t(
|
|
366
|
+
control: /* @__PURE__ */ t(Le, { size: "small" }),
|
|
367
367
|
sx: { ml: 0.25, pr: 1 },
|
|
368
|
-
onChange: (s,
|
|
368
|
+
onChange: (s, d) => i == null ? void 0 : i(d)
|
|
369
369
|
}
|
|
370
370
|
),
|
|
371
371
|
")"
|
|
@@ -383,21 +383,21 @@ const wr = tt(function({ showMarkdown: i, markdown: l, onMarkdownChange: r, show
|
|
|
383
383
|
}), Pr = jt(() => import("react-best-gradient-color-picker"));
|
|
384
384
|
function Ir(e) {
|
|
385
385
|
try {
|
|
386
|
-
const l = Ue.parse(e).map((
|
|
387
|
-
const
|
|
388
|
-
if (
|
|
389
|
-
const p = Ut(
|
|
386
|
+
const l = Ue.parse(e).map((u) => {
|
|
387
|
+
const m = u.colorStops.map((a) => {
|
|
388
|
+
if (a.type !== "rgba") {
|
|
389
|
+
const p = Ut(a.value).toRgb();
|
|
390
390
|
return {
|
|
391
|
-
...
|
|
391
|
+
...a,
|
|
392
392
|
value: [p.r, p.g, p.b, p.a],
|
|
393
393
|
type: "rgba"
|
|
394
394
|
};
|
|
395
395
|
}
|
|
396
|
-
return
|
|
396
|
+
return a;
|
|
397
397
|
});
|
|
398
398
|
return {
|
|
399
|
-
...
|
|
400
|
-
colorStops:
|
|
399
|
+
...u,
|
|
400
|
+
colorStops: m
|
|
401
401
|
};
|
|
402
402
|
});
|
|
403
403
|
return Ue.stringify(l);
|
|
@@ -405,14 +405,14 @@ function Ir(e) {
|
|
|
405
405
|
return Je(e) ? e : "";
|
|
406
406
|
}
|
|
407
407
|
}
|
|
408
|
-
function Sr({ color: e, sx:
|
|
408
|
+
function Sr({ color: e, sx: r = {}, ...l }) {
|
|
409
409
|
Je(e);
|
|
410
|
-
const
|
|
411
|
-
return _e(e) ?
|
|
410
|
+
const i = {};
|
|
411
|
+
return _e(e) ? i.backgroundImage = e : i.backgroundColor = e, /* @__PURE__ */ t(
|
|
412
412
|
O,
|
|
413
413
|
{
|
|
414
414
|
sx: {
|
|
415
|
-
...
|
|
415
|
+
...r,
|
|
416
416
|
width: "100%",
|
|
417
417
|
paddingBottom: "100%",
|
|
418
418
|
cursor: "pointer",
|
|
@@ -422,41 +422,41 @@ function Sr({ color: e, sx: i = {}, ...l }) {
|
|
|
422
422
|
"&:hover": {
|
|
423
423
|
opacity: 0.75
|
|
424
424
|
},
|
|
425
|
-
...
|
|
425
|
+
...i
|
|
426
426
|
},
|
|
427
427
|
...l
|
|
428
428
|
}
|
|
429
429
|
);
|
|
430
430
|
}
|
|
431
|
-
const Or = tt(function({ onSave:
|
|
432
|
-
const
|
|
431
|
+
const Or = tt(function({ onSave: r }, l) {
|
|
432
|
+
const i = Tt({
|
|
433
433
|
value: ""
|
|
434
|
-
}), { t:
|
|
435
|
-
|
|
436
|
-
const [
|
|
434
|
+
}), { t: u } = A(), m = {};
|
|
435
|
+
i.value ? _e(i.value) ? m.backgroundImage = i.value : m.backgroundColor = i.value : m.border = "1px solid #ccc";
|
|
436
|
+
const [a, { setFalse: p, setTrue: k }] = Vt(!1), h = N(() => {
|
|
437
437
|
p();
|
|
438
438
|
}, [p]), x = () => {
|
|
439
|
-
|
|
439
|
+
r({ value: i.value }, h);
|
|
440
440
|
};
|
|
441
441
|
return rt(l, () => ({
|
|
442
442
|
open({ value: b } = { value: "" }) {
|
|
443
|
-
|
|
443
|
+
i.value = b, k();
|
|
444
444
|
},
|
|
445
445
|
close() {
|
|
446
|
-
|
|
446
|
+
h();
|
|
447
447
|
}
|
|
448
|
-
})), /* @__PURE__ */ S(Pe, { open:
|
|
449
|
-
/* @__PURE__ */ t(
|
|
448
|
+
})), /* @__PURE__ */ S(Pe, { open: a, onClose: h, hideBackdrop: !0, children: [
|
|
449
|
+
/* @__PURE__ */ t(qe, { children: u("maker.configBackground") }),
|
|
450
450
|
/* @__PURE__ */ t(Qe, { sx: { width: 600 }, children: /* @__PURE__ */ S(O, { width: "100%", display: "flex", children: [
|
|
451
|
-
/* @__PURE__ */ t(O, { flex: 1, mr: 1, sx:
|
|
451
|
+
/* @__PURE__ */ t(O, { flex: 1, mr: 1, sx: m, children: !i.value && /* @__PURE__ */ t(te, { children: u("error.notConfig") }) }),
|
|
452
452
|
/* @__PURE__ */ t(zt, { children: /* @__PURE__ */ t(
|
|
453
453
|
Pr,
|
|
454
454
|
{
|
|
455
455
|
width: 200,
|
|
456
456
|
height: 200,
|
|
457
|
-
value: Ir(
|
|
457
|
+
value: Ir(i.value),
|
|
458
458
|
onChange: (b) => {
|
|
459
|
-
|
|
459
|
+
i.value = b;
|
|
460
460
|
},
|
|
461
461
|
hidePresets: !0,
|
|
462
462
|
hideAdvancedSliders: !0,
|
|
@@ -466,8 +466,8 @@ const Or = tt(function({ onSave: i }, l) {
|
|
|
466
466
|
) })
|
|
467
467
|
] }) }),
|
|
468
468
|
/* @__PURE__ */ S(Xe, { children: [
|
|
469
|
-
/* @__PURE__ */ t(
|
|
470
|
-
/* @__PURE__ */ t(
|
|
469
|
+
/* @__PURE__ */ t(T, { variant: "outlined", size: "small", onClick: h, children: u("common.cancel") }),
|
|
470
|
+
/* @__PURE__ */ t(T, { variant: "contained", size: "small", onClick: x, children: u("maker.save") })
|
|
471
471
|
] })
|
|
472
472
|
] });
|
|
473
473
|
});
|
|
@@ -494,17 +494,17 @@ At(O)`
|
|
|
494
494
|
`;
|
|
495
495
|
function Cr({
|
|
496
496
|
value: e,
|
|
497
|
-
onChange:
|
|
497
|
+
onChange: r,
|
|
498
498
|
...l
|
|
499
499
|
}) {
|
|
500
|
-
const
|
|
500
|
+
const i = J(null);
|
|
501
501
|
return /* @__PURE__ */ S($, { children: [
|
|
502
502
|
/* @__PURE__ */ t(
|
|
503
503
|
wr,
|
|
504
504
|
{
|
|
505
505
|
...l,
|
|
506
506
|
value: e,
|
|
507
|
-
onChange:
|
|
507
|
+
onChange: r,
|
|
508
508
|
InputProps: {
|
|
509
509
|
endAdornment: /* @__PURE__ */ t(ue, { position: "end", children: /* @__PURE__ */ t(
|
|
510
510
|
Sr,
|
|
@@ -512,8 +512,8 @@ function Cr({
|
|
|
512
512
|
color: e ?? "",
|
|
513
513
|
style: { width: "1.5rem", height: "1.5rem", padding: 0 },
|
|
514
514
|
onClick: () => {
|
|
515
|
-
var
|
|
516
|
-
(
|
|
515
|
+
var u;
|
|
516
|
+
(u = i.current) == null || u.open({ value: e ?? "" });
|
|
517
517
|
}
|
|
518
518
|
}
|
|
519
519
|
) })
|
|
@@ -523,9 +523,9 @@ function Cr({
|
|
|
523
523
|
/* @__PURE__ */ t(
|
|
524
524
|
Or,
|
|
525
525
|
{
|
|
526
|
-
ref:
|
|
527
|
-
onSave: ({ value:
|
|
528
|
-
|
|
526
|
+
ref: i,
|
|
527
|
+
onSave: ({ value: u }, m) => {
|
|
528
|
+
r(u), m();
|
|
529
529
|
}
|
|
530
530
|
}
|
|
531
531
|
)
|
|
@@ -533,41 +533,41 @@ function Cr({
|
|
|
533
533
|
}
|
|
534
534
|
function jr({
|
|
535
535
|
label: e,
|
|
536
|
-
value:
|
|
536
|
+
value: r,
|
|
537
537
|
onChange: l,
|
|
538
|
-
property:
|
|
539
|
-
component:
|
|
540
|
-
defaultLocale:
|
|
541
|
-
allComponents:
|
|
538
|
+
property: i,
|
|
539
|
+
component: u,
|
|
540
|
+
defaultLocale: m,
|
|
541
|
+
allComponents: a,
|
|
542
542
|
PropertyValueField: p,
|
|
543
543
|
onUpload: k
|
|
544
544
|
}) {
|
|
545
|
-
const { locale:
|
|
546
|
-
if (!lt(
|
|
547
|
-
const n =
|
|
545
|
+
const { locale: h } = A(), x = J(null);
|
|
546
|
+
if (!lt(i.subProperties)) {
|
|
547
|
+
const n = V(Object.values(i.subProperties || {}), "index").filter(
|
|
548
548
|
(o) => o.data.visible !== !1 && o.data.key
|
|
549
549
|
);
|
|
550
550
|
return /* @__PURE__ */ S(j, { width: "100%", children: [
|
|
551
551
|
/* @__PURE__ */ t(oe, { sx: { px: 0.25, py: 0.5 }, children: e }),
|
|
552
552
|
/* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(O, { sx: { position: "relative" }, children: n.map((o, s) => {
|
|
553
|
-
const { data:
|
|
553
|
+
const { data: d } = o, f = d.key ?? d.id, w = s === n.length - 1;
|
|
554
554
|
let c = null;
|
|
555
555
|
try {
|
|
556
|
-
|
|
556
|
+
r && typeof r == "object" ? c = r[f] : typeof r == "string" && (c = (i.type === "yaml" ? ye.parse(r || "") : JSON.parse(r || "{}"))[f]);
|
|
557
557
|
} catch {
|
|
558
558
|
}
|
|
559
|
-
c == null && (
|
|
559
|
+
c == null && (d.locales && h && d.locales[h] ? c = d.locales[h].defaultValue : d.locales && m && d.locales[m] && (c = d.locales[m].defaultValue));
|
|
560
560
|
const v = (P) => {
|
|
561
561
|
try {
|
|
562
562
|
let C = {};
|
|
563
|
-
if (typeof
|
|
563
|
+
if (typeof r == "string")
|
|
564
564
|
try {
|
|
565
|
-
C =
|
|
565
|
+
C = i.type === "yaml" ? ye.parse(r || "") : JSON.parse(r || "{}");
|
|
566
566
|
} catch {
|
|
567
567
|
}
|
|
568
|
-
else typeof
|
|
569
|
-
nt(C,
|
|
570
|
-
const y = ge(C,
|
|
568
|
+
else typeof r == "object" && r !== null && (C = { ...r });
|
|
569
|
+
nt(C, f, P);
|
|
570
|
+
const y = ge(C, i.type);
|
|
571
571
|
l == null || l(y);
|
|
572
572
|
} catch (C) {
|
|
573
573
|
console.error("Error updating property:", C);
|
|
@@ -644,19 +644,19 @@ function jr({
|
|
|
644
644
|
/* @__PURE__ */ t(O, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ t(
|
|
645
645
|
p,
|
|
646
646
|
{
|
|
647
|
-
component:
|
|
648
|
-
property:
|
|
647
|
+
component: u,
|
|
648
|
+
property: d,
|
|
649
649
|
value: c,
|
|
650
650
|
onChange: v,
|
|
651
651
|
size: "small",
|
|
652
652
|
fullWidth: !0,
|
|
653
|
-
defaultLocale:
|
|
654
|
-
allComponents:
|
|
653
|
+
defaultLocale: m,
|
|
654
|
+
allComponents: a
|
|
655
655
|
}
|
|
656
656
|
) })
|
|
657
657
|
]
|
|
658
658
|
},
|
|
659
|
-
|
|
659
|
+
d.id
|
|
660
660
|
);
|
|
661
661
|
}) }) })
|
|
662
662
|
] });
|
|
@@ -689,10 +689,10 @@ function jr({
|
|
|
689
689
|
/* @__PURE__ */ t(
|
|
690
690
|
ke,
|
|
691
691
|
{
|
|
692
|
-
keyId:
|
|
693
|
-
locale:
|
|
694
|
-
language:
|
|
695
|
-
value: typeof
|
|
692
|
+
keyId: i.id,
|
|
693
|
+
locale: h,
|
|
694
|
+
language: i.type === "yaml" ? "yaml" : "json",
|
|
695
|
+
value: typeof r == "string" ? r : "",
|
|
696
696
|
onChange: (n) => {
|
|
697
697
|
l == null || l(n);
|
|
698
698
|
},
|
|
@@ -700,7 +700,7 @@ function jr({
|
|
|
700
700
|
x.current = n, k && k(n);
|
|
701
701
|
}
|
|
702
702
|
},
|
|
703
|
-
|
|
703
|
+
i.id
|
|
704
704
|
),
|
|
705
705
|
/* @__PURE__ */ t(
|
|
706
706
|
O,
|
|
@@ -729,58 +729,58 @@ function jr({
|
|
|
729
729
|
const Ke = ["string", "multiline", "json", "yaml", "component", "custom", "url"];
|
|
730
730
|
function ft({
|
|
731
731
|
disabled: e,
|
|
732
|
-
list:
|
|
732
|
+
list: r,
|
|
733
733
|
renderItem: l,
|
|
734
|
-
...
|
|
734
|
+
...i
|
|
735
735
|
}) {
|
|
736
|
-
const
|
|
736
|
+
const u = J(null), m = Rt(), a = Et(), p = V(Object.entries(r), (o) => o[1].index).map((o) => o[0]), k = J(p), h = N(
|
|
737
737
|
(o) => {
|
|
738
|
-
k.current = o,
|
|
738
|
+
k.current = o, a();
|
|
739
739
|
},
|
|
740
|
-
[
|
|
740
|
+
[a]
|
|
741
741
|
), x = N(
|
|
742
742
|
({ index: o }, { index: s }) => {
|
|
743
|
-
const
|
|
744
|
-
|
|
743
|
+
const d = [...k.current];
|
|
744
|
+
d.splice(s, 0, ...d.splice(o, 1)), h(d);
|
|
745
745
|
},
|
|
746
|
-
[
|
|
746
|
+
[h]
|
|
747
747
|
);
|
|
748
|
-
|
|
749
|
-
|
|
748
|
+
M(() => {
|
|
749
|
+
h(p);
|
|
750
750
|
}, [p.join("-")]);
|
|
751
751
|
const [{ isOver: b }, n] = ht({
|
|
752
|
-
accept:
|
|
752
|
+
accept: m,
|
|
753
753
|
collect: (o) => ({
|
|
754
754
|
isOver: o.isOver()
|
|
755
755
|
}),
|
|
756
756
|
canDrop: () => !e,
|
|
757
757
|
drop: () => {
|
|
758
|
-
var
|
|
758
|
+
var d;
|
|
759
759
|
const o = () => {
|
|
760
|
-
k.current.forEach((
|
|
761
|
-
const c =
|
|
760
|
+
k.current.forEach((f, w) => {
|
|
761
|
+
const c = r[f];
|
|
762
762
|
c && (c.index = w);
|
|
763
763
|
});
|
|
764
|
-
}, s = (
|
|
764
|
+
}, s = (d = H(r)) == null ? void 0 : d.doc;
|
|
765
765
|
s ? s.transact(() => {
|
|
766
766
|
o();
|
|
767
767
|
}) : o();
|
|
768
768
|
}
|
|
769
769
|
});
|
|
770
|
-
return
|
|
771
|
-
b ||
|
|
772
|
-
}, [b]), n(
|
|
770
|
+
return M(() => {
|
|
771
|
+
b || h(p);
|
|
772
|
+
}, [b]), n(u), /* @__PURE__ */ t(O, { ...i, ref: u, className: Nt(b && "isDragging"), children: k.current.map((o, s) => /* @__PURE__ */ t(
|
|
773
773
|
zr,
|
|
774
774
|
{
|
|
775
|
-
type:
|
|
775
|
+
type: m,
|
|
776
776
|
disabled: e,
|
|
777
777
|
id: o,
|
|
778
778
|
index: s,
|
|
779
|
-
itemIndex: (
|
|
779
|
+
itemIndex: (d) => k.current.indexOf(d),
|
|
780
780
|
move: x,
|
|
781
|
-
children: (
|
|
782
|
-
const
|
|
783
|
-
return
|
|
781
|
+
children: (d) => {
|
|
782
|
+
const f = r[o];
|
|
783
|
+
return f ? l(f.data, s, d) : null;
|
|
784
784
|
}
|
|
785
785
|
},
|
|
786
786
|
o
|
|
@@ -788,50 +788,50 @@ function ft({
|
|
|
788
788
|
}
|
|
789
789
|
function zr({
|
|
790
790
|
disabled: e,
|
|
791
|
-
id:
|
|
791
|
+
id: r,
|
|
792
792
|
index: l,
|
|
793
|
-
type:
|
|
794
|
-
children:
|
|
795
|
-
itemIndex:
|
|
796
|
-
move:
|
|
793
|
+
type: i,
|
|
794
|
+
children: u,
|
|
795
|
+
itemIndex: m,
|
|
796
|
+
move: a
|
|
797
797
|
}) {
|
|
798
|
-
const p = J(), [{ isDragging: k },
|
|
799
|
-
type:
|
|
800
|
-
item: () => ({ id:
|
|
798
|
+
const p = J(), [{ isDragging: k }, h, x] = yr({
|
|
799
|
+
type: i,
|
|
800
|
+
item: () => ({ id: r }),
|
|
801
801
|
canDrag: () => !e,
|
|
802
802
|
collect: (n) => ({ isDragging: n.isDragging() })
|
|
803
803
|
}), [, b] = ht({
|
|
804
|
-
accept:
|
|
804
|
+
accept: i,
|
|
805
805
|
canDrop: () => !e,
|
|
806
806
|
hover(n, o) {
|
|
807
807
|
var g;
|
|
808
808
|
if (!p.current)
|
|
809
809
|
return;
|
|
810
|
-
const s =
|
|
811
|
-
if (s ===
|
|
810
|
+
const s = m(n.id), d = l;
|
|
811
|
+
if (s === d)
|
|
812
812
|
return;
|
|
813
|
-
const
|
|
814
|
-
s <
|
|
813
|
+
const f = (g = p.current) == null ? void 0 : g.getBoundingClientRect(), w = (f.bottom - f.top) / 2, v = o.getClientOffset().y - f.top;
|
|
814
|
+
s < d && v < w || s > d && v > w || a({ id: n.id, index: s }, { id: r, index: l });
|
|
815
815
|
}
|
|
816
816
|
});
|
|
817
|
-
return typeof
|
|
817
|
+
return typeof u == "function" ? u({
|
|
818
818
|
isDragging: k,
|
|
819
|
-
drag:
|
|
819
|
+
drag: h,
|
|
820
820
|
drop: (n) => (p.current = n, b(n)),
|
|
821
821
|
preview: x
|
|
822
|
-
}) : (
|
|
822
|
+
}) : (h(b(x(p))), /* @__PURE__ */ t(O, { ref: p, children: u }));
|
|
823
823
|
}
|
|
824
824
|
function Rr({
|
|
825
825
|
drop: e,
|
|
826
|
-
preview:
|
|
826
|
+
preview: r,
|
|
827
827
|
drag: l,
|
|
828
|
-
disabled:
|
|
829
|
-
isDragging:
|
|
830
|
-
children:
|
|
831
|
-
onDelete:
|
|
828
|
+
disabled: i,
|
|
829
|
+
isDragging: u,
|
|
830
|
+
children: m,
|
|
831
|
+
onDelete: a,
|
|
832
832
|
onVisibilityChange: p,
|
|
833
833
|
visible: k = !0,
|
|
834
|
-
actions:
|
|
834
|
+
actions: h,
|
|
835
835
|
alwaysShowActions: x = !1
|
|
836
836
|
}) {
|
|
837
837
|
const { t: b } = A();
|
|
@@ -847,18 +847,18 @@ function Rr({
|
|
|
847
847
|
/* @__PURE__ */ t(
|
|
848
848
|
O,
|
|
849
849
|
{
|
|
850
|
-
ref:
|
|
850
|
+
ref: r,
|
|
851
851
|
sx: {
|
|
852
852
|
flex: 1,
|
|
853
853
|
borderRadius: 0.5,
|
|
854
|
-
bgcolor:
|
|
854
|
+
bgcolor: u ? "action.hover" : "background.paper",
|
|
855
855
|
opacity: 0.9999
|
|
856
856
|
// NOTE: make preview effective
|
|
857
857
|
},
|
|
858
|
-
children:
|
|
858
|
+
children: m
|
|
859
859
|
}
|
|
860
860
|
),
|
|
861
|
-
!
|
|
861
|
+
!i && /* @__PURE__ */ t(
|
|
862
862
|
O,
|
|
863
863
|
{
|
|
864
864
|
className: x ? "" : "hover-visible",
|
|
@@ -886,10 +886,10 @@ function Rr({
|
|
|
886
886
|
}
|
|
887
887
|
},
|
|
888
888
|
children: [
|
|
889
|
-
|
|
890
|
-
p && /* @__PURE__ */ t(X, { title: b(k ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(
|
|
891
|
-
|
|
892
|
-
/* @__PURE__ */ t(X, { title: b("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(
|
|
889
|
+
h,
|
|
890
|
+
p && /* @__PURE__ */ t(X, { title: b(k ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: () => p(!k), children: k ? /* @__PURE__ */ t(lr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(nr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
891
|
+
a && /* @__PURE__ */ t(X, { title: b("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: a, children: /* @__PURE__ */ t(or, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
892
|
+
/* @__PURE__ */ t(X, { title: b("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { ref: l, children: /* @__PURE__ */ t(sr, { sx: { color: "grey.500" } }) }) })
|
|
893
893
|
]
|
|
894
894
|
}
|
|
895
895
|
)
|
|
@@ -901,54 +901,54 @@ function Rr({
|
|
|
901
901
|
}
|
|
902
902
|
function Dr({
|
|
903
903
|
label: e,
|
|
904
|
-
value:
|
|
904
|
+
value: r,
|
|
905
905
|
onChange: l
|
|
906
906
|
}) {
|
|
907
|
-
const [
|
|
907
|
+
const [i, u] = Z(!1);
|
|
908
908
|
return /* @__PURE__ */ S(j, { gap: 1, children: [
|
|
909
909
|
/* @__PURE__ */ t(
|
|
910
910
|
D,
|
|
911
911
|
{
|
|
912
912
|
label: e,
|
|
913
913
|
size: "small",
|
|
914
|
-
value:
|
|
915
|
-
onChange: (
|
|
914
|
+
value: r,
|
|
915
|
+
onChange: (m) => l == null ? void 0 : l(m.target.value),
|
|
916
916
|
InputProps: {
|
|
917
917
|
endAdornment: /* @__PURE__ */ t(
|
|
918
918
|
Ie,
|
|
919
919
|
{
|
|
920
|
-
onChange: ({ response:
|
|
920
|
+
onChange: ({ response: m }) => {
|
|
921
921
|
var p;
|
|
922
|
-
const
|
|
923
|
-
|
|
922
|
+
const a = (p = m == null ? void 0 : m.data) == null ? void 0 : p.filename;
|
|
923
|
+
a && (l == null || l(a));
|
|
924
924
|
}
|
|
925
925
|
}
|
|
926
926
|
)
|
|
927
927
|
}
|
|
928
928
|
}
|
|
929
929
|
),
|
|
930
|
-
|
|
930
|
+
r && /* @__PURE__ */ t(
|
|
931
931
|
O,
|
|
932
932
|
{
|
|
933
933
|
component: "img",
|
|
934
934
|
sx: { objectFit: "contain", borderRadius: 1, cursor: "pointer" },
|
|
935
|
-
src: ne(
|
|
935
|
+
src: ne(r),
|
|
936
936
|
alt: e,
|
|
937
937
|
maxWidth: 100,
|
|
938
938
|
maxHeight: 100,
|
|
939
939
|
width: "100%",
|
|
940
|
-
onClick: () =>
|
|
940
|
+
onClick: () => u(!0)
|
|
941
941
|
}
|
|
942
942
|
),
|
|
943
|
-
/* @__PURE__ */ t(Pe, { open:
|
|
943
|
+
/* @__PURE__ */ t(Pe, { open: i, onClose: () => u(!1), children: /* @__PURE__ */ t(O, { component: "img", sx: { objectFit: "contain" }, src: ne(r), alt: e }) })
|
|
944
944
|
] });
|
|
945
945
|
}
|
|
946
|
-
function ve(e,
|
|
946
|
+
function ve(e, r = "") {
|
|
947
947
|
return fr(
|
|
948
948
|
e,
|
|
949
|
-
(l,
|
|
950
|
-
const
|
|
951
|
-
return ur(
|
|
949
|
+
(l, i, u) => {
|
|
950
|
+
const m = r ? `${r}.${u}` : u;
|
|
951
|
+
return ur(i) ? ar(l, ve(i, m)) : l[m] = i, l;
|
|
952
952
|
},
|
|
953
953
|
{}
|
|
954
954
|
);
|
|
@@ -967,46 +967,46 @@ const Ar = [
|
|
|
967
967
|
{ value: "component", label: "Component" },
|
|
968
968
|
{ value: "custom", label: "Custom (Render by a Component)" }
|
|
969
969
|
];
|
|
970
|
-
function le(e,
|
|
971
|
-
return !e || !l ? !1 : Object.values(e).some(({ data:
|
|
970
|
+
function le(e, r, l) {
|
|
971
|
+
return !e || !l ? !1 : Object.values(e).some(({ data: i }) => i.id !== r && i.key === l);
|
|
972
972
|
}
|
|
973
|
-
function bt(e,
|
|
973
|
+
function bt(e, r) {
|
|
974
974
|
var l;
|
|
975
|
-
return !e || !
|
|
975
|
+
return !e || !r ? !1 : ((l = e[r]) == null ? void 0 : l.data.visible) ?? !0;
|
|
976
976
|
}
|
|
977
|
-
function
|
|
977
|
+
function Ti({ componentId: e }) {
|
|
978
978
|
const {
|
|
979
|
-
state: { components:
|
|
980
|
-
} = de(), l =
|
|
981
|
-
return
|
|
979
|
+
state: { components: r }
|
|
980
|
+
} = de(), l = r[e], i = l == null ? void 0 : l.data;
|
|
981
|
+
return i ? /* @__PURE__ */ t(j, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ t(O, { p: 2, children: /* @__PURE__ */ t(br, { FallbackComponent: gt, resetKeys: [e], children: /* @__PURE__ */ t(Nr, { value: i }) }) }) }) : null;
|
|
982
982
|
}
|
|
983
983
|
function Nr({ value: e }) {
|
|
984
|
-
var k,
|
|
985
|
-
const { t:
|
|
986
|
-
localState: { currentLocale: l, componentDebugProps:
|
|
984
|
+
var k, h, x;
|
|
985
|
+
const { t: r } = A(), {
|
|
986
|
+
localState: { currentLocale: l, componentDebugProps: i },
|
|
987
987
|
state: {
|
|
988
|
-
config: { defaultLocale:
|
|
988
|
+
config: { defaultLocale: u }
|
|
989
989
|
},
|
|
990
|
-
localActions: { setComponentDebugProps:
|
|
991
|
-
} = de(),
|
|
990
|
+
localActions: { setComponentDebugProps: m }
|
|
991
|
+
} = de(), a = H(e).doc, p = xe();
|
|
992
992
|
return /* @__PURE__ */ t(j, { height: "100%", children: /* @__PURE__ */ S(j, { gap: 2, children: [
|
|
993
|
-
/* @__PURE__ */ t(
|
|
993
|
+
/* @__PURE__ */ t(Tr, { config: e }),
|
|
994
994
|
/* @__PURE__ */ t(
|
|
995
995
|
Er,
|
|
996
996
|
{
|
|
997
997
|
config: e,
|
|
998
998
|
currentLocale: l,
|
|
999
|
-
defaultLocale:
|
|
999
|
+
defaultLocale: u,
|
|
1000
1000
|
allComponents: p,
|
|
1001
1001
|
onUpdateConfig: (b) => {
|
|
1002
|
-
|
|
1002
|
+
a.transact(() => {
|
|
1003
1003
|
b(e);
|
|
1004
1004
|
});
|
|
1005
1005
|
}
|
|
1006
1006
|
}
|
|
1007
1007
|
),
|
|
1008
1008
|
/* @__PURE__ */ S(j, { gap: 2, direction: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
1009
|
-
/* @__PURE__ */ t(F, { variant: "subtitle1", children:
|
|
1009
|
+
/* @__PURE__ */ t(F, { variant: "subtitle1", children: r("renderer") }),
|
|
1010
1010
|
/* @__PURE__ */ S(
|
|
1011
1011
|
D,
|
|
1012
1012
|
{
|
|
@@ -1016,7 +1016,7 @@ function Nr({ value: e }) {
|
|
|
1016
1016
|
SelectProps: { autoWidth: !0 },
|
|
1017
1017
|
value: ((k = e.renderer) == null ? void 0 : k.type) || "react-component",
|
|
1018
1018
|
onChange: (b) => {
|
|
1019
|
-
|
|
1019
|
+
a.transact(() => {
|
|
1020
1020
|
const n = b.target.value;
|
|
1021
1021
|
e.renderer ?? (e.renderer = { type: n }), e.renderer.type = n;
|
|
1022
1022
|
});
|
|
@@ -1028,34 +1028,34 @@ function Nr({ value: e }) {
|
|
|
1028
1028
|
}
|
|
1029
1029
|
)
|
|
1030
1030
|
] }),
|
|
1031
|
-
((
|
|
1031
|
+
((h = e.renderer) == null ? void 0 : h.type) === "component" ? /* @__PURE__ */ t($r, { value: e }) : ((x = e.renderer) == null ? void 0 : x.type) === "react-component" ? /* @__PURE__ */ t(Jr, { value: e }) : null,
|
|
1032
1032
|
/* @__PURE__ */ t(
|
|
1033
|
-
|
|
1033
|
+
Mr,
|
|
1034
1034
|
{
|
|
1035
1035
|
config: e,
|
|
1036
1036
|
currentLocale: l,
|
|
1037
|
-
defaultLocale:
|
|
1037
|
+
defaultLocale: u,
|
|
1038
1038
|
allComponents: p,
|
|
1039
1039
|
onChange: ({ key: b, value: n }) => {
|
|
1040
|
-
|
|
1040
|
+
m({
|
|
1041
1041
|
[b]: n.value
|
|
1042
1042
|
});
|
|
1043
1043
|
},
|
|
1044
1044
|
props: {
|
|
1045
|
-
...
|
|
1045
|
+
...i
|
|
1046
1046
|
}
|
|
1047
1047
|
}
|
|
1048
1048
|
)
|
|
1049
1049
|
] }) });
|
|
1050
1050
|
}
|
|
1051
|
-
function
|
|
1052
|
-
const { t:
|
|
1051
|
+
function Tr({ config: e }) {
|
|
1052
|
+
const { t: r } = A();
|
|
1053
1053
|
return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
|
|
1054
|
-
/* @__PURE__ */ t(F, { variant: "subtitle1", children:
|
|
1054
|
+
/* @__PURE__ */ t(F, { variant: "subtitle1", children: r("basicInfo") }),
|
|
1055
1055
|
/* @__PURE__ */ t(
|
|
1056
1056
|
D,
|
|
1057
1057
|
{
|
|
1058
|
-
label:
|
|
1058
|
+
label: r("name"),
|
|
1059
1059
|
size: "small",
|
|
1060
1060
|
value: e.name || "",
|
|
1061
1061
|
onChange: (l) => e.name = l.target.value
|
|
@@ -1064,7 +1064,7 @@ function Vr({ config: e }) {
|
|
|
1064
1064
|
/* @__PURE__ */ t(
|
|
1065
1065
|
D,
|
|
1066
1066
|
{
|
|
1067
|
-
label:
|
|
1067
|
+
label: r("description"),
|
|
1068
1068
|
size: "small",
|
|
1069
1069
|
multiline: !0,
|
|
1070
1070
|
minRows: 2,
|
|
@@ -1082,14 +1082,14 @@ function Vr({ config: e }) {
|
|
|
1082
1082
|
multiple: !0,
|
|
1083
1083
|
freeSolo: !0,
|
|
1084
1084
|
value: e.tags ?? [],
|
|
1085
|
-
onChange: (l,
|
|
1086
|
-
renderInput: (l) => /* @__PURE__ */ t(D, { label:
|
|
1085
|
+
onChange: (l, i) => e.tags = i,
|
|
1086
|
+
renderInput: (l) => /* @__PURE__ */ t(D, { label: r("tags"), ...l })
|
|
1087
1087
|
}
|
|
1088
1088
|
),
|
|
1089
1089
|
/* @__PURE__ */ t(
|
|
1090
1090
|
Dr,
|
|
1091
1091
|
{
|
|
1092
|
-
label:
|
|
1092
|
+
label: r("previewImage"),
|
|
1093
1093
|
value: e.previewImage || "",
|
|
1094
1094
|
onChange: (l) => e.previewImage = l
|
|
1095
1095
|
}
|
|
@@ -1098,38 +1098,38 @@ function Vr({ config: e }) {
|
|
|
1098
1098
|
}
|
|
1099
1099
|
function yt({
|
|
1100
1100
|
data: e,
|
|
1101
|
-
params:
|
|
1101
|
+
params: r,
|
|
1102
1102
|
visible: l,
|
|
1103
|
-
config:
|
|
1104
|
-
currentLocale:
|
|
1105
|
-
defaultLocale:
|
|
1106
|
-
allComponents:
|
|
1103
|
+
config: i,
|
|
1104
|
+
currentLocale: u,
|
|
1105
|
+
defaultLocale: m,
|
|
1106
|
+
allComponents: a,
|
|
1107
1107
|
onUpdateConfig: p
|
|
1108
1108
|
}) {
|
|
1109
|
-
var x, b, n, o, s,
|
|
1110
|
-
const { t: k } = A(),
|
|
1109
|
+
var x, b, n, o, s, d;
|
|
1110
|
+
const { t: k } = A(), h = ae(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? Br : K, [e.type]);
|
|
1111
1111
|
return /* @__PURE__ */ t(
|
|
1112
1112
|
Rr,
|
|
1113
1113
|
{
|
|
1114
|
-
preview:
|
|
1115
|
-
drop:
|
|
1116
|
-
drag:
|
|
1117
|
-
isDragging:
|
|
1114
|
+
preview: r.preview,
|
|
1115
|
+
drop: r.drop,
|
|
1116
|
+
drag: r.drag,
|
|
1117
|
+
isDragging: r.isDragging,
|
|
1118
1118
|
onDelete: () => {
|
|
1119
|
-
p((
|
|
1120
|
-
if (
|
|
1121
|
-
const c = Object.entries(
|
|
1122
|
-
delete
|
|
1119
|
+
p((f) => {
|
|
1120
|
+
if (f.properties) {
|
|
1121
|
+
const c = Object.entries(f.properties).sort(([, g], [, P]) => g.index - P.index);
|
|
1122
|
+
delete f.properties[e.id], c.filter(([g]) => g !== e.id).forEach(([, g], P) => {
|
|
1123
1123
|
g.index = P;
|
|
1124
1124
|
});
|
|
1125
1125
|
}
|
|
1126
1126
|
});
|
|
1127
1127
|
},
|
|
1128
1128
|
visible: l,
|
|
1129
|
-
onVisibilityChange: (
|
|
1129
|
+
onVisibilityChange: (f) => {
|
|
1130
1130
|
p((w) => {
|
|
1131
1131
|
const c = w.properties[e.id].data;
|
|
1132
|
-
c.visible =
|
|
1132
|
+
c.visible = f;
|
|
1133
1133
|
});
|
|
1134
1134
|
},
|
|
1135
1135
|
alwaysShowActions: !0,
|
|
@@ -1144,24 +1144,24 @@ function yt({
|
|
|
1144
1144
|
width: "calc(100% - 80px - 8px)",
|
|
1145
1145
|
flex: 1,
|
|
1146
1146
|
"& .MuiOutlinedInput-root": {
|
|
1147
|
-
borderColor: e.key ? le(
|
|
1147
|
+
borderColor: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
|
|
1148
1148
|
},
|
|
1149
1149
|
"& .MuiFormLabel-root": {
|
|
1150
|
-
color: e.key ? le(
|
|
1150
|
+
color: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
|
|
1151
1151
|
},
|
|
1152
1152
|
"& .MuiFormLabel-root.Mui-focused": {
|
|
1153
|
-
color: e.key ? le(
|
|
1153
|
+
color: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
|
|
1154
1154
|
}
|
|
1155
1155
|
},
|
|
1156
1156
|
value: e.key || "",
|
|
1157
|
-
onChange: (
|
|
1157
|
+
onChange: (f) => {
|
|
1158
1158
|
p((w) => {
|
|
1159
1159
|
const c = w.properties[e.id].data;
|
|
1160
|
-
c.key =
|
|
1160
|
+
c.key = f.target.value.trim();
|
|
1161
1161
|
});
|
|
1162
1162
|
},
|
|
1163
1163
|
InputProps: {
|
|
1164
|
-
endAdornment: !e.key || e.key && le(
|
|
1164
|
+
endAdornment: !e.key || e.key && le(i.properties, e.id, e.key) ? /* @__PURE__ */ t(
|
|
1165
1165
|
ue,
|
|
1166
1166
|
{
|
|
1167
1167
|
position: "end",
|
|
@@ -1190,12 +1190,12 @@ function yt({
|
|
|
1190
1190
|
label: k("label"),
|
|
1191
1191
|
size: "small",
|
|
1192
1192
|
sx: { flex: 1 },
|
|
1193
|
-
value: (((b = (x = e.locales) == null ? void 0 : x[
|
|
1194
|
-
onChange: (
|
|
1193
|
+
value: (((b = (x = e.locales) == null ? void 0 : x[u]) == null ? void 0 : b.name) ?? ((o = (n = e.locales) == null ? void 0 : n[m]) == null ? void 0 : o.name)) || "",
|
|
1194
|
+
onChange: (f) => {
|
|
1195
1195
|
p((w) => {
|
|
1196
1196
|
var v;
|
|
1197
1197
|
const c = w.properties[e.id].data;
|
|
1198
|
-
c.locales ?? (c.locales = {}), (v = c.locales)[
|
|
1198
|
+
c.locales ?? (c.locales = {}), (v = c.locales)[u] ?? (v[u] = {}), c.locales[u].name = f.target.value;
|
|
1199
1199
|
});
|
|
1200
1200
|
}
|
|
1201
1201
|
}
|
|
@@ -1208,78 +1208,81 @@ function yt({
|
|
|
1208
1208
|
select: !0,
|
|
1209
1209
|
sx: { flex: 1 },
|
|
1210
1210
|
value: e.type === "string" && e.multiline ? "multiline" : e.type || "string",
|
|
1211
|
-
onChange: (
|
|
1211
|
+
onChange: (f) => {
|
|
1212
1212
|
p((w) => {
|
|
1213
1213
|
const c = w.properties[e.id].data;
|
|
1214
1214
|
if (c.locales)
|
|
1215
1215
|
for (const g of Object.keys(c.locales))
|
|
1216
1216
|
c.locales[g].defaultValue = void 0;
|
|
1217
|
-
const v =
|
|
1217
|
+
const v = f.target.value;
|
|
1218
1218
|
v === "multiline" ? (c.type = "string", c.multiline = !0) : (typeof c.multiline < "u" && delete c.multiline, c.type = v);
|
|
1219
1219
|
});
|
|
1220
1220
|
},
|
|
1221
|
-
children: Ar.map((
|
|
1221
|
+
children: Ar.map((f) => /* @__PURE__ */ t(he, { value: f.value, children: f.label }, f.value))
|
|
1222
1222
|
}
|
|
1223
1223
|
)
|
|
1224
1224
|
] }),
|
|
1225
1225
|
/* @__PURE__ */ S(j, { direction: "row", gap: 1, children: [
|
|
1226
1226
|
/* @__PURE__ */ t(
|
|
1227
|
-
|
|
1227
|
+
h,
|
|
1228
1228
|
{
|
|
1229
|
-
allComponents:
|
|
1230
|
-
defaultLocale:
|
|
1231
|
-
component:
|
|
1229
|
+
allComponents: a,
|
|
1230
|
+
defaultLocale: m,
|
|
1231
|
+
component: i,
|
|
1232
1232
|
property: e,
|
|
1233
1233
|
label: k("defaultValue"),
|
|
1234
1234
|
size: "small",
|
|
1235
1235
|
fullWidth: !0,
|
|
1236
|
-
value: (
|
|
1237
|
-
onChange: (
|
|
1236
|
+
value: (d = (s = e.locales) == null ? void 0 : s[u]) == null ? void 0 : d.defaultValue,
|
|
1237
|
+
onChange: (f, w) => {
|
|
1238
1238
|
p((c) => {
|
|
1239
1239
|
var g;
|
|
1240
1240
|
const v = c.properties[e.id].data;
|
|
1241
1241
|
if (w != null && w.forceUpdateProperty) {
|
|
1242
|
-
const P = ve(v), C = ve(
|
|
1242
|
+
const P = ve(v), C = ve(f);
|
|
1243
1243
|
Object.keys(C).forEach((y) => {
|
|
1244
1244
|
P[y] || nt(v, y, C[y]);
|
|
1245
1245
|
});
|
|
1246
1246
|
} else
|
|
1247
|
-
v.locales ?? (v.locales = {}), (g = v.locales)[
|
|
1247
|
+
v.locales ?? (v.locales = {}), (g = v.locales)[u] ?? (g[u] = {}), v.locales[u].defaultValue = f;
|
|
1248
1248
|
});
|
|
1249
1249
|
}
|
|
1250
1250
|
}
|
|
1251
1251
|
),
|
|
1252
|
-
e.type === "custom" ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(Ur, { property: e, allComponents:
|
|
1252
|
+
e.type === "custom" ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(Ur, { property: e, allComponents: a }) }) : null
|
|
1253
1253
|
] })
|
|
1254
1254
|
] })
|
|
1255
1255
|
}
|
|
1256
1256
|
);
|
|
1257
1257
|
}
|
|
1258
|
-
function
|
|
1259
|
-
const [
|
|
1260
|
-
return
|
|
1261
|
-
|
|
1262
|
-
|
|
1263
|
-
|
|
1264
|
-
|
|
1265
|
-
|
|
1266
|
-
|
|
1267
|
-
|
|
1258
|
+
function Vr(e, r) {
|
|
1259
|
+
const [l, i] = Z(0);
|
|
1260
|
+
return M(() => {
|
|
1261
|
+
const m = setTimeout(() => {
|
|
1262
|
+
if (e.current) {
|
|
1263
|
+
let a = e.current.parentElement, p = 0;
|
|
1264
|
+
for (; a; )
|
|
1265
|
+
a.classList.contains("property-container") && p++, a = a.parentElement;
|
|
1266
|
+
i(p);
|
|
1267
|
+
}
|
|
1268
|
+
}, 100);
|
|
1269
|
+
return () => clearTimeout(m);
|
|
1270
|
+
}, [e, r]), l;
|
|
1268
1271
|
}
|
|
1269
1272
|
function Er({
|
|
1270
1273
|
config: e,
|
|
1271
|
-
currentLocale:
|
|
1274
|
+
currentLocale: r,
|
|
1272
1275
|
defaultLocale: l,
|
|
1273
|
-
allComponents:
|
|
1274
|
-
onUpdateConfig:
|
|
1275
|
-
useI18nEditor:
|
|
1276
|
+
allComponents: i,
|
|
1277
|
+
onUpdateConfig: u,
|
|
1278
|
+
useI18nEditor: m = !0
|
|
1276
1279
|
}) {
|
|
1277
|
-
const { t:
|
|
1280
|
+
const { t: a } = A(), p = pe({ variant: "dialog" }), k = e.properties && V(Object.values(e.properties), "index");
|
|
1278
1281
|
return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
|
|
1279
1282
|
/* @__PURE__ */ S(j, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between", children: [
|
|
1280
|
-
/* @__PURE__ */ t(F, { variant: "subtitle1", children:
|
|
1283
|
+
/* @__PURE__ */ t(F, { variant: "subtitle1", children: a("properties") }),
|
|
1281
1284
|
/* @__PURE__ */ t(O, { flex: 1 }),
|
|
1282
|
-
|
|
1285
|
+
m && /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...me(p), children: /* @__PURE__ */ t(ct, { fontSize: "small" }) })
|
|
1283
1286
|
] }),
|
|
1284
1287
|
e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ t(
|
|
1285
1288
|
ft,
|
|
@@ -1287,8 +1290,8 @@ function Er({
|
|
|
1287
1290
|
component: j,
|
|
1288
1291
|
gap: 2,
|
|
1289
1292
|
list: e.properties,
|
|
1290
|
-
renderItem: (
|
|
1291
|
-
const n = bt(e.properties,
|
|
1293
|
+
renderItem: (h, x, b) => {
|
|
1294
|
+
const n = bt(e.properties, h.id);
|
|
1292
1295
|
return /* @__PURE__ */ t(
|
|
1293
1296
|
re,
|
|
1294
1297
|
{
|
|
@@ -1303,103 +1306,103 @@ function Er({
|
|
|
1303
1306
|
children: /* @__PURE__ */ t(j, { gap: 2, children: /* @__PURE__ */ t(
|
|
1304
1307
|
yt,
|
|
1305
1308
|
{
|
|
1306
|
-
data:
|
|
1309
|
+
data: h,
|
|
1307
1310
|
params: b,
|
|
1308
1311
|
visible: n,
|
|
1309
1312
|
config: e,
|
|
1310
|
-
currentLocale:
|
|
1313
|
+
currentLocale: r,
|
|
1311
1314
|
defaultLocale: l,
|
|
1312
|
-
allComponents:
|
|
1313
|
-
onUpdateConfig:
|
|
1315
|
+
allComponents: i,
|
|
1316
|
+
onUpdateConfig: u
|
|
1314
1317
|
}
|
|
1315
1318
|
) })
|
|
1316
1319
|
},
|
|
1317
|
-
|
|
1320
|
+
h.id
|
|
1318
1321
|
);
|
|
1319
1322
|
}
|
|
1320
1323
|
}
|
|
1321
|
-
) : /* @__PURE__ */ t(te, { style: { fontSize: 12 }, children:
|
|
1324
|
+
) : /* @__PURE__ */ t(te, { style: { fontSize: 12 }, children: a("maker.properties.noProperties") }),
|
|
1322
1325
|
/* @__PURE__ */ t(
|
|
1323
|
-
|
|
1326
|
+
T,
|
|
1324
1327
|
{
|
|
1325
1328
|
fullWidth: !0,
|
|
1326
1329
|
variant: "outlined",
|
|
1327
1330
|
className: "ignore-style-override",
|
|
1328
1331
|
onClick: () => {
|
|
1329
|
-
|
|
1332
|
+
u((h) => {
|
|
1330
1333
|
var b;
|
|
1331
1334
|
const x = $e();
|
|
1332
|
-
|
|
1335
|
+
h.properties ?? (h.properties = {}), (b = h.properties)[x] ?? (b[x] = { index: (k == null ? void 0 : k.length) || 0, data: { id: x } });
|
|
1333
1336
|
});
|
|
1334
1337
|
},
|
|
1335
1338
|
startIcon: /* @__PURE__ */ t(at, {}),
|
|
1336
|
-
children:
|
|
1339
|
+
children: a("addObject", { object: a("property") })
|
|
1337
1340
|
}
|
|
1338
1341
|
),
|
|
1339
|
-
|
|
1342
|
+
m && /* @__PURE__ */ t(vt, { ...pt(p), component: e })
|
|
1340
1343
|
] }) });
|
|
1341
1344
|
}
|
|
1342
1345
|
function Ur({
|
|
1343
1346
|
property: e,
|
|
1344
|
-
allComponents:
|
|
1347
|
+
allComponents: r
|
|
1345
1348
|
}) {
|
|
1346
1349
|
const l = pe({ variant: "popper" });
|
|
1347
1350
|
return /* @__PURE__ */ S($, { children: [
|
|
1348
|
-
/* @__PURE__ */ t(
|
|
1351
|
+
/* @__PURE__ */ t(T, { sx: { minWidth: 0 }, ...me(l), children: /* @__PURE__ */ t(ut, { fontSize: "small" }) }),
|
|
1349
1352
|
/* @__PURE__ */ t(et, { ...mt(l), children: /* @__PURE__ */ t(st, { onClickAway: l.close, children: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ t(O, { width: 500, p: 2, children: /* @__PURE__ */ t(
|
|
1350
1353
|
Oe,
|
|
1351
1354
|
{
|
|
1352
1355
|
value: e.componentId,
|
|
1353
|
-
onChange: (
|
|
1354
|
-
allComponents:
|
|
1356
|
+
onChange: (i, u) => e.componentId = u,
|
|
1357
|
+
allComponents: r
|
|
1355
1358
|
}
|
|
1356
1359
|
) }) }) }) })
|
|
1357
1360
|
] });
|
|
1358
1361
|
}
|
|
1359
1362
|
function Wr({
|
|
1360
1363
|
value: e,
|
|
1361
|
-
valueImmutable:
|
|
1364
|
+
valueImmutable: r,
|
|
1362
1365
|
onChange: l,
|
|
1363
|
-
defaultLocale:
|
|
1364
|
-
allComponents:
|
|
1366
|
+
defaultLocale: i,
|
|
1367
|
+
allComponents: u
|
|
1365
1368
|
}) {
|
|
1366
1369
|
var k;
|
|
1367
|
-
const
|
|
1370
|
+
const m = pe({ variant: "popper" }), { locale: a } = A(), p = typeof (e == null ? void 0 : e.componentId) == "string" ? (k = u[e.componentId]) == null ? void 0 : k.data : void 0;
|
|
1368
1371
|
return p ? /* @__PURE__ */ S($, { children: [
|
|
1369
|
-
/* @__PURE__ */ t(
|
|
1372
|
+
/* @__PURE__ */ t(T, { sx: { minWidth: 0 }, disabled: !p, ...me(m), children: /* @__PURE__ */ t(ut, { fontSize: "small" }) }),
|
|
1370
1373
|
/* @__PURE__ */ t(
|
|
1371
1374
|
et,
|
|
1372
1375
|
{
|
|
1373
|
-
...mt(
|
|
1376
|
+
...mt(m),
|
|
1374
1377
|
sx: {
|
|
1375
1378
|
zIndex: 1e3
|
|
1376
1379
|
},
|
|
1377
|
-
children: /* @__PURE__ */ t(st, { onClickAway:
|
|
1380
|
+
children: /* @__PURE__ */ t(st, { onClickAway: m.close, children: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ S(O, { width: 500, p: 2, children: [
|
|
1378
1381
|
/* @__PURE__ */ t(F, { variant: "subtitle1", children: "Parameters" }),
|
|
1379
|
-
/* @__PURE__ */ t(j, { gap: 1, children: (p == null ? void 0 : p.properties) &&
|
|
1380
|
-
var x, b, n, o, s,
|
|
1382
|
+
/* @__PURE__ */ t(j, { gap: 1, children: (p == null ? void 0 : p.properties) && V(Object.values(p.properties), "index").map(({ data: h }) => {
|
|
1383
|
+
var x, b, n, o, s, d, f, w;
|
|
1381
1384
|
return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
|
|
1382
1385
|
K,
|
|
1383
1386
|
{
|
|
1384
|
-
allComponents:
|
|
1385
|
-
defaultLocale:
|
|
1387
|
+
allComponents: u,
|
|
1388
|
+
defaultLocale: i,
|
|
1386
1389
|
size: "small",
|
|
1387
1390
|
fullWidth: !0,
|
|
1388
1391
|
component: p,
|
|
1389
|
-
property:
|
|
1390
|
-
valueImmutable: ee((b = (x = e.properties) == null ? void 0 : x[
|
|
1391
|
-
value: ((o = (n = e.properties) == null ? void 0 : n[
|
|
1392
|
+
property: h,
|
|
1393
|
+
valueImmutable: ee((b = (x = e.properties) == null ? void 0 : x[h.id]) == null ? void 0 : b.value),
|
|
1394
|
+
value: ((o = (n = e.properties) == null ? void 0 : n[h.id]) == null ? void 0 : o.value) ?? ((d = (s = h.locales) == null ? void 0 : s[a]) == null ? void 0 : d.defaultValue) ?? ((w = (f = h.locales) == null ? void 0 : f[i]) == null ? void 0 : w.defaultValue),
|
|
1392
1395
|
onChange: (c) => {
|
|
1393
|
-
if (
|
|
1396
|
+
if (r) {
|
|
1394
1397
|
const v = JSON.parse(JSON.stringify(e));
|
|
1395
|
-
l == null || l({ ...v, properties: { ...v.properties, [
|
|
1398
|
+
l == null || l({ ...v, properties: { ...v.properties, [h.id]: { value: c } } });
|
|
1396
1399
|
} else
|
|
1397
|
-
|
|
1398
|
-
e.properties ?? (e.properties = {}), e.properties[
|
|
1400
|
+
H(p).doc.transact(() => {
|
|
1401
|
+
e.properties ?? (e.properties = {}), e.properties[h.id] = { value: c };
|
|
1399
1402
|
});
|
|
1400
1403
|
}
|
|
1401
1404
|
}
|
|
1402
|
-
) },
|
|
1405
|
+
) }, h.id);
|
|
1403
1406
|
}) })
|
|
1404
1407
|
] }) }) })
|
|
1405
1408
|
}
|
|
@@ -1408,26 +1411,26 @@ function Wr({
|
|
|
1408
1411
|
}
|
|
1409
1412
|
function vt({
|
|
1410
1413
|
type: e = "properties",
|
|
1411
|
-
component:
|
|
1414
|
+
component: r,
|
|
1412
1415
|
...l
|
|
1413
1416
|
}) {
|
|
1414
1417
|
var b, n, o;
|
|
1415
|
-
const { t:
|
|
1418
|
+
const { t: i } = A(), {
|
|
1416
1419
|
state: {
|
|
1417
|
-
components:
|
|
1418
|
-
supportedLocales:
|
|
1419
|
-
config: { defaultLocale:
|
|
1420
|
+
components: u,
|
|
1421
|
+
supportedLocales: m,
|
|
1422
|
+
config: { defaultLocale: a }
|
|
1420
1423
|
}
|
|
1421
|
-
} = de(), p = xe(), k =
|
|
1424
|
+
} = de(), p = xe(), k = H(r).doc, h = e === "properties" ? r.properties : e === "parameters" && ((b = r.renderer) == null ? void 0 : b.type) === "component" ? (n = u[r.renderer.componentId]) == null ? void 0 : n.data.properties : void 0, x = ((o = r.renderer) == null ? void 0 : o.type) === "component" ? r : void 0;
|
|
1422
1425
|
return /* @__PURE__ */ S(Pe, { ...l, fullWidth: !0, maxWidth: "lg", children: [
|
|
1423
|
-
/* @__PURE__ */ t(
|
|
1424
|
-
/* @__PURE__ */ t(Qe, { children:
|
|
1425
|
-
/* @__PURE__ */ t(
|
|
1426
|
-
|
|
1427
|
-
|
|
1426
|
+
/* @__PURE__ */ t(qe, { children: i("i18nEditorTitle") }),
|
|
1427
|
+
/* @__PURE__ */ t(Qe, { children: h && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ S(Me, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
|
|
1428
|
+
/* @__PURE__ */ t(He, { children: /* @__PURE__ */ t(se, { children: m.map(({ locale: s, name: d }) => /* @__PURE__ */ S(ce, { children: [
|
|
1429
|
+
d,
|
|
1430
|
+
a === s && /* @__PURE__ */ t(cr, { sx: { fontSize: 12, color: "text.secondary" } })
|
|
1428
1431
|
] }, s)) }) }),
|
|
1429
|
-
/* @__PURE__ */ t(Ye, { children:
|
|
1430
|
-
var
|
|
1432
|
+
/* @__PURE__ */ t(Ye, { children: V(Object.values(h), "index").map(({ data: s }) => /* @__PURE__ */ t(se, { children: m.map(({ locale: d }) => {
|
|
1433
|
+
var f, w, c, v, g, P, C, y, I, z, R, E, U, W, ie, Y, G, L, q, Q, Ce, je, ze, Re, De, Ae;
|
|
1431
1434
|
return /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ t(j, { gap: 1, children: e === "properties" ? /* @__PURE__ */ S($, { children: [
|
|
1432
1435
|
/* @__PURE__ */ t(
|
|
1433
1436
|
D,
|
|
@@ -1446,12 +1449,12 @@ function vt({
|
|
|
1446
1449
|
D,
|
|
1447
1450
|
{
|
|
1448
1451
|
size: "small",
|
|
1449
|
-
label:
|
|
1450
|
-
value: (((w = (
|
|
1452
|
+
label: i("label"),
|
|
1453
|
+
value: (((w = (f = s.locales) == null ? void 0 : f[d]) == null ? void 0 : w.name) ?? ((v = (c = s.locales) == null ? void 0 : c[a]) == null ? void 0 : v.name)) || "",
|
|
1451
1454
|
onChange: (_) => {
|
|
1452
1455
|
k.transact(() => {
|
|
1453
1456
|
var B;
|
|
1454
|
-
s.locales ?? (s.locales = {}), (B = s.locales)[
|
|
1457
|
+
s.locales ?? (s.locales = {}), (B = s.locales)[d] ?? (B[d] = {}), s.locales[d].name = _.target.value;
|
|
1455
1458
|
});
|
|
1456
1459
|
}
|
|
1457
1460
|
}
|
|
@@ -1460,18 +1463,18 @@ function vt({
|
|
|
1460
1463
|
K,
|
|
1461
1464
|
{
|
|
1462
1465
|
allComponents: p,
|
|
1463
|
-
defaultLocale:
|
|
1464
|
-
component:
|
|
1466
|
+
defaultLocale: a,
|
|
1467
|
+
component: r,
|
|
1465
1468
|
property: s,
|
|
1466
1469
|
size: "small",
|
|
1467
1470
|
fullWidth: !0,
|
|
1468
1471
|
label: "Default Value",
|
|
1469
|
-
valueImmutable: ee((P = (g = s.locales) == null ? void 0 : g[
|
|
1470
|
-
value: ((y = (C = s.locales) == null ? void 0 : C[
|
|
1472
|
+
valueImmutable: ee((P = (g = s.locales) == null ? void 0 : g[d]) == null ? void 0 : P.defaultValue),
|
|
1473
|
+
value: ((y = (C = s.locales) == null ? void 0 : C[d]) == null ? void 0 : y.defaultValue) ?? ((z = (I = s.locales) == null ? void 0 : I[a]) == null ? void 0 : z.defaultValue),
|
|
1471
1474
|
onChange: (_) => {
|
|
1472
1475
|
k.transact(() => {
|
|
1473
1476
|
var B;
|
|
1474
|
-
s.locales ?? (s.locales = {}), (B = s.locales)[
|
|
1477
|
+
s.locales ?? (s.locales = {}), (B = s.locales)[d] ?? (B[d] = {}), s.locales[d].defaultValue = _;
|
|
1475
1478
|
});
|
|
1476
1479
|
}
|
|
1477
1480
|
}
|
|
@@ -1480,66 +1483,66 @@ function vt({
|
|
|
1480
1483
|
K,
|
|
1481
1484
|
{
|
|
1482
1485
|
allComponents: p,
|
|
1483
|
-
defaultLocale:
|
|
1484
|
-
component:
|
|
1486
|
+
defaultLocale: a,
|
|
1487
|
+
component: r,
|
|
1485
1488
|
property: s,
|
|
1486
1489
|
size: "small",
|
|
1487
1490
|
fullWidth: !0,
|
|
1488
1491
|
valueImmutable: ee(
|
|
1489
|
-
(W = (U = (E = (R = x.renderer.properties) == null ? void 0 : R[s.id]) == null ? void 0 : E.locales) == null ? void 0 : U[
|
|
1492
|
+
(W = (U = (E = (R = x.renderer.properties) == null ? void 0 : R[s.id]) == null ? void 0 : E.locales) == null ? void 0 : U[d]) == null ? void 0 : W.value
|
|
1490
1493
|
),
|
|
1491
|
-
value: ((
|
|
1494
|
+
value: ((L = (G = (Y = (ie = x.renderer.properties) == null ? void 0 : ie[s.id]) == null ? void 0 : Y.locales) == null ? void 0 : G[d]) == null ? void 0 : L.value) ?? ((je = (Ce = (Q = (q = x.renderer.properties) == null ? void 0 : q[s.id]) == null ? void 0 : Q.locales) == null ? void 0 : Ce[a]) == null ? void 0 : je.value) ?? ((Re = (ze = s.locales) == null ? void 0 : ze[d]) == null ? void 0 : Re.defaultValue) ?? ((Ae = (De = s.locales) == null ? void 0 : De[a]) == null ? void 0 : Ae.defaultValue),
|
|
1492
1495
|
onChange: (_) => {
|
|
1493
1496
|
k.transact(() => {
|
|
1494
|
-
var B, Ne,
|
|
1495
|
-
(B = x.renderer).properties ?? (B.properties = {}), (Ne = x.renderer.properties)[
|
|
1497
|
+
var B, Ne, Te, Ve, Ee;
|
|
1498
|
+
(B = x.renderer).properties ?? (B.properties = {}), (Ne = x.renderer.properties)[Te = s.id] ?? (Ne[Te] = {}), (Ve = x.renderer.properties[s.id]).locales ?? (Ve.locales = {}), (Ee = x.renderer.properties[s.id].locales)[d] ?? (Ee[d] = {}), x.renderer.properties[s.id].locales[d].value = _;
|
|
1496
1499
|
});
|
|
1497
1500
|
}
|
|
1498
1501
|
}
|
|
1499
|
-
) }) : null }, s.id) },
|
|
1502
|
+
) }) : null }, s.id) }, d);
|
|
1500
1503
|
}) }, s.id)) })
|
|
1501
1504
|
] }) }) }),
|
|
1502
|
-
/* @__PURE__ */ t(Xe, { children: /* @__PURE__ */ t(
|
|
1503
|
-
var
|
|
1504
|
-
return (
|
|
1505
|
-
}, children:
|
|
1505
|
+
/* @__PURE__ */ t(Xe, { children: /* @__PURE__ */ t(T, { onClick: (s) => {
|
|
1506
|
+
var d;
|
|
1507
|
+
return (d = l.onClose) == null ? void 0 : d.call(l, s, "escapeKeyDown");
|
|
1508
|
+
}, children: i("close") }) })
|
|
1506
1509
|
] });
|
|
1507
1510
|
}
|
|
1508
|
-
const Fe = (e,
|
|
1509
|
-
const
|
|
1511
|
+
const Fe = (e, r) => (l) => {
|
|
1512
|
+
const i = [
|
|
1513
|
+
l.palette.info.main,
|
|
1510
1514
|
l.palette.primary.main,
|
|
1511
1515
|
l.palette.secondary.main,
|
|
1512
1516
|
l.palette.success.main,
|
|
1513
|
-
l.palette.warning.main
|
|
1514
|
-
|
|
1515
|
-
], a = e % r.length, f = r[a % r.length], d = Be(f, 0.5), p = Be(f, 1);
|
|
1517
|
+
l.palette.warning.main
|
|
1518
|
+
], u = Math.min(i.length - 1, e), m = i[u], a = Be(m, 0.5), p = Be(m, 1);
|
|
1516
1519
|
return {
|
|
1517
1520
|
// 保留原有的边框样式
|
|
1518
|
-
borderColor: `${
|
|
1521
|
+
borderColor: `${a} !important`,
|
|
1519
1522
|
borderLeft: "3px solid !important",
|
|
1520
1523
|
// 稍粗的左侧边框
|
|
1521
|
-
borderLeftColor:
|
|
1524
|
+
borderLeftColor: a,
|
|
1522
1525
|
// 使用透明度适应深色/浅色模式
|
|
1523
1526
|
color: p,
|
|
1524
|
-
...
|
|
1527
|
+
...r
|
|
1525
1528
|
};
|
|
1526
1529
|
};
|
|
1527
1530
|
function Br({
|
|
1528
1531
|
property: e,
|
|
1529
|
-
onChange:
|
|
1532
|
+
onChange: r,
|
|
1530
1533
|
defaultLocale: l,
|
|
1531
|
-
allComponents:
|
|
1534
|
+
allComponents: i
|
|
1532
1535
|
}) {
|
|
1533
|
-
const { t:
|
|
1536
|
+
const { t: u, locale: m } = A(), a = J(null), p = Vr(a, e), k = N(() => {
|
|
1534
1537
|
if (!(e.type !== "json" && e.type !== "yaml" && e.type !== "array") && e.subProperties)
|
|
1535
1538
|
try {
|
|
1536
|
-
const
|
|
1537
|
-
|
|
1539
|
+
const h = {};
|
|
1540
|
+
V(Object.values(e.subProperties), "index").filter(
|
|
1538
1541
|
(n) => n.data.visible !== !1 && n.data.key
|
|
1539
1542
|
).forEach(({ data: n }) => {
|
|
1540
|
-
var s,
|
|
1543
|
+
var s, d, f, w;
|
|
1541
1544
|
if (!n.key) return;
|
|
1542
|
-
let o = ((
|
|
1545
|
+
let o = ((d = (s = n.locales) == null ? void 0 : s[m]) == null ? void 0 : d.defaultValue) ?? ((w = (f = n.locales) == null ? void 0 : f[l]) == null ? void 0 : w.defaultValue);
|
|
1543
1546
|
if (n.type === "number")
|
|
1544
1547
|
o = Number(o);
|
|
1545
1548
|
else if (n.type === "boolean")
|
|
@@ -1550,28 +1553,27 @@ function Br({
|
|
|
1550
1553
|
} catch (c) {
|
|
1551
1554
|
console.error("Error parsing nested value", o, c), o = {};
|
|
1552
1555
|
}
|
|
1553
|
-
|
|
1556
|
+
h[n.key] = o;
|
|
1554
1557
|
});
|
|
1555
|
-
const b = ge(
|
|
1556
|
-
|
|
1557
|
-
} catch (
|
|
1558
|
-
console.error("Error converting structure to text:",
|
|
1558
|
+
const b = ge(h, e.type);
|
|
1559
|
+
r == null || r(b);
|
|
1560
|
+
} catch (h) {
|
|
1561
|
+
console.error("Error converting structure to text:", h);
|
|
1559
1562
|
}
|
|
1560
|
-
}, [e,
|
|
1561
|
-
return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(j, { direction: "column", gap: 1.5, sx: { width: "100%" }, children: [
|
|
1562
|
-
/* @__PURE__ */ t(Ct, { sx: { mt: -1 }, children: /* @__PURE__ */ t(F, { variant: "caption", color: "text.secondary", children:
|
|
1563
|
+
}, [e, m, l, r]);
|
|
1564
|
+
return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(j, { direction: "column", gap: 1.5, sx: { width: "100%" }, ref: a, children: [
|
|
1565
|
+
/* @__PURE__ */ t(Ct, { sx: { mt: -1 }, children: /* @__PURE__ */ t(F, { variant: "caption", color: "text.secondary", children: u("maker.properties.subProperties") }) }),
|
|
1563
1566
|
e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ t(
|
|
1564
1567
|
ft,
|
|
1565
1568
|
{
|
|
1566
1569
|
component: j,
|
|
1567
1570
|
gap: 2,
|
|
1568
1571
|
list: e.subProperties,
|
|
1569
|
-
renderItem: (
|
|
1570
|
-
const n =
|
|
1572
|
+
renderItem: (h, x, b) => {
|
|
1573
|
+
const n = h.visible !== !1;
|
|
1571
1574
|
return /* @__PURE__ */ t(
|
|
1572
1575
|
re,
|
|
1573
1576
|
{
|
|
1574
|
-
ref: d,
|
|
1575
1577
|
elevation: 0,
|
|
1576
1578
|
className: "property-container",
|
|
1577
1579
|
sx: {
|
|
@@ -1583,24 +1585,24 @@ function Br({
|
|
|
1583
1585
|
children: /* @__PURE__ */ t(j, { gap: 2, children: /* @__PURE__ */ t(
|
|
1584
1586
|
yt,
|
|
1585
1587
|
{
|
|
1586
|
-
data:
|
|
1588
|
+
data: h,
|
|
1587
1589
|
params: b,
|
|
1588
1590
|
visible: n,
|
|
1589
1591
|
config: {
|
|
1590
1592
|
properties: e.subProperties
|
|
1591
1593
|
},
|
|
1592
|
-
currentLocale:
|
|
1594
|
+
currentLocale: m,
|
|
1593
1595
|
defaultLocale: l,
|
|
1594
|
-
allComponents:
|
|
1596
|
+
allComponents: i,
|
|
1595
1597
|
onUpdateConfig: (o) => {
|
|
1596
1598
|
try {
|
|
1597
1599
|
const s = { properties: e.subProperties || {} };
|
|
1598
1600
|
o(s);
|
|
1599
|
-
const
|
|
1601
|
+
const d = {
|
|
1600
1602
|
...e,
|
|
1601
1603
|
subProperties: s.properties
|
|
1602
1604
|
};
|
|
1603
|
-
|
|
1605
|
+
r == null || r(d, { forceUpdateProperty: !0 }), k();
|
|
1604
1606
|
} catch (s) {
|
|
1605
1607
|
console.error("Error updating property:", s);
|
|
1606
1608
|
}
|
|
@@ -1608,13 +1610,13 @@ function Br({
|
|
|
1608
1610
|
}
|
|
1609
1611
|
) })
|
|
1610
1612
|
},
|
|
1611
|
-
|
|
1613
|
+
h.id
|
|
1612
1614
|
);
|
|
1613
1615
|
}
|
|
1614
1616
|
}
|
|
1615
|
-
) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: 100 }, children:
|
|
1617
|
+
) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: 100 }, children: u("maker.properties.noSubProperties") }),
|
|
1616
1618
|
/* @__PURE__ */ t(
|
|
1617
|
-
|
|
1619
|
+
T,
|
|
1618
1620
|
{
|
|
1619
1621
|
fullWidth: !0,
|
|
1620
1622
|
variant: "outlined",
|
|
@@ -1623,15 +1625,15 @@ function Br({
|
|
|
1623
1625
|
startIcon: /* @__PURE__ */ t(at, {}),
|
|
1624
1626
|
onClick: () => {
|
|
1625
1627
|
try {
|
|
1626
|
-
const
|
|
1627
|
-
index: Object.values(
|
|
1628
|
+
const h = e.subProperties || {}, x = $e(), n = {
|
|
1629
|
+
index: Object.values(h).length,
|
|
1628
1630
|
data: {
|
|
1629
1631
|
id: x,
|
|
1630
1632
|
key: "",
|
|
1631
1633
|
type: "string",
|
|
1632
1634
|
visible: !0,
|
|
1633
1635
|
locales: {
|
|
1634
|
-
[
|
|
1636
|
+
[m]: {
|
|
1635
1637
|
name: "",
|
|
1636
1638
|
defaultValue: ""
|
|
1637
1639
|
}
|
|
@@ -1642,13 +1644,13 @@ function Br({
|
|
|
1642
1644
|
}, o = {
|
|
1643
1645
|
...e,
|
|
1644
1646
|
subProperties: {
|
|
1645
|
-
...
|
|
1647
|
+
...h,
|
|
1646
1648
|
[x]: n
|
|
1647
1649
|
}
|
|
1648
1650
|
};
|
|
1649
|
-
|
|
1650
|
-
} catch (
|
|
1651
|
-
console.error("Error adding property:",
|
|
1651
|
+
r == null || r(o, { forceUpdateProperty: !0 }), k();
|
|
1652
|
+
} catch (h) {
|
|
1653
|
+
console.error("Error adding property:", h);
|
|
1652
1654
|
}
|
|
1653
1655
|
},
|
|
1654
1656
|
sx: {
|
|
@@ -1656,32 +1658,32 @@ function Br({
|
|
|
1656
1658
|
// borderLeft: undefined,
|
|
1657
1659
|
})
|
|
1658
1660
|
},
|
|
1659
|
-
children:
|
|
1661
|
+
children: u("maker.properties.addSubProperty")
|
|
1660
1662
|
}
|
|
1661
1663
|
)
|
|
1662
1664
|
] });
|
|
1663
1665
|
}
|
|
1664
1666
|
function K({
|
|
1665
1667
|
component: e,
|
|
1666
|
-
property:
|
|
1668
|
+
property: r,
|
|
1667
1669
|
value: l,
|
|
1668
|
-
onChange:
|
|
1669
|
-
valueImmutable:
|
|
1670
|
-
defaultLocale:
|
|
1671
|
-
allComponents:
|
|
1670
|
+
onChange: i,
|
|
1671
|
+
valueImmutable: u,
|
|
1672
|
+
defaultLocale: m,
|
|
1673
|
+
allComponents: a,
|
|
1672
1674
|
...p
|
|
1673
1675
|
}) {
|
|
1674
|
-
var o, s,
|
|
1675
|
-
const { locale: k } = A(),
|
|
1676
|
+
var o, s, d, f, w;
|
|
1677
|
+
const { locale: k } = A(), h = Zt(), x = J(null), b = () => {
|
|
1676
1678
|
var v;
|
|
1677
|
-
const c = (v =
|
|
1679
|
+
const c = (v = h == null ? void 0 : h.current) == null ? void 0 : v.getUploader();
|
|
1678
1680
|
c == null || c.open(), x.current && c.onceUploadSuccess(({ response: g }) => {
|
|
1679
1681
|
var C, y;
|
|
1680
1682
|
let P = ((C = g == null ? void 0 : g.data) == null ? void 0 : C.filename) || "";
|
|
1681
1683
|
P && (P = `mediakit://${P}`, l && !l.includes("mediakit://") && (P += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), (y = x.current) == null || y.call(x, P);
|
|
1682
1684
|
});
|
|
1683
|
-
}, n = p.label || ((s = (o =
|
|
1684
|
-
if (
|
|
1685
|
+
}, n = p.label || ((s = (o = r.locales) == null ? void 0 : o[k]) == null ? void 0 : s.name) || ((f = (d = r.locales) == null ? void 0 : d[m]) == null ? void 0 : f.name) || r.key || r.id;
|
|
1686
|
+
if (r.type === "number")
|
|
1685
1687
|
return /* @__PURE__ */ t(
|
|
1686
1688
|
Kr,
|
|
1687
1689
|
{
|
|
@@ -1689,11 +1691,11 @@ function K({
|
|
|
1689
1691
|
label: n,
|
|
1690
1692
|
NumberProps: {
|
|
1691
1693
|
value: ["number", "string"].includes(typeof l) ? l : null,
|
|
1692
|
-
onChange: (c, v) =>
|
|
1694
|
+
onChange: (c, v) => i == null ? void 0 : i(v)
|
|
1693
1695
|
}
|
|
1694
1696
|
}
|
|
1695
1697
|
);
|
|
1696
|
-
if (
|
|
1698
|
+
if (r.type === "decimal")
|
|
1697
1699
|
return /* @__PURE__ */ t(
|
|
1698
1700
|
D,
|
|
1699
1701
|
{
|
|
@@ -1704,81 +1706,81 @@ function K({
|
|
|
1704
1706
|
onChange: (c) => {
|
|
1705
1707
|
const v = c.target.value;
|
|
1706
1708
|
if (v === "" || v === "-") {
|
|
1707
|
-
|
|
1709
|
+
i == null || i(v);
|
|
1708
1710
|
return;
|
|
1709
1711
|
}
|
|
1710
1712
|
if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(v)) {
|
|
1711
1713
|
let P = v;
|
|
1712
|
-
/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(P) && (P = Number(P)),
|
|
1714
|
+
/^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(P) && (P = Number(P)), i == null || i(P);
|
|
1713
1715
|
}
|
|
1714
1716
|
}
|
|
1715
1717
|
}
|
|
1716
1718
|
);
|
|
1717
|
-
if (
|
|
1719
|
+
if (r.type === "boolean")
|
|
1718
1720
|
return /* @__PURE__ */ t(
|
|
1719
1721
|
Ge,
|
|
1720
1722
|
{
|
|
1721
1723
|
label: n,
|
|
1722
1724
|
labelPlacement: "start",
|
|
1723
|
-
control: /* @__PURE__ */ t(
|
|
1725
|
+
control: /* @__PURE__ */ t(Le, { checked: l === !0, onChange: (c, v) => i == null ? void 0 : i(v) })
|
|
1724
1726
|
}
|
|
1725
1727
|
);
|
|
1726
|
-
if (
|
|
1728
|
+
if (r.type === "color")
|
|
1727
1729
|
return /* @__PURE__ */ t(
|
|
1728
1730
|
Cr,
|
|
1729
1731
|
{
|
|
1730
1732
|
label: n,
|
|
1731
1733
|
value: l,
|
|
1732
1734
|
onChange: (c) => {
|
|
1733
|
-
|
|
1735
|
+
i == null || i(c);
|
|
1734
1736
|
}
|
|
1735
1737
|
}
|
|
1736
1738
|
);
|
|
1737
|
-
if (
|
|
1739
|
+
if (r.type === "json" || r.type === "yaml")
|
|
1738
1740
|
return /* @__PURE__ */ t(
|
|
1739
1741
|
jr,
|
|
1740
1742
|
{
|
|
1741
1743
|
label: n,
|
|
1742
1744
|
value: l,
|
|
1743
1745
|
onChange: (c) => {
|
|
1744
|
-
|
|
1746
|
+
i == null || i(c);
|
|
1745
1747
|
},
|
|
1746
|
-
property:
|
|
1748
|
+
property: r,
|
|
1747
1749
|
component: e,
|
|
1748
|
-
defaultLocale:
|
|
1749
|
-
allComponents:
|
|
1750
|
+
defaultLocale: m,
|
|
1751
|
+
allComponents: a,
|
|
1750
1752
|
PropertyValueField: K,
|
|
1751
1753
|
onUpload: (c) => {
|
|
1752
1754
|
x.current = c, b();
|
|
1753
1755
|
}
|
|
1754
1756
|
}
|
|
1755
1757
|
);
|
|
1756
|
-
if (
|
|
1757
|
-
const c = (w =
|
|
1758
|
+
if (r.type === "custom") {
|
|
1759
|
+
const c = (w = a[r.componentId]) == null ? void 0 : w.data;
|
|
1758
1760
|
return c ? /* @__PURE__ */ t(O, { width: "100%", children: /* @__PURE__ */ t(
|
|
1759
1761
|
ot,
|
|
1760
1762
|
{
|
|
1761
1763
|
componentId: c.id,
|
|
1762
|
-
props: { label: n, value: l, onChange:
|
|
1764
|
+
props: { label: n, value: l, onChange: i },
|
|
1763
1765
|
locale: k,
|
|
1764
1766
|
dev: {
|
|
1765
1767
|
mode: "draft",
|
|
1766
|
-
components:
|
|
1767
|
-
defaultLocale:
|
|
1768
|
+
components: a,
|
|
1769
|
+
defaultLocale: m
|
|
1768
1770
|
}
|
|
1769
1771
|
}
|
|
1770
1772
|
) }) : /* @__PURE__ */ t(D, { ...p, label: n, disabled: !0, placeholder: "Click right button select a component" });
|
|
1771
1773
|
}
|
|
1772
|
-
if (
|
|
1774
|
+
if (r.type === "component")
|
|
1773
1775
|
return /* @__PURE__ */ S(j, { width: "100%", direction: "row", gap: 1, children: [
|
|
1774
1776
|
/* @__PURE__ */ t(O, { flex: 1, children: /* @__PURE__ */ t(
|
|
1775
1777
|
Oe,
|
|
1776
1778
|
{
|
|
1777
|
-
allComponents:
|
|
1779
|
+
allComponents: a,
|
|
1778
1780
|
label: n,
|
|
1779
1781
|
value: l == null ? void 0 : l.componentId,
|
|
1780
1782
|
onChange: (c, v) => {
|
|
1781
|
-
|
|
1783
|
+
u || !l ? i == null || i({ ...l && JSON.parse(JSON.stringify(l)), componentId: v }) : typeof l == "object" && (l.componentId = v);
|
|
1782
1784
|
}
|
|
1783
1785
|
}
|
|
1784
1786
|
) }),
|
|
@@ -1786,15 +1788,15 @@ function K({
|
|
|
1786
1788
|
Wr,
|
|
1787
1789
|
{
|
|
1788
1790
|
value: l,
|
|
1789
|
-
valueImmutable:
|
|
1790
|
-
onChange:
|
|
1791
|
-
defaultLocale:
|
|
1792
|
-
allComponents:
|
|
1791
|
+
valueImmutable: u,
|
|
1792
|
+
onChange: i,
|
|
1793
|
+
defaultLocale: m,
|
|
1794
|
+
allComponents: a
|
|
1793
1795
|
}
|
|
1794
1796
|
) })
|
|
1795
1797
|
] });
|
|
1796
|
-
if (!
|
|
1797
|
-
const c =
|
|
1798
|
+
if (!r.type || ["string", "url"].includes(r.type)) {
|
|
1799
|
+
const c = r.type === "string" ? r.multiline : void 0, v = r.type === "url" ? l == null ? void 0 : l.url : l;
|
|
1798
1800
|
return /* @__PURE__ */ t(
|
|
1799
1801
|
D,
|
|
1800
1802
|
{
|
|
@@ -1804,10 +1806,10 @@ function K({
|
|
|
1804
1806
|
multiline: c,
|
|
1805
1807
|
minRows: c ? 2 : void 0,
|
|
1806
1808
|
maxRows: c ? 10 : void 0,
|
|
1807
|
-
onChange: (g) =>
|
|
1808
|
-
|
|
1809
|
+
onChange: (g) => i == null ? void 0 : i(
|
|
1810
|
+
r.type === "url" ? { ...l, url: g.target.value, mediaKitUrl: g.target.value } : g.target.value
|
|
1809
1811
|
),
|
|
1810
|
-
InputProps:
|
|
1812
|
+
InputProps: r.type === "url" ? {
|
|
1811
1813
|
sx: { pr: 0 },
|
|
1812
1814
|
endAdornment: /* @__PURE__ */ S(ue, { position: "end", children: [
|
|
1813
1815
|
/* @__PURE__ */ t(
|
|
@@ -1820,7 +1822,7 @@ function K({
|
|
|
1820
1822
|
P && (C = await fe(P).catch(() => be(P)).catch(() => {
|
|
1821
1823
|
}));
|
|
1822
1824
|
let y = ((R = g == null ? void 0 : g.data) == null ? void 0 : R.filename) || "";
|
|
1823
|
-
y && (y = `mediakit://${y}`),
|
|
1825
|
+
y && (y = `mediakit://${y}`), i == null || i({
|
|
1824
1826
|
url: P,
|
|
1825
1827
|
mediaKitUrl: y,
|
|
1826
1828
|
width: C == null ? void 0 : C.naturalWidth,
|
|
@@ -1835,14 +1837,14 @@ function K({
|
|
|
1835
1837
|
}
|
|
1836
1838
|
);
|
|
1837
1839
|
}
|
|
1838
|
-
return
|
|
1840
|
+
return r.type === "array" ? /* @__PURE__ */ t(
|
|
1839
1841
|
kr,
|
|
1840
1842
|
{
|
|
1841
1843
|
label: n,
|
|
1842
1844
|
value: Array.isArray(l) ? l : [],
|
|
1843
|
-
onChange: (c) =>
|
|
1844
|
-
property:
|
|
1845
|
-
renderItem: ({ item: c, index: v, onChange: g }) =>
|
|
1845
|
+
onChange: (c) => i == null ? void 0 : i(c),
|
|
1846
|
+
property: r,
|
|
1847
|
+
renderItem: ({ item: c, index: v, onChange: g }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(j, { gap: 1, width: "100%", children: V(Object.values(r.subProperties), "index").filter((P) => P.data.visible !== !1).map(({ data: P }) => P.key ? /* @__PURE__ */ t(
|
|
1846
1848
|
K,
|
|
1847
1849
|
{
|
|
1848
1850
|
component: e,
|
|
@@ -1854,20 +1856,20 @@ function K({
|
|
|
1854
1856
|
},
|
|
1855
1857
|
size: "small",
|
|
1856
1858
|
fullWidth: !0,
|
|
1857
|
-
defaultLocale:
|
|
1858
|
-
allComponents:
|
|
1859
|
+
defaultLocale: m,
|
|
1860
|
+
allComponents: a
|
|
1859
1861
|
},
|
|
1860
1862
|
P.id
|
|
1861
1863
|
) : null) }, v) : /* @__PURE__ */ t(D, { size: p.size, fullWidth: !0, value: c, onChange: (P) => g(P.target.value) })
|
|
1862
1864
|
}
|
|
1863
|
-
) : (console.error("Unsupported property type",
|
|
1865
|
+
) : (console.error("Unsupported property type", r.type), null);
|
|
1864
1866
|
}
|
|
1865
1867
|
function Kr({
|
|
1866
1868
|
NumberProps: e,
|
|
1867
|
-
...
|
|
1869
|
+
...r
|
|
1868
1870
|
}) {
|
|
1869
|
-
const { getInputProps: l } = ir(e),
|
|
1870
|
-
return /* @__PURE__ */ t(D, { ...
|
|
1871
|
+
const { getInputProps: l } = ir(e), i = l();
|
|
1872
|
+
return /* @__PURE__ */ t(D, { ...r, inputProps: i });
|
|
1871
1873
|
}
|
|
1872
1874
|
const Fr = `import React from '@blocklet/pages-kit/builtin/react'
|
|
1873
1875
|
import { Box } from '@blocklet/pages-kit/builtin/mui/material'
|
|
@@ -1883,20 +1885,20 @@ export default function () {
|
|
|
1883
1885
|
function Jr({
|
|
1884
1886
|
value: e
|
|
1885
1887
|
}) {
|
|
1886
|
-
const { locale:
|
|
1887
|
-
return
|
|
1888
|
-
var
|
|
1889
|
-
(
|
|
1888
|
+
const { locale: r } = A(), l = it(), i = H(e).doc;
|
|
1889
|
+
return M(() => {
|
|
1890
|
+
var u;
|
|
1891
|
+
(u = e.renderer) != null && u.script || (i.transact(() => {
|
|
1890
1892
|
e.renderer.script = e.renderer.type === "react-component" ? Fr : _r;
|
|
1891
1893
|
}), l());
|
|
1892
1894
|
}, [e]), /* @__PURE__ */ t(O, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ t(
|
|
1893
1895
|
ke,
|
|
1894
1896
|
{
|
|
1895
1897
|
keyId: e.id,
|
|
1896
|
-
locale:
|
|
1898
|
+
locale: r,
|
|
1897
1899
|
language: "typescript",
|
|
1898
1900
|
value: e.renderer.script || "",
|
|
1899
|
-
onChange: (
|
|
1901
|
+
onChange: (u) => e.renderer.script = u,
|
|
1900
1902
|
typeScriptNoValidation: !1
|
|
1901
1903
|
},
|
|
1902
1904
|
e.id
|
|
@@ -1904,14 +1906,14 @@ function Jr({
|
|
|
1904
1906
|
}
|
|
1905
1907
|
function $r({ value: e }) {
|
|
1906
1908
|
var x, b, n;
|
|
1907
|
-
const { t:
|
|
1909
|
+
const { t: r } = A(), l = H(e).doc, {
|
|
1908
1910
|
state: {
|
|
1909
|
-
components:
|
|
1910
|
-
config: { defaultLocale:
|
|
1911
|
-
resources:
|
|
1911
|
+
components: i,
|
|
1912
|
+
config: { defaultLocale: u },
|
|
1913
|
+
resources: m
|
|
1912
1914
|
},
|
|
1913
|
-
localState: { currentLocale:
|
|
1914
|
-
} = de(), p = xe(), k = ((x =
|
|
1915
|
+
localState: { currentLocale: a }
|
|
1916
|
+
} = de(), p = xe(), k = ((x = i[e.renderer.componentId]) == null ? void 0 : x.data) ?? ((n = (b = m.components) == null ? void 0 : b[e.renderer.componentId]) == null ? void 0 : n.component), h = pe({ variant: "dialog" });
|
|
1915
1917
|
return /* @__PURE__ */ S(j, { gap: 1, children: [
|
|
1916
1918
|
/* @__PURE__ */ t(
|
|
1917
1919
|
Oe,
|
|
@@ -1924,50 +1926,50 @@ function $r({ value: e }) {
|
|
|
1924
1926
|
),
|
|
1925
1927
|
k && /* @__PURE__ */ S($, { children: [
|
|
1926
1928
|
/* @__PURE__ */ S(j, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
|
|
1927
|
-
/* @__PURE__ */ t(F, { variant: "subtitle2", children:
|
|
1928
|
-
/* @__PURE__ */ t(
|
|
1929
|
+
/* @__PURE__ */ t(F, { variant: "subtitle2", children: r("parameters") }),
|
|
1930
|
+
/* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...me(h), children: /* @__PURE__ */ t(ct, { fontSize: "small" }) })
|
|
1929
1931
|
] }),
|
|
1930
|
-
k.properties &&
|
|
1931
|
-
var s,
|
|
1932
|
+
k.properties && V(Object.values(k.properties), "index").map(({ data: o }) => {
|
|
1933
|
+
var s, d, f, w, c, v, g, P, C, y, I, z, R, E, U, W;
|
|
1932
1934
|
return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
|
|
1933
1935
|
K,
|
|
1934
1936
|
{
|
|
1935
1937
|
allComponents: p,
|
|
1936
|
-
defaultLocale:
|
|
1938
|
+
defaultLocale: u,
|
|
1937
1939
|
component: k,
|
|
1938
1940
|
property: o,
|
|
1939
1941
|
fullWidth: !0,
|
|
1940
1942
|
size: "small",
|
|
1941
|
-
valueImmutable: ee((w = (
|
|
1942
|
-
value: ((P = (g = (v = (c = e.renderer.properties) == null ? void 0 : c[o.id]) == null ? void 0 : v.locales) == null ? void 0 : g[
|
|
1943
|
+
valueImmutable: ee((w = (f = (d = (s = e.renderer.properties) == null ? void 0 : s[o.id]) == null ? void 0 : d.locales) == null ? void 0 : f[a]) == null ? void 0 : w.value),
|
|
1944
|
+
value: ((P = (g = (v = (c = e.renderer.properties) == null ? void 0 : c[o.id]) == null ? void 0 : v.locales) == null ? void 0 : g[a]) == null ? void 0 : P.value) ?? ((z = (I = (y = (C = e.renderer.properties) == null ? void 0 : C[o.id]) == null ? void 0 : y.locales) == null ? void 0 : I[u]) == null ? void 0 : z.value) ?? ((E = (R = o.locales) == null ? void 0 : R[a]) == null ? void 0 : E.defaultValue) ?? ((W = (U = o.locales) == null ? void 0 : U[u]) == null ? void 0 : W.defaultValue),
|
|
1943
1945
|
onChange: (ie) => {
|
|
1944
1946
|
l.transact(() => {
|
|
1945
|
-
var Y, G,
|
|
1946
|
-
(Y = e.renderer).properties ?? (Y.properties = {}), (G = e.renderer.properties)[
|
|
1947
|
+
var Y, G, L, q, Q;
|
|
1948
|
+
(Y = e.renderer).properties ?? (Y.properties = {}), (G = e.renderer.properties)[L = o.id] ?? (G[L] = {}), (q = e.renderer.properties[o.id]).locales ?? (q.locales = {}), (Q = e.renderer.properties[o.id].locales)[a] ?? (Q[a] = {}), e.renderer.properties[o.id].locales[a].value = ie;
|
|
1947
1949
|
});
|
|
1948
1950
|
}
|
|
1949
1951
|
}
|
|
1950
1952
|
) }, o.id);
|
|
1951
1953
|
}),
|
|
1952
|
-
/* @__PURE__ */ t(vt, { ...pt(
|
|
1954
|
+
/* @__PURE__ */ t(vt, { ...pt(h), component: e, type: "parameters" })
|
|
1953
1955
|
] })
|
|
1954
1956
|
] });
|
|
1955
1957
|
}
|
|
1956
1958
|
function Oe({
|
|
1957
1959
|
label: e,
|
|
1958
|
-
options:
|
|
1960
|
+
options: r,
|
|
1959
1961
|
excludes: l,
|
|
1960
|
-
value:
|
|
1961
|
-
onChange:
|
|
1962
|
-
allComponents:
|
|
1963
|
-
...
|
|
1962
|
+
value: i,
|
|
1963
|
+
onChange: u,
|
|
1964
|
+
allComponents: m,
|
|
1965
|
+
...a
|
|
1964
1966
|
}) {
|
|
1965
1967
|
var x;
|
|
1966
|
-
const { t: p } = A(), k =
|
|
1968
|
+
const { t: p } = A(), k = r ?? V(Object.values(mr(m, ...l ?? [])), "index").map((b) => b.data), h = (typeof i == "string" ? (x = m[i]) == null ? void 0 : x.data : void 0) ?? null;
|
|
1967
1969
|
return /* @__PURE__ */ t(
|
|
1968
1970
|
Ze,
|
|
1969
1971
|
{
|
|
1970
|
-
...
|
|
1972
|
+
...a,
|
|
1971
1973
|
size: "small",
|
|
1972
1974
|
options: k,
|
|
1973
1975
|
autoHighlight: !0,
|
|
@@ -1975,113 +1977,113 @@ function Oe({
|
|
|
1975
1977
|
getOptionKey: (b) => b.id,
|
|
1976
1978
|
getOptionLabel: (b) => b.name || b.id,
|
|
1977
1979
|
renderInput: (b) => /* @__PURE__ */ t(D, { label: e || p("component"), ...b }),
|
|
1978
|
-
value:
|
|
1980
|
+
value: h,
|
|
1979
1981
|
onChange: (b, n) => {
|
|
1980
|
-
var s,
|
|
1982
|
+
var s, d, f, w, c, v;
|
|
1981
1983
|
let o = {};
|
|
1982
1984
|
n && (o = {
|
|
1983
|
-
blockletId: (s =
|
|
1984
|
-
blockletTitle: (
|
|
1985
|
-
componentName: ((w = (
|
|
1986
|
-
}),
|
|
1985
|
+
blockletId: (s = m[n == null ? void 0 : n.id]) == null ? void 0 : s.blockletId,
|
|
1986
|
+
blockletTitle: (d = m[n == null ? void 0 : n.id]) == null ? void 0 : d.blockletTitle,
|
|
1987
|
+
componentName: ((w = (f = m[n == null ? void 0 : n.id]) == null ? void 0 : f.data) == null ? void 0 : w.name) || ((v = (c = m[n == null ? void 0 : n.id]) == null ? void 0 : c.data) == null ? void 0 : v.id)
|
|
1988
|
+
}), u == null || u(b, n == null ? void 0 : n.id, o);
|
|
1987
1989
|
}
|
|
1988
1990
|
}
|
|
1989
1991
|
);
|
|
1990
1992
|
}
|
|
1991
|
-
function
|
|
1993
|
+
function Mr({
|
|
1992
1994
|
config: e,
|
|
1993
|
-
allComponents:
|
|
1995
|
+
allComponents: r,
|
|
1994
1996
|
defaultLocale: l,
|
|
1995
|
-
propertiesValue:
|
|
1996
|
-
currentLocale:
|
|
1997
|
-
onChange:
|
|
1998
|
-
props:
|
|
1997
|
+
propertiesValue: i,
|
|
1998
|
+
currentLocale: u,
|
|
1999
|
+
onChange: m,
|
|
2000
|
+
props: a
|
|
1999
2001
|
}) {
|
|
2000
|
-
const { t: p } = A(), [k,
|
|
2001
|
-
|
|
2002
|
+
const { t: p } = A(), [k, h] = Z(e == null ? void 0 : e.properties), [x, b] = Z(null);
|
|
2003
|
+
M(() => {
|
|
2002
2004
|
(() => {
|
|
2003
2005
|
var w, c;
|
|
2004
2006
|
((w = e == null ? void 0 : e.renderer) == null ? void 0 : w.type) === "react-component" && lt(e == null ? void 0 : e.properties) ? tr((c = e == null ? void 0 : e.renderer) == null ? void 0 : c.script).then((v) => {
|
|
2005
2007
|
const g = rr(v);
|
|
2006
|
-
|
|
2007
|
-
}) :
|
|
2008
|
+
h(g);
|
|
2009
|
+
}) : h(e == null ? void 0 : e.properties);
|
|
2008
2010
|
})();
|
|
2009
2011
|
}, [JSON.stringify(e)]);
|
|
2010
2012
|
const n = N(() => !e || !k ? {} : Object.values(k).reduce(
|
|
2011
|
-
(
|
|
2013
|
+
(f, { data: w }) => {
|
|
2012
2014
|
var v, g, P, C, y;
|
|
2013
2015
|
const c = w.key || w.id;
|
|
2014
|
-
return
|
|
2016
|
+
return f[w.id] = {
|
|
2015
2017
|
key: c,
|
|
2016
|
-
value: (
|
|
2018
|
+
value: (a == null ? void 0 : a[c]) ?? ((v = i == null ? void 0 : i[w.id]) == null ? void 0 : v.value) ?? ((P = (g = w.locales) == null ? void 0 : g[u]) == null ? void 0 : P.defaultValue) ?? ((y = (C = w.locales) == null ? void 0 : C[l]) == null ? void 0 : y.defaultValue),
|
|
2017
2019
|
id: w.id,
|
|
2018
2020
|
type: w.type
|
|
2019
|
-
},
|
|
2021
|
+
}, f;
|
|
2020
2022
|
},
|
|
2021
2023
|
{}
|
|
2022
|
-
), [JSON.stringify(k), e,
|
|
2024
|
+
), [JSON.stringify(k), e, i, u, l]), o = ae(() => {
|
|
2023
2025
|
if (!k)
|
|
2024
2026
|
return {
|
|
2025
2027
|
canUseProperties: [],
|
|
2026
2028
|
visibleProperties: [],
|
|
2027
2029
|
canUsePropertiesKeys: []
|
|
2028
2030
|
};
|
|
2029
|
-
const
|
|
2031
|
+
const f = V(Object.values(k), "index"), w = f.filter(({ data: g }) => g.key && bt(k, g.id)), c = f.filter(({ data: g }) => g.key), v = c.map(({ data: g }) => g.key);
|
|
2030
2032
|
return {
|
|
2031
2033
|
canUseProperties: c,
|
|
2032
2034
|
visibleProperties: w,
|
|
2033
2035
|
canUsePropertiesKeys: v
|
|
2034
2036
|
};
|
|
2035
|
-
}, [JSON.stringify(k)]), s = n(),
|
|
2037
|
+
}, [JSON.stringify(k)]), s = n(), d = pr(s, "key");
|
|
2036
2038
|
return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
|
|
2037
2039
|
/* @__PURE__ */ t(F, { variant: "subtitle1", children: p("maker.properties.parameters") }),
|
|
2038
2040
|
!e || o.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ t(te, { style: { fontSize: 12 }, children: p("maker.properties.noParameters") }) : /* @__PURE__ */ S($, { children: [
|
|
2039
|
-
/* @__PURE__ */ t(j, { gap: 2, children: o.visibleProperties.map(({ data:
|
|
2041
|
+
/* @__PURE__ */ t(j, { gap: 2, children: o.visibleProperties.map(({ data: f }) => {
|
|
2040
2042
|
var w, c;
|
|
2041
2043
|
return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
|
|
2042
2044
|
K,
|
|
2043
2045
|
{
|
|
2044
|
-
allComponents:
|
|
2046
|
+
allComponents: r,
|
|
2045
2047
|
defaultLocale: l,
|
|
2046
2048
|
size: "small",
|
|
2047
2049
|
fullWidth: !0,
|
|
2048
2050
|
component: e,
|
|
2049
|
-
property:
|
|
2050
|
-
valueImmutable: ee((w =
|
|
2051
|
-
value: (
|
|
2051
|
+
property: f,
|
|
2052
|
+
valueImmutable: ee((w = i == null ? void 0 : i[f.id]) == null ? void 0 : w.value),
|
|
2053
|
+
value: (a == null ? void 0 : a[f.key || f.id]) ?? ((c = s[f.id]) == null ? void 0 : c.value),
|
|
2052
2054
|
onChange: (v) => {
|
|
2053
|
-
|
|
2054
|
-
path: ["properties",
|
|
2055
|
+
m({
|
|
2056
|
+
path: ["properties", f.id],
|
|
2055
2057
|
value: { value: v },
|
|
2056
|
-
shouldSync: !(!
|
|
2058
|
+
shouldSync: !(!f.type || Ke.includes(f.type)),
|
|
2057
2059
|
excludeKeys: [],
|
|
2058
|
-
key:
|
|
2060
|
+
key: f.key || f.id
|
|
2059
2061
|
});
|
|
2060
2062
|
}
|
|
2061
2063
|
}
|
|
2062
|
-
) },
|
|
2064
|
+
) }, f.id);
|
|
2063
2065
|
}) }),
|
|
2064
2066
|
/* @__PURE__ */ t(j, { gap: 2, sx: { width: "100%" }, children: /* @__PURE__ */ t(
|
|
2065
2067
|
ot,
|
|
2066
2068
|
{
|
|
2067
2069
|
componentId: (e == null ? void 0 : e.id) || "",
|
|
2068
2070
|
renderType: "setting",
|
|
2069
|
-
locale:
|
|
2071
|
+
locale: u,
|
|
2070
2072
|
properties: s,
|
|
2071
|
-
dev: { mode: "draft", components:
|
|
2073
|
+
dev: { mode: "draft", components: r, defaultLocale: l },
|
|
2072
2074
|
props: {
|
|
2073
|
-
...hr(
|
|
2074
|
-
onChange: (
|
|
2075
|
+
...hr(a ?? {}, o.canUsePropertiesKeys),
|
|
2076
|
+
onChange: (f) => {
|
|
2075
2077
|
const { canUsePropertiesKeys: w } = o;
|
|
2076
|
-
Object.keys(
|
|
2078
|
+
Object.keys(f).filter((v) => {
|
|
2077
2079
|
var g;
|
|
2078
|
-
return
|
|
2079
|
-
}).filter((v) => !(v === "locale" && !dr(
|
|
2080
|
-
const P =
|
|
2080
|
+
return f[v] !== ((g = d == null ? void 0 : d[v]) == null ? void 0 : g.value);
|
|
2081
|
+
}).filter((v) => !(v === "locale" && !dr(d[v], "locale"))).reduce((v, g) => v.then(() => {
|
|
2082
|
+
const P = d[g], C = w.includes(g);
|
|
2081
2083
|
if (P != null && P.id && C)
|
|
2082
|
-
return
|
|
2084
|
+
return m({
|
|
2083
2085
|
path: ["properties", P.id],
|
|
2084
|
-
value: { value:
|
|
2086
|
+
value: { value: f[g] },
|
|
2085
2087
|
shouldSync: !(!P.type || Ke.includes(P.type)),
|
|
2086
2088
|
excludeKeys: [],
|
|
2087
2089
|
key: P.key || P.id
|
|
@@ -2108,12 +2110,12 @@ function Hr({
|
|
|
2108
2110
|
] }) });
|
|
2109
2111
|
}
|
|
2110
2112
|
export {
|
|
2111
|
-
|
|
2113
|
+
Tr as BasicInfo,
|
|
2112
2114
|
Oe as CustomComponentAutocomplete,
|
|
2113
|
-
|
|
2115
|
+
Ti as CustomComponentSettings,
|
|
2114
2116
|
Fr as DefaultReactComponentScriptTemplate,
|
|
2115
2117
|
_r as DefaultWebComponentScriptTemplate,
|
|
2116
|
-
|
|
2118
|
+
Mr as ParametersConfig,
|
|
2117
2119
|
Er as PropertiesConfig,
|
|
2118
2120
|
K as PropertyValueField
|
|
2119
2121
|
};
|