@blocklet/pages-kit-inner-components 0.6.20 → 0.6.22
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/cjs/add-component.js +1 -1
- package/lib/cjs/chunks/{home-D6CNLMDa.js → home-CmcR9R89.js} +2 -2
- package/lib/cjs/chunks/html-JOhPskS4.js +1 -0
- package/lib/cjs/chunks/index-7_tPWvdE.js +475 -0
- package/lib/cjs/chunks/{publish-button-FsuH_RMC.js → publish-button-CuIP1HAR.js} +1 -1
- package/lib/cjs/chunks/site-state-CkqENAbR.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/locales.js +2 -2
- package/lib/cjs/project-html.js +6 -6
- package/lib/cjs/resources.js +1 -1
- package/lib/cjs/setting.js +3 -3
- package/lib/cjs/site-state.js +1 -1
- package/lib/es/add-component.js +2 -2
- package/lib/es/chunks/{home-Dmze9ay0.js → home-pT8D7Ttx.js} +2 -2
- package/lib/es/chunks/html-DfzaaIYa.js +49 -0
- package/lib/es/chunks/{index-aeMNll_R.js → index-BHQcp5eX.js} +964 -563
- package/lib/es/chunks/{publish-button-BPtL08Ue.js → publish-button-CIVPDQb7.js} +2 -2
- package/lib/es/chunks/{site-state-Dt2__Byi.js → site-state-CqlS8v17.js} +536 -562
- package/lib/es/home.js +2 -2
- package/lib/es/locales.js +86 -8
- package/lib/es/project-html.js +93 -133
- package/lib/es/resources.js +1 -1
- package/lib/es/setting.js +143 -141
- package/lib/es/site-state.js +1 -1
- package/package.json +5 -5
- package/lib/cjs/chunks/index-D3fT0ax0.js +0 -475
- package/lib/cjs/chunks/site-state-Vc48a38-.js +0 -1
package/lib/es/setting.js
CHANGED
|
@@ -1,28 +1,28 @@
|
|
|
1
1
|
import { jsx as r, jsxs as v, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { Box as P, Alert as
|
|
3
|
-
import { t as
|
|
2
|
+
import { Box as P, Alert as Xe, Typography as T, TextField as z, Stack as k, FormLabel as ee, TableContainer as Ze, Paper as G, Table as Ne, TableHead as je, TableRow as re, TableCell as te, TableBody as ze, Button as E, IconButton as Y, FormControlLabel as ge, Switch as Ve, InputAdornment as $, alpha as ae, Tooltip as _, buttonClasses as er, Dialog as ye, DialogTitle as Re, DialogContent as Ee, DialogActions as Ae, Checkbox as rr, Autocomplete as Te, MenuItem as ce, Collapse as tr, Divider as nr, Popper as ir } from "@mui/material";
|
|
3
|
+
import { t as xe, f as ne, a as oe, h as ve } from "./chunks/state-DSo43FAB.js";
|
|
4
4
|
import q from "@arcblock/ux/lib/Empty";
|
|
5
5
|
import { useLocaleContext as V } from "@arcblock/ux/lib/Locale/context";
|
|
6
|
-
import { CodeEditor as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import
|
|
6
|
+
import { CodeEditor as Ce } from "@blocklet/code-editor";
|
|
7
|
+
import or from "@mui/icons-material/AddRounded";
|
|
8
|
+
import lr from "@mui/icons-material/ArrowDownward";
|
|
9
|
+
import sr from "@mui/icons-material/ArrowUpward";
|
|
10
|
+
import ar from "@mui/icons-material/DeleteOutline";
|
|
11
11
|
import D from "lodash/sortBy";
|
|
12
|
-
import { useCallback as A, useMemo as H, useState as B, useEffect as U, useImperativeHandle as
|
|
13
|
-
import { useUpdate as
|
|
14
|
-
import { ColorItem as
|
|
15
|
-
import { getImageSize as de, getVideoSize as ue, UploaderButton as
|
|
16
|
-
import { Icon as
|
|
12
|
+
import { useCallback as A, useMemo as H, useState as B, useEffect as U, useImperativeHandle as cr, useRef as M, useId as dr } from "react";
|
|
13
|
+
import { useUpdate as De, useDebounce as ur } from "react-use";
|
|
14
|
+
import { ColorItem as pr, ConfigColorDialog as mr } from "@blocklet/pages-kit/builtin/color-picker";
|
|
15
|
+
import { getImageSize as de, getVideoSize as ue, UploaderButton as Pe, UploaderProvider as le, useUploader as hr } from "@blocklet/pages-kit/builtin/uploader";
|
|
16
|
+
import { Icon as fr } from "@iconify-icon/react";
|
|
17
17
|
import K from "lodash/isEmpty";
|
|
18
|
-
import
|
|
18
|
+
import We from "lodash/set";
|
|
19
19
|
import * as pe from "yaml";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import { CustomComponentRenderer as
|
|
20
|
+
import me from "lodash/cloneDeep";
|
|
21
|
+
import he from "@arcblock/ux/lib/Toast";
|
|
22
|
+
import { CustomComponentRenderer as Ue, transpileAndLoadScript as br, getPropertiesFromCode as gr } from "@blocklet/pages-kit/components";
|
|
23
23
|
import { parsePropertyValue as yr } from "@blocklet/pages-kit/utils/property";
|
|
24
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
|
|
25
|
+
import { VisibilityOffRounded as Cr, VisibilityRounded as Pr, DeleteOutlineRounded as kr, DragIndicatorRounded as wr, TranslateRounded as Ke, AddRounded as Be, InfoRounded as Me, PsychologyAlt as Ir, StarRounded as Sr, SettingsRounded as Le } from "@mui/icons-material";
|
|
26
26
|
import { getYjsValue as Q } from "@syncedstore/core";
|
|
27
27
|
import { useUpdate as Or, useReactive as Nr } from "ahooks";
|
|
28
28
|
import jr from "lodash/assign";
|
|
@@ -35,13 +35,13 @@ import Ar from "lodash/keyBy";
|
|
|
35
35
|
import Tr from "lodash/omit";
|
|
36
36
|
import Dr from "lodash/pick";
|
|
37
37
|
import Wr from "lodash/reduce";
|
|
38
|
-
import { usePopupState as
|
|
38
|
+
import { usePopupState as ke, bindTrigger as we, bindDialog as Fe, bindPopper as Ur } from "material-ui-popup-state/hooks";
|
|
39
39
|
import { ErrorBoundary as Kr } from "react-error-boundary";
|
|
40
40
|
import { cx as Br } from "@emotion/css";
|
|
41
|
-
import { useDrop as
|
|
42
|
-
import { nextId as
|
|
41
|
+
import { useDrop as Je, useDrag as Mr } from "react-dnd";
|
|
42
|
+
import { nextId as _e } from "@blocklet/pages-kit/utils/common";
|
|
43
43
|
function Lr({ error: e }) {
|
|
44
|
-
return /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(
|
|
44
|
+
return /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(Xe, { severity: "error", children: e.message }) });
|
|
45
45
|
}
|
|
46
46
|
function Fr({
|
|
47
47
|
onClick: e,
|
|
@@ -49,7 +49,7 @@ function Fr({
|
|
|
49
49
|
sx: o,
|
|
50
50
|
...l
|
|
51
51
|
}) {
|
|
52
|
-
return /* @__PURE__ */ r(Y, { size: "small", color: "warning", variant: "outlined", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(
|
|
52
|
+
return /* @__PURE__ */ r(Y, { size: "small", color: "warning", variant: "outlined", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(ar, { fontSize: "small" }) });
|
|
53
53
|
}
|
|
54
54
|
function Jr({
|
|
55
55
|
onClick: e,
|
|
@@ -57,7 +57,7 @@ function Jr({
|
|
|
57
57
|
sx: o,
|
|
58
58
|
...l
|
|
59
59
|
}) {
|
|
60
|
-
return /* @__PURE__ */ r(Y, { size: "small", color: "primary", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(
|
|
60
|
+
return /* @__PURE__ */ r(Y, { size: "small", color: "primary", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(sr, { fontSize: "small" }) });
|
|
61
61
|
}
|
|
62
62
|
function _r({
|
|
63
63
|
onClick: e,
|
|
@@ -65,7 +65,7 @@ function _r({
|
|
|
65
65
|
sx: o,
|
|
66
66
|
...l
|
|
67
67
|
}) {
|
|
68
|
-
return /* @__PURE__ */ r(Y, { size: "small", color: "primary", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(
|
|
68
|
+
return /* @__PURE__ */ r(Y, { size: "small", color: "primary", disabled: t, onClick: e, ...l, children: /* @__PURE__ */ r(lr, { fontSize: "small" }) });
|
|
69
69
|
}
|
|
70
70
|
function $r({
|
|
71
71
|
label: e,
|
|
@@ -78,9 +78,9 @@ function $r({
|
|
|
78
78
|
renderItem: b,
|
|
79
79
|
...m
|
|
80
80
|
}) {
|
|
81
|
-
const { t: c, locale: s } = V(), a =
|
|
81
|
+
const { t: c, locale: s } = V(), a = De(), i = A(
|
|
82
82
|
(y) => {
|
|
83
|
-
o(
|
|
83
|
+
o(xe(y, d.type));
|
|
84
84
|
},
|
|
85
85
|
[o, d.type]
|
|
86
86
|
), n = H(() => Array.isArray(t) ? t : [], [t]), f = A(() => {
|
|
@@ -219,8 +219,8 @@ function $r({
|
|
|
219
219
|
},
|
|
220
220
|
children: [
|
|
221
221
|
e && /* @__PURE__ */ r(ee, { children: e }),
|
|
222
|
-
n.length > 0 ? /* @__PURE__ */ r(
|
|
223
|
-
|
|
222
|
+
n.length > 0 ? /* @__PURE__ */ r(Ze, { component: G, variant: "outlined", sx: { borderRadius: 1, mb: 1 }, children: /* @__PURE__ */ v(
|
|
223
|
+
Ne,
|
|
224
224
|
{
|
|
225
225
|
size: "small",
|
|
226
226
|
sx: {
|
|
@@ -237,7 +237,7 @@ function $r({
|
|
|
237
237
|
borderCollapse: "collapse"
|
|
238
238
|
},
|
|
239
239
|
children: [
|
|
240
|
-
/* @__PURE__ */ r(
|
|
240
|
+
/* @__PURE__ */ r(je, { sx: { display: "none" }, children: /* @__PURE__ */ r(re, { children: j.map((y) => /* @__PURE__ */ r(
|
|
241
241
|
te,
|
|
242
242
|
{
|
|
243
243
|
width: y.width,
|
|
@@ -247,7 +247,7 @@ function $r({
|
|
|
247
247
|
},
|
|
248
248
|
y.field
|
|
249
249
|
)) }) }),
|
|
250
|
-
/* @__PURE__ */ r(
|
|
250
|
+
/* @__PURE__ */ r(ze, { children: n.map((y, C, O) => /* @__PURE__ */ r(
|
|
251
251
|
re,
|
|
252
252
|
{
|
|
253
253
|
sx: {
|
|
@@ -286,7 +286,7 @@ function $r({
|
|
|
286
286
|
size: "small",
|
|
287
287
|
variant: "outlined",
|
|
288
288
|
disabled: l,
|
|
289
|
-
startIcon: /* @__PURE__ */ r(
|
|
289
|
+
startIcon: /* @__PURE__ */ r(or, {}),
|
|
290
290
|
onClick: g,
|
|
291
291
|
children: c("maker.properties.addArrayItem")
|
|
292
292
|
}
|
|
@@ -303,7 +303,7 @@ function $r({
|
|
|
303
303
|
children: [
|
|
304
304
|
e && /* @__PURE__ */ r(ee, { children: e }),
|
|
305
305
|
/* @__PURE__ */ r(P, { sx: { border: 1, borderColor: "divider", borderRadius: 1, minHeight: 150 }, children: /* @__PURE__ */ r(
|
|
306
|
-
|
|
306
|
+
Ce,
|
|
307
307
|
{
|
|
308
308
|
keyId: d.id,
|
|
309
309
|
locale: s,
|
|
@@ -348,20 +348,20 @@ function Hr({
|
|
|
348
348
|
b(c, { ...f, filename: c });
|
|
349
349
|
}
|
|
350
350
|
};
|
|
351
|
-
|
|
351
|
+
ur(
|
|
352
352
|
() => {
|
|
353
353
|
c !== p && b(c);
|
|
354
354
|
},
|
|
355
355
|
300,
|
|
356
356
|
[c]
|
|
357
|
-
),
|
|
357
|
+
), cr(e, () => ({
|
|
358
358
|
submit: a
|
|
359
359
|
}));
|
|
360
360
|
const i = {};
|
|
361
361
|
return h && (i.InputProps = {
|
|
362
362
|
sx: { pr: 0 },
|
|
363
363
|
endAdornment: /* @__PURE__ */ r($, { position: "end", sx: { mx: 0.5 }, children: /* @__PURE__ */ r(
|
|
364
|
-
|
|
364
|
+
Pe,
|
|
365
365
|
{
|
|
366
366
|
onChange: async ({ response: n }) => {
|
|
367
367
|
const f = n?.data?.filename, g = ne(f) || "";
|
|
@@ -393,12 +393,12 @@ function Hr({
|
|
|
393
393
|
t && /* @__PURE__ */ v(F, { children: [
|
|
394
394
|
" (",
|
|
395
395
|
/* @__PURE__ */ r(
|
|
396
|
-
|
|
396
|
+
ge,
|
|
397
397
|
{
|
|
398
398
|
checked: o,
|
|
399
|
-
label: /* @__PURE__ */ r(P, { component:
|
|
399
|
+
label: /* @__PURE__ */ r(P, { component: fr, icon: "tabler:markdown", sx: { verticalAlign: "middle" } }),
|
|
400
400
|
labelPlacement: "start",
|
|
401
|
-
control: /* @__PURE__ */ r(
|
|
401
|
+
control: /* @__PURE__ */ r(Ve, { size: "small" }),
|
|
402
402
|
sx: { ml: 0.25, pr: 1 },
|
|
403
403
|
onChange: (n, f) => l?.(f)
|
|
404
404
|
}
|
|
@@ -423,24 +423,25 @@ function Hr({
|
|
|
423
423
|
function Gr({
|
|
424
424
|
value: e,
|
|
425
425
|
onChange: t,
|
|
426
|
-
|
|
426
|
+
disableGradient: o = !1,
|
|
427
|
+
...l
|
|
427
428
|
}) {
|
|
428
|
-
const
|
|
429
|
+
const h = M(null);
|
|
429
430
|
return /* @__PURE__ */ v(F, { children: [
|
|
430
431
|
/* @__PURE__ */ r(
|
|
431
432
|
Hr,
|
|
432
433
|
{
|
|
433
|
-
...
|
|
434
|
+
...l,
|
|
434
435
|
value: e,
|
|
435
436
|
onChange: t,
|
|
436
437
|
InputProps: {
|
|
437
438
|
endAdornment: /* @__PURE__ */ r($, { position: "end", children: /* @__PURE__ */ r(
|
|
438
|
-
|
|
439
|
+
pr,
|
|
439
440
|
{
|
|
440
441
|
color: e ?? "",
|
|
441
442
|
style: { width: "1.5rem", height: "1.5rem", padding: 0 },
|
|
442
443
|
onClick: () => {
|
|
443
|
-
|
|
444
|
+
h.current?.open({ value: e ?? "" });
|
|
444
445
|
}
|
|
445
446
|
}
|
|
446
447
|
) })
|
|
@@ -448,12 +449,13 @@ function Gr({
|
|
|
448
449
|
}
|
|
449
450
|
),
|
|
450
451
|
/* @__PURE__ */ r(
|
|
451
|
-
|
|
452
|
+
mr,
|
|
452
453
|
{
|
|
453
|
-
ref:
|
|
454
|
-
onSave: ({ value:
|
|
455
|
-
t(
|
|
456
|
-
}
|
|
454
|
+
ref: h,
|
|
455
|
+
onSave: ({ value: p }, d) => {
|
|
456
|
+
t(p), d();
|
|
457
|
+
},
|
|
458
|
+
disableGradient: o
|
|
457
459
|
}
|
|
458
460
|
)
|
|
459
461
|
] });
|
|
@@ -499,8 +501,8 @@ function Yr({
|
|
|
499
501
|
} catch {
|
|
500
502
|
}
|
|
501
503
|
else typeof t == "object" && t !== null && (j = { ...t });
|
|
502
|
-
|
|
503
|
-
const y =
|
|
504
|
+
We(j, u, w);
|
|
505
|
+
const y = xe(j, l.type);
|
|
504
506
|
o?.(y);
|
|
505
507
|
} catch (j) {
|
|
506
508
|
console.error("Error updating property:", j);
|
|
@@ -629,7 +631,7 @@ function Yr({
|
|
|
629
631
|
}
|
|
630
632
|
),
|
|
631
633
|
/* @__PURE__ */ r(
|
|
632
|
-
|
|
634
|
+
Ce,
|
|
633
635
|
{
|
|
634
636
|
keyId: l.id,
|
|
635
637
|
locale: c,
|
|
@@ -675,16 +677,16 @@ function Yr({
|
|
|
675
677
|
);
|
|
676
678
|
}
|
|
677
679
|
const qr = ["string", "multiline", "json", "yaml", "url", "component", "custom", "array"];
|
|
678
|
-
function
|
|
680
|
+
function Se(e) {
|
|
679
681
|
return e.type ? !qr.includes(e.type) : !1;
|
|
680
682
|
}
|
|
681
|
-
function
|
|
683
|
+
function $e({
|
|
682
684
|
disabled: e,
|
|
683
685
|
list: t,
|
|
684
686
|
renderItem: o,
|
|
685
687
|
...l
|
|
686
688
|
}) {
|
|
687
|
-
const h = M(null), p =
|
|
689
|
+
const h = M(null), p = dr(), d = Or(), b = D(Object.entries(t), (n) => n[1].index).map((n) => n[0]), m = M(b), c = A(
|
|
688
690
|
(n) => {
|
|
689
691
|
m.current = n, d();
|
|
690
692
|
},
|
|
@@ -699,7 +701,7 @@ function _e({
|
|
|
699
701
|
U(() => {
|
|
700
702
|
c(b);
|
|
701
703
|
}, [b.join("-")]);
|
|
702
|
-
const [{ isOver: a }, i] =
|
|
704
|
+
const [{ isOver: a }, i] = Je({
|
|
703
705
|
accept: p,
|
|
704
706
|
collect: (n) => ({
|
|
705
707
|
isOver: n.isOver()
|
|
@@ -750,7 +752,7 @@ function Qr({
|
|
|
750
752
|
item: () => ({ id: t }),
|
|
751
753
|
canDrag: () => !e,
|
|
752
754
|
collect: (i) => ({ isDragging: i.isDragging() })
|
|
753
|
-
}), [, a] =
|
|
755
|
+
}), [, a] = Je({
|
|
754
756
|
accept: l,
|
|
755
757
|
canDrop: () => !e,
|
|
756
758
|
hover(i, n) {
|
|
@@ -827,7 +829,7 @@ function Xr({
|
|
|
827
829
|
bgcolor: (i) => ae(i.palette.grey[200], 0.9),
|
|
828
830
|
borderRadius: 1,
|
|
829
831
|
p: 0.5,
|
|
830
|
-
[`.${
|
|
832
|
+
[`.${er.root}`]: {
|
|
831
833
|
minWidth: 24,
|
|
832
834
|
width: 24,
|
|
833
835
|
height: 24,
|
|
@@ -855,7 +857,7 @@ function Zr(e) {
|
|
|
855
857
|
function et(e, t, o) {
|
|
856
858
|
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;
|
|
857
859
|
}
|
|
858
|
-
const
|
|
860
|
+
const He = (e, t, o, l) => {
|
|
859
861
|
const h = {};
|
|
860
862
|
return D(Object.entries(e), ([, d]) => d.index).forEach(([d, b]) => {
|
|
861
863
|
const m = b.data;
|
|
@@ -867,7 +869,7 @@ const $e = (e, t, o, l) => {
|
|
|
867
869
|
describe: a?.describe ?? "",
|
|
868
870
|
displayName: s
|
|
869
871
|
};
|
|
870
|
-
m.subProperties && !K(m.subProperties) && (i.subProperties =
|
|
872
|
+
m.subProperties && !K(m.subProperties) && (i.subProperties = He(
|
|
871
873
|
m.subProperties,
|
|
872
874
|
a?.subProperties,
|
|
873
875
|
o,
|
|
@@ -892,7 +894,7 @@ function rt({
|
|
|
892
894
|
const u = { properties: {} };
|
|
893
895
|
if (l.properties) {
|
|
894
896
|
const x = h?.properties;
|
|
895
|
-
u.properties =
|
|
897
|
+
u.properties = He(l.properties, x, p, d);
|
|
896
898
|
}
|
|
897
899
|
a(u);
|
|
898
900
|
}
|
|
@@ -923,12 +925,12 @@ function rt({
|
|
|
923
925
|
if (x.subProperties && !K(x.subProperties)) {
|
|
924
926
|
const O = (R, W) => {
|
|
925
927
|
const J = {};
|
|
926
|
-
return Object.entries(R).forEach(([
|
|
928
|
+
return Object.entries(R).forEach(([Qe, X]) => {
|
|
927
929
|
const se = { ...X };
|
|
928
930
|
W !== null && (se.isNeedGenerate = W), X.subProperties && !K(X.subProperties) && (se.subProperties = O(
|
|
929
931
|
X.subProperties,
|
|
930
932
|
W !== null ? W : null
|
|
931
|
-
)), J[
|
|
933
|
+
)), J[Qe] = se;
|
|
932
934
|
}), J;
|
|
933
935
|
};
|
|
934
936
|
C.subProperties = O(
|
|
@@ -1029,10 +1031,10 @@ function rt({
|
|
|
1029
1031
|
},
|
|
1030
1032
|
children: [
|
|
1031
1033
|
/* @__PURE__ */ r(
|
|
1032
|
-
|
|
1034
|
+
ge,
|
|
1033
1035
|
{
|
|
1034
1036
|
control: /* @__PURE__ */ r(
|
|
1035
|
-
|
|
1037
|
+
rr,
|
|
1036
1038
|
{
|
|
1037
1039
|
checked: w.isNeedGenerate,
|
|
1038
1040
|
disabled: W,
|
|
@@ -1081,9 +1083,9 @@ function rt({
|
|
|
1081
1083
|
] }) }, S);
|
|
1082
1084
|
}) });
|
|
1083
1085
|
};
|
|
1084
|
-
return /* @__PURE__ */ v(
|
|
1085
|
-
/* @__PURE__ */ r(
|
|
1086
|
-
/* @__PURE__ */ r(
|
|
1086
|
+
return /* @__PURE__ */ v(ye, { open: e, onClose: i, maxWidth: "lg", fullWidth: !0, children: [
|
|
1087
|
+
/* @__PURE__ */ r(Re, { children: b || c("maker.properties.llmConfigTitle") }),
|
|
1088
|
+
/* @__PURE__ */ r(Ee, { children: /* @__PURE__ */ r(
|
|
1087
1089
|
P,
|
|
1088
1090
|
{
|
|
1089
1091
|
sx: {
|
|
@@ -1095,7 +1097,7 @@ function rt({
|
|
|
1095
1097
|
] }) : /* @__PURE__ */ r(T, { children: c("maker.properties.loading") }) : /* @__PURE__ */ r(T, { color: "error", children: c("maker.properties.componentNotFound") })
|
|
1096
1098
|
}
|
|
1097
1099
|
) }),
|
|
1098
|
-
/* @__PURE__ */ v(
|
|
1100
|
+
/* @__PURE__ */ v(Ae, { children: [
|
|
1099
1101
|
/* @__PURE__ */ r(E, { onClick: i, children: c("common.cancel") }),
|
|
1100
1102
|
/* @__PURE__ */ r(E, { variant: "contained", onClick: n, disabled: !s || m, children: c("common.confirm") })
|
|
1101
1103
|
] })
|
|
@@ -1127,7 +1129,7 @@ function tt({
|
|
|
1127
1129
|
pr: 0
|
|
1128
1130
|
},
|
|
1129
1131
|
endAdornment: /* @__PURE__ */ r($, { position: "end", children: /* @__PURE__ */ r(
|
|
1130
|
-
|
|
1132
|
+
Pe,
|
|
1131
1133
|
{
|
|
1132
1134
|
onChange: ({ response: p }) => {
|
|
1133
1135
|
const d = p?.data?.filename;
|
|
@@ -1156,15 +1158,15 @@ function tt({
|
|
|
1156
1158
|
}
|
|
1157
1159
|
}
|
|
1158
1160
|
),
|
|
1159
|
-
/* @__PURE__ */ r(
|
|
1161
|
+
/* @__PURE__ */ r(ye, { open: l, onClose: () => h(!1), children: /* @__PURE__ */ r(P, { component: "img", sx: { objectFit: "contain" }, src: ne(t), alt: e }) })
|
|
1160
1162
|
]
|
|
1161
1163
|
}
|
|
1162
1164
|
);
|
|
1163
1165
|
}
|
|
1164
|
-
function
|
|
1166
|
+
function fe(e, t = "") {
|
|
1165
1167
|
return Wr(e, (o, l, h) => {
|
|
1166
1168
|
const p = t ? `${t}.${h}` : h;
|
|
1167
|
-
return Er(l) ? jr(o,
|
|
1169
|
+
return Er(l) ? jr(o, fe(l, p)) : o[p] = l, o;
|
|
1168
1170
|
}, {});
|
|
1169
1171
|
}
|
|
1170
1172
|
const nt = [
|
|
@@ -1184,7 +1186,7 @@ const nt = [
|
|
|
1184
1186
|
function Z(e, t, o) {
|
|
1185
1187
|
return !e || !o ? !1 : Object.values(e).some(({ data: l }) => l.id !== t && l.key === o);
|
|
1186
1188
|
}
|
|
1187
|
-
function
|
|
1189
|
+
function be(e, t) {
|
|
1188
1190
|
return !e || !t ? !1 : e[t]?.data.visible ?? !0;
|
|
1189
1191
|
}
|
|
1190
1192
|
function on({ componentId: e }) {
|
|
@@ -1203,7 +1205,7 @@ function on({ componentId: e }) {
|
|
|
1203
1205
|
}) : null;
|
|
1204
1206
|
}
|
|
1205
1207
|
function it({ value: e, componentId: t }) {
|
|
1206
|
-
const { t: o } = V(), { localState: { currentLocale: l, customComponentPreviewerProperties: h }, state: { config: { defaultLocale: p } }, localActions: { setCustomComponentPreviewerProperties: d } } = oe(), b = Q(e).doc, m =
|
|
1208
|
+
const { t: o } = V(), { localState: { currentLocale: l, customComponentPreviewerProperties: h }, state: { config: { defaultLocale: p } }, localActions: { setCustomComponentPreviewerProperties: d } } = oe(), b = Q(e).doc, m = ve(), c = H(() => h?.[t] ?? {}, [t, h]), s = Nr({
|
|
1207
1209
|
componentId: t,
|
|
1208
1210
|
propertiesValue: {
|
|
1209
1211
|
...c
|
|
@@ -1279,7 +1281,7 @@ function it({ value: e, componentId: t }) {
|
|
|
1279
1281
|
}),
|
|
1280
1282
|
e.renderer?.type === "component" && /* @__PURE__ */ r(ft, { value: e }),
|
|
1281
1283
|
e.renderer?.type === "react-component" && /* @__PURE__ */ r(ht, { value: e }),
|
|
1282
|
-
/* @__PURE__ */ r(
|
|
1284
|
+
/* @__PURE__ */ r(qe, {
|
|
1283
1285
|
config: e,
|
|
1284
1286
|
currentLocale: l,
|
|
1285
1287
|
defaultLocale: p,
|
|
@@ -1288,7 +1290,7 @@ function it({ value: e, componentId: t }) {
|
|
|
1288
1290
|
onChange: ({ value: a, id: i, path: n }) => {
|
|
1289
1291
|
const f = [...n, "data"];
|
|
1290
1292
|
if (!zr(e, f)) {
|
|
1291
|
-
|
|
1293
|
+
he.warning(o("cannotFindPropertyKey", {
|
|
1292
1294
|
key: f.join(".")
|
|
1293
1295
|
}));
|
|
1294
1296
|
return;
|
|
@@ -1331,7 +1333,7 @@ function ot({ config: e }) {
|
|
|
1331
1333
|
htmlInput: { maxLength: 200 }
|
|
1332
1334
|
}
|
|
1333
1335
|
}),
|
|
1334
|
-
/* @__PURE__ */ r(
|
|
1336
|
+
/* @__PURE__ */ r(Te, {
|
|
1335
1337
|
size: "small",
|
|
1336
1338
|
options: [],
|
|
1337
1339
|
multiple: !0,
|
|
@@ -1348,7 +1350,7 @@ function ot({ config: e }) {
|
|
|
1348
1350
|
]
|
|
1349
1351
|
}) });
|
|
1350
1352
|
}
|
|
1351
|
-
function
|
|
1353
|
+
function Ge({ data: e, params: t, visible: o, config: l, currentLocale: h, defaultLocale: p, allComponents: d, onUpdateConfig: b }) {
|
|
1352
1354
|
const { t: m } = V(), c = H(() => e.type === "json" || e.type === "yaml" || e.type === "array" ? dt : L, [e.type]);
|
|
1353
1355
|
return /* @__PURE__ */ r(Xr, {
|
|
1354
1356
|
preview: t.preview,
|
|
@@ -1411,7 +1413,7 @@ function He({ data: e, params: t, visible: o, config: l, currentLocale: h, defau
|
|
|
1411
1413
|
width: 16,
|
|
1412
1414
|
ml: 0
|
|
1413
1415
|
},
|
|
1414
|
-
children: /* @__PURE__ */ r(_, { title: e.key ? m("duplicateKey") : m("requiredKey"), children: /* @__PURE__ */ r(
|
|
1416
|
+
children: /* @__PURE__ */ r(_, { title: e.key ? m("duplicateKey") : m("requiredKey"), children: /* @__PURE__ */ r(Me, {
|
|
1415
1417
|
sx: {
|
|
1416
1418
|
color: e.key ? "warning.main" : "error.main",
|
|
1417
1419
|
fontSize: 16
|
|
@@ -1478,9 +1480,9 @@ function He({ data: e, params: t, visible: o, config: l, currentLocale: h, defau
|
|
|
1478
1480
|
b((i) => {
|
|
1479
1481
|
const n = i.properties[e.id].data;
|
|
1480
1482
|
if (a?.forceUpdateProperty) {
|
|
1481
|
-
const f =
|
|
1483
|
+
const f = fe(n), g = fe(s);
|
|
1482
1484
|
Object.keys(g).forEach((u) => {
|
|
1483
|
-
f[u] ||
|
|
1485
|
+
f[u] || We(n, u, g[u]);
|
|
1484
1486
|
});
|
|
1485
1487
|
} else
|
|
1486
1488
|
n.locales ??= {}, n.locales[h] ??= {}, n.locales[h].defaultValue = s;
|
|
@@ -1509,7 +1511,7 @@ function lt(e, t) {
|
|
|
1509
1511
|
}, [e, t]), o;
|
|
1510
1512
|
}
|
|
1511
1513
|
function st({ config: e, currentLocale: t, defaultLocale: o, allComponents: l, onUpdateConfig: h, useI18nEditor: p = !0 }) {
|
|
1512
|
-
const { t: d } = V(), b =
|
|
1514
|
+
const { t: d } = V(), b = ke({ variant: "dialog" }), m = e.properties && D(Object.values(e.properties), "index");
|
|
1513
1515
|
return /* @__PURE__ */ r(le, { children: /* @__PURE__ */ v(k, {
|
|
1514
1516
|
sx: {
|
|
1515
1517
|
gap: 2
|
|
@@ -1529,15 +1531,15 @@ function st({ config: e, currentLocale: t, defaultLocale: o, allComponents: l, o
|
|
|
1529
1531
|
flex: 1
|
|
1530
1532
|
}
|
|
1531
1533
|
}),
|
|
1532
|
-
p && /* @__PURE__ */ r(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...
|
|
1534
|
+
p && /* @__PURE__ */ r(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...we(b), children: /* @__PURE__ */ r(Ke, { fontSize: "small" }) })
|
|
1533
1535
|
]
|
|
1534
1536
|
}),
|
|
1535
|
-
e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ r(
|
|
1537
|
+
e.properties && Object.keys(e.properties).length > 0 ? /* @__PURE__ */ r($e, {
|
|
1536
1538
|
component: k,
|
|
1537
1539
|
gap: 2,
|
|
1538
1540
|
list: e.properties,
|
|
1539
1541
|
renderItem: (c, s, a) => {
|
|
1540
|
-
const i =
|
|
1542
|
+
const i = be(e.properties, c.id);
|
|
1541
1543
|
return /* @__PURE__ */ r(G, {
|
|
1542
1544
|
elevation: 0,
|
|
1543
1545
|
className: "property-container",
|
|
@@ -1551,7 +1553,7 @@ function st({ config: e, currentLocale: t, defaultLocale: o, allComponents: l, o
|
|
|
1551
1553
|
sx: {
|
|
1552
1554
|
gap: 2
|
|
1553
1555
|
},
|
|
1554
|
-
children: /* @__PURE__ */ r(
|
|
1556
|
+
children: /* @__PURE__ */ r(Ge, {
|
|
1555
1557
|
data: c,
|
|
1556
1558
|
params: a,
|
|
1557
1559
|
visible: i,
|
|
@@ -1571,27 +1573,27 @@ function st({ config: e, currentLocale: t, defaultLocale: o, allComponents: l, o
|
|
|
1571
1573
|
className: "ignore-style-override",
|
|
1572
1574
|
onClick: () => {
|
|
1573
1575
|
h((c) => {
|
|
1574
|
-
const s =
|
|
1576
|
+
const s = _e();
|
|
1575
1577
|
c.properties ??= {}, c.properties[s] ??= { index: m?.length || 0, data: { id: s } };
|
|
1576
1578
|
});
|
|
1577
1579
|
},
|
|
1578
|
-
startIcon: /* @__PURE__ */ r(
|
|
1580
|
+
startIcon: /* @__PURE__ */ r(Be, {}),
|
|
1579
1581
|
children: d("addObject", { object: d("property") })
|
|
1580
1582
|
}),
|
|
1581
|
-
p && /* @__PURE__ */ r(
|
|
1583
|
+
p && /* @__PURE__ */ r(Ye, { ...Fe(b), component: e })
|
|
1582
1584
|
]
|
|
1583
1585
|
}) });
|
|
1584
1586
|
}
|
|
1585
1587
|
function at({ property: e, allComponents: t }) {
|
|
1586
|
-
const o =
|
|
1588
|
+
const o = ke({ variant: "popper" });
|
|
1587
1589
|
return /* @__PURE__ */ v(F, { children: [
|
|
1588
|
-
/* @__PURE__ */ r(E, { sx: { minWidth: 0 }, ...
|
|
1589
|
-
/* @__PURE__ */ r(
|
|
1590
|
+
/* @__PURE__ */ r(E, { sx: { minWidth: 0 }, ...we(o), children: /* @__PURE__ */ r(Le, { fontSize: "small" }) }),
|
|
1591
|
+
/* @__PURE__ */ r(ir, { ...Ur(o), children: /* @__PURE__ */ r(vr, { onClickAway: o.close, children: /* @__PURE__ */ r(G, { children: /* @__PURE__ */ r(P, {
|
|
1590
1592
|
sx: {
|
|
1591
1593
|
width: 500,
|
|
1592
1594
|
p: 2
|
|
1593
1595
|
},
|
|
1594
|
-
children: /* @__PURE__ */ r(
|
|
1596
|
+
children: /* @__PURE__ */ r(Ie, {
|
|
1595
1597
|
value: e.componentId,
|
|
1596
1598
|
onChange: (l, h) => e.componentId = h,
|
|
1597
1599
|
allComponents: t
|
|
@@ -1608,9 +1610,9 @@ function ct({ value: e, valueImmutable: t, onChange: o, defaultLocale: l, allCom
|
|
|
1608
1610
|
size: "small",
|
|
1609
1611
|
onClick: () => d(!p),
|
|
1610
1612
|
color: p ? "primary" : "default",
|
|
1611
|
-
children: /* @__PURE__ */ r(
|
|
1613
|
+
children: /* @__PURE__ */ r(Le, { fontSize: "small" })
|
|
1612
1614
|
}),
|
|
1613
|
-
p && /* @__PURE__ */ r(
|
|
1615
|
+
p && /* @__PURE__ */ r(tr, { in: p, timeout: "auto", unmountOnExit: !0, sx: { width: "100%", zIndex: 10 }, children: /* @__PURE__ */ v(G, {
|
|
1614
1616
|
elevation: 1,
|
|
1615
1617
|
sx: {
|
|
1616
1618
|
mt: 1,
|
|
@@ -1626,14 +1628,14 @@ function ct({ value: e, valueImmutable: t, onChange: o, defaultLocale: l, allCom
|
|
|
1626
1628
|
width: "100%",
|
|
1627
1629
|
mb: 2
|
|
1628
1630
|
},
|
|
1629
|
-
children: /* @__PURE__ */ r(
|
|
1631
|
+
children: /* @__PURE__ */ r(qe, {
|
|
1630
1632
|
config: c,
|
|
1631
1633
|
currentLocale: m,
|
|
1632
1634
|
defaultLocale: l,
|
|
1633
1635
|
allComponents: h,
|
|
1634
1636
|
propertiesValue: e?.properties,
|
|
1635
1637
|
onChange: ({ id: s, value: a }) => {
|
|
1636
|
-
const i =
|
|
1638
|
+
const i = me(a.value), n = JSON.parse(JSON.stringify(e));
|
|
1637
1639
|
n?.componentId && (t ? o?.({ ...n, properties: { ...n.properties, [s]: { value: i } } }) : (n.properties = n.properties ?? {}, n.properties[s] = { value: i }, o?.(n)));
|
|
1638
1640
|
}
|
|
1639
1641
|
})
|
|
@@ -1643,12 +1645,12 @@ function ct({ value: e, valueImmutable: t, onChange: o, defaultLocale: l, allCom
|
|
|
1643
1645
|
}) })
|
|
1644
1646
|
] }) : null;
|
|
1645
1647
|
}
|
|
1646
|
-
function
|
|
1647
|
-
const { t: l } = V(), { state: { components: h, supportedLocales: p, config: { defaultLocale: d } } } = oe(), b =
|
|
1648
|
-
return /* @__PURE__ */ v(
|
|
1649
|
-
/* @__PURE__ */ r(
|
|
1650
|
-
/* @__PURE__ */ r(
|
|
1651
|
-
/* @__PURE__ */ r(
|
|
1648
|
+
function Ye({ type: e = "properties", component: t, ...o }) {
|
|
1649
|
+
const { t: l } = V(), { state: { components: h, supportedLocales: p, config: { defaultLocale: d } } } = oe(), b = ve(), 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;
|
|
1650
|
+
return /* @__PURE__ */ v(ye, { ...o, fullWidth: !0, maxWidth: "lg", children: [
|
|
1651
|
+
/* @__PURE__ */ r(Re, { children: l("i18nEditorTitle") }),
|
|
1652
|
+
/* @__PURE__ */ r(Ee, { children: c && /* @__PURE__ */ r(k, { children: /* @__PURE__ */ v(Ne, { stickyHeader: !0, sx: { td: { verticalAlign: "top" } }, children: [
|
|
1653
|
+
/* @__PURE__ */ r(je, { children: /* @__PURE__ */ r(re, { children: p.map(({ locale: a, name: i }) => /* @__PURE__ */ r(te, { children: /* @__PURE__ */ v(T, {
|
|
1652
1654
|
sx: {
|
|
1653
1655
|
color: "text.primary"
|
|
1654
1656
|
},
|
|
@@ -1657,7 +1659,7 @@ function Ge({ type: e = "properties", component: t, ...o }) {
|
|
|
1657
1659
|
d === a && /* @__PURE__ */ r(Sr, { sx: { fontSize: 12 } })
|
|
1658
1660
|
]
|
|
1659
1661
|
}) }, a)) }) }),
|
|
1660
|
-
/* @__PURE__ */ r(
|
|
1662
|
+
/* @__PURE__ */ r(ze, { children: D(Object.values(c), "index").map(({ data: a }) => /* @__PURE__ */ r(re, { children: p.map(({ locale: i }) => /* @__PURE__ */ r(te, { children: /* @__PURE__ */ r(k, {
|
|
1661
1663
|
sx: {
|
|
1662
1664
|
gap: 1
|
|
1663
1665
|
},
|
|
@@ -1715,10 +1717,10 @@ function Ge({ type: e = "properties", component: t, ...o }) {
|
|
|
1715
1717
|
}) }) : null
|
|
1716
1718
|
}, a.id) }, i)) }, a.id)) })
|
|
1717
1719
|
] }) }) }),
|
|
1718
|
-
/* @__PURE__ */ r(
|
|
1720
|
+
/* @__PURE__ */ r(Ae, { children: /* @__PURE__ */ r(E, { onClick: (a) => o.onClose?.(a, "escapeKeyDown"), children: l("close") }) })
|
|
1719
1721
|
] });
|
|
1720
1722
|
}
|
|
1721
|
-
const
|
|
1723
|
+
const Oe = (e, t) => (o) => {
|
|
1722
1724
|
const l = [
|
|
1723
1725
|
o.palette.info.main,
|
|
1724
1726
|
o.palette.primary.main,
|
|
@@ -1758,7 +1760,7 @@ function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
|
|
|
1758
1760
|
}
|
|
1759
1761
|
c[i.key] = n;
|
|
1760
1762
|
}), e.type === "array" && !Array.isArray(c) && (c = K(c) ? [] : [c]);
|
|
1761
|
-
const a =
|
|
1763
|
+
const a = xe(c, e.type);
|
|
1762
1764
|
t?.(a);
|
|
1763
1765
|
} catch (c) {
|
|
1764
1766
|
console.error("Error converting structure to text:", c);
|
|
@@ -1772,14 +1774,14 @@ function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
|
|
|
1772
1774
|
width: "100%"
|
|
1773
1775
|
},
|
|
1774
1776
|
children: [
|
|
1775
|
-
/* @__PURE__ */ r(
|
|
1777
|
+
/* @__PURE__ */ r(nr, { sx: { mt: -1 }, children: /* @__PURE__ */ r(T, {
|
|
1776
1778
|
variant: "caption",
|
|
1777
1779
|
sx: {
|
|
1778
1780
|
color: "text.secondary"
|
|
1779
1781
|
},
|
|
1780
1782
|
children: h("maker.properties.subProperties")
|
|
1781
1783
|
}) }),
|
|
1782
|
-
e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ r(
|
|
1784
|
+
e.subProperties && Object.keys(e.subProperties).length > 0 ? /* @__PURE__ */ r($e, {
|
|
1783
1785
|
component: k,
|
|
1784
1786
|
gap: 2,
|
|
1785
1787
|
list: e.subProperties,
|
|
@@ -1792,13 +1794,13 @@ function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
|
|
|
1792
1794
|
p: 1.25,
|
|
1793
1795
|
borderRadius: 1,
|
|
1794
1796
|
border: i ? "1px solid" : "1px dashed",
|
|
1795
|
-
"&":
|
|
1797
|
+
"&": Oe(b)
|
|
1796
1798
|
},
|
|
1797
1799
|
children: /* @__PURE__ */ r(k, {
|
|
1798
1800
|
sx: {
|
|
1799
1801
|
gap: 2
|
|
1800
1802
|
},
|
|
1801
|
-
children: /* @__PURE__ */ r(
|
|
1803
|
+
children: /* @__PURE__ */ r(Ge, {
|
|
1802
1804
|
data: c,
|
|
1803
1805
|
params: a,
|
|
1804
1806
|
visible: i,
|
|
@@ -1831,10 +1833,10 @@ function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
|
|
|
1831
1833
|
variant: "outlined",
|
|
1832
1834
|
className: "ignore-style-override",
|
|
1833
1835
|
size: "small",
|
|
1834
|
-
startIcon: /* @__PURE__ */ r(
|
|
1836
|
+
startIcon: /* @__PURE__ */ r(Be, {}),
|
|
1835
1837
|
onClick: () => {
|
|
1836
1838
|
try {
|
|
1837
|
-
const c = e.subProperties || {}, s =
|
|
1839
|
+
const c = e.subProperties || {}, s = _e(), i = {
|
|
1838
1840
|
index: Object.values(c).length,
|
|
1839
1841
|
data: {
|
|
1840
1842
|
id: s,
|
|
@@ -1863,7 +1865,7 @@ function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
|
|
|
1863
1865
|
}
|
|
1864
1866
|
},
|
|
1865
1867
|
sx: {
|
|
1866
|
-
"&":
|
|
1868
|
+
"&": Oe(b, {
|
|
1867
1869
|
// borderLeft: undefined,
|
|
1868
1870
|
})
|
|
1869
1871
|
},
|
|
@@ -1873,7 +1875,7 @@ function dt({ property: e, onChange: t, defaultLocale: o, allComponents: l }) {
|
|
|
1873
1875
|
});
|
|
1874
1876
|
}
|
|
1875
1877
|
function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h, defaultLocale: p, allComponents: d, ...b }) {
|
|
1876
|
-
const { locale: m } = V(), c =
|
|
1878
|
+
const { locale: m } = V(), c = hr(), s = M(null), a = () => {
|
|
1877
1879
|
const n = c?.current?.getUploader();
|
|
1878
1880
|
n?.open(), s.current && n.onceUploadSuccess(({ response: f }) => {
|
|
1879
1881
|
let g = f?.data?.filename || "";
|
|
@@ -1908,10 +1910,10 @@ function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h
|
|
|
1908
1910
|
}
|
|
1909
1911
|
});
|
|
1910
1912
|
if (t.type === "boolean")
|
|
1911
|
-
return /* @__PURE__ */ r(
|
|
1913
|
+
return /* @__PURE__ */ r(ge, {
|
|
1912
1914
|
label: i,
|
|
1913
1915
|
labelPlacement: "start",
|
|
1914
|
-
control: /* @__PURE__ */ r(
|
|
1916
|
+
control: /* @__PURE__ */ r(Ve, { checked: o === !0, onChange: (n, f) => l?.(f) })
|
|
1915
1917
|
});
|
|
1916
1918
|
if (t.type === "color")
|
|
1917
1919
|
return /* @__PURE__ */ r(Gr, {
|
|
@@ -1943,7 +1945,7 @@ function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h
|
|
|
1943
1945
|
sx: {
|
|
1944
1946
|
width: "100%"
|
|
1945
1947
|
},
|
|
1946
|
-
children: /* @__PURE__ */ r(
|
|
1948
|
+
children: /* @__PURE__ */ r(Ue, {
|
|
1947
1949
|
componentId: n.id,
|
|
1948
1950
|
props: { label: i, value: o, onChange: l },
|
|
1949
1951
|
locale: m,
|
|
@@ -1963,7 +1965,7 @@ function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h
|
|
|
1963
1965
|
gap: 1
|
|
1964
1966
|
},
|
|
1965
1967
|
children: [
|
|
1966
|
-
/* @__PURE__ */ r(
|
|
1968
|
+
/* @__PURE__ */ r(Ie, {
|
|
1967
1969
|
allComponents: d,
|
|
1968
1970
|
label: i,
|
|
1969
1971
|
value: o?.componentId,
|
|
@@ -2005,7 +2007,7 @@ function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h
|
|
|
2005
2007
|
justifyContent: "center"
|
|
2006
2008
|
},
|
|
2007
2009
|
children: [
|
|
2008
|
-
/* @__PURE__ */ r(
|
|
2010
|
+
/* @__PURE__ */ r(Pe, {
|
|
2009
2011
|
onChange: async ({ response: g }) => {
|
|
2010
2012
|
const u = g?.data?.url || g?.data?.fileUrl;
|
|
2011
2013
|
let x;
|
|
@@ -2020,7 +2022,7 @@ function L({ component: e, property: t, value: o, onChange: l, valueImmutable: h
|
|
|
2020
2022
|
});
|
|
2021
2023
|
}
|
|
2022
2024
|
}),
|
|
2023
|
-
/* @__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(
|
|
2025
|
+
/* @__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(Me, { sx: { cursor: "default", mr: 1 }, fontSize: "small" }) })
|
|
2024
2026
|
]
|
|
2025
2027
|
})
|
|
2026
2028
|
} : void 0
|
|
@@ -2074,12 +2076,12 @@ export default function () {
|
|
|
2074
2076
|
}`, mt = `console.log('hello')
|
|
2075
2077
|
`;
|
|
2076
2078
|
function ht({ value: e }) {
|
|
2077
|
-
const { locale: t } = V(), o =
|
|
2079
|
+
const { locale: t } = V(), o = De(), l = Q(e).doc;
|
|
2078
2080
|
return U(() => {
|
|
2079
2081
|
e.renderer?.script || (l.transact(() => {
|
|
2080
2082
|
e.renderer.script = e.renderer.type === "react-component" ? pt : mt;
|
|
2081
2083
|
}), o());
|
|
2082
|
-
}, [e]), /* @__PURE__ */ r(P, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ r(
|
|
2084
|
+
}, [e]), /* @__PURE__ */ r(P, { sx: { border: 1, borderColor: "divider", borderRadius: 1, overflow: "hidden" }, children: /* @__PURE__ */ r(Ce, {
|
|
2083
2085
|
keyId: e.id,
|
|
2084
2086
|
locale: t,
|
|
2085
2087
|
language: "typescript",
|
|
@@ -2092,13 +2094,13 @@ function ht({ value: e }) {
|
|
|
2092
2094
|
}, e.id) });
|
|
2093
2095
|
}
|
|
2094
2096
|
function ft({ value: e }) {
|
|
2095
|
-
const { t } = V(), o = Q(e).doc, { state: { components: l, config: { defaultLocale: h }, resources: p }, localState: { currentLocale: d } } = oe(), b =
|
|
2097
|
+
const { t } = V(), o = Q(e).doc, { state: { components: l, config: { defaultLocale: h }, resources: p }, localState: { currentLocale: d } } = oe(), b = ve(), m = l[e.renderer.componentId]?.data ?? p.components?.[e.renderer.componentId]?.component, c = ke({ variant: "dialog" });
|
|
2096
2098
|
return /* @__PURE__ */ r(le, { children: /* @__PURE__ */ v(k, {
|
|
2097
2099
|
sx: {
|
|
2098
2100
|
gap: 1
|
|
2099
2101
|
},
|
|
2100
2102
|
children: [
|
|
2101
|
-
/* @__PURE__ */ r(
|
|
2103
|
+
/* @__PURE__ */ r(Ie, {
|
|
2102
2104
|
allComponents: b,
|
|
2103
2105
|
excludes: [e.id],
|
|
2104
2106
|
value: e.renderer.componentId,
|
|
@@ -2113,7 +2115,7 @@ function ft({ value: e }) {
|
|
|
2113
2115
|
},
|
|
2114
2116
|
children: [
|
|
2115
2117
|
/* @__PURE__ */ r(T, { variant: "subtitle2", children: t("parameters") }),
|
|
2116
|
-
/* @__PURE__ */ r(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...
|
|
2118
|
+
/* @__PURE__ */ r(E, { sx: { minWidth: 32, minHeight: 32, p: 0 }, ...we(c), children: /* @__PURE__ */ r(Ke, { fontSize: "small" }) })
|
|
2117
2119
|
]
|
|
2118
2120
|
}),
|
|
2119
2121
|
m.properties && D(Object.values(m.properties), "index").map(({ data: s }) => /* @__PURE__ */ r(P, { children: /* @__PURE__ */ r(L, {
|
|
@@ -2131,14 +2133,14 @@ function ft({ value: e }) {
|
|
|
2131
2133
|
});
|
|
2132
2134
|
}
|
|
2133
2135
|
}) }, s.id)),
|
|
2134
|
-
/* @__PURE__ */ r(
|
|
2136
|
+
/* @__PURE__ */ r(Ye, { ...Fe(c), component: e, type: "parameters" })
|
|
2135
2137
|
] })
|
|
2136
2138
|
]
|
|
2137
2139
|
}) });
|
|
2138
2140
|
}
|
|
2139
|
-
function
|
|
2141
|
+
function Ie({ label: e, options: t, excludes: o, value: l, onChange: h, allComponents: p, ...d }) {
|
|
2140
2142
|
const { t: b } = V(), m = t ?? D(Object.values(Tr(p, ...o ?? [])), "index").map((s) => s.data), c = (typeof l == "string" ? p[l]?.data : void 0) ?? null;
|
|
2141
|
-
return /* @__PURE__ */ r(
|
|
2143
|
+
return /* @__PURE__ */ r(Te, {
|
|
2142
2144
|
...d,
|
|
2143
2145
|
size: "small",
|
|
2144
2146
|
options: m,
|
|
@@ -2158,14 +2160,14 @@ function we({ label: e, options: t, excludes: o, value: l, onChange: h, allCompo
|
|
|
2158
2160
|
}
|
|
2159
2161
|
});
|
|
2160
2162
|
}
|
|
2161
|
-
function
|
|
2162
|
-
const { t: b } = V(), [m, c] = B(e?.properties), [s, a] = B(null);
|
|
2163
|
+
function qe({ config: e, allComponents: t, defaultLocale: o, propertiesValue: l, currentLocale: h, onChange: p, props: d }) {
|
|
2164
|
+
const { t: b } = V(), [m, c] = B(me(e?.properties)), [s, a] = B(null);
|
|
2163
2165
|
U(() => {
|
|
2164
2166
|
(() => {
|
|
2165
2167
|
e?.renderer?.type === "react-component" && K(e?.properties) ? br(e?.renderer?.script).then((x) => {
|
|
2166
2168
|
const I = gr(x);
|
|
2167
2169
|
c(I);
|
|
2168
|
-
}) : c(e?.properties);
|
|
2170
|
+
}) : c(me(e?.properties));
|
|
2169
2171
|
})();
|
|
2170
2172
|
}, [JSON.stringify(e)]);
|
|
2171
2173
|
const i = A(() => !e || !m ? {} : Object.values(m).reduce((u, { data: x }) => {
|
|
@@ -2183,7 +2185,7 @@ function Ye({ config: e, allComponents: t, defaultLocale: o, propertiesValue: l,
|
|
|
2183
2185
|
visibleProperties: [],
|
|
2184
2186
|
canUsePropertiesKeys: []
|
|
2185
2187
|
};
|
|
2186
|
-
const u = D(Object.values(m), "index"), x = u.filter(({ data: S }) => S.key &&
|
|
2188
|
+
const u = D(Object.values(m), "index"), x = u.filter(({ data: S }) => S.key && be(m, S.id)), I = u.filter(({ data: S }) => S.key && S.type !== "component"), N = I.map(({ data: S }) => S.key);
|
|
2187
2189
|
return {
|
|
2188
2190
|
canUseProperties: I,
|
|
2189
2191
|
visibleProperties: x,
|
|
@@ -2215,7 +2217,7 @@ function Ye({ config: e, allComponents: t, defaultLocale: o, propertiesValue: l,
|
|
|
2215
2217
|
path: ["properties", u.id],
|
|
2216
2218
|
id: u.id,
|
|
2217
2219
|
value: { value: x },
|
|
2218
|
-
shouldSync:
|
|
2220
|
+
shouldSync: Se(u),
|
|
2219
2221
|
excludeKeys: [],
|
|
2220
2222
|
key: u.key || u.id
|
|
2221
2223
|
});
|
|
@@ -2227,7 +2229,7 @@ function Ye({ config: e, allComponents: t, defaultLocale: o, propertiesValue: l,
|
|
|
2227
2229
|
gap: 2,
|
|
2228
2230
|
width: "100%"
|
|
2229
2231
|
},
|
|
2230
|
-
children: /* @__PURE__ */ r(
|
|
2232
|
+
children: /* @__PURE__ */ r(Ue, {
|
|
2231
2233
|
componentId: e?.id || "",
|
|
2232
2234
|
renderType: "setting",
|
|
2233
2235
|
locale: h,
|
|
@@ -2237,22 +2239,22 @@ function Ye({ config: e, allComponents: t, defaultLocale: o, propertiesValue: l,
|
|
|
2237
2239
|
...Dr(d ?? {}, n.canUsePropertiesKeys),
|
|
2238
2240
|
onChange: (u) => {
|
|
2239
2241
|
const { canUsePropertiesKeys: x } = n;
|
|
2240
|
-
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") &&
|
|
2242
|
+
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") && be(m, g[N]?.id))).reduce((N, S) => N.then(() => {
|
|
2241
2243
|
const w = g[S], j = x.includes(S);
|
|
2242
2244
|
if (w?.id && j)
|
|
2243
2245
|
return p({
|
|
2244
2246
|
path: ["properties", w.id],
|
|
2245
2247
|
id: w.id,
|
|
2246
2248
|
value: { value: u[S] },
|
|
2247
|
-
shouldSync:
|
|
2249
|
+
shouldSync: Se(w),
|
|
2248
2250
|
excludeKeys: [],
|
|
2249
2251
|
key: w.key || w.id
|
|
2250
2252
|
}), Promise.resolve();
|
|
2251
2253
|
const y = `propertyNotFound${S}`;
|
|
2252
2254
|
if (s === y)
|
|
2253
2255
|
return Promise.resolve();
|
|
2254
|
-
|
|
2255
|
-
const C =
|
|
2256
|
+
he.close(s);
|
|
2257
|
+
const C = he.warning(b("maker.properties.propertyNotFound", {
|
|
2256
2258
|
key: S
|
|
2257
2259
|
}), {
|
|
2258
2260
|
key: y
|
|
@@ -2287,11 +2289,11 @@ function bt({ config: e }) {
|
|
|
2287
2289
|
}
|
|
2288
2290
|
export {
|
|
2289
2291
|
ot as BasicInfo,
|
|
2290
|
-
|
|
2292
|
+
Ie as CustomComponentAutocomplete,
|
|
2291
2293
|
on as CustomComponentSettings,
|
|
2292
2294
|
pt as DefaultReactComponentScriptTemplate,
|
|
2293
2295
|
mt as DefaultWebComponentScriptTemplate,
|
|
2294
|
-
|
|
2296
|
+
qe as ParametersConfig,
|
|
2295
2297
|
st as PropertiesConfig,
|
|
2296
2298
|
L as PropertyValueField
|
|
2297
2299
|
};
|