@blocklet/pages-kit-inner-components 0.5.55 → 0.6.0

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