@blocklet/pages-kit-inner-components 0.6.103 → 0.6.105
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/add-component.js +1 -1
- package/lib/cjs/chunks/components-BmFOXvb0.js +57 -0
- package/lib/cjs/chunks/{draft-data-CkVvOh60.js → draft-data-e1KnFlxv.js} +1 -1
- package/lib/cjs/chunks/{home-DdN3Z-6B.js → home-DHmHyTMb.js} +10 -10
- package/lib/cjs/chunks/{index-B-Wh6PRT.js → index-Cu2Jg8OH.js} +24 -24
- package/lib/cjs/chunks/{publish-button-BtLFUEny.js → publish-button-Do7oJLSH.js} +1 -1
- package/lib/cjs/chunks/site-state-BQySNTiP.js +1 -0
- package/lib/cjs/chunks/state-DU3L5Lve.js +1 -0
- package/lib/cjs/components.js +1 -1
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/project-html.js +1 -1
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +3 -3
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/add-component.js +2 -2
- package/lib/es/chunks/components-DLjI_Xlm.js +615 -0
- package/lib/es/chunks/{draft-data-BOoVhbon.js → draft-data-DRdPzuGm.js} +1 -1
- package/lib/es/chunks/{home-DVTVPkSm.js → home-DajDpGXA.js} +123 -123
- package/lib/es/chunks/{index-DENjTU8O.js → index-BpP1FqET.js} +239 -238
- package/lib/es/chunks/{publish-button-BVcMw8Fh.js → publish-button-8kEbdc0k.js} +3 -3
- package/lib/es/chunks/site-state-DS7eIMFg.js +1684 -0
- package/lib/es/chunks/{state-DNdwHwty.js → state-qDCrgEMQ.js} +114 -113
- package/lib/es/components.js +14 -13
- package/lib/es/home.js +3 -3
- package/lib/es/project-html.js +1 -1
- package/lib/es/resources.js +2 -2
- package/lib/es/setting.js +415 -413
- package/lib/es/site-state.js +2 -2
- package/package.json +7 -7
- package/lib/cjs/chunks/components-DsHjikTX.js +0 -57
- package/lib/cjs/chunks/site-state-DlLhHuIr.js +0 -1
- package/lib/cjs/chunks/state-BdtFHk36.js +0 -1
- package/lib/es/chunks/components-BIhMGXjB.js +0 -610
- package/lib/es/chunks/site-state-CN4Kulgk.js +0 -1671
package/lib/es/setting.js
CHANGED
|
@@ -1,77 +1,79 @@
|
|
|
1
1
|
import { jsx as e, jsxs as x, Fragment as U } from "react/jsx-runtime";
|
|
2
|
-
import { Box as w, Alert as
|
|
3
|
-
import { t as xe, f as
|
|
4
|
-
import
|
|
2
|
+
import { Box as w, Alert as Ze, Typography as E, TextField as R, Stack as S, FormLabel as ee, TableContainer as er, Paper as J, Table as ze, TableHead as je, TableRow as re, TableCell as te, TableBody as Re, Button as D, IconButton as $, FormControlLabel as le, Switch as ye, InputAdornment as H, alpha as ue, Tooltip as B, buttonClasses as rr, Dialog as ve, DialogTitle as Ve, DialogContent as Ae, DialogActions as De, Checkbox as tr, Autocomplete as Ee, MenuItem as X, Collapse as nr, Divider as or, Popper as ir } from "@mui/material";
|
|
3
|
+
import { t as xe, f as ne, a as se, h as Ce } from "./chunks/state-qDCrgEMQ.js";
|
|
4
|
+
import _ from "@arcblock/ux/lib/Empty";
|
|
5
5
|
import { useLocaleContext as V } from "@arcblock/ux/lib/Locale/context";
|
|
6
6
|
import { CodeEditor as Pe } from "@blocklet/code-editor";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import { useCallback as K, useMemo as
|
|
13
|
-
import { useUpdate as
|
|
14
|
-
import { ColorItem as
|
|
15
|
-
import { getImageSize as pe, getVideoSize as me, UploaderButton as ke, UploaderProvider as ce, useUploader as
|
|
16
|
-
import { Icon as
|
|
7
|
+
import lr from "@mui/icons-material/AddRounded";
|
|
8
|
+
import sr from "@mui/icons-material/ArrowDownward";
|
|
9
|
+
import ar from "@mui/icons-material/ArrowUpward";
|
|
10
|
+
import cr from "@mui/icons-material/DeleteOutline";
|
|
11
|
+
import T from "lodash/sortBy";
|
|
12
|
+
import { useCallback as K, useMemo as oe, useState as W, useEffect as G, useImperativeHandle as dr, useRef as ae } from "react";
|
|
13
|
+
import { useUpdate as Te, useDebounce as ur } from "react-use";
|
|
14
|
+
import { ColorItem as pr, ConfigColorDialog as mr } from "@blocklet/pages-kit/builtin/color-picker";
|
|
15
|
+
import { getImageSize as pe, getVideoSize as me, UploaderButton as ke, UploaderProvider as ce, useUploader as hr } from "@blocklet/pages-kit/builtin/uploader";
|
|
16
|
+
import { Icon as fr } from "@iconify-icon/react";
|
|
17
17
|
import L from "lodash/isEmpty";
|
|
18
18
|
import We from "lodash/set";
|
|
19
19
|
import * as he from "yaml";
|
|
20
20
|
import fe from "lodash/cloneDeep";
|
|
21
21
|
import be from "@arcblock/ux/lib/Toast";
|
|
22
|
-
import { CustomComponentRenderer as Ke, transpileAndLoadScript as
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import Tr from "lodash/
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
22
|
+
import { CustomComponentRenderer as Ke, transpileAndLoadScript as br, getPropertiesFromCode as gr } from "@blocklet/pages-kit/components";
|
|
23
|
+
import { useDeepCompareCallback as yr } from "@blocklet/pages-kit/hooks/use-deep-compare-callback";
|
|
24
|
+
import { useDeepCompareMemo as vr } from "@blocklet/pages-kit/hooks/use-deep-compare-memo";
|
|
25
|
+
import { parsePropertyValue as xr } from "@blocklet/pages-kit/utils/property";
|
|
26
|
+
import { unstable_useNumberInput as Cr, ClickAwayListener as Pr } from "@mui/base";
|
|
27
|
+
import { SyncRounded as kr, SyncDisabledRounded as wr, VisibilityOffRounded as Sr, VisibilityRounded as Ir, DeleteOutlineRounded as Or, DragIndicatorRounded as Nr, TranslateRounded as Le, AddRounded as Ue, InfoRounded as Be, PsychologyAlt as zr, StarRounded as jr, SettingsRounded as Me } from "@mui/icons-material";
|
|
28
|
+
import { getYjsValue as Y } from "@syncedstore/core";
|
|
29
|
+
import { useDeepCompareEffect as Fe, useReactive as Rr } from "ahooks";
|
|
30
|
+
import Vr from "lodash/assign";
|
|
31
|
+
import Ar from "lodash/get";
|
|
32
|
+
import Dr from "lodash/has";
|
|
33
|
+
import Er from "lodash/isEqual";
|
|
34
|
+
import ie from "lodash/isNil";
|
|
35
|
+
import Tr from "lodash/isObject";
|
|
36
|
+
import Wr from "lodash/keyBy";
|
|
37
|
+
import Kr from "lodash/omit";
|
|
38
|
+
import Lr from "lodash/pick";
|
|
39
|
+
import Ur from "lodash/reduce";
|
|
40
|
+
import { usePopupState as we, bindTrigger as Se, bindDialog as He, bindPopper as Br } from "material-ui-popup-state/hooks";
|
|
41
|
+
import { ErrorBoundary as Mr } from "react-error-boundary";
|
|
42
|
+
import { useSensors as Fr, useSensor as Hr, PointerSensor as Jr, DndContext as $r, closestCorners as _r, DragOverlay as Gr } from "@dnd-kit/core";
|
|
43
|
+
import { SortableContext as Yr, verticalListSortingStrategy as qr, useSortable as Qr } from "@dnd-kit/sortable";
|
|
44
|
+
import { CSS as Xr } from "@dnd-kit/utilities";
|
|
43
45
|
import { nextId as Je } from "@blocklet/pages-kit/utils/common";
|
|
44
|
-
function
|
|
45
|
-
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
|
|
46
|
+
function Zr({ error: r }) {
|
|
47
|
+
return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(Ze, { severity: "error", children: r.message }) });
|
|
46
48
|
}
|
|
47
|
-
function
|
|
49
|
+
function et({
|
|
48
50
|
onClick: r,
|
|
49
51
|
disabled: t,
|
|
50
|
-
sx:
|
|
52
|
+
sx: o,
|
|
51
53
|
...s
|
|
52
54
|
}) {
|
|
53
|
-
return /* @__PURE__ */ e(
|
|
55
|
+
return /* @__PURE__ */ e($, { size: "small", color: "warning", variant: "outlined", disabled: t, onClick: r, ...s, children: /* @__PURE__ */ e(cr, { fontSize: "small" }) });
|
|
54
56
|
}
|
|
55
|
-
function
|
|
57
|
+
function rt({
|
|
56
58
|
onClick: r,
|
|
57
59
|
disabled: t,
|
|
58
|
-
sx:
|
|
60
|
+
sx: o,
|
|
59
61
|
...s
|
|
60
62
|
}) {
|
|
61
|
-
return /* @__PURE__ */ e(
|
|
63
|
+
return /* @__PURE__ */ e($, { size: "small", color: "primary", disabled: t, onClick: r, ...s, children: /* @__PURE__ */ e(ar, { fontSize: "small" }) });
|
|
62
64
|
}
|
|
63
|
-
function
|
|
65
|
+
function tt({
|
|
64
66
|
onClick: r,
|
|
65
67
|
disabled: t,
|
|
66
|
-
sx:
|
|
68
|
+
sx: o,
|
|
67
69
|
...s
|
|
68
70
|
}) {
|
|
69
|
-
return /* @__PURE__ */ e(
|
|
71
|
+
return /* @__PURE__ */ e($, { size: "small", color: "primary", disabled: t, onClick: r, ...s, children: /* @__PURE__ */ e(sr, { fontSize: "small" }) });
|
|
70
72
|
}
|
|
71
|
-
function
|
|
73
|
+
function nt({
|
|
72
74
|
label: r,
|
|
73
75
|
value: t,
|
|
74
|
-
onChange:
|
|
76
|
+
onChange: o,
|
|
75
77
|
disabled: s = !1,
|
|
76
78
|
itemLabel: h = "",
|
|
77
79
|
emptyHeight: u = 40,
|
|
@@ -79,69 +81,69 @@ function et({
|
|
|
79
81
|
renderItem: y,
|
|
80
82
|
...m
|
|
81
83
|
}) {
|
|
82
|
-
const { t: a, locale: c } = V(), l =
|
|
84
|
+
const { t: a, locale: c } = V(), l = Te(), i = K(
|
|
83
85
|
(b) => {
|
|
84
|
-
|
|
86
|
+
o(xe(b, d.type));
|
|
85
87
|
},
|
|
86
|
-
[
|
|
87
|
-
), n =
|
|
88
|
+
[o, d.type]
|
|
89
|
+
), n = oe(() => Array.isArray(t) ? t : [], [t]), p = K(() => {
|
|
88
90
|
const b = [...n, ""];
|
|
89
|
-
|
|
90
|
-
}, [n,
|
|
91
|
+
i(b), l();
|
|
92
|
+
}, [n, i, l]), g = K(() => {
|
|
91
93
|
if (!d || !d.subProperties)
|
|
92
94
|
return p();
|
|
93
95
|
const b = {};
|
|
94
|
-
|
|
96
|
+
T(Object.values(d.subProperties), "index").forEach(({ data: j }) => {
|
|
95
97
|
if (!j.key) return;
|
|
96
98
|
const A = j.locales?.[c]?.defaultValue ?? "";
|
|
97
99
|
b[j.key] = A;
|
|
98
100
|
});
|
|
99
101
|
const O = [...n, b];
|
|
100
|
-
|
|
101
|
-
}, [n,
|
|
102
|
+
i(O), l();
|
|
103
|
+
}, [n, i, l, d, c, p]), f = K(
|
|
102
104
|
(b) => {
|
|
103
105
|
try {
|
|
104
106
|
const C = JSON.parse(b);
|
|
105
|
-
Array.isArray(C) ?
|
|
107
|
+
Array.isArray(C) ? i(C) : console.error("JSON解析结果不是数组");
|
|
106
108
|
} catch (C) {
|
|
107
109
|
console.error("JSON解析错误:", C);
|
|
108
110
|
}
|
|
109
111
|
},
|
|
110
|
-
[
|
|
112
|
+
[i]
|
|
111
113
|
), k = K(
|
|
112
114
|
(b) => {
|
|
113
115
|
const C = n.filter((O, j) => j !== b);
|
|
114
|
-
|
|
116
|
+
i(C), l();
|
|
115
117
|
},
|
|
116
|
-
[n,
|
|
118
|
+
[n, i, l]
|
|
117
119
|
), v = K(
|
|
118
120
|
(b) => {
|
|
119
121
|
if (b <= 0) return;
|
|
120
122
|
const C = [...n], O = C[b];
|
|
121
|
-
C[b] = C[b - 1], C[b - 1] = O,
|
|
123
|
+
C[b] = C[b - 1], C[b - 1] = O, i(C), l();
|
|
122
124
|
},
|
|
123
|
-
[n,
|
|
125
|
+
[n, i, l]
|
|
124
126
|
), N = K(
|
|
125
127
|
(b) => {
|
|
126
128
|
if (b >= n.length - 1) return;
|
|
127
129
|
const C = [...n], O = C[b];
|
|
128
|
-
C[b] = C[b + 1], C[b + 1] = O,
|
|
130
|
+
C[b] = C[b + 1], C[b + 1] = O, i(C), l();
|
|
129
131
|
},
|
|
130
|
-
[n,
|
|
132
|
+
[n, i, l]
|
|
131
133
|
), z = K(
|
|
132
134
|
(b, C) => {
|
|
133
135
|
const O = [...n];
|
|
134
|
-
O[b] = C,
|
|
136
|
+
O[b] = C, i(O);
|
|
135
137
|
},
|
|
136
|
-
[n,
|
|
137
|
-
), P = d && d.subProperties && Object.keys(d.subProperties).length > 0, I =
|
|
138
|
+
[n, i]
|
|
139
|
+
), P = d && d.subProperties && Object.keys(d.subProperties).length > 0, I = oe(() => [
|
|
138
140
|
{
|
|
139
141
|
field: "index",
|
|
140
142
|
headerName: "#",
|
|
141
143
|
width: 40,
|
|
142
144
|
align: "center",
|
|
143
145
|
renderCell: ({ index: b }) => /* @__PURE__ */ e(
|
|
144
|
-
|
|
146
|
+
E,
|
|
145
147
|
{
|
|
146
148
|
variant: "body1",
|
|
147
149
|
sx: {
|
|
@@ -186,15 +188,15 @@ function et({
|
|
|
186
188
|
// 增加宽度以容纳更多按钮
|
|
187
189
|
align: "center",
|
|
188
190
|
renderCell: ({ index: b }) => /* @__PURE__ */ x(S, { direction: "column", spacing: 0.25, children: [
|
|
189
|
-
/* @__PURE__ */ e(
|
|
191
|
+
/* @__PURE__ */ e(rt, { disabled: s || b === 0, onClick: () => v(b) }),
|
|
190
192
|
/* @__PURE__ */ e(
|
|
191
|
-
|
|
193
|
+
tt,
|
|
192
194
|
{
|
|
193
195
|
disabled: s || b === n.length - 1,
|
|
194
196
|
onClick: () => N(b)
|
|
195
197
|
}
|
|
196
198
|
),
|
|
197
|
-
/* @__PURE__ */ e(
|
|
199
|
+
/* @__PURE__ */ e(et, { disabled: s, onClick: () => k(b) })
|
|
198
200
|
] })
|
|
199
201
|
}
|
|
200
202
|
], [
|
|
@@ -219,8 +221,8 @@ function et({
|
|
|
219
221
|
gap: 1
|
|
220
222
|
},
|
|
221
223
|
children: [
|
|
222
|
-
r && /* @__PURE__ */ e(
|
|
223
|
-
n.length > 0 ? /* @__PURE__ */ e(
|
|
224
|
+
r && /* @__PURE__ */ e(ee, { children: r }),
|
|
225
|
+
n.length > 0 ? /* @__PURE__ */ e(er, { component: J, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ x(
|
|
224
226
|
ze,
|
|
225
227
|
{
|
|
226
228
|
size: "small",
|
|
@@ -238,8 +240,8 @@ function et({
|
|
|
238
240
|
borderCollapse: "collapse"
|
|
239
241
|
},
|
|
240
242
|
children: [
|
|
241
|
-
/* @__PURE__ */ e(je, { sx: { display: "none" }, children: /* @__PURE__ */ e(
|
|
242
|
-
|
|
243
|
+
/* @__PURE__ */ e(je, { sx: { display: "none" }, children: /* @__PURE__ */ e(re, { children: I.map((b) => /* @__PURE__ */ e(
|
|
244
|
+
te,
|
|
243
245
|
{
|
|
244
246
|
width: b.width,
|
|
245
247
|
align: b.align || "left",
|
|
@@ -249,7 +251,7 @@ function et({
|
|
|
249
251
|
b.field
|
|
250
252
|
)) }) }),
|
|
251
253
|
/* @__PURE__ */ e(Re, { children: n.map((b, C, O) => /* @__PURE__ */ e(
|
|
252
|
-
|
|
254
|
+
re,
|
|
253
255
|
{
|
|
254
256
|
sx: {
|
|
255
257
|
borderBottom: C < O.length - 1 ? "1px solid" : "none",
|
|
@@ -259,7 +261,7 @@ function et({
|
|
|
259
261
|
}
|
|
260
262
|
},
|
|
261
263
|
children: I.map((j) => /* @__PURE__ */ e(
|
|
262
|
-
|
|
264
|
+
te,
|
|
263
265
|
{
|
|
264
266
|
width: j.width,
|
|
265
267
|
align: j.align || "left",
|
|
@@ -279,15 +281,15 @@ function et({
|
|
|
279
281
|
)) })
|
|
280
282
|
]
|
|
281
283
|
}
|
|
282
|
-
) }) : /* @__PURE__ */ e(
|
|
284
|
+
) }) : /* @__PURE__ */ e(_, { style: { fontSize: 12, height: u }, children: a("maker.properties.arrayEmpty") }),
|
|
283
285
|
/* @__PURE__ */ e(
|
|
284
|
-
|
|
286
|
+
D,
|
|
285
287
|
{
|
|
286
288
|
fullWidth: !0,
|
|
287
289
|
size: "small",
|
|
288
290
|
variant: "outlined",
|
|
289
291
|
disabled: s,
|
|
290
|
-
startIcon: /* @__PURE__ */ e(
|
|
292
|
+
startIcon: /* @__PURE__ */ e(lr, {}),
|
|
291
293
|
onClick: g,
|
|
292
294
|
children: a("maker.properties.addArrayItem")
|
|
293
295
|
}
|
|
@@ -302,7 +304,7 @@ function et({
|
|
|
302
304
|
gap: 1
|
|
303
305
|
},
|
|
304
306
|
children: [
|
|
305
|
-
r && /* @__PURE__ */ e(
|
|
307
|
+
r && /* @__PURE__ */ e(ee, { children: r }),
|
|
306
308
|
/* @__PURE__ */ e(w, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ e(
|
|
307
309
|
Pe,
|
|
308
310
|
{
|
|
@@ -322,10 +324,10 @@ function et({
|
|
|
322
324
|
}
|
|
323
325
|
);
|
|
324
326
|
}
|
|
325
|
-
function
|
|
327
|
+
function ot({
|
|
326
328
|
ref: r,
|
|
327
329
|
showMarkdown: t,
|
|
328
|
-
markdown:
|
|
330
|
+
markdown: o,
|
|
329
331
|
onMarkdownChange: s,
|
|
330
332
|
showUploader: h,
|
|
331
333
|
value: u,
|
|
@@ -334,12 +336,12 @@ function rt({
|
|
|
334
336
|
...m
|
|
335
337
|
}) {
|
|
336
338
|
const [a, c] = W("");
|
|
337
|
-
|
|
339
|
+
G(() => {
|
|
338
340
|
c(u || "");
|
|
339
341
|
}, [u, c]);
|
|
340
342
|
const l = async () => {
|
|
341
343
|
if (a !== u) {
|
|
342
|
-
const n =
|
|
344
|
+
const n = ne(a);
|
|
343
345
|
if (!n) {
|
|
344
346
|
y(a, void 0);
|
|
345
347
|
return;
|
|
@@ -349,23 +351,23 @@ function rt({
|
|
|
349
351
|
y(a, { ...p, filename: a });
|
|
350
352
|
}
|
|
351
353
|
};
|
|
352
|
-
|
|
354
|
+
ur(
|
|
353
355
|
() => {
|
|
354
356
|
a !== u && y(a);
|
|
355
357
|
},
|
|
356
358
|
300,
|
|
357
359
|
[a]
|
|
358
|
-
),
|
|
360
|
+
), dr(r, () => ({
|
|
359
361
|
submit: l
|
|
360
362
|
}));
|
|
361
|
-
const
|
|
362
|
-
return h && (
|
|
363
|
+
const i = {};
|
|
364
|
+
return h && (i.InputProps = {
|
|
363
365
|
sx: { pr: 0 },
|
|
364
366
|
endAdornment: /* @__PURE__ */ e(H, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ e(
|
|
365
367
|
ke,
|
|
366
368
|
{
|
|
367
369
|
onChange: async ({ response: n }) => {
|
|
368
|
-
const p = n?.data?.filename, g =
|
|
370
|
+
const p = n?.data?.filename, g = ne(p) || "";
|
|
369
371
|
let f = {};
|
|
370
372
|
g && (f = await pe(g).catch(() => me(g)).catch(() => {
|
|
371
373
|
})), y(p, {
|
|
@@ -396,8 +398,8 @@ function rt({
|
|
|
396
398
|
/* @__PURE__ */ e(
|
|
397
399
|
le,
|
|
398
400
|
{
|
|
399
|
-
checked:
|
|
400
|
-
label: /* @__PURE__ */ e(w, { component:
|
|
401
|
+
checked: o,
|
|
402
|
+
label: /* @__PURE__ */ e(w, { component: fr, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
|
|
401
403
|
labelPlacement: "start",
|
|
402
404
|
control: /* @__PURE__ */ e(ye, { size: "small" }),
|
|
403
405
|
sx: { ml: 0.25, pr: 1 },
|
|
@@ -411,7 +413,7 @@ function rt({
|
|
|
411
413
|
),
|
|
412
414
|
value: a,
|
|
413
415
|
onChange: (n) => c(n.target.value),
|
|
414
|
-
...
|
|
416
|
+
...i,
|
|
415
417
|
onKeyDown: (n) => {
|
|
416
418
|
n.keyCode !== 229 && n.key === "Enter" && l();
|
|
417
419
|
},
|
|
@@ -421,23 +423,23 @@ function rt({
|
|
|
421
423
|
}
|
|
422
424
|
);
|
|
423
425
|
}
|
|
424
|
-
function
|
|
426
|
+
function it({
|
|
425
427
|
value: r,
|
|
426
428
|
onChange: t,
|
|
427
|
-
disableGradient:
|
|
429
|
+
disableGradient: o = !1,
|
|
428
430
|
...s
|
|
429
431
|
}) {
|
|
430
432
|
const h = ae(null);
|
|
431
433
|
return /* @__PURE__ */ x(U, { children: [
|
|
432
434
|
/* @__PURE__ */ e(
|
|
433
|
-
|
|
435
|
+
ot,
|
|
434
436
|
{
|
|
435
437
|
...s,
|
|
436
438
|
value: r,
|
|
437
439
|
onChange: t,
|
|
438
440
|
InputProps: {
|
|
439
441
|
endAdornment: /* @__PURE__ */ e(H, { position: "end", children: /* @__PURE__ */ e(
|
|
440
|
-
|
|
442
|
+
pr,
|
|
441
443
|
{
|
|
442
444
|
color: r ?? "",
|
|
443
445
|
style: { width: "1.5rem", height: "1.5rem", padding: 0 },
|
|
@@ -450,21 +452,21 @@ function tt({
|
|
|
450
452
|
}
|
|
451
453
|
),
|
|
452
454
|
/* @__PURE__ */ e(
|
|
453
|
-
|
|
455
|
+
mr,
|
|
454
456
|
{
|
|
455
457
|
ref: h,
|
|
456
458
|
onSave: ({ value: u }, d) => {
|
|
457
459
|
t(u), d();
|
|
458
460
|
},
|
|
459
|
-
disableGradient:
|
|
461
|
+
disableGradient: o
|
|
460
462
|
}
|
|
461
463
|
)
|
|
462
464
|
] });
|
|
463
465
|
}
|
|
464
|
-
function
|
|
466
|
+
function lt({
|
|
465
467
|
label: r,
|
|
466
468
|
value: t,
|
|
467
|
-
onChange:
|
|
469
|
+
onChange: o,
|
|
468
470
|
property: s,
|
|
469
471
|
component: h,
|
|
470
472
|
defaultLocale: u,
|
|
@@ -474,7 +476,7 @@ function nt({
|
|
|
474
476
|
}) {
|
|
475
477
|
const { locale: a } = V(), c = ae(null);
|
|
476
478
|
if (!L(s.subProperties)) {
|
|
477
|
-
const
|
|
479
|
+
const i = T(Object.values(s.subProperties || {}), "index").filter(
|
|
478
480
|
(n) => n.data.visible !== !1 && n.data.key
|
|
479
481
|
);
|
|
480
482
|
return /* @__PURE__ */ x(
|
|
@@ -484,9 +486,9 @@ function nt({
|
|
|
484
486
|
width: "100%"
|
|
485
487
|
},
|
|
486
488
|
children: [
|
|
487
|
-
/* @__PURE__ */ e(
|
|
488
|
-
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(w, { sx: { position: "relative" }, children:
|
|
489
|
-
const { data: g } = n, f = g.key ?? g.id, k = p ===
|
|
489
|
+
/* @__PURE__ */ e(ee, { sx: { px: 0.25, py: 0.5 }, children: r }),
|
|
490
|
+
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(w, { sx: { position: "relative" }, children: i.map((n, p) => {
|
|
491
|
+
const { data: g } = n, f = g.key ?? g.id, k = p === i.length - 1;
|
|
490
492
|
let v = null;
|
|
491
493
|
try {
|
|
492
494
|
t && typeof t == "object" ? v = t[f] : typeof t == "string" && (v = (s.type === "yaml" ? he.parse(t || "") : JSON.parse(t || "{}"))[f]);
|
|
@@ -504,7 +506,7 @@ function nt({
|
|
|
504
506
|
else typeof t == "object" && t !== null && (I = { ...t });
|
|
505
507
|
We(I, f, P);
|
|
506
508
|
const b = xe(I, s.type);
|
|
507
|
-
|
|
509
|
+
o?.(b);
|
|
508
510
|
} catch (I) {
|
|
509
511
|
console.error("Error updating property:", I);
|
|
510
512
|
}
|
|
@@ -620,7 +622,7 @@ function nt({
|
|
|
620
622
|
},
|
|
621
623
|
children: [
|
|
622
624
|
/* @__PURE__ */ e(
|
|
623
|
-
|
|
625
|
+
ee,
|
|
624
626
|
{
|
|
625
627
|
sx: {
|
|
626
628
|
position: "absolute",
|
|
@@ -638,11 +640,11 @@ function nt({
|
|
|
638
640
|
locale: a,
|
|
639
641
|
language: s.type === "yaml" ? "yaml" : "json",
|
|
640
642
|
value: typeof t == "string" ? t : "",
|
|
641
|
-
onChange: (
|
|
642
|
-
|
|
643
|
+
onChange: (i) => {
|
|
644
|
+
o?.(i);
|
|
643
645
|
},
|
|
644
|
-
onUpload: (
|
|
645
|
-
c.current =
|
|
646
|
+
onUpload: (i) => {
|
|
647
|
+
c.current = i, m && m(i);
|
|
646
648
|
},
|
|
647
649
|
fullScreenOptions: {
|
|
648
650
|
enableEscExit: !0,
|
|
@@ -680,20 +682,20 @@ function nt({
|
|
|
680
682
|
function Oe(r) {
|
|
681
683
|
return !!r.shared;
|
|
682
684
|
}
|
|
683
|
-
const
|
|
685
|
+
const st = {
|
|
684
686
|
setActivatorNodeRef: () => {
|
|
685
687
|
},
|
|
686
688
|
attributes: {},
|
|
687
689
|
listeners: {}
|
|
688
690
|
};
|
|
689
|
-
function
|
|
691
|
+
function $e({
|
|
690
692
|
disabled: r,
|
|
691
693
|
list: t,
|
|
692
|
-
renderItem:
|
|
694
|
+
renderItem: o,
|
|
693
695
|
...s
|
|
694
696
|
}) {
|
|
695
|
-
const h =
|
|
696
|
-
|
|
697
|
+
const h = T(Object.entries(t), ([, p]) => p.index), u = h.map(([p]) => p), [d, y] = W(null), [m, a] = W(null), c = Fr(
|
|
698
|
+
Hr(Jr, {
|
|
697
699
|
activationConstraint: {
|
|
698
700
|
distance: 8
|
|
699
701
|
// 8px movement required to start drag
|
|
@@ -701,10 +703,10 @@ function He({
|
|
|
701
703
|
})
|
|
702
704
|
);
|
|
703
705
|
return /* @__PURE__ */ x(
|
|
704
|
-
|
|
706
|
+
$r,
|
|
705
707
|
{
|
|
706
708
|
sensors: c,
|
|
707
|
-
collisionDetection:
|
|
709
|
+
collisionDetection: _r,
|
|
708
710
|
onDragStart: (p) => {
|
|
709
711
|
const { active: g } = p, f = t[g.id];
|
|
710
712
|
f && (a(g.id), y(f.data));
|
|
@@ -722,14 +724,14 @@ function He({
|
|
|
722
724
|
O && I.splice(C, 0, O), I.forEach(([, j], A) => {
|
|
723
725
|
j.index = A;
|
|
724
726
|
});
|
|
725
|
-
}, z =
|
|
727
|
+
}, z = Y(t)?.doc;
|
|
726
728
|
z ? z.transact(() => {
|
|
727
729
|
N();
|
|
728
730
|
}) : N();
|
|
729
731
|
}
|
|
730
732
|
},
|
|
731
733
|
children: [
|
|
732
|
-
/* @__PURE__ */ e(
|
|
734
|
+
/* @__PURE__ */ e(Yr, { items: u, strategy: qr, children: /* @__PURE__ */ e(S, { ...s, children: h.map(([p, g], f) => /* @__PURE__ */ e(at, { id: p, disabled: r, isDragging: m === p, children: ({ dragHandle: k }) => o(g.data, f, {
|
|
733
735
|
isDragging: m === p,
|
|
734
736
|
dragHandle: k,
|
|
735
737
|
drag: null,
|
|
@@ -739,7 +741,7 @@ function He({
|
|
|
739
741
|
preview: null
|
|
740
742
|
// Legacy compatibility
|
|
741
743
|
}) }, p)) }) }),
|
|
742
|
-
/* @__PURE__ */ e(
|
|
744
|
+
/* @__PURE__ */ e(Gr, { children: d && m ? /* @__PURE__ */ e(
|
|
743
745
|
w,
|
|
744
746
|
{
|
|
745
747
|
sx: {
|
|
@@ -751,9 +753,9 @@ function He({
|
|
|
751
753
|
boxShadow: 2,
|
|
752
754
|
maxWidth: 400
|
|
753
755
|
},
|
|
754
|
-
children:
|
|
756
|
+
children: o(d, 0, {
|
|
755
757
|
isDragging: !0,
|
|
756
|
-
dragHandle:
|
|
758
|
+
dragHandle: st,
|
|
757
759
|
drag: null,
|
|
758
760
|
drop: null,
|
|
759
761
|
preview: null
|
|
@@ -764,19 +766,19 @@ function He({
|
|
|
764
766
|
}
|
|
765
767
|
);
|
|
766
768
|
}
|
|
767
|
-
function
|
|
769
|
+
function at({
|
|
768
770
|
id: r,
|
|
769
771
|
disabled: t,
|
|
770
|
-
isDragging:
|
|
772
|
+
isDragging: o,
|
|
771
773
|
children: s
|
|
772
774
|
}) {
|
|
773
|
-
const { attributes: h, listeners: u, setNodeRef: d, setActivatorNodeRef: y, transform: m, transition: a } =
|
|
775
|
+
const { attributes: h, listeners: u, setNodeRef: d, setActivatorNodeRef: y, transform: m, transition: a } = Qr({
|
|
774
776
|
id: r,
|
|
775
777
|
disabled: t
|
|
776
778
|
}), c = {
|
|
777
|
-
transform:
|
|
779
|
+
transform: Xr.Transform.toString(m),
|
|
778
780
|
transition: a,
|
|
779
|
-
opacity:
|
|
781
|
+
opacity: o ? 0.5 : 1
|
|
780
782
|
};
|
|
781
783
|
return /* @__PURE__ */ e(w, { ref: d, style: c, children: s({
|
|
782
784
|
dragHandle: {
|
|
@@ -786,10 +788,10 @@ function ot({
|
|
|
786
788
|
}
|
|
787
789
|
}) });
|
|
788
790
|
}
|
|
789
|
-
function
|
|
791
|
+
function ct({
|
|
790
792
|
disabled: r,
|
|
791
793
|
isDragging: t,
|
|
792
|
-
children:
|
|
794
|
+
children: o,
|
|
793
795
|
onDelete: s,
|
|
794
796
|
onVisibilityChange: h,
|
|
795
797
|
visible: u = !0,
|
|
@@ -799,7 +801,7 @@ function lt({
|
|
|
799
801
|
alwaysShowActions: a = !1,
|
|
800
802
|
dragHandle: c
|
|
801
803
|
}) {
|
|
802
|
-
const { t: l } = V(),
|
|
804
|
+
const { t: l } = V(), i = c?.attributes ?? {}, n = c?.listeners ?? {}, p = c?.setActivatorNodeRef;
|
|
803
805
|
return /* @__PURE__ */ e(
|
|
804
806
|
w,
|
|
805
807
|
{
|
|
@@ -818,7 +820,7 @@ function lt({
|
|
|
818
820
|
opacity: 0.9999
|
|
819
821
|
// NOTE: make preview effective
|
|
820
822
|
},
|
|
821
|
-
children:
|
|
823
|
+
children: o
|
|
822
824
|
}
|
|
823
825
|
),
|
|
824
826
|
!r && /* @__PURE__ */ e(
|
|
@@ -841,7 +843,7 @@ function lt({
|
|
|
841
843
|
bgcolor: (g) => ue(g.palette.grey[200], 0.9),
|
|
842
844
|
borderRadius: 1,
|
|
843
845
|
p: 0.5,
|
|
844
|
-
[`.${
|
|
846
|
+
[`.${rr.root}`]: {
|
|
845
847
|
minWidth: 24,
|
|
846
848
|
width: 24,
|
|
847
849
|
height: 24,
|
|
@@ -850,10 +852,10 @@ function lt({
|
|
|
850
852
|
},
|
|
851
853
|
children: [
|
|
852
854
|
m,
|
|
853
|
-
d && /* @__PURE__ */ e(B, { title: l(y ? "disableSharing" : "enableSharing"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(
|
|
854
|
-
h && /* @__PURE__ */ e(B, { title: l(u ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(
|
|
855
|
-
s && /* @__PURE__ */ e(B, { title: l("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(
|
|
856
|
-
/* @__PURE__ */ e(B, { title: l("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(
|
|
855
|
+
d && /* @__PURE__ */ e(B, { title: l(y ? "disableSharing" : "enableSharing"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(D, { onClick: () => d(!y), children: y ? /* @__PURE__ */ e(kr, { sx: { fontSize: "1.25rem", color: "primary.main" } }) : /* @__PURE__ */ e(wr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
856
|
+
h && /* @__PURE__ */ e(B, { title: l(u ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(D, { onClick: () => h(!u), children: u ? /* @__PURE__ */ e(Sr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ e(Ir, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
857
|
+
s && /* @__PURE__ */ e(B, { title: l("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(D, { onClick: s, children: /* @__PURE__ */ e(Or, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
|
|
858
|
+
/* @__PURE__ */ e(B, { title: l("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(D, { ref: p, ...i, ...n, children: /* @__PURE__ */ e(Nr, { sx: { color: "grey.500" } }) }) })
|
|
857
859
|
]
|
|
858
860
|
}
|
|
859
861
|
)
|
|
@@ -863,37 +865,37 @@ function lt({
|
|
|
863
865
|
}
|
|
864
866
|
);
|
|
865
867
|
}
|
|
866
|
-
function
|
|
867
|
-
const t = ["string", "json", "array", "url", "multiline"],
|
|
868
|
-
return !!(t.includes(r.type || "") && !
|
|
868
|
+
function dt(r) {
|
|
869
|
+
const t = ["string", "json", "array", "url", "multiline"], o = ["style", "fontSize", "color", "content", "type"];
|
|
870
|
+
return !!(t.includes(r.type || "") && !o.includes(r.key || ""));
|
|
869
871
|
}
|
|
870
|
-
function
|
|
871
|
-
return r.locales && r.locales[t] && r.locales[t].name ? r.locales[t].name :
|
|
872
|
+
function ut(r, t, o) {
|
|
873
|
+
return r.locales && r.locales[t] && r.locales[t].name ? r.locales[t].name : o && r.locales && r.locales[o] && r.locales[o].name ? r.locales[o].name : r.key ? r.key : r.id;
|
|
872
874
|
}
|
|
873
|
-
const
|
|
875
|
+
const _e = (r, t, o, s) => {
|
|
874
876
|
const h = {};
|
|
875
|
-
return
|
|
877
|
+
return T(Object.entries(r), ([, d]) => d.index).forEach(([d, y]) => {
|
|
876
878
|
const m = y.data;
|
|
877
879
|
if (!m) return;
|
|
878
|
-
const a = m.key || m.id, c =
|
|
880
|
+
const a = m.key || m.id, c = o ? ut(m, o, s || "") : a, l = t?.[m.id], i = {
|
|
879
881
|
key: a,
|
|
880
|
-
isNeedGenerate: l?.isNeedGenerate ??
|
|
882
|
+
isNeedGenerate: l?.isNeedGenerate ?? dt(m),
|
|
881
883
|
// 如果存在使用现有值,否则默认勾选
|
|
882
884
|
describe: l?.describe ?? "",
|
|
883
885
|
displayName: c
|
|
884
886
|
};
|
|
885
|
-
m.subProperties && !L(m.subProperties) && (
|
|
887
|
+
m.subProperties && !L(m.subProperties) && (i.subProperties = _e(
|
|
886
888
|
m.subProperties,
|
|
887
889
|
l?.subProperties,
|
|
888
|
-
|
|
890
|
+
o,
|
|
889
891
|
s
|
|
890
|
-
)), h[m.id] =
|
|
892
|
+
)), h[m.id] = i;
|
|
891
893
|
}), h;
|
|
892
894
|
};
|
|
893
|
-
function
|
|
895
|
+
function pt({
|
|
894
896
|
open: r,
|
|
895
897
|
onClose: t,
|
|
896
|
-
onConfirm:
|
|
898
|
+
onConfirm: o,
|
|
897
899
|
component: s,
|
|
898
900
|
initialConfig: h,
|
|
899
901
|
locale: u,
|
|
@@ -902,20 +904,20 @@ function ct({
|
|
|
902
904
|
loading: m = !1
|
|
903
905
|
}) {
|
|
904
906
|
const { t: a } = V(), [c, l] = W(null);
|
|
905
|
-
|
|
907
|
+
G(() => {
|
|
906
908
|
if (r && s) {
|
|
907
909
|
const f = { properties: {} };
|
|
908
910
|
if (s.properties) {
|
|
909
911
|
const k = h?.properties;
|
|
910
|
-
f.properties =
|
|
912
|
+
f.properties = _e(s.properties, k, u, d);
|
|
911
913
|
}
|
|
912
914
|
l(f);
|
|
913
915
|
}
|
|
914
916
|
}, [r, s, h, u, d]);
|
|
915
|
-
const
|
|
917
|
+
const i = () => {
|
|
916
918
|
t();
|
|
917
919
|
}, n = () => {
|
|
918
|
-
c && (
|
|
920
|
+
c && (o(c), t());
|
|
919
921
|
}, p = (f, k, v) => {
|
|
920
922
|
if (!c || !f.length) return;
|
|
921
923
|
const N = JSON.parse(JSON.stringify(c));
|
|
@@ -937,14 +939,14 @@ function ct({
|
|
|
937
939
|
};
|
|
938
940
|
if (k.subProperties && !L(k.subProperties)) {
|
|
939
941
|
const O = (j, A) => {
|
|
940
|
-
const
|
|
941
|
-
return Object.entries(j).forEach(([
|
|
942
|
-
const de = { ...
|
|
943
|
-
A !== null && (de.isNeedGenerate = A),
|
|
944
|
-
|
|
942
|
+
const F = {};
|
|
943
|
+
return Object.entries(j).forEach(([Xe, q]) => {
|
|
944
|
+
const de = { ...q };
|
|
945
|
+
A !== null && (de.isNeedGenerate = A), q.subProperties && !L(q.subProperties) && (de.subProperties = O(
|
|
946
|
+
q.subProperties,
|
|
945
947
|
A !== null ? A : null
|
|
946
|
-
)),
|
|
947
|
-
}),
|
|
948
|
+
)), F[Xe] = de;
|
|
949
|
+
}), F;
|
|
948
950
|
};
|
|
949
951
|
C.subProperties = O(
|
|
950
952
|
k.subProperties,
|
|
@@ -973,8 +975,8 @@ function ct({
|
|
|
973
975
|
}
|
|
974
976
|
}, g = (f, k = [], v = !0) => {
|
|
975
977
|
if (!f || L(f))
|
|
976
|
-
return /* @__PURE__ */ e(
|
|
977
|
-
const N =
|
|
978
|
+
return /* @__PURE__ */ e(_, { children: a("maker.properties.noProperties") });
|
|
979
|
+
const N = T(Object.entries(f), ([, z]) => z.displayName);
|
|
978
980
|
return /* @__PURE__ */ e(S, { spacing: 1.5, children: N.map(([z, P], I) => {
|
|
979
981
|
const b = [...k, z], C = I === N.length - 1, O = P.subProperties && !L(P.subProperties), j = P.displayName || z, A = !v;
|
|
980
982
|
return /* @__PURE__ */ e(w, { sx: { position: "relative" }, children: /* @__PURE__ */ x(S, { direction: "row", children: [
|
|
@@ -1047,13 +1049,13 @@ function ct({
|
|
|
1047
1049
|
le,
|
|
1048
1050
|
{
|
|
1049
1051
|
control: /* @__PURE__ */ e(
|
|
1050
|
-
|
|
1052
|
+
tr,
|
|
1051
1053
|
{
|
|
1052
1054
|
checked: P.isNeedGenerate,
|
|
1053
1055
|
disabled: A,
|
|
1054
|
-
onChange: (
|
|
1056
|
+
onChange: (F) => {
|
|
1055
1057
|
p(b, P, {
|
|
1056
|
-
isNeedGenerate:
|
|
1058
|
+
isNeedGenerate: F.target.checked
|
|
1057
1059
|
});
|
|
1058
1060
|
}
|
|
1059
1061
|
}
|
|
@@ -1076,9 +1078,9 @@ function ct({
|
|
|
1076
1078
|
fullWidth: !0,
|
|
1077
1079
|
label: a("maker.properties.llmPropertyDescribe"),
|
|
1078
1080
|
value: P.describe,
|
|
1079
|
-
onChange: (
|
|
1081
|
+
onChange: (F) => {
|
|
1080
1082
|
p(b, P, {
|
|
1081
|
-
describe:
|
|
1083
|
+
describe: F.target.value
|
|
1082
1084
|
});
|
|
1083
1085
|
},
|
|
1084
1086
|
disabled: !P.isNeedGenerate
|
|
@@ -1096,7 +1098,7 @@ function ct({
|
|
|
1096
1098
|
] }) }, z);
|
|
1097
1099
|
}) });
|
|
1098
1100
|
};
|
|
1099
|
-
return /* @__PURE__ */ x(ve, { open: r, onClose:
|
|
1101
|
+
return /* @__PURE__ */ x(ve, { open: r, onClose: i, maxWidth: "lg", fullWidth: !0, children: [
|
|
1100
1102
|
/* @__PURE__ */ e(Ve, { children: y || a("maker.properties.llmConfigTitle") }),
|
|
1101
1103
|
/* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(
|
|
1102
1104
|
w,
|
|
@@ -1104,22 +1106,22 @@ function ct({
|
|
|
1104
1106
|
sx: {
|
|
1105
1107
|
my: 3
|
|
1106
1108
|
},
|
|
1107
|
-
children: m ? /* @__PURE__ */ e(
|
|
1108
|
-
/* @__PURE__ */ e(
|
|
1109
|
+
children: m ? /* @__PURE__ */ e(E, { children: a("maker.properties.loading") }) : s ? c ? /* @__PURE__ */ x(S, { spacing: 3, children: [
|
|
1110
|
+
/* @__PURE__ */ e(E, { variant: "subtitle2", children: a("maker.properties.llmConfigInstructions") }),
|
|
1109
1111
|
g(c.properties)
|
|
1110
|
-
] }) : /* @__PURE__ */ e(
|
|
1112
|
+
] }) : /* @__PURE__ */ e(E, { children: a("maker.properties.loading") }) : /* @__PURE__ */ e(E, { color: "error", children: a("maker.properties.componentNotFound") })
|
|
1111
1113
|
}
|
|
1112
1114
|
) }),
|
|
1113
|
-
/* @__PURE__ */ x(
|
|
1114
|
-
/* @__PURE__ */ e(
|
|
1115
|
-
/* @__PURE__ */ e(
|
|
1115
|
+
/* @__PURE__ */ x(De, { children: [
|
|
1116
|
+
/* @__PURE__ */ e(D, { onClick: i, children: a("common.cancel") }),
|
|
1117
|
+
/* @__PURE__ */ e(D, { variant: "contained", onClick: n, disabled: !c || m, children: a("common.confirm") })
|
|
1116
1118
|
] })
|
|
1117
1119
|
] });
|
|
1118
1120
|
}
|
|
1119
|
-
function
|
|
1121
|
+
function mt({
|
|
1120
1122
|
label: r,
|
|
1121
1123
|
value: t,
|
|
1122
|
-
onChange:
|
|
1124
|
+
onChange: o
|
|
1123
1125
|
}) {
|
|
1124
1126
|
const [s, h] = W(!1);
|
|
1125
1127
|
return /* @__PURE__ */ x(
|
|
@@ -1135,7 +1137,7 @@ function dt({
|
|
|
1135
1137
|
label: r,
|
|
1136
1138
|
size: "small",
|
|
1137
1139
|
value: t,
|
|
1138
|
-
onChange: (u) =>
|
|
1140
|
+
onChange: (u) => o?.(u.target.value),
|
|
1139
1141
|
slotProps: {
|
|
1140
1142
|
input: {
|
|
1141
1143
|
sx: {
|
|
@@ -1146,7 +1148,7 @@ function dt({
|
|
|
1146
1148
|
{
|
|
1147
1149
|
onChange: ({ response: u }) => {
|
|
1148
1150
|
const d = u?.data?.filename;
|
|
1149
|
-
d &&
|
|
1151
|
+
d && o?.(d);
|
|
1150
1152
|
}
|
|
1151
1153
|
}
|
|
1152
1154
|
) })
|
|
@@ -1158,7 +1160,7 @@ function dt({
|
|
|
1158
1160
|
w,
|
|
1159
1161
|
{
|
|
1160
1162
|
component: "img",
|
|
1161
|
-
src:
|
|
1163
|
+
src: ne(t),
|
|
1162
1164
|
alt: r,
|
|
1163
1165
|
onClick: () => h(!0),
|
|
1164
1166
|
sx: {
|
|
@@ -1171,18 +1173,18 @@ function dt({
|
|
|
1171
1173
|
}
|
|
1172
1174
|
}
|
|
1173
1175
|
),
|
|
1174
|
-
/* @__PURE__ */ e(ve, { open: s, onClose: () => h(!1), children: /* @__PURE__ */ e(w, { component: "img", sx: { objectFit: "contain" }, src:
|
|
1176
|
+
/* @__PURE__ */ e(ve, { open: s, onClose: () => h(!1), children: /* @__PURE__ */ e(w, { component: "img", sx: { objectFit: "contain" }, src: ne(t), alt: r }) })
|
|
1175
1177
|
]
|
|
1176
1178
|
}
|
|
1177
1179
|
);
|
|
1178
1180
|
}
|
|
1179
1181
|
function ge(r, t = "") {
|
|
1180
|
-
return
|
|
1182
|
+
return Ur(r, (o, s, h) => {
|
|
1181
1183
|
const u = t ? `${t}.${h}` : h;
|
|
1182
|
-
return
|
|
1184
|
+
return Tr(s) ? Vr(o, ge(s, u)) : o[u] = s, o;
|
|
1183
1185
|
}, {});
|
|
1184
1186
|
}
|
|
1185
|
-
const
|
|
1187
|
+
const ht = [
|
|
1186
1188
|
{ value: "string", label: "Text" },
|
|
1187
1189
|
{ value: "multiline", label: "Text (Multiline)" },
|
|
1188
1190
|
{ value: "number", label: "Number" },
|
|
@@ -1196,16 +1198,16 @@ const ut = [
|
|
|
1196
1198
|
{ value: "component", label: "Component" },
|
|
1197
1199
|
{ value: "custom", label: "Custom (Render by a Component)" }
|
|
1198
1200
|
];
|
|
1199
|
-
function
|
|
1200
|
-
return !r || !
|
|
1201
|
+
function Q(r, t, o) {
|
|
1202
|
+
return !r || !o ? !1 : Object.values(r).some(({ data: s }) => s.id !== t && s.key === o);
|
|
1201
1203
|
}
|
|
1202
|
-
function
|
|
1204
|
+
function Z(r, t) {
|
|
1203
1205
|
return !r || !t ? !1 : r[t]?.data.visible ?? !0;
|
|
1204
1206
|
}
|
|
1205
|
-
function
|
|
1207
|
+
function Ge(r, t) {
|
|
1206
1208
|
return !r || !t ? !1 : r[t]?.data.shared ?? !1;
|
|
1207
1209
|
}
|
|
1208
|
-
function
|
|
1210
|
+
function vn({ componentId: r }) {
|
|
1209
1211
|
const { state: { components: t } } = se(), s = t[r]?.data;
|
|
1210
1212
|
return s ? /* @__PURE__ */ e(S, {
|
|
1211
1213
|
sx: {
|
|
@@ -1216,35 +1218,35 @@ function hn({ componentId: r }) {
|
|
|
1216
1218
|
sx: {
|
|
1217
1219
|
p: 2
|
|
1218
1220
|
},
|
|
1219
|
-
children: /* @__PURE__ */ e(
|
|
1221
|
+
children: /* @__PURE__ */ e(Mr, { FallbackComponent: Zr, resetKeys: [r], children: /* @__PURE__ */ e(ft, { value: s, componentId: r }) })
|
|
1220
1222
|
})
|
|
1221
1223
|
}) : null;
|
|
1222
1224
|
}
|
|
1223
|
-
function
|
|
1224
|
-
const { t:
|
|
1225
|
+
function ft({ value: r, componentId: t }) {
|
|
1226
|
+
const { t: o } = V(), { localState: { currentLocale: s, customComponentPreviewerProperties: h }, state: { config: { defaultLocale: u } }, localActions: { setCustomComponentPreviewerProperties: d } } = se(), y = Y(r).doc, m = Ce(), a = oe(() => h?.[t] ?? {}, [t, h]), c = r.renderer?.type || "react-component", l = c === "component-template", i = Rr({
|
|
1225
1227
|
componentId: t,
|
|
1226
1228
|
propertiesValue: {
|
|
1227
1229
|
...a
|
|
1228
1230
|
}
|
|
1229
1231
|
});
|
|
1230
|
-
return
|
|
1231
|
-
|
|
1232
|
+
return G(() => {
|
|
1233
|
+
i.componentId !== t && (i.componentId = t, i.propertiesValue = {
|
|
1232
1234
|
...a
|
|
1233
1235
|
});
|
|
1234
|
-
}, [t, a,
|
|
1235
|
-
if (
|
|
1236
|
+
}, [t, a, i]), Fe(() => {
|
|
1237
|
+
if (i.componentId !== t)
|
|
1236
1238
|
return;
|
|
1237
1239
|
const n = Object.fromEntries(Object.values(r.properties ?? {}).map(({ data: p }) => [
|
|
1238
1240
|
p.id,
|
|
1239
1241
|
{
|
|
1240
|
-
value:
|
|
1242
|
+
value: i.propertiesValue[p.id]?.value ?? xr(p, p.locales?.[s]?.defaultValue ?? p.locales?.[u]?.defaultValue, {
|
|
1241
1243
|
locale: s,
|
|
1242
1244
|
defaultLocale: u
|
|
1243
1245
|
})
|
|
1244
1246
|
}
|
|
1245
1247
|
]));
|
|
1246
1248
|
d(t, n);
|
|
1247
|
-
}, [
|
|
1249
|
+
}, [i.propertiesValue, t, i.componentId]), /* @__PURE__ */ e(S, {
|
|
1248
1250
|
sx: {
|
|
1249
1251
|
height: "100%"
|
|
1250
1252
|
},
|
|
@@ -1253,9 +1255,9 @@ function pt({ value: r, componentId: t }) {
|
|
|
1253
1255
|
gap: 2
|
|
1254
1256
|
},
|
|
1255
1257
|
children: [
|
|
1256
|
-
/* @__PURE__ */ e(
|
|
1258
|
+
/* @__PURE__ */ e(bt, { config: r }),
|
|
1257
1259
|
/* @__PURE__ */ x(U, { children: [
|
|
1258
|
-
/* @__PURE__ */ e(
|
|
1260
|
+
/* @__PURE__ */ e(yt, {
|
|
1259
1261
|
config: r,
|
|
1260
1262
|
currentLocale: s,
|
|
1261
1263
|
defaultLocale: u,
|
|
@@ -1274,7 +1276,7 @@ function pt({ value: r, componentId: t }) {
|
|
|
1274
1276
|
alignItems: "center"
|
|
1275
1277
|
},
|
|
1276
1278
|
children: [
|
|
1277
|
-
/* @__PURE__ */ e(
|
|
1279
|
+
/* @__PURE__ */ e(E, { variant: "subtitle1", children: o("renderer") }),
|
|
1278
1280
|
/* @__PURE__ */ x(R, {
|
|
1279
1281
|
hiddenLabel: !0,
|
|
1280
1282
|
size: "small",
|
|
@@ -1291,30 +1293,30 @@ function pt({ value: r, componentId: t }) {
|
|
|
1291
1293
|
select: { autoWidth: !0 }
|
|
1292
1294
|
},
|
|
1293
1295
|
children: [
|
|
1294
|
-
/* @__PURE__ */ e(
|
|
1295
|
-
/* @__PURE__ */ e(
|
|
1296
|
-
/* @__PURE__ */ e(
|
|
1296
|
+
/* @__PURE__ */ e(X, { value: "component-template", disabled: !0, children: o("maker.components.componentTemplate") }),
|
|
1297
|
+
/* @__PURE__ */ e(X, { value: "react-component", children: "React Component" }),
|
|
1298
|
+
/* @__PURE__ */ e(X, { value: "component", children: "Custom Component" })
|
|
1297
1299
|
]
|
|
1298
1300
|
})
|
|
1299
1301
|
]
|
|
1300
1302
|
}),
|
|
1301
|
-
c === "component" && /* @__PURE__ */ e(
|
|
1302
|
-
c === "react-component" && /* @__PURE__ */ e(
|
|
1303
|
-
/* @__PURE__ */ e(
|
|
1303
|
+
c === "component" && /* @__PURE__ */ e(It, { value: r }),
|
|
1304
|
+
c === "react-component" && /* @__PURE__ */ e(St, { value: r }),
|
|
1305
|
+
/* @__PURE__ */ e(Qe, {
|
|
1304
1306
|
config: r,
|
|
1305
1307
|
currentLocale: s,
|
|
1306
1308
|
defaultLocale: u,
|
|
1307
1309
|
allComponents: m,
|
|
1308
|
-
propertiesValue:
|
|
1310
|
+
propertiesValue: i.propertiesValue,
|
|
1309
1311
|
onChange: ({ value: n, id: p, path: g }) => {
|
|
1310
1312
|
const f = [...g, "data"];
|
|
1311
|
-
if (!
|
|
1312
|
-
be.warning(
|
|
1313
|
+
if (!Ar(r, f)) {
|
|
1314
|
+
be.warning(o("cannotFindPropertyKey", {
|
|
1313
1315
|
key: f.join(".")
|
|
1314
1316
|
}));
|
|
1315
1317
|
return;
|
|
1316
1318
|
}
|
|
1317
|
-
|
|
1319
|
+
i.propertiesValue[p] = {
|
|
1318
1320
|
value: n.value
|
|
1319
1321
|
};
|
|
1320
1322
|
}
|
|
@@ -1324,19 +1326,19 @@ function pt({ value: r, componentId: t }) {
|
|
|
1324
1326
|
})
|
|
1325
1327
|
});
|
|
1326
1328
|
}
|
|
1327
|
-
function
|
|
1329
|
+
function bt({ config: r }) {
|
|
1328
1330
|
const { t } = V();
|
|
1329
1331
|
return /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ x(S, {
|
|
1330
1332
|
sx: {
|
|
1331
1333
|
gap: 2
|
|
1332
1334
|
},
|
|
1333
1335
|
children: [
|
|
1334
|
-
/* @__PURE__ */ e(
|
|
1336
|
+
/* @__PURE__ */ e(E, { variant: "subtitle1", children: t("basicInfo") }),
|
|
1335
1337
|
/* @__PURE__ */ e(R, {
|
|
1336
1338
|
label: t("name"),
|
|
1337
1339
|
size: "small",
|
|
1338
1340
|
value: r.name || "",
|
|
1339
|
-
onChange: (
|
|
1341
|
+
onChange: (o) => r.name = o.target.value
|
|
1340
1342
|
}),
|
|
1341
1343
|
/* @__PURE__ */ e(R, {
|
|
1342
1344
|
label: t("description"),
|
|
@@ -1345,34 +1347,34 @@ function mt({ config: r }) {
|
|
|
1345
1347
|
minRows: 2,
|
|
1346
1348
|
maxRows: 8,
|
|
1347
1349
|
value: r.description || "",
|
|
1348
|
-
onChange: (
|
|
1350
|
+
onChange: (o) => r.description = o.target.value,
|
|
1349
1351
|
slotProps: {
|
|
1350
1352
|
input: {
|
|
1351
|
-
endAdornment: /* @__PURE__ */ e(H, { position: "end", sx: { mt: -1.5 }, children: /* @__PURE__ */ e(
|
|
1353
|
+
endAdornment: /* @__PURE__ */ e(H, { position: "end", sx: { mt: -1.5 }, children: /* @__PURE__ */ e(Ot, { config: r }) })
|
|
1352
1354
|
},
|
|
1353
1355
|
htmlInput: { maxLength: 2048 }
|
|
1354
1356
|
}
|
|
1355
1357
|
}),
|
|
1356
|
-
/* @__PURE__ */ e(
|
|
1358
|
+
/* @__PURE__ */ e(Ee, {
|
|
1357
1359
|
size: "small",
|
|
1358
1360
|
options: [],
|
|
1359
1361
|
multiple: !0,
|
|
1360
1362
|
freeSolo: !0,
|
|
1361
1363
|
value: r.tags ?? [],
|
|
1362
|
-
onChange: (
|
|
1363
|
-
renderInput: (
|
|
1364
|
+
onChange: (o, s) => r.tags = s,
|
|
1365
|
+
renderInput: (o) => /* @__PURE__ */ e(R, { label: t("tags"), ...o })
|
|
1364
1366
|
}),
|
|
1365
|
-
/* @__PURE__ */ e(
|
|
1367
|
+
/* @__PURE__ */ e(mt, {
|
|
1366
1368
|
label: t("previewImage"),
|
|
1367
1369
|
value: r.previewImage || "",
|
|
1368
|
-
onChange: (
|
|
1370
|
+
onChange: (o) => r.previewImage = o
|
|
1369
1371
|
})
|
|
1370
1372
|
]
|
|
1371
1373
|
}) });
|
|
1372
1374
|
}
|
|
1373
|
-
function
|
|
1374
|
-
const { t: a } = V(), c =
|
|
1375
|
-
return /* @__PURE__ */ e(
|
|
1375
|
+
function Ye({ data: r, params: t, visible: o, shared: s, config: h, currentLocale: u, defaultLocale: d, allComponents: y, onUpdateConfig: m }) {
|
|
1376
|
+
const { t: a } = V(), c = oe(() => r.type === "json" || r.type === "yaml" || r.type === "array" ? Ct : M, [r.type]);
|
|
1377
|
+
return /* @__PURE__ */ e(ct, {
|
|
1376
1378
|
preview: t.preview,
|
|
1377
1379
|
drop: t.drop,
|
|
1378
1380
|
drag: t.drag,
|
|
@@ -1388,17 +1390,17 @@ function Ge({ data: r, params: t, visible: i, shared: s, config: h, currentLocal
|
|
|
1388
1390
|
}
|
|
1389
1391
|
});
|
|
1390
1392
|
},
|
|
1391
|
-
visible:
|
|
1393
|
+
visible: o,
|
|
1392
1394
|
onVisibilityChange: (l) => {
|
|
1393
|
-
m((
|
|
1394
|
-
const n =
|
|
1395
|
+
m((i) => {
|
|
1396
|
+
const n = i.properties[r.id].data;
|
|
1395
1397
|
n.visible = l;
|
|
1396
1398
|
});
|
|
1397
1399
|
},
|
|
1398
1400
|
shared: s,
|
|
1399
1401
|
onSharedChange: (l) => {
|
|
1400
|
-
m((
|
|
1401
|
-
const n =
|
|
1402
|
+
m((i) => {
|
|
1403
|
+
const n = i.properties[r.id].data;
|
|
1402
1404
|
n.shared = l;
|
|
1403
1405
|
});
|
|
1404
1406
|
},
|
|
@@ -1417,25 +1419,25 @@ function Ge({ data: r, params: t, visible: i, shared: s, config: h, currentLocal
|
|
|
1417
1419
|
width: "calc(100% - 104px - 8px)",
|
|
1418
1420
|
flex: 1,
|
|
1419
1421
|
"& .MuiOutlinedInput-root": {
|
|
1420
|
-
borderColor: r.key ?
|
|
1422
|
+
borderColor: r.key ? Q(h.properties, r.id, r.key) ? "warning.main" : void 0 : "error.main"
|
|
1421
1423
|
},
|
|
1422
1424
|
"& .MuiFormLabel-root": {
|
|
1423
|
-
color: r.key ?
|
|
1425
|
+
color: r.key ? Q(h.properties, r.id, r.key) ? "warning.main" : "text.secondary" : "error.main"
|
|
1424
1426
|
},
|
|
1425
1427
|
"& .MuiFormLabel-root.Mui-focused": {
|
|
1426
|
-
color: r.key ?
|
|
1428
|
+
color: r.key ? Q(h.properties, r.id, r.key) ? "warning.main" : "primary.main" : "error.main"
|
|
1427
1429
|
}
|
|
1428
1430
|
},
|
|
1429
1431
|
value: r.key || "",
|
|
1430
1432
|
onChange: (l) => {
|
|
1431
|
-
m((
|
|
1432
|
-
const n =
|
|
1433
|
+
m((i) => {
|
|
1434
|
+
const n = i.properties[r.id].data;
|
|
1433
1435
|
n.key = l.target.value.trim();
|
|
1434
1436
|
});
|
|
1435
1437
|
},
|
|
1436
1438
|
slotProps: {
|
|
1437
1439
|
input: {
|
|
1438
|
-
endAdornment: !r.key || r.key &&
|
|
1440
|
+
endAdornment: !r.key || r.key && Q(h.properties, r.id, r.key) ? /* @__PURE__ */ e(H, {
|
|
1439
1441
|
position: "end",
|
|
1440
1442
|
sx: {
|
|
1441
1443
|
width: 16,
|
|
@@ -1463,8 +1465,8 @@ function Ge({ data: r, params: t, visible: i, shared: s, config: h, currentLocal
|
|
|
1463
1465
|
sx: { flex: 1 },
|
|
1464
1466
|
value: (r.locales?.[u]?.name ?? r.locales?.[d]?.name) || "",
|
|
1465
1467
|
onChange: (l) => {
|
|
1466
|
-
m((
|
|
1467
|
-
const n =
|
|
1468
|
+
m((i) => {
|
|
1469
|
+
const n = i.properties[r.id].data;
|
|
1468
1470
|
n.locales ??= {}, n.locales[u] ??= {}, n.locales[u].name = l.target.value;
|
|
1469
1471
|
});
|
|
1470
1472
|
}
|
|
@@ -1476,8 +1478,8 @@ function Ge({ data: r, params: t, visible: i, shared: s, config: h, currentLocal
|
|
|
1476
1478
|
sx: { flex: 1 },
|
|
1477
1479
|
value: r.type === "string" && r.multiline ? "multiline" : r.type || "string",
|
|
1478
1480
|
onChange: (l) => {
|
|
1479
|
-
m((
|
|
1480
|
-
const n =
|
|
1481
|
+
m((i) => {
|
|
1482
|
+
const n = i.properties[r.id].data;
|
|
1481
1483
|
if (n.locales)
|
|
1482
1484
|
for (const g of Object.keys(n.locales))
|
|
1483
1485
|
n.locales[g].defaultValue = void 0;
|
|
@@ -1485,7 +1487,7 @@ function Ge({ data: r, params: t, visible: i, shared: s, config: h, currentLocal
|
|
|
1485
1487
|
p === "multiline" ? (n.type = "string", n.multiline = !0) : (typeof n.multiline < "u" && delete n.multiline, n.type = p);
|
|
1486
1488
|
});
|
|
1487
1489
|
},
|
|
1488
|
-
children:
|
|
1490
|
+
children: ht.map((l) => /* @__PURE__ */ e(X, { value: l.value, children: l.label }, l.value))
|
|
1489
1491
|
})
|
|
1490
1492
|
]
|
|
1491
1493
|
}),
|
|
@@ -1504,10 +1506,10 @@ function Ge({ data: r, params: t, visible: i, shared: s, config: h, currentLocal
|
|
|
1504
1506
|
size: "small",
|
|
1505
1507
|
fullWidth: !0,
|
|
1506
1508
|
value: r.locales?.[u]?.defaultValue,
|
|
1507
|
-
onChange: (l,
|
|
1509
|
+
onChange: (l, i) => {
|
|
1508
1510
|
m((n) => {
|
|
1509
1511
|
const p = n.properties[r.id].data;
|
|
1510
|
-
if (
|
|
1512
|
+
if (i?.forceUpdateProperty) {
|
|
1511
1513
|
const g = ge(p), f = ge(l);
|
|
1512
1514
|
Object.keys(f).forEach((k) => {
|
|
1513
1515
|
g[k] || We(p, k, f[k]);
|
|
@@ -1517,16 +1519,16 @@ function Ge({ data: r, params: t, visible: i, shared: s, config: h, currentLocal
|
|
|
1517
1519
|
});
|
|
1518
1520
|
}
|
|
1519
1521
|
}),
|
|
1520
|
-
r.type === "custom" ? /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
|
|
1522
|
+
r.type === "custom" ? /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(vt, { property: r, allComponents: y }) }) : null
|
|
1521
1523
|
]
|
|
1522
1524
|
})
|
|
1523
1525
|
]
|
|
1524
1526
|
})
|
|
1525
1527
|
});
|
|
1526
1528
|
}
|
|
1527
|
-
function
|
|
1528
|
-
const [
|
|
1529
|
-
return
|
|
1529
|
+
function gt(r, t) {
|
|
1530
|
+
const [o, s] = W(0);
|
|
1531
|
+
return G(() => {
|
|
1530
1532
|
const u = setTimeout(() => {
|
|
1531
1533
|
if (r.current) {
|
|
1532
1534
|
let d = r.current.parentElement, y = 0;
|
|
@@ -1536,10 +1538,10 @@ function ht(r, t) {
|
|
|
1536
1538
|
}
|
|
1537
1539
|
}, 100);
|
|
1538
1540
|
return () => clearTimeout(u);
|
|
1539
|
-
}, [r, t]),
|
|
1541
|
+
}, [r, t]), o;
|
|
1540
1542
|
}
|
|
1541
|
-
function
|
|
1542
|
-
const { t: d } = V(), y = we({ variant: "dialog" }), m = r.properties &&
|
|
1543
|
+
function yt({ config: r, currentLocale: t, defaultLocale: o, allComponents: s, onUpdateConfig: h, useI18nEditor: u = !0 }) {
|
|
1544
|
+
const { t: d } = V(), y = we({ variant: "dialog" }), m = r.properties && T(Object.values(r.properties), "index");
|
|
1543
1545
|
return /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ x(S, {
|
|
1544
1546
|
sx: {
|
|
1545
1547
|
gap: 2
|
|
@@ -1553,50 +1555,50 @@ function ft({ config: r, currentLocale: t, defaultLocale: i, allComponents: s, o
|
|
|
1553
1555
|
justifyContent: "space-between"
|
|
1554
1556
|
},
|
|
1555
1557
|
children: [
|
|
1556
|
-
/* @__PURE__ */ e(
|
|
1558
|
+
/* @__PURE__ */ e(E, { variant: "subtitle1", children: d("properties") }),
|
|
1557
1559
|
/* @__PURE__ */ e(w, {
|
|
1558
1560
|
sx: {
|
|
1559
1561
|
flex: 1
|
|
1560
1562
|
}
|
|
1561
1563
|
}),
|
|
1562
|
-
u && /* @__PURE__ */ e(
|
|
1564
|
+
u && /* @__PURE__ */ e(D, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Se(y), children: /* @__PURE__ */ e(Le, { fontSize: "small" }) })
|
|
1563
1565
|
]
|
|
1564
1566
|
}),
|
|
1565
|
-
r.properties && Object.keys(r.properties).length > 0 ? /* @__PURE__ */ e(
|
|
1567
|
+
r.properties && Object.keys(r.properties).length > 0 ? /* @__PURE__ */ e($e, {
|
|
1566
1568
|
component: S,
|
|
1567
1569
|
gap: 2,
|
|
1568
1570
|
list: r.properties,
|
|
1569
1571
|
renderItem: (a, c, l) => {
|
|
1570
|
-
const
|
|
1571
|
-
return /* @__PURE__ */ e(
|
|
1572
|
+
const i = Z(r.properties, a.id), n = Ge(r.properties, a.id);
|
|
1573
|
+
return /* @__PURE__ */ e(J, {
|
|
1572
1574
|
elevation: 0,
|
|
1573
1575
|
className: "property-container",
|
|
1574
1576
|
sx: {
|
|
1575
1577
|
p: 1.25,
|
|
1576
1578
|
borderRadius: 1,
|
|
1577
|
-
border:
|
|
1579
|
+
border: i ? "1px solid" : "1px dashed",
|
|
1578
1580
|
borderColor: "divider"
|
|
1579
1581
|
},
|
|
1580
1582
|
children: /* @__PURE__ */ e(S, {
|
|
1581
1583
|
sx: {
|
|
1582
1584
|
gap: 2
|
|
1583
1585
|
},
|
|
1584
|
-
children: /* @__PURE__ */ e(
|
|
1586
|
+
children: /* @__PURE__ */ e(Ye, {
|
|
1585
1587
|
data: a,
|
|
1586
1588
|
params: l,
|
|
1587
|
-
visible:
|
|
1589
|
+
visible: i,
|
|
1588
1590
|
shared: n,
|
|
1589
1591
|
config: r,
|
|
1590
1592
|
currentLocale: t,
|
|
1591
|
-
defaultLocale:
|
|
1593
|
+
defaultLocale: o,
|
|
1592
1594
|
allComponents: s,
|
|
1593
1595
|
onUpdateConfig: h
|
|
1594
1596
|
})
|
|
1595
1597
|
})
|
|
1596
1598
|
}, a.id);
|
|
1597
1599
|
}
|
|
1598
|
-
}) : /* @__PURE__ */ e(
|
|
1599
|
-
/* @__PURE__ */ e(
|
|
1600
|
+
}) : /* @__PURE__ */ e(_, { style: { fontSize: 12 }, children: d("maker.properties.noProperties") }),
|
|
1601
|
+
/* @__PURE__ */ e(D, {
|
|
1600
1602
|
fullWidth: !0,
|
|
1601
1603
|
variant: "outlined",
|
|
1602
1604
|
className: "ignore-style-override",
|
|
@@ -1609,15 +1611,15 @@ function ft({ config: r, currentLocale: t, defaultLocale: i, allComponents: s, o
|
|
|
1609
1611
|
startIcon: /* @__PURE__ */ e(Ue, {}),
|
|
1610
1612
|
children: d("addObject", { object: d("property") })
|
|
1611
1613
|
}),
|
|
1612
|
-
u && /* @__PURE__ */ e(
|
|
1614
|
+
u && /* @__PURE__ */ e(qe, { ...He(y), component: r })
|
|
1613
1615
|
]
|
|
1614
1616
|
}) });
|
|
1615
1617
|
}
|
|
1616
|
-
function
|
|
1617
|
-
const
|
|
1618
|
+
function vt({ property: r, allComponents: t }) {
|
|
1619
|
+
const o = we({ variant: "popper" });
|
|
1618
1620
|
return /* @__PURE__ */ x(U, { children: [
|
|
1619
|
-
/* @__PURE__ */ e(
|
|
1620
|
-
/* @__PURE__ */ e(ir, { ...
|
|
1621
|
+
/* @__PURE__ */ e(D, { sx: { minWidth: 0 }, ...Se(o), children: /* @__PURE__ */ e(Me, { fontSize: "small" }) }),
|
|
1622
|
+
/* @__PURE__ */ e(ir, { ...Br(o), children: /* @__PURE__ */ e(Pr, { onClickAway: o.close, children: /* @__PURE__ */ e(J, { children: /* @__PURE__ */ e(w, {
|
|
1621
1623
|
sx: {
|
|
1622
1624
|
width: 500,
|
|
1623
1625
|
p: 2
|
|
@@ -1630,10 +1632,10 @@ function bt({ property: r, allComponents: t }) {
|
|
|
1630
1632
|
}) }) }) })
|
|
1631
1633
|
] });
|
|
1632
1634
|
}
|
|
1633
|
-
function
|
|
1635
|
+
function xt({ value: r, valueImmutable: t, onChange: o, defaultLocale: s, allComponents: h }) {
|
|
1634
1636
|
const [u, d] = W(!1), { t: y, locale: m } = V(), a = typeof r?.componentId == "string" ? h[r.componentId]?.data : void 0;
|
|
1635
1637
|
return a ? /* @__PURE__ */ x(w, { sx: { width: "100%", position: "relative" }, children: [
|
|
1636
|
-
/* @__PURE__ */ e(
|
|
1638
|
+
/* @__PURE__ */ e($, {
|
|
1637
1639
|
sx: { minWidth: 0 },
|
|
1638
1640
|
disabled: !a,
|
|
1639
1641
|
size: "small",
|
|
@@ -1641,7 +1643,7 @@ function gt({ value: r, valueImmutable: t, onChange: i, defaultLocale: s, allCom
|
|
|
1641
1643
|
color: u ? "primary" : "default",
|
|
1642
1644
|
children: /* @__PURE__ */ e(Me, { fontSize: "small" })
|
|
1643
1645
|
}),
|
|
1644
|
-
u && /* @__PURE__ */ e(
|
|
1646
|
+
u && /* @__PURE__ */ e(nr, { in: u, timeout: "auto", unmountOnExit: !0, sx: { width: "100%", zIndex: 10 }, children: /* @__PURE__ */ x(J, {
|
|
1645
1647
|
elevation: 1,
|
|
1646
1648
|
sx: {
|
|
1647
1649
|
mt: 1,
|
|
@@ -1657,38 +1659,38 @@ function gt({ value: r, valueImmutable: t, onChange: i, defaultLocale: s, allCom
|
|
|
1657
1659
|
width: "100%",
|
|
1658
1660
|
mb: 2
|
|
1659
1661
|
},
|
|
1660
|
-
children: /* @__PURE__ */ e(
|
|
1662
|
+
children: /* @__PURE__ */ e(Qe, {
|
|
1661
1663
|
config: a,
|
|
1662
1664
|
currentLocale: m,
|
|
1663
1665
|
defaultLocale: s,
|
|
1664
1666
|
allComponents: h,
|
|
1665
1667
|
propertiesValue: r?.properties,
|
|
1666
1668
|
onChange: ({ id: c, value: l }) => {
|
|
1667
|
-
const
|
|
1668
|
-
n?.componentId && (t ?
|
|
1669
|
+
const i = fe(l.value), n = JSON.parse(JSON.stringify(r));
|
|
1670
|
+
n?.componentId && (t ? o?.({ ...n, properties: { ...n.properties, [c]: { value: i } } }) : (n.properties = n.properties ?? {}, n.properties[c] = { value: i }, o?.(n)));
|
|
1669
1671
|
}
|
|
1670
1672
|
})
|
|
1671
1673
|
}),
|
|
1672
|
-
/* @__PURE__ */ e(
|
|
1674
|
+
/* @__PURE__ */ e(D, { size: "small", onClick: () => d(!1), sx: { mt: 1 }, children: y("close") })
|
|
1673
1675
|
]
|
|
1674
1676
|
}) })
|
|
1675
1677
|
] }) : null;
|
|
1676
1678
|
}
|
|
1677
|
-
function
|
|
1678
|
-
const { t: s } = V(), { state: { components: h, supportedLocales: u, config: { defaultLocale: d } } } = se(), y = Ce(), m =
|
|
1679
|
-
return /* @__PURE__ */ x(ve, { ...
|
|
1679
|
+
function qe({ type: r = "properties", component: t, ...o }) {
|
|
1680
|
+
const { t: s } = V(), { state: { components: h, supportedLocales: u, config: { defaultLocale: d } } } = se(), y = Ce(), m = Y(t).doc, a = r === "properties" ? t.properties : r === "parameters" && t.renderer?.type === "component" ? h[t.renderer.componentId]?.data.properties : void 0, c = t.renderer?.type === "component" ? t : void 0;
|
|
1681
|
+
return /* @__PURE__ */ x(ve, { ...o, fullWidth: !0, maxWidth: "lg", children: [
|
|
1680
1682
|
/* @__PURE__ */ e(Ve, { children: s("i18nEditorTitle") }),
|
|
1681
1683
|
/* @__PURE__ */ e(Ae, { children: a && /* @__PURE__ */ e(S, { children: /* @__PURE__ */ x(ze, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
|
|
1682
|
-
/* @__PURE__ */ e(je, { children: /* @__PURE__ */ e(
|
|
1684
|
+
/* @__PURE__ */ e(je, { children: /* @__PURE__ */ e(re, { children: u.map(({ locale: l, name: i }) => /* @__PURE__ */ e(te, { children: /* @__PURE__ */ x(E, {
|
|
1683
1685
|
sx: {
|
|
1684
1686
|
color: "text.primary"
|
|
1685
1687
|
},
|
|
1686
1688
|
children: [
|
|
1687
|
-
|
|
1688
|
-
d === l && /* @__PURE__ */ e(
|
|
1689
|
+
i,
|
|
1690
|
+
d === l && /* @__PURE__ */ e(jr, { sx: { fontSize: 12 } })
|
|
1689
1691
|
]
|
|
1690
1692
|
}) }, l)) }) }),
|
|
1691
|
-
/* @__PURE__ */ e(Re, { children:
|
|
1693
|
+
/* @__PURE__ */ e(Re, { children: T(Object.values(a), "index").map(({ data: l }) => /* @__PURE__ */ e(re, { children: u.map(({ locale: i }) => /* @__PURE__ */ e(te, { children: /* @__PURE__ */ e(S, {
|
|
1692
1694
|
sx: {
|
|
1693
1695
|
gap: 1
|
|
1694
1696
|
},
|
|
@@ -1706,14 +1708,14 @@ function Ye({ type: r = "properties", component: t, ...i }) {
|
|
|
1706
1708
|
/* @__PURE__ */ e(R, {
|
|
1707
1709
|
size: "small",
|
|
1708
1710
|
label: s("label"),
|
|
1709
|
-
value: (l.locales?.[
|
|
1711
|
+
value: (l.locales?.[i]?.name ?? l.locales?.[d]?.name) || "",
|
|
1710
1712
|
onChange: (n) => {
|
|
1711
1713
|
m.transact(() => {
|
|
1712
|
-
l.locales ??= {}, l.locales[
|
|
1714
|
+
l.locales ??= {}, l.locales[i] ??= {}, l.locales[i].name = n.target.value;
|
|
1713
1715
|
});
|
|
1714
1716
|
}
|
|
1715
1717
|
}),
|
|
1716
|
-
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
|
|
1718
|
+
/* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(M, {
|
|
1717
1719
|
allComponents: y,
|
|
1718
1720
|
defaultLocale: d,
|
|
1719
1721
|
component: t,
|
|
@@ -1721,41 +1723,41 @@ function Ye({ type: r = "properties", component: t, ...i }) {
|
|
|
1721
1723
|
size: "small",
|
|
1722
1724
|
fullWidth: !0,
|
|
1723
1725
|
label: "Default Value",
|
|
1724
|
-
valueImmutable:
|
|
1725
|
-
value: l.locales?.[
|
|
1726
|
+
valueImmutable: ie(l.locales?.[i]?.defaultValue),
|
|
1727
|
+
value: l.locales?.[i]?.defaultValue ?? l.locales?.[d]?.defaultValue,
|
|
1726
1728
|
onChange: (n) => {
|
|
1727
1729
|
m.transact(() => {
|
|
1728
|
-
l.locales ??= {}, l.locales[
|
|
1730
|
+
l.locales ??= {}, l.locales[i] ??= {}, l.locales[i].defaultValue = n;
|
|
1729
1731
|
});
|
|
1730
1732
|
}
|
|
1731
1733
|
}) })
|
|
1732
|
-
] }) : r === "parameters" && c ? /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
|
|
1734
|
+
] }) : r === "parameters" && c ? /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(M, {
|
|
1733
1735
|
allComponents: y,
|
|
1734
1736
|
defaultLocale: d,
|
|
1735
1737
|
component: t,
|
|
1736
1738
|
property: l,
|
|
1737
1739
|
size: "small",
|
|
1738
1740
|
fullWidth: !0,
|
|
1739
|
-
valueImmutable:
|
|
1740
|
-
value: c.renderer.properties?.[l.id]?.locales?.[
|
|
1741
|
+
valueImmutable: ie(c.renderer.properties?.[l.id]?.locales?.[i]?.value),
|
|
1742
|
+
value: c.renderer.properties?.[l.id]?.locales?.[i]?.value ?? c.renderer.properties?.[l.id]?.locales?.[d]?.value ?? l.locales?.[i]?.defaultValue ?? l.locales?.[d]?.defaultValue,
|
|
1741
1743
|
onChange: (n) => {
|
|
1742
1744
|
m.transact(() => {
|
|
1743
|
-
c.renderer.properties ??= {}, c.renderer.properties[l.id] ??= {}, c.renderer.properties[l.id].locales ??= {}, c.renderer.properties[l.id].locales[
|
|
1745
|
+
c.renderer.properties ??= {}, c.renderer.properties[l.id] ??= {}, c.renderer.properties[l.id].locales ??= {}, c.renderer.properties[l.id].locales[i] ??= {}, c.renderer.properties[l.id].locales[i].value = n;
|
|
1744
1746
|
});
|
|
1745
1747
|
}
|
|
1746
1748
|
}) }) : null
|
|
1747
|
-
}, l.id) },
|
|
1749
|
+
}, l.id) }, i)) }, l.id)) })
|
|
1748
1750
|
] }) }) }),
|
|
1749
|
-
/* @__PURE__ */ e(
|
|
1751
|
+
/* @__PURE__ */ e(De, { children: /* @__PURE__ */ e(D, { onClick: (l) => o.onClose?.(l, "escapeKeyDown"), children: s("close") }) })
|
|
1750
1752
|
] });
|
|
1751
1753
|
}
|
|
1752
|
-
const Ne = (r, t) => (
|
|
1754
|
+
const Ne = (r, t) => (o) => {
|
|
1753
1755
|
const s = [
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1756
|
+
o.palette.info.main,
|
|
1757
|
+
o.palette.primary.main,
|
|
1758
|
+
o.palette.secondary.main,
|
|
1759
|
+
o.palette.success.main,
|
|
1760
|
+
o.palette.warning.main
|
|
1759
1761
|
], h = Math.min(s.length - 1, r), u = s[h], d = ue(u, 0.5), y = ue(u, 1);
|
|
1760
1762
|
return {
|
|
1761
1763
|
// 保留原有的边框样式
|
|
@@ -1768,33 +1770,33 @@ const Ne = (r, t) => (i) => {
|
|
|
1768
1770
|
...t
|
|
1769
1771
|
};
|
|
1770
1772
|
};
|
|
1771
|
-
function
|
|
1772
|
-
const { t: h, locale: u } = V(), d = ae(null), y =
|
|
1773
|
+
function Ct({ property: r, onChange: t, defaultLocale: o, allComponents: s }) {
|
|
1774
|
+
const { t: h, locale: u } = V(), d = ae(null), y = gt(d, r), m = K(() => {
|
|
1773
1775
|
if (!(r.type !== "json" && r.type !== "yaml" && r.type !== "array") && r.subProperties)
|
|
1774
1776
|
try {
|
|
1775
1777
|
let a = {};
|
|
1776
|
-
|
|
1777
|
-
if (!
|
|
1778
|
+
T(Object.values(r.subProperties), "index").filter((i) => i.data.visible !== !1 && i.data.key).forEach(({ data: i }) => {
|
|
1779
|
+
if (!i.key)
|
|
1778
1780
|
return;
|
|
1779
|
-
let n =
|
|
1780
|
-
if (
|
|
1781
|
+
let n = i.locales?.[u]?.defaultValue ?? i.locales?.[o]?.defaultValue;
|
|
1782
|
+
if (i.type === "number")
|
|
1781
1783
|
n = Number(n);
|
|
1782
|
-
else if (
|
|
1784
|
+
else if (i.type === "boolean")
|
|
1783
1785
|
n = n === !0 || n === "true";
|
|
1784
|
-
else if ((
|
|
1786
|
+
else if ((i.type === "json" || i.type === "yaml") && typeof n == "string")
|
|
1785
1787
|
try {
|
|
1786
|
-
|
|
1788
|
+
i.type === "json" ? n = JSON.parse(n) : n = he.parse(n);
|
|
1787
1789
|
} catch (p) {
|
|
1788
1790
|
console.error("Error parsing nested value", n, p), n = {};
|
|
1789
1791
|
}
|
|
1790
|
-
a[
|
|
1792
|
+
a[i.key] = n;
|
|
1791
1793
|
}), r.type === "array" && !Array.isArray(a) && (a = L(a) ? [] : [a]);
|
|
1792
1794
|
const l = xe(a, r.type);
|
|
1793
1795
|
t?.(l);
|
|
1794
1796
|
} catch (a) {
|
|
1795
1797
|
console.error("Error converting structure to text:", a);
|
|
1796
1798
|
}
|
|
1797
|
-
}, [r, u,
|
|
1799
|
+
}, [r, u, o, t]);
|
|
1798
1800
|
return r.type !== "json" && r.type !== "yaml" && r.type !== "array" ? null : /* @__PURE__ */ x(S, {
|
|
1799
1801
|
direction: "column",
|
|
1800
1802
|
ref: d,
|
|
@@ -1803,42 +1805,42 @@ function yt({ property: r, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
|
1803
1805
|
width: "100%"
|
|
1804
1806
|
},
|
|
1805
1807
|
children: [
|
|
1806
|
-
/* @__PURE__ */ e(
|
|
1808
|
+
/* @__PURE__ */ e(or, { sx: { mt: -1 }, children: /* @__PURE__ */ e(E, {
|
|
1807
1809
|
variant: "caption",
|
|
1808
1810
|
sx: {
|
|
1809
1811
|
color: "text.secondary"
|
|
1810
1812
|
},
|
|
1811
1813
|
children: h("maker.properties.subProperties")
|
|
1812
1814
|
}) }),
|
|
1813
|
-
r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ e(
|
|
1815
|
+
r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ e($e, {
|
|
1814
1816
|
component: S,
|
|
1815
1817
|
gap: 2,
|
|
1816
1818
|
list: r.subProperties,
|
|
1817
1819
|
renderItem: (a, c, l) => {
|
|
1818
|
-
const
|
|
1819
|
-
return /* @__PURE__ */ e(
|
|
1820
|
+
const i = a.visible !== !1, n = a.shared ?? !1;
|
|
1821
|
+
return /* @__PURE__ */ e(J, {
|
|
1820
1822
|
elevation: 0,
|
|
1821
1823
|
className: "property-container",
|
|
1822
1824
|
sx: {
|
|
1823
1825
|
p: 1.25,
|
|
1824
1826
|
borderRadius: 1,
|
|
1825
|
-
border:
|
|
1827
|
+
border: i ? "1px solid" : "1px dashed",
|
|
1826
1828
|
"&": Ne(y)
|
|
1827
1829
|
},
|
|
1828
1830
|
children: /* @__PURE__ */ e(S, {
|
|
1829
1831
|
sx: {
|
|
1830
1832
|
gap: 2
|
|
1831
1833
|
},
|
|
1832
|
-
children: /* @__PURE__ */ e(
|
|
1834
|
+
children: /* @__PURE__ */ e(Ye, {
|
|
1833
1835
|
data: a,
|
|
1834
1836
|
params: l,
|
|
1835
|
-
visible:
|
|
1837
|
+
visible: i,
|
|
1836
1838
|
shared: n,
|
|
1837
1839
|
config: {
|
|
1838
1840
|
properties: r.subProperties
|
|
1839
1841
|
},
|
|
1840
1842
|
currentLocale: u,
|
|
1841
|
-
defaultLocale:
|
|
1843
|
+
defaultLocale: o,
|
|
1842
1844
|
allComponents: s,
|
|
1843
1845
|
onUpdateConfig: (p) => {
|
|
1844
1846
|
try {
|
|
@@ -1857,8 +1859,8 @@ function yt({ property: r, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
|
1857
1859
|
})
|
|
1858
1860
|
}, a.id);
|
|
1859
1861
|
}
|
|
1860
|
-
}) : /* @__PURE__ */ e(
|
|
1861
|
-
/* @__PURE__ */ e(
|
|
1862
|
+
}) : /* @__PURE__ */ e(_, { style: { fontSize: 12, height: 100 }, children: h("maker.properties.noSubProperties") }),
|
|
1863
|
+
/* @__PURE__ */ e(D, {
|
|
1862
1864
|
fullWidth: !0,
|
|
1863
1865
|
variant: "outlined",
|
|
1864
1866
|
className: "ignore-style-override",
|
|
@@ -1866,7 +1868,7 @@ function yt({ property: r, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
|
1866
1868
|
startIcon: /* @__PURE__ */ e(Ue, {}),
|
|
1867
1869
|
onClick: () => {
|
|
1868
1870
|
try {
|
|
1869
|
-
const a = r.subProperties || {}, c = Je(),
|
|
1871
|
+
const a = r.subProperties || {}, c = Je(), i = {
|
|
1870
1872
|
index: Object.values(a).length,
|
|
1871
1873
|
data: {
|
|
1872
1874
|
id: c,
|
|
@@ -1887,7 +1889,7 @@ function yt({ property: r, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
|
1887
1889
|
...r,
|
|
1888
1890
|
subProperties: {
|
|
1889
1891
|
...a,
|
|
1890
|
-
[c]:
|
|
1892
|
+
[c]: i
|
|
1891
1893
|
}
|
|
1892
1894
|
};
|
|
1893
1895
|
t?.(n, { forceUpdateProperty: !0 }), m();
|
|
@@ -1905,29 +1907,29 @@ function yt({ property: r, onChange: t, defaultLocale: i, allComponents: s }) {
|
|
|
1905
1907
|
]
|
|
1906
1908
|
});
|
|
1907
1909
|
}
|
|
1908
|
-
function
|
|
1909
|
-
const { locale: m } = V(), a =
|
|
1910
|
+
function M({ component: r, property: t, value: o, onChange: s, valueImmutable: h, defaultLocale: u, allComponents: d, ...y }) {
|
|
1911
|
+
const { locale: m } = V(), a = hr(), c = ae(null), l = () => {
|
|
1910
1912
|
const n = a?.current?.getUploader();
|
|
1911
1913
|
n?.open(), c.current && n.onceUploadSuccess(({ response: p }) => {
|
|
1912
1914
|
let g = p?.data?.filename || "";
|
|
1913
|
-
g && (g = `mediakit://${g}`,
|
|
1915
|
+
g && (g = `mediakit://${g}`, o && !o.includes("mediakit://") && (g += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), c.current?.(g);
|
|
1914
1916
|
});
|
|
1915
|
-
},
|
|
1917
|
+
}, i = y.label ?? (t.locales?.[m]?.name || t.locales?.[u]?.name || t.key || t.id);
|
|
1916
1918
|
if (t.type === "number")
|
|
1917
|
-
return /* @__PURE__ */ e(
|
|
1919
|
+
return /* @__PURE__ */ e(Pt, {
|
|
1918
1920
|
...y,
|
|
1919
|
-
label:
|
|
1921
|
+
label: i,
|
|
1920
1922
|
NumberProps: {
|
|
1921
|
-
value: ["number", "string"].includes(typeof
|
|
1923
|
+
value: ["number", "string"].includes(typeof o) ? o : null,
|
|
1922
1924
|
onChange: (n, p) => s?.(p)
|
|
1923
1925
|
}
|
|
1924
1926
|
});
|
|
1925
1927
|
if (t.type === "decimal")
|
|
1926
1928
|
return /* @__PURE__ */ e(R, {
|
|
1927
1929
|
...y,
|
|
1928
|
-
label:
|
|
1930
|
+
label: i,
|
|
1929
1931
|
type: "text",
|
|
1930
|
-
value:
|
|
1932
|
+
value: o ?? "",
|
|
1931
1933
|
onChange: (n) => {
|
|
1932
1934
|
const p = n.target.value;
|
|
1933
1935
|
if (p === "" || p === "-") {
|
|
@@ -1942,22 +1944,22 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
1942
1944
|
});
|
|
1943
1945
|
if (t.type === "boolean")
|
|
1944
1946
|
return /* @__PURE__ */ e(le, {
|
|
1945
|
-
label:
|
|
1947
|
+
label: i,
|
|
1946
1948
|
labelPlacement: "start",
|
|
1947
|
-
control: /* @__PURE__ */ e(ye, { checked:
|
|
1949
|
+
control: /* @__PURE__ */ e(ye, { checked: o === !0, onChange: (n, p) => s?.(p) })
|
|
1948
1950
|
});
|
|
1949
1951
|
if (t.type === "color")
|
|
1950
|
-
return /* @__PURE__ */ e(
|
|
1951
|
-
label:
|
|
1952
|
-
value:
|
|
1952
|
+
return /* @__PURE__ */ e(it, {
|
|
1953
|
+
label: i,
|
|
1954
|
+
value: o,
|
|
1953
1955
|
onChange: (n) => {
|
|
1954
1956
|
s?.(n);
|
|
1955
1957
|
}
|
|
1956
1958
|
});
|
|
1957
1959
|
if (t.type === "json" || t.type === "yaml")
|
|
1958
|
-
return /* @__PURE__ */ e(
|
|
1959
|
-
label:
|
|
1960
|
-
value:
|
|
1960
|
+
return /* @__PURE__ */ e(lt, {
|
|
1961
|
+
label: i,
|
|
1962
|
+
value: o,
|
|
1961
1963
|
onChange: (n) => {
|
|
1962
1964
|
s?.(n);
|
|
1963
1965
|
},
|
|
@@ -1965,7 +1967,7 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
1965
1967
|
component: r,
|
|
1966
1968
|
defaultLocale: u,
|
|
1967
1969
|
allComponents: d,
|
|
1968
|
-
PropertyValueField:
|
|
1970
|
+
PropertyValueField: M,
|
|
1969
1971
|
onUpload: (n) => {
|
|
1970
1972
|
c.current = n, l();
|
|
1971
1973
|
}
|
|
@@ -1978,7 +1980,7 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
1978
1980
|
},
|
|
1979
1981
|
children: /* @__PURE__ */ e(Ke, {
|
|
1980
1982
|
componentId: n.id,
|
|
1981
|
-
props: { label:
|
|
1983
|
+
props: { label: i, value: o, onChange: s },
|
|
1982
1984
|
locale: m,
|
|
1983
1985
|
dev: {
|
|
1984
1986
|
mode: "draft",
|
|
@@ -1986,7 +1988,7 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
1986
1988
|
defaultLocale: u
|
|
1987
1989
|
}
|
|
1988
1990
|
})
|
|
1989
|
-
}) : /* @__PURE__ */ e(R, { ...y, label:
|
|
1991
|
+
}) : /* @__PURE__ */ e(R, { ...y, label: i, disabled: !0, placeholder: "Click right button select a component" });
|
|
1990
1992
|
}
|
|
1991
1993
|
if (t.type === "component")
|
|
1992
1994
|
return /* @__PURE__ */ x(S, {
|
|
@@ -1998,14 +2000,14 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
1998
2000
|
children: [
|
|
1999
2001
|
/* @__PURE__ */ e(Ie, {
|
|
2000
2002
|
allComponents: d,
|
|
2001
|
-
label:
|
|
2002
|
-
value:
|
|
2003
|
+
label: i,
|
|
2004
|
+
value: o?.componentId,
|
|
2003
2005
|
onChange: (n, p) => {
|
|
2004
|
-
h || !
|
|
2006
|
+
h || !o ? s?.({ ...o && JSON.parse(JSON.stringify(o)), componentId: p }) : typeof o == "object" && (o.componentId = p, s?.({ ...o && JSON.parse(JSON.stringify(o)), componentId: p }));
|
|
2005
2007
|
}
|
|
2006
2008
|
}),
|
|
2007
|
-
|
|
2008
|
-
value:
|
|
2009
|
+
o?.componentId && /* @__PURE__ */ e(xt, {
|
|
2010
|
+
value: o,
|
|
2009
2011
|
valueImmutable: h,
|
|
2010
2012
|
onChange: s,
|
|
2011
2013
|
defaultLocale: u,
|
|
@@ -2016,15 +2018,15 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
2016
2018
|
if (!t.type || ["string", "url", "multiline"].includes(t.type)) {
|
|
2017
2019
|
let n = t.type === "string" ? t.multiline : void 0;
|
|
2018
2020
|
t.type === "multiline" && (n = !0);
|
|
2019
|
-
const p = t.type === "url" ?
|
|
2021
|
+
const p = t.type === "url" ? o?.url : o;
|
|
2020
2022
|
return /* @__PURE__ */ e(R, {
|
|
2021
2023
|
...y,
|
|
2022
|
-
label:
|
|
2024
|
+
label: i,
|
|
2023
2025
|
value: typeof p == "string" ? p : "",
|
|
2024
2026
|
multiline: n,
|
|
2025
2027
|
minRows: n ? 2 : void 0,
|
|
2026
2028
|
maxRows: n ? 10 : void 0,
|
|
2027
|
-
onChange: (g) => s?.(t.type === "url" ? { ...
|
|
2029
|
+
onChange: (g) => s?.(t.type === "url" ? { ...o, url: g.target.value, mediaKitUrl: g.target.value } : g.target.value),
|
|
2028
2030
|
slotProps: {
|
|
2029
2031
|
input: t.type === "url" ? {
|
|
2030
2032
|
sx: {
|
|
@@ -2060,9 +2062,9 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
2060
2062
|
}
|
|
2061
2063
|
});
|
|
2062
2064
|
}
|
|
2063
|
-
return t.type === "array" ? /* @__PURE__ */ e(
|
|
2064
|
-
label:
|
|
2065
|
-
value: Array.isArray(
|
|
2065
|
+
return t.type === "array" ? /* @__PURE__ */ e(nt, {
|
|
2066
|
+
label: i,
|
|
2067
|
+
value: Array.isArray(o) ? o : [],
|
|
2066
2068
|
onChange: (n) => s?.(n),
|
|
2067
2069
|
property: t,
|
|
2068
2070
|
renderItem: ({ item: n, index: p, onChange: g }) => t.subProperties && Object.keys(t.subProperties).length > 0 ? /* @__PURE__ */ e(S, {
|
|
@@ -2070,7 +2072,7 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
2070
2072
|
gap: 1,
|
|
2071
2073
|
width: "100%"
|
|
2072
2074
|
},
|
|
2073
|
-
children:
|
|
2075
|
+
children: T(Object.values(t.subProperties), "index").filter((f) => f.data.visible !== !1).map(({ data: f }) => f.key ? /* @__PURE__ */ e(M, {
|
|
2074
2076
|
component: r,
|
|
2075
2077
|
property: f,
|
|
2076
2078
|
value: n[f.key],
|
|
@@ -2086,8 +2088,8 @@ function F({ component: r, property: t, value: i, onChange: s, valueImmutable: h
|
|
|
2086
2088
|
}, p) : /* @__PURE__ */ e(R, { size: y.size, fullWidth: !0, value: n, onChange: (f) => g(f.target.value) })
|
|
2087
2089
|
}) : (console.error("Unsupported property type", t.type), null);
|
|
2088
2090
|
}
|
|
2089
|
-
function
|
|
2090
|
-
const { getInputProps:
|
|
2091
|
+
function Pt({ NumberProps: r, ...t }) {
|
|
2092
|
+
const { getInputProps: o } = Cr(r), s = o();
|
|
2091
2093
|
return /* @__PURE__ */ e(R, {
|
|
2092
2094
|
...t,
|
|
2093
2095
|
slotProps: {
|
|
@@ -2095,7 +2097,7 @@ function vt({ NumberProps: r, ...t }) {
|
|
|
2095
2097
|
}
|
|
2096
2098
|
});
|
|
2097
2099
|
}
|
|
2098
|
-
const
|
|
2100
|
+
const kt = `import React from '@blocklet/pages-kit/builtin/react'
|
|
2099
2101
|
import { Box } from '@blocklet/pages-kit/builtin/mui/material'
|
|
2100
2102
|
|
|
2101
2103
|
export default function () {
|
|
@@ -2104,14 +2106,14 @@ export default function () {
|
|
|
2104
2106
|
Hello World
|
|
2105
2107
|
</Box>
|
|
2106
2108
|
)
|
|
2107
|
-
}`,
|
|
2109
|
+
}`, wt = `console.log('hello')
|
|
2108
2110
|
`;
|
|
2109
|
-
function
|
|
2110
|
-
const { locale: t } = V(),
|
|
2111
|
-
return
|
|
2111
|
+
function St({ value: r }) {
|
|
2112
|
+
const { locale: t } = V(), o = Te(), s = Y(r).doc;
|
|
2113
|
+
return G(() => {
|
|
2112
2114
|
r.renderer?.script || (s.transact(() => {
|
|
2113
|
-
r.renderer.script = r.renderer.type === "react-component" ?
|
|
2114
|
-
}),
|
|
2115
|
+
r.renderer.script = r.renderer.type === "react-component" ? kt : wt;
|
|
2116
|
+
}), o());
|
|
2115
2117
|
}, [r]), /* @__PURE__ */ e(w, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ e(Pe, {
|
|
2116
2118
|
keyId: r.id,
|
|
2117
2119
|
locale: t,
|
|
@@ -2124,8 +2126,8 @@ function Pt({ value: r }) {
|
|
|
2124
2126
|
}
|
|
2125
2127
|
}, r.id) });
|
|
2126
2128
|
}
|
|
2127
|
-
function
|
|
2128
|
-
const { t } = V(),
|
|
2129
|
+
function It({ value: r }) {
|
|
2130
|
+
const { t } = V(), o = Y(r).doc, { state: { components: s, config: { defaultLocale: h }, resources: u }, localState: { currentLocale: d } } = se(), y = Ce(), m = s[r.renderer.componentId]?.data ?? u.components?.[r.renderer.componentId]?.component, a = we({ variant: "dialog" });
|
|
2129
2131
|
return /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ x(S, {
|
|
2130
2132
|
sx: {
|
|
2131
2133
|
gap: 1
|
|
@@ -2145,33 +2147,33 @@ function kt({ value: r }) {
|
|
|
2145
2147
|
alignItems: "center"
|
|
2146
2148
|
},
|
|
2147
2149
|
children: [
|
|
2148
|
-
/* @__PURE__ */ e(
|
|
2149
|
-
/* @__PURE__ */ e(
|
|
2150
|
+
/* @__PURE__ */ e(E, { variant: "subtitle2", children: t("parameters") }),
|
|
2151
|
+
/* @__PURE__ */ e(D, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Se(a), children: /* @__PURE__ */ e(Le, { fontSize: "small" }) })
|
|
2150
2152
|
]
|
|
2151
2153
|
}),
|
|
2152
|
-
m.properties &&
|
|
2154
|
+
m.properties && T(Object.values(m.properties), "index").map(({ data: c }) => /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(M, {
|
|
2153
2155
|
allComponents: y,
|
|
2154
2156
|
defaultLocale: h,
|
|
2155
2157
|
component: m,
|
|
2156
2158
|
property: c,
|
|
2157
2159
|
fullWidth: !0,
|
|
2158
2160
|
size: "small",
|
|
2159
|
-
valueImmutable:
|
|
2161
|
+
valueImmutable: ie(r.renderer.properties?.[c.id]?.locales?.[d]?.value),
|
|
2160
2162
|
value: r.renderer.properties?.[c.id]?.locales?.[d]?.value ?? r.renderer.properties?.[c.id]?.locales?.[h]?.value ?? c.locales?.[d]?.defaultValue ?? c.locales?.[h]?.defaultValue,
|
|
2161
2163
|
onChange: (l) => {
|
|
2162
|
-
|
|
2164
|
+
o.transact(() => {
|
|
2163
2165
|
r.renderer.properties ??= {}, r.renderer.properties[c.id] ??= {}, r.renderer.properties[c.id].locales ??= {}, r.renderer.properties[c.id].locales[d] ??= {}, r.renderer.properties[c.id].locales[d].value = l;
|
|
2164
2166
|
});
|
|
2165
2167
|
}
|
|
2166
2168
|
}) }, c.id)),
|
|
2167
|
-
/* @__PURE__ */ e(
|
|
2169
|
+
/* @__PURE__ */ e(qe, { ...He(a), component: r, type: "parameters" })
|
|
2168
2170
|
] })
|
|
2169
2171
|
]
|
|
2170
2172
|
}) });
|
|
2171
2173
|
}
|
|
2172
|
-
function Ie({ label: r, options: t, excludes:
|
|
2173
|
-
const { t: y } = V(), m = t ??
|
|
2174
|
-
return /* @__PURE__ */ e(
|
|
2174
|
+
function Ie({ label: r, options: t, excludes: o, value: s, onChange: h, allComponents: u, ...d }) {
|
|
2175
|
+
const { t: y } = V(), m = t ?? T(Object.values(Kr(u, ...o ?? [])), "index").map((c) => c.data), a = (typeof s == "string" ? u[s]?.data : void 0) ?? null;
|
|
2176
|
+
return /* @__PURE__ */ e(Ee, {
|
|
2175
2177
|
...d,
|
|
2176
2178
|
size: "small",
|
|
2177
2179
|
options: m,
|
|
@@ -2182,55 +2184,55 @@ function Ie({ label: r, options: t, excludes: i, value: s, onChange: h, allCompo
|
|
|
2182
2184
|
renderInput: (c) => /* @__PURE__ */ e(R, { label: r || y("component"), ...c }),
|
|
2183
2185
|
value: a,
|
|
2184
2186
|
onChange: (c, l) => {
|
|
2185
|
-
let
|
|
2186
|
-
l && (
|
|
2187
|
+
let i = {};
|
|
2188
|
+
l && (i = {
|
|
2187
2189
|
blockletId: u[l?.id]?.blockletId,
|
|
2188
2190
|
blockletTitle: u[l?.id]?.blockletTitle,
|
|
2189
2191
|
componentName: u[l?.id]?.data?.name || u[l?.id]?.data?.id
|
|
2190
|
-
}), h?.(c, l?.id,
|
|
2192
|
+
}), h?.(c, l?.id, i);
|
|
2191
2193
|
}
|
|
2192
2194
|
});
|
|
2193
2195
|
}
|
|
2194
|
-
function
|
|
2195
|
-
const { t: y } = V(), [m, a] = W(fe(r?.properties)), [c, l] = W(null), [
|
|
2196
|
-
|
|
2196
|
+
function Qe({ config: r, allComponents: t, defaultLocale: o, propertiesValue: s, currentLocale: h, onChange: u, props: d }) {
|
|
2197
|
+
const { t: y } = V(), [m, a] = W(fe(r?.properties)), [c, l] = W(null), [i, n] = W(!1);
|
|
2198
|
+
Fe(() => {
|
|
2197
2199
|
(() => {
|
|
2198
|
-
r?.renderer?.type === "react-component" && L(r?.properties) ?
|
|
2199
|
-
const z =
|
|
2200
|
+
r?.renderer?.type === "react-component" && L(r?.properties) ? br(r?.renderer?.script).then((N) => {
|
|
2201
|
+
const z = gr(N);
|
|
2200
2202
|
a(z);
|
|
2201
2203
|
}) : a(fe(r?.properties));
|
|
2202
2204
|
})();
|
|
2203
|
-
}, [
|
|
2204
|
-
const p =
|
|
2205
|
+
}, [r]);
|
|
2206
|
+
const p = yr(() => !r || !m ? {} : Object.values(m).reduce((v, { data: N }) => {
|
|
2205
2207
|
const z = N.key || N.id;
|
|
2206
2208
|
return v[N.id] = {
|
|
2207
2209
|
key: z,
|
|
2208
|
-
value: d?.[z] ?? s?.[N.id]?.value ?? N.locales?.[h]?.defaultValue ?? N.locales?.[
|
|
2210
|
+
value: d?.[z] ?? s?.[N.id]?.value ?? N.locales?.[h]?.defaultValue ?? N.locales?.[o]?.defaultValue,
|
|
2209
2211
|
id: N.id,
|
|
2210
2212
|
type: N.type,
|
|
2211
|
-
visible:
|
|
2212
|
-
shared:
|
|
2213
|
+
visible: Z(m, N.id),
|
|
2214
|
+
shared: Ge(m, N.id)
|
|
2213
2215
|
}, v;
|
|
2214
|
-
}, {}), [
|
|
2216
|
+
}, {}), [m, r, s, h, o]), g = vr(() => {
|
|
2215
2217
|
if (!m)
|
|
2216
2218
|
return {
|
|
2217
2219
|
canUseProperties: [],
|
|
2218
2220
|
visibleProperties: [],
|
|
2219
2221
|
canUsePropertiesKeys: []
|
|
2220
2222
|
};
|
|
2221
|
-
const v =
|
|
2223
|
+
const v = T(Object.values(m), "index"), N = v.filter(({ data: I }) => I.key && Z(m, I.id)), z = v.filter(({ data: I }) => I.key && I.type !== "component"), P = z.map(({ data: I }) => I.key);
|
|
2222
2224
|
return {
|
|
2223
2225
|
canUseProperties: z,
|
|
2224
2226
|
visibleProperties: N,
|
|
2225
2227
|
canUsePropertiesKeys: P
|
|
2226
2228
|
};
|
|
2227
|
-
}, [
|
|
2229
|
+
}, [m]), f = p(), k = Wr(f, "key");
|
|
2228
2230
|
return /* @__PURE__ */ e(ce, { children: /* @__PURE__ */ x(S, {
|
|
2229
2231
|
sx: {
|
|
2230
2232
|
gap: 2
|
|
2231
2233
|
},
|
|
2232
2234
|
children: [
|
|
2233
|
-
/* @__PURE__ */ x(
|
|
2235
|
+
/* @__PURE__ */ x(E, {
|
|
2234
2236
|
variant: "subtitle1",
|
|
2235
2237
|
sx: {
|
|
2236
2238
|
display: "flex",
|
|
@@ -2242,36 +2244,36 @@ function qe({ config: r, allComponents: t, defaultLocale: i, propertiesValue: s,
|
|
|
2242
2244
|
/* @__PURE__ */ e(le, {
|
|
2243
2245
|
control: /* @__PURE__ */ e(ye, {
|
|
2244
2246
|
size: "small",
|
|
2245
|
-
checked:
|
|
2247
|
+
checked: i,
|
|
2246
2248
|
onChange: (v) => n(v.target.checked)
|
|
2247
2249
|
}),
|
|
2248
|
-
label: /* @__PURE__ */ e(
|
|
2250
|
+
label: /* @__PURE__ */ e(E, { variant: "caption", children: y("maker.properties.forceSyncToAllLanguages") }),
|
|
2249
2251
|
sx: {
|
|
2250
2252
|
mr: 0
|
|
2251
2253
|
}
|
|
2252
2254
|
})
|
|
2253
2255
|
]
|
|
2254
2256
|
}),
|
|
2255
|
-
!r || g.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ e(
|
|
2257
|
+
!r || g.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ e(_, { style: { fontSize: 12 }, children: y("maker.properties.noParameters") }) : /* @__PURE__ */ x(U, { children: [
|
|
2256
2258
|
/* @__PURE__ */ e(S, {
|
|
2257
2259
|
sx: {
|
|
2258
2260
|
gap: 2
|
|
2259
2261
|
},
|
|
2260
|
-
children: g.visibleProperties.map(({ data: v }) => /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
|
|
2262
|
+
children: g.visibleProperties.map(({ data: v }) => /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(M, {
|
|
2261
2263
|
allComponents: t,
|
|
2262
|
-
defaultLocale:
|
|
2264
|
+
defaultLocale: o,
|
|
2263
2265
|
size: "small",
|
|
2264
2266
|
fullWidth: !0,
|
|
2265
2267
|
component: r,
|
|
2266
2268
|
property: v,
|
|
2267
|
-
valueImmutable:
|
|
2269
|
+
valueImmutable: ie(s?.[v.id]?.value),
|
|
2268
2270
|
value: d?.[v.key || v.id] ?? f[v.id]?.value,
|
|
2269
2271
|
onChange: (N) => {
|
|
2270
2272
|
u({
|
|
2271
2273
|
path: ["properties", v.id],
|
|
2272
2274
|
id: v.id,
|
|
2273
2275
|
value: { value: N },
|
|
2274
|
-
shouldSync:
|
|
2276
|
+
shouldSync: i ? !0 : Oe(v),
|
|
2275
2277
|
excludeKeys: [],
|
|
2276
2278
|
key: v.key || v.id
|
|
2277
2279
|
});
|
|
@@ -2288,19 +2290,19 @@ function qe({ config: r, allComponents: t, defaultLocale: i, propertiesValue: s,
|
|
|
2288
2290
|
renderType: "setting",
|
|
2289
2291
|
locale: h,
|
|
2290
2292
|
properties: f,
|
|
2291
|
-
dev: { mode: "draft", components: t, defaultLocale:
|
|
2293
|
+
dev: { mode: "draft", components: t, defaultLocale: o },
|
|
2292
2294
|
props: {
|
|
2293
|
-
...
|
|
2295
|
+
...Lr(d ?? {}, g.canUsePropertiesKeys),
|
|
2294
2296
|
onChange: (v) => {
|
|
2295
2297
|
const { canUsePropertiesKeys: N } = g;
|
|
2296
|
-
Object.keys(v).filter((P) => !
|
|
2298
|
+
Object.keys(v).filter((P) => !Er(v[P], k?.[P]?.value)).filter((P) => !(P === "locale" && !Dr(k[P], "locale") || k[P]?.type === "component" || (k[P]?.type === "yaml" || k[P]?.type === "json") && Z(m, k[P]?.id))).reduce((P, I) => P.then(() => {
|
|
2297
2299
|
const b = k[I], C = N.includes(I);
|
|
2298
2300
|
if (b?.id && C)
|
|
2299
2301
|
return u({
|
|
2300
2302
|
path: ["properties", b.id],
|
|
2301
2303
|
id: b.id,
|
|
2302
2304
|
value: { value: v[I] },
|
|
2303
|
-
shouldSync:
|
|
2305
|
+
shouldSync: i ? !0 : Oe(b),
|
|
2304
2306
|
excludeKeys: [],
|
|
2305
2307
|
key: b.key || b.id
|
|
2306
2308
|
}), Promise.resolve();
|
|
@@ -2323,31 +2325,31 @@ function qe({ config: r, allComponents: t, defaultLocale: i, propertiesValue: s,
|
|
|
2323
2325
|
]
|
|
2324
2326
|
}, h) });
|
|
2325
2327
|
}
|
|
2326
|
-
function
|
|
2327
|
-
const { t, locale:
|
|
2328
|
+
function Ot({ config: r }) {
|
|
2329
|
+
const { t, locale: o } = V(), [s, h] = W(!1), u = (d) => {
|
|
2328
2330
|
r.llmConfig = d;
|
|
2329
2331
|
};
|
|
2330
2332
|
return /* @__PURE__ */ x(U, { children: [
|
|
2331
|
-
/* @__PURE__ */ e(B, { title: t("maker.properties.configLLMDescription"), children: /* @__PURE__ */ e(
|
|
2332
|
-
s && /* @__PURE__ */ e(
|
|
2333
|
+
/* @__PURE__ */ e(B, { title: t("maker.properties.configLLMDescription"), children: /* @__PURE__ */ e($, { color: "primary", onClick: () => h(!0), size: "small", children: /* @__PURE__ */ e(zr, {}) }) }),
|
|
2334
|
+
s && /* @__PURE__ */ e(pt, {
|
|
2333
2335
|
open: s,
|
|
2334
2336
|
onClose: () => h(!1),
|
|
2335
2337
|
onConfirm: u,
|
|
2336
2338
|
component: r,
|
|
2337
2339
|
initialConfig: r.llmConfig,
|
|
2338
|
-
locale:
|
|
2340
|
+
locale: o,
|
|
2339
2341
|
defaultLocale: "en",
|
|
2340
2342
|
title: t("maker.properties.llmConfigTitle")
|
|
2341
2343
|
})
|
|
2342
2344
|
] });
|
|
2343
2345
|
}
|
|
2344
2346
|
export {
|
|
2345
|
-
|
|
2347
|
+
bt as BasicInfo,
|
|
2346
2348
|
Ie as CustomComponentAutocomplete,
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2350
|
-
|
|
2351
|
-
|
|
2352
|
-
|
|
2349
|
+
vn as CustomComponentSettings,
|
|
2350
|
+
kt as DefaultReactComponentScriptTemplate,
|
|
2351
|
+
wt as DefaultWebComponentScriptTemplate,
|
|
2352
|
+
Qe as ParametersConfig,
|
|
2353
|
+
yt as PropertiesConfig,
|
|
2354
|
+
M as PropertyValueField
|
|
2353
2355
|
};
|