@blocklet/pages-kit-inner-components 0.5.41 → 0.5.43

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