@blocklet/pages-kit-inner-components 0.5.34 → 0.5.36

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/lib/cjs/add-component.js +2 -2
  2. package/lib/cjs/chunks/{array-DxhrK2d5.js → array-Ck0L_JhL.js} +1 -1
  3. package/lib/cjs/chunks/{config-string-DqWgB7yO.js → config-string-CaLe_baf.js} +1 -1
  4. package/lib/cjs/chunks/{draft-data-DzN2u_NT.js → draft-data-CY1N7Ozn.js} +1 -1
  5. package/lib/cjs/chunks/{home-0fezWT4S.js → home-CjWVwLEf.js} +3 -3
  6. package/lib/cjs/chunks/{publish-button-D2jaaXXn.js → publish-button-BDrUGRX4.js} +1 -1
  7. package/lib/cjs/chunks/site-state-CIPfhJn5.js +57 -0
  8. package/lib/cjs/chunks/state-D4QeRw7n.js +1 -0
  9. package/lib/cjs/components.js +1 -1
  10. package/lib/cjs/home.js +1 -1
  11. package/lib/cjs/project-html.js +1 -1
  12. package/lib/cjs/resources.js +1 -1
  13. package/lib/cjs/setting.js +2 -2
  14. package/lib/cjs/site-state.js +1 -1
  15. package/lib/es/add-component.js +4 -4
  16. package/lib/es/chunks/{array-D6qyZucY.js → array-HCA75FfO.js} +1 -1
  17. package/lib/es/chunks/{config-string-Btybe5Rd.js → config-string-17RNX8vu.js} +1 -1
  18. package/lib/es/chunks/{draft-data-DQ7_JyJX.js → draft-data-CyeVe0kA.js} +1 -1
  19. package/lib/es/chunks/{home-Dox9JwvF.js → home-COrN_x32.js} +4 -4
  20. package/lib/es/chunks/{publish-button-T2YJBoty.js → publish-button-WmGjhj6q.js} +3 -3
  21. package/lib/es/chunks/site-state-CfrteYXm.js +2137 -0
  22. package/lib/es/chunks/{state-NhsHvaKm.js → state-Br2xp7Mf.js} +179 -175
  23. package/lib/es/components.js +1 -1
  24. package/lib/es/home.js +3 -3
  25. package/lib/es/project-html.js +1 -1
  26. package/lib/es/resources.js +1 -1
  27. package/lib/es/setting.js +541 -534
  28. package/lib/es/site-state.js +1 -1
  29. package/package.json +3 -3
  30. package/lib/cjs/chunks/site-state-D00xEf4T.js +0 -57
  31. package/lib/cjs/chunks/state-DoGBMTzI.js +0 -1
  32. package/lib/es/chunks/site-state-nXcBqjeR.js +0 -2076
package/lib/es/setting.js CHANGED
@@ -1,29 +1,29 @@
1
- import { jsx as t, jsxs as O, Fragment as X } from "react/jsx-runtime";
2
- import { t as ve, g as Te, b as ce, E as ot, n as Ke, h as xe } from "./chunks/state-NhsHvaKm.js";
1
+ import { jsx as t, jsxs as O, Fragment as Z } from "react/jsx-runtime";
2
+ import { t as ve, g as Te, b as ce, E as ot, n as Ke, h as xe } from "./chunks/state-Br2xp7Mf.js";
3
3
  import de from "@arcblock/ux/lib/Empty";
4
- import { useLocaleContext as C } from "@arcblock/ux/lib/Locale/context";
4
+ import { useLocaleContext as D } from "@arcblock/ux/lib/Locale/context";
5
5
  import { CodeEditor as ge } from "@blocklet/code-editor";
6
6
  import nt from "@mui/icons-material/AddRounded";
7
7
  import st from "@mui/icons-material/ArrowDownward";
8
8
  import ct from "@mui/icons-material/ArrowUpward";
9
9
  import dt from "@mui/icons-material/DeleteOutline";
10
- import { Typography as B, TextField as V, Stack as R, FormLabel as ie, Box as j, TableContainer as at, Paper as Z, Table as Be, TableHead as Fe, TableRow as le, TableCell as oe, TableBody as Je, Button as E, IconButton as ae, InputAdornment as Pe, alpha as pe, Tooltip as G, buttonClasses as ut, Dialog as Me, Autocomplete as $e, FormControlLabel as pt, Switch as mt, MenuItem as me, DialogTitle as ft, DialogContent as ht, DialogActions as bt, Collapse as yt, Divider as vt, Popper as xt } from "@mui/material";
10
+ import { Typography as B, TextField as V, Stack as R, FormLabel as le, Box as j, TableContainer as at, Paper as ee, Table as Be, TableHead as Fe, TableRow as oe, TableCell as ne, TableBody as Je, Button as E, IconButton as ae, InputAdornment as we, alpha as pe, Tooltip as G, buttonClasses as ut, Dialog as Me, Autocomplete as $e, FormControlLabel as pt, Switch as mt, MenuItem as me, DialogTitle as ft, DialogContent as ht, DialogActions as bt, Collapse as yt, Divider as vt, Popper as xt } from "@mui/material";
11
11
  import A from "lodash/sortBy";
12
- import { useCallback as D, useMemo as ne, useRef as J, useId as gt, useEffect as $, useState as Q } from "react";
12
+ import { useCallback as C, useMemo as Q, useRef as J, useId as gt, useEffect as M, useState as X } from "react";
13
13
  import { useUpdate as _e } from "react-use";
14
- import { ColorItem as Pt, ConfigColorDialog as wt } from "@blocklet/pages-kit/builtin/color-picker";
15
- import { C as kt } from "./chunks/config-string-Btybe5Rd.js";
16
- import we from "lodash/isEmpty";
14
+ import { ColorItem as wt, ConfigColorDialog as Pt } from "@blocklet/pages-kit/builtin/color-picker";
15
+ import { C as kt } from "./chunks/config-string-17RNX8vu.js";
16
+ import Pe from "lodash/isEmpty";
17
17
  import He from "lodash/set";
18
18
  import * as fe from "yaml";
19
- import { UploaderButton as Ye, UploaderProvider as ue, useUploader as It, getImageSize as St, getVideoSize as Ot } from "@blocklet/pages-kit/builtin/uploader";
19
+ import { UploaderButton as Ye, UploaderProvider as ue, useUploader as St, getImageSize as It, getVideoSize as Ot } from "@blocklet/pages-kit/builtin/uploader";
20
20
  import jt from "lodash/cloneDeep";
21
21
  import he from "@arcblock/ux/lib/Toast";
22
22
  import { CustomComponentRenderer as qe, transpileAndLoadScript as Rt, getPropertiesFromCode as zt } from "@blocklet/pages-kit/components";
23
23
  import { parsePropertyValue as Nt } from "@blocklet/pages-kit/utils/property";
24
- import { unstable_useNumberInput as Vt, ClickAwayListener as Ct } from "@mui/base";
25
- import { VisibilityOffRounded as Dt, VisibilityRounded as Et, DeleteOutlineRounded as At, DragIndicatorRounded as Tt, TranslateRounded as Le, AddRounded as Ge, InfoRounded as Qe, StarRounded as Ut, SettingsRounded as Xe } from "@mui/icons-material";
26
- import { getYjsValue as ee } from "@syncedstore/core";
24
+ import { unstable_useNumberInput as Vt, ClickAwayListener as Dt } from "@mui/base";
25
+ import { VisibilityOffRounded as Ct, VisibilityRounded as Et, DeleteOutlineRounded as At, DragIndicatorRounded as Tt, TranslateRounded as Le, AddRounded as Ge, InfoRounded as Qe, StarRounded as Ut, SettingsRounded as Xe } from "@mui/icons-material";
26
+ import { getYjsValue as te } from "@syncedstore/core";
27
27
  import { useUpdate as Wt, useReactive as Kt } from "ahooks";
28
28
  import Bt from "lodash/assign";
29
29
  import Ft from "lodash/get";
@@ -35,7 +35,7 @@ import _t from "lodash/keyBy";
35
35
  import Ht from "lodash/omit";
36
36
  import Yt from "lodash/pick";
37
37
  import qt from "lodash/reduce";
38
- import { usePopupState as ke, bindTrigger as Ie, bindDialog as Ze, bindPopper as Lt } from "material-ui-popup-state/hooks";
38
+ import { usePopupState as ke, bindTrigger as Se, bindDialog as Ze, bindPopper as Lt } from "material-ui-popup-state/hooks";
39
39
  import { ErrorBoundary as Gt } from "react-error-boundary";
40
40
  import { cx as Qt } from "@emotion/css";
41
41
  import { useDrop as et, useDrag as Xt } from "react-dnd";
@@ -68,75 +68,75 @@ function rr({
68
68
  value: r,
69
69
  onChange: i,
70
70
  disabled: l = !1,
71
- itemLabel: u = "",
71
+ itemLabel: p = "",
72
72
  emptyHeight: y = 40,
73
73
  property: a,
74
- renderItem: x,
75
- ...g
74
+ renderItem: g,
75
+ ...P
76
76
  }) {
77
- const { t: b, locale: k } = C(), v = _e(), o = D(
78
- (p) => {
79
- i(ve(p, a.type));
77
+ const { t: b, locale: v } = D(), x = _e(), o = C(
78
+ (f) => {
79
+ i(ve(f, a.type));
80
80
  },
81
81
  [i, a.type]
82
- ), n = ne(() => Array.isArray(r) ? r : [], [r]), s = D(() => {
83
- const p = [...n, ""];
84
- o(p), v();
85
- }, [n, o, v]), d = D(() => {
82
+ ), s = Q(() => Array.isArray(r) ? r : [], [r]), n = C(() => {
83
+ const f = [...s, ""];
84
+ o(f), x();
85
+ }, [s, o, x]), d = C(() => {
86
86
  if (!a || !a.subProperties)
87
- return s();
88
- const p = {};
87
+ return n();
88
+ const f = {};
89
89
  A(Object.values(a.subProperties), "index").forEach(({ data: N }) => {
90
90
  var U, W;
91
91
  if (!N.key) return;
92
- const T = ((W = (U = N.locales) == null ? void 0 : U[k]) == null ? void 0 : W.defaultValue) ?? "";
93
- p[N.key] = T;
92
+ const T = ((W = (U = N.locales) == null ? void 0 : U[v]) == null ? void 0 : W.defaultValue) ?? "";
93
+ f[N.key] = T;
94
94
  });
95
- const z = [...n, p];
96
- o(z), v();
97
- }, [n, o, v, a, k, s]), m = D(
98
- (p) => {
95
+ const z = [...s, f];
96
+ o(z), x();
97
+ }, [s, o, x, a, v, n]), h = C(
98
+ (f) => {
99
99
  try {
100
- const I = JSON.parse(p);
101
- Array.isArray(I) ? o(I) : console.error("JSON解析结果不是数组");
102
- } catch (I) {
103
- console.error("JSON解析错误:", I);
100
+ const S = JSON.parse(f);
101
+ Array.isArray(S) ? o(S) : console.error("JSON解析结果不是数组");
102
+ } catch (S) {
103
+ console.error("JSON解析错误:", S);
104
104
  }
105
105
  },
106
106
  [o]
107
- ), w = D(
108
- (p) => {
109
- const I = n.filter((z, N) => N !== p);
110
- o(I), v();
107
+ ), w = C(
108
+ (f) => {
109
+ const S = s.filter((z, N) => N !== f);
110
+ o(S), x();
111
111
  },
112
- [n, o, v]
113
- ), c = D(
114
- (p) => {
115
- if (p <= 0) return;
116
- const I = [...n], z = I[p];
117
- I[p] = I[p - 1], I[p - 1] = z, o(I), v();
112
+ [s, o, x]
113
+ ), c = C(
114
+ (f) => {
115
+ if (f <= 0) return;
116
+ const S = [...s], z = S[f];
117
+ S[f] = S[f - 1], S[f - 1] = z, o(S), x();
118
118
  },
119
- [n, o, v]
120
- ), h = D(
121
- (p) => {
122
- if (p >= n.length - 1) return;
123
- const I = [...n], z = I[p];
124
- I[p] = I[p + 1], I[p + 1] = z, o(I), v();
119
+ [s, o, x]
120
+ ), m = C(
121
+ (f) => {
122
+ if (f >= s.length - 1) return;
123
+ const S = [...s], z = S[f];
124
+ S[f] = S[f + 1], S[f + 1] = z, o(S), x();
125
125
  },
126
- [n, o, v]
127
- ), f = D(
128
- (p, I) => {
129
- const z = [...n];
130
- z[p] = I, o(z);
126
+ [s, o, x]
127
+ ), u = C(
128
+ (f, S) => {
129
+ const z = [...s];
130
+ z[f] = S, o(z);
131
131
  },
132
- [n, o]
133
- ), P = a && a.subProperties && Object.keys(a.subProperties).length > 0, S = ne(() => [
132
+ [s, o]
133
+ ), k = a && a.subProperties && Object.keys(a.subProperties).length > 0, I = Q(() => [
134
134
  {
135
135
  field: "index",
136
136
  headerName: "#",
137
137
  width: 40,
138
138
  align: "center",
139
- renderCell: ({ index: p }) => /* @__PURE__ */ t(
139
+ renderCell: ({ index: f }) => /* @__PURE__ */ t(
140
140
  B,
141
141
  {
142
142
  variant: "body1",
@@ -150,28 +150,28 @@ function rr({
150
150
  justifyContent: "center",
151
151
  color: "text.secondary"
152
152
  },
153
- children: p + 1
153
+ children: f + 1
154
154
  }
155
155
  )
156
156
  },
157
157
  {
158
158
  field: "content",
159
159
  headerName: "",
160
- renderCell: ({ row: p, index: I }) => x && P ? x({
161
- item: p,
162
- index: I,
160
+ renderCell: ({ row: f, index: S }) => g && k ? g({
161
+ item: f,
162
+ index: S,
163
163
  property: a,
164
- onChange: (z) => f(I, z)
164
+ onChange: (z) => u(S, z)
165
165
  }) : /* @__PURE__ */ t(
166
166
  V,
167
167
  {
168
168
  fullWidth: !0,
169
169
  size: "small",
170
170
  disabled: l,
171
- value: p,
172
- placeholder: u || `${b("item")} ${I + 1}`,
173
- onChange: (z) => f(I, z.target.value),
174
- ...g
171
+ value: f,
172
+ placeholder: p || `${b("item")} ${S + 1}`,
173
+ onChange: (z) => u(S, z.target.value),
174
+ ...P
175
175
  }
176
176
  )
177
177
  },
@@ -181,35 +181,35 @@ function rr({
181
181
  width: 30,
182
182
  // 增加宽度以容纳更多按钮
183
183
  align: "center",
184
- renderCell: ({ index: p }) => /* @__PURE__ */ O(R, { direction: "column", spacing: 0.25, children: [
185
- /* @__PURE__ */ t(er, { disabled: l || p === 0, onClick: () => c(p) }),
184
+ renderCell: ({ index: f }) => /* @__PURE__ */ O(R, { direction: "column", spacing: 0.25, children: [
185
+ /* @__PURE__ */ t(er, { disabled: l || f === 0, onClick: () => c(f) }),
186
186
  /* @__PURE__ */ t(
187
187
  tr,
188
188
  {
189
- disabled: l || p === n.length - 1,
190
- onClick: () => h(p)
189
+ disabled: l || f === s.length - 1,
190
+ onClick: () => m(f)
191
191
  }
192
192
  ),
193
- /* @__PURE__ */ t(Zt, { disabled: l, onClick: () => w(p) })
193
+ /* @__PURE__ */ t(Zt, { disabled: l, onClick: () => w(f) })
194
194
  ] })
195
195
  }
196
196
  ], [
197
- x,
198
- P,
197
+ g,
198
+ k,
199
199
  a,
200
- f,
201
200
  u,
201
+ p,
202
202
  b,
203
203
  l,
204
- g,
204
+ P,
205
205
  w,
206
206
  c,
207
- h,
208
- n.length
207
+ m,
208
+ s.length
209
209
  ]);
210
- return P ? /* @__PURE__ */ O(R, { width: "100%", gap: 1, children: [
211
- e && /* @__PURE__ */ t(ie, { children: e }),
212
- n.length > 0 ? /* @__PURE__ */ t(at, { component: Z, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ O(
210
+ return k ? /* @__PURE__ */ O(R, { width: "100%", gap: 1, children: [
211
+ e && /* @__PURE__ */ t(le, { children: e }),
212
+ s.length > 0 ? /* @__PURE__ */ t(at, { component: ee, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ O(
213
213
  Be,
214
214
  {
215
215
  size: "small",
@@ -227,28 +227,28 @@ function rr({
227
227
  borderCollapse: "collapse"
228
228
  },
229
229
  children: [
230
- /* @__PURE__ */ t(Fe, { sx: { display: "none" }, children: /* @__PURE__ */ t(le, { children: S.map((p) => /* @__PURE__ */ t(
231
- oe,
230
+ /* @__PURE__ */ t(Fe, { sx: { display: "none" }, children: /* @__PURE__ */ t(oe, { children: I.map((f) => /* @__PURE__ */ t(
231
+ ne,
232
232
  {
233
- width: p.width,
234
- align: p.align || "left",
233
+ width: f.width,
234
+ align: f.align || "left",
235
235
  sx: { fontWeight: "bold" },
236
- children: p.renderHeader ? p.renderHeader() : p.headerName
236
+ children: f.renderHeader ? f.renderHeader() : f.headerName
237
237
  },
238
- p.field
238
+ f.field
239
239
  )) }) }),
240
- /* @__PURE__ */ t(Je, { children: n.map((p, I, z) => /* @__PURE__ */ t(
241
- le,
240
+ /* @__PURE__ */ t(Je, { children: s.map((f, S, z) => /* @__PURE__ */ t(
241
+ oe,
242
242
  {
243
243
  sx: {
244
- borderBottom: I < z.length - 1 ? "1px solid" : "none",
244
+ borderBottom: S < z.length - 1 ? "1px solid" : "none",
245
245
  borderColor: "divider",
246
246
  "&:hover": {
247
247
  backgroundColor: "action.hover"
248
248
  }
249
249
  },
250
- children: S.map((N) => /* @__PURE__ */ t(
251
- oe,
250
+ children: I.map((N) => /* @__PURE__ */ t(
251
+ ne,
252
252
  {
253
253
  width: N.width,
254
254
  align: N.align || "left",
@@ -256,15 +256,15 @@ function rr({
256
256
  borderBottom: "none"
257
257
  },
258
258
  children: N.renderCell({
259
- row: p,
260
- index: I,
261
- onChange: (T) => f(I, T)
259
+ row: f,
260
+ index: S,
261
+ onChange: (T) => u(S, T)
262
262
  })
263
263
  },
264
- `${I}-${N.field}`
264
+ `${S}-${N.field}`
265
265
  ))
266
266
  },
267
- I
267
+ S
268
268
  )) })
269
269
  ]
270
270
  }
@@ -282,15 +282,15 @@ function rr({
282
282
  }
283
283
  )
284
284
  ] }) : /* @__PURE__ */ O(R, { width: "100%", gap: 1, children: [
285
- e && /* @__PURE__ */ t(ie, { children: e }),
285
+ e && /* @__PURE__ */ t(le, { children: e }),
286
286
  /* @__PURE__ */ t(j, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ t(
287
287
  ge,
288
288
  {
289
289
  keyId: a.id,
290
- locale: k,
290
+ locale: v,
291
291
  language: "json",
292
- value: JSON.stringify(n, null, 2),
293
- onChange: (p) => m(p || ""),
292
+ value: JSON.stringify(s, null, 2),
293
+ onChange: (f) => h(f || ""),
294
294
  fullScreenOptions: {
295
295
  enableEscExit: !0,
296
296
  targetContainer: () => document.getElementById("parameters-config-dialog") || null
@@ -306,7 +306,7 @@ function ir({
306
306
  ...i
307
307
  }) {
308
308
  const l = J(null);
309
- return /* @__PURE__ */ O(X, { children: [
309
+ return /* @__PURE__ */ O(Z, { children: [
310
310
  /* @__PURE__ */ t(
311
311
  kt,
312
312
  {
@@ -314,14 +314,14 @@ function ir({
314
314
  value: e,
315
315
  onChange: r,
316
316
  InputProps: {
317
- endAdornment: /* @__PURE__ */ t(Pe, { position: "end", children: /* @__PURE__ */ t(
318
- Pt,
317
+ endAdornment: /* @__PURE__ */ t(we, { position: "end", children: /* @__PURE__ */ t(
318
+ wt,
319
319
  {
320
320
  color: e ?? "",
321
321
  style: { width: "1.5rem", height: "1.5rem", padding: 0 },
322
322
  onClick: () => {
323
- var u;
324
- (u = l.current) == null || u.open({ value: e ?? "" });
323
+ var p;
324
+ (p = l.current) == null || p.open({ value: e ?? "" });
325
325
  }
326
326
  }
327
327
  ) })
@@ -329,11 +329,11 @@ function ir({
329
329
  }
330
330
  ),
331
331
  /* @__PURE__ */ t(
332
- wt,
332
+ Pt,
333
333
  {
334
334
  ref: l,
335
- onSave: ({ value: u }, y) => {
336
- r(u), y();
335
+ onSave: ({ value: p }, y) => {
336
+ r(p), y();
337
337
  }
338
338
  }
339
339
  )
@@ -344,43 +344,43 @@ function lr({
344
344
  value: r,
345
345
  onChange: i,
346
346
  property: l,
347
- component: u,
347
+ component: p,
348
348
  defaultLocale: y,
349
349
  allComponents: a,
350
- PropertyValueField: x,
351
- onUpload: g
350
+ PropertyValueField: g,
351
+ onUpload: P
352
352
  }) {
353
- const { locale: b } = C(), k = J(null);
354
- if (!we(l.subProperties)) {
353
+ const { locale: b } = D(), v = J(null);
354
+ if (!Pe(l.subProperties)) {
355
355
  const o = A(Object.values(l.subProperties || {}), "index").filter(
356
- (n) => n.data.visible !== !1 && n.data.key
356
+ (s) => s.data.visible !== !1 && s.data.key
357
357
  );
358
358
  return /* @__PURE__ */ O(R, { width: "100%", children: [
359
- /* @__PURE__ */ t(ie, { sx: { px: 0.25, py: 0.5 }, children: e }),
360
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(j, { sx: { position: "relative" }, children: o.map((n, s) => {
361
- const { data: d } = n, m = d.key ?? d.id, w = s === o.length - 1;
359
+ /* @__PURE__ */ t(le, { sx: { px: 0.25, py: 0.5 }, children: e }),
360
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(j, { sx: { position: "relative" }, children: o.map((s, n) => {
361
+ const { data: d } = s, h = d.key ?? d.id, w = n === o.length - 1;
362
362
  let c = null;
363
363
  try {
364
- r && typeof r == "object" ? c = r[m] : typeof r == "string" && (c = (l.type === "yaml" ? fe.parse(r || "") : JSON.parse(r || "{}"))[m]);
364
+ r && typeof r == "object" ? c = r[h] : typeof r == "string" && (c = (l.type === "yaml" ? fe.parse(r || "") : JSON.parse(r || "{}"))[h]);
365
365
  } catch {
366
366
  }
367
367
  c == null && (d.locales && b && d.locales[b] ? c = d.locales[b].defaultValue : d.locales && y && d.locales[y] && (c = d.locales[y].defaultValue));
368
- const h = (P) => {
368
+ const m = (k) => {
369
369
  try {
370
- let S = {};
370
+ let I = {};
371
371
  if (typeof r == "string")
372
372
  try {
373
- S = l.type === "yaml" ? fe.parse(r || "") : JSON.parse(r || "{}");
373
+ I = l.type === "yaml" ? fe.parse(r || "") : JSON.parse(r || "{}");
374
374
  } catch {
375
375
  }
376
- else typeof r == "object" && r !== null && (S = { ...r });
377
- He(S, m, P);
378
- const p = ve(S, l.type);
379
- i == null || i(p);
380
- } catch (S) {
381
- console.error("Error updating property:", S);
376
+ else typeof r == "object" && r !== null && (I = { ...r });
377
+ He(I, h, k);
378
+ const f = ve(I, l.type);
379
+ i == null || i(f);
380
+ } catch (I) {
381
+ console.error("Error updating property:", I);
382
382
  }
383
- }, f = 8;
383
+ }, u = 8;
384
384
  return /* @__PURE__ */ O(
385
385
  j,
386
386
  {
@@ -405,7 +405,7 @@ function lr({
405
405
  {
406
406
  sx: {
407
407
  position: "absolute",
408
- left: f,
408
+ left: u,
409
409
  top: 0,
410
410
  height: 16,
411
411
  // 连接到字段中点的高度
@@ -420,7 +420,7 @@ function lr({
420
420
  {
421
421
  sx: {
422
422
  position: "absolute",
423
- left: f,
423
+ left: u,
424
424
  top: 16,
425
425
  // 连接到字段中点
426
426
  width: 12,
@@ -435,7 +435,7 @@ function lr({
435
435
  {
436
436
  sx: {
437
437
  position: "absolute",
438
- left: f,
438
+ left: u,
439
439
  top: 16,
440
440
  // 从当前项中点
441
441
  bottom: -8,
@@ -450,12 +450,12 @@ function lr({
450
450
  }
451
451
  ),
452
452
  /* @__PURE__ */ t(j, { sx: { flexGrow: 1 }, children: /* @__PURE__ */ t(
453
- x,
453
+ g,
454
454
  {
455
- component: u,
455
+ component: p,
456
456
  property: d,
457
457
  value: c,
458
- onChange: h,
458
+ onChange: m,
459
459
  size: "small",
460
460
  fullWidth: !0,
461
461
  defaultLocale: y,
@@ -483,7 +483,7 @@ function lr({
483
483
  },
484
484
  children: [
485
485
  /* @__PURE__ */ t(
486
- ie,
486
+ le,
487
487
  {
488
488
  sx: {
489
489
  position: "absolute",
@@ -505,7 +505,7 @@ function lr({
505
505
  i == null || i(o);
506
506
  },
507
507
  onUpload: (o) => {
508
- k.current = o, g && g(o);
508
+ v.current = o, P && P(o);
509
509
  },
510
510
  fullScreenOptions: {
511
511
  enableEscExit: !0,
@@ -548,57 +548,57 @@ function tt({
548
548
  renderItem: i,
549
549
  ...l
550
550
  }) {
551
- const u = J(null), y = gt(), a = Wt(), x = A(Object.entries(r), (n) => n[1].index).map((n) => n[0]), g = J(x), b = D(
552
- (n) => {
553
- g.current = n, a();
551
+ const p = J(null), y = gt(), a = Wt(), g = A(Object.entries(r), (s) => s[1].index).map((s) => s[0]), P = J(g), b = C(
552
+ (s) => {
553
+ P.current = s, a();
554
554
  },
555
555
  [a]
556
- ), k = D(
557
- ({ index: n }, { index: s }) => {
558
- const d = [...g.current];
559
- d.splice(s, 0, ...d.splice(n, 1)), b(d);
556
+ ), v = C(
557
+ ({ index: s }, { index: n }) => {
558
+ const d = [...P.current];
559
+ d.splice(n, 0, ...d.splice(s, 1)), b(d);
560
560
  },
561
561
  [b]
562
562
  );
563
- $(() => {
564
- b(x);
565
- }, [x.join("-")]);
566
- const [{ isOver: v }, o] = et({
563
+ M(() => {
564
+ b(g);
565
+ }, [g.join("-")]);
566
+ const [{ isOver: x }, o] = et({
567
567
  accept: y,
568
- collect: (n) => ({
569
- isOver: n.isOver()
568
+ collect: (s) => ({
569
+ isOver: s.isOver()
570
570
  }),
571
571
  canDrop: () => !e,
572
572
  drop: () => {
573
573
  var d;
574
- const n = () => {
575
- g.current.forEach((m, w) => {
576
- const c = r[m];
574
+ const s = () => {
575
+ P.current.forEach((h, w) => {
576
+ const c = r[h];
577
577
  c && (c.index = w);
578
578
  });
579
- }, s = (d = ee(r)) == null ? void 0 : d.doc;
580
- s ? s.transact(() => {
581
- n();
582
- }) : n();
579
+ }, n = (d = te(r)) == null ? void 0 : d.doc;
580
+ n ? n.transact(() => {
581
+ s();
582
+ }) : s();
583
583
  }
584
584
  });
585
- return $(() => {
586
- v || b(x);
587
- }, [v]), o(u), /* @__PURE__ */ t(j, { ...l, ref: u, className: Qt(v && "isDragging"), children: g.current.map((n, s) => /* @__PURE__ */ t(
585
+ return M(() => {
586
+ x || b(g);
587
+ }, [x]), o(p), /* @__PURE__ */ t(j, { ...l, ref: p, className: Qt(x && "isDragging"), children: P.current.map((s, n) => /* @__PURE__ */ t(
588
588
  nr,
589
589
  {
590
590
  type: y,
591
591
  disabled: e,
592
- id: n,
593
- index: s,
594
- itemIndex: (d) => g.current.indexOf(d),
595
- move: k,
592
+ id: s,
593
+ index: n,
594
+ itemIndex: (d) => P.current.indexOf(d),
595
+ move: v,
596
596
  children: (d) => {
597
- const m = r[n];
598
- return m ? i(m.data, s, d) : null;
597
+ const h = r[s];
598
+ return h ? i(h.data, n, d) : null;
599
599
  }
600
600
  },
601
- n
601
+ s
602
602
  )) });
603
603
  }
604
604
  function nr({
@@ -606,57 +606,57 @@ function nr({
606
606
  id: r,
607
607
  index: i,
608
608
  type: l,
609
- children: u,
609
+ children: p,
610
610
  itemIndex: y,
611
611
  move: a
612
612
  }) {
613
- const x = J(), [{ isDragging: g }, b, k] = Xt({
613
+ const g = J(), [{ isDragging: P }, b, v] = Xt({
614
614
  type: l,
615
615
  item: () => ({ id: r }),
616
616
  canDrag: () => !e,
617
617
  collect: (o) => ({ isDragging: o.isDragging() })
618
- }), [, v] = et({
618
+ }), [, x] = et({
619
619
  accept: l,
620
620
  canDrop: () => !e,
621
- hover(o, n) {
622
- var f;
623
- if (!x.current)
621
+ hover(o, s) {
622
+ var u;
623
+ if (!g.current)
624
624
  return;
625
- const s = y(o.id), d = i;
626
- if (s === d)
625
+ const n = y(o.id), d = i;
626
+ if (n === d)
627
627
  return;
628
- const m = (f = x.current) == null ? void 0 : f.getBoundingClientRect(), w = (m.bottom - m.top) / 2, h = n.getClientOffset().y - m.top;
629
- s < d && h < w || s > d && h > w || a({ id: o.id, index: s }, { id: r, index: i });
628
+ const h = (u = g.current) == null ? void 0 : u.getBoundingClientRect(), w = (h.bottom - h.top) / 2, m = s.getClientOffset().y - h.top;
629
+ n < d && m < w || n > d && m > w || a({ id: o.id, index: n }, { id: r, index: i });
630
630
  }
631
631
  });
632
- return typeof u == "function" ? u({
633
- isDragging: g,
632
+ return typeof p == "function" ? p({
633
+ isDragging: P,
634
634
  drag: b,
635
- drop: (o) => (x.current = o, v(o)),
636
- preview: k
637
- }) : (b(v(k(x))), /* @__PURE__ */ t(j, { ref: x, children: u }));
635
+ drop: (o) => (g.current = o, x(o)),
636
+ preview: v
637
+ }) : (b(x(v(g))), /* @__PURE__ */ t(j, { ref: g, children: p }));
638
638
  }
639
639
  function sr({
640
640
  drop: e,
641
641
  preview: r,
642
642
  drag: i,
643
643
  disabled: l,
644
- isDragging: u,
644
+ isDragging: p,
645
645
  children: y,
646
646
  onDelete: a,
647
- onVisibilityChange: x,
648
- visible: g = !0,
647
+ onVisibilityChange: g,
648
+ visible: P = !0,
649
649
  actions: b,
650
- alwaysShowActions: k = !1
650
+ alwaysShowActions: v = !1
651
651
  }) {
652
- const { t: v } = C();
652
+ const { t: x } = D();
653
653
  return /* @__PURE__ */ t(
654
654
  j,
655
655
  {
656
656
  ref: e,
657
657
  sx: {
658
658
  ":hover .hover-visible": { maxWidth: "100%" },
659
- opacity: g ? 1 : 0.5
659
+ opacity: P ? 1 : 0.5
660
660
  },
661
661
  children: /* @__PURE__ */ O(j, { sx: { position: "relative" }, children: [
662
662
  /* @__PURE__ */ t(
@@ -666,7 +666,7 @@ function sr({
666
666
  sx: {
667
667
  flex: 1,
668
668
  borderRadius: 0.5,
669
- bgcolor: u ? "action.hover" : "background.paper",
669
+ bgcolor: p ? "action.hover" : "background.paper",
670
670
  opacity: 0.9999
671
671
  // NOTE: make preview effective
672
672
  },
@@ -676,9 +676,9 @@ function sr({
676
676
  !l && /* @__PURE__ */ t(
677
677
  j,
678
678
  {
679
- className: k ? "" : "hover-visible",
679
+ className: v ? "" : "hover-visible",
680
680
  sx: {
681
- maxWidth: k ? "100%" : 0,
681
+ maxWidth: v ? "100%" : 0,
682
682
  overflow: "hidden",
683
683
  position: "absolute",
684
684
  right: 2,
@@ -702,9 +702,9 @@ function sr({
702
702
  },
703
703
  children: [
704
704
  b,
705
- x && /* @__PURE__ */ t(G, { title: v(g ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(E, { onClick: () => x(!g), children: g ? /* @__PURE__ */ t(Dt, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(Et, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
706
- a && /* @__PURE__ */ t(G, { title: v("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(E, { onClick: a, children: /* @__PURE__ */ t(At, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
707
- /* @__PURE__ */ t(G, { title: v("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(E, { ref: i, children: /* @__PURE__ */ t(Tt, { sx: { color: "grey.500" } }) }) })
705
+ g && /* @__PURE__ */ t(G, { title: x(P ? "hideParameter" : "showParameter"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(E, { onClick: () => g(!P), children: P ? /* @__PURE__ */ t(Ct, { sx: { fontSize: "1.25rem", color: "grey.500" } }) : /* @__PURE__ */ t(Et, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
706
+ a && /* @__PURE__ */ t(G, { title: x("delete"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(E, { onClick: a, children: /* @__PURE__ */ t(At, { sx: { fontSize: "1.25rem", color: "grey.500" } }) }) }),
707
+ /* @__PURE__ */ t(G, { title: x("dragSort"), disableInteractive: !0, placement: "top", children: /* @__PURE__ */ t(E, { ref: i, children: /* @__PURE__ */ t(Tt, { sx: { color: "grey.500" } }) }) })
708
708
  ]
709
709
  }
710
710
  )
@@ -719,7 +719,7 @@ function cr({
719
719
  value: r,
720
720
  onChange: i
721
721
  }) {
722
- const [l, u] = Q(!1);
722
+ const [l, p] = X(!1);
723
723
  return /* @__PURE__ */ O(R, { gap: 1, children: [
724
724
  /* @__PURE__ */ t(
725
725
  V,
@@ -733,8 +733,8 @@ function cr({
733
733
  Ye,
734
734
  {
735
735
  onChange: ({ response: y }) => {
736
- var x;
737
- const a = (x = y == null ? void 0 : y.data) == null ? void 0 : x.filename;
736
+ var g;
737
+ const a = (g = y == null ? void 0 : y.data) == null ? void 0 : g.filename;
738
738
  a && (i == null || i(a));
739
739
  }
740
740
  }
@@ -752,15 +752,15 @@ function cr({
752
752
  maxWidth: 100,
753
753
  maxHeight: 100,
754
754
  width: "100%",
755
- onClick: () => u(!0)
755
+ onClick: () => p(!0)
756
756
  }
757
757
  ),
758
- /* @__PURE__ */ t(Me, { open: l, onClose: () => u(!1), children: /* @__PURE__ */ t(j, { component: "img", sx: { objectFit: "contain" }, src: Te(r), alt: e }) })
758
+ /* @__PURE__ */ t(Me, { open: l, onClose: () => p(!1), children: /* @__PURE__ */ t(j, { component: "img", sx: { objectFit: "contain" }, src: Te(r), alt: e }) })
759
759
  ] });
760
760
  }
761
761
  function be(e, r = "") {
762
- return qt(e, (i, l, u) => {
763
- const y = r ? `${r}.${u}` : u;
762
+ return qt(e, (i, l, p) => {
763
+ const y = r ? `${r}.${p}` : p;
764
764
  return $t(l) ? Bt(i, be(l, y)) : i[y] = l, i;
765
765
  }, {});
766
766
  }
@@ -778,7 +778,7 @@ const dr = [
778
778
  { value: "component", label: "Component" },
779
779
  { value: "custom", label: "Custom (Render by a Component)" }
780
780
  ];
781
- function re(e, r, i) {
781
+ function ie(e, r, i) {
782
782
  return !e || !i ? !1 : Object.values(e).some(({ data: l }) => l.id !== r && l.key === i);
783
783
  }
784
784
  function ye(e, r) {
@@ -787,54 +787,61 @@ function ye(e, r) {
787
787
  }
788
788
  function ci({ componentId: e }) {
789
789
  const { state: { components: r } } = ce(), i = r[e], l = i == null ? void 0 : i.data;
790
- return l ? /* @__PURE__ */ t(R, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ t(j, { p: 2, children: /* @__PURE__ */ t(Gt, { FallbackComponent: ot, resetKeys: [e], children: /* @__PURE__ */ t(ar, { value: l }) }) }) }) : null;
790
+ return l ? /* @__PURE__ */ t(R, { maxHeight: "100%", overflow: "auto", children: /* @__PURE__ */ t(j, { p: 2, children: /* @__PURE__ */ t(Gt, { FallbackComponent: ot, resetKeys: [e], children: /* @__PURE__ */ t(ar, { value: l, componentId: e }) }) }) }) : null;
791
791
  }
792
- function ar({ value: e }) {
793
- var b, k, v;
794
- const { t: r } = C(), { localState: { currentLocale: i, customComponentPreviewerProperties: l }, state: { config: { defaultLocale: u } }, localActions: { setCustomComponentPreviewerProperties: y } } = ce(), a = ee(e).doc, x = xe(), g = Kt({
792
+ function ar({ value: e, componentId: r }) {
793
+ var x, o, s;
794
+ const { t: i } = D(), { localState: { currentLocale: l, customComponentPreviewerProperties: p }, state: { config: { defaultLocale: y } }, localActions: { setCustomComponentPreviewerProperties: a } } = ce(), g = te(e).doc, P = xe(), b = Q(() => (p == null ? void 0 : p[r]) ?? {}, [r, p]), v = Kt({
795
+ componentId: r,
795
796
  propertiesValue: {
796
- ...y
797
+ ...b
797
798
  }
798
799
  });
799
- return $(() => {
800
- const o = Object.fromEntries(Object.values(e.properties ?? {}).map(({ data: n }) => {
801
- var s, d, m, w, c;
800
+ return M(() => {
801
+ v.componentId !== r && (v.componentId = r, v.propertiesValue = {
802
+ ...b
803
+ });
804
+ }, [r, b, v]), M(() => {
805
+ if (v.componentId !== r)
806
+ return;
807
+ const n = Object.fromEntries(Object.values(e.properties ?? {}).map(({ data: d }) => {
808
+ var h, w, c, m, u;
802
809
  return [
803
- n.id,
810
+ d.id,
804
811
  {
805
- value: ((s = g.propertiesValue[n.id]) == null ? void 0 : s.value) ?? Nt(n, ((m = (d = n.locales) == null ? void 0 : d[i]) == null ? void 0 : m.defaultValue) ?? ((c = (w = n.locales) == null ? void 0 : w[u]) == null ? void 0 : c.defaultValue), {
806
- locale: i,
807
- defaultLocale: u
812
+ value: ((h = v.propertiesValue[d.id]) == null ? void 0 : h.value) ?? Nt(d, ((c = (w = d.locales) == null ? void 0 : w[l]) == null ? void 0 : c.defaultValue) ?? ((u = (m = d.locales) == null ? void 0 : m[y]) == null ? void 0 : u.defaultValue), {
813
+ locale: l,
814
+ defaultLocale: y
808
815
  })
809
816
  }
810
817
  ];
811
818
  }));
812
- y(o);
813
- }, [JSON.stringify(g.propertiesValue)]), /* @__PURE__ */ t(R, { height: "100%", children: /* @__PURE__ */ O(R, { gap: 2, children: [
819
+ a(r, n);
820
+ }, [JSON.stringify(v.propertiesValue), r, v.componentId]), /* @__PURE__ */ t(R, { height: "100%", children: /* @__PURE__ */ O(R, { gap: 2, children: [
814
821
  /* @__PURE__ */ t(ur, { config: e }),
815
822
  /* @__PURE__ */ t(mr, {
816
823
  config: e,
817
- currentLocale: i,
818
- defaultLocale: u,
819
- allComponents: x,
820
- onUpdateConfig: (o) => {
821
- a.transact(() => {
822
- o(e);
824
+ currentLocale: l,
825
+ defaultLocale: y,
826
+ allComponents: P,
827
+ onUpdateConfig: (n) => {
828
+ g.transact(() => {
829
+ n(e);
823
830
  });
824
831
  }
825
832
  }),
826
833
  /* @__PURE__ */ O(R, { gap: 2, direction: "row", justifyContent: "space-between", alignItems: "center", children: [
827
- /* @__PURE__ */ t(B, { variant: "subtitle1", children: r("renderer") }),
834
+ /* @__PURE__ */ t(B, { variant: "subtitle1", children: i("renderer") }),
828
835
  /* @__PURE__ */ O(V, {
829
836
  hiddenLabel: !0,
830
837
  size: "small",
831
838
  select: !0,
832
839
  SelectProps: { autoWidth: !0 },
833
- value: ((b = e.renderer) == null ? void 0 : b.type) || "react-component",
834
- onChange: (o) => {
835
- a.transact(() => {
836
- const n = o.target.value;
837
- e.renderer ?? (e.renderer = { type: n }), e.renderer.type = n;
840
+ value: ((x = e.renderer) == null ? void 0 : x.type) || "react-component",
841
+ onChange: (n) => {
842
+ g.transact(() => {
843
+ const d = n.target.value;
844
+ e.renderer ?? (e.renderer = { type: d }), e.renderer.type = d;
838
845
  });
839
846
  },
840
847
  children: [
@@ -843,31 +850,31 @@ function ar({ value: e }) {
843
850
  ]
844
851
  })
845
852
  ] }),
846
- ((k = e.renderer) == null ? void 0 : k.type) === "component" && /* @__PURE__ */ t(Pr, { value: e }),
847
- ((v = e.renderer) == null ? void 0 : v.type) === "react-component" && /* @__PURE__ */ t(gr, { value: e }),
853
+ ((o = e.renderer) == null ? void 0 : o.type) === "component" && /* @__PURE__ */ t(wr, { value: e }),
854
+ ((s = e.renderer) == null ? void 0 : s.type) === "react-component" && /* @__PURE__ */ t(gr, { value: e }),
848
855
  /* @__PURE__ */ t(lt, {
849
856
  config: e,
850
- currentLocale: i,
851
- defaultLocale: u,
852
- allComponents: x,
853
- propertiesValue: l,
854
- onChange: ({ value: o, id: n, path: s }) => {
855
- const d = [...s, "data"];
856
- if (!Ft(e, d)) {
857
- he.warning(r("cannotFindPropertyKey", {
858
- key: d.join(".")
857
+ currentLocale: l,
858
+ defaultLocale: y,
859
+ allComponents: P,
860
+ propertiesValue: b,
861
+ onChange: ({ value: n, id: d, path: h }) => {
862
+ const w = [...h, "data"];
863
+ if (!Ft(e, w)) {
864
+ he.warning(i("cannotFindPropertyKey", {
865
+ key: w.join(".")
859
866
  }));
860
867
  return;
861
868
  }
862
- g.propertiesValue[n] = {
863
- value: o.value
869
+ v.propertiesValue[d] = {
870
+ value: n.value
864
871
  };
865
872
  }
866
873
  })
867
874
  ] }) });
868
875
  }
869
876
  function ur({ config: e }) {
870
- const { t: r } = C();
877
+ const { t: r } = D();
871
878
  return /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ O(R, { gap: 2, children: [
872
879
  /* @__PURE__ */ t(B, { variant: "subtitle1", children: r("basicInfo") }),
873
880
  /* @__PURE__ */ t(V, {
@@ -902,65 +909,65 @@ function ur({ config: e }) {
902
909
  })
903
910
  ] }) });
904
911
  }
905
- function rt({ data: e, params: r, visible: i, config: l, currentLocale: u, defaultLocale: y, allComponents: a, onUpdateConfig: x }) {
906
- var k, v, o, n, s, d;
907
- const { t: g } = C(), b = ne(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? br : M, [e.type]);
912
+ function rt({ data: e, params: r, visible: i, config: l, currentLocale: p, defaultLocale: y, allComponents: a, onUpdateConfig: g }) {
913
+ var v, x, o, s, n, d;
914
+ const { t: P } = D(), b = Q(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? br : $, [e.type]);
908
915
  return /* @__PURE__ */ t(sr, {
909
916
  preview: r.preview,
910
917
  drop: r.drop,
911
918
  drag: r.drag,
912
919
  isDragging: r.isDragging,
913
920
  onDelete: () => {
914
- x((m) => {
915
- if (m.properties) {
916
- const c = Object.entries(m.properties).sort(([, f], [, P]) => f.index - P.index);
917
- delete m.properties[e.id], c.filter(([f]) => f !== e.id).forEach(([, f], P) => {
918
- f.index = P;
921
+ g((h) => {
922
+ if (h.properties) {
923
+ const c = Object.entries(h.properties).sort(([, u], [, k]) => u.index - k.index);
924
+ delete h.properties[e.id], c.filter(([u]) => u !== e.id).forEach(([, u], k) => {
925
+ u.index = k;
919
926
  });
920
927
  }
921
928
  });
922
929
  },
923
930
  visible: i,
924
- onVisibilityChange: (m) => {
925
- x((w) => {
931
+ onVisibilityChange: (h) => {
932
+ g((w) => {
926
933
  const c = w.properties[e.id].data;
927
- c.visible = m;
934
+ c.visible = h;
928
935
  });
929
936
  },
930
937
  alwaysShowActions: !0,
931
938
  children: /* @__PURE__ */ O(R, { direction: "column", gap: 2, children: [
932
939
  /* @__PURE__ */ t(V, {
933
- label: g("key"),
940
+ label: P("key"),
934
941
  size: "small",
935
942
  required: !0,
936
943
  sx: {
937
944
  width: "calc(100% - 80px - 8px)",
938
945
  flex: 1,
939
946
  "& .MuiOutlinedInput-root": {
940
- borderColor: e.key ? re(l.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
947
+ borderColor: e.key ? ie(l.properties, e.id, e.key) ? "warning.main" : void 0 : "error.main"
941
948
  },
942
949
  "& .MuiFormLabel-root": {
943
- color: e.key ? re(l.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
950
+ color: e.key ? ie(l.properties, e.id, e.key) ? "warning.main" : "text.secondary" : "error.main"
944
951
  },
945
952
  "& .MuiFormLabel-root.Mui-focused": {
946
- color: e.key ? re(l.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
953
+ color: e.key ? ie(l.properties, e.id, e.key) ? "warning.main" : "primary.main" : "error.main"
947
954
  }
948
955
  },
949
956
  value: e.key || "",
950
- onChange: (m) => {
951
- x((w) => {
957
+ onChange: (h) => {
958
+ g((w) => {
952
959
  const c = w.properties[e.id].data;
953
- c.key = m.target.value.trim();
960
+ c.key = h.target.value.trim();
954
961
  });
955
962
  },
956
963
  InputProps: {
957
- endAdornment: !e.key || e.key && re(l.properties, e.id, e.key) ? /* @__PURE__ */ t(Pe, {
964
+ endAdornment: !e.key || e.key && ie(l.properties, e.id, e.key) ? /* @__PURE__ */ t(we, {
958
965
  position: "end",
959
966
  sx: {
960
967
  width: 16,
961
968
  ml: 0
962
969
  },
963
- children: /* @__PURE__ */ t(G, { title: e.key ? g("duplicateKey") : g("requiredKey"), children: /* @__PURE__ */ t(Qe, {
970
+ children: /* @__PURE__ */ t(G, { title: e.key ? P("duplicateKey") : P("requiredKey"), children: /* @__PURE__ */ t(Qe, {
964
971
  sx: {
965
972
  color: e.key ? "warning.main" : "error.main",
966
973
  fontSize: 16
@@ -971,35 +978,35 @@ function rt({ data: e, params: r, visible: i, config: l, currentLocale: u, defau
971
978
  }),
972
979
  /* @__PURE__ */ O(R, { direction: "row", gap: 1, children: [
973
980
  /* @__PURE__ */ t(V, {
974
- label: g("label"),
981
+ label: P("label"),
975
982
  size: "small",
976
983
  sx: { flex: 1 },
977
- value: (((v = (k = e.locales) == null ? void 0 : k[u]) == null ? void 0 : v.name) ?? ((n = (o = e.locales) == null ? void 0 : o[y]) == null ? void 0 : n.name)) || "",
978
- onChange: (m) => {
979
- x((w) => {
980
- var h;
984
+ value: (((x = (v = e.locales) == null ? void 0 : v[p]) == null ? void 0 : x.name) ?? ((s = (o = e.locales) == null ? void 0 : o[y]) == null ? void 0 : s.name)) || "",
985
+ onChange: (h) => {
986
+ g((w) => {
987
+ var m;
981
988
  const c = w.properties[e.id].data;
982
- c.locales ?? (c.locales = {}), (h = c.locales)[u] ?? (h[u] = {}), c.locales[u].name = m.target.value;
989
+ c.locales ?? (c.locales = {}), (m = c.locales)[p] ?? (m[p] = {}), c.locales[p].name = h.target.value;
983
990
  });
984
991
  }
985
992
  }),
986
993
  /* @__PURE__ */ t(V, {
987
- label: g("type"),
994
+ label: P("type"),
988
995
  size: "small",
989
996
  select: !0,
990
997
  sx: { flex: 1 },
991
998
  value: e.type === "string" && e.multiline ? "multiline" : e.type || "string",
992
- onChange: (m) => {
993
- x((w) => {
999
+ onChange: (h) => {
1000
+ g((w) => {
994
1001
  const c = w.properties[e.id].data;
995
1002
  if (c.locales)
996
- for (const f of Object.keys(c.locales))
997
- c.locales[f].defaultValue = void 0;
998
- const h = m.target.value;
999
- h === "multiline" ? (c.type = "string", c.multiline = !0) : (typeof c.multiline < "u" && delete c.multiline, c.type = h);
1003
+ for (const u of Object.keys(c.locales))
1004
+ c.locales[u].defaultValue = void 0;
1005
+ const m = h.target.value;
1006
+ m === "multiline" ? (c.type = "string", c.multiline = !0) : (typeof c.multiline < "u" && delete c.multiline, c.type = m);
1000
1007
  });
1001
1008
  },
1002
- children: dr.map((m) => /* @__PURE__ */ t(me, { value: m.value, children: m.label }, m.value))
1009
+ children: dr.map((h) => /* @__PURE__ */ t(me, { value: h.value, children: h.label }, h.value))
1003
1010
  })
1004
1011
  ] }),
1005
1012
  /* @__PURE__ */ O(R, { direction: "row", gap: 1, children: [
@@ -1008,21 +1015,21 @@ function rt({ data: e, params: r, visible: i, config: l, currentLocale: u, defau
1008
1015
  defaultLocale: y,
1009
1016
  component: l,
1010
1017
  property: e,
1011
- label: g("defaultValue"),
1018
+ label: P("defaultValue"),
1012
1019
  size: "small",
1013
1020
  fullWidth: !0,
1014
- value: (d = (s = e.locales) == null ? void 0 : s[u]) == null ? void 0 : d.defaultValue,
1015
- onChange: (m, w) => {
1016
- x((c) => {
1017
- var f;
1018
- const h = c.properties[e.id].data;
1021
+ value: (d = (n = e.locales) == null ? void 0 : n[p]) == null ? void 0 : d.defaultValue,
1022
+ onChange: (h, w) => {
1023
+ g((c) => {
1024
+ var u;
1025
+ const m = c.properties[e.id].data;
1019
1026
  if (w != null && w.forceUpdateProperty) {
1020
- const P = be(h), S = be(m);
1021
- Object.keys(S).forEach((p) => {
1022
- P[p] || He(h, p, S[p]);
1027
+ const k = be(m), I = be(h);
1028
+ Object.keys(I).forEach((f) => {
1029
+ k[f] || He(m, f, I[f]);
1023
1030
  });
1024
1031
  } else
1025
- h.locales ?? (h.locales = {}), (f = h.locales)[u] ?? (f[u] = {}), h.locales[u].defaultValue = m;
1032
+ m.locales ?? (m.locales = {}), (u = m.locales)[p] ?? (u[p] = {}), m.locales[p].defaultValue = h;
1026
1033
  });
1027
1034
  }
1028
1035
  }),
@@ -1032,34 +1039,34 @@ function rt({ data: e, params: r, visible: i, config: l, currentLocale: u, defau
1032
1039
  });
1033
1040
  }
1034
1041
  function pr(e, r) {
1035
- const [i, l] = Q(0);
1036
- return $(() => {
1042
+ const [i, l] = X(0);
1043
+ return M(() => {
1037
1044
  const y = setTimeout(() => {
1038
1045
  if (e.current) {
1039
- let a = e.current.parentElement, x = 0;
1046
+ let a = e.current.parentElement, g = 0;
1040
1047
  for (; a; )
1041
- a.classList.contains("property-container") && x++, a = a.parentElement;
1042
- l(x);
1048
+ a.classList.contains("property-container") && g++, a = a.parentElement;
1049
+ l(g);
1043
1050
  }
1044
1051
  }, 100);
1045
1052
  return () => clearTimeout(y);
1046
1053
  }, [e, r]), i;
1047
1054
  }
1048
- function mr({ config: e, currentLocale: r, defaultLocale: i, allComponents: l, onUpdateConfig: u, useI18nEditor: y = !0 }) {
1049
- const { t: a } = C(), x = ke({ variant: "dialog" }), g = e.properties && A(Object.values(e.properties), "index");
1055
+ function mr({ config: e, currentLocale: r, defaultLocale: i, allComponents: l, onUpdateConfig: p, useI18nEditor: y = !0 }) {
1056
+ const { t: a } = D(), g = ke({ variant: "dialog" }), P = e.properties && A(Object.values(e.properties), "index");
1050
1057
  return /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ O(R, { gap: 2, children: [
1051
1058
  /* @__PURE__ */ O(R, { direction: "row", gap: 1, alignItems: "center", justifyContent: "space-between", children: [
1052
1059
  /* @__PURE__ */ t(B, { variant: "subtitle1", children: a("properties") }),
1053
1060
  /* @__PURE__ */ t(j, { flex: 1 }),
1054
- y && /* @__PURE__ */ t(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Ie(x), children: /* @__PURE__ */ t(Le, { fontSize: "small" }) })
1061
+ y && /* @__PURE__ */ t(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Se(g), children: /* @__PURE__ */ t(Le, { fontSize: "small" }) })
1055
1062
  ] }),
1056
1063
  e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ t(tt, {
1057
1064
  component: R,
1058
1065
  gap: 2,
1059
1066
  list: e.properties,
1060
- renderItem: (b, k, v) => {
1067
+ renderItem: (b, v, x) => {
1061
1068
  const o = ye(e.properties, b.id);
1062
- return /* @__PURE__ */ t(Z, {
1069
+ return /* @__PURE__ */ t(ee, {
1063
1070
  elevation: 0,
1064
1071
  className: "property-container",
1065
1072
  sx: {
@@ -1070,13 +1077,13 @@ function mr({ config: e, currentLocale: r, defaultLocale: i, allComponents: l, o
1070
1077
  },
1071
1078
  children: /* @__PURE__ */ t(R, { gap: 2, children: /* @__PURE__ */ t(rt, {
1072
1079
  data: b,
1073
- params: v,
1080
+ params: x,
1074
1081
  visible: o,
1075
1082
  config: e,
1076
1083
  currentLocale: r,
1077
1084
  defaultLocale: i,
1078
1085
  allComponents: l,
1079
- onUpdateConfig: u
1086
+ onUpdateConfig: p
1080
1087
  }) })
1081
1088
  }, b.id);
1082
1089
  }
@@ -1086,32 +1093,32 @@ function mr({ config: e, currentLocale: r, defaultLocale: i, allComponents: l, o
1086
1093
  variant: "outlined",
1087
1094
  className: "ignore-style-override",
1088
1095
  onClick: () => {
1089
- u((b) => {
1090
- var v;
1091
- const k = Ke();
1092
- b.properties ?? (b.properties = {}), (v = b.properties)[k] ?? (v[k] = { index: (g == null ? void 0 : g.length) || 0, data: { id: k } });
1096
+ p((b) => {
1097
+ var x;
1098
+ const v = Ke();
1099
+ b.properties ?? (b.properties = {}), (x = b.properties)[v] ?? (x[v] = { index: (P == null ? void 0 : P.length) || 0, data: { id: v } });
1093
1100
  });
1094
1101
  },
1095
1102
  startIcon: /* @__PURE__ */ t(Ge, {}),
1096
1103
  children: a("addObject", { object: a("property") })
1097
1104
  }),
1098
- y && /* @__PURE__ */ t(it, { ...Ze(x), component: e })
1105
+ y && /* @__PURE__ */ t(it, { ...Ze(g), component: e })
1099
1106
  ] }) });
1100
1107
  }
1101
1108
  function fr({ property: e, allComponents: r }) {
1102
1109
  const i = ke({ variant: "popper" });
1103
- return /* @__PURE__ */ O(X, { children: [
1104
- /* @__PURE__ */ t(E, { sx: { minWidth: 0 }, ...Ie(i), children: /* @__PURE__ */ t(Xe, { fontSize: "small" }) }),
1105
- /* @__PURE__ */ t(xt, { ...Lt(i), children: /* @__PURE__ */ t(Ct, { onClickAway: i.close, children: /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(j, { width: 500, p: 2, children: /* @__PURE__ */ t(Se, {
1110
+ return /* @__PURE__ */ O(Z, { children: [
1111
+ /* @__PURE__ */ t(E, { sx: { minWidth: 0 }, ...Se(i), children: /* @__PURE__ */ t(Xe, { fontSize: "small" }) }),
1112
+ /* @__PURE__ */ t(xt, { ...Lt(i), children: /* @__PURE__ */ t(Dt, { onClickAway: i.close, children: /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(j, { width: 500, p: 2, children: /* @__PURE__ */ t(Ie, {
1106
1113
  value: e.componentId,
1107
- onChange: (l, u) => e.componentId = u,
1114
+ onChange: (l, p) => e.componentId = p,
1108
1115
  allComponents: r
1109
1116
  }) }) }) }) })
1110
1117
  ] });
1111
1118
  }
1112
- function hr({ value: e, valueImmutable: r, onChange: i, defaultLocale: l, allComponents: u }) {
1113
- var k;
1114
- const [y, a] = Q(!1), { t: x, locale: g } = C(), b = typeof (e == null ? void 0 : e.componentId) == "string" ? (k = u[e.componentId]) == null ? void 0 : k.data : void 0;
1119
+ function hr({ value: e, valueImmutable: r, onChange: i, defaultLocale: l, allComponents: p }) {
1120
+ var v;
1121
+ const [y, a] = X(!1), { t: g, locale: P } = D(), b = typeof (e == null ? void 0 : e.componentId) == "string" ? (v = p[e.componentId]) == null ? void 0 : v.data : void 0;
1115
1122
  return b ? /* @__PURE__ */ O(j, { sx: { width: "100%", position: "relative" }, children: [
1116
1123
  /* @__PURE__ */ t(ae, {
1117
1124
  sx: { minWidth: 0 },
@@ -1121,7 +1128,7 @@ function hr({ value: e, valueImmutable: r, onChange: i, defaultLocale: l, allCom
1121
1128
  color: y ? "primary" : "default",
1122
1129
  children: /* @__PURE__ */ t(Xe, { fontSize: "small" })
1123
1130
  }),
1124
- y && /* @__PURE__ */ t(yt, { in: y, timeout: "auto", unmountOnExit: !0, sx: { width: "100%", zIndex: 10 }, children: /* @__PURE__ */ O(Z, {
1131
+ y && /* @__PURE__ */ t(yt, { in: y, timeout: "auto", unmountOnExit: !0, sx: { width: "100%", zIndex: 10 }, children: /* @__PURE__ */ O(ee, {
1125
1132
  elevation: 1,
1126
1133
  sx: {
1127
1134
  mt: 1,
@@ -1134,92 +1141,92 @@ function hr({ value: e, valueImmutable: r, onChange: i, defaultLocale: l, allCom
1134
1141
  children: [
1135
1142
  /* @__PURE__ */ t(j, { width: "100%", mb: 2, children: /* @__PURE__ */ t(lt, {
1136
1143
  config: b,
1137
- currentLocale: g,
1144
+ currentLocale: P,
1138
1145
  defaultLocale: l,
1139
- allComponents: u,
1146
+ allComponents: p,
1140
1147
  propertiesValue: e == null ? void 0 : e.properties,
1141
- onChange: ({ id: v, value: o }) => {
1142
- const n = jt(o.value), s = JSON.parse(JSON.stringify(e));
1143
- s != null && s.componentId && (r ? i == null || i({ ...s, properties: { ...s.properties, [v]: { value: n } } }) : (s.properties = s.properties ?? {}, s.properties[v] = { value: n }, i == null || i(s)));
1148
+ onChange: ({ id: x, value: o }) => {
1149
+ const s = jt(o.value), n = JSON.parse(JSON.stringify(e));
1150
+ n != null && n.componentId && (r ? i == null || i({ ...n, properties: { ...n.properties, [x]: { value: s } } }) : (n.properties = n.properties ?? {}, n.properties[x] = { value: s }, i == null || i(n)));
1144
1151
  }
1145
1152
  }) }),
1146
- /* @__PURE__ */ t(E, { size: "small", onClick: () => a(!1), sx: { mt: 1 }, children: x("close") })
1153
+ /* @__PURE__ */ t(E, { size: "small", onClick: () => a(!1), sx: { mt: 1 }, children: g("close") })
1147
1154
  ]
1148
1155
  }) })
1149
1156
  ] }) : null;
1150
1157
  }
1151
1158
  function it({ type: e = "properties", component: r, ...i }) {
1152
- var v, o, n;
1153
- const { t: l } = C(), { state: { components: u, supportedLocales: y, config: { defaultLocale: a } } } = ce(), x = xe(), g = ee(r).doc, b = e === "properties" ? r.properties : e === "parameters" && ((v = r.renderer) == null ? void 0 : v.type) === "component" ? (o = u[r.renderer.componentId]) == null ? void 0 : o.data.properties : void 0, k = ((n = r.renderer) == null ? void 0 : n.type) === "component" ? r : void 0;
1159
+ var x, o, s;
1160
+ const { t: l } = D(), { state: { components: p, supportedLocales: y, config: { defaultLocale: a } } } = ce(), g = xe(), P = te(r).doc, b = e === "properties" ? r.properties : e === "parameters" && ((x = r.renderer) == null ? void 0 : x.type) === "component" ? (o = p[r.renderer.componentId]) == null ? void 0 : o.data.properties : void 0, v = ((s = r.renderer) == null ? void 0 : s.type) === "component" ? r : void 0;
1154
1161
  return /* @__PURE__ */ O(Me, { ...i, fullWidth: !0, maxWidth: "lg", children: [
1155
1162
  /* @__PURE__ */ t(ft, { children: l("i18nEditorTitle") }),
1156
1163
  /* @__PURE__ */ t(ht, { children: b && /* @__PURE__ */ t(R, { children: /* @__PURE__ */ O(Be, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
1157
- /* @__PURE__ */ t(Fe, { children: /* @__PURE__ */ t(le, { children: y.map(({ locale: s, name: d }) => /* @__PURE__ */ t(oe, { children: /* @__PURE__ */ O(B, { color: "text.primary", children: [
1164
+ /* @__PURE__ */ t(Fe, { children: /* @__PURE__ */ t(oe, { children: y.map(({ locale: n, name: d }) => /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ O(B, { color: "text.primary", children: [
1158
1165
  d,
1159
- a === s && /* @__PURE__ */ t(Ut, { sx: { fontSize: 12 } })
1160
- ] }) }, s)) }) }),
1161
- /* @__PURE__ */ t(Je, { children: A(Object.values(b), "index").map(({ data: s }) => /* @__PURE__ */ t(le, { children: y.map(({ locale: d }) => {
1162
- var m, w, c, h, f, P, S, p, I, z, N, T, U, W, te, _, H, Y, q, L, Oe, je, Re, ze, Ne, Ve;
1163
- return /* @__PURE__ */ t(oe, { children: /* @__PURE__ */ t(R, { gap: 1, children: e === "properties" ? /* @__PURE__ */ O(X, { children: [
1166
+ a === n && /* @__PURE__ */ t(Ut, { sx: { fontSize: 12 } })
1167
+ ] }) }, n)) }) }),
1168
+ /* @__PURE__ */ t(Je, { children: A(Object.values(b), "index").map(({ data: n }) => /* @__PURE__ */ t(oe, { children: y.map(({ locale: d }) => {
1169
+ var h, w, c, m, u, k, I, f, S, z, N, T, U, W, re, _, H, Y, q, L, Oe, je, Re, ze, Ne, Ve;
1170
+ return /* @__PURE__ */ t(ne, { children: /* @__PURE__ */ t(R, { gap: 1, children: e === "properties" ? /* @__PURE__ */ O(Z, { children: [
1164
1171
  /* @__PURE__ */ t(V, {
1165
1172
  size: "small",
1166
1173
  label: "Key",
1167
- value: s.key || "",
1174
+ value: n.key || "",
1168
1175
  onChange: (F) => {
1169
- g.transact(() => {
1170
- s.key = F.target.value.trim();
1176
+ P.transact(() => {
1177
+ n.key = F.target.value.trim();
1171
1178
  });
1172
1179
  }
1173
1180
  }),
1174
1181
  /* @__PURE__ */ t(V, {
1175
1182
  size: "small",
1176
1183
  label: l("label"),
1177
- value: (((w = (m = s.locales) == null ? void 0 : m[d]) == null ? void 0 : w.name) ?? ((h = (c = s.locales) == null ? void 0 : c[a]) == null ? void 0 : h.name)) || "",
1184
+ value: (((w = (h = n.locales) == null ? void 0 : h[d]) == null ? void 0 : w.name) ?? ((m = (c = n.locales) == null ? void 0 : c[a]) == null ? void 0 : m.name)) || "",
1178
1185
  onChange: (F) => {
1179
- g.transact(() => {
1186
+ P.transact(() => {
1180
1187
  var K;
1181
- s.locales ?? (s.locales = {}), (K = s.locales)[d] ?? (K[d] = {}), s.locales[d].name = F.target.value;
1188
+ n.locales ?? (n.locales = {}), (K = n.locales)[d] ?? (K[d] = {}), n.locales[d].name = F.target.value;
1182
1189
  });
1183
1190
  }
1184
1191
  }),
1185
- /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(M, {
1186
- allComponents: x,
1192
+ /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t($, {
1193
+ allComponents: g,
1187
1194
  defaultLocale: a,
1188
1195
  component: r,
1189
- property: s,
1196
+ property: n,
1190
1197
  size: "small",
1191
1198
  fullWidth: !0,
1192
1199
  label: "Default Value",
1193
- valueImmutable: se((P = (f = s.locales) == null ? void 0 : f[d]) == null ? void 0 : P.defaultValue),
1194
- value: ((p = (S = s.locales) == null ? void 0 : S[d]) == null ? void 0 : p.defaultValue) ?? ((z = (I = s.locales) == null ? void 0 : I[a]) == null ? void 0 : z.defaultValue),
1200
+ valueImmutable: se((k = (u = n.locales) == null ? void 0 : u[d]) == null ? void 0 : k.defaultValue),
1201
+ value: ((f = (I = n.locales) == null ? void 0 : I[d]) == null ? void 0 : f.defaultValue) ?? ((z = (S = n.locales) == null ? void 0 : S[a]) == null ? void 0 : z.defaultValue),
1195
1202
  onChange: (F) => {
1196
- g.transact(() => {
1203
+ P.transact(() => {
1197
1204
  var K;
1198
- s.locales ?? (s.locales = {}), (K = s.locales)[d] ?? (K[d] = {}), s.locales[d].defaultValue = F;
1205
+ n.locales ?? (n.locales = {}), (K = n.locales)[d] ?? (K[d] = {}), n.locales[d].defaultValue = F;
1199
1206
  });
1200
1207
  }
1201
1208
  }) })
1202
- ] }) : e === "parameters" && k ? /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(M, {
1203
- allComponents: x,
1209
+ ] }) : e === "parameters" && v ? /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t($, {
1210
+ allComponents: g,
1204
1211
  defaultLocale: a,
1205
1212
  component: r,
1206
- property: s,
1213
+ property: n,
1207
1214
  size: "small",
1208
1215
  fullWidth: !0,
1209
- valueImmutable: se((W = (U = (T = (N = k.renderer.properties) == null ? void 0 : N[s.id]) == null ? void 0 : T.locales) == null ? void 0 : U[d]) == null ? void 0 : W.value),
1210
- value: ((Y = (H = (_ = (te = k.renderer.properties) == null ? void 0 : te[s.id]) == null ? void 0 : _.locales) == null ? void 0 : H[d]) == null ? void 0 : Y.value) ?? ((je = (Oe = (L = (q = k.renderer.properties) == null ? void 0 : q[s.id]) == null ? void 0 : L.locales) == null ? void 0 : Oe[a]) == null ? void 0 : je.value) ?? ((ze = (Re = s.locales) == null ? void 0 : Re[d]) == null ? void 0 : ze.defaultValue) ?? ((Ve = (Ne = s.locales) == null ? void 0 : Ne[a]) == null ? void 0 : Ve.defaultValue),
1216
+ valueImmutable: se((W = (U = (T = (N = v.renderer.properties) == null ? void 0 : N[n.id]) == null ? void 0 : T.locales) == null ? void 0 : U[d]) == null ? void 0 : W.value),
1217
+ value: ((Y = (H = (_ = (re = v.renderer.properties) == null ? void 0 : re[n.id]) == null ? void 0 : _.locales) == null ? void 0 : H[d]) == null ? void 0 : Y.value) ?? ((je = (Oe = (L = (q = v.renderer.properties) == null ? void 0 : q[n.id]) == null ? void 0 : L.locales) == null ? void 0 : Oe[a]) == null ? void 0 : je.value) ?? ((ze = (Re = n.locales) == null ? void 0 : Re[d]) == null ? void 0 : ze.defaultValue) ?? ((Ve = (Ne = n.locales) == null ? void 0 : Ne[a]) == null ? void 0 : Ve.defaultValue),
1211
1218
  onChange: (F) => {
1212
- g.transact(() => {
1213
- var K, Ce, De, Ee, Ae;
1214
- (K = k.renderer).properties ?? (K.properties = {}), (Ce = k.renderer.properties)[De = s.id] ?? (Ce[De] = {}), (Ee = k.renderer.properties[s.id]).locales ?? (Ee.locales = {}), (Ae = k.renderer.properties[s.id].locales)[d] ?? (Ae[d] = {}), k.renderer.properties[s.id].locales[d].value = F;
1219
+ P.transact(() => {
1220
+ var K, De, Ce, Ee, Ae;
1221
+ (K = v.renderer).properties ?? (K.properties = {}), (De = v.renderer.properties)[Ce = n.id] ?? (De[Ce] = {}), (Ee = v.renderer.properties[n.id]).locales ?? (Ee.locales = {}), (Ae = v.renderer.properties[n.id].locales)[d] ?? (Ae[d] = {}), v.renderer.properties[n.id].locales[d].value = F;
1215
1222
  });
1216
1223
  }
1217
- }) }) : null }, s.id) }, d);
1218
- }) }, s.id)) })
1224
+ }) }) : null }, n.id) }, d);
1225
+ }) }, n.id)) })
1219
1226
  ] }) }) }),
1220
- /* @__PURE__ */ t(bt, { children: /* @__PURE__ */ t(E, { onClick: (s) => {
1227
+ /* @__PURE__ */ t(bt, { children: /* @__PURE__ */ t(E, { onClick: (n) => {
1221
1228
  var d;
1222
- return (d = i.onClose) == null ? void 0 : d.call(i, s, "escapeKeyDown");
1229
+ return (d = i.onClose) == null ? void 0 : d.call(i, n, "escapeKeyDown");
1223
1230
  }, children: l("close") }) })
1224
1231
  ] });
1225
1232
  }
@@ -1230,7 +1237,7 @@ const We = (e, r) => (i) => {
1230
1237
  i.palette.secondary.main,
1231
1238
  i.palette.success.main,
1232
1239
  i.palette.warning.main
1233
- ], u = Math.min(l.length - 1, e), y = l[u], a = pe(y, 0.5), x = pe(y, 1);
1240
+ ], p = Math.min(l.length - 1, e), y = l[p], a = pe(y, 0.5), g = pe(y, 1);
1234
1241
  return {
1235
1242
  // 保留原有的边框样式
1236
1243
  borderColor: `${a} !important`,
@@ -1238,58 +1245,58 @@ const We = (e, r) => (i) => {
1238
1245
  // 稍粗的左侧边框
1239
1246
  borderLeftColor: a,
1240
1247
  // 使用透明度适应深色/浅色模式
1241
- color: x,
1248
+ color: g,
1242
1249
  ...r
1243
1250
  };
1244
1251
  };
1245
1252
  function br({ property: e, onChange: r, defaultLocale: i, allComponents: l }) {
1246
- const { t: u, locale: y } = C(), a = J(null), x = pr(a, e), g = D(() => {
1253
+ const { t: p, locale: y } = D(), a = J(null), g = pr(a, e), P = C(() => {
1247
1254
  if (!(e.type !== "json" && e.type !== "yaml" && e.type !== "array") && e.subProperties)
1248
1255
  try {
1249
1256
  let b = {};
1250
1257
  A(Object.values(e.subProperties), "index").filter((o) => o.data.visible !== !1 && o.data.key).forEach(({ data: o }) => {
1251
- var s, d, m, w;
1258
+ var n, d, h, w;
1252
1259
  if (!o.key)
1253
1260
  return;
1254
- let n = ((d = (s = o.locales) == null ? void 0 : s[y]) == null ? void 0 : d.defaultValue) ?? ((w = (m = o.locales) == null ? void 0 : m[i]) == null ? void 0 : w.defaultValue);
1261
+ let s = ((d = (n = o.locales) == null ? void 0 : n[y]) == null ? void 0 : d.defaultValue) ?? ((w = (h = o.locales) == null ? void 0 : h[i]) == null ? void 0 : w.defaultValue);
1255
1262
  if (o.type === "number")
1256
- n = Number(n);
1263
+ s = Number(s);
1257
1264
  else if (o.type === "boolean")
1258
- n = n === !0 || n === "true";
1259
- else if ((o.type === "json" || o.type === "yaml") && typeof n == "string")
1265
+ s = s === !0 || s === "true";
1266
+ else if ((o.type === "json" || o.type === "yaml") && typeof s == "string")
1260
1267
  try {
1261
- o.type === "json" ? n = JSON.parse(n) : n = fe.parse(n);
1268
+ o.type === "json" ? s = JSON.parse(s) : s = fe.parse(s);
1262
1269
  } catch (c) {
1263
- console.error("Error parsing nested value", n, c), n = {};
1270
+ console.error("Error parsing nested value", s, c), s = {};
1264
1271
  }
1265
- b[o.key] = n;
1266
- }), e.type === "array" && !Array.isArray(b) && (b = we(b) ? [] : [b]);
1267
- const v = ve(b, e.type);
1268
- r == null || r(v);
1272
+ b[o.key] = s;
1273
+ }), e.type === "array" && !Array.isArray(b) && (b = Pe(b) ? [] : [b]);
1274
+ const x = ve(b, e.type);
1275
+ r == null || r(x);
1269
1276
  } catch (b) {
1270
1277
  console.error("Error converting structure to text:", b);
1271
1278
  }
1272
1279
  }, [e, y, i, r]);
1273
1280
  return e.type !== "json" && e.type !== "yaml" && e.type !== "array" ? null : /* @__PURE__ */ O(R, { direction: "column", gap: 1.5, sx: { width: "100%" }, ref: a, children: [
1274
- /* @__PURE__ */ t(vt, { sx: { mt: -1 }, children: /* @__PURE__ */ t(B, { variant: "caption", color: "text.secondary", children: u("maker.properties.subProperties") }) }),
1281
+ /* @__PURE__ */ t(vt, { sx: { mt: -1 }, children: /* @__PURE__ */ t(B, { variant: "caption", color: "text.secondary", children: p("maker.properties.subProperties") }) }),
1275
1282
  e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ t(tt, {
1276
1283
  component: R,
1277
1284
  gap: 2,
1278
1285
  list: e.subProperties,
1279
- renderItem: (b, k, v) => {
1286
+ renderItem: (b, v, x) => {
1280
1287
  const o = b.visible !== !1;
1281
- return /* @__PURE__ */ t(Z, {
1288
+ return /* @__PURE__ */ t(ee, {
1282
1289
  elevation: 0,
1283
1290
  className: "property-container",
1284
1291
  sx: {
1285
1292
  p: 1.25,
1286
1293
  borderRadius: 1,
1287
1294
  border: o ? "1px solid" : "1px dashed",
1288
- "&": We(x)
1295
+ "&": We(g)
1289
1296
  },
1290
1297
  children: /* @__PURE__ */ t(R, { gap: 2, children: /* @__PURE__ */ t(rt, {
1291
1298
  data: b,
1292
- params: v,
1299
+ params: x,
1293
1300
  visible: o,
1294
1301
  config: {
1295
1302
  properties: e.subProperties
@@ -1297,23 +1304,23 @@ function br({ property: e, onChange: r, defaultLocale: i, allComponents: l }) {
1297
1304
  currentLocale: y,
1298
1305
  defaultLocale: i,
1299
1306
  allComponents: l,
1300
- onUpdateConfig: (n) => {
1307
+ onUpdateConfig: (s) => {
1301
1308
  try {
1302
- const s = { properties: e.subProperties || {} };
1303
- n(s);
1309
+ const n = { properties: e.subProperties || {} };
1310
+ s(n);
1304
1311
  const d = {
1305
1312
  ...e,
1306
- subProperties: s.properties
1313
+ subProperties: n.properties
1307
1314
  };
1308
- r == null || r(d, { forceUpdateProperty: !0 }), g();
1309
- } catch (s) {
1310
- console.error("Error updating property:", s);
1315
+ r == null || r(d, { forceUpdateProperty: !0 }), P();
1316
+ } catch (n) {
1317
+ console.error("Error updating property:", n);
1311
1318
  }
1312
1319
  }
1313
1320
  }) })
1314
1321
  }, b.id);
1315
1322
  }
1316
- }) : /* @__PURE__ */ t(de, { style: { fontSize: 12, height: 100 }, children: u("maker.properties.noSubProperties") }),
1323
+ }) : /* @__PURE__ */ t(de, { style: { fontSize: 12, height: 100 }, children: p("maker.properties.noSubProperties") }),
1317
1324
  /* @__PURE__ */ t(E, {
1318
1325
  fullWidth: !0,
1319
1326
  variant: "outlined",
@@ -1322,10 +1329,10 @@ function br({ property: e, onChange: r, defaultLocale: i, allComponents: l }) {
1322
1329
  startIcon: /* @__PURE__ */ t(Ge, {}),
1323
1330
  onClick: () => {
1324
1331
  try {
1325
- const b = e.subProperties || {}, k = Ke(), o = {
1332
+ const b = e.subProperties || {}, v = Ke(), o = {
1326
1333
  index: Object.values(b).length,
1327
1334
  data: {
1328
- id: k,
1335
+ id: v,
1329
1336
  key: "",
1330
1337
  type: "string",
1331
1338
  visible: !0,
@@ -1338,62 +1345,62 @@ function br({ property: e, onChange: r, defaultLocale: i, allComponents: l }) {
1338
1345
  // 为嵌套属性预初始化
1339
1346
  subProperties: {}
1340
1347
  }
1341
- }, n = {
1348
+ }, s = {
1342
1349
  ...e,
1343
1350
  subProperties: {
1344
1351
  ...b,
1345
- [k]: o
1352
+ [v]: o
1346
1353
  }
1347
1354
  };
1348
- r == null || r(n, { forceUpdateProperty: !0 }), g();
1355
+ r == null || r(s, { forceUpdateProperty: !0 }), P();
1349
1356
  } catch (b) {
1350
1357
  console.error("Error adding property:", b);
1351
1358
  }
1352
1359
  },
1353
1360
  sx: {
1354
- "&": We(x, {
1361
+ "&": We(g, {
1355
1362
  // borderLeft: undefined,
1356
1363
  })
1357
1364
  },
1358
- children: u("maker.properties.addSubProperty")
1365
+ children: p("maker.properties.addSubProperty")
1359
1366
  })
1360
1367
  ] });
1361
1368
  }
1362
- function M({ component: e, property: r, value: i, onChange: l, valueImmutable: u, defaultLocale: y, allComponents: a, ...x }) {
1363
- var n, s, d, m, w;
1364
- const { locale: g } = C(), b = It(), k = J(null), v = () => {
1365
- var h;
1366
- const c = (h = b == null ? void 0 : b.current) == null ? void 0 : h.getUploader();
1367
- c == null || c.open(), k.current && c.onceUploadSuccess(({ response: f }) => {
1368
- var S, p;
1369
- let P = ((S = f == null ? void 0 : f.data) == null ? void 0 : S.filename) || "";
1370
- P && (P = `mediakit://${P}`, i && !i.includes("mediakit://") && (P += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), (p = k.current) == null || p.call(k, P);
1369
+ function $({ component: e, property: r, value: i, onChange: l, valueImmutable: p, defaultLocale: y, allComponents: a, ...g }) {
1370
+ var s, n, d, h, w;
1371
+ const { locale: P } = D(), b = St(), v = J(null), x = () => {
1372
+ var m;
1373
+ const c = (m = b == null ? void 0 : b.current) == null ? void 0 : m.getUploader();
1374
+ c == null || c.open(), v.current && c.onceUploadSuccess(({ response: u }) => {
1375
+ var I, f;
1376
+ let k = ((I = u == null ? void 0 : u.data) == null ? void 0 : I.filename) || "";
1377
+ k && (k = `mediakit://${k}`, i && !i.includes("mediakit://") && (k += " # please use < import { getMediaKitAbsoluteUrl } from '@blocklet/pages-kit/builtin/utils' > to get the full address")), (f = v.current) == null || f.call(v, k);
1371
1378
  });
1372
- }, o = x.label ?? (((s = (n = r.locales) == null ? void 0 : n[g]) == null ? void 0 : s.name) || ((m = (d = r.locales) == null ? void 0 : d[y]) == null ? void 0 : m.name) || r.key || r.id);
1379
+ }, o = g.label ?? (((n = (s = r.locales) == null ? void 0 : s[P]) == null ? void 0 : n.name) || ((h = (d = r.locales) == null ? void 0 : d[y]) == null ? void 0 : h.name) || r.key || r.id);
1373
1380
  if (r.type === "number")
1374
1381
  return /* @__PURE__ */ t(yr, {
1375
- ...x,
1382
+ ...g,
1376
1383
  label: o,
1377
1384
  NumberProps: {
1378
1385
  value: ["number", "string"].includes(typeof i) ? i : null,
1379
- onChange: (c, h) => l == null ? void 0 : l(h)
1386
+ onChange: (c, m) => l == null ? void 0 : l(m)
1380
1387
  }
1381
1388
  });
1382
1389
  if (r.type === "decimal")
1383
1390
  return /* @__PURE__ */ t(V, {
1384
- ...x,
1391
+ ...g,
1385
1392
  label: o,
1386
1393
  type: "text",
1387
1394
  value: i ?? "",
1388
1395
  onChange: (c) => {
1389
- const h = c.target.value;
1390
- if (h === "" || h === "-") {
1391
- l == null || l(h);
1396
+ const m = c.target.value;
1397
+ if (m === "" || m === "-") {
1398
+ l == null || l(m);
1392
1399
  return;
1393
1400
  }
1394
- if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(h)) {
1395
- let P = h;
1396
- /^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(P) && (P = Number(P)), l == null || l(P);
1401
+ if (/^-?(?!.*\..*\.)[0-9]*(\.[0-9]{0,9})?$/.test(m)) {
1402
+ let k = m;
1403
+ /^-?[1-9]+[0-9]*(\.[0-9]{1,9})?$/.test(k) && (k = Number(k)), l == null || l(k);
1397
1404
  }
1398
1405
  }
1399
1406
  });
@@ -1401,7 +1408,7 @@ function M({ component: e, property: r, value: i, onChange: l, valueImmutable: u
1401
1408
  return /* @__PURE__ */ t(pt, {
1402
1409
  label: o,
1403
1410
  labelPlacement: "start",
1404
- control: /* @__PURE__ */ t(mt, { checked: i === !0, onChange: (c, h) => l == null ? void 0 : l(h) })
1411
+ control: /* @__PURE__ */ t(mt, { checked: i === !0, onChange: (c, m) => l == null ? void 0 : l(m) })
1405
1412
  });
1406
1413
  if (r.type === "color")
1407
1414
  return /* @__PURE__ */ t(ir, {
@@ -1422,9 +1429,9 @@ function M({ component: e, property: r, value: i, onChange: l, valueImmutable: u
1422
1429
  component: e,
1423
1430
  defaultLocale: y,
1424
1431
  allComponents: a,
1425
- PropertyValueField: M,
1432
+ PropertyValueField: $,
1426
1433
  onUpload: (c) => {
1427
- k.current = c, v();
1434
+ v.current = c, x();
1428
1435
  }
1429
1436
  });
1430
1437
  if (r.type === "custom") {
@@ -1432,27 +1439,27 @@ function M({ component: e, property: r, value: i, onChange: l, valueImmutable: u
1432
1439
  return c ? /* @__PURE__ */ t(j, { width: "100%", children: /* @__PURE__ */ t(qe, {
1433
1440
  componentId: c.id,
1434
1441
  props: { label: o, value: i, onChange: l },
1435
- locale: g,
1442
+ locale: P,
1436
1443
  dev: {
1437
1444
  mode: "draft",
1438
1445
  components: a,
1439
1446
  defaultLocale: y
1440
1447
  }
1441
- }) }) : /* @__PURE__ */ t(V, { ...x, label: o, disabled: !0, placeholder: "Click right button select a component" });
1448
+ }) }) : /* @__PURE__ */ t(V, { ...g, label: o, disabled: !0, placeholder: "Click right button select a component" });
1442
1449
  }
1443
1450
  if (r.type === "component")
1444
1451
  return /* @__PURE__ */ O(R, { width: "100%", direction: "column", gap: 1, children: [
1445
- /* @__PURE__ */ t(Se, {
1452
+ /* @__PURE__ */ t(Ie, {
1446
1453
  allComponents: a,
1447
1454
  label: o,
1448
1455
  value: i == null ? void 0 : i.componentId,
1449
- onChange: (c, h) => {
1450
- u || !i ? l == null || l({ ...i && JSON.parse(JSON.stringify(i)), componentId: h }) : typeof i == "object" && (i.componentId = h, l == null || l({ ...i && JSON.parse(JSON.stringify(i)), componentId: h }));
1456
+ onChange: (c, m) => {
1457
+ p || !i ? l == null || l({ ...i && JSON.parse(JSON.stringify(i)), componentId: m }) : typeof i == "object" && (i.componentId = m, l == null || l({ ...i && JSON.parse(JSON.stringify(i)), componentId: m }));
1451
1458
  }
1452
1459
  }),
1453
1460
  (i == null ? void 0 : i.componentId) && /* @__PURE__ */ t(hr, {
1454
1461
  value: i,
1455
- valueImmutable: u,
1462
+ valueImmutable: p,
1456
1463
  onChange: l,
1457
1464
  defaultLocale: y,
1458
1465
  allComponents: a
@@ -1461,33 +1468,33 @@ function M({ component: e, property: r, value: i, onChange: l, valueImmutable: u
1461
1468
  if (!r.type || ["string", "url", "multiline"].includes(r.type)) {
1462
1469
  let c = r.type === "string" ? r.multiline : void 0;
1463
1470
  r.type === "multiline" && (c = !0);
1464
- const h = r.type === "url" ? i == null ? void 0 : i.url : i;
1471
+ const m = r.type === "url" ? i == null ? void 0 : i.url : i;
1465
1472
  return /* @__PURE__ */ t(V, {
1466
- ...x,
1473
+ ...g,
1467
1474
  label: o,
1468
- value: typeof h == "string" ? h : "",
1475
+ value: typeof m == "string" ? m : "",
1469
1476
  multiline: c,
1470
1477
  minRows: c ? 2 : void 0,
1471
1478
  maxRows: c ? 10 : void 0,
1472
- onChange: (f) => l == null ? void 0 : l(r.type === "url" ? { ...i, url: f.target.value, mediaKitUrl: f.target.value } : f.target.value),
1479
+ onChange: (u) => l == null ? void 0 : l(r.type === "url" ? { ...i, url: u.target.value, mediaKitUrl: u.target.value } : u.target.value),
1473
1480
  InputProps: r.type === "url" ? {
1474
1481
  sx: {
1475
1482
  pr: 0
1476
1483
  },
1477
- endAdornment: /* @__PURE__ */ O(Pe, { position: "end", children: [
1484
+ endAdornment: /* @__PURE__ */ O(we, { position: "end", children: [
1478
1485
  /* @__PURE__ */ t(Ye, {
1479
- onChange: async ({ response: f }) => {
1480
- var I, z, N;
1481
- const P = ((I = f == null ? void 0 : f.data) == null ? void 0 : I.url) || ((z = f == null ? void 0 : f.data) == null ? void 0 : z.fileUrl);
1482
- let S;
1483
- P && (S = await St(P).catch(() => Ot(P)).catch(() => {
1486
+ onChange: async ({ response: u }) => {
1487
+ var S, z, N;
1488
+ const k = ((S = u == null ? void 0 : u.data) == null ? void 0 : S.url) || ((z = u == null ? void 0 : u.data) == null ? void 0 : z.fileUrl);
1489
+ let I;
1490
+ k && (I = await It(k).catch(() => Ot(k)).catch(() => {
1484
1491
  }));
1485
- let p = ((N = f == null ? void 0 : f.data) == null ? void 0 : N.filename) || "";
1486
- p && (p = `mediakit://${p}`), l == null || l({
1487
- url: P,
1488
- mediaKitUrl: p,
1489
- width: S == null ? void 0 : S.naturalWidth,
1490
- height: S == null ? void 0 : S.naturalHeight
1492
+ let f = ((N = u == null ? void 0 : u.data) == null ? void 0 : N.filename) || "";
1493
+ f && (f = `mediakit://${f}`), l == null || l({
1494
+ url: k,
1495
+ mediaKitUrl: f,
1496
+ width: I == null ? void 0 : I.naturalWidth,
1497
+ height: I == null ? void 0 : I.naturalHeight
1491
1498
  });
1492
1499
  }
1493
1500
  }),
@@ -1501,19 +1508,19 @@ function M({ component: e, property: r, value: i, onChange: l, valueImmutable: u
1501
1508
  value: Array.isArray(i) ? i : [],
1502
1509
  onChange: (c) => l == null ? void 0 : l(c),
1503
1510
  property: r,
1504
- renderItem: ({ item: c, index: h, onChange: f }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(R, { gap: 1, width: "100%", children: A(Object.values(r.subProperties), "index").filter((P) => P.data.visible !== !1).map(({ data: P }) => P.key ? /* @__PURE__ */ t(M, {
1511
+ renderItem: ({ item: c, index: m, onChange: u }) => r.subProperties && Object.keys(r.subProperties).length > 0 ? /* @__PURE__ */ t(R, { gap: 1, width: "100%", children: A(Object.values(r.subProperties), "index").filter((k) => k.data.visible !== !1).map(({ data: k }) => k.key ? /* @__PURE__ */ t($, {
1505
1512
  component: e,
1506
- property: P,
1507
- value: c[P.key],
1508
- onChange: (S) => {
1509
- const p = { ...c, [P.key]: S };
1510
- f(p);
1513
+ property: k,
1514
+ value: c[k.key],
1515
+ onChange: (I) => {
1516
+ const f = { ...c, [k.key]: I };
1517
+ u(f);
1511
1518
  },
1512
1519
  size: "small",
1513
1520
  fullWidth: !0,
1514
1521
  defaultLocale: y,
1515
1522
  allComponents: a
1516
- }, P.id) : null) }, h) : /* @__PURE__ */ t(V, { size: x.size, fullWidth: !0, value: c, onChange: (P) => f(P.target.value) })
1523
+ }, k.id) : null) }, m) : /* @__PURE__ */ t(V, { size: g.size, fullWidth: !0, value: c, onChange: (k) => u(k.target.value) })
1517
1524
  }) : (console.error("Unsupported property type", r.type), null);
1518
1525
  }
1519
1526
  function yr({ NumberProps: e, ...r }) {
@@ -1532,10 +1539,10 @@ export default function () {
1532
1539
  }`, xr = `console.log('hello')
1533
1540
  `;
1534
1541
  function gr({ value: e }) {
1535
- const { locale: r } = C(), i = _e(), l = ee(e).doc;
1536
- return $(() => {
1537
- var u;
1538
- (u = e.renderer) != null && u.script || (l.transact(() => {
1542
+ const { locale: r } = D(), i = _e(), l = te(e).doc;
1543
+ return M(() => {
1544
+ var p;
1545
+ (p = e.renderer) != null && p.script || (l.transact(() => {
1539
1546
  e.renderer.script = e.renderer.type === "react-component" ? vr : xr;
1540
1547
  }), i());
1541
1548
  }, [e]), /* @__PURE__ */ t(j, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ t(ge, {
@@ -1543,172 +1550,172 @@ function gr({ value: e }) {
1543
1550
  locale: r,
1544
1551
  language: "typescript",
1545
1552
  value: e.renderer.script || "",
1546
- onChange: (u) => e.renderer.script = u,
1553
+ onChange: (p) => e.renderer.script = p,
1547
1554
  typeScriptNoValidation: !1,
1548
1555
  fullScreenOptions: {
1549
1556
  enableEscExit: !0
1550
1557
  }
1551
1558
  }, e.id) });
1552
1559
  }
1553
- function Pr({ value: e }) {
1554
- var k, v, o;
1555
- const { t: r } = C(), i = ee(e).doc, { state: { components: l, config: { defaultLocale: u }, resources: y }, localState: { currentLocale: a } } = ce(), x = xe(), g = ((k = l[e.renderer.componentId]) == null ? void 0 : k.data) ?? ((o = (v = y.components) == null ? void 0 : v[e.renderer.componentId]) == null ? void 0 : o.component), b = ke({ variant: "dialog" });
1560
+ function wr({ value: e }) {
1561
+ var v, x, o;
1562
+ const { t: r } = D(), i = te(e).doc, { state: { components: l, config: { defaultLocale: p }, resources: y }, localState: { currentLocale: a } } = ce(), g = xe(), P = ((v = l[e.renderer.componentId]) == null ? void 0 : v.data) ?? ((o = (x = y.components) == null ? void 0 : x[e.renderer.componentId]) == null ? void 0 : o.component), b = ke({ variant: "dialog" });
1556
1563
  return /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ O(R, { gap: 1, children: [
1557
- /* @__PURE__ */ t(Se, {
1558
- allComponents: x,
1564
+ /* @__PURE__ */ t(Ie, {
1565
+ allComponents: g,
1559
1566
  excludes: [e.id],
1560
1567
  value: e.renderer.componentId,
1561
- onChange: (n, s) => e.renderer.componentId = s
1568
+ onChange: (s, n) => e.renderer.componentId = n
1562
1569
  }),
1563
- g && /* @__PURE__ */ O(X, { children: [
1570
+ P && /* @__PURE__ */ O(Z, { children: [
1564
1571
  /* @__PURE__ */ O(R, { direction: "row", justifyContent: "space-between", alignItems: "center", children: [
1565
1572
  /* @__PURE__ */ t(B, { variant: "subtitle2", children: r("parameters") }),
1566
- /* @__PURE__ */ t(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Ie(b), children: /* @__PURE__ */ t(Le, { fontSize: "small" }) })
1573
+ /* @__PURE__ */ t(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...Se(b), children: /* @__PURE__ */ t(Le, { fontSize: "small" }) })
1567
1574
  ] }),
1568
- g.properties && A(Object.values(g.properties), "index").map(({ data: n }) => {
1569
- var s, d, m, w, c, h, f, P, S, p, I, z, N, T, U, W;
1570
- return /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(M, {
1571
- allComponents: x,
1572
- defaultLocale: u,
1573
- component: g,
1574
- property: n,
1575
+ P.properties && A(Object.values(P.properties), "index").map(({ data: s }) => {
1576
+ var n, d, h, w, c, m, u, k, I, f, S, z, N, T, U, W;
1577
+ return /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t($, {
1578
+ allComponents: g,
1579
+ defaultLocale: p,
1580
+ component: P,
1581
+ property: s,
1575
1582
  fullWidth: !0,
1576
1583
  size: "small",
1577
- valueImmutable: se((w = (m = (d = (s = e.renderer.properties) == null ? void 0 : s[n.id]) == null ? void 0 : d.locales) == null ? void 0 : m[a]) == null ? void 0 : w.value),
1578
- value: ((P = (f = (h = (c = e.renderer.properties) == null ? void 0 : c[n.id]) == null ? void 0 : h.locales) == null ? void 0 : f[a]) == null ? void 0 : P.value) ?? ((z = (I = (p = (S = e.renderer.properties) == null ? void 0 : S[n.id]) == null ? void 0 : p.locales) == null ? void 0 : I[u]) == null ? void 0 : z.value) ?? ((T = (N = n.locales) == null ? void 0 : N[a]) == null ? void 0 : T.defaultValue) ?? ((W = (U = n.locales) == null ? void 0 : U[u]) == null ? void 0 : W.defaultValue),
1579
- onChange: (te) => {
1584
+ valueImmutable: se((w = (h = (d = (n = e.renderer.properties) == null ? void 0 : n[s.id]) == null ? void 0 : d.locales) == null ? void 0 : h[a]) == null ? void 0 : w.value),
1585
+ value: ((k = (u = (m = (c = e.renderer.properties) == null ? void 0 : c[s.id]) == null ? void 0 : m.locales) == null ? void 0 : u[a]) == null ? void 0 : k.value) ?? ((z = (S = (f = (I = e.renderer.properties) == null ? void 0 : I[s.id]) == null ? void 0 : f.locales) == null ? void 0 : S[p]) == null ? void 0 : z.value) ?? ((T = (N = s.locales) == null ? void 0 : N[a]) == null ? void 0 : T.defaultValue) ?? ((W = (U = s.locales) == null ? void 0 : U[p]) == null ? void 0 : W.defaultValue),
1586
+ onChange: (re) => {
1580
1587
  i.transact(() => {
1581
1588
  var _, H, Y, q, L;
1582
- (_ = e.renderer).properties ?? (_.properties = {}), (H = e.renderer.properties)[Y = n.id] ?? (H[Y] = {}), (q = e.renderer.properties[n.id]).locales ?? (q.locales = {}), (L = e.renderer.properties[n.id].locales)[a] ?? (L[a] = {}), e.renderer.properties[n.id].locales[a].value = te;
1589
+ (_ = e.renderer).properties ?? (_.properties = {}), (H = e.renderer.properties)[Y = s.id] ?? (H[Y] = {}), (q = e.renderer.properties[s.id]).locales ?? (q.locales = {}), (L = e.renderer.properties[s.id].locales)[a] ?? (L[a] = {}), e.renderer.properties[s.id].locales[a].value = re;
1583
1590
  });
1584
1591
  }
1585
- }) }, n.id);
1592
+ }) }, s.id);
1586
1593
  }),
1587
1594
  /* @__PURE__ */ t(it, { ...Ze(b), component: e, type: "parameters" })
1588
1595
  ] })
1589
1596
  ] }) });
1590
1597
  }
1591
- function Se({ label: e, options: r, excludes: i, value: l, onChange: u, allComponents: y, ...a }) {
1592
- var k;
1593
- const { t: x } = C(), g = r ?? A(Object.values(Ht(y, ...i ?? [])), "index").map((v) => v.data), b = (typeof l == "string" ? (k = y[l]) == null ? void 0 : k.data : void 0) ?? null;
1598
+ function Ie({ label: e, options: r, excludes: i, value: l, onChange: p, allComponents: y, ...a }) {
1599
+ var v;
1600
+ const { t: g } = D(), P = r ?? A(Object.values(Ht(y, ...i ?? [])), "index").map((x) => x.data), b = (typeof l == "string" ? (v = y[l]) == null ? void 0 : v.data : void 0) ?? null;
1594
1601
  return /* @__PURE__ */ t($e, {
1595
1602
  ...a,
1596
1603
  size: "small",
1597
- options: g,
1604
+ options: P,
1598
1605
  autoHighlight: !0,
1599
- isOptionEqualToValue: (v, o) => v.id === o.id,
1600
- getOptionKey: (v) => v.id,
1601
- getOptionLabel: (v) => v.name || v.id,
1602
- renderInput: (v) => /* @__PURE__ */ t(V, { label: e || x("component"), ...v }),
1606
+ isOptionEqualToValue: (x, o) => x.id === o.id,
1607
+ getOptionKey: (x) => x.id,
1608
+ getOptionLabel: (x) => x.name || x.id,
1609
+ renderInput: (x) => /* @__PURE__ */ t(V, { label: e || g("component"), ...x }),
1603
1610
  value: b,
1604
- onChange: (v, o) => {
1605
- var s, d, m, w, c, h;
1606
- let n = {};
1607
- o && (n = {
1608
- blockletId: (s = y[o == null ? void 0 : o.id]) == null ? void 0 : s.blockletId,
1611
+ onChange: (x, o) => {
1612
+ var n, d, h, w, c, m;
1613
+ let s = {};
1614
+ o && (s = {
1615
+ blockletId: (n = y[o == null ? void 0 : o.id]) == null ? void 0 : n.blockletId,
1609
1616
  blockletTitle: (d = y[o == null ? void 0 : o.id]) == null ? void 0 : d.blockletTitle,
1610
- componentName: ((w = (m = y[o == null ? void 0 : o.id]) == null ? void 0 : m.data) == null ? void 0 : w.name) || ((h = (c = y[o == null ? void 0 : o.id]) == null ? void 0 : c.data) == null ? void 0 : h.id)
1611
- }), u == null || u(v, o == null ? void 0 : o.id, n);
1617
+ componentName: ((w = (h = y[o == null ? void 0 : o.id]) == null ? void 0 : h.data) == null ? void 0 : w.name) || ((m = (c = y[o == null ? void 0 : o.id]) == null ? void 0 : c.data) == null ? void 0 : m.id)
1618
+ }), p == null || p(x, o == null ? void 0 : o.id, s);
1612
1619
  }
1613
1620
  });
1614
1621
  }
1615
- function lt({ config: e, allComponents: r, defaultLocale: i, propertiesValue: l, currentLocale: u, onChange: y, props: a }) {
1616
- const { t: x } = C(), [g, b] = Q(e == null ? void 0 : e.properties), [k, v] = Q(null);
1617
- $(() => {
1622
+ function lt({ config: e, allComponents: r, defaultLocale: i, propertiesValue: l, currentLocale: p, onChange: y, props: a }) {
1623
+ const { t: g } = D(), [P, b] = X(e == null ? void 0 : e.properties), [v, x] = X(null);
1624
+ M(() => {
1618
1625
  (() => {
1619
1626
  var w, c;
1620
- ((w = e == null ? void 0 : e.renderer) == null ? void 0 : w.type) === "react-component" && we(e == null ? void 0 : e.properties) ? Rt((c = e == null ? void 0 : e.renderer) == null ? void 0 : c.script).then((h) => {
1621
- const f = zt(h);
1622
- b(f);
1627
+ ((w = e == null ? void 0 : e.renderer) == null ? void 0 : w.type) === "react-component" && Pe(e == null ? void 0 : e.properties) ? Rt((c = e == null ? void 0 : e.renderer) == null ? void 0 : c.script).then((m) => {
1628
+ const u = zt(m);
1629
+ b(u);
1623
1630
  }) : b(e == null ? void 0 : e.properties);
1624
1631
  })();
1625
1632
  }, [JSON.stringify(e)]);
1626
- const o = D(() => !e || !g ? {} : Object.values(g).reduce((m, { data: w }) => {
1627
- var h, f, P, S, p;
1633
+ const o = C(() => !e || !P ? {} : Object.values(P).reduce((h, { data: w }) => {
1634
+ var m, u, k, I, f;
1628
1635
  const c = w.key || w.id;
1629
- return m[w.id] = {
1636
+ return h[w.id] = {
1630
1637
  key: c,
1631
- value: (a == null ? void 0 : a[c]) ?? ((h = l == null ? void 0 : l[w.id]) == null ? void 0 : h.value) ?? ((P = (f = w.locales) == null ? void 0 : f[u]) == null ? void 0 : P.defaultValue) ?? ((p = (S = w.locales) == null ? void 0 : S[i]) == null ? void 0 : p.defaultValue),
1638
+ value: (a == null ? void 0 : a[c]) ?? ((m = l == null ? void 0 : l[w.id]) == null ? void 0 : m.value) ?? ((k = (u = w.locales) == null ? void 0 : u[p]) == null ? void 0 : k.defaultValue) ?? ((f = (I = w.locales) == null ? void 0 : I[i]) == null ? void 0 : f.defaultValue),
1632
1639
  id: w.id,
1633
1640
  type: w.type
1634
- }, m;
1635
- }, {}), [JSON.stringify(g), e, l, u, i]), n = ne(() => {
1636
- if (!g)
1641
+ }, h;
1642
+ }, {}), [JSON.stringify(P), e, l, p, i]), s = Q(() => {
1643
+ if (!P)
1637
1644
  return {
1638
1645
  canUseProperties: [],
1639
1646
  visibleProperties: [],
1640
1647
  canUsePropertiesKeys: []
1641
1648
  };
1642
- const m = A(Object.values(g), "index"), w = m.filter(({ data: f }) => f.key && ye(g, f.id)), c = m.filter(({ data: f }) => f.key && f.type !== "component"), h = c.map(({ data: f }) => f.key);
1649
+ const h = A(Object.values(P), "index"), w = h.filter(({ data: u }) => u.key && ye(P, u.id)), c = h.filter(({ data: u }) => u.key && u.type !== "component"), m = c.map(({ data: u }) => u.key);
1643
1650
  return {
1644
1651
  canUseProperties: c,
1645
1652
  visibleProperties: w,
1646
- canUsePropertiesKeys: h
1653
+ canUsePropertiesKeys: m
1647
1654
  };
1648
- }, [JSON.stringify(g)]), s = o(), d = _t(s, "key");
1655
+ }, [JSON.stringify(P)]), n = o(), d = _t(n, "key");
1649
1656
  return /* @__PURE__ */ t(ue, { children: /* @__PURE__ */ O(R, { gap: 2, children: [
1650
- /* @__PURE__ */ t(B, { variant: "subtitle1", children: x("maker.properties.parameters") }),
1651
- !e || n.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ t(de, { style: { fontSize: 12 }, children: x("maker.properties.noParameters") }) : /* @__PURE__ */ O(X, { children: [
1652
- /* @__PURE__ */ t(R, { gap: 2, children: n.visibleProperties.map(({ data: m }) => {
1657
+ /* @__PURE__ */ t(B, { variant: "subtitle1", children: g("maker.properties.parameters") }),
1658
+ !e || s.canUsePropertiesKeys.length === 0 ? /* @__PURE__ */ t(de, { style: { fontSize: 12 }, children: g("maker.properties.noParameters") }) : /* @__PURE__ */ O(Z, { children: [
1659
+ /* @__PURE__ */ t(R, { gap: 2, children: s.visibleProperties.map(({ data: h }) => {
1653
1660
  var w, c;
1654
- return /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t(M, {
1661
+ return /* @__PURE__ */ t(j, { children: /* @__PURE__ */ t($, {
1655
1662
  allComponents: r,
1656
1663
  defaultLocale: i,
1657
1664
  size: "small",
1658
1665
  fullWidth: !0,
1659
1666
  component: e,
1660
- property: m,
1661
- valueImmutable: se((w = l == null ? void 0 : l[m.id]) == null ? void 0 : w.value),
1662
- value: (a == null ? void 0 : a[m.key || m.id]) ?? ((c = s[m.id]) == null ? void 0 : c.value),
1663
- onChange: (h) => {
1667
+ property: h,
1668
+ valueImmutable: se((w = l == null ? void 0 : l[h.id]) == null ? void 0 : w.value),
1669
+ value: (a == null ? void 0 : a[h.key || h.id]) ?? ((c = n[h.id]) == null ? void 0 : c.value),
1670
+ onChange: (m) => {
1664
1671
  y({
1665
- path: ["properties", m.id],
1666
- id: m.id,
1667
- value: { value: h },
1668
- shouldSync: Ue(m),
1672
+ path: ["properties", h.id],
1673
+ id: h.id,
1674
+ value: { value: m },
1675
+ shouldSync: Ue(h),
1669
1676
  excludeKeys: [],
1670
- key: m.key || m.id
1677
+ key: h.key || h.id
1671
1678
  });
1672
1679
  }
1673
- }) }, m.id);
1680
+ }) }, h.id);
1674
1681
  }) }),
1675
1682
  /* @__PURE__ */ t(R, { gap: 2, sx: { width: "100%" }, children: /* @__PURE__ */ t(qe, {
1676
1683
  componentId: (e == null ? void 0 : e.id) || "",
1677
1684
  renderType: "setting",
1678
- locale: u,
1679
- properties: s,
1685
+ locale: p,
1686
+ properties: n,
1680
1687
  dev: { mode: "draft", components: r, defaultLocale: i },
1681
1688
  props: {
1682
- ...Yt(a ?? {}, n.canUsePropertiesKeys),
1683
- onChange: (m) => {
1684
- const { canUsePropertiesKeys: w } = n;
1685
- Object.keys(m).filter((h) => {
1686
- var f;
1687
- return !Mt(m[h], (f = d == null ? void 0 : d[h]) == null ? void 0 : f.value);
1688
- }).filter((h) => {
1689
- var f, P, S, p;
1690
- return !(h === "locale" && !Jt(d[h], "locale") || ((f = d[h]) == null ? void 0 : f.type) === "component" || (((P = d[h]) == null ? void 0 : P.type) === "yaml" || ((S = d[h]) == null ? void 0 : S.type) === "json") && ye(g, (p = d[h]) == null ? void 0 : p.id));
1691
- }).reduce((h, f) => h.then(() => {
1692
- const P = d[f], S = w.includes(f);
1693
- if (P != null && P.id && S)
1689
+ ...Yt(a ?? {}, s.canUsePropertiesKeys),
1690
+ onChange: (h) => {
1691
+ const { canUsePropertiesKeys: w } = s;
1692
+ Object.keys(h).filter((m) => {
1693
+ var u;
1694
+ return !Mt(h[m], (u = d == null ? void 0 : d[m]) == null ? void 0 : u.value);
1695
+ }).filter((m) => {
1696
+ var u, k, I, f;
1697
+ return !(m === "locale" && !Jt(d[m], "locale") || ((u = d[m]) == null ? void 0 : u.type) === "component" || (((k = d[m]) == null ? void 0 : k.type) === "yaml" || ((I = d[m]) == null ? void 0 : I.type) === "json") && ye(P, (f = d[m]) == null ? void 0 : f.id));
1698
+ }).reduce((m, u) => m.then(() => {
1699
+ const k = d[u], I = w.includes(u);
1700
+ if (k != null && k.id && I)
1694
1701
  return y({
1695
- path: ["properties", P.id],
1696
- id: P.id,
1697
- value: { value: m[f] },
1698
- shouldSync: Ue(P),
1702
+ path: ["properties", k.id],
1703
+ id: k.id,
1704
+ value: { value: h[u] },
1705
+ shouldSync: Ue(k),
1699
1706
  excludeKeys: [],
1700
- key: P.key || P.id
1707
+ key: k.key || k.id
1701
1708
  }), Promise.resolve();
1702
- const p = `propertyNotFound${f}`;
1703
- if (k === p)
1709
+ const f = `propertyNotFound${u}`;
1710
+ if (v === f)
1704
1711
  return Promise.resolve();
1705
- he.close(k);
1706
- const I = he.warning(x("maker.properties.propertyNotFound", {
1707
- key: f
1712
+ he.close(v);
1713
+ const S = he.warning(g("maker.properties.propertyNotFound", {
1714
+ key: u
1708
1715
  }), {
1709
- key: p
1716
+ key: f
1710
1717
  });
1711
- return v(I), Promise.resolve();
1718
+ return x(S), Promise.resolve();
1712
1719
  }), Promise.resolve());
1713
1720
  }
1714
1721
  }
@@ -1718,11 +1725,11 @@ function lt({ config: e, allComponents: r, defaultLocale: i, propertiesValue: l,
1718
1725
  }
1719
1726
  export {
1720
1727
  ur as BasicInfo,
1721
- Se as CustomComponentAutocomplete,
1728
+ Ie as CustomComponentAutocomplete,
1722
1729
  ci as CustomComponentSettings,
1723
1730
  vr as DefaultReactComponentScriptTemplate,
1724
1731
  xr as DefaultWebComponentScriptTemplate,
1725
1732
  lt as ParametersConfig,
1726
1733
  mr as PropertiesConfig,
1727
- M as PropertyValueField
1734
+ $ as PropertyValueField
1728
1735
  };