@blocklet/pages-kit-inner-components 0.0.16 → 0.0.17

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,71 +1,71 @@
1
- import { jsx as e, jsxs as I, Fragment as $ } from "react/jsx-runtime";
2
- import { g as Z, i as Re, b as ze, h as re, E as qe, n as Qe, j as ce } from "../state-CETtldI3.mjs";
3
- import { TextField as V, Stack as R, FormControlLabel as Ve, Switch as Pe, Box as S, InputAdornment as de, Dialog as ae, DialogTitle as Oe, DialogContent as je, DialogActions as Ce, Button as N, alpha as Xe, Tooltip as ne, buttonClasses as Ze, Typography as Q, Autocomplete as Ae, MenuItem as T, FormLabel as Le, Popper as Te, Paper as Be, Table as et, TableHead as tt, TableRow as Se, TableCell as ke, TableBody as rt } from "@mui/material";
4
- import { forwardRef as We, useState as Ne, useEffect as L, useImperativeHandle as Ee, lazy as it, useCallback as ee, Suspense as lt, useRef as M, useId as nt } from "react";
5
- import ot from "@arcblock/ux/lib/Empty";
1
+ import { jsx as e, jsxs as S, Fragment as $ } from "react/jsx-runtime";
2
+ import { g as ye, i as we, b as De, h as te, E as Ge, n as Me, j as se } from "../state-CETtldI3.mjs";
3
+ import { TextField as V, Stack as R, FormControlLabel as Re, Switch as ze, Box as w, InputAdornment as ce, Dialog as Ce, DialogTitle as Ve, DialogContent as Pe, DialogActions as Oe, Button as N, alpha as qe, Tooltip as le, buttonClasses as Qe, Typography as Q, Autocomplete as je, MenuItem as A, FormLabel as Xe, Popper as Te, Paper as Ae, Table as Ze, TableHead as Le, TableRow as Ie, TableCell as Se, TableBody as et } from "@mui/material";
4
+ import { forwardRef as Be, useState as tt, useEffect as Z, useImperativeHandle as We, lazy as rt, useCallback as L, Suspense as it, useRef as M, useId as lt } from "react";
5
+ import nt from "@arcblock/ux/lib/Empty";
6
6
  import { useLocaleContext as W } from "@arcblock/ux/lib/Locale/context";
7
- import { styled as st } from "@arcblock/ux/lib/Theme";
8
- import { cx as ct } from "@emotion/css";
9
- import { useReactive as dt, useBoolean as at, useUpdate as ut } from "ahooks";
10
- import De from "gradient-parser";
7
+ import { styled as ot } from "@arcblock/ux/lib/Theme";
8
+ import { cx as st } from "@emotion/css";
9
+ import { useReactive as ct, useBoolean as dt, useUpdate as at } from "ahooks";
10
+ import ke from "gradient-parser";
11
11
  import "lodash/without";
12
- import pt from "tinycolor2";
13
- import { red as mt, pink as ht, purple as ft, indigo as bt, blue as gt, cyan as vt, teal as xt, green as yt, lime as It, yellow as wt, amber as St, orange as kt, brown as Dt, grey as Rt, blueGrey as zt } from "@mui/material/colors";
14
- import { getImageSize as oe, getVideoSize as se, UploaderButton as ue, UploaderProvider as He } from "./uploader.js";
15
- import { Icon as Vt } from "@iconify-icon/react";
16
- import { useDebounce as Pt, useUpdate as Ot } from "react-use";
17
- import { CodeEditor as _e } from "@blocklet/code-editor";
18
- import { CustomComponentRenderer as Fe } from "@blocklet/pages-kit/components";
19
- import { ClickAwayListener as Ue, unstable_useNumberInput as jt } from "@mui/base";
20
- import { DeleteOutlineRounded as Ct, DragIndicatorRounded as At, AddRounded as Tt, TranslateRounded as Ke, InfoRounded as Bt, SettingsRounded as $e, StarRounded as Wt } from "@mui/icons-material";
12
+ import ut from "tinycolor2";
13
+ import { red as pt, pink as mt, purple as ht, indigo as ft, blue as bt, cyan as gt, teal as vt, green as xt, lime as yt, yellow as It, amber as St, orange as kt, brown as wt, grey as Dt, blueGrey as Rt } from "@mui/material/colors";
14
+ import { getImageSize as ne, getVideoSize as oe, UploaderButton as Ne, UploaderProvider as zt } from "./uploader.js";
15
+ import { Icon as Ct } from "@iconify-icon/react";
16
+ import { useDebounce as Vt, useUpdate as Pt } from "react-use";
17
+ import { CodeEditor as Ee } from "@blocklet/code-editor";
18
+ import { CustomComponentRenderer as _e } from "@blocklet/pages-kit/components";
19
+ import { ClickAwayListener as He, unstable_useNumberInput as Ot } from "@mui/base";
20
+ import { DeleteOutlineRounded as jt, DragIndicatorRounded as Tt, AddRounded as At, TranslateRounded as Ue, InfoRounded as Bt, SettingsRounded as Fe, StarRounded as Wt } from "@mui/icons-material";
21
21
  import { getYjsValue as J } from "@syncedstore/core";
22
- import { sortBy as X, omit as Nt, isNil as te } from "lodash";
23
- import { usePopupState as ie, bindTrigger as le, bindDialog as Je, bindPopper as Ye } from "material-ui-popup-state/hooks";
22
+ import { sortBy as X, omit as Nt, isNil as ee } from "lodash";
23
+ import { usePopupState as re, bindTrigger as ie, bindDialog as Ke, bindPopper as $e } from "material-ui-popup-state/hooks";
24
24
  import { ErrorBoundary as Et } from "react-error-boundary";
25
- import Ht from "lodash/sortBy";
26
- import { useDrop as Ge, useDrag as _t } from "react-dnd";
27
- mt[300], ht[300], ft[300], // deepPurple['300'],
28
- bt[300], gt[300], // lightBlue['300'],
29
- vt[300], xt[300], yt[300], // lightGreen['300'],
30
- It[300], wt[300], St[300], kt[300], // deepOrange['300'],
31
- Dt[300], Rt[300], zt[300];
32
- const Ft = We(function({ showMarkdown: r, markdown: l, onMarkdownChange: i, showUploader: s, value: a, meta: d, onChange: c, ...b }, v) {
33
- const [u, g] = Ne("");
34
- L(() => {
35
- g(a || "");
36
- }, [a, g]);
37
- const h = async () => {
38
- if (u !== a) {
39
- const n = Z(u);
40
- if (!n) {
41
- c(u, void 0);
25
+ import _t from "lodash/sortBy";
26
+ import { useDrop as Je, useDrag as Ht } from "react-dnd";
27
+ pt[300], mt[300], ht[300], // deepPurple['300'],
28
+ ft[300], bt[300], // lightBlue['300'],
29
+ gt[300], vt[300], xt[300], // lightGreen['300'],
30
+ yt[300], It[300], St[300], kt[300], // deepOrange['300'],
31
+ wt[300], Dt[300], Rt[300];
32
+ const Ut = Be(function({ showMarkdown: r, markdown: n, onMarkdownChange: i, showUploader: s, value: h, meta: d, onChange: c, ...b }, v) {
33
+ const [a, g] = tt("");
34
+ Z(() => {
35
+ g(h || "");
36
+ }, [h, g]);
37
+ const m = async () => {
38
+ if (a !== h) {
39
+ const l = ye(a);
40
+ if (!l) {
41
+ c(a, void 0);
42
42
  return;
43
43
  }
44
- const o = await oe(n).catch(() => se(n)).catch(() => {
44
+ const o = await ne(l).catch(() => oe(l)).catch(() => {
45
45
  });
46
- c(u, { ...o, filename: u });
46
+ c(a, { ...o, filename: a });
47
47
  }
48
48
  };
49
- Pt(
49
+ Vt(
50
50
  () => {
51
- u !== a && c(u);
51
+ a !== h && c(a);
52
52
  },
53
53
  300,
54
- [u]
55
- ), Ee(v, () => ({
56
- submit: h
54
+ [a]
55
+ ), We(v, () => ({
56
+ submit: m
57
57
  }));
58
- const m = {};
59
- return s && (m.InputProps = {
58
+ const p = {};
59
+ return s && (p.InputProps = {
60
60
  sx: { pr: 0 },
61
- endAdornment: /* @__PURE__ */ e(de, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ e(
62
- ue,
61
+ endAdornment: /* @__PURE__ */ e(ce, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ e(
62
+ Ne,
63
63
  {
64
- onChange: async ({ response: n }) => {
64
+ onChange: async ({ response: l }) => {
65
65
  var y;
66
- const o = (y = n == null ? void 0 : n.data) == null ? void 0 : y.filename, f = Z(o) || "";
66
+ const o = (y = l == null ? void 0 : l.data) == null ? void 0 : y.filename, f = ye(o) || "";
67
67
  let x = {};
68
- f && (x = await oe(f).catch(() => se(f)).catch(() => {
68
+ f && (x = await ne(f).catch(() => oe(f)).catch(() => {
69
69
  })), c(o, {
70
70
  ...x,
71
71
  filename: o
@@ -79,40 +79,40 @@ const Ft = We(function({ showMarkdown: r, markdown: l, onMarkdownChange: i, show
79
79
  size: "small",
80
80
  fullWidth: !0,
81
81
  ...b,
82
- label: /* @__PURE__ */ I(R, { direction: "row", spacing: 1, alignItems: "center", children: [
82
+ label: /* @__PURE__ */ S(R, { direction: "row", spacing: 1, alignItems: "center", children: [
83
83
  b.label,
84
- r && /* @__PURE__ */ I($, { children: [
84
+ r && /* @__PURE__ */ S($, { children: [
85
85
  " (",
86
86
  /* @__PURE__ */ e(
87
- Ve,
87
+ Re,
88
88
  {
89
- checked: l,
90
- label: /* @__PURE__ */ e(S, { component: Vt, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
89
+ checked: n,
90
+ label: /* @__PURE__ */ e(w, { component: Ct, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
91
91
  labelPlacement: "start",
92
- control: /* @__PURE__ */ e(Pe, { size: "small" }),
92
+ control: /* @__PURE__ */ e(ze, { size: "small" }),
93
93
  sx: { ml: 0.25, pr: 1 },
94
- onChange: (n, o) => i == null ? void 0 : i(o)
94
+ onChange: (l, o) => i == null ? void 0 : i(o)
95
95
  }
96
96
  ),
97
97
  ")"
98
98
  ] })
99
99
  ] }),
100
100
  InputLabelProps: { shrink: !0, ...b.InputLabelProps },
101
- value: u,
102
- onChange: (n) => g(n.target.value),
103
- ...m,
104
- onKeyDown: (n) => {
105
- n.keyCode !== 229 && n.key === "Enter" && h();
101
+ value: a,
102
+ onChange: (l) => g(l.target.value),
103
+ ...p,
104
+ onKeyDown: (l) => {
105
+ l.keyCode !== 229 && l.key === "Enter" && m();
106
106
  }
107
107
  }
108
108
  );
109
- }), Ut = it(() => import("react-best-gradient-color-picker"));
109
+ }), Ft = rt(() => import("react-best-gradient-color-picker"));
110
110
  function Kt(t) {
111
111
  try {
112
- const l = De.parse(t).map((s) => {
113
- const a = s.colorStops.map((d) => {
112
+ const n = ke.parse(t).map((s) => {
113
+ const h = s.colorStops.map((d) => {
114
114
  if (d.type !== "rgba") {
115
- const c = pt(d.value).toRgb();
115
+ const c = ut(d.value).toRgb();
116
116
  return {
117
117
  ...d,
118
118
  value: [c.r, c.g, c.b, c.a],
@@ -123,19 +123,19 @@ function Kt(t) {
123
123
  });
124
124
  return {
125
125
  ...s,
126
- colorStops: a
126
+ colorStops: h
127
127
  };
128
128
  });
129
- return De.stringify(l);
129
+ return ke.stringify(n);
130
130
  } catch {
131
- return ze(t) ? t : "";
131
+ return De(t) ? t : "";
132
132
  }
133
133
  }
134
- function $t({ color: t, sx: r = {}, ...l }) {
135
- ze(t);
134
+ function $t({ color: t, sx: r = {}, ...n }) {
135
+ De(t);
136
136
  const i = {};
137
- return Re(t) ? i.backgroundImage = t : i.backgroundColor = t, /* @__PURE__ */ e(
138
- S,
137
+ return we(t) ? i.backgroundImage = t : i.backgroundColor = t, /* @__PURE__ */ e(
138
+ w,
139
139
  {
140
140
  sx: {
141
141
  ...r,
@@ -150,33 +150,33 @@ function $t({ color: t, sx: r = {}, ...l }) {
150
150
  },
151
151
  ...i
152
152
  },
153
- ...l
153
+ ...n
154
154
  }
155
155
  );
156
156
  }
157
- const Jt = We(function({ onSave: r }, l) {
158
- const i = dt({
157
+ const Jt = Be(function({ onSave: r }, n) {
158
+ const i = ct({
159
159
  value: ""
160
- }), { t: s } = W(), a = {};
161
- i.value ? Re(i.value) ? a.backgroundImage = i.value : a.backgroundColor = i.value : a.border = "1px solid #ccc";
162
- const [d, { setFalse: c, setTrue: b }] = at(!1), v = ee(() => {
160
+ }), { t: s } = W(), h = {};
161
+ i.value ? we(i.value) ? h.backgroundImage = i.value : h.backgroundColor = i.value : h.border = "1px solid #ccc";
162
+ const [d, { setFalse: c, setTrue: b }] = dt(!1), v = L(() => {
163
163
  c();
164
- }, [c]), u = () => {
164
+ }, [c]), a = () => {
165
165
  r({ value: i.value }, v);
166
166
  };
167
- return Ee(l, () => ({
167
+ return We(n, () => ({
168
168
  open({ value: g } = { value: "" }) {
169
169
  i.value = g, b();
170
170
  },
171
171
  close() {
172
172
  v();
173
173
  }
174
- })), /* @__PURE__ */ I(ae, { open: d, onClose: v, hideBackdrop: !0, children: [
175
- /* @__PURE__ */ e(Oe, { children: s("maker.configBackground") }),
176
- /* @__PURE__ */ e(je, { sx: { width: 600 }, children: /* @__PURE__ */ I(S, { width: "100%", display: "flex", children: [
177
- /* @__PURE__ */ e(S, { flex: 1, mr: 1, sx: a, children: !i.value && /* @__PURE__ */ e(ot, { children: s("error.notConfig") }) }),
178
- /* @__PURE__ */ e(lt, { children: /* @__PURE__ */ e(
179
- Ut,
174
+ })), /* @__PURE__ */ S(Ce, { open: d, onClose: v, hideBackdrop: !0, children: [
175
+ /* @__PURE__ */ e(Ve, { children: s("maker.configBackground") }),
176
+ /* @__PURE__ */ e(Pe, { sx: { width: 600 }, children: /* @__PURE__ */ S(w, { width: "100%", display: "flex", children: [
177
+ /* @__PURE__ */ e(w, { flex: 1, mr: 1, sx: h, children: !i.value && /* @__PURE__ */ e(nt, { children: s("error.notConfig") }) }),
178
+ /* @__PURE__ */ e(it, { children: /* @__PURE__ */ e(
179
+ Ft,
180
180
  {
181
181
  width: 200,
182
182
  height: 200,
@@ -191,13 +191,13 @@ const Jt = We(function({ onSave: r }, l) {
191
191
  }
192
192
  ) })
193
193
  ] }) }),
194
- /* @__PURE__ */ I(Ce, { children: [
194
+ /* @__PURE__ */ S(Oe, { children: [
195
195
  /* @__PURE__ */ e(N, { variant: "outlined", size: "small", onClick: v, children: s("common.cancel") }),
196
- /* @__PURE__ */ e(N, { variant: "contained", size: "small", onClick: u, children: s("maker.save") })
196
+ /* @__PURE__ */ e(N, { variant: "contained", size: "small", onClick: a, children: s("maker.save") })
197
197
  ] })
198
198
  ] });
199
199
  });
200
- st(S)`
200
+ ot(w)`
201
201
  .color-item {
202
202
  position: relative;
203
203
  }
@@ -221,18 +221,18 @@ st(S)`
221
221
  function Yt({
222
222
  value: t,
223
223
  onChange: r,
224
- ...l
224
+ ...n
225
225
  }) {
226
226
  const i = M(null);
227
- return /* @__PURE__ */ I($, { children: [
227
+ return /* @__PURE__ */ S($, { children: [
228
228
  /* @__PURE__ */ e(
229
- Ft,
229
+ Ut,
230
230
  {
231
- ...l,
231
+ ...n,
232
232
  value: t,
233
233
  onChange: r,
234
234
  InputProps: {
235
- endAdornment: /* @__PURE__ */ e(de, { position: "end", children: /* @__PURE__ */ e(
235
+ endAdornment: /* @__PURE__ */ e(ce, { position: "end", children: /* @__PURE__ */ e(
236
236
  $t,
237
237
  {
238
238
  color: t ?? "",
@@ -250,8 +250,8 @@ function Yt({
250
250
  Jt,
251
251
  {
252
252
  ref: i,
253
- onSave: ({ value: s }, a) => {
254
- r(s), a();
253
+ onSave: ({ value: s }, h) => {
254
+ r(s), h();
255
255
  }
256
256
  }
257
257
  )
@@ -260,111 +260,111 @@ function Yt({
260
260
  function Gt({
261
261
  disabled: t,
262
262
  list: r,
263
- renderItem: l,
263
+ renderItem: n,
264
264
  ...i
265
265
  }) {
266
- const s = M(null), a = nt(), d = ut(), c = Ht(Object.entries(r), (m) => m[1].index).map((m) => m[0]), b = M(c), v = ee(
267
- (m) => {
268
- b.current = m, d();
266
+ const s = M(null), h = lt(), d = at(), c = _t(Object.entries(r), (p) => p[1].index).map((p) => p[0]), b = M(c), v = L(
267
+ (p) => {
268
+ b.current = p, d();
269
269
  },
270
270
  [d]
271
- ), u = ee(
272
- ({ index: m }, { index: n }) => {
271
+ ), a = L(
272
+ ({ index: p }, { index: l }) => {
273
273
  const o = [...b.current];
274
- o.splice(n, 0, ...o.splice(m, 1)), v(o);
274
+ o.splice(l, 0, ...o.splice(p, 1)), v(o);
275
275
  },
276
276
  [v]
277
277
  );
278
- L(() => {
278
+ Z(() => {
279
279
  v(c);
280
280
  }, [c.join("-")]);
281
- const [{ isOver: g }, h] = Ge({
282
- accept: a,
283
- collect: (m) => ({
284
- isOver: m.isOver()
281
+ const [{ isOver: g }, m] = Je({
282
+ accept: h,
283
+ collect: (p) => ({
284
+ isOver: p.isOver()
285
285
  }),
286
286
  canDrop: () => !t,
287
287
  drop: () => {
288
288
  var o;
289
- const m = () => {
289
+ const p = () => {
290
290
  b.current.forEach((f, x) => {
291
291
  const y = r[f];
292
292
  y && (y.index = x);
293
293
  });
294
- }, n = (o = J(r)) == null ? void 0 : o.doc;
295
- n ? n.transact(() => {
296
- m();
297
- }) : m();
294
+ }, l = (o = J(r)) == null ? void 0 : o.doc;
295
+ l ? l.transact(() => {
296
+ p();
297
+ }) : p();
298
298
  }
299
299
  });
300
- return L(() => {
300
+ return Z(() => {
301
301
  g || v(c);
302
- }, [g]), h(s), /* @__PURE__ */ e(S, { ...i, ref: s, className: ct(g && "isDragging"), children: b.current.map((m, n) => /* @__PURE__ */ e(
302
+ }, [g]), m(s), /* @__PURE__ */ e(w, { ...i, ref: s, className: st(g && "isDragging"), children: b.current.map((p, l) => /* @__PURE__ */ e(
303
303
  Mt,
304
304
  {
305
- type: a,
305
+ type: h,
306
306
  disabled: t,
307
- id: m,
308
- index: n,
307
+ id: p,
308
+ index: l,
309
309
  itemIndex: (o) => b.current.indexOf(o),
310
- move: u,
310
+ move: a,
311
311
  children: (o) => {
312
- const f = r[m];
313
- return f ? l(f.data, n, o) : null;
312
+ const f = r[p];
313
+ return f ? n(f.data, l, o) : null;
314
314
  }
315
315
  },
316
- m
316
+ p
317
317
  )) });
318
318
  }
319
319
  function Mt({
320
320
  disabled: t,
321
321
  id: r,
322
- index: l,
322
+ index: n,
323
323
  type: i,
324
324
  children: s,
325
- itemIndex: a,
325
+ itemIndex: h,
326
326
  move: d
327
327
  }) {
328
- const c = M(), [{ isDragging: b }, v, u] = _t({
328
+ const c = M(), [{ isDragging: b }, v, a] = Ht({
329
329
  type: i,
330
330
  item: () => ({ id: r }),
331
331
  canDrag: () => !t,
332
- collect: (h) => ({ isDragging: h.isDragging() })
333
- }), [, g] = Ge({
332
+ collect: (m) => ({ isDragging: m.isDragging() })
333
+ }), [, g] = Je({
334
334
  accept: i,
335
335
  canDrop: () => !t,
336
- hover(h, m) {
337
- var w;
336
+ hover(m, p) {
337
+ var I;
338
338
  if (!c.current)
339
339
  return;
340
- const n = a(h.id), o = l;
341
- if (n === o)
340
+ const l = h(m.id), o = n;
341
+ if (l === o)
342
342
  return;
343
- const f = (w = c.current) == null ? void 0 : w.getBoundingClientRect(), x = (f.bottom - f.top) / 2, p = m.getClientOffset().y - f.top;
344
- n < o && p < x || n > o && p > x || d({ id: h.id, index: n }, { id: r, index: l });
343
+ const f = (I = c.current) == null ? void 0 : I.getBoundingClientRect(), x = (f.bottom - f.top) / 2, u = p.getClientOffset().y - f.top;
344
+ l < o && u < x || l > o && u > x || d({ id: m.id, index: l }, { id: r, index: n });
345
345
  }
346
346
  });
347
347
  return typeof s == "function" ? s({
348
348
  isDragging: b,
349
349
  drag: v,
350
- drop: (h) => (c.current = h, g(h)),
351
- preview: u
352
- }) : (v(g(u(c))), /* @__PURE__ */ e(S, { ref: c, children: s }));
350
+ drop: (m) => (c.current = m, g(m)),
351
+ preview: a
352
+ }) : (v(g(a(c))), /* @__PURE__ */ e(w, { ref: c, children: s }));
353
353
  }
354
354
  function qt({
355
355
  drop: t,
356
356
  preview: r,
357
- drag: l,
357
+ drag: n,
358
358
  disabled: i,
359
359
  isDragging: s,
360
- children: a,
360
+ children: h,
361
361
  onDelete: d,
362
362
  actions: c
363
363
  }) {
364
364
  const { t: b } = W();
365
- return /* @__PURE__ */ e(S, { ref: t, sx: { ":hover .hover-visible": { maxHeight: "100%" } }, children: /* @__PURE__ */ I(S, { sx: { position: "relative" }, children: [
365
+ return /* @__PURE__ */ e(w, { ref: t, sx: { ":hover .hover-visible": { maxHeight: "100%" } }, children: /* @__PURE__ */ S(w, { sx: { position: "relative" }, children: [
366
366
  /* @__PURE__ */ e(
367
- S,
367
+ w,
368
368
  {
369
369
  ref: r,
370
370
  sx: {
@@ -374,23 +374,23 @@ function qt({
374
374
  opacity: 0.9999
375
375
  // NOTE: make preview effective
376
376
  },
377
- children: a
377
+ children: h
378
378
  }
379
379
  ),
380
380
  !i && /* @__PURE__ */ e(
381
- S,
381
+ w,
382
382
  {
383
383
  className: "hover-visible",
384
384
  sx: { maxHeight: 0, overflow: "hidden", position: "absolute", right: 2, top: 2 },
385
- children: /* @__PURE__ */ I(
385
+ children: /* @__PURE__ */ S(
386
386
  R,
387
387
  {
388
388
  direction: "row",
389
389
  sx: {
390
- bgcolor: (v) => Xe(v.palette.grey[300], 0.9),
390
+ bgcolor: (v) => qe(v.palette.grey[300], 0.9),
391
391
  borderRadius: 1,
392
392
  p: 0.5,
393
- [`.${Ze.root}`]: {
393
+ [`.${Qe.root}`]: {
394
394
  minWidth: 24,
395
395
  width: 24,
396
396
  height: 24,
@@ -399,8 +399,8 @@ function qt({
399
399
  },
400
400
  children: [
401
401
  c,
402
- d && /* @__PURE__ */ e(ne, { title: b("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(N, { onClick: d, children: /* @__PURE__ */ e(Ct, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
403
- /* @__PURE__ */ e(ne, { title: b("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(N, { ref: l, children: /* @__PURE__ */ e(At, { sx: { color: "grey.500" } }) }) })
402
+ d && /* @__PURE__ */ e(le, { title: b("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(N, { onClick: d, children: /* @__PURE__ */ e(jt, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
403
+ /* @__PURE__ */ e(le, { title: b("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ e(N, { ref: n, children: /* @__PURE__ */ e(Tt, { sx: { color: "grey.500" } }) }) })
404
404
  ]
405
405
  }
406
406
  )
@@ -408,73 +408,29 @@ function qt({
408
408
  )
409
409
  ] }) });
410
410
  }
411
- function Qt({
412
- label: t,
413
- value: r,
414
- onChange: l
415
- }) {
416
- const [i, s] = Ne(!1);
417
- return /* @__PURE__ */ I(R, { gap: 1, children: [
418
- /* @__PURE__ */ e(
419
- V,
420
- {
421
- label: t,
422
- size: "small",
423
- value: r,
424
- onChange: (a) => l == null ? void 0 : l(a.target.value),
425
- InputProps: {
426
- endAdornment: /* @__PURE__ */ e(
427
- ue,
428
- {
429
- onChange: ({ response: a }) => {
430
- var c;
431
- const d = (c = a == null ? void 0 : a.data) == null ? void 0 : c.filename;
432
- d && (l == null || l(d));
433
- }
434
- }
435
- )
436
- }
437
- }
438
- ),
439
- r && /* @__PURE__ */ e(
440
- S,
441
- {
442
- component: "img",
443
- sx: { objectFit: "contain", borderRadius: 1, cursor: "pointer" },
444
- src: Z(r),
445
- alt: t,
446
- maxWidth: 100,
447
- maxHeight: 100,
448
- width: "100%",
449
- onClick: () => s(!0)
450
- }
451
- ),
452
- /* @__PURE__ */ e(ae, { open: i, onClose: () => s(!1), children: /* @__PURE__ */ e(S, { component: "img", sx: { objectFit: "contain" }, src: Z(r), alt: t }) })
453
- ] });
454
- }
455
- function Ar({ componentId: t }) {
411
+ function jr({ componentId: t }) {
456
412
  const {
457
413
  state: { components: r }
458
- } = re(), l = r[t], i = l == null ? void 0 : l.data;
459
- return i ? /* @__PURE__ */ e(R, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ e(S, { p: 2, children: /* @__PURE__ */ e(Et, { FallbackComponent: qe, resetKeys: [t], children: /* @__PURE__ */ e(Xt, { value: i }) }) }) }) : null;
414
+ } = te(), n = r[t], i = n == null ? void 0 : n.data;
415
+ return i ? /* @__PURE__ */ e(R, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ e(w, { p: 2, children: /* @__PURE__ */ e(zt, { children: /* @__PURE__ */ e(Et, { FallbackComponent: Ge, resetKeys: [t], children: /* @__PURE__ */ e(Qt, { value: i }) }) }) }) }) : null;
460
416
  }
461
- function Xt({ value: t }) {
417
+ function Qt({ value: t }) {
462
418
  var d, c, b;
463
419
  const { t: r } = W(), {
464
- localState: { currentLocale: l },
420
+ localState: { currentLocale: n },
465
421
  state: {
466
422
  config: { defaultLocale: i }
467
423
  }
468
- } = re(), s = J(t).doc, a = ce();
469
- return /* @__PURE__ */ e(R, { height: "100%", children: /* @__PURE__ */ I(R, { gap: 2, children: [
470
- /* @__PURE__ */ e(Zt, { config: t }),
424
+ } = te(), s = J(t).doc, h = se();
425
+ return /* @__PURE__ */ e(R, { height: "100%", children: /* @__PURE__ */ S(R, { gap: 2, children: [
426
+ /* @__PURE__ */ e(Xt, { config: t }),
471
427
  /* @__PURE__ */ e(
472
- Lt,
428
+ Zt,
473
429
  {
474
430
  config: t,
475
- currentLocale: l,
431
+ currentLocale: n,
476
432
  defaultLocale: i,
477
- allComponents: a,
433
+ allComponents: h,
478
434
  onUpdateConfig: (v) => {
479
435
  s.transact(() => {
480
436
  v(t);
@@ -482,9 +438,9 @@ function Xt({ value: t }) {
482
438
  }
483
439
  }
484
440
  ),
485
- /* @__PURE__ */ I(R, { gap: 2, direction: "row", justifyContent: "space-between", alignItems: "center", children: [
441
+ /* @__PURE__ */ S(R, { gap: 2, direction: "row", justifyContent: "space-between", alignItems: "center", children: [
486
442
  /* @__PURE__ */ e(Q, { variant: "subtitle1", children: r("renderer") }),
487
- /* @__PURE__ */ I(
443
+ /* @__PURE__ */ S(
488
444
  V,
489
445
  {
490
446
  hiddenLabel: !0,
@@ -494,82 +450,77 @@ function Xt({ value: t }) {
494
450
  value: ((d = t.renderer) == null ? void 0 : d.type) || "react-component",
495
451
  onChange: (v) => {
496
452
  s.transact(() => {
497
- const u = v.target.value;
498
- t.renderer ?? (t.renderer = { type: u }), t.renderer.type = u;
453
+ const a = v.target.value;
454
+ t.renderer ?? (t.renderer = { type: a }), t.renderer.type = a;
499
455
  });
500
456
  },
501
457
  children: [
502
- /* @__PURE__ */ e(T, { value: "react-component", children: "React Component" }),
503
- /* @__PURE__ */ e(T, { value: "component", children: "Custom Component" })
458
+ /* @__PURE__ */ e(A, { value: "react-component", children: "React Component" }),
459
+ /* @__PURE__ */ e(A, { value: "component", children: "Custom Component" })
504
460
  ]
505
461
  }
506
462
  )
507
463
  ] }),
508
- ((c = t.renderer) == null ? void 0 : c.type) === "component" ? /* @__PURE__ */ e(or, { value: t }) : ((b = t.renderer) == null ? void 0 : b.type) === "react-component" ? /* @__PURE__ */ e(nr, { value: t }) : null
464
+ ((c = t.renderer) == null ? void 0 : c.type) === "component" ? /* @__PURE__ */ e(nr, { value: t }) : ((b = t.renderer) == null ? void 0 : b.type) === "react-component" ? /* @__PURE__ */ e(lr, { value: t }) : null
509
465
  ] }) });
510
466
  }
511
- function Zt({ config: t }) {
467
+ function Xt({ config: t }) {
512
468
  const { t: r } = W();
513
- return /* @__PURE__ */ e(He, { children: /* @__PURE__ */ I(R, { gap: 2, children: [
514
- /* @__PURE__ */ e(Q, { variant: "subtitle1", children: r("basicInfo") }),
515
- /* @__PURE__ */ e(
516
- V,
517
- {
518
- label: r("name"),
519
- size: "small",
520
- value: t.name || "",
521
- onChange: (l) => t.name = l.target.value
522
- }
523
- ),
524
- /* @__PURE__ */ e(
525
- V,
526
- {
527
- label: r("description"),
528
- size: "small",
529
- multiline: !0,
530
- minRows: 2,
531
- maxRows: 10,
532
- inputProps: { maxLength: 200 },
533
- value: t.description || "",
534
- onChange: (l) => t.description = l.target.value
535
- }
536
- ),
537
- /* @__PURE__ */ e(
538
- Ae,
539
- {
540
- size: "small",
541
- options: [],
542
- multiple: !0,
543
- freeSolo: !0,
544
- value: t.tags ?? [],
545
- onChange: (l, i) => t.tags = i,
546
- renderInput: (l) => /* @__PURE__ */ e(V, { label: r("tags"), ...l })
547
- }
548
- ),
549
- /* @__PURE__ */ e(
550
- Qt,
551
- {
552
- label: r("previewImage"),
553
- value: t.previewImage || "",
554
- onChange: (l) => t.previewImage = l
555
- }
556
- )
557
- ] }) });
469
+ return (
470
+ // <UploaderProvider>
471
+ /* @__PURE__ */ S(R, { gap: 2, children: [
472
+ /* @__PURE__ */ e(Q, { variant: "subtitle1", children: r("basicInfo") }),
473
+ /* @__PURE__ */ e(
474
+ V,
475
+ {
476
+ label: r("name"),
477
+ size: "small",
478
+ value: t.name || "",
479
+ onChange: (n) => t.name = n.target.value
480
+ }
481
+ ),
482
+ /* @__PURE__ */ e(
483
+ V,
484
+ {
485
+ label: r("description"),
486
+ size: "small",
487
+ multiline: !0,
488
+ minRows: 2,
489
+ maxRows: 10,
490
+ inputProps: { maxLength: 200 },
491
+ value: t.description || "",
492
+ onChange: (n) => t.description = n.target.value
493
+ }
494
+ ),
495
+ /* @__PURE__ */ e(
496
+ je,
497
+ {
498
+ size: "small",
499
+ options: [],
500
+ multiple: !0,
501
+ freeSolo: !0,
502
+ value: t.tags ?? [],
503
+ onChange: (n, i) => t.tags = i,
504
+ renderInput: (n) => /* @__PURE__ */ e(V, { label: r("tags"), ...n })
505
+ }
506
+ )
507
+ ] })
508
+ );
558
509
  }
559
- function Lt({
510
+ function Zt({
560
511
  config: t,
561
512
  currentLocale: r,
562
- defaultLocale: l,
513
+ defaultLocale: n,
563
514
  allComponents: i,
564
515
  onUpdateConfig: s,
565
- useI18nEditor: a = !0
516
+ useI18nEditor: h = !0
566
517
  }) {
567
- var u, g, h, m, n, o, f, x, y;
568
- const { t: d } = W(), c = ie({ variant: "dialog" }), b = t.properties && X(Object.values(t.properties), "index"), v = ee(
569
- (p) => {
570
- s((w) => {
571
- var D, O, j;
572
- w.properties ?? (w.properties = {}), (D = w.properties).customSettings ?? (D.customSettings = {
518
+ var a, g, m, p, l, o, f, x, y;
519
+ const { t: d } = W(), c = re({ variant: "dialog" }), b = t.properties && X(Object.values(t.properties), "index"), v = L(
520
+ (u) => {
521
+ s((I) => {
522
+ var D, P, O;
523
+ I.properties ?? (I.properties = {}), (D = I.properties).customSettings ?? (D.customSettings = {
573
524
  index: 0,
574
525
  data: {
575
526
  id: "customSettings",
@@ -581,178 +532,181 @@ function Lt({
581
532
  }
582
533
  }
583
534
  }
584
- }), (O = w.properties.customSettings.data).locales ?? (O.locales = {}), (j = w.properties.customSettings.data.locales)[r] ?? (j[r] = {}), w.properties.customSettings.data.locales[r].defaultValue = p;
535
+ }), (P = I.properties.customSettings.data).locales ?? (P.locales = {}), (O = I.properties.customSettings.data.locales)[r] ?? (O[r] = {}), I.properties.customSettings.data.locales[r].defaultValue = u;
585
536
  });
586
537
  },
587
538
  [r, s]
588
539
  );
589
- return /* @__PURE__ */ e(He, { children: /* @__PURE__ */ I(R, { gap: 2, children: [
590
- /* @__PURE__ */ I(R, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between", children: [
591
- /* @__PURE__ */ e(Q, { variant: "subtitle1", children: d("properties") }),
592
- /* @__PURE__ */ e(S, { flex: 1 }),
593
- /* @__PURE__ */ e(
594
- N,
540
+ return (
541
+ // <UploaderProvider>
542
+ /* @__PURE__ */ S(R, { gap: 2, children: [
543
+ /* @__PURE__ */ S(R, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between", children: [
544
+ /* @__PURE__ */ e(Q, { variant: "subtitle1", children: d("properties") }),
545
+ /* @__PURE__ */ e(w, { flex: 1 }),
546
+ /* @__PURE__ */ e(
547
+ N,
548
+ {
549
+ onClick: () => {
550
+ s((u) => {
551
+ var D;
552
+ const I = Me();
553
+ u.properties ?? (u.properties = {}), (D = u.properties)[I] ?? (D[I] = { index: (b == null ? void 0 : b.length) || 0, data: { id: I } });
554
+ });
555
+ },
556
+ startIcon: /* @__PURE__ */ e(At, {}),
557
+ children: d("addObject", { object: d("property") })
558
+ }
559
+ ),
560
+ h && /* @__PURE__ */ e(N, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...ie(c), children: /* @__PURE__ */ e(Ue, { fontSize: "small" }) })
561
+ ] }),
562
+ t.properties && /* @__PURE__ */ e(
563
+ Gt,
595
564
  {
596
- onClick: () => {
597
- s((p) => {
598
- var D;
599
- const w = Qe();
600
- p.properties ?? (p.properties = {}), (D = p.properties)[w] ?? (D[w] = { index: (b == null ? void 0 : b.length) || 0, data: { id: w } });
601
- });
602
- },
603
- startIcon: /* @__PURE__ */ e(Tt, {}),
604
- children: d("addObject", { object: d("property") })
605
- }
606
- ),
607
- a && /* @__PURE__ */ e(N, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...le(c), children: /* @__PURE__ */ e(Ke, { fontSize: "small" }) })
608
- ] }),
609
- t.properties && /* @__PURE__ */ e(
610
- Gt,
611
- {
612
- component: R,
613
- gap: 2,
614
- list: t.properties,
615
- renderItem: (p, w, D) => {
616
- var O, j, B, H, _, F;
617
- return p.type === "custom-settings" ? null : /* @__PURE__ */ I(R, { gap: 1, bgcolor: "background.paper", children: [
618
- /* @__PURE__ */ e(
619
- qt,
620
- {
621
- preview: D.preview,
622
- drop: D.drop,
623
- drag: D.drag,
624
- isDragging: D.isDragging,
625
- onDelete: () => {
626
- s((z) => {
627
- if (z.properties) {
628
- const k = Object.entries(z.properties).sort(([, A], [, E]) => A.index - E.index);
629
- delete z.properties[p.id], k.filter(([A]) => A !== p.id).forEach(([, A], E) => {
630
- A.index = E;
631
- });
632
- }
633
- });
634
- },
635
- children: /* @__PURE__ */ I(R, { direction: "row", gap: 1, children: [
636
- /* @__PURE__ */ e(
637
- V,
638
- {
639
- label: d("key"),
640
- size: "small",
641
- sx: { flex: 1 },
642
- value: p.key || "",
643
- onChange: (z) => {
644
- s((C) => {
645
- const k = C.properties[p.id].data;
646
- k.key = z.target.value.trim();
647
- });
648
- }
649
- }
650
- ),
651
- /* @__PURE__ */ e(
652
- V,
653
- {
654
- label: d("label"),
655
- size: "small",
656
- sx: { flex: 1 },
657
- value: (((j = (O = p.locales) == null ? void 0 : O[r]) == null ? void 0 : j.name) ?? ((H = (B = p.locales) == null ? void 0 : B[l]) == null ? void 0 : H.name)) || "",
658
- onChange: (z) => {
659
- s((C) => {
660
- var P;
661
- const k = C.properties[p.id].data;
662
- k.locales ?? (k.locales = {}), (P = k.locales)[r] ?? (P[r] = {}), k.locales[r].name = z.target.value;
663
- });
664
- }
665
- }
666
- ),
667
- /* @__PURE__ */ I(
668
- V,
669
- {
670
- label: d("type"),
671
- size: "small",
672
- select: !0,
673
- sx: { flex: 1 },
674
- value: p.type === "string" && p.multiline ? "multiline" : p.type || "string",
675
- onChange: (z) => {
676
- s((C) => {
677
- const k = C.properties[p.id].data;
678
- if (k.locales)
679
- for (const A of Object.keys(k.locales))
680
- k.locales[A].defaultValue = void 0;
681
- const P = z.target.value;
682
- P === "multiline" ? (k.type = "string", k.multiline = !0) : (typeof k.multiline < "u" && delete k.multiline, k.type = P);
683
- });
684
- },
685
- children: [
686
- /* @__PURE__ */ e(T, { value: "string", children: "Text" }),
687
- /* @__PURE__ */ e(T, { value: "multiline", children: "Text (Multiline)" }),
688
- /* @__PURE__ */ e(T, { value: "number", children: "Number" }),
689
- /* @__PURE__ */ e(T, { value: "decimal", children: "Decimal" }),
690
- /* @__PURE__ */ e(T, { value: "boolean", children: "Boolean" }),
691
- /* @__PURE__ */ e(T, { value: "color", children: "Color" }),
692
- /* @__PURE__ */ e(T, { value: "url", children: "URL (Upload)" }),
693
- /* @__PURE__ */ e(T, { value: "json", children: "JSON" }),
694
- /* @__PURE__ */ e(T, { value: "yaml", children: "YAML" }),
695
- /* @__PURE__ */ e(T, { value: "component", children: "Component" }),
696
- /* @__PURE__ */ e(T, { value: "custom", children: "Custom (Render by a Component)" })
697
- ]
698
- }
699
- )
700
- ] })
701
- }
702
- ),
703
- /* @__PURE__ */ I(R, { direction: "row", gap: 1, children: [
565
+ component: R,
566
+ gap: 2,
567
+ list: t.properties,
568
+ renderItem: (u, I, D) => {
569
+ var P, O, B, _, H, U;
570
+ return u.type === "custom-settings" ? null : /* @__PURE__ */ S(R, { gap: 1, bgcolor: "background.paper", children: [
704
571
  /* @__PURE__ */ e(
705
- q,
572
+ qt,
706
573
  {
707
- allComponents: i,
708
- defaultLocale: l,
709
- component: t,
710
- property: p,
711
- label: d("defaultValue"),
712
- size: "small",
713
- fullWidth: !0,
714
- value: (F = (_ = p.locales) == null ? void 0 : _[r]) == null ? void 0 : F.defaultValue,
715
- onChange: (z) => {
716
- s((C) => {
717
- var P;
718
- const k = C.properties[p.id].data;
719
- k.locales ?? (k.locales = {}), (P = k.locales)[r] ?? (P[r] = {}), k.locales[r].defaultValue = z;
574
+ preview: D.preview,
575
+ drop: D.drop,
576
+ drag: D.drag,
577
+ isDragging: D.isDragging,
578
+ onDelete: () => {
579
+ s((z) => {
580
+ if (z.properties) {
581
+ const k = Object.entries(z.properties).sort(([, T], [, E]) => T.index - E.index);
582
+ delete z.properties[u.id], k.filter(([T]) => T !== u.id).forEach(([, T], E) => {
583
+ T.index = E;
584
+ });
585
+ }
720
586
  });
721
- }
587
+ },
588
+ children: /* @__PURE__ */ S(R, { direction: "row", gap: 1, children: [
589
+ /* @__PURE__ */ e(
590
+ V,
591
+ {
592
+ label: d("key"),
593
+ size: "small",
594
+ sx: { flex: 1 },
595
+ value: u.key || "",
596
+ onChange: (z) => {
597
+ s((j) => {
598
+ const k = j.properties[u.id].data;
599
+ k.key = z.target.value.trim();
600
+ });
601
+ }
602
+ }
603
+ ),
604
+ /* @__PURE__ */ e(
605
+ V,
606
+ {
607
+ label: d("label"),
608
+ size: "small",
609
+ sx: { flex: 1 },
610
+ value: (((O = (P = u.locales) == null ? void 0 : P[r]) == null ? void 0 : O.name) ?? ((_ = (B = u.locales) == null ? void 0 : B[n]) == null ? void 0 : _.name)) || "",
611
+ onChange: (z) => {
612
+ s((j) => {
613
+ var C;
614
+ const k = j.properties[u.id].data;
615
+ k.locales ?? (k.locales = {}), (C = k.locales)[r] ?? (C[r] = {}), k.locales[r].name = z.target.value;
616
+ });
617
+ }
618
+ }
619
+ ),
620
+ /* @__PURE__ */ S(
621
+ V,
622
+ {
623
+ label: d("type"),
624
+ size: "small",
625
+ select: !0,
626
+ sx: { flex: 1 },
627
+ value: u.type === "string" && u.multiline ? "multiline" : u.type || "string",
628
+ onChange: (z) => {
629
+ s((j) => {
630
+ const k = j.properties[u.id].data;
631
+ if (k.locales)
632
+ for (const T of Object.keys(k.locales))
633
+ k.locales[T].defaultValue = void 0;
634
+ const C = z.target.value;
635
+ C === "multiline" ? (k.type = "string", k.multiline = !0) : (typeof k.multiline < "u" && delete k.multiline, k.type = C);
636
+ });
637
+ },
638
+ children: [
639
+ /* @__PURE__ */ e(A, { value: "string", children: "Text" }),
640
+ /* @__PURE__ */ e(A, { value: "multiline", children: "Text (Multiline)" }),
641
+ /* @__PURE__ */ e(A, { value: "number", children: "Number" }),
642
+ /* @__PURE__ */ e(A, { value: "decimal", children: "Decimal" }),
643
+ /* @__PURE__ */ e(A, { value: "boolean", children: "Boolean" }),
644
+ /* @__PURE__ */ e(A, { value: "color", children: "Color" }),
645
+ /* @__PURE__ */ e(A, { value: "url", children: "URL (Upload)" }),
646
+ /* @__PURE__ */ e(A, { value: "json", children: "JSON" }),
647
+ /* @__PURE__ */ e(A, { value: "yaml", children: "YAML" }),
648
+ /* @__PURE__ */ e(A, { value: "component", children: "Component" }),
649
+ /* @__PURE__ */ e(A, { value: "custom", children: "Custom (Render by a Component)" })
650
+ ]
651
+ }
652
+ )
653
+ ] })
722
654
  }
723
655
  ),
724
- p.type === "custom" ? /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(er, { property: p, allComponents: i }) }) : null
725
- ] })
726
- ] }, p.id);
656
+ /* @__PURE__ */ S(R, { direction: "row", gap: 1, children: [
657
+ /* @__PURE__ */ e(
658
+ q,
659
+ {
660
+ allComponents: i,
661
+ defaultLocale: n,
662
+ component: t,
663
+ property: u,
664
+ label: d("defaultValue"),
665
+ size: "small",
666
+ fullWidth: !0,
667
+ value: (U = (H = u.locales) == null ? void 0 : H[r]) == null ? void 0 : U.defaultValue,
668
+ onChange: (z) => {
669
+ s((j) => {
670
+ var C;
671
+ const k = j.properties[u.id].data;
672
+ k.locales ?? (k.locales = {}), (C = k.locales)[r] ?? (C[r] = {}), k.locales[r].defaultValue = z;
673
+ });
674
+ }
675
+ }
676
+ ),
677
+ u.type === "custom" ? /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(Lt, { property: u, allComponents: i }) }) : null
678
+ ] })
679
+ ] }, u.id);
680
+ }
727
681
  }
728
- }
729
- ),
730
- ((u = i == null ? void 0 : i[t.id]) == null ? void 0 : u.data) && /* @__PURE__ */ e(S, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
731
- Fe,
732
- {
733
- componentId: t.id,
734
- renderType: "setting",
735
- locale: r,
736
- properties: {},
737
- dev: { mode: "draft", components: i, defaultLocale: l },
738
- props: {
739
- value: ((n = (m = (h = (g = t.properties) == null ? void 0 : g.customSettings) == null ? void 0 : h.data.locales) == null ? void 0 : m[r]) == null ? void 0 : n.defaultValue) ?? ((y = (x = (f = (o = t.properties) == null ? void 0 : o.customSettings) == null ? void 0 : f.data.locales) == null ? void 0 : x[l]) == null ? void 0 : y.defaultValue) ?? null,
740
- onChange: v
682
+ ),
683
+ ((a = i == null ? void 0 : i[t.id]) == null ? void 0 : a.data) && /* @__PURE__ */ e(w, { sx: { width: "100%" }, children: /* @__PURE__ */ e(
684
+ _e,
685
+ {
686
+ componentId: t.id,
687
+ renderType: "setting",
688
+ locale: r,
689
+ properties: {},
690
+ dev: { mode: "draft", components: i, defaultLocale: n },
691
+ props: {
692
+ value: ((l = (p = (m = (g = t.properties) == null ? void 0 : g.customSettings) == null ? void 0 : m.data.locales) == null ? void 0 : p[r]) == null ? void 0 : l.defaultValue) ?? ((y = (x = (f = (o = t.properties) == null ? void 0 : o.customSettings) == null ? void 0 : f.data.locales) == null ? void 0 : x[n]) == null ? void 0 : y.defaultValue) ?? null,
693
+ onChange: v
694
+ }
741
695
  }
742
- }
743
- ) }),
744
- a && /* @__PURE__ */ e(Me, { ...Je(c), component: t })
745
- ] }) });
696
+ ) }),
697
+ h && /* @__PURE__ */ e(Ye, { ...Ke(c), component: t })
698
+ ] })
699
+ );
746
700
  }
747
- function er({
701
+ function Lt({
748
702
  property: t,
749
703
  allComponents: r
750
704
  }) {
751
- const l = ie({ variant: "popper" });
752
- return /* @__PURE__ */ I($, { children: [
753
- /* @__PURE__ */ e(N, { sx: { minWidth: 0 }, ...le(l), children: /* @__PURE__ */ e($e, { fontSize: "small" }) }),
754
- /* @__PURE__ */ e(Te, { ...Ye(l), children: /* @__PURE__ */ e(Ue, { onClickAway: l.close, children: /* @__PURE__ */ e(Be, { children: /* @__PURE__ */ e(S, { width: 500, p: 2, children: /* @__PURE__ */ e(
755
- pe,
705
+ const n = re({ variant: "popper" });
706
+ return /* @__PURE__ */ S($, { children: [
707
+ /* @__PURE__ */ e(N, { sx: { minWidth: 0 }, ...ie(n), children: /* @__PURE__ */ e(Fe, { fontSize: "small" }) }),
708
+ /* @__PURE__ */ e(Te, { ...$e(n), children: /* @__PURE__ */ e(He, { onClickAway: n.close, children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ e(w, { width: 500, p: 2, children: /* @__PURE__ */ e(
709
+ de,
756
710
  {
757
711
  value: t.componentId,
758
712
  onChange: (i, s) => t.componentId = s,
@@ -761,29 +715,29 @@ function er({
761
715
  ) }) }) }) })
762
716
  ] });
763
717
  }
764
- function tr({
718
+ function er({
765
719
  value: t,
766
720
  valueImmutable: r,
767
- onChange: l,
721
+ onChange: n,
768
722
  defaultLocale: i,
769
723
  allComponents: s
770
724
  }) {
771
725
  var b;
772
- const a = ie({ variant: "popper" }), { locale: d } = W(), c = typeof (t == null ? void 0 : t.componentId) == "string" ? (b = s[t.componentId]) == null ? void 0 : b.data : void 0;
773
- return c ? /* @__PURE__ */ I($, { children: [
774
- /* @__PURE__ */ e(N, { sx: { minWidth: 0 }, disabled: !c, ...le(a), children: /* @__PURE__ */ e($e, { fontSize: "small" }) }),
726
+ const h = re({ variant: "popper" }), { locale: d } = W(), c = typeof (t == null ? void 0 : t.componentId) == "string" ? (b = s[t.componentId]) == null ? void 0 : b.data : void 0;
727
+ return c ? /* @__PURE__ */ S($, { children: [
728
+ /* @__PURE__ */ e(N, { sx: { minWidth: 0 }, disabled: !c, ...ie(h), children: /* @__PURE__ */ e(Fe, { fontSize: "small" }) }),
775
729
  /* @__PURE__ */ e(
776
730
  Te,
777
731
  {
778
- ...Ye(a),
732
+ ...$e(h),
779
733
  sx: {
780
734
  zIndex: 1e3
781
735
  },
782
- children: /* @__PURE__ */ e(Ue, { onClickAway: a.close, children: /* @__PURE__ */ e(Be, { children: /* @__PURE__ */ I(S, { width: 500, p: 2, children: [
736
+ children: /* @__PURE__ */ e(He, { onClickAway: h.close, children: /* @__PURE__ */ e(Ae, { children: /* @__PURE__ */ S(w, { width: 500, p: 2, children: [
783
737
  /* @__PURE__ */ e(Q, { variant: "subtitle1", children: "Parameters" }),
784
738
  /* @__PURE__ */ e(R, { gap: 1, children: (c == null ? void 0 : c.properties) && X(Object.values(c.properties), "index").map(({ data: v }) => {
785
- var u, g, h, m, n, o, f, x;
786
- return /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(
739
+ var a, g, m, p, l, o, f, x;
740
+ return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
787
741
  q,
788
742
  {
789
743
  allComponents: s,
@@ -792,12 +746,12 @@ function tr({
792
746
  fullWidth: !0,
793
747
  component: c,
794
748
  property: v,
795
- valueImmutable: te((g = (u = t.properties) == null ? void 0 : u[v.id]) == null ? void 0 : g.value),
796
- value: ((m = (h = t.properties) == null ? void 0 : h[v.id]) == null ? void 0 : m.value) ?? ((o = (n = v.locales) == null ? void 0 : n[d]) == null ? void 0 : o.defaultValue) ?? ((x = (f = v.locales) == null ? void 0 : f[i]) == null ? void 0 : x.defaultValue),
749
+ valueImmutable: ee((g = (a = t.properties) == null ? void 0 : a[v.id]) == null ? void 0 : g.value),
750
+ value: ((p = (m = t.properties) == null ? void 0 : m[v.id]) == null ? void 0 : p.value) ?? ((o = (l = v.locales) == null ? void 0 : l[d]) == null ? void 0 : o.defaultValue) ?? ((x = (f = v.locales) == null ? void 0 : f[i]) == null ? void 0 : x.defaultValue),
797
751
  onChange: (y) => {
798
752
  if (r) {
799
- const p = JSON.parse(JSON.stringify(t));
800
- l == null || l({ ...p, properties: { ...p.properties, [v.id]: { value: y } } });
753
+ const u = JSON.parse(JSON.stringify(t));
754
+ n == null || n({ ...u, properties: { ...u.properties, [v.id]: { value: y } } });
801
755
  } else
802
756
  J(c).doc.transact(() => {
803
757
  t.properties ?? (t.properties = {}), t.properties[v.id] = { value: y };
@@ -811,38 +765,38 @@ function tr({
811
765
  )
812
766
  ] }) : null;
813
767
  }
814
- function Me({
768
+ function Ye({
815
769
  type: t = "properties",
816
770
  component: r,
817
- ...l
771
+ ...n
818
772
  }) {
819
- var g, h, m;
773
+ var g, m, p;
820
774
  const { t: i } = W(), {
821
775
  state: {
822
776
  components: s,
823
- supportedLocales: a,
777
+ supportedLocales: h,
824
778
  config: { defaultLocale: d }
825
779
  }
826
- } = re(), c = ce(), b = J(r).doc, v = t === "properties" ? r.properties : t === "parameters" && ((g = r.renderer) == null ? void 0 : g.type) === "component" ? (h = s[r.renderer.componentId]) == null ? void 0 : h.data.properties : void 0, u = ((m = r.renderer) == null ? void 0 : m.type) === "component" ? r : void 0;
827
- return /* @__PURE__ */ I(ae, { ...l, fullWidth: !0, maxWidth: "lg", children: [
828
- /* @__PURE__ */ e(Oe, { children: i("i18nEditorTitle") }),
829
- /* @__PURE__ */ e(je, { children: v && /* @__PURE__ */ e(R, { children: /* @__PURE__ */ I(et, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
830
- /* @__PURE__ */ e(tt, { children: /* @__PURE__ */ e(Se, { children: a.map(({ locale: n, name: o }) => /* @__PURE__ */ I(ke, { children: [
780
+ } = te(), c = se(), b = J(r).doc, v = t === "properties" ? r.properties : t === "parameters" && ((g = r.renderer) == null ? void 0 : g.type) === "component" ? (m = s[r.renderer.componentId]) == null ? void 0 : m.data.properties : void 0, a = ((p = r.renderer) == null ? void 0 : p.type) === "component" ? r : void 0;
781
+ return /* @__PURE__ */ S(Ce, { ...n, fullWidth: !0, maxWidth: "lg", children: [
782
+ /* @__PURE__ */ e(Ve, { children: i("i18nEditorTitle") }),
783
+ /* @__PURE__ */ e(Pe, { children: v && /* @__PURE__ */ e(R, { children: /* @__PURE__ */ S(Ze, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
784
+ /* @__PURE__ */ e(Le, { children: /* @__PURE__ */ e(Ie, { children: h.map(({ locale: l, name: o }) => /* @__PURE__ */ S(Se, { children: [
831
785
  o,
832
- d === n && /* @__PURE__ */ e(Wt, { sx: { fontSize: 12, color: "text.secondary" } })
833
- ] }, n)) }) }),
834
- /* @__PURE__ */ e(rt, { children: X(Object.values(v), "index").map(({ data: n }) => /* @__PURE__ */ e(Se, { children: a.map(({ locale: o }) => {
835
- var f, x, y, p, w, D, O, j, B, H, _, F, z, C, k, P, A, E, Y, G, me, he, fe, be, ge, ve;
836
- return /* @__PURE__ */ e(ke, { children: /* @__PURE__ */ e(R, { gap: 1, children: t === "properties" ? /* @__PURE__ */ I($, { children: [
786
+ d === l && /* @__PURE__ */ e(Wt, { sx: { fontSize: 12, color: "text.secondary" } })
787
+ ] }, l)) }) }),
788
+ /* @__PURE__ */ e(et, { children: X(Object.values(v), "index").map(({ data: l }) => /* @__PURE__ */ e(Ie, { children: h.map(({ locale: o }) => {
789
+ var f, x, y, u, I, D, P, O, B, _, H, U, z, j, k, C, T, E, Y, G, ae, ue, pe, me, he, fe;
790
+ return /* @__PURE__ */ e(Se, { children: /* @__PURE__ */ e(R, { gap: 1, children: t === "properties" ? /* @__PURE__ */ S($, { children: [
837
791
  /* @__PURE__ */ e(
838
792
  V,
839
793
  {
840
794
  size: "small",
841
795
  label: "Key",
842
- value: n.key || "",
796
+ value: l.key || "",
843
797
  onChange: (K) => {
844
798
  b.transact(() => {
845
- n.key = K.target.value.trim();
799
+ l.key = K.target.value.trim();
846
800
  });
847
801
  }
848
802
  }
@@ -852,84 +806,84 @@ function Me({
852
806
  {
853
807
  size: "small",
854
808
  label: i("label"),
855
- value: (((x = (f = n.locales) == null ? void 0 : f[o]) == null ? void 0 : x.name) ?? ((p = (y = n.locales) == null ? void 0 : y[d]) == null ? void 0 : p.name)) || "",
809
+ value: (((x = (f = l.locales) == null ? void 0 : f[o]) == null ? void 0 : x.name) ?? ((u = (y = l.locales) == null ? void 0 : y[d]) == null ? void 0 : u.name)) || "",
856
810
  onChange: (K) => {
857
811
  b.transact(() => {
858
- var U;
859
- n.locales ?? (n.locales = {}), (U = n.locales)[o] ?? (U[o] = {}), n.locales[o].name = K.target.value;
812
+ var F;
813
+ l.locales ?? (l.locales = {}), (F = l.locales)[o] ?? (F[o] = {}), l.locales[o].name = K.target.value;
860
814
  });
861
815
  }
862
816
  }
863
817
  ),
864
- /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(
818
+ /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
865
819
  q,
866
820
  {
867
821
  allComponents: c,
868
822
  defaultLocale: d,
869
823
  component: r,
870
- property: n,
824
+ property: l,
871
825
  size: "small",
872
826
  fullWidth: !0,
873
827
  label: "Default Value",
874
- valueImmutable: te((D = (w = n.locales) == null ? void 0 : w[o]) == null ? void 0 : D.defaultValue),
875
- value: ((j = (O = n.locales) == null ? void 0 : O[o]) == null ? void 0 : j.defaultValue) ?? ((H = (B = n.locales) == null ? void 0 : B[d]) == null ? void 0 : H.defaultValue),
828
+ valueImmutable: ee((D = (I = l.locales) == null ? void 0 : I[o]) == null ? void 0 : D.defaultValue),
829
+ value: ((O = (P = l.locales) == null ? void 0 : P[o]) == null ? void 0 : O.defaultValue) ?? ((_ = (B = l.locales) == null ? void 0 : B[d]) == null ? void 0 : _.defaultValue),
876
830
  onChange: (K) => {
877
831
  b.transact(() => {
878
- var U;
879
- n.locales ?? (n.locales = {}), (U = n.locales)[o] ?? (U[o] = {}), n.locales[o].defaultValue = K;
832
+ var F;
833
+ l.locales ?? (l.locales = {}), (F = l.locales)[o] ?? (F[o] = {}), l.locales[o].defaultValue = K;
880
834
  });
881
835
  }
882
836
  }
883
837
  ) })
884
- ] }) : t === "parameters" && u ? /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(
838
+ ] }) : t === "parameters" && a ? /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
885
839
  q,
886
840
  {
887
841
  allComponents: c,
888
842
  defaultLocale: d,
889
843
  component: r,
890
- property: n,
844
+ property: l,
891
845
  size: "small",
892
846
  fullWidth: !0,
893
- valueImmutable: te(
894
- (C = (z = (F = (_ = u.renderer.properties) == null ? void 0 : _[n.id]) == null ? void 0 : F.locales) == null ? void 0 : z[o]) == null ? void 0 : C.value
847
+ valueImmutable: ee(
848
+ (j = (z = (U = (H = a.renderer.properties) == null ? void 0 : H[l.id]) == null ? void 0 : U.locales) == null ? void 0 : z[o]) == null ? void 0 : j.value
895
849
  ),
896
- value: ((E = (A = (P = (k = u.renderer.properties) == null ? void 0 : k[n.id]) == null ? void 0 : P.locales) == null ? void 0 : A[o]) == null ? void 0 : E.value) ?? ((he = (me = (G = (Y = u.renderer.properties) == null ? void 0 : Y[n.id]) == null ? void 0 : G.locales) == null ? void 0 : me[d]) == null ? void 0 : he.value) ?? ((be = (fe = n.locales) == null ? void 0 : fe[o]) == null ? void 0 : be.defaultValue) ?? ((ve = (ge = n.locales) == null ? void 0 : ge[d]) == null ? void 0 : ve.defaultValue),
850
+ value: ((E = (T = (C = (k = a.renderer.properties) == null ? void 0 : k[l.id]) == null ? void 0 : C.locales) == null ? void 0 : T[o]) == null ? void 0 : E.value) ?? ((ue = (ae = (G = (Y = a.renderer.properties) == null ? void 0 : Y[l.id]) == null ? void 0 : G.locales) == null ? void 0 : ae[d]) == null ? void 0 : ue.value) ?? ((me = (pe = l.locales) == null ? void 0 : pe[o]) == null ? void 0 : me.defaultValue) ?? ((fe = (he = l.locales) == null ? void 0 : he[d]) == null ? void 0 : fe.defaultValue),
897
851
  onChange: (K) => {
898
852
  b.transact(() => {
899
- var U, xe, ye, Ie, we;
900
- (U = u.renderer).properties ?? (U.properties = {}), (xe = u.renderer.properties)[ye = n.id] ?? (xe[ye] = {}), (Ie = u.renderer.properties[n.id]).locales ?? (Ie.locales = {}), (we = u.renderer.properties[n.id].locales)[o] ?? (we[o] = {}), u.renderer.properties[n.id].locales[o].value = K;
853
+ var F, be, ge, ve, xe;
854
+ (F = a.renderer).properties ?? (F.properties = {}), (be = a.renderer.properties)[ge = l.id] ?? (be[ge] = {}), (ve = a.renderer.properties[l.id]).locales ?? (ve.locales = {}), (xe = a.renderer.properties[l.id].locales)[o] ?? (xe[o] = {}), a.renderer.properties[l.id].locales[o].value = K;
901
855
  });
902
856
  }
903
857
  }
904
- ) }) : null }, n.id) }, o);
905
- }) }, n.id)) })
858
+ ) }) : null }, l.id) }, o);
859
+ }) }, l.id)) })
906
860
  ] }) }) }),
907
- /* @__PURE__ */ e(Ce, { children: /* @__PURE__ */ e(N, { onClick: (n) => {
861
+ /* @__PURE__ */ e(Oe, { children: /* @__PURE__ */ e(N, { onClick: (l) => {
908
862
  var o;
909
- return (o = l.onClose) == null ? void 0 : o.call(l, n, "escapeKeyDown");
863
+ return (o = n.onClose) == null ? void 0 : o.call(n, l, "escapeKeyDown");
910
864
  }, children: i("close") }) })
911
865
  ] });
912
866
  }
913
867
  function q({
914
868
  component: t,
915
869
  property: r,
916
- value: l,
870
+ value: n,
917
871
  onChange: i,
918
872
  valueImmutable: s,
919
- defaultLocale: a,
873
+ defaultLocale: h,
920
874
  allComponents: d,
921
875
  ...c
922
876
  }) {
923
- var g, h, m, n, o;
924
- const { locale: b } = W(), v = M(null), u = c.label || ((h = (g = r.locales) == null ? void 0 : g[b]) == null ? void 0 : h.name) || ((n = (m = r.locales) == null ? void 0 : m[a]) == null ? void 0 : n.name) || r.key || r.id;
877
+ var g, m, p, l, o;
878
+ const { locale: b } = W(), v = M(null), a = c.label || ((m = (g = r.locales) == null ? void 0 : g[b]) == null ? void 0 : m.name) || ((l = (p = r.locales) == null ? void 0 : p[h]) == null ? void 0 : l.name) || r.key || r.id;
925
879
  if (r.type === "number")
926
880
  return /* @__PURE__ */ e(
927
- rr,
881
+ tr,
928
882
  {
929
883
  ...c,
930
- label: u,
884
+ label: a,
931
885
  NumberProps: {
932
- value: ["number", "string"].includes(typeof l) ? l : null,
886
+ value: ["number", "string"].includes(typeof n) ? n : null,
933
887
  onChange: (f, x) => i == null ? void 0 : i(x)
934
888
  }
935
889
  }
@@ -941,9 +895,9 @@ function q({
941
895
  V,
942
896
  {
943
897
  ...c,
944
- label: u,
898
+ label: a,
945
899
  type: "text",
946
- value: l ?? "",
900
+ value: n ?? "",
947
901
  onChange: (f) => {
948
902
  const x = f.target.value;
949
903
  if (x === "" || x === "-") {
@@ -951,34 +905,34 @@ function q({
951
905
  return;
952
906
  }
953
907
  if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(x)) {
954
- let p = x;
955
- /^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(p) && (p = Number(p)), i == null || i(p);
908
+ let u = x;
909
+ /^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(u) && (u = Number(u)), i == null || i(u);
956
910
  }
957
911
  }
958
912
  }
959
913
  );
960
914
  if (r.type === "boolean")
961
915
  return /* @__PURE__ */ e(
962
- Ve,
916
+ Re,
963
917
  {
964
- label: u,
918
+ label: a,
965
919
  labelPlacement: "start",
966
- control: /* @__PURE__ */ e(Pe, { checked: l === !0, onChange: (f, x) => i == null ? void 0 : i(x) })
920
+ control: /* @__PURE__ */ e(ze, { checked: n === !0, onChange: (f, x) => i == null ? void 0 : i(x) })
967
921
  }
968
922
  );
969
923
  if (r.type === "color")
970
924
  return /* @__PURE__ */ e(
971
925
  Yt,
972
926
  {
973
- label: u,
974
- value: l,
927
+ label: a,
928
+ value: n,
975
929
  onChange: (f) => {
976
930
  i == null || i(f);
977
931
  }
978
932
  }
979
933
  );
980
934
  if (r.type === "json" || r.type === "yaml")
981
- return /* @__PURE__ */ I(
935
+ return /* @__PURE__ */ S(
982
936
  R,
983
937
  {
984
938
  sx: {
@@ -992,7 +946,7 @@ function q({
992
946
  },
993
947
  children: [
994
948
  /* @__PURE__ */ e(
995
- Le,
949
+ Xe,
996
950
  {
997
951
  sx: {
998
952
  position: "absolute",
@@ -1000,16 +954,16 @@ function q({
1000
954
  top: 0,
1001
955
  transform: "translate(0px, -7px) scale(0.75)"
1002
956
  },
1003
- children: u
957
+ children: a
1004
958
  }
1005
959
  ),
1006
960
  /* @__PURE__ */ e(
1007
- _e,
961
+ Ee,
1008
962
  {
1009
963
  keyId: r.id,
1010
964
  locale: b,
1011
965
  language: r.type === "yaml" ? "yaml" : "json",
1012
- value: typeof l == "string" ? l : "",
966
+ value: typeof n == "string" ? n : "",
1013
967
  onChange: (f) => i == null ? void 0 : i(f),
1014
968
  onUpload: (f) => {
1015
969
  v.current = f;
@@ -1018,7 +972,7 @@ function q({
1018
972
  r.id
1019
973
  ),
1020
974
  /* @__PURE__ */ e(
1021
- S,
975
+ w,
1022
976
  {
1023
977
  component: "fieldset",
1024
978
  sx: {
@@ -1034,7 +988,7 @@ function q({
1034
988
  px: 1,
1035
989
  py: 0
1036
990
  },
1037
- children: /* @__PURE__ */ e(S, { component: "legend", sx: { fontSize: "0.75em" }, children: /* @__PURE__ */ e(S, { component: "span", sx: { opacity: 0 }, children: c.label }) })
991
+ children: /* @__PURE__ */ e(w, { component: "legend", sx: { fontSize: "0.75em" }, children: /* @__PURE__ */ e(w, { component: "span", sx: { opacity: 0 }, children: c.label }) })
1038
992
  }
1039
993
  )
1040
994
  ]
@@ -1042,81 +996,81 @@ function q({
1042
996
  );
1043
997
  if (r.type === "custom") {
1044
998
  const f = (o = d[r.componentId]) == null ? void 0 : o.data;
1045
- return f ? /* @__PURE__ */ e(S, { width: "100%", children: /* @__PURE__ */ e(
1046
- Fe,
999
+ return f ? /* @__PURE__ */ e(w, { width: "100%", children: /* @__PURE__ */ e(
1000
+ _e,
1047
1001
  {
1048
1002
  componentId: f.id,
1049
- props: { label: u, value: l, onChange: i },
1003
+ props: { label: a, value: n, onChange: i },
1050
1004
  locale: b,
1051
1005
  dev: {
1052
1006
  mode: "draft",
1053
1007
  components: d,
1054
- defaultLocale: a
1008
+ defaultLocale: h
1055
1009
  }
1056
1010
  }
1057
- ) }) : /* @__PURE__ */ e(V, { ...c, label: u, disabled: !0, placeholder: "Click right button select a component" });
1011
+ ) }) : /* @__PURE__ */ e(V, { ...c, label: a, disabled: !0, placeholder: "Click right button select a component" });
1058
1012
  }
1059
1013
  if (r.type === "component")
1060
- return /* @__PURE__ */ I(R, { width: "100%", direction: "row", gap: 1, children: [
1061
- /* @__PURE__ */ e(S, { flex: 1, children: /* @__PURE__ */ e(
1062
- pe,
1014
+ return /* @__PURE__ */ S(R, { width: "100%", direction: "row", gap: 1, children: [
1015
+ /* @__PURE__ */ e(w, { flex: 1, children: /* @__PURE__ */ e(
1016
+ de,
1063
1017
  {
1064
1018
  allComponents: d,
1065
- label: u,
1066
- value: l == null ? void 0 : l.componentId,
1019
+ label: a,
1020
+ value: n == null ? void 0 : n.componentId,
1067
1021
  onChange: (f, x) => {
1068
- s || !l ? i == null || i({ ...l && JSON.parse(JSON.stringify(l)), componentId: x }) : typeof l == "object" && (l.componentId = x);
1022
+ s || !n ? i == null || i({ ...n && JSON.parse(JSON.stringify(n)), componentId: x }) : typeof n == "object" && (n.componentId = x);
1069
1023
  }
1070
1024
  }
1071
1025
  ) }),
1072
- /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(
1073
- tr,
1026
+ /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
1027
+ er,
1074
1028
  {
1075
- value: l,
1029
+ value: n,
1076
1030
  valueImmutable: s,
1077
1031
  onChange: i,
1078
- defaultLocale: a,
1032
+ defaultLocale: h,
1079
1033
  allComponents: d
1080
1034
  }
1081
1035
  ) })
1082
1036
  ] });
1083
1037
  if (!r.type || ["string", "url"].includes(r.type)) {
1084
- const f = r.type === "string" ? r.multiline : void 0, x = r.type === "url" ? l == null ? void 0 : l.url : l;
1038
+ const f = r.type === "string" ? r.multiline : void 0, x = r.type === "url" ? n == null ? void 0 : n.url : n;
1085
1039
  return /* @__PURE__ */ e(
1086
1040
  V,
1087
1041
  {
1088
1042
  ...c,
1089
- label: u,
1043
+ label: a,
1090
1044
  value: typeof x == "string" ? x : "",
1091
1045
  multiline: f,
1092
1046
  minRows: f ? 2 : void 0,
1093
1047
  maxRows: f ? 10 : void 0,
1094
1048
  onChange: (y) => i == null ? void 0 : i(
1095
- r.type === "url" ? { ...l, url: y.target.value, mediaKitUrl: y.target.value } : y.target.value
1049
+ r.type === "url" ? { ...n, url: y.target.value, mediaKitUrl: y.target.value } : y.target.value
1096
1050
  ),
1097
1051
  InputProps: r.type === "url" ? {
1098
1052
  sx: { pr: 0 },
1099
- endAdornment: /* @__PURE__ */ I(de, { position: "end", children: [
1053
+ endAdornment: /* @__PURE__ */ S(ce, { position: "end", children: [
1100
1054
  /* @__PURE__ */ e(
1101
- ue,
1055
+ Ne,
1102
1056
  {
1103
1057
  onChange: async ({ response: y }) => {
1104
- var O, j, B;
1105
- const p = ((O = y == null ? void 0 : y.data) == null ? void 0 : O.url) || ((j = y == null ? void 0 : y.data) == null ? void 0 : j.fileUrl);
1106
- let w;
1107
- p && (w = await oe(p).catch(() => se(p)).catch(() => {
1058
+ var P, O, B;
1059
+ const u = ((P = y == null ? void 0 : y.data) == null ? void 0 : P.url) || ((O = y == null ? void 0 : y.data) == null ? void 0 : O.fileUrl);
1060
+ let I;
1061
+ u && (I = await ne(u).catch(() => oe(u)).catch(() => {
1108
1062
  }));
1109
1063
  let D = ((B = y == null ? void 0 : y.data) == null ? void 0 : B.filename) || "";
1110
1064
  D && (D = `mediakit://${D}`), i == null || i({
1111
- url: p,
1065
+ url: u,
1112
1066
  mediaKitUrl: D,
1113
- width: w == null ? void 0 : w.naturalWidth,
1114
- height: w == null ? void 0 : w.naturalHeight
1067
+ width: I == null ? void 0 : I.naturalWidth,
1068
+ height: I == null ? void 0 : I.naturalHeight
1115
1069
  });
1116
1070
  }
1117
1071
  }
1118
1072
  ),
1119
- /* @__PURE__ */ e(ne, { title: "If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.", children: /* @__PURE__ */ e(Bt, { sx: { cursor: "default" }, fontSize: "small" }) })
1073
+ /* @__PURE__ */ e(le, { title: "If you are using the 'mediaKitUrl' property, please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address.", children: /* @__PURE__ */ e(Bt, { sx: { cursor: "default" }, fontSize: "small" }) })
1120
1074
  ] })
1121
1075
  } : void 0
1122
1076
  }
@@ -1124,14 +1078,14 @@ function q({
1124
1078
  }
1125
1079
  return console.error("Unsupported property type", r.type), null;
1126
1080
  }
1127
- function rr({
1081
+ function tr({
1128
1082
  NumberProps: t,
1129
1083
  ...r
1130
1084
  }) {
1131
- const { getInputProps: l } = jt(t), i = l();
1085
+ const { getInputProps: n } = Ot(t), i = n();
1132
1086
  return /* @__PURE__ */ e(V, { ...r, inputProps: i });
1133
1087
  }
1134
- const ir = `import React from '@blocklet/pages-kit/builtin/react'
1088
+ const rr = `import React from '@blocklet/pages-kit/builtin/react'
1135
1089
  import { Box } from '@blocklet/pages-kit/builtin/mui/material'
1136
1090
 
1137
1091
  export default function () {
@@ -1140,19 +1094,19 @@ export default function () {
1140
1094
  Hello World
1141
1095
  </Box>
1142
1096
  )
1143
- }`, lr = `console.log('hello')
1097
+ }`, ir = `console.log('hello')
1144
1098
  `;
1145
- function nr({
1099
+ function lr({
1146
1100
  value: t
1147
1101
  }) {
1148
- const { locale: r } = W(), l = Ot(), i = J(t).doc;
1149
- return L(() => {
1102
+ const { locale: r } = W(), n = Pt(), i = J(t).doc;
1103
+ return Z(() => {
1150
1104
  var s;
1151
1105
  (s = t.renderer) != null && s.script || (i.transact(() => {
1152
- t.renderer.script = t.renderer.type === "react-component" ? ir : lr;
1153
- }), l());
1154
- }, [t]), /* @__PURE__ */ e(S, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ e(
1155
- _e,
1106
+ t.renderer.script = t.renderer.type === "react-component" ? rr : ir;
1107
+ }), n());
1108
+ }, [t]), /* @__PURE__ */ e(w, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ e(
1109
+ Ee,
1156
1110
  {
1157
1111
  keyId: t.id,
1158
1112
  locale: r,
@@ -1164,98 +1118,98 @@ function nr({
1164
1118
  t.id
1165
1119
  ) });
1166
1120
  }
1167
- function or({ value: t }) {
1168
- var u, g, h;
1169
- const { t: r } = W(), l = J(t).doc, {
1121
+ function nr({ value: t }) {
1122
+ var a, g, m;
1123
+ const { t: r } = W(), n = J(t).doc, {
1170
1124
  state: {
1171
1125
  components: i,
1172
1126
  config: { defaultLocale: s },
1173
- resources: a
1127
+ resources: h
1174
1128
  },
1175
1129
  localState: { currentLocale: d }
1176
- } = re(), c = ce(), b = ((u = i[t.renderer.componentId]) == null ? void 0 : u.data) ?? ((h = (g = a.components) == null ? void 0 : g[t.renderer.componentId]) == null ? void 0 : h.component), v = ie({ variant: "dialog" });
1177
- return /* @__PURE__ */ I(R, { gap: 1, children: [
1130
+ } = te(), c = se(), b = ((a = i[t.renderer.componentId]) == null ? void 0 : a.data) ?? ((m = (g = h.components) == null ? void 0 : g[t.renderer.componentId]) == null ? void 0 : m.component), v = re({ variant: "dialog" });
1131
+ return /* @__PURE__ */ S(R, { gap: 1, children: [
1178
1132
  /* @__PURE__ */ e(
1179
- pe,
1133
+ de,
1180
1134
  {
1181
1135
  allComponents: c,
1182
1136
  excludes: [t.id],
1183
1137
  value: t.renderer.componentId,
1184
- onChange: (m, n) => t.renderer.componentId = n
1138
+ onChange: (p, l) => t.renderer.componentId = l
1185
1139
  }
1186
1140
  ),
1187
- b && /* @__PURE__ */ I($, { children: [
1188
- /* @__PURE__ */ I(R, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1141
+ b && /* @__PURE__ */ S($, { children: [
1142
+ /* @__PURE__ */ S(R, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1189
1143
  /* @__PURE__ */ e(Q, { variant: "subtitle2", children: r("parameters") }),
1190
- /* @__PURE__ */ e(N, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...le(v), children: /* @__PURE__ */ e(Ke, { fontSize: "small" }) })
1144
+ /* @__PURE__ */ e(N, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...ie(v), children: /* @__PURE__ */ e(Ue, { fontSize: "small" }) })
1191
1145
  ] }),
1192
- b.properties && X(Object.values(b.properties), "index").map(({ data: m }) => {
1193
- var n, o, f, x, y, p, w, D, O, j, B, H, _, F, z, C;
1194
- return /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(
1146
+ b.properties && X(Object.values(b.properties), "index").map(({ data: p }) => {
1147
+ var l, o, f, x, y, u, I, D, P, O, B, _, H, U, z, j;
1148
+ return /* @__PURE__ */ e(w, { children: /* @__PURE__ */ e(
1195
1149
  q,
1196
1150
  {
1197
1151
  allComponents: c,
1198
1152
  defaultLocale: s,
1199
1153
  component: b,
1200
- property: m,
1154
+ property: p,
1201
1155
  fullWidth: !0,
1202
1156
  size: "small",
1203
- valueImmutable: te((x = (f = (o = (n = t.renderer.properties) == null ? void 0 : n[m.id]) == null ? void 0 : o.locales) == null ? void 0 : f[d]) == null ? void 0 : x.value),
1204
- value: ((D = (w = (p = (y = t.renderer.properties) == null ? void 0 : y[m.id]) == null ? void 0 : p.locales) == null ? void 0 : w[d]) == null ? void 0 : D.value) ?? ((H = (B = (j = (O = t.renderer.properties) == null ? void 0 : O[m.id]) == null ? void 0 : j.locales) == null ? void 0 : B[s]) == null ? void 0 : H.value) ?? ((F = (_ = m.locales) == null ? void 0 : _[d]) == null ? void 0 : F.defaultValue) ?? ((C = (z = m.locales) == null ? void 0 : z[s]) == null ? void 0 : C.defaultValue),
1157
+ valueImmutable: ee((x = (f = (o = (l = t.renderer.properties) == null ? void 0 : l[p.id]) == null ? void 0 : o.locales) == null ? void 0 : f[d]) == null ? void 0 : x.value),
1158
+ value: ((D = (I = (u = (y = t.renderer.properties) == null ? void 0 : y[p.id]) == null ? void 0 : u.locales) == null ? void 0 : I[d]) == null ? void 0 : D.value) ?? ((_ = (B = (O = (P = t.renderer.properties) == null ? void 0 : P[p.id]) == null ? void 0 : O.locales) == null ? void 0 : B[s]) == null ? void 0 : _.value) ?? ((U = (H = p.locales) == null ? void 0 : H[d]) == null ? void 0 : U.defaultValue) ?? ((j = (z = p.locales) == null ? void 0 : z[s]) == null ? void 0 : j.defaultValue),
1205
1159
  onChange: (k) => {
1206
- l.transact(() => {
1207
- var P, A, E, Y, G;
1208
- (P = t.renderer).properties ?? (P.properties = {}), (A = t.renderer.properties)[E = m.id] ?? (A[E] = {}), (Y = t.renderer.properties[m.id]).locales ?? (Y.locales = {}), (G = t.renderer.properties[m.id].locales)[d] ?? (G[d] = {}), t.renderer.properties[m.id].locales[d].value = k;
1160
+ n.transact(() => {
1161
+ var C, T, E, Y, G;
1162
+ (C = t.renderer).properties ?? (C.properties = {}), (T = t.renderer.properties)[E = p.id] ?? (T[E] = {}), (Y = t.renderer.properties[p.id]).locales ?? (Y.locales = {}), (G = t.renderer.properties[p.id].locales)[d] ?? (G[d] = {}), t.renderer.properties[p.id].locales[d].value = k;
1209
1163
  });
1210
1164
  }
1211
1165
  }
1212
- ) }, m.id);
1166
+ ) }, p.id);
1213
1167
  }),
1214
- /* @__PURE__ */ e(Me, { ...Je(v), component: t, type: "parameters" })
1168
+ /* @__PURE__ */ e(Ye, { ...Ke(v), component: t, type: "parameters" })
1215
1169
  ] })
1216
1170
  ] });
1217
1171
  }
1218
- function pe({
1172
+ function de({
1219
1173
  label: t,
1220
1174
  options: r,
1221
- excludes: l,
1175
+ excludes: n,
1222
1176
  value: i,
1223
1177
  onChange: s,
1224
- allComponents: a,
1178
+ allComponents: h,
1225
1179
  ...d
1226
1180
  }) {
1227
- var u;
1228
- const { t: c } = W(), b = r ?? X(Object.values(Nt(a, ...l ?? [])), "index").map((g) => g.data), v = (typeof i == "string" ? (u = a[i]) == null ? void 0 : u.data : void 0) ?? null;
1181
+ var a;
1182
+ const { t: c } = W(), b = r ?? X(Object.values(Nt(h, ...n ?? [])), "index").map((g) => g.data), v = (typeof i == "string" ? (a = h[i]) == null ? void 0 : a.data : void 0) ?? null;
1229
1183
  return /* @__PURE__ */ e(
1230
- Ae,
1184
+ je,
1231
1185
  {
1232
1186
  ...d,
1233
1187
  size: "small",
1234
1188
  options: b,
1235
1189
  autoHighlight: !0,
1236
- isOptionEqualToValue: (g, h) => g.id === h.id,
1190
+ isOptionEqualToValue: (g, m) => g.id === m.id,
1237
1191
  getOptionKey: (g) => g.id,
1238
1192
  getOptionLabel: (g) => g.name || g.id,
1239
1193
  renderInput: (g) => /* @__PURE__ */ e(V, { label: t || c("component"), ...g }),
1240
1194
  value: v,
1241
- onChange: (g, h) => {
1242
- var n, o, f, x, y, p;
1243
- let m = {};
1244
- h && (m = {
1245
- blockletId: (n = a[h == null ? void 0 : h.id]) == null ? void 0 : n.blockletId,
1246
- blockletTitle: (o = a[h == null ? void 0 : h.id]) == null ? void 0 : o.blockletTitle,
1247
- componentName: ((x = (f = a[h == null ? void 0 : h.id]) == null ? void 0 : f.data) == null ? void 0 : x.name) || ((p = (y = a[h == null ? void 0 : h.id]) == null ? void 0 : y.data) == null ? void 0 : p.id)
1248
- }), s == null || s(g, h == null ? void 0 : h.id, m);
1195
+ onChange: (g, m) => {
1196
+ var l, o, f, x, y, u;
1197
+ let p = {};
1198
+ m && (p = {
1199
+ blockletId: (l = h[m == null ? void 0 : m.id]) == null ? void 0 : l.blockletId,
1200
+ blockletTitle: (o = h[m == null ? void 0 : m.id]) == null ? void 0 : o.blockletTitle,
1201
+ componentName: ((x = (f = h[m == null ? void 0 : m.id]) == null ? void 0 : f.data) == null ? void 0 : x.name) || ((u = (y = h[m == null ? void 0 : m.id]) == null ? void 0 : y.data) == null ? void 0 : u.id)
1202
+ }), s == null || s(g, m == null ? void 0 : m.id, p);
1249
1203
  }
1250
1204
  }
1251
1205
  );
1252
1206
  }
1253
1207
  export {
1254
- Zt as BasicInfo,
1255
- pe as CustomComponentAutocomplete,
1256
- Ar as CustomComponentSettings,
1257
- ir as DefaultReactComponentScriptTemplate,
1258
- lr as DefaultWebComponentScriptTemplate,
1259
- Lt as PropertiesConfig,
1208
+ Xt as BasicInfo,
1209
+ de as CustomComponentAutocomplete,
1210
+ jr as CustomComponentSettings,
1211
+ rr as DefaultReactComponentScriptTemplate,
1212
+ ir as DefaultWebComponentScriptTemplate,
1213
+ Zt as PropertiesConfig,
1260
1214
  q as PropertyValueField
1261
1215
  };