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