@blocklet/pages-kit-inner-components 0.4.43 → 0.4.44

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,5 +1,5 @@
1
1
  import { jsx as t, jsxs as S, Fragment as $ } from "react/jsx-runtime";
2
- import { t as ge, g as ne, i as _e, b as Je, h as de, E as gt, n as $e, j as xe } from "./_chunks/state-kKXkQecK.js";
2
+ import { t as ge, g as ne, i as _e, b as Je, h as de, E as gt, n as $e, j as xe } from "./_chunks/state-DqChB5ys.js";
3
3
  import te from "@arcblock/ux/lib/Empty";
4
4
  import { useLocaleContext as A } from "@arcblock/ux/lib/Locale/context";
5
5
  import { CodeEditor as ke } from "@blocklet/code-editor";
@@ -7,17 +7,17 @@ import xt from "@mui/icons-material/AddRounded";
7
7
  import kt from "@mui/icons-material/ArrowDownward";
8
8
  import wt from "@mui/icons-material/ArrowUpward";
9
9
  import Pt from "@mui/icons-material/DeleteOutline";
10
- import { Typography as F, TextField as D, Stack as j, FormLabel as oe, Box as O, TableContainer as It, Paper as re, Table as He, TableHead as Me, TableRow as se, TableCell as ce, TableBody as Ye, Button as V, IconButton as we, FormControlLabel as Ge, Switch as qe, InputAdornment as ue, Dialog as Pe, DialogTitle as Le, DialogContent as Qe, DialogActions as Xe, alpha as St, Tooltip as X, buttonClasses as Ot, Autocomplete as Ze, MenuItem as he, Popper as et, Divider as Ct } from "@mui/material";
11
- import T from "lodash/sortBy";
12
- import { useCallback as N, useMemo as ae, forwardRef as tt, useState as Z, useEffect as H, useImperativeHandle as rt, lazy as jt, Suspense as zt, useRef as J, useId as Rt } from "react";
10
+ import { Typography as F, TextField as D, Stack as j, FormLabel as oe, Box as O, TableContainer as It, Paper as re, Table as Me, TableHead as He, TableRow as se, TableCell as ce, TableBody as Ye, Button as T, IconButton as we, FormControlLabel as Ge, Switch as Le, InputAdornment as ue, Dialog as Pe, DialogTitle as qe, DialogContent as Qe, DialogActions as Xe, alpha as St, Tooltip as X, buttonClasses as Ot, Autocomplete as Ze, MenuItem as he, Popper as et, Divider as Ct } from "@mui/material";
11
+ import V from "lodash/sortBy";
12
+ import { useCallback as N, useMemo as ae, forwardRef as tt, useState as Z, useEffect as M, useImperativeHandle as rt, lazy as jt, Suspense as zt, useRef as J, useId as Rt } from "react";
13
13
  import { useUpdate as it, useDebounce as Dt } from "react-use";
14
14
  import { styled as At } from "@arcblock/ux/lib/Theme";
15
15
  import { cx as Nt } from "@emotion/css";
16
- import { useReactive as Vt, useBoolean as Tt, useUpdate as Et } from "ahooks";
16
+ import { useReactive as Tt, useBoolean as Vt, useUpdate as Et } from "ahooks";
17
17
  import Ue 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 Ht, lime as Mt, yellow as Yt, amber as Gt, orange as qt, brown as Lt, grey as Qt, blueGrey as Xt } from "@mui/material/colors";
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 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 be, UploaderButton as Ie, UploaderProvider as Se, useUploader as Zt } from "./uploader.js";
22
22
  import { Icon as er } from "@iconify-icon/react";
23
23
  import lt from "lodash/isEmpty";
@@ -29,7 +29,7 @@ import { CustomComponentRenderer as ot, transpileAndLoadScript as tr, getPropert
29
29
  import { unstable_useNumberInput as ir, ClickAwayListener as st } from "@mui/base";
30
30
  import { VisibilityOffRounded as lr, VisibilityRounded as nr, DeleteOutlineRounded as or, DragIndicatorRounded as sr, TranslateRounded as ct, AddRounded as at, InfoRounded as dt, StarRounded as cr, SettingsRounded as ut } from "@mui/icons-material";
31
31
  import { alpha as Be } from "@mui/material/styles";
32
- import { getYjsValue as M } from "@syncedstore/core";
32
+ import { getYjsValue as H } from "@syncedstore/core";
33
33
  import ar from "lodash/assign";
34
34
  import dr from "lodash/has";
35
35
  import ee from "lodash/isNil";
@@ -43,52 +43,52 @@ import { ErrorBoundary as br } from "react-error-boundary";
43
43
  import { useDrop as ht, useDrag as yr } from "react-dnd";
44
44
  function vr({
45
45
  onClick: e,
46
- disabled: i,
46
+ disabled: r,
47
47
  sx: l,
48
- ...r
48
+ ...i
49
49
  }) {
50
- return /* @__PURE__ */ t(we, { size: "small", color: "warning", variant: "outlined", disabled: i, onClick: e, ...r, children: /* @__PURE__ */ t(Pt, { fontSize: "small" }) });
50
+ return /* @__PURE__ */ t(we, { size: "small", color: "warning", variant: "outlined", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(Pt, { fontSize: "small" }) });
51
51
  }
52
52
  function gr({
53
53
  onClick: e,
54
- disabled: i,
54
+ disabled: r,
55
55
  sx: l,
56
- ...r
56
+ ...i
57
57
  }) {
58
- return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled: i, onClick: e, ...r, children: /* @__PURE__ */ t(wt, { fontSize: "small" }) });
58
+ return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(wt, { fontSize: "small" }) });
59
59
  }
60
60
  function xr({
61
61
  onClick: e,
62
- disabled: i,
62
+ disabled: r,
63
63
  sx: l,
64
- ...r
64
+ ...i
65
65
  }) {
66
- return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled: i, onClick: e, ...r, children: /* @__PURE__ */ t(kt, { fontSize: "small" }) });
66
+ return /* @__PURE__ */ t(we, { size: "small", color: "primary", disabled: r, onClick: e, ...i, children: /* @__PURE__ */ t(kt, { fontSize: "small" }) });
67
67
  }
68
68
  function kr({
69
69
  label: e,
70
- value: i,
70
+ value: r,
71
71
  onChange: l,
72
- disabled: r = !1,
73
- itemLabel: a = "",
74
- emptyHeight: f = 40,
75
- property: d,
72
+ disabled: i = !1,
73
+ itemLabel: u = "",
74
+ emptyHeight: m = 40,
75
+ property: a,
76
76
  renderItem: p,
77
77
  ...k
78
78
  }) {
79
- const { t: m, locale: x } = A(), b = it(), n = N(
79
+ const { t: h, locale: x } = A(), b = it(), n = N(
80
80
  (y) => {
81
- l(ge(y, d.type));
81
+ l(ge(y, a.type));
82
82
  },
83
- [l, d.type]
84
- ), o = ae(() => Array.isArray(i) ? i : [], [i]), s = N(() => {
83
+ [l, a.type]
84
+ ), o = ae(() => Array.isArray(r) ? r : [], [r]), s = N(() => {
85
85
  const y = [...o, ""];
86
86
  n(y), b();
87
- }, [o, n, b]), u = N(() => {
88
- if (!d || !d.subProperties)
87
+ }, [o, n, b]), d = N(() => {
88
+ if (!a || !a.subProperties)
89
89
  return s();
90
90
  const y = {};
91
- T(Object.values(d.subProperties), "index").forEach(({ data: R }) => {
91
+ V(Object.values(a.subProperties), "index").forEach(({ data: R }) => {
92
92
  var U, W;
93
93
  if (!R.key) return;
94
94
  const E = ((W = (U = R.locales) == null ? void 0 : U[x]) == null ? void 0 : W.defaultValue) ?? "";
@@ -96,7 +96,7 @@ function kr({
96
96
  });
97
97
  const z = [...o, y];
98
98
  n(z), b();
99
- }, [o, n, b, d, x, s]), h = N(
99
+ }, [o, n, b, a, x, s]), f = N(
100
100
  (y) => {
101
101
  try {
102
102
  const I = JSON.parse(y);
@@ -132,7 +132,7 @@ function kr({
132
132
  z[y] = I, n(z);
133
133
  },
134
134
  [o, n]
135
- ), P = d && d.subProperties && Object.keys(d.subProperties).length > 0, C = ae(() => [
135
+ ), P = a && a.subProperties && Object.keys(a.subProperties).length > 0, C = ae(() => [
136
136
  {
137
137
  field: "index",
138
138
  headerName: "#",
@@ -162,16 +162,16 @@ function kr({
162
162
  renderCell: ({ row: y, index: I }) => p && P ? p({
163
163
  item: y,
164
164
  index: I,
165
- property: d,
165
+ property: a,
166
166
  onChange: (z) => g(I, z)
167
167
  }) : /* @__PURE__ */ t(
168
168
  D,
169
169
  {
170
170
  fullWidth: !0,
171
171
  size: "small",
172
- disabled: r,
172
+ disabled: i,
173
173
  value: y,
174
- placeholder: a || `${m("item")} ${I + 1}`,
174
+ placeholder: u || `${h("item")} ${I + 1}`,
175
175
  onChange: (z) => g(I, z.target.value),
176
176
  ...k
177
177
  }
@@ -184,25 +184,25 @@ function kr({
184
184
  // 增加宽度以容纳更多按钮
185
185
  align: "center",
186
186
  renderCell: ({ index: y }) => /* @__PURE__ */ S(j, { direction: "column", spacing: 0.25, children: [
187
- /* @__PURE__ */ t(gr, { disabled: r || y === 0, onClick: () => c(y) }),
187
+ /* @__PURE__ */ t(gr, { disabled: i || y === 0, onClick: () => c(y) }),
188
188
  /* @__PURE__ */ t(
189
189
  xr,
190
190
  {
191
- disabled: r || y === o.length - 1,
191
+ disabled: i || y === o.length - 1,
192
192
  onClick: () => v(y)
193
193
  }
194
194
  ),
195
- /* @__PURE__ */ t(vr, { disabled: r, onClick: () => w(y) })
195
+ /* @__PURE__ */ t(vr, { disabled: i, onClick: () => w(y) })
196
196
  ] })
197
197
  }
198
198
  ], [
199
199
  p,
200
200
  P,
201
- d,
202
- g,
203
201
  a,
204
- m,
205
- r,
202
+ g,
203
+ u,
204
+ h,
205
+ i,
206
206
  k,
207
207
  w,
208
208
  c,
@@ -212,7 +212,7 @@ function kr({
212
212
  return P ? /* @__PURE__ */ S(j, { width: "100%", gap: 1, children: [
213
213
  e && /* @__PURE__ */ t(oe, { children: e }),
214
214
  o.length > 0 ? /* @__PURE__ */ t(It, { component: re, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ S(
215
- He,
215
+ Me,
216
216
  {
217
217
  size: "small",
218
218
  sx: {
@@ -229,7 +229,7 @@ function kr({
229
229
  borderCollapse: "collapse"
230
230
  },
231
231
  children: [
232
- /* @__PURE__ */ t(Me, { sx: { display: "none" }, children: /* @__PURE__ */ t(se, { children: C.map((y) => /* @__PURE__ */ t(
232
+ /* @__PURE__ */ t(He, { sx: { display: "none" }, children: /* @__PURE__ */ t(se, { children: C.map((y) => /* @__PURE__ */ t(
233
233
  ce,
234
234
  {
235
235
  width: y.width,
@@ -270,17 +270,17 @@ function kr({
270
270
  )) })
271
271
  ]
272
272
  }
273
- ) }) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: f }, children: m("maker.properties.arrayEmpty") }),
273
+ ) }) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: m }, children: h("maker.properties.arrayEmpty") }),
274
274
  /* @__PURE__ */ t(
275
- V,
275
+ T,
276
276
  {
277
277
  fullWidth: !0,
278
278
  size: "small",
279
279
  variant: "outlined",
280
- disabled: r,
280
+ disabled: i,
281
281
  startIcon: /* @__PURE__ */ t(xt, {}),
282
- onClick: u,
283
- children: m("maker.properties.addArrayItem")
282
+ onClick: d,
283
+ children: h("maker.properties.addArrayItem")
284
284
  }
285
285
  )
286
286
  ] }) : /* @__PURE__ */ S(j, { width: "100%", gap: 1, children: [
@@ -288,61 +288,61 @@ function kr({
288
288
  /* @__PURE__ */ t(O, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ t(
289
289
  ke,
290
290
  {
291
- keyId: d.id,
291
+ keyId: a.id,
292
292
  locale: x,
293
293
  language: "json",
294
294
  value: JSON.stringify(o, null, 2),
295
- onChange: (y) => h(y || "")
295
+ onChange: (y) => f(y || "")
296
296
  },
297
- d.id
297
+ a.id
298
298
  ) })
299
299
  ] });
300
300
  }
301
301
  Wt[300], Bt[300], Kt[300], // deepPurple['300'],
302
302
  Ft[300], _t[300], // lightBlue['300'],
303
- Jt[300], $t[300], Ht[300], // lightGreen['300'],
304
- Mt[300], Yt[300], Gt[300], qt[300], // deepOrange['300'],
305
- Lt[300], Qt[300], Xt[300];
306
- const wr = tt(function({ showMarkdown: i, markdown: l, onMarkdownChange: r, showUploader: a, value: f, meta: d, onChange: p, ...k }, m) {
303
+ Jt[300], $t[300], Mt[300], // lightGreen['300'],
304
+ Ht[300], Yt[300], Gt[300], Lt[300], // deepOrange['300'],
305
+ qt[300], Qt[300], Xt[300];
306
+ const wr = tt(function({ showMarkdown: r, markdown: l, onMarkdownChange: i, showUploader: u, value: m, meta: a, onChange: p, ...k }, h) {
307
307
  const [x, b] = Z("");
308
- H(() => {
309
- b(f || "");
310
- }, [f, b]);
308
+ M(() => {
309
+ b(m || "");
310
+ }, [m, b]);
311
311
  const n = async () => {
312
- if (x !== f) {
312
+ if (x !== m) {
313
313
  const s = ne(x);
314
314
  if (!s) {
315
315
  p(x, void 0);
316
316
  return;
317
317
  }
318
- const u = await fe(s).catch(() => be(s)).catch(() => {
318
+ const d = await fe(s).catch(() => be(s)).catch(() => {
319
319
  });
320
- p(x, { ...u, filename: x });
320
+ p(x, { ...d, filename: x });
321
321
  }
322
322
  };
323
323
  Dt(
324
324
  () => {
325
- x !== f && p(x);
325
+ x !== m && p(x);
326
326
  },
327
327
  300,
328
328
  [x]
329
- ), rt(m, () => ({
329
+ ), rt(h, () => ({
330
330
  submit: n
331
331
  }));
332
332
  const o = {};
333
- return a && (o.InputProps = {
333
+ return u && (o.InputProps = {
334
334
  sx: { pr: 0 },
335
335
  endAdornment: /* @__PURE__ */ t(ue, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ t(
336
336
  Ie,
337
337
  {
338
338
  onChange: async ({ response: s }) => {
339
339
  var c;
340
- const u = (c = s == null ? void 0 : s.data) == null ? void 0 : c.filename, h = ne(u) || "";
340
+ const d = (c = s == null ? void 0 : s.data) == null ? void 0 : c.filename, f = ne(d) || "";
341
341
  let w = {};
342
- h && (w = await fe(h).catch(() => be(h)).catch(() => {
343
- })), p(u, {
342
+ f && (w = await fe(f).catch(() => be(f)).catch(() => {
343
+ })), p(d, {
344
344
  ...w,
345
- filename: u
345
+ filename: d
346
346
  });
347
347
  }
348
348
  }
@@ -355,7 +355,7 @@ const wr = tt(function({ showMarkdown: i, markdown: l, onMarkdownChange: r, show
355
355
  ...k,
356
356
  label: /* @__PURE__ */ S(j, { direction: "row", spacing: 1, alignItems: "center", children: [
357
357
  k.label,
358
- i && /* @__PURE__ */ S($, { children: [
358
+ r && /* @__PURE__ */ S($, { children: [
359
359
  " (",
360
360
  /* @__PURE__ */ t(
361
361
  Ge,
@@ -363,9 +363,9 @@ const wr = tt(function({ showMarkdown: i, markdown: l, onMarkdownChange: r, show
363
363
  checked: l,
364
364
  label: /* @__PURE__ */ t(O, { component: er, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
365
365
  labelPlacement: "start",
366
- control: /* @__PURE__ */ t(qe, { size: "small" }),
366
+ control: /* @__PURE__ */ t(Le, { size: "small" }),
367
367
  sx: { ml: 0.25, pr: 1 },
368
- onChange: (s, u) => r == null ? void 0 : r(u)
368
+ onChange: (s, d) => i == null ? void 0 : i(d)
369
369
  }
370
370
  ),
371
371
  ")"
@@ -383,21 +383,21 @@ const wr = tt(function({ showMarkdown: i, markdown: l, onMarkdownChange: r, show
383
383
  }), Pr = jt(() => import("react-best-gradient-color-picker"));
384
384
  function Ir(e) {
385
385
  try {
386
- const l = Ue.parse(e).map((a) => {
387
- const f = a.colorStops.map((d) => {
388
- if (d.type !== "rgba") {
389
- const p = Ut(d.value).toRgb();
386
+ const l = Ue.parse(e).map((u) => {
387
+ const m = u.colorStops.map((a) => {
388
+ if (a.type !== "rgba") {
389
+ const p = Ut(a.value).toRgb();
390
390
  return {
391
- ...d,
391
+ ...a,
392
392
  value: [p.r, p.g, p.b, p.a],
393
393
  type: "rgba"
394
394
  };
395
395
  }
396
- return d;
396
+ return a;
397
397
  });
398
398
  return {
399
- ...a,
400
- colorStops: f
399
+ ...u,
400
+ colorStops: m
401
401
  };
402
402
  });
403
403
  return Ue.stringify(l);
@@ -405,14 +405,14 @@ function Ir(e) {
405
405
  return Je(e) ? e : "";
406
406
  }
407
407
  }
408
- function Sr({ color: e, sx: i = {}, ...l }) {
408
+ function Sr({ color: e, sx: r = {}, ...l }) {
409
409
  Je(e);
410
- const r = {};
411
- return _e(e) ? r.backgroundImage = e : r.backgroundColor = e, /* @__PURE__ */ t(
410
+ const i = {};
411
+ return _e(e) ? i.backgroundImage = e : i.backgroundColor = e, /* @__PURE__ */ t(
412
412
  O,
413
413
  {
414
414
  sx: {
415
- ...i,
415
+ ...r,
416
416
  width: "100%",
417
417
  paddingBottom: "100%",
418
418
  cursor: "pointer",
@@ -422,41 +422,41 @@ function Sr({ color: e, sx: i = {}, ...l }) {
422
422
  "&:hover": {
423
423
  opacity: 0.75
424
424
  },
425
- ...r
425
+ ...i
426
426
  },
427
427
  ...l
428
428
  }
429
429
  );
430
430
  }
431
- const Or = tt(function({ onSave: i }, l) {
432
- const r = Vt({
431
+ const Or = tt(function({ onSave: r }, l) {
432
+ const i = Tt({
433
433
  value: ""
434
- }), { t: a } = A(), f = {};
435
- r.value ? _e(r.value) ? f.backgroundImage = r.value : f.backgroundColor = r.value : f.border = "1px solid #ccc";
436
- const [d, { setFalse: p, setTrue: k }] = Tt(!1), m = N(() => {
434
+ }), { t: u } = A(), m = {};
435
+ i.value ? _e(i.value) ? m.backgroundImage = i.value : m.backgroundColor = i.value : m.border = "1px solid #ccc";
436
+ const [a, { setFalse: p, setTrue: k }] = Vt(!1), h = N(() => {
437
437
  p();
438
438
  }, [p]), x = () => {
439
- i({ value: r.value }, m);
439
+ r({ value: i.value }, h);
440
440
  };
441
441
  return rt(l, () => ({
442
442
  open({ value: b } = { value: "" }) {
443
- r.value = b, k();
443
+ i.value = b, k();
444
444
  },
445
445
  close() {
446
- m();
446
+ h();
447
447
  }
448
- })), /* @__PURE__ */ S(Pe, { open: d, onClose: m, hideBackdrop: !0, children: [
449
- /* @__PURE__ */ t(Le, { children: a("maker.configBackground") }),
448
+ })), /* @__PURE__ */ S(Pe, { open: a, onClose: h, hideBackdrop: !0, children: [
449
+ /* @__PURE__ */ t(qe, { children: u("maker.configBackground") }),
450
450
  /* @__PURE__ */ t(Qe, { sx: { width: 600 }, children: /* @__PURE__ */ S(O, { width: "100%", display: "flex", children: [
451
- /* @__PURE__ */ t(O, { flex: 1, mr: 1, sx: f, children: !r.value && /* @__PURE__ */ t(te, { children: a("error.notConfig") }) }),
451
+ /* @__PURE__ */ t(O, { flex: 1, mr: 1, sx: m, children: !i.value && /* @__PURE__ */ t(te, { children: u("error.notConfig") }) }),
452
452
  /* @__PURE__ */ t(zt, { children: /* @__PURE__ */ t(
453
453
  Pr,
454
454
  {
455
455
  width: 200,
456
456
  height: 200,
457
- value: Ir(r.value),
457
+ value: Ir(i.value),
458
458
  onChange: (b) => {
459
- r.value = b;
459
+ i.value = b;
460
460
  },
461
461
  hidePresets: !0,
462
462
  hideAdvancedSliders: !0,
@@ -466,8 +466,8 @@ const Or = tt(function({ onSave: i }, l) {
466
466
  ) })
467
467
  ] }) }),
468
468
  /* @__PURE__ */ S(Xe, { children: [
469
- /* @__PURE__ */ t(V, { variant: "outlined", size: "small", onClick: m, children: a("common.cancel") }),
470
- /* @__PURE__ */ t(V, { variant: "contained", size: "small", onClick: x, children: a("maker.save") })
469
+ /* @__PURE__ */ t(T, { variant: "outlined", size: "small", onClick: h, children: u("common.cancel") }),
470
+ /* @__PURE__ */ t(T, { variant: "contained", size: "small", onClick: x, children: u("maker.save") })
471
471
  ] })
472
472
  ] });
473
473
  });
@@ -494,17 +494,17 @@ At(O)`
494
494
  `;
495
495
  function Cr({
496
496
  value: e,
497
- onChange: i,
497
+ onChange: r,
498
498
  ...l
499
499
  }) {
500
- const r = J(null);
500
+ const i = J(null);
501
501
  return /* @__PURE__ */ S($, { children: [
502
502
  /* @__PURE__ */ t(
503
503
  wr,
504
504
  {
505
505
  ...l,
506
506
  value: e,
507
- onChange: i,
507
+ onChange: r,
508
508
  InputProps: {
509
509
  endAdornment: /* @__PURE__ */ t(ue, { position: "end", children: /* @__PURE__ */ t(
510
510
  Sr,
@@ -512,8 +512,8 @@ function Cr({
512
512
  color: e ?? "",
513
513
  style: { width: "1.5rem", height: "1.5rem", padding: 0 },
514
514
  onClick: () => {
515
- var a;
516
- (a = r.current) == null || a.open({ value: e ?? "" });
515
+ var u;
516
+ (u = i.current) == null || u.open({ value: e ?? "" });
517
517
  }
518
518
  }
519
519
  ) })
@@ -523,9 +523,9 @@ function Cr({
523
523
  /* @__PURE__ */ t(
524
524
  Or,
525
525
  {
526
- ref: r,
527
- onSave: ({ value: a }, f) => {
528
- i(a), f();
526
+ ref: i,
527
+ onSave: ({ value: u }, m) => {
528
+ r(u), m();
529
529
  }
530
530
  }
531
531
  )
@@ -533,41 +533,41 @@ function Cr({
533
533
  }
534
534
  function jr({
535
535
  label: e,
536
- value: i,
536
+ value: r,
537
537
  onChange: l,
538
- property: r,
539
- component: a,
540
- defaultLocale: f,
541
- allComponents: d,
538
+ property: i,
539
+ component: u,
540
+ defaultLocale: m,
541
+ allComponents: a,
542
542
  PropertyValueField: p,
543
543
  onUpload: k
544
544
  }) {
545
- const { locale: m } = A(), x = J(null);
546
- if (!lt(r.subProperties)) {
547
- const n = T(Object.values(r.subProperties || {}), "index").filter(
545
+ const { locale: h } = A(), x = J(null);
546
+ if (!lt(i.subProperties)) {
547
+ const n = V(Object.values(i.subProperties || {}), "index").filter(
548
548
  (o) => o.data.visible !== !1 && o.data.key
549
549
  );
550
550
  return /* @__PURE__ */ S(j, { width: "100%", children: [
551
551
  /* @__PURE__ */ t(oe, { sx: { px: 0.25, py: 0.5 }, children: e }),
552
552
  /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(O, { sx: { position: "relative" }, children: n.map((o, s) => {
553
- const { data: u } = o, h = u.key ?? u.id, w = s === n.length - 1;
553
+ const { data: d } = o, f = d.key ?? d.id, w = s === n.length - 1;
554
554
  let c = null;
555
555
  try {
556
- i && typeof i == "object" ? c = i[h] : typeof i == "string" && (c = (r.type === "yaml" ? ye.parse(i || "") : JSON.parse(i || "{}"))[h]);
556
+ r && typeof r == "object" ? c = r[f] : typeof r == "string" && (c = (i.type === "yaml" ? ye.parse(r || "") : JSON.parse(r || "{}"))[f]);
557
557
  } catch {
558
558
  }
559
- c == null && (u.locales && m && u.locales[m] ? c = u.locales[m].defaultValue : u.locales && f && u.locales[f] && (c = u.locales[f].defaultValue));
559
+ c == null && (d.locales && h && d.locales[h] ? c = d.locales[h].defaultValue : d.locales && m && d.locales[m] && (c = d.locales[m].defaultValue));
560
560
  const v = (P) => {
561
561
  try {
562
562
  let C = {};
563
- if (typeof i == "string")
563
+ if (typeof r == "string")
564
564
  try {
565
- C = r.type === "yaml" ? ye.parse(i || "") : JSON.parse(i || "{}");
565
+ C = i.type === "yaml" ? ye.parse(r || "") : JSON.parse(r || "{}");
566
566
  } catch {
567
567
  }
568
- else typeof i == "object" && i !== null && (C = { ...i });
569
- nt(C, h, P);
570
- const y = ge(C, r.type);
568
+ else typeof r == "object" && r !== null && (C = { ...r });
569
+ nt(C, f, P);
570
+ const y = ge(C, i.type);
571
571
  l == null || l(y);
572
572
  } catch (C) {
573
573
  console.error("Error updating property:", C);
@@ -644,19 +644,19 @@ function jr({
644
644
  /* @__PURE__ */ t(O, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ t(
645
645
  p,
646
646
  {
647
- component: a,
648
- property: u,
647
+ component: u,
648
+ property: d,
649
649
  value: c,
650
650
  onChange: v,
651
651
  size: "small",
652
652
  fullWidth: !0,
653
- defaultLocale: f,
654
- allComponents: d
653
+ defaultLocale: m,
654
+ allComponents: a
655
655
  }
656
656
  ) })
657
657
  ]
658
658
  },
659
- u.id
659
+ d.id
660
660
  );
661
661
  }) }) })
662
662
  ] });
@@ -689,10 +689,10 @@ function jr({
689
689
  /* @__PURE__ */ t(
690
690
  ke,
691
691
  {
692
- keyId: r.id,
693
- locale: m,
694
- language: r.type === "yaml" ? "yaml" : "json",
695
- value: typeof i == "string" ? i : "",
692
+ keyId: i.id,
693
+ locale: h,
694
+ language: i.type === "yaml" ? "yaml" : "json",
695
+ value: typeof r == "string" ? r : "",
696
696
  onChange: (n) => {
697
697
  l == null || l(n);
698
698
  },
@@ -700,7 +700,7 @@ function jr({
700
700
  x.current = n, k && k(n);
701
701
  }
702
702
  },
703
- r.id
703
+ i.id
704
704
  ),
705
705
  /* @__PURE__ */ t(
706
706
  O,
@@ -729,58 +729,58 @@ function jr({
729
729
  const Ke = ["string", "multiline", "json", "yaml", "component", "custom", "url"];
730
730
  function ft({
731
731
  disabled: e,
732
- list: i,
732
+ list: r,
733
733
  renderItem: l,
734
- ...r
734
+ ...i
735
735
  }) {
736
- const a = J(null), f = Rt(), d = Et(), p = T(Object.entries(i), (o) => o[1].index).map((o) => o[0]), k = J(p), m = N(
736
+ const u = J(null), m = Rt(), a = Et(), p = V(Object.entries(r), (o) => o[1].index).map((o) => o[0]), k = J(p), h = N(
737
737
  (o) => {
738
- k.current = o, d();
738
+ k.current = o, a();
739
739
  },
740
- [d]
740
+ [a]
741
741
  ), x = N(
742
742
  ({ index: o }, { index: s }) => {
743
- const u = [...k.current];
744
- u.splice(s, 0, ...u.splice(o, 1)), m(u);
743
+ const d = [...k.current];
744
+ d.splice(s, 0, ...d.splice(o, 1)), h(d);
745
745
  },
746
- [m]
746
+ [h]
747
747
  );
748
- H(() => {
749
- m(p);
748
+ M(() => {
749
+ h(p);
750
750
  }, [p.join("-")]);
751
751
  const [{ isOver: b }, n] = ht({
752
- accept: f,
752
+ accept: m,
753
753
  collect: (o) => ({
754
754
  isOver: o.isOver()
755
755
  }),
756
756
  canDrop: () => !e,
757
757
  drop: () => {
758
- var u;
758
+ var d;
759
759
  const o = () => {
760
- k.current.forEach((h, w) => {
761
- const c = i[h];
760
+ k.current.forEach((f, w) => {
761
+ const c = r[f];
762
762
  c && (c.index = w);
763
763
  });
764
- }, s = (u = M(i)) == null ? void 0 : u.doc;
764
+ }, s = (d = H(r)) == null ? void 0 : d.doc;
765
765
  s ? s.transact(() => {
766
766
  o();
767
767
  }) : o();
768
768
  }
769
769
  });
770
- return H(() => {
771
- b || m(p);
772
- }, [b]), n(a), /* @__PURE__ */ t(O, { ...r, ref: a, className: Nt(b && "isDragging"), children: k.current.map((o, s) => /* @__PURE__ */ t(
770
+ return M(() => {
771
+ b || h(p);
772
+ }, [b]), n(u), /* @__PURE__ */ t(O, { ...i, ref: u, className: Nt(b && "isDragging"), children: k.current.map((o, s) => /* @__PURE__ */ t(
773
773
  zr,
774
774
  {
775
- type: f,
775
+ type: m,
776
776
  disabled: e,
777
777
  id: o,
778
778
  index: s,
779
- itemIndex: (u) => k.current.indexOf(u),
779
+ itemIndex: (d) => k.current.indexOf(d),
780
780
  move: x,
781
- children: (u) => {
782
- const h = i[o];
783
- return h ? l(h.data, s, u) : null;
781
+ children: (d) => {
782
+ const f = r[o];
783
+ return f ? l(f.data, s, d) : null;
784
784
  }
785
785
  },
786
786
  o
@@ -788,50 +788,50 @@ function ft({
788
788
  }
789
789
  function zr({
790
790
  disabled: e,
791
- id: i,
791
+ id: r,
792
792
  index: l,
793
- type: r,
794
- children: a,
795
- itemIndex: f,
796
- move: d
793
+ type: i,
794
+ children: u,
795
+ itemIndex: m,
796
+ move: a
797
797
  }) {
798
- const p = J(), [{ isDragging: k }, m, x] = yr({
799
- type: r,
800
- item: () => ({ id: i }),
798
+ const p = J(), [{ isDragging: k }, h, x] = yr({
799
+ type: i,
800
+ item: () => ({ id: r }),
801
801
  canDrag: () => !e,
802
802
  collect: (n) => ({ isDragging: n.isDragging() })
803
803
  }), [, b] = ht({
804
- accept: r,
804
+ accept: i,
805
805
  canDrop: () => !e,
806
806
  hover(n, o) {
807
807
  var g;
808
808
  if (!p.current)
809
809
  return;
810
- const s = f(n.id), u = l;
811
- if (s === u)
810
+ const s = m(n.id), d = l;
811
+ if (s === d)
812
812
  return;
813
- const h = (g = p.current) == null ? void 0 : g.getBoundingClientRect(), w = (h.bottom - h.top) / 2, v = o.getClientOffset().y - h.top;
814
- s < u && v < w || s > u && v > w || d({ id: n.id, index: s }, { id: i, index: l });
813
+ const f = (g = p.current) == null ? void 0 : g.getBoundingClientRect(), w = (f.bottom - f.top) / 2, v = o.getClientOffset().y - f.top;
814
+ s < d && v < w || s > d && v > w || a({ id: n.id, index: s }, { id: r, index: l });
815
815
  }
816
816
  });
817
- return typeof a == "function" ? a({
817
+ return typeof u == "function" ? u({
818
818
  isDragging: k,
819
- drag: m,
819
+ drag: h,
820
820
  drop: (n) => (p.current = n, b(n)),
821
821
  preview: x
822
- }) : (m(b(x(p))), /* @__PURE__ */ t(O, { ref: p, children: a }));
822
+ }) : (h(b(x(p))), /* @__PURE__ */ t(O, { ref: p, children: u }));
823
823
  }
824
824
  function Rr({
825
825
  drop: e,
826
- preview: i,
826
+ preview: r,
827
827
  drag: l,
828
- disabled: r,
829
- isDragging: a,
830
- children: f,
831
- onDelete: d,
828
+ disabled: i,
829
+ isDragging: u,
830
+ children: m,
831
+ onDelete: a,
832
832
  onVisibilityChange: p,
833
833
  visible: k = !0,
834
- actions: m,
834
+ actions: h,
835
835
  alwaysShowActions: x = !1
836
836
  }) {
837
837
  const { t: b } = A();
@@ -847,18 +847,18 @@ function Rr({
847
847
  /* @__PURE__ */ t(
848
848
  O,
849
849
  {
850
- ref: i,
850
+ ref: r,
851
851
  sx: {
852
852
  flex: 1,
853
853
  borderRadius: 0.5,
854
- bgcolor: a ? "action.hover" : "background.paper",
854
+ bgcolor: u ? "action.hover" : "background.paper",
855
855
  opacity: 0.9999
856
856
  // NOTE: make preview effective
857
857
  },
858
- children: f
858
+ children: m
859
859
  }
860
860
  ),
861
- !r && /* @__PURE__ */ t(
861
+ !i && /* @__PURE__ */ t(
862
862
  O,
863
863
  {
864
864
  className: x ? "" : "hover-visible",
@@ -886,10 +886,10 @@ function Rr({
886
886
  }
887
887
  },
888
888
  children: [
889
- m,
890
- p && /* @__PURE__ */ t(X, { title: b(k ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(V, { onClick: () => p(!k), children: k ? /* @__PURE__ */ t(lr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(nr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
891
- d && /* @__PURE__ */ t(X, { title: b("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(V, { onClick: d, children: /* @__PURE__ */ t(or, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
892
- /* @__PURE__ */ t(X, { title: b("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(V, { ref: l, children: /* @__PURE__ */ t(sr, { sx: { color: "grey.500" } }) }) })
889
+ h,
890
+ p && /* @__PURE__ */ t(X, { title: b(k ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: () => p(!k), children: k ? /* @__PURE__ */ t(lr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(nr, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
891
+ a && /* @__PURE__ */ t(X, { title: b("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { onClick: a, children: /* @__PURE__ */ t(or, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
892
+ /* @__PURE__ */ t(X, { title: b("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(T, { ref: l, children: /* @__PURE__ */ t(sr, { sx: { color: "grey.500" } }) }) })
893
893
  ]
894
894
  }
895
895
  )
@@ -901,54 +901,54 @@ function Rr({
901
901
  }
902
902
  function Dr({
903
903
  label: e,
904
- value: i,
904
+ value: r,
905
905
  onChange: l
906
906
  }) {
907
- const [r, a] = Z(!1);
907
+ const [i, u] = Z(!1);
908
908
  return /* @__PURE__ */ S(j, { gap: 1, children: [
909
909
  /* @__PURE__ */ t(
910
910
  D,
911
911
  {
912
912
  label: e,
913
913
  size: "small",
914
- value: i,
915
- onChange: (f) => l == null ? void 0 : l(f.target.value),
914
+ value: r,
915
+ onChange: (m) => l == null ? void 0 : l(m.target.value),
916
916
  InputProps: {
917
917
  endAdornment: /* @__PURE__ */ t(
918
918
  Ie,
919
919
  {
920
- onChange: ({ response: f }) => {
920
+ onChange: ({ response: m }) => {
921
921
  var p;
922
- const d = (p = f == null ? void 0 : f.data) == null ? void 0 : p.filename;
923
- d && (l == null || l(d));
922
+ const a = (p = m == null ? void 0 : m.data) == null ? void 0 : p.filename;
923
+ a && (l == null || l(a));
924
924
  }
925
925
  }
926
926
  )
927
927
  }
928
928
  }
929
929
  ),
930
- i && /* @__PURE__ */ t(
930
+ r && /* @__PURE__ */ t(
931
931
  O,
932
932
  {
933
933
  component: "img",
934
934
  sx: { objectFit: "contain", borderRadius: 1, cursor: "pointer" },
935
- src: ne(i),
935
+ src: ne(r),
936
936
  alt: e,
937
937
  maxWidth: 100,
938
938
  maxHeight: 100,
939
939
  width: "100%",
940
- onClick: () => a(!0)
940
+ onClick: () => u(!0)
941
941
  }
942
942
  ),
943
- /* @__PURE__ */ t(Pe, { open: r, onClose: () => a(!1), children: /* @__PURE__ */ t(O, { component: "img", sx: { objectFit: "contain" }, src: ne(i), alt: e }) })
943
+ /* @__PURE__ */ t(Pe, { open: i, onClose: () => u(!1), children: /* @__PURE__ */ t(O, { component: "img", sx: { objectFit: "contain" }, src: ne(r), alt: e }) })
944
944
  ] });
945
945
  }
946
- function ve(e, i = "") {
946
+ function ve(e, r = "") {
947
947
  return fr(
948
948
  e,
949
- (l, r, a) => {
950
- const f = i ? `${i}.${a}` : a;
951
- return ur(r) ? ar(l, ve(r, f)) : l[f] = r, l;
949
+ (l, i, u) => {
950
+ const m = r ? `${r}.${u}` : u;
951
+ return ur(i) ? ar(l, ve(i, m)) : l[m] = i, l;
952
952
  },
953
953
  {}
954
954
  );
@@ -967,46 +967,46 @@ const Ar = [
967
967
  { value: "component", label: "Component" },
968
968
  { value: "custom", label: "Custom (Render by a Component)" }
969
969
  ];
970
- function le(e, i, l) {
971
- return !e || !l ? !1 : Object.values(e).some(({ data: r }) => r.id !== i && r.key === l);
970
+ function le(e, r, l) {
971
+ return !e || !l ? !1 : Object.values(e).some(({ data: i }) => i.id !== r && i.key === l);
972
972
  }
973
- function bt(e, i) {
973
+ function bt(e, r) {
974
974
  var l;
975
- return !e || !i ? !1 : ((l = e[i]) == null ? void 0 : l.data.visible) ?? !0;
975
+ return !e || !r ? !1 : ((l = e[r]) == null ? void 0 : l.data.visible) ?? !0;
976
976
  }
977
- function Vi({ componentId: e }) {
977
+ function Ti({ componentId: e }) {
978
978
  const {
979
- state: { components: i }
980
- } = de(), l = i[e], r = l == null ? void 0 : l.data;
981
- return r ? /* @__PURE__ */ t(j, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ t(O, { p: 2, children: /* @__PURE__ */ t(br, { FallbackComponent: gt, resetKeys: [e], children: /* @__PURE__ */ t(Nr, { value: r }) }) }) }) : null;
979
+ state: { components: r }
980
+ } = de(), l = r[e], i = l == null ? void 0 : l.data;
981
+ return i ? /* @__PURE__ */ t(j, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ t(O, { p: 2, children: /* @__PURE__ */ t(br, { FallbackComponent: gt, resetKeys: [e], children: /* @__PURE__ */ t(Nr, { value: i }) }) }) }) : null;
982
982
  }
983
983
  function Nr({ value: e }) {
984
- var k, m, x;
985
- const { t: i } = A(), {
986
- localState: { currentLocale: l, componentDebugProps: r },
984
+ var k, h, x;
985
+ const { t: r } = A(), {
986
+ localState: { currentLocale: l, componentDebugProps: i },
987
987
  state: {
988
- config: { defaultLocale: a }
988
+ config: { defaultLocale: u }
989
989
  },
990
- localActions: { setComponentDebugProps: f }
991
- } = de(), d = M(e).doc, p = xe();
990
+ localActions: { setComponentDebugProps: m }
991
+ } = de(), a = H(e).doc, p = xe();
992
992
  return /* @__PURE__ */ t(j, { height: "100%", children: /* @__PURE__ */ S(j, { gap: 2, children: [
993
- /* @__PURE__ */ t(Vr, { config: e }),
993
+ /* @__PURE__ */ t(Tr, { config: e }),
994
994
  /* @__PURE__ */ t(
995
995
  Er,
996
996
  {
997
997
  config: e,
998
998
  currentLocale: l,
999
- defaultLocale: a,
999
+ defaultLocale: u,
1000
1000
  allComponents: p,
1001
1001
  onUpdateConfig: (b) => {
1002
- d.transact(() => {
1002
+ a.transact(() => {
1003
1003
  b(e);
1004
1004
  });
1005
1005
  }
1006
1006
  }
1007
1007
  ),
1008
1008
  /* @__PURE__ */ S(j, { gap: 2, direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1009
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: i("renderer") }),
1009
+ /* @__PURE__ */ t(F, { variant: "subtitle1", children: r("renderer") }),
1010
1010
  /* @__PURE__ */ S(
1011
1011
  D,
1012
1012
  {
@@ -1016,7 +1016,7 @@ function Nr({ value: e }) {
1016
1016
  SelectProps: { autoWidth: !0 },
1017
1017
  value: ((k = e.renderer) == null ? void 0 : k.type) || "react-component",
1018
1018
  onChange: (b) => {
1019
- d.transact(() => {
1019
+ a.transact(() => {
1020
1020
  const n = b.target.value;
1021
1021
  e.renderer ?? (e.renderer = { type: n }), e.renderer.type = n;
1022
1022
  });
@@ -1028,34 +1028,34 @@ function Nr({ value: e }) {
1028
1028
  }
1029
1029
  )
1030
1030
  ] }),
1031
- ((m = e.renderer) == null ? void 0 : m.type) === "component" ? /* @__PURE__ */ t($r, { value: e }) : ((x = e.renderer) == null ? void 0 : x.type) === "react-component" ? /* @__PURE__ */ t(Jr, { value: e }) : null,
1031
+ ((h = e.renderer) == null ? void 0 : h.type) === "component" ? /* @__PURE__ */ t($r, { value: e }) : ((x = e.renderer) == null ? void 0 : x.type) === "react-component" ? /* @__PURE__ */ t(Jr, { value: e }) : null,
1032
1032
  /* @__PURE__ */ t(
1033
- Hr,
1033
+ Mr,
1034
1034
  {
1035
1035
  config: e,
1036
1036
  currentLocale: l,
1037
- defaultLocale: a,
1037
+ defaultLocale: u,
1038
1038
  allComponents: p,
1039
1039
  onChange: ({ key: b, value: n }) => {
1040
- f({
1040
+ m({
1041
1041
  [b]: n.value
1042
1042
  });
1043
1043
  },
1044
1044
  props: {
1045
- ...r
1045
+ ...i
1046
1046
  }
1047
1047
  }
1048
1048
  )
1049
1049
  ] }) });
1050
1050
  }
1051
- function Vr({ config: e }) {
1052
- const { t: i } = A();
1051
+ function Tr({ config: e }) {
1052
+ const { t: r } = A();
1053
1053
  return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
1054
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: i("basicInfo") }),
1054
+ /* @__PURE__ */ t(F, { variant: "subtitle1", children: r("basicInfo") }),
1055
1055
  /* @__PURE__ */ t(
1056
1056
  D,
1057
1057
  {
1058
- label: i("name"),
1058
+ label: r("name"),
1059
1059
  size: "small",
1060
1060
  value: e.name || "",
1061
1061
  onChange: (l) => e.name = l.target.value
@@ -1064,7 +1064,7 @@ function Vr({ config: e }) {
1064
1064
  /* @__PURE__ */ t(
1065
1065
  D,
1066
1066
  {
1067
- label: i("description"),
1067
+ label: r("description"),
1068
1068
  size: "small",
1069
1069
  multiline: !0,
1070
1070
  minRows: 2,
@@ -1082,14 +1082,14 @@ function Vr({ config: e }) {
1082
1082
  multiple: !0,
1083
1083
  freeSolo: !0,
1084
1084
  value: e.tags ?? [],
1085
- onChange: (l, r) => e.tags = r,
1086
- renderInput: (l) => /* @__PURE__ */ t(D, { label: i("tags"), ...l })
1085
+ onChange: (l, i) => e.tags = i,
1086
+ renderInput: (l) => /* @__PURE__ */ t(D, { label: r("tags"), ...l })
1087
1087
  }
1088
1088
  ),
1089
1089
  /* @__PURE__ */ t(
1090
1090
  Dr,
1091
1091
  {
1092
- label: i("previewImage"),
1092
+ label: r("previewImage"),
1093
1093
  value: e.previewImage || "",
1094
1094
  onChange: (l) => e.previewImage = l
1095
1095
  }
@@ -1098,38 +1098,38 @@ function Vr({ config: e }) {
1098
1098
  }
1099
1099
  function yt({
1100
1100
  data: e,
1101
- params: i,
1101
+ params: r,
1102
1102
  visible: l,
1103
- config: r,
1104
- currentLocale: a,
1105
- defaultLocale: f,
1106
- allComponents: d,
1103
+ config: i,
1104
+ currentLocale: u,
1105
+ defaultLocale: m,
1106
+ allComponents: a,
1107
1107
  onUpdateConfig: p
1108
1108
  }) {
1109
- var x, b, n, o, s, u;
1110
- const { t: k } = A(), m = ae(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? Br : K, [e.type]);
1109
+ var x, b, n, o, s, d;
1110
+ const { t: k } = A(), h = ae(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? Br : K, [e.type]);
1111
1111
  return /* @__PURE__ */ t(
1112
1112
  Rr,
1113
1113
  {
1114
- preview: i.preview,
1115
- drop: i.drop,
1116
- drag: i.drag,
1117
- isDragging: i.isDragging,
1114
+ preview: r.preview,
1115
+ drop: r.drop,
1116
+ drag: r.drag,
1117
+ isDragging: r.isDragging,
1118
1118
  onDelete: () => {
1119
- p((h) => {
1120
- if (h.properties) {
1121
- const c = Object.entries(h.properties).sort(([, g], [, P]) => g.index - P.index);
1122
- delete h.properties[e.id], c.filter(([g]) => g !== e.id).forEach(([, g], P) => {
1119
+ p((f) => {
1120
+ if (f.properties) {
1121
+ const c = Object.entries(f.properties).sort(([, g], [, P]) => g.index - P.index);
1122
+ delete f.properties[e.id], c.filter(([g]) => g !== e.id).forEach(([, g], P) => {
1123
1123
  g.index = P;
1124
1124
  });
1125
1125
  }
1126
1126
  });
1127
1127
  },
1128
1128
  visible: l,
1129
- onVisibilityChange: (h) => {
1129
+ onVisibilityChange: (f) => {
1130
1130
  p((w) => {
1131
1131
  const c = w.properties[e.id].data;
1132
- c.visible = h;
1132
+ c.visible = f;
1133
1133
  });
1134
1134
  },
1135
1135
  alwaysShowActions: !0,
@@ -1144,24 +1144,24 @@ function yt({
1144
1144
  width: "calc(100% - 80px - 8px)",
1145
1145
  flex: 1,
1146
1146
  "& .MuiOutlinedInput-root": {
1147
- borderColor: e.key ? le(r.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
1147
+ borderColor: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
1148
1148
  },
1149
1149
  "& .MuiFormLabel-root": {
1150
- color: e.key ? le(r.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
1150
+ color: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
1151
1151
  },
1152
1152
  "& .MuiFormLabel-root.Mui-focused": {
1153
- color: e.key ? le(r.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
1153
+ color: e.key ? le(i.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
1154
1154
  }
1155
1155
  },
1156
1156
  value: e.key || "",
1157
- onChange: (h) => {
1157
+ onChange: (f) => {
1158
1158
  p((w) => {
1159
1159
  const c = w.properties[e.id].data;
1160
- c.key = h.target.value.trim();
1160
+ c.key = f.target.value.trim();
1161
1161
  });
1162
1162
  },
1163
1163
  InputProps: {
1164
- endAdornment: !e.key || e.key && le(r.properties, e.id, e.key) ? /* @__PURE__ */ t(
1164
+ endAdornment: !e.key || e.key && le(i.properties, e.id, e.key) ? /* @__PURE__ */ t(
1165
1165
  ue,
1166
1166
  {
1167
1167
  position: "end",
@@ -1190,12 +1190,12 @@ function yt({
1190
1190
  label: k("label"),
1191
1191
  size: "small",
1192
1192
  sx: { flex: 1 },
1193
- value: (((b = (x = e.locales) == null ? void 0 : x[a]) == null ? void 0 : b.name) ?? ((o = (n = e.locales) == null ? void 0 : n[f]) == null ? void 0 : o.name)) || "",
1194
- onChange: (h) => {
1193
+ value: (((b = (x = e.locales) == null ? void 0 : x[u]) == null ? void 0 : b.name) ?? ((o = (n = e.locales) == null ? void 0 : n[m]) == null ? void 0 : o.name)) || "",
1194
+ onChange: (f) => {
1195
1195
  p((w) => {
1196
1196
  var v;
1197
1197
  const c = w.properties[e.id].data;
1198
- c.locales ?? (c.locales = {}), (v = c.locales)[a] ?? (v[a] = {}), c.locales[a].name = h.target.value;
1198
+ c.locales ?? (c.locales = {}), (v = c.locales)[u] ?? (v[u] = {}), c.locales[u].name = f.target.value;
1199
1199
  });
1200
1200
  }
1201
1201
  }
@@ -1208,78 +1208,81 @@ function yt({
1208
1208
  select: !0,
1209
1209
  sx: { flex: 1 },
1210
1210
  value: e.type === "string" && e.multiline ? "multiline" : e.type || "string",
1211
- onChange: (h) => {
1211
+ onChange: (f) => {
1212
1212
  p((w) => {
1213
1213
  const c = w.properties[e.id].data;
1214
1214
  if (c.locales)
1215
1215
  for (const g of Object.keys(c.locales))
1216
1216
  c.locales[g].defaultValue = void 0;
1217
- const v = h.target.value;
1217
+ const v = f.target.value;
1218
1218
  v === "multiline" ? (c.type = "string", c.multiline = !0) : (typeof c.multiline < "u" && delete c.multiline, c.type = v);
1219
1219
  });
1220
1220
  },
1221
- children: Ar.map((h) => /* @__PURE__ */ t(he, { value: h.value, children: h.label }, h.value))
1221
+ children: Ar.map((f) => /* @__PURE__ */ t(he, { value: f.value, children: f.label }, f.value))
1222
1222
  }
1223
1223
  )
1224
1224
  ] }),
1225
1225
  /* @__PURE__ */ S(j, { direction: "row", gap: 1, children: [
1226
1226
  /* @__PURE__ */ t(
1227
- m,
1227
+ h,
1228
1228
  {
1229
- allComponents: d,
1230
- defaultLocale: f,
1231
- component: r,
1229
+ allComponents: a,
1230
+ defaultLocale: m,
1231
+ component: i,
1232
1232
  property: e,
1233
1233
  label: k("defaultValue"),
1234
1234
  size: "small",
1235
1235
  fullWidth: !0,
1236
- value: (u = (s = e.locales) == null ? void 0 : s[a]) == null ? void 0 : u.defaultValue,
1237
- onChange: (h, w) => {
1236
+ value: (d = (s = e.locales) == null ? void 0 : s[u]) == null ? void 0 : d.defaultValue,
1237
+ onChange: (f, w) => {
1238
1238
  p((c) => {
1239
1239
  var g;
1240
1240
  const v = c.properties[e.id].data;
1241
1241
  if (w != null && w.forceUpdateProperty) {
1242
- const P = ve(v), C = ve(h);
1242
+ const P = ve(v), C = ve(f);
1243
1243
  Object.keys(C).forEach((y) => {
1244
1244
  P[y] || nt(v, y, C[y]);
1245
1245
  });
1246
1246
  } else
1247
- v.locales ?? (v.locales = {}), (g = v.locales)[a] ?? (g[a] = {}), v.locales[a].defaultValue = h;
1247
+ v.locales ?? (v.locales = {}), (g = v.locales)[u] ?? (g[u] = {}), v.locales[u].defaultValue = f;
1248
1248
  });
1249
1249
  }
1250
1250
  }
1251
1251
  ),
1252
- e.type === "custom" ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(Ur, { property: e, allComponents: d }) }) : null
1252
+ e.type === "custom" ? /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(Ur, { property: e, allComponents: a }) }) : null
1253
1253
  ] })
1254
1254
  ] })
1255
1255
  }
1256
1256
  );
1257
1257
  }
1258
- function Tr(e) {
1259
- const [i, l] = Z(0);
1260
- return H(() => {
1261
- if (e.current) {
1262
- let r = e.current.parentElement, a = 0;
1263
- for (; r; )
1264
- r.classList.contains("property-container") && a++, r = r.parentElement;
1265
- l(a);
1266
- }
1267
- }, []), i;
1258
+ function Vr(e, r) {
1259
+ const [l, i] = Z(0);
1260
+ return M(() => {
1261
+ const m = setTimeout(() => {
1262
+ if (e.current) {
1263
+ let a = e.current.parentElement, p = 0;
1264
+ for (; a; )
1265
+ a.classList.contains("property-container") && p++, a = a.parentElement;
1266
+ i(p);
1267
+ }
1268
+ }, 100);
1269
+ return () => clearTimeout(m);
1270
+ }, [e, r]), l;
1268
1271
  }
1269
1272
  function Er({
1270
1273
  config: e,
1271
- currentLocale: i,
1274
+ currentLocale: r,
1272
1275
  defaultLocale: l,
1273
- allComponents: r,
1274
- onUpdateConfig: a,
1275
- useI18nEditor: f = !0
1276
+ allComponents: i,
1277
+ onUpdateConfig: u,
1278
+ useI18nEditor: m = !0
1276
1279
  }) {
1277
- const { t: d } = A(), p = pe({ variant: "dialog" }), k = e.properties && T(Object.values(e.properties), "index");
1280
+ const { t: a } = A(), p = pe({ variant: "dialog" }), k = e.properties && V(Object.values(e.properties), "index");
1278
1281
  return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
1279
1282
  /* @__PURE__ */ S(j, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between", children: [
1280
- /* @__PURE__ */ t(F, { variant: "subtitle1", children: d("properties") }),
1283
+ /* @__PURE__ */ t(F, { variant: "subtitle1", children: a("properties") }),
1281
1284
  /* @__PURE__ */ t(O, { flex: 1 }),
1282
- f && /* @__PURE__ */ t(V, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...me(p), children: /* @__PURE__ */ t(ct, { fontSize: "small" }) })
1285
+ m && /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...me(p), children: /* @__PURE__ */ t(ct, { fontSize: "small" }) })
1283
1286
  ] }),
1284
1287
  e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ t(
1285
1288
  ft,
@@ -1287,8 +1290,8 @@ function Er({
1287
1290
  component: j,
1288
1291
  gap: 2,
1289
1292
  list: e.properties,
1290
- renderItem: (m, x, b) => {
1291
- const n = bt(e.properties, m.id);
1293
+ renderItem: (h, x, b) => {
1294
+ const n = bt(e.properties, h.id);
1292
1295
  return /* @__PURE__ */ t(
1293
1296
  re,
1294
1297
  {
@@ -1303,103 +1306,103 @@ function Er({
1303
1306
  children: /* @__PURE__ */ t(j, { gap: 2, children: /* @__PURE__ */ t(
1304
1307
  yt,
1305
1308
  {
1306
- data: m,
1309
+ data: h,
1307
1310
  params: b,
1308
1311
  visible: n,
1309
1312
  config: e,
1310
- currentLocale: i,
1313
+ currentLocale: r,
1311
1314
  defaultLocale: l,
1312
- allComponents: r,
1313
- onUpdateConfig: a
1315
+ allComponents: i,
1316
+ onUpdateConfig: u
1314
1317
  }
1315
1318
  ) })
1316
1319
  },
1317
- m.id
1320
+ h.id
1318
1321
  );
1319
1322
  }
1320
1323
  }
1321
- ) : /* @__PURE__ */ t(te, { style: { fontSize: 12 }, children: d("maker.properties.noProperties") }),
1324
+ ) : /* @__PURE__ */ t(te, { style: { fontSize: 12 }, children: a("maker.properties.noProperties") }),
1322
1325
  /* @__PURE__ */ t(
1323
- V,
1326
+ T,
1324
1327
  {
1325
1328
  fullWidth: !0,
1326
1329
  variant: "outlined",
1327
1330
  className: "ignore-style-override",
1328
1331
  onClick: () => {
1329
- a((m) => {
1332
+ u((h) => {
1330
1333
  var b;
1331
1334
  const x = $e();
1332
- m.properties ?? (m.properties = {}), (b = m.properties)[x] ?? (b[x] = { index: (k == null ? void 0 : k.length) || 0, data: { id: x } });
1335
+ h.properties ?? (h.properties = {}), (b = h.properties)[x] ?? (b[x] = { index: (k == null ? void 0 : k.length) || 0, data: { id: x } });
1333
1336
  });
1334
1337
  },
1335
1338
  startIcon: /* @__PURE__ */ t(at, {}),
1336
- children: d("addObject", { object: d("property") })
1339
+ children: a("addObject", { object: a("property") })
1337
1340
  }
1338
1341
  ),
1339
- f && /* @__PURE__ */ t(vt, { ...pt(p), component: e })
1342
+ m && /* @__PURE__ */ t(vt, { ...pt(p), component: e })
1340
1343
  ] }) });
1341
1344
  }
1342
1345
  function Ur({
1343
1346
  property: e,
1344
- allComponents: i
1347
+ allComponents: r
1345
1348
  }) {
1346
1349
  const l = pe({ variant: "popper" });
1347
1350
  return /* @__PURE__ */ S($, { children: [
1348
- /* @__PURE__ */ t(V, { sx: { minWidth: 0 }, ...me(l), children: /* @__PURE__ */ t(ut, { fontSize: "small" }) }),
1351
+ /* @__PURE__ */ t(T, { sx: { minWidth: 0 }, ...me(l), children: /* @__PURE__ */ t(ut, { fontSize: "small" }) }),
1349
1352
  /* @__PURE__ */ t(et, { ...mt(l), children: /* @__PURE__ */ t(st, { onClickAway: l.close, children: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ t(O, { width: 500, p: 2, children: /* @__PURE__ */ t(
1350
1353
  Oe,
1351
1354
  {
1352
1355
  value: e.componentId,
1353
- onChange: (r, a) => e.componentId = a,
1354
- allComponents: i
1356
+ onChange: (i, u) => e.componentId = u,
1357
+ allComponents: r
1355
1358
  }
1356
1359
  ) }) }) }) })
1357
1360
  ] });
1358
1361
  }
1359
1362
  function Wr({
1360
1363
  value: e,
1361
- valueImmutable: i,
1364
+ valueImmutable: r,
1362
1365
  onChange: l,
1363
- defaultLocale: r,
1364
- allComponents: a
1366
+ defaultLocale: i,
1367
+ allComponents: u
1365
1368
  }) {
1366
1369
  var k;
1367
- const f = pe({ variant: "popper" }), { locale: d } = A(), p = typeof (e == null ? void 0 : e.componentId) == "string" ? (k = a[e.componentId]) == null ? void 0 : k.data : void 0;
1370
+ const m = pe({ variant: "popper" }), { locale: a } = A(), p = typeof (e == null ? void 0 : e.componentId) == "string" ? (k = u[e.componentId]) == null ? void 0 : k.data : void 0;
1368
1371
  return p ? /* @__PURE__ */ S($, { children: [
1369
- /* @__PURE__ */ t(V, { sx: { minWidth: 0 }, disabled: !p, ...me(f), children: /* @__PURE__ */ t(ut, { fontSize: "small" }) }),
1372
+ /* @__PURE__ */ t(T, { sx: { minWidth: 0 }, disabled: !p, ...me(m), children: /* @__PURE__ */ t(ut, { fontSize: "small" }) }),
1370
1373
  /* @__PURE__ */ t(
1371
1374
  et,
1372
1375
  {
1373
- ...mt(f),
1376
+ ...mt(m),
1374
1377
  sx: {
1375
1378
  zIndex: 1e3
1376
1379
  },
1377
- children: /* @__PURE__ */ t(st, { onClickAway: f.close, children: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ S(O, { width: 500, p: 2, children: [
1380
+ children: /* @__PURE__ */ t(st, { onClickAway: m.close, children: /* @__PURE__ */ t(re, { children: /* @__PURE__ */ S(O, { width: 500, p: 2, children: [
1378
1381
  /* @__PURE__ */ t(F, { variant: "subtitle1", children: "Parameters" }),
1379
- /* @__PURE__ */ t(j, { gap: 1, children: (p == null ? void 0 : p.properties) && T(Object.values(p.properties), "index").map(({ data: m }) => {
1380
- var x, b, n, o, s, u, h, w;
1382
+ /* @__PURE__ */ t(j, { gap: 1, children: (p == null ? void 0 : p.properties) && V(Object.values(p.properties), "index").map(({ data: h }) => {
1383
+ var x, b, n, o, s, d, f, w;
1381
1384
  return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
1382
1385
  K,
1383
1386
  {
1384
- allComponents: a,
1385
- defaultLocale: r,
1387
+ allComponents: u,
1388
+ defaultLocale: i,
1386
1389
  size: "small",
1387
1390
  fullWidth: !0,
1388
1391
  component: p,
1389
- property: m,
1390
- valueImmutable: ee((b = (x = e.properties) == null ? void 0 : x[m.id]) == null ? void 0 : b.value),
1391
- value: ((o = (n = e.properties) == null ? void 0 : n[m.id]) == null ? void 0 : o.value) ?? ((u = (s = m.locales) == null ? void 0 : s[d]) == null ? void 0 : u.defaultValue) ?? ((w = (h = m.locales) == null ? void 0 : h[r]) == null ? void 0 : w.defaultValue),
1392
+ property: h,
1393
+ valueImmutable: ee((b = (x = e.properties) == null ? void 0 : x[h.id]) == null ? void 0 : b.value),
1394
+ value: ((o = (n = e.properties) == null ? void 0 : n[h.id]) == null ? void 0 : o.value) ?? ((d = (s = h.locales) == null ? void 0 : s[a]) == null ? void 0 : d.defaultValue) ?? ((w = (f = h.locales) == null ? void 0 : f[i]) == null ? void 0 : w.defaultValue),
1392
1395
  onChange: (c) => {
1393
- if (i) {
1396
+ if (r) {
1394
1397
  const v = JSON.parse(JSON.stringify(e));
1395
- l == null || l({ ...v, properties: { ...v.properties, [m.id]: { value: c } } });
1398
+ l == null || l({ ...v, properties: { ...v.properties, [h.id]: { value: c } } });
1396
1399
  } else
1397
- M(p).doc.transact(() => {
1398
- e.properties ?? (e.properties = {}), e.properties[m.id] = { value: c };
1400
+ H(p).doc.transact(() => {
1401
+ e.properties ?? (e.properties = {}), e.properties[h.id] = { value: c };
1399
1402
  });
1400
1403
  }
1401
1404
  }
1402
- ) }, m.id);
1405
+ ) }, h.id);
1403
1406
  }) })
1404
1407
  ] }) }) })
1405
1408
  }
@@ -1408,26 +1411,26 @@ function Wr({
1408
1411
  }
1409
1412
  function vt({
1410
1413
  type: e = "properties",
1411
- component: i,
1414
+ component: r,
1412
1415
  ...l
1413
1416
  }) {
1414
1417
  var b, n, o;
1415
- const { t: r } = A(), {
1418
+ const { t: i } = A(), {
1416
1419
  state: {
1417
- components: a,
1418
- supportedLocales: f,
1419
- config: { defaultLocale: d }
1420
+ components: u,
1421
+ supportedLocales: m,
1422
+ config: { defaultLocale: a }
1420
1423
  }
1421
- } = de(), p = xe(), k = M(i).doc, m = e === "properties" ? i.properties : e === "parameters" && ((b = i.renderer) == null ? void 0 : b.type) === "component" ? (n = a[i.renderer.componentId]) == null ? void 0 : n.data.properties : void 0, x = ((o = i.renderer) == null ? void 0 : o.type) === "component" ? i : void 0;
1424
+ } = de(), p = xe(), k = H(r).doc, h = e === "properties" ? r.properties : e === "parameters" && ((b = r.renderer) == null ? void 0 : b.type) === "component" ? (n = u[r.renderer.componentId]) == null ? void 0 : n.data.properties : void 0, x = ((o = r.renderer) == null ? void 0 : o.type) === "component" ? r : void 0;
1422
1425
  return /* @__PURE__ */ S(Pe, { ...l, fullWidth: !0, maxWidth: "lg", children: [
1423
- /* @__PURE__ */ t(Le, { children: r("i18nEditorTitle") }),
1424
- /* @__PURE__ */ t(Qe, { children: m && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ S(He, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
1425
- /* @__PURE__ */ t(Me, { children: /* @__PURE__ */ t(se, { children: f.map(({ locale: s, name: u }) => /* @__PURE__ */ S(ce, { children: [
1426
- u,
1427
- d === s && /* @__PURE__ */ t(cr, { sx: { fontSize: 12, color: "text.secondary" } })
1426
+ /* @__PURE__ */ t(qe, { children: i("i18nEditorTitle") }),
1427
+ /* @__PURE__ */ t(Qe, { children: h && /* @__PURE__ */ t(j, { children: /* @__PURE__ */ S(Me, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
1428
+ /* @__PURE__ */ t(He, { children: /* @__PURE__ */ t(se, { children: m.map(({ locale: s, name: d }) => /* @__PURE__ */ S(ce, { children: [
1429
+ d,
1430
+ a === s && /* @__PURE__ */ t(cr, { sx: { fontSize: 12, color: "text.secondary" } })
1428
1431
  ] }, s)) }) }),
1429
- /* @__PURE__ */ t(Ye, { children: T(Object.values(m), "index").map(({ data: s }) => /* @__PURE__ */ t(se, { children: f.map(({ locale: u }) => {
1430
- var h, w, c, v, g, P, C, y, I, z, R, E, U, W, ie, Y, G, q, L, Q, Ce, je, ze, Re, De, Ae;
1432
+ /* @__PURE__ */ t(Ye, { children: V(Object.values(h), "index").map(({ data: s }) => /* @__PURE__ */ t(se, { children: m.map(({ locale: d }) => {
1433
+ var f, w, c, v, g, P, C, y, I, z, R, E, U, W, ie, Y, G, L, q, Q, Ce, je, ze, Re, De, Ae;
1431
1434
  return /* @__PURE__ */ t(ce, { children: /* @__PURE__ */ t(j, { gap: 1, children: e === "properties" ? /* @__PURE__ */ S($, { children: [
1432
1435
  /* @__PURE__ */ t(
1433
1436
  D,
@@ -1446,12 +1449,12 @@ function vt({
1446
1449
  D,
1447
1450
  {
1448
1451
  size: "small",
1449
- label: r("label"),
1450
- value: (((w = (h = s.locales) == null ? void 0 : h[u]) == null ? void 0 : w.name) ?? ((v = (c = s.locales) == null ? void 0 : c[d]) == null ? void 0 : v.name)) || "",
1452
+ label: i("label"),
1453
+ value: (((w = (f = s.locales) == null ? void 0 : f[d]) == null ? void 0 : w.name) ?? ((v = (c = s.locales) == null ? void 0 : c[a]) == null ? void 0 : v.name)) || "",
1451
1454
  onChange: (_) => {
1452
1455
  k.transact(() => {
1453
1456
  var B;
1454
- s.locales ?? (s.locales = {}), (B = s.locales)[u] ?? (B[u] = {}), s.locales[u].name = _.target.value;
1457
+ s.locales ?? (s.locales = {}), (B = s.locales)[d] ?? (B[d] = {}), s.locales[d].name = _.target.value;
1455
1458
  });
1456
1459
  }
1457
1460
  }
@@ -1460,18 +1463,18 @@ function vt({
1460
1463
  K,
1461
1464
  {
1462
1465
  allComponents: p,
1463
- defaultLocale: d,
1464
- component: i,
1466
+ defaultLocale: a,
1467
+ component: r,
1465
1468
  property: s,
1466
1469
  size: "small",
1467
1470
  fullWidth: !0,
1468
1471
  label: "Default Value",
1469
- valueImmutable: ee((P = (g = s.locales) == null ? void 0 : g[u]) == null ? void 0 : P.defaultValue),
1470
- value: ((y = (C = s.locales) == null ? void 0 : C[u]) == null ? void 0 : y.defaultValue) ?? ((z = (I = s.locales) == null ? void 0 : I[d]) == null ? void 0 : z.defaultValue),
1472
+ valueImmutable: ee((P = (g = s.locales) == null ? void 0 : g[d]) == null ? void 0 : P.defaultValue),
1473
+ value: ((y = (C = s.locales) == null ? void 0 : C[d]) == null ? void 0 : y.defaultValue) ?? ((z = (I = s.locales) == null ? void 0 : I[a]) == null ? void 0 : z.defaultValue),
1471
1474
  onChange: (_) => {
1472
1475
  k.transact(() => {
1473
1476
  var B;
1474
- s.locales ?? (s.locales = {}), (B = s.locales)[u] ?? (B[u] = {}), s.locales[u].defaultValue = _;
1477
+ s.locales ?? (s.locales = {}), (B = s.locales)[d] ?? (B[d] = {}), s.locales[d].defaultValue = _;
1475
1478
  });
1476
1479
  }
1477
1480
  }
@@ -1480,66 +1483,66 @@ function vt({
1480
1483
  K,
1481
1484
  {
1482
1485
  allComponents: p,
1483
- defaultLocale: d,
1484
- component: i,
1486
+ defaultLocale: a,
1487
+ component: r,
1485
1488
  property: s,
1486
1489
  size: "small",
1487
1490
  fullWidth: !0,
1488
1491
  valueImmutable: ee(
1489
- (W = (U = (E = (R = x.renderer.properties) == null ? void 0 : R[s.id]) == null ? void 0 : E.locales) == null ? void 0 : U[u]) == null ? void 0 : W.value
1492
+ (W = (U = (E = (R = x.renderer.properties) == null ? void 0 : R[s.id]) == null ? void 0 : E.locales) == null ? void 0 : U[d]) == null ? void 0 : W.value
1490
1493
  ),
1491
- value: ((q = (G = (Y = (ie = x.renderer.properties) == null ? void 0 : ie[s.id]) == null ? void 0 : Y.locales) == null ? void 0 : G[u]) == null ? void 0 : q.value) ?? ((je = (Ce = (Q = (L = x.renderer.properties) == null ? void 0 : L[s.id]) == null ? void 0 : Q.locales) == null ? void 0 : Ce[d]) == null ? void 0 : je.value) ?? ((Re = (ze = s.locales) == null ? void 0 : ze[u]) == null ? void 0 : Re.defaultValue) ?? ((Ae = (De = s.locales) == null ? void 0 : De[d]) == null ? void 0 : Ae.defaultValue),
1494
+ value: ((L = (G = (Y = (ie = x.renderer.properties) == null ? void 0 : ie[s.id]) == null ? void 0 : Y.locales) == null ? void 0 : G[d]) == null ? void 0 : L.value) ?? ((je = (Ce = (Q = (q = x.renderer.properties) == null ? void 0 : q[s.id]) == null ? void 0 : Q.locales) == null ? void 0 : Ce[a]) == null ? void 0 : je.value) ?? ((Re = (ze = s.locales) == null ? void 0 : ze[d]) == null ? void 0 : Re.defaultValue) ?? ((Ae = (De = s.locales) == null ? void 0 : De[a]) == null ? void 0 : Ae.defaultValue),
1492
1495
  onChange: (_) => {
1493
1496
  k.transact(() => {
1494
- var B, Ne, Ve, Te, Ee;
1495
- (B = x.renderer).properties ?? (B.properties = {}), (Ne = x.renderer.properties)[Ve = s.id] ?? (Ne[Ve] = {}), (Te = x.renderer.properties[s.id]).locales ?? (Te.locales = {}), (Ee = x.renderer.properties[s.id].locales)[u] ?? (Ee[u] = {}), x.renderer.properties[s.id].locales[u].value = _;
1497
+ var B, Ne, Te, Ve, Ee;
1498
+ (B = x.renderer).properties ?? (B.properties = {}), (Ne = x.renderer.properties)[Te = s.id] ?? (Ne[Te] = {}), (Ve = x.renderer.properties[s.id]).locales ?? (Ve.locales = {}), (Ee = x.renderer.properties[s.id].locales)[d] ?? (Ee[d] = {}), x.renderer.properties[s.id].locales[d].value = _;
1496
1499
  });
1497
1500
  }
1498
1501
  }
1499
- ) }) : null }, s.id) }, u);
1502
+ ) }) : null }, s.id) }, d);
1500
1503
  }) }, s.id)) })
1501
1504
  ] }) }) }),
1502
- /* @__PURE__ */ t(Xe, { children: /* @__PURE__ */ t(V, { onClick: (s) => {
1503
- var u;
1504
- return (u = l.onClose) == null ? void 0 : u.call(l, s, "escapeKeyDown");
1505
- }, children: r("close") }) })
1505
+ /* @__PURE__ */ t(Xe, { children: /* @__PURE__ */ t(T, { onClick: (s) => {
1506
+ var d;
1507
+ return (d = l.onClose) == null ? void 0 : d.call(l, s, "escapeKeyDown");
1508
+ }, children: i("close") }) })
1506
1509
  ] });
1507
1510
  }
1508
- const Fe = (e, i) => (l) => {
1509
- const r = [
1511
+ const Fe = (e, r) => (l) => {
1512
+ const i = [
1513
+ l.palette.info.main,
1510
1514
  l.palette.primary.main,
1511
1515
  l.palette.secondary.main,
1512
1516
  l.palette.success.main,
1513
- l.palette.warning.main,
1514
- l.palette.info.main
1515
- ], a = e % r.length, f = r[a % r.length], d = Be(f, 0.5), p = Be(f, 1);
1517
+ l.palette.warning.main
1518
+ ], u = Math.min(i.length - 1, e), m = i[u], a = Be(m, 0.5), p = Be(m, 1);
1516
1519
  return {
1517
1520
  // 保留原有的边框样式
1518
- borderColor: `${d} !important`,
1521
+ borderColor: `${a} !important`,
1519
1522
  borderLeft: "3px solid !important",
1520
1523
  // 稍粗的左侧边框
1521
- borderLeftColor: d,
1524
+ borderLeftColor: a,
1522
1525
  // 使用透明度适应深色/浅色模式
1523
1526
  color: p,
1524
- ...i
1527
+ ...r
1525
1528
  };
1526
1529
  };
1527
1530
  function Br({
1528
1531
  property: e,
1529
- onChange: i,
1532
+ onChange: r,
1530
1533
  defaultLocale: l,
1531
- allComponents: r
1534
+ allComponents: i
1532
1535
  }) {
1533
- const { t: a, locale: f } = A(), d = J(null), p = Tr(d), k = N(() => {
1536
+ const { t: u, locale: m } = A(), a = J(null), p = Vr(a, e), k = N(() => {
1534
1537
  if (!(e.type !== "json" && e.type !== "yaml" && e.type !== "array") && e.subProperties)
1535
1538
  try {
1536
- const m = {};
1537
- T(Object.values(e.subProperties), "index").filter(
1539
+ const h = {};
1540
+ V(Object.values(e.subProperties), "index").filter(
1538
1541
  (n) => n.data.visible !== !1 && n.data.key
1539
1542
  ).forEach(({ data: n }) => {
1540
- var s, u, h, w;
1543
+ var s, d, f, w;
1541
1544
  if (!n.key) return;
1542
- let o = ((u = (s = n.locales) == null ? void 0 : s[f]) == null ? void 0 : u.defaultValue) ?? ((w = (h = n.locales) == null ? void 0 : h[l]) == null ? void 0 : w.defaultValue);
1545
+ let o = ((d = (s = n.locales) == null ? void 0 : s[m]) == null ? void 0 : d.defaultValue) ?? ((w = (f = n.locales) == null ? void 0 : f[l]) == null ? void 0 : w.defaultValue);
1543
1546
  if (n.type === "number")
1544
1547
  o = Number(o);
1545
1548
  else if (n.type === "boolean")
@@ -1550,28 +1553,27 @@ function Br({
1550
1553
  } catch (c) {
1551
1554
  console.error("Error parsing nested value", o, c), o = {};
1552
1555
  }
1553
- m[n.key] = o;
1556
+ h[n.key] = o;
1554
1557
  });
1555
- const b = ge(m, e.type);
1556
- i == null || i(b);
1557
- } catch (m) {
1558
- console.error("Error converting structure to text:", m);
1558
+ const b = ge(h, e.type);
1559
+ r == null || r(b);
1560
+ } catch (h) {
1561
+ console.error("Error converting structure to text:", h);
1559
1562
  }
1560
- }, [e, f, l, i]);
1561
- return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(j, { direction: "column", gap: 1.5, sx: { width: "100%" }, children: [
1562
- /* @__PURE__ */ t(Ct, { sx: { mt: -1 }, children: /* @__PURE__ */ t(F, { variant: "caption", color: "text.secondary", children: a("maker.properties.subProperties") }) }),
1563
+ }, [e, m, l, r]);
1564
+ return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ S(j, { direction: "column", gap: 1.5, sx: { width: "100%" }, ref: a, children: [
1565
+ /* @__PURE__ */ t(Ct, { sx: { mt: -1 }, children: /* @__PURE__ */ t(F, { variant: "caption", color: "text.secondary", children: u("maker.properties.subProperties") }) }),
1563
1566
  e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ t(
1564
1567
  ft,
1565
1568
  {
1566
1569
  component: j,
1567
1570
  gap: 2,
1568
1571
  list: e.subProperties,
1569
- renderItem: (m, x, b) => {
1570
- const n = m.visible !== !1;
1572
+ renderItem: (h, x, b) => {
1573
+ const n = h.visible !== !1;
1571
1574
  return /* @__PURE__ */ t(
1572
1575
  re,
1573
1576
  {
1574
- ref: d,
1575
1577
  elevation: 0,
1576
1578
  className: "property-container",
1577
1579
  sx: {
@@ -1583,24 +1585,24 @@ function Br({
1583
1585
  children: /* @__PURE__ */ t(j, { gap: 2, children: /* @__PURE__ */ t(
1584
1586
  yt,
1585
1587
  {
1586
- data: m,
1588
+ data: h,
1587
1589
  params: b,
1588
1590
  visible: n,
1589
1591
  config: {
1590
1592
  properties: e.subProperties
1591
1593
  },
1592
- currentLocale: f,
1594
+ currentLocale: m,
1593
1595
  defaultLocale: l,
1594
- allComponents: r,
1596
+ allComponents: i,
1595
1597
  onUpdateConfig: (o) => {
1596
1598
  try {
1597
1599
  const s = { properties: e.subProperties || {} };
1598
1600
  o(s);
1599
- const u = {
1601
+ const d = {
1600
1602
  ...e,
1601
1603
  subProperties: s.properties
1602
1604
  };
1603
- i == null || i(u, { forceUpdateProperty: !0 }), k();
1605
+ r == null || r(d, { forceUpdateProperty: !0 }), k();
1604
1606
  } catch (s) {
1605
1607
  console.error("Error updating property:", s);
1606
1608
  }
@@ -1608,13 +1610,13 @@ function Br({
1608
1610
  }
1609
1611
  ) })
1610
1612
  },
1611
- m.id
1613
+ h.id
1612
1614
  );
1613
1615
  }
1614
1616
  }
1615
- ) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: 100 }, children: a("maker.properties.noSubProperties") }),
1617
+ ) : /* @__PURE__ */ t(te, { style: { fontSize: 12, height: 100 }, children: u("maker.properties.noSubProperties") }),
1616
1618
  /* @__PURE__ */ t(
1617
- V,
1619
+ T,
1618
1620
  {
1619
1621
  fullWidth: !0,
1620
1622
  variant: "outlined",
@@ -1623,15 +1625,15 @@ function Br({
1623
1625
  startIcon: /* @__PURE__ */ t(at, {}),
1624
1626
  onClick: () => {
1625
1627
  try {
1626
- const m = e.subProperties || {}, x = $e(), n = {
1627
- index: Object.values(m).length,
1628
+ const h = e.subProperties || {}, x = $e(), n = {
1629
+ index: Object.values(h).length,
1628
1630
  data: {
1629
1631
  id: x,
1630
1632
  key: "",
1631
1633
  type: "string",
1632
1634
  visible: !0,
1633
1635
  locales: {
1634
- [f]: {
1636
+ [m]: {
1635
1637
  name: "",
1636
1638
  defaultValue: ""
1637
1639
  }
@@ -1642,13 +1644,13 @@ function Br({
1642
1644
  }, o = {
1643
1645
  ...e,
1644
1646
  subProperties: {
1645
- ...m,
1647
+ ...h,
1646
1648
  [x]: n
1647
1649
  }
1648
1650
  };
1649
- i == null || i(o, { forceUpdateProperty: !0 }), k();
1650
- } catch (m) {
1651
- console.error("Error adding property:", m);
1651
+ r == null || r(o, { forceUpdateProperty: !0 }), k();
1652
+ } catch (h) {
1653
+ console.error("Error adding property:", h);
1652
1654
  }
1653
1655
  },
1654
1656
  sx: {
@@ -1656,32 +1658,32 @@ function Br({
1656
1658
  // borderLeft: undefined,
1657
1659
  })
1658
1660
  },
1659
- children: a("maker.properties.addSubProperty")
1661
+ children: u("maker.properties.addSubProperty")
1660
1662
  }
1661
1663
  )
1662
1664
  ] });
1663
1665
  }
1664
1666
  function K({
1665
1667
  component: e,
1666
- property: i,
1668
+ property: r,
1667
1669
  value: l,
1668
- onChange: r,
1669
- valueImmutable: a,
1670
- defaultLocale: f,
1671
- allComponents: d,
1670
+ onChange: i,
1671
+ valueImmutable: u,
1672
+ defaultLocale: m,
1673
+ allComponents: a,
1672
1674
  ...p
1673
1675
  }) {
1674
- var o, s, u, h, w;
1675
- const { locale: k } = A(), m = Zt(), x = J(null), b = () => {
1676
+ var o, s, d, f, w;
1677
+ const { locale: k } = A(), h = Zt(), x = J(null), b = () => {
1676
1678
  var v;
1677
- const c = (v = m == null ? void 0 : m.current) == null ? void 0 : v.getUploader();
1679
+ const c = (v = h == null ? void 0 : h.current) == null ? void 0 : v.getUploader();
1678
1680
  c == null || c.open(), x.current && c.onceUploadSuccess(({ response: g }) => {
1679
1681
  var C, y;
1680
1682
  let P = ((C = g == null ? void 0 : g.data) == null ? void 0 : C.filename) || "";
1681
1683
  P && (P = `mediakit://${P}`, l && !l.includes("mediakit://") && (P += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), (y = x.current) == null || y.call(x, P);
1682
1684
  });
1683
- }, n = p.label || ((s = (o = i.locales) == null ? void 0 : o[k]) == null ? void 0 : s.name) || ((h = (u = i.locales) == null ? void 0 : u[f]) == null ? void 0 : h.name) || i.key || i.id;
1684
- if (i.type === "number")
1685
+ }, n = p.label || ((s = (o = r.locales) == null ? void 0 : o[k]) == null ? void 0 : s.name) || ((f = (d = r.locales) == null ? void 0 : d[m]) == null ? void 0 : f.name) || r.key || r.id;
1686
+ if (r.type === "number")
1685
1687
  return /* @__PURE__ */ t(
1686
1688
  Kr,
1687
1689
  {
@@ -1689,11 +1691,11 @@ function K({
1689
1691
  label: n,
1690
1692
  NumberProps: {
1691
1693
  value: ["number", "string"].includes(typeof l) ? l : null,
1692
- onChange: (c, v) => r == null ? void 0 : r(v)
1694
+ onChange: (c, v) => i == null ? void 0 : i(v)
1693
1695
  }
1694
1696
  }
1695
1697
  );
1696
- if (i.type === "decimal")
1698
+ if (r.type === "decimal")
1697
1699
  return /* @__PURE__ */ t(
1698
1700
  D,
1699
1701
  {
@@ -1704,81 +1706,81 @@ function K({
1704
1706
  onChange: (c) => {
1705
1707
  const v = c.target.value;
1706
1708
  if (v === "" || v === "-") {
1707
- r == null || r(v);
1709
+ i == null || i(v);
1708
1710
  return;
1709
1711
  }
1710
1712
  if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(v)) {
1711
1713
  let P = v;
1712
- /^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(P) && (P = Number(P)), r == null || r(P);
1714
+ /^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(P) && (P = Number(P)), i == null || i(P);
1713
1715
  }
1714
1716
  }
1715
1717
  }
1716
1718
  );
1717
- if (i.type === "boolean")
1719
+ if (r.type === "boolean")
1718
1720
  return /* @__PURE__ */ t(
1719
1721
  Ge,
1720
1722
  {
1721
1723
  label: n,
1722
1724
  labelPlacement: "start",
1723
- control: /* @__PURE__ */ t(qe, { checked: l === !0, onChange: (c, v) => r == null ? void 0 : r(v) })
1725
+ control: /* @__PURE__ */ t(Le, { checked: l === !0, onChange: (c, v) => i == null ? void 0 : i(v) })
1724
1726
  }
1725
1727
  );
1726
- if (i.type === "color")
1728
+ if (r.type === "color")
1727
1729
  return /* @__PURE__ */ t(
1728
1730
  Cr,
1729
1731
  {
1730
1732
  label: n,
1731
1733
  value: l,
1732
1734
  onChange: (c) => {
1733
- r == null || r(c);
1735
+ i == null || i(c);
1734
1736
  }
1735
1737
  }
1736
1738
  );
1737
- if (i.type === "json" || i.type === "yaml")
1739
+ if (r.type === "json" || r.type === "yaml")
1738
1740
  return /* @__PURE__ */ t(
1739
1741
  jr,
1740
1742
  {
1741
1743
  label: n,
1742
1744
  value: l,
1743
1745
  onChange: (c) => {
1744
- r == null || r(c);
1746
+ i == null || i(c);
1745
1747
  },
1746
- property: i,
1748
+ property: r,
1747
1749
  component: e,
1748
- defaultLocale: f,
1749
- allComponents: d,
1750
+ defaultLocale: m,
1751
+ allComponents: a,
1750
1752
  PropertyValueField: K,
1751
1753
  onUpload: (c) => {
1752
1754
  x.current = c, b();
1753
1755
  }
1754
1756
  }
1755
1757
  );
1756
- if (i.type === "custom") {
1757
- const c = (w = d[i.componentId]) == null ? void 0 : w.data;
1758
+ if (r.type === "custom") {
1759
+ const c = (w = a[r.componentId]) == null ? void 0 : w.data;
1758
1760
  return c ? /* @__PURE__ */ t(O, { width: "100%", children: /* @__PURE__ */ t(
1759
1761
  ot,
1760
1762
  {
1761
1763
  componentId: c.id,
1762
- props: { label: n, value: l, onChange: r },
1764
+ props: { label: n, value: l, onChange: i },
1763
1765
  locale: k,
1764
1766
  dev: {
1765
1767
  mode: "draft",
1766
- components: d,
1767
- defaultLocale: f
1768
+ components: a,
1769
+ defaultLocale: m
1768
1770
  }
1769
1771
  }
1770
1772
  ) }) : /* @__PURE__ */ t(D, { ...p, label: n, disabled: !0, placeholder: "Click right button select a component" });
1771
1773
  }
1772
- if (i.type === "component")
1774
+ if (r.type === "component")
1773
1775
  return /* @__PURE__ */ S(j, { width: "100%", direction: "row", gap: 1, children: [
1774
1776
  /* @__PURE__ */ t(O, { flex: 1, children: /* @__PURE__ */ t(
1775
1777
  Oe,
1776
1778
  {
1777
- allComponents: d,
1779
+ allComponents: a,
1778
1780
  label: n,
1779
1781
  value: l == null ? void 0 : l.componentId,
1780
1782
  onChange: (c, v) => {
1781
- a || !l ? r == null || r({ ...l && JSON.parse(JSON.stringify(l)), componentId: v }) : typeof l == "object" && (l.componentId = v);
1783
+ u || !l ? i == null || i({ ...l && JSON.parse(JSON.stringify(l)), componentId: v }) : typeof l == "object" && (l.componentId = v);
1782
1784
  }
1783
1785
  }
1784
1786
  ) }),
@@ -1786,15 +1788,15 @@ function K({
1786
1788
  Wr,
1787
1789
  {
1788
1790
  value: l,
1789
- valueImmutable: a,
1790
- onChange: r,
1791
- defaultLocale: f,
1792
- allComponents: d
1791
+ valueImmutable: u,
1792
+ onChange: i,
1793
+ defaultLocale: m,
1794
+ allComponents: a
1793
1795
  }
1794
1796
  ) })
1795
1797
  ] });
1796
- if (!i.type || ["string", "url"].includes(i.type)) {
1797
- const c = i.type === "string" ? i.multiline : void 0, v = i.type === "url" ? l == null ? void 0 : l.url : l;
1798
+ if (!r.type || ["string", "url"].includes(r.type)) {
1799
+ const c = r.type === "string" ? r.multiline : void 0, v = r.type === "url" ? l == null ? void 0 : l.url : l;
1798
1800
  return /* @__PURE__ */ t(
1799
1801
  D,
1800
1802
  {
@@ -1804,10 +1806,10 @@ function K({
1804
1806
  multiline: c,
1805
1807
  minRows: c ? 2 : void 0,
1806
1808
  maxRows: c ? 10 : void 0,
1807
- onChange: (g) => r == null ? void 0 : r(
1808
- i.type === "url" ? { ...l, url: g.target.value, mediaKitUrl: g.target.value } : g.target.value
1809
+ onChange: (g) => i == null ? void 0 : i(
1810
+ r.type === "url" ? { ...l, url: g.target.value, mediaKitUrl: g.target.value } : g.target.value
1809
1811
  ),
1810
- InputProps: i.type === "url" ? {
1812
+ InputProps: r.type === "url" ? {
1811
1813
  sx: { pr: 0 },
1812
1814
  endAdornment: /* @__PURE__ */ S(ue, { position: "end", children: [
1813
1815
  /* @__PURE__ */ t(
@@ -1820,7 +1822,7 @@ function K({
1820
1822
  P && (C = await fe(P).catch(() => be(P)).catch(() => {
1821
1823
  }));
1822
1824
  let y = ((R = g == null ? void 0 : g.data) == null ? void 0 : R.filename) || "";
1823
- y && (y = `mediakit://${y}`), r == null || r({
1825
+ y && (y = `mediakit://${y}`), i == null || i({
1824
1826
  url: P,
1825
1827
  mediaKitUrl: y,
1826
1828
  width: C == null ? void 0 : C.naturalWidth,
@@ -1835,14 +1837,14 @@ function K({
1835
1837
  }
1836
1838
  );
1837
1839
  }
1838
- return i.type === "array" ? /* @__PURE__ */ t(
1840
+ return r.type === "array" ? /* @__PURE__ */ t(
1839
1841
  kr,
1840
1842
  {
1841
1843
  label: n,
1842
1844
  value: Array.isArray(l) ? l : [],
1843
- onChange: (c) => r == null ? void 0 : r(c),
1844
- property: i,
1845
- renderItem: ({ item: c, index: v, onChange: g }) => i.subProperties && Object.keys(i.subProperties).length > 0 ? /* @__PURE__ */ t(j, { gap: 1, width: "100%", children: T(Object.values(i.subProperties), "index").filter((P) => P.data.visible !== !1).map(({ data: P }) => P.key ? /* @__PURE__ */ t(
1845
+ onChange: (c) => i == null ? void 0 : i(c),
1846
+ property: r,
1847
+ renderItem: ({ item: c, index: v, onChange: g }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(j, { gap: 1, width: "100%", children: V(Object.values(r.subProperties), "index").filter((P) => P.data.visible !== !1).map(({ data: P }) => P.key ? /* @__PURE__ */ t(
1846
1848
  K,
1847
1849
  {
1848
1850
  component: e,
@@ -1854,20 +1856,20 @@ function K({
1854
1856
  },
1855
1857
  size: "small",
1856
1858
  fullWidth: !0,
1857
- defaultLocale: f,
1858
- allComponents: d
1859
+ defaultLocale: m,
1860
+ allComponents: a
1859
1861
  },
1860
1862
  P.id
1861
1863
  ) : null) }, v) : /* @__PURE__ */ t(D, { size: p.size, fullWidth: !0, value: c, onChange: (P) => g(P.target.value) })
1862
1864
  }
1863
- ) : (console.error("Unsupported property type", i.type), null);
1865
+ ) : (console.error("Unsupported property type", r.type), null);
1864
1866
  }
1865
1867
  function Kr({
1866
1868
  NumberProps: e,
1867
- ...i
1869
+ ...r
1868
1870
  }) {
1869
- const { getInputProps: l } = ir(e), r = l();
1870
- return /* @__PURE__ */ t(D, { ...i, inputProps: r });
1871
+ const { getInputProps: l } = ir(e), i = l();
1872
+ return /* @__PURE__ */ t(D, { ...r, inputProps: i });
1871
1873
  }
1872
1874
  const Fr = `import React from '@blocklet/pages-kit/builtin/react'
1873
1875
  import { Box } from '@blocklet/pages-kit/builtin/mui/material'
@@ -1883,20 +1885,20 @@ export default function () {
1883
1885
  function Jr({
1884
1886
  value: e
1885
1887
  }) {
1886
- const { locale: i } = A(), l = it(), r = M(e).doc;
1887
- return H(() => {
1888
- var a;
1889
- (a = e.renderer) != null && a.script || (r.transact(() => {
1888
+ const { locale: r } = A(), l = it(), i = H(e).doc;
1889
+ return M(() => {
1890
+ var u;
1891
+ (u = e.renderer) != null && u.script || (i.transact(() => {
1890
1892
  e.renderer.script = e.renderer.type === "react-component" ? Fr : _r;
1891
1893
  }), l());
1892
1894
  }, [e]), /* @__PURE__ */ t(O, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ t(
1893
1895
  ke,
1894
1896
  {
1895
1897
  keyId: e.id,
1896
- locale: i,
1898
+ locale: r,
1897
1899
  language: "typescript",
1898
1900
  value: e.renderer.script || "",
1899
- onChange: (a) => e.renderer.script = a,
1901
+ onChange: (u) => e.renderer.script = u,
1900
1902
  typeScriptNoValidation: !1
1901
1903
  },
1902
1904
  e.id
@@ -1904,14 +1906,14 @@ function Jr({
1904
1906
  }
1905
1907
  function $r({ value: e }) {
1906
1908
  var x, b, n;
1907
- const { t: i } = A(), l = M(e).doc, {
1909
+ const { t: r } = A(), l = H(e).doc, {
1908
1910
  state: {
1909
- components: r,
1910
- config: { defaultLocale: a },
1911
- resources: f
1911
+ components: i,
1912
+ config: { defaultLocale: u },
1913
+ resources: m
1912
1914
  },
1913
- localState: { currentLocale: d }
1914
- } = de(), p = xe(), k = ((x = r[e.renderer.componentId]) == null ? void 0 : x.data) ?? ((n = (b = f.components) == null ? void 0 : b[e.renderer.componentId]) == null ? void 0 : n.component), m = pe({ variant: "dialog" });
1915
+ localState: { currentLocale: a }
1916
+ } = de(), p = xe(), k = ((x = i[e.renderer.componentId]) == null ? void 0 : x.data) ?? ((n = (b = m.components) == null ? void 0 : b[e.renderer.componentId]) == null ? void 0 : n.component), h = pe({ variant: "dialog" });
1915
1917
  return /* @__PURE__ */ S(j, { gap: 1, children: [
1916
1918
  /* @__PURE__ */ t(
1917
1919
  Oe,
@@ -1924,50 +1926,50 @@ function $r({ value: e }) {
1924
1926
  ),
1925
1927
  k && /* @__PURE__ */ S($, { children: [
1926
1928
  /* @__PURE__ */ S(j, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1927
- /* @__PURE__ */ t(F, { variant: "subtitle2", children: i("parameters") }),
1928
- /* @__PURE__ */ t(V, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...me(m), children: /* @__PURE__ */ t(ct, { fontSize: "small" }) })
1929
+ /* @__PURE__ */ t(F, { variant: "subtitle2", children: r("parameters") }),
1930
+ /* @__PURE__ */ t(T, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...me(h), children: /* @__PURE__ */ t(ct, { fontSize: "small" }) })
1929
1931
  ] }),
1930
- k.properties && T(Object.values(k.properties), "index").map(({ data: o }) => {
1931
- var s, u, h, w, c, v, g, P, C, y, I, z, R, E, U, W;
1932
+ k.properties && V(Object.values(k.properties), "index").map(({ data: o }) => {
1933
+ var s, d, f, w, c, v, g, P, C, y, I, z, R, E, U, W;
1932
1934
  return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
1933
1935
  K,
1934
1936
  {
1935
1937
  allComponents: p,
1936
- defaultLocale: a,
1938
+ defaultLocale: u,
1937
1939
  component: k,
1938
1940
  property: o,
1939
1941
  fullWidth: !0,
1940
1942
  size: "small",
1941
- valueImmutable: ee((w = (h = (u = (s = e.renderer.properties) == null ? void 0 : s[o.id]) == null ? void 0 : u.locales) == null ? void 0 : h[d]) == null ? void 0 : w.value),
1942
- value: ((P = (g = (v = (c = e.renderer.properties) == null ? void 0 : c[o.id]) == null ? void 0 : v.locales) == null ? void 0 : g[d]) == null ? void 0 : P.value) ?? ((z = (I = (y = (C = e.renderer.properties) == null ? void 0 : C[o.id]) == null ? void 0 : y.locales) == null ? void 0 : I[a]) == null ? void 0 : z.value) ?? ((E = (R = o.locales) == null ? void 0 : R[d]) == null ? void 0 : E.defaultValue) ?? ((W = (U = o.locales) == null ? void 0 : U[a]) == null ? void 0 : W.defaultValue),
1943
+ valueImmutable: ee((w = (f = (d = (s = e.renderer.properties) == null ? void 0 : s[o.id]) == null ? void 0 : d.locales) == null ? void 0 : f[a]) == null ? void 0 : w.value),
1944
+ value: ((P = (g = (v = (c = e.renderer.properties) == null ? void 0 : c[o.id]) == null ? void 0 : v.locales) == null ? void 0 : g[a]) == null ? void 0 : P.value) ?? ((z = (I = (y = (C = e.renderer.properties) == null ? void 0 : C[o.id]) == null ? void 0 : y.locales) == null ? void 0 : I[u]) == null ? void 0 : z.value) ?? ((E = (R = o.locales) == null ? void 0 : R[a]) == null ? void 0 : E.defaultValue) ?? ((W = (U = o.locales) == null ? void 0 : U[u]) == null ? void 0 : W.defaultValue),
1943
1945
  onChange: (ie) => {
1944
1946
  l.transact(() => {
1945
- var Y, G, q, L, Q;
1946
- (Y = e.renderer).properties ?? (Y.properties = {}), (G = e.renderer.properties)[q = o.id] ?? (G[q] = {}), (L = e.renderer.properties[o.id]).locales ?? (L.locales = {}), (Q = e.renderer.properties[o.id].locales)[d] ?? (Q[d] = {}), e.renderer.properties[o.id].locales[d].value = ie;
1947
+ var Y, G, L, q, Q;
1948
+ (Y = e.renderer).properties ?? (Y.properties = {}), (G = e.renderer.properties)[L = o.id] ?? (G[L] = {}), (q = e.renderer.properties[o.id]).locales ?? (q.locales = {}), (Q = e.renderer.properties[o.id].locales)[a] ?? (Q[a] = {}), e.renderer.properties[o.id].locales[a].value = ie;
1947
1949
  });
1948
1950
  }
1949
1951
  }
1950
1952
  ) }, o.id);
1951
1953
  }),
1952
- /* @__PURE__ */ t(vt, { ...pt(m), component: e, type: "parameters" })
1954
+ /* @__PURE__ */ t(vt, { ...pt(h), component: e, type: "parameters" })
1953
1955
  ] })
1954
1956
  ] });
1955
1957
  }
1956
1958
  function Oe({
1957
1959
  label: e,
1958
- options: i,
1960
+ options: r,
1959
1961
  excludes: l,
1960
- value: r,
1961
- onChange: a,
1962
- allComponents: f,
1963
- ...d
1962
+ value: i,
1963
+ onChange: u,
1964
+ allComponents: m,
1965
+ ...a
1964
1966
  }) {
1965
1967
  var x;
1966
- const { t: p } = A(), k = i ?? T(Object.values(mr(f, ...l ?? [])), "index").map((b) => b.data), m = (typeof r == "string" ? (x = f[r]) == null ? void 0 : x.data : void 0) ?? null;
1968
+ const { t: p } = A(), k = r ?? V(Object.values(mr(m, ...l ?? [])), "index").map((b) => b.data), h = (typeof i == "string" ? (x = m[i]) == null ? void 0 : x.data : void 0) ?? null;
1967
1969
  return /* @__PURE__ */ t(
1968
1970
  Ze,
1969
1971
  {
1970
- ...d,
1972
+ ...a,
1971
1973
  size: "small",
1972
1974
  options: k,
1973
1975
  autoHighlight: !0,
@@ -1975,113 +1977,113 @@ function Oe({
1975
1977
  getOptionKey: (b) => b.id,
1976
1978
  getOptionLabel: (b) => b.name || b.id,
1977
1979
  renderInput: (b) => /* @__PURE__ */ t(D, { label: e || p("component"), ...b }),
1978
- value: m,
1980
+ value: h,
1979
1981
  onChange: (b, n) => {
1980
- var s, u, h, w, c, v;
1982
+ var s, d, f, w, c, v;
1981
1983
  let o = {};
1982
1984
  n && (o = {
1983
- blockletId: (s = f[n == null ? void 0 : n.id]) == null ? void 0 : s.blockletId,
1984
- blockletTitle: (u = f[n == null ? void 0 : n.id]) == null ? void 0 : u.blockletTitle,
1985
- componentName: ((w = (h = f[n == null ? void 0 : n.id]) == null ? void 0 : h.data) == null ? void 0 : w.name) || ((v = (c = f[n == null ? void 0 : n.id]) == null ? void 0 : c.data) == null ? void 0 : v.id)
1986
- }), a == null || a(b, n == null ? void 0 : n.id, o);
1985
+ blockletId: (s = m[n == null ? void 0 : n.id]) == null ? void 0 : s.blockletId,
1986
+ blockletTitle: (d = m[n == null ? void 0 : n.id]) == null ? void 0 : d.blockletTitle,
1987
+ componentName: ((w = (f = m[n == null ? void 0 : n.id]) == null ? void 0 : f.data) == null ? void 0 : w.name) || ((v = (c = m[n == null ? void 0 : n.id]) == null ? void 0 : c.data) == null ? void 0 : v.id)
1988
+ }), u == null || u(b, n == null ? void 0 : n.id, o);
1987
1989
  }
1988
1990
  }
1989
1991
  );
1990
1992
  }
1991
- function Hr({
1993
+ function Mr({
1992
1994
  config: e,
1993
- allComponents: i,
1995
+ allComponents: r,
1994
1996
  defaultLocale: l,
1995
- propertiesValue: r,
1996
- currentLocale: a,
1997
- onChange: f,
1998
- props: d
1997
+ propertiesValue: i,
1998
+ currentLocale: u,
1999
+ onChange: m,
2000
+ props: a
1999
2001
  }) {
2000
- const { t: p } = A(), [k, m] = Z(e == null ? void 0 : e.properties), [x, b] = Z(null);
2001
- H(() => {
2002
+ const { t: p } = A(), [k, h] = Z(e == null ? void 0 : e.properties), [x, b] = Z(null);
2003
+ M(() => {
2002
2004
  (() => {
2003
2005
  var w, c;
2004
2006
  ((w = e == null ? void 0 : e.renderer) == null ? void 0 : w.type) === "react-component" && lt(e == null ? void 0 : e.properties) ? tr((c = e == null ? void 0 : e.renderer) == null ? void 0 : c.script).then((v) => {
2005
2007
  const g = rr(v);
2006
- m(g);
2007
- }) : m(e == null ? void 0 : e.properties);
2008
+ h(g);
2009
+ }) : h(e == null ? void 0 : e.properties);
2008
2010
  })();
2009
2011
  }, [JSON.stringify(e)]);
2010
2012
  const n = N(() => !e || !k ? {} : Object.values(k).reduce(
2011
- (h, { data: w }) => {
2013
+ (f, { data: w }) => {
2012
2014
  var v, g, P, C, y;
2013
2015
  const c = w.key || w.id;
2014
- return h[w.id] = {
2016
+ return f[w.id] = {
2015
2017
  key: c,
2016
- value: (d == null ? void 0 : d[c]) ?? ((v = r == null ? void 0 : r[w.id]) == null ? void 0 : v.value) ?? ((P = (g = w.locales) == null ? void 0 : g[a]) == null ? void 0 : P.defaultValue) ?? ((y = (C = w.locales) == null ? void 0 : C[l]) == null ? void 0 : y.defaultValue),
2018
+ value: (a == null ? void 0 : a[c]) ?? ((v = i == null ? void 0 : i[w.id]) == null ? void 0 : v.value) ?? ((P = (g = w.locales) == null ? void 0 : g[u]) == null ? void 0 : P.defaultValue) ?? ((y = (C = w.locales) == null ? void 0 : C[l]) == null ? void 0 : y.defaultValue),
2017
2019
  id: w.id,
2018
2020
  type: w.type
2019
- }, h;
2021
+ }, f;
2020
2022
  },
2021
2023
  {}
2022
- ), [JSON.stringify(k), e, r, a, l]), o = ae(() => {
2024
+ ), [JSON.stringify(k), e, i, u, l]), o = ae(() => {
2023
2025
  if (!k)
2024
2026
  return {
2025
2027
  canUseProperties: [],
2026
2028
  visibleProperties: [],
2027
2029
  canUsePropertiesKeys: []
2028
2030
  };
2029
- const h = T(Object.values(k), "index"), w = h.filter(({ data: g }) => g.key && bt(k, g.id)), c = h.filter(({ data: g }) => g.key), v = c.map(({ data: g }) => g.key);
2031
+ const f = V(Object.values(k), "index"), w = f.filter(({ data: g }) => g.key && bt(k, g.id)), c = f.filter(({ data: g }) => g.key), v = c.map(({ data: g }) => g.key);
2030
2032
  return {
2031
2033
  canUseProperties: c,
2032
2034
  visibleProperties: w,
2033
2035
  canUsePropertiesKeys: v
2034
2036
  };
2035
- }, [JSON.stringify(k)]), s = n(), u = pr(s, "key");
2037
+ }, [JSON.stringify(k)]), s = n(), d = pr(s, "key");
2036
2038
  return /* @__PURE__ */ t(Se, { children: /* @__PURE__ */ S(j, { gap: 2, children: [
2037
2039
  /* @__PURE__ */ t(F, { variant: "subtitle1", children: p("maker.properties.parameters") }),
2038
2040
  !e || o.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ t(te, { style: { fontSize: 12 }, children: p("maker.properties.noParameters") }) : /* @__PURE__ */ S($, { children: [
2039
- /* @__PURE__ */ t(j, { gap: 2, children: o.visibleProperties.map(({ data: h }) => {
2041
+ /* @__PURE__ */ t(j, { gap: 2, children: o.visibleProperties.map(({ data: f }) => {
2040
2042
  var w, c;
2041
2043
  return /* @__PURE__ */ t(O, { children: /* @__PURE__ */ t(
2042
2044
  K,
2043
2045
  {
2044
- allComponents: i,
2046
+ allComponents: r,
2045
2047
  defaultLocale: l,
2046
2048
  size: "small",
2047
2049
  fullWidth: !0,
2048
2050
  component: e,
2049
- property: h,
2050
- valueImmutable: ee((w = r == null ? void 0 : r[h.id]) == null ? void 0 : w.value),
2051
- value: (d == null ? void 0 : d[h.key || h.id]) ?? ((c = s[h.id]) == null ? void 0 : c.value),
2051
+ property: f,
2052
+ valueImmutable: ee((w = i == null ? void 0 : i[f.id]) == null ? void 0 : w.value),
2053
+ value: (a == null ? void 0 : a[f.key || f.id]) ?? ((c = s[f.id]) == null ? void 0 : c.value),
2052
2054
  onChange: (v) => {
2053
- f({
2054
- path: ["properties", h.id],
2055
+ m({
2056
+ path: ["properties", f.id],
2055
2057
  value: { value: v },
2056
- shouldSync: !(!h.type || Ke.includes(h.type)),
2058
+ shouldSync: !(!f.type || Ke.includes(f.type)),
2057
2059
  excludeKeys: [],
2058
- key: h.key || h.id
2060
+ key: f.key || f.id
2059
2061
  });
2060
2062
  }
2061
2063
  }
2062
- ) }, h.id);
2064
+ ) }, f.id);
2063
2065
  }) }),
2064
2066
  /* @__PURE__ */ t(j, { gap: 2, sx: { width: "100%" }, children: /* @__PURE__ */ t(
2065
2067
  ot,
2066
2068
  {
2067
2069
  componentId: (e == null ? void 0 : e.id) || "",
2068
2070
  renderType: "setting",
2069
- locale: a,
2071
+ locale: u,
2070
2072
  properties: s,
2071
- dev: { mode: "draft", components: i, defaultLocale: l },
2073
+ dev: { mode: "draft", components: r, defaultLocale: l },
2072
2074
  props: {
2073
- ...hr(d ?? {}, o.canUsePropertiesKeys),
2074
- onChange: (h) => {
2075
+ ...hr(a ?? {}, o.canUsePropertiesKeys),
2076
+ onChange: (f) => {
2075
2077
  const { canUsePropertiesKeys: w } = o;
2076
- Object.keys(h).filter((v) => {
2078
+ Object.keys(f).filter((v) => {
2077
2079
  var g;
2078
- return h[v] !== ((g = u == null ? void 0 : u[v]) == null ? void 0 : g.value);
2079
- }).filter((v) => !(v === "locale" && !dr(u[v], "locale"))).reduce((v, g) => v.then(() => {
2080
- const P = u[g], C = w.includes(g);
2080
+ return f[v] !== ((g = d == null ? void 0 : d[v]) == null ? void 0 : g.value);
2081
+ }).filter((v) => !(v === "locale" && !dr(d[v], "locale"))).reduce((v, g) => v.then(() => {
2082
+ const P = d[g], C = w.includes(g);
2081
2083
  if (P != null && P.id && C)
2082
- return f({
2084
+ return m({
2083
2085
  path: ["properties", P.id],
2084
- value: { value: h[g] },
2086
+ value: { value: f[g] },
2085
2087
  shouldSync: !(!P.type || Ke.includes(P.type)),
2086
2088
  excludeKeys: [],
2087
2089
  key: P.key || P.id
@@ -2108,12 +2110,12 @@ function Hr({
2108
2110
  ] }) });
2109
2111
  }
2110
2112
  export {
2111
- Vr as BasicInfo,
2113
+ Tr as BasicInfo,
2112
2114
  Oe as CustomComponentAutocomplete,
2113
- Vi as CustomComponentSettings,
2115
+ Ti as CustomComponentSettings,
2114
2116
  Fr as DefaultReactComponentScriptTemplate,
2115
2117
  _r as DefaultWebComponentScriptTemplate,
2116
- Hr as ParametersConfig,
2118
+ Mr as ParametersConfig,
2117
2119
  Er as PropertiesConfig,
2118
2120
  K as PropertyValueField
2119
2121
  };