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