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