@blocklet/pages-kit-inner-components 0.4.85 → 0.4.86

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