@blocklet/pages-kit-inner-components 0.0.8 → 0.0.9

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