@blocklet/pages-kit-inner-components 0.6.72 → 0.6.73

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