@blocklet/pages-kit-inner-components 0.6.72 → 0.6.73
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/add-component.js +12 -12
- package/lib/cjs/chunks/{draft-data-DfZ81oCU.js → draft-data-1hI-ev3X.js} +1 -1
- package/lib/cjs/chunks/{home-CP3WKJ_e.js → home-ymdnbwRQ.js} +2 -2
- package/lib/cjs/chunks/{index-BqynZDZ3.js → index-BAiZumV7.js} +1 -1
- package/lib/cjs/chunks/{publish-button-t3lAZwFy.js → publish-button-45a3egG-.js} +1 -1
- package/lib/cjs/chunks/{site-state-BRYYpS9Q.js → site-state-CcYU6tKv.js} +1 -1
- package/lib/cjs/chunks/state-BAjDjwwp.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/locales.js +2 -2
- 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 +274 -242
- package/lib/es/chunks/{draft-data-BtzZ0_tq.js → draft-data--WtLtXxy.js} +1 -1
- package/lib/es/chunks/{home-DBOWtpCK.js → home-BIH-BNIG.js} +3 -3
- package/lib/es/chunks/{index-CjNVgrdz.js → index-Cj977HLf.js} +1 -1
- package/lib/es/chunks/{publish-button-CFzWcpJ3.js → publish-button-Dn3ikSo5.js} +3 -3
- package/lib/es/chunks/{site-state-DYm1fKT3.js → site-state-BXM-5tZw.js} +5 -1
- package/lib/es/chunks/state-DS2djQbR.js +873 -0
- package/lib/es/home.js +3 -3
- package/lib/es/locales.js +20 -4
- package/lib/es/resources.js +1 -1
- package/lib/es/setting.js +829 -799
- package/lib/es/site-state.js +1 -1
- package/package.json +3 -3
- package/lib/cjs/chunks/state-BP5DoD6I.js +0 -1
- package/lib/es/chunks/state-Biqa_a5U.js +0 -685
package/lib/es/add-component.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { i as
|
|
1
|
+
import { jsx as o, jsxs as w } from "react/jsx-runtime";
|
|
2
|
+
import { i as D, a as G, h as J, j as Z, k as ee, l as oe, m as te, f as re } from "./chunks/state-DS2djQbR.js";
|
|
3
3
|
import $ from "@arcblock/ux/lib/Empty";
|
|
4
|
-
import { useLocaleContext as
|
|
4
|
+
import { useLocaleContext as F } from "@arcblock/ux/lib/Locale/context";
|
|
5
5
|
import { Icon as L } from "@iconify-icon/react";
|
|
6
|
-
import
|
|
7
|
-
import { Box as n, styled as
|
|
8
|
-
import { useReactive as
|
|
9
|
-
import { createContext as
|
|
10
|
-
import {
|
|
11
|
-
import { styled as
|
|
6
|
+
import ie from "@mui/icons-material/Check";
|
|
7
|
+
import { Box as n, styled as H, alpha as ne, Stack as ae, Dialog as se, DialogTitle as le, TextField as pe, IconButton as ce, DialogContent as de, Tabs as me, Tab as ue, Grid as O, Card as fe, CardMedia as be, CardContent as ge, Typography as W, DialogActions as xe, Button as N, Skeleton as he } from "@mui/material";
|
|
8
|
+
import { useReactive as Q } from "ahooks";
|
|
9
|
+
import { createContext as _, useMemo as P, useEffect as M, useRef as E } from "react";
|
|
10
|
+
import { a as ye, R as ve, B as V, c as Ce, T as ke, I as we } from "./chunks/index-Cj977HLf.js";
|
|
11
|
+
import { styled as g } from "@arcblock/ux/lib/Theme";
|
|
12
12
|
import "@blocklet/pages-kit/builtin/color-picker";
|
|
13
13
|
import "@blocklet/pages-kit/utils/style";
|
|
14
14
|
import "@emotion/css";
|
|
15
15
|
import "lodash/without";
|
|
16
|
-
import { red as
|
|
16
|
+
import { red as Ie, pink as Te, purple as Re, indigo as Se, blue as ze, cyan as Ee, teal as Pe, green as Me, lime as _e, yellow as Ae, amber as Le, orange as Oe, brown as Ne, grey as je, blueGrey as Be } from "@mui/material/colors";
|
|
17
17
|
import "@blocklet/pages-kit/builtin/uploader";
|
|
18
18
|
import "react-use";
|
|
19
19
|
import "lodash/cloneDeep";
|
|
@@ -30,12 +30,12 @@ import "is-uri";
|
|
|
30
30
|
import "@arcblock/ux/lib/Toast";
|
|
31
31
|
import "@mui/material/Tooltip";
|
|
32
32
|
import "@mui/icons-material/KeyboardArrowLeft";
|
|
33
|
-
import
|
|
33
|
+
import De from "@mui/material/Box";
|
|
34
34
|
import "@mui/material/DialogTitle";
|
|
35
35
|
import "@mui/material/IconButton";
|
|
36
36
|
import "@mui/material/Dialog";
|
|
37
37
|
import "@mui/material/useMediaQuery";
|
|
38
|
-
import { css as
|
|
38
|
+
import { css as Ge } from "@emotion/react";
|
|
39
39
|
import "@mui/material/Alert";
|
|
40
40
|
import "@mui/material/AlertTitle";
|
|
41
41
|
import "react-error-boundary";
|
|
@@ -44,15 +44,15 @@ import "lodash/isEmpty";
|
|
|
44
44
|
import "yaml";
|
|
45
45
|
import "@mui/material/Typography";
|
|
46
46
|
import "joi";
|
|
47
|
-
import { createStatusApi as
|
|
48
|
-
import { createFetch as
|
|
47
|
+
import { createStatusApi as U, createTextCompletionApi as $e } from "@blocklet/aigne-hub/api";
|
|
48
|
+
import { createFetch as Fe } from "@blocklet/js-sdk";
|
|
49
49
|
import "@mui/x-date-pickers";
|
|
50
50
|
import "@mui/x-date-pickers/AdapterDayjs";
|
|
51
51
|
import "@mui/x-date-pickers/LocalizationProvider";
|
|
52
52
|
import "circular-natal-horoscope-js/dist";
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
53
|
+
import X from "dayjs";
|
|
54
|
+
import He from "dayjs/plugin/timezone";
|
|
55
|
+
import We from "dayjs/plugin/utc";
|
|
56
56
|
import "fast-deep-equal";
|
|
57
57
|
import "lodash/isNil";
|
|
58
58
|
import "tz-lookup";
|
|
@@ -60,14 +60,14 @@ import "@mui/icons-material/CheckCircleOutline";
|
|
|
60
60
|
import "lodash/uniq";
|
|
61
61
|
import "lodash/get";
|
|
62
62
|
import "lodash/set";
|
|
63
|
-
import { nextId as
|
|
64
|
-
import { CustomComponentRenderer as
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
63
|
+
import { nextId as Y } from "@blocklet/pages-kit/utils/common";
|
|
64
|
+
import { CustomComponentRenderer as Qe } from "@blocklet/pages-kit/components";
|
|
65
|
+
Ie[300], Te[300], Re[300], // deepPurple['300'],
|
|
66
|
+
Se[300], ze[300], // lightBlue['300'],
|
|
67
|
+
Ee[300], Pe[300], Me[300], // lightGreen['300'],
|
|
68
|
+
_e[300], Ae[300], Le[300], Oe[300], // deepOrange['300'],
|
|
69
|
+
Ne[300], je[300], Be[300];
|
|
70
|
+
g(n)`
|
|
71
71
|
.color-item {
|
|
72
72
|
position: relative;
|
|
73
73
|
}
|
|
@@ -88,7 +88,7 @@ m(n)`
|
|
|
88
88
|
right: 0;
|
|
89
89
|
}
|
|
90
90
|
`;
|
|
91
|
-
|
|
91
|
+
H(n)(({ theme: e }) => ({
|
|
92
92
|
display: "flex",
|
|
93
93
|
alignItems: "center",
|
|
94
94
|
padding: "8px",
|
|
@@ -174,7 +174,7 @@ F(n)(({ theme: e }) => ({
|
|
|
174
174
|
padding: e.spacing(0.5),
|
|
175
175
|
opacity: 0,
|
|
176
176
|
transition: "opacity 0.2s ease",
|
|
177
|
-
backgroundColor:
|
|
177
|
+
backgroundColor: ne(e.palette.background.paper, 0.8),
|
|
178
178
|
backdropFilter: "blur(2px)",
|
|
179
179
|
borderRadius: e.spacing(0.5),
|
|
180
180
|
margin: `auto ${e.spacing(0.5)}`,
|
|
@@ -205,7 +205,7 @@ F(n)(({ theme: e }) => ({
|
|
|
205
205
|
opacity: 0.7
|
|
206
206
|
}
|
|
207
207
|
}));
|
|
208
|
-
|
|
208
|
+
H(n)`
|
|
209
209
|
position: relative;
|
|
210
210
|
border: 1px solid #c0c0c0;
|
|
211
211
|
min-height: 40px;
|
|
@@ -230,23 +230,23 @@ F(n)`
|
|
|
230
230
|
transform: translateY(-50%);
|
|
231
231
|
}
|
|
232
232
|
`;
|
|
233
|
-
const
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
axios:
|
|
233
|
+
const Ve = _({ embed: !1 }), { Provider: ct } = Ve;
|
|
234
|
+
_(void 0);
|
|
235
|
+
U({
|
|
236
|
+
axios: D,
|
|
237
237
|
path: "/api/ai/status"
|
|
238
238
|
});
|
|
239
|
-
|
|
240
|
-
axios:
|
|
239
|
+
U({
|
|
240
|
+
axios: D,
|
|
241
241
|
path: "/api/ai/agent-status"
|
|
242
242
|
});
|
|
243
|
-
|
|
244
|
-
fetch:
|
|
243
|
+
$e({
|
|
244
|
+
fetch: Fe(),
|
|
245
245
|
path: "/api/ai/completions"
|
|
246
246
|
});
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
247
|
+
X.extend(We);
|
|
248
|
+
X.extend(He);
|
|
249
|
+
g(n)`
|
|
250
250
|
flex-grow: 1;
|
|
251
251
|
display: flex;
|
|
252
252
|
flex-direction: column;
|
|
@@ -350,8 +350,8 @@ m(n)`
|
|
|
350
350
|
}
|
|
351
351
|
}
|
|
352
352
|
`;
|
|
353
|
-
|
|
354
|
-
|
|
353
|
+
_({});
|
|
354
|
+
g(n)`
|
|
355
355
|
display: flex;
|
|
356
356
|
flex-direction: column;
|
|
357
357
|
flex: 1;
|
|
@@ -364,7 +364,7 @@ m(n)`
|
|
|
364
364
|
}
|
|
365
365
|
}
|
|
366
366
|
`;
|
|
367
|
-
|
|
367
|
+
g(n)`
|
|
368
368
|
background: #fbfbfb;
|
|
369
369
|
border: 1px solid #f6f6f6;
|
|
370
370
|
border-radius: 4px;
|
|
@@ -386,7 +386,7 @@ m(n)`
|
|
|
386
386
|
cursor: pointer;
|
|
387
387
|
}
|
|
388
388
|
`;
|
|
389
|
-
|
|
389
|
+
g(De)`
|
|
390
390
|
background: #f6f2ff;
|
|
391
391
|
margin-bottom: 20px;
|
|
392
392
|
|
|
@@ -407,7 +407,7 @@ m(Le)`
|
|
|
407
407
|
margin-top: 4px;
|
|
408
408
|
}
|
|
409
409
|
`;
|
|
410
|
-
|
|
410
|
+
g(n)`
|
|
411
411
|
display: block;
|
|
412
412
|
padding: 16px;
|
|
413
413
|
text-decoration: none;
|
|
@@ -438,12 +438,12 @@ m(n)`
|
|
|
438
438
|
overflow: hidden;
|
|
439
439
|
}
|
|
440
440
|
`;
|
|
441
|
-
|
|
441
|
+
Ge`
|
|
442
442
|
.MuiMenu-root {
|
|
443
443
|
z-index: 13010 !important;
|
|
444
444
|
}
|
|
445
445
|
`;
|
|
446
|
-
|
|
446
|
+
g(n)`
|
|
447
447
|
display: flex;
|
|
448
448
|
flex-direction: column;
|
|
449
449
|
flex: 1;
|
|
@@ -456,7 +456,7 @@ m(n)`
|
|
|
456
456
|
}
|
|
457
457
|
}
|
|
458
458
|
`;
|
|
459
|
-
|
|
459
|
+
g(n)`
|
|
460
460
|
background: #fbfbfb;
|
|
461
461
|
border: 1px solid #f6f6f6;
|
|
462
462
|
border-radius: 4px;
|
|
@@ -480,7 +480,7 @@ m(n)`
|
|
|
480
480
|
cursor: pointer;
|
|
481
481
|
}
|
|
482
482
|
`;
|
|
483
|
-
|
|
483
|
+
g(n)`
|
|
484
484
|
> .ai-button {
|
|
485
485
|
display: none;
|
|
486
486
|
z-index: 1;
|
|
@@ -499,7 +499,7 @@ m(n)`
|
|
|
499
499
|
}
|
|
500
500
|
}
|
|
501
501
|
`;
|
|
502
|
-
|
|
502
|
+
g(n)`
|
|
503
503
|
> .language-button {
|
|
504
504
|
display: none;
|
|
505
505
|
z-index: 1;
|
|
@@ -518,7 +518,7 @@ m(n)`
|
|
|
518
518
|
}
|
|
519
519
|
}
|
|
520
520
|
`;
|
|
521
|
-
|
|
521
|
+
g(n)`
|
|
522
522
|
position: relative;
|
|
523
523
|
|
|
524
524
|
.action {
|
|
@@ -542,8 +542,8 @@ m(n)`
|
|
|
542
542
|
}
|
|
543
543
|
}
|
|
544
544
|
`;
|
|
545
|
-
|
|
546
|
-
const
|
|
545
|
+
Y();
|
|
546
|
+
const Ue = {
|
|
547
547
|
type: "default",
|
|
548
548
|
title: "Section CardList",
|
|
549
549
|
description: "This is Section CardList",
|
|
@@ -558,67 +558,99 @@ const He = {
|
|
|
558
558
|
padding: "normal",
|
|
559
559
|
list: [
|
|
560
560
|
{
|
|
561
|
-
id:
|
|
561
|
+
id: Y(),
|
|
562
562
|
title: "Simplified Service Delivery",
|
|
563
563
|
description: "Block Server's Service Gateway makes networking easy with access to load balancing, SSL termination, automatic and customizable URL mapping, and redirects.",
|
|
564
564
|
image: "https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png"
|
|
565
565
|
}
|
|
566
566
|
]
|
|
567
567
|
};
|
|
568
|
-
function
|
|
568
|
+
function Xe({
|
|
569
569
|
componentId: e,
|
|
570
|
-
locale:
|
|
571
|
-
components:
|
|
570
|
+
locale: c,
|
|
571
|
+
components: d
|
|
572
572
|
}) {
|
|
573
573
|
const {
|
|
574
574
|
state: {
|
|
575
|
-
config: { defaultLocale:
|
|
575
|
+
config: { defaultLocale: l }
|
|
576
576
|
},
|
|
577
|
-
localState: { customComponentPreviewerProperties:
|
|
578
|
-
} = G(), i =
|
|
579
|
-
|
|
580
|
-
|
|
577
|
+
localState: { customComponentPreviewerProperties: v }
|
|
578
|
+
} = G(), i = J(), x = d || i, u = x?.[e], p = u?.data ?? (u && typeof u == "object" && "component" in u ? u.component : void 0), f = p?.renderer;
|
|
579
|
+
if (f?.type === "component-template" && p) {
|
|
580
|
+
const b = Z(p, f), a = c || l || "en", t = ee();
|
|
581
|
+
return /* @__PURE__ */ o(ye, { page: b, defaultLocale: l, currentLocale: a, children: /* @__PURE__ */ o(ve, { children: /* @__PURE__ */ o(ae, { spacing: 2, sx: { p: 1 }, children: b.sectionIds.map((h, y) => {
|
|
582
|
+
const m = b.sections[h];
|
|
583
|
+
if (!m || m.visibility === "hidden")
|
|
584
|
+
return null;
|
|
585
|
+
const S = b.dataSource?.[m.id]?.[a] ?? (l ? b.dataSource?.[m.id]?.[l] : void 0) ?? {}, C = m.properties ?? {};
|
|
586
|
+
return /* @__PURE__ */ o(
|
|
587
|
+
V,
|
|
588
|
+
{
|
|
589
|
+
id: m.id,
|
|
590
|
+
type: m.component,
|
|
591
|
+
section: m,
|
|
592
|
+
config: {
|
|
593
|
+
...C,
|
|
594
|
+
...S,
|
|
595
|
+
locale: a,
|
|
596
|
+
editing: !0,
|
|
597
|
+
dev: {
|
|
598
|
+
mode: "draft",
|
|
599
|
+
defaultLocale: l,
|
|
600
|
+
components: x,
|
|
601
|
+
projectId: t
|
|
602
|
+
}
|
|
603
|
+
},
|
|
604
|
+
page: b,
|
|
605
|
+
renderIndex: y
|
|
606
|
+
},
|
|
607
|
+
m.id
|
|
608
|
+
);
|
|
609
|
+
}) }) }) });
|
|
610
|
+
}
|
|
611
|
+
return /* @__PURE__ */ o(
|
|
612
|
+
Qe,
|
|
581
613
|
{
|
|
582
614
|
componentId: e,
|
|
583
|
-
locale:
|
|
615
|
+
locale: c,
|
|
584
616
|
dev: {
|
|
585
617
|
mode: "draft",
|
|
586
|
-
components:
|
|
587
|
-
defaultLocale:
|
|
618
|
+
components: x,
|
|
619
|
+
defaultLocale: l
|
|
588
620
|
},
|
|
589
|
-
properties:
|
|
621
|
+
properties: v?.[e] ?? {}
|
|
590
622
|
}
|
|
591
623
|
);
|
|
592
624
|
}
|
|
593
|
-
const
|
|
594
|
-
id:
|
|
595
|
-
component:
|
|
596
|
-
name:
|
|
597
|
-
properties:
|
|
598
|
-
previewImage:
|
|
599
|
-
type:
|
|
600
|
-
blockletId:
|
|
601
|
-
blockletTitle:
|
|
602
|
-
})) : [],
|
|
625
|
+
const j = 260, Ye = 5, K = "IGNORE_RENDER_BLOCKLET_TITLE", B = (e, c) => e ? Object.entries(e).map(([d, l]) => ({
|
|
626
|
+
id: d,
|
|
627
|
+
component: d,
|
|
628
|
+
name: l?.data?.name || l?.component?.name || d,
|
|
629
|
+
properties: l?.data || l.component,
|
|
630
|
+
previewImage: l?.data?.previewImage || null,
|
|
631
|
+
type: c,
|
|
632
|
+
blockletId: l?.blockletId,
|
|
633
|
+
blockletTitle: l?.blockletTitle
|
|
634
|
+
})) : [], Ke = [
|
|
603
635
|
{
|
|
604
636
|
id: "section",
|
|
605
637
|
name: "Section",
|
|
606
|
-
properties:
|
|
638
|
+
properties: Ce
|
|
607
639
|
},
|
|
608
640
|
{
|
|
609
641
|
id: "section-card-list",
|
|
610
642
|
name: "Section Card List",
|
|
611
|
-
properties:
|
|
643
|
+
properties: Ue
|
|
612
644
|
},
|
|
613
645
|
{
|
|
614
646
|
id: "toc",
|
|
615
647
|
name: "Toc",
|
|
616
|
-
properties:
|
|
648
|
+
properties: ke
|
|
617
649
|
},
|
|
618
650
|
{
|
|
619
651
|
id: "iframe",
|
|
620
652
|
name: "Embed",
|
|
621
|
-
properties:
|
|
653
|
+
properties: we
|
|
622
654
|
},
|
|
623
655
|
{
|
|
624
656
|
id: "layout-block",
|
|
@@ -626,75 +658,75 @@ const B = 260, We = 5, Y = "IGNORE_RENDER_BLOCKLET_TITLE", D = (e, p) => e ? Obj
|
|
|
626
658
|
properties: {}
|
|
627
659
|
}
|
|
628
660
|
].map((e) => ({ ...e, type: "basic", component: e.id }));
|
|
629
|
-
function
|
|
661
|
+
function dt({
|
|
630
662
|
state: e,
|
|
631
|
-
open:
|
|
632
|
-
onClose:
|
|
633
|
-
onSelect:
|
|
634
|
-
defaultTab:
|
|
663
|
+
open: c,
|
|
664
|
+
onClose: d,
|
|
665
|
+
onSelect: l,
|
|
666
|
+
defaultTab: v,
|
|
635
667
|
title: i,
|
|
636
|
-
componentGroups:
|
|
637
|
-
components:
|
|
638
|
-
multiple:
|
|
639
|
-
defaultSelected:
|
|
640
|
-
emptyText:
|
|
668
|
+
componentGroups: x,
|
|
669
|
+
components: u,
|
|
670
|
+
multiple: p = !1,
|
|
671
|
+
defaultSelected: f,
|
|
672
|
+
emptyText: b
|
|
641
673
|
}) {
|
|
642
|
-
const { t:
|
|
674
|
+
const { t: a } = F(), t = Q({
|
|
643
675
|
selectedComponent: null,
|
|
644
|
-
activeTab:
|
|
676
|
+
activeTab: v,
|
|
645
677
|
searchQuery: ""
|
|
646
|
-
}),
|
|
678
|
+
}), h = P(() => x || [
|
|
647
679
|
{
|
|
648
680
|
name: "basic",
|
|
649
|
-
label:
|
|
650
|
-
components:
|
|
681
|
+
label: a("maker.components.basicGroup"),
|
|
682
|
+
components: Ke
|
|
651
683
|
},
|
|
652
684
|
e && {
|
|
653
685
|
name: "custom",
|
|
654
|
-
label:
|
|
655
|
-
components:
|
|
686
|
+
label: a("maker.components.customGroup"),
|
|
687
|
+
components: B(oe(e), "custom")
|
|
656
688
|
},
|
|
657
689
|
e && {
|
|
658
690
|
name: "resource",
|
|
659
|
-
label:
|
|
660
|
-
components:
|
|
691
|
+
label: a("maker.components.resourceGroup"),
|
|
692
|
+
components: B(te(e), "resource")
|
|
661
693
|
}
|
|
662
|
-
].filter(Boolean), [
|
|
663
|
-
|
|
664
|
-
},
|
|
665
|
-
if (
|
|
666
|
-
if (C(
|
|
667
|
-
|
|
694
|
+
].filter(Boolean), [x, a, e, c]), y = t.activeTab || h[0]?.name, m = () => {
|
|
695
|
+
t.selectedComponent && (l(t.selectedComponent), d());
|
|
696
|
+
}, S = (r) => {
|
|
697
|
+
if (r) {
|
|
698
|
+
if (C(r)) {
|
|
699
|
+
p ? t.selectedComponent = t.selectedComponent.filter((s) => s.id !== r.id) : t.selectedComponent = null;
|
|
668
700
|
return;
|
|
669
701
|
}
|
|
670
|
-
if (
|
|
671
|
-
const
|
|
672
|
-
|
|
702
|
+
if (p) {
|
|
703
|
+
const s = Array.isArray(t.selectedComponent) ? t.selectedComponent : [], k = s.some((z) => z.id === r.id);
|
|
704
|
+
t.selectedComponent = k ? s.filter((z) => z.id !== r.id) : [...s, r];
|
|
673
705
|
} else
|
|
674
|
-
|
|
706
|
+
t.selectedComponent = r;
|
|
675
707
|
}
|
|
676
|
-
}, C = (
|
|
677
|
-
const
|
|
678
|
-
return
|
|
679
|
-
}, [
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
}, [
|
|
683
|
-
const
|
|
684
|
-
(
|
|
685
|
-
const
|
|
686
|
-
return
|
|
708
|
+
}, C = (r) => t.selectedComponent ? p ? t.selectedComponent.some((s) => s.id === r.id) : t.selectedComponent.id === r.id : !1, I = h?.length === 0, T = P(() => {
|
|
709
|
+
const r = h.find((s) => s?.name === y)?.components || [];
|
|
710
|
+
return t.searchQuery ? r.filter((s) => s.name.toLowerCase().includes(t.searchQuery.toLowerCase())) : r;
|
|
711
|
+
}, [y, h, t.searchQuery]);
|
|
712
|
+
M(() => {
|
|
713
|
+
t.searchQuery = "", c && f ? t.selectedComponent = p ? Array.isArray(f) ? f : [f] : f : t.selectedComponent = null;
|
|
714
|
+
}, [c, f, p]);
|
|
715
|
+
const R = T?.length === 0, A = b || a(y === "resource" ? "maker.components.needAddResource" : "maker.components.noComponents"), q = P(() => T ? T.reduce(
|
|
716
|
+
(r, s) => {
|
|
717
|
+
const k = s.blockletId || K, z = s.blockletTitle || a("maker.components.defaultGroup");
|
|
718
|
+
return r[k] || (r[k] = {
|
|
687
719
|
title: z,
|
|
688
720
|
components: []
|
|
689
|
-
}),
|
|
721
|
+
}), r[k].components.push(s), r;
|
|
690
722
|
},
|
|
691
723
|
{}
|
|
692
|
-
) : {}, [
|
|
693
|
-
return /* @__PURE__ */
|
|
694
|
-
|
|
724
|
+
) : {}, [T]);
|
|
725
|
+
return /* @__PURE__ */ w(
|
|
726
|
+
se,
|
|
695
727
|
{
|
|
696
|
-
open:
|
|
697
|
-
onClose:
|
|
728
|
+
open: c,
|
|
729
|
+
onClose: d,
|
|
698
730
|
maxWidth: "lg",
|
|
699
731
|
fullWidth: !0,
|
|
700
732
|
slotProps: {
|
|
@@ -708,19 +740,19 @@ function at({
|
|
|
708
740
|
}
|
|
709
741
|
},
|
|
710
742
|
children: [
|
|
711
|
-
/* @__PURE__ */
|
|
712
|
-
/* @__PURE__ */
|
|
713
|
-
/* @__PURE__ */
|
|
714
|
-
|
|
743
|
+
/* @__PURE__ */ w(le, { className: "between", sx: { display: "flex", gap: 2 }, children: [
|
|
744
|
+
/* @__PURE__ */ o(n, { children: i || a("maker.components.addComponent") }),
|
|
745
|
+
/* @__PURE__ */ o(
|
|
746
|
+
pe,
|
|
715
747
|
{
|
|
716
748
|
size: "small",
|
|
717
|
-
placeholder:
|
|
718
|
-
value:
|
|
719
|
-
onChange: (
|
|
749
|
+
placeholder: a("maker.components.searchComponent"),
|
|
750
|
+
value: t.searchQuery,
|
|
751
|
+
onChange: (r) => t.searchQuery = r.target.value,
|
|
720
752
|
sx: { flex: 1, maxWidth: 350 },
|
|
721
753
|
slotProps: {
|
|
722
754
|
input: {
|
|
723
|
-
startAdornment: /* @__PURE__ */
|
|
755
|
+
startAdornment: /* @__PURE__ */ o(
|
|
724
756
|
L,
|
|
725
757
|
{
|
|
726
758
|
icon: "tabler:search",
|
|
@@ -733,10 +765,10 @@ function at({
|
|
|
733
765
|
}
|
|
734
766
|
}
|
|
735
767
|
),
|
|
736
|
-
/* @__PURE__ */
|
|
768
|
+
/* @__PURE__ */ o(ce, { size: "small", onClick: d, children: /* @__PURE__ */ o(n, { component: L, icon: "tabler:x", sx: { color: "text.primary" } }) })
|
|
737
769
|
] }),
|
|
738
|
-
/* @__PURE__ */
|
|
739
|
-
|
|
770
|
+
/* @__PURE__ */ w(
|
|
771
|
+
de,
|
|
740
772
|
{
|
|
741
773
|
sx: {
|
|
742
774
|
display: "flex",
|
|
@@ -746,12 +778,12 @@ function at({
|
|
|
746
778
|
overflow: "hidden"
|
|
747
779
|
},
|
|
748
780
|
children: [
|
|
749
|
-
!
|
|
750
|
-
|
|
781
|
+
!I && /* @__PURE__ */ o(n, { sx: { width: 150, borderRight: 1, borderColor: "divider" }, children: /* @__PURE__ */ o(
|
|
782
|
+
me,
|
|
751
783
|
{
|
|
752
784
|
orientation: "vertical",
|
|
753
|
-
value:
|
|
754
|
-
onChange: (
|
|
785
|
+
value: y,
|
|
786
|
+
onChange: (r, s) => t.activeTab = s,
|
|
755
787
|
sx: {
|
|
756
788
|
"& .MuiTab-root": {
|
|
757
789
|
alignItems: "flex-start",
|
|
@@ -761,10 +793,10 @@ function at({
|
|
|
761
793
|
px: 2
|
|
762
794
|
}
|
|
763
795
|
},
|
|
764
|
-
children:
|
|
796
|
+
children: h.map((r, s) => /* @__PURE__ */ o(ue, { label: r?.label, value: r?.name }, s))
|
|
765
797
|
}
|
|
766
798
|
) }),
|
|
767
|
-
/* @__PURE__ */
|
|
799
|
+
/* @__PURE__ */ o(
|
|
768
800
|
n,
|
|
769
801
|
{
|
|
770
802
|
sx: {
|
|
@@ -773,32 +805,32 @@ function at({
|
|
|
773
805
|
overflowY: "auto",
|
|
774
806
|
pr: 1
|
|
775
807
|
},
|
|
776
|
-
children:
|
|
777
|
-
|
|
808
|
+
children: R ? /* @__PURE__ */ o($, { children: A }) : /* @__PURE__ */ o(
|
|
809
|
+
Je,
|
|
778
810
|
{
|
|
779
|
-
wrapperComponent:
|
|
811
|
+
wrapperComponent: O,
|
|
780
812
|
wrapperComponentProps: {
|
|
781
813
|
container: !0,
|
|
782
814
|
spacing: 2,
|
|
783
|
-
sx:
|
|
815
|
+
sx: R ? {
|
|
784
816
|
height: "100%"
|
|
785
817
|
} : {}
|
|
786
818
|
},
|
|
787
|
-
groups:
|
|
788
|
-
emptyText:
|
|
789
|
-
renderItem: (
|
|
790
|
-
const
|
|
791
|
-
return /* @__PURE__ */
|
|
792
|
-
|
|
819
|
+
groups: q,
|
|
820
|
+
emptyText: A,
|
|
821
|
+
renderItem: (r) => {
|
|
822
|
+
const s = C(r);
|
|
823
|
+
return /* @__PURE__ */ o(
|
|
824
|
+
O,
|
|
793
825
|
{
|
|
794
826
|
sx: {
|
|
795
827
|
width: "100%",
|
|
796
828
|
"& .add-component-card": {
|
|
797
829
|
boxShadow: "none",
|
|
798
830
|
border: 1,
|
|
799
|
-
borderColor:
|
|
831
|
+
borderColor: s ? "primary.main" : "grey.200",
|
|
800
832
|
"& .check-container": {
|
|
801
|
-
display:
|
|
833
|
+
display: s ? "flex" : "none",
|
|
802
834
|
position: "absolute",
|
|
803
835
|
right: 0,
|
|
804
836
|
bottom: 0,
|
|
@@ -817,8 +849,8 @@ function at({
|
|
|
817
849
|
height: 0,
|
|
818
850
|
borderTop: "transparent solid 15px",
|
|
819
851
|
borderLeft: "transparent solid 15px",
|
|
820
|
-
borderBottom: (
|
|
821
|
-
borderRight: (
|
|
852
|
+
borderBottom: (k) => `solid 15px ${k.palette.primary.main}`,
|
|
853
|
+
borderRight: (k) => `solid 15px ${k.palette.primary.main}`,
|
|
822
854
|
transition: "all 0.1s ease",
|
|
823
855
|
content: '""'
|
|
824
856
|
},
|
|
@@ -837,8 +869,8 @@ function at({
|
|
|
837
869
|
md: 6,
|
|
838
870
|
lg: 4
|
|
839
871
|
},
|
|
840
|
-
children: /* @__PURE__ */
|
|
841
|
-
|
|
872
|
+
children: /* @__PURE__ */ w(
|
|
873
|
+
fe,
|
|
842
874
|
{
|
|
843
875
|
className: "add-component-card",
|
|
844
876
|
sx: {
|
|
@@ -846,37 +878,37 @@ function at({
|
|
|
846
878
|
width: "100%",
|
|
847
879
|
cursor: "pointer"
|
|
848
880
|
},
|
|
849
|
-
onClick: () =>
|
|
881
|
+
onClick: () => S(r),
|
|
850
882
|
children: [
|
|
851
|
-
/* @__PURE__ */
|
|
852
|
-
|
|
883
|
+
/* @__PURE__ */ o(
|
|
884
|
+
be,
|
|
853
885
|
{
|
|
854
886
|
sx: {
|
|
855
887
|
width: "100%",
|
|
856
|
-
height:
|
|
888
|
+
height: j,
|
|
857
889
|
overflow: "auto",
|
|
858
890
|
position: "relative"
|
|
859
891
|
},
|
|
860
|
-
children: /* @__PURE__ */
|
|
861
|
-
|
|
892
|
+
children: /* @__PURE__ */ o(
|
|
893
|
+
qe,
|
|
862
894
|
{
|
|
863
|
-
components:
|
|
864
|
-
containerHeight:
|
|
865
|
-
component:
|
|
895
|
+
components: u,
|
|
896
|
+
containerHeight: j,
|
|
897
|
+
component: r
|
|
866
898
|
},
|
|
867
|
-
|
|
899
|
+
r.id
|
|
868
900
|
)
|
|
869
901
|
}
|
|
870
902
|
),
|
|
871
|
-
/* @__PURE__ */
|
|
872
|
-
|
|
903
|
+
/* @__PURE__ */ o(
|
|
904
|
+
ge,
|
|
873
905
|
{
|
|
874
906
|
sx: {
|
|
875
907
|
bgcolor: "background.paper",
|
|
876
908
|
borderTop: 1,
|
|
877
|
-
borderColor:
|
|
909
|
+
borderColor: s ? "primary.main" : "grey.200"
|
|
878
910
|
},
|
|
879
|
-
children: /* @__PURE__ */
|
|
911
|
+
children: /* @__PURE__ */ o(
|
|
880
912
|
W,
|
|
881
913
|
{
|
|
882
914
|
variant: "body1",
|
|
@@ -884,17 +916,17 @@ function at({
|
|
|
884
916
|
sx: {
|
|
885
917
|
fontWeight: "bold"
|
|
886
918
|
},
|
|
887
|
-
children:
|
|
919
|
+
children: r.name
|
|
888
920
|
}
|
|
889
921
|
)
|
|
890
922
|
}
|
|
891
923
|
),
|
|
892
|
-
/* @__PURE__ */
|
|
924
|
+
/* @__PURE__ */ o(n, { className: "check-container", children: /* @__PURE__ */ o(ie, { className: "check-icon" }) })
|
|
893
925
|
]
|
|
894
926
|
}
|
|
895
927
|
)
|
|
896
928
|
},
|
|
897
|
-
|
|
929
|
+
r.id
|
|
898
930
|
);
|
|
899
931
|
}
|
|
900
932
|
}
|
|
@@ -904,8 +936,8 @@ function at({
|
|
|
904
936
|
]
|
|
905
937
|
}
|
|
906
938
|
),
|
|
907
|
-
/* @__PURE__ */
|
|
908
|
-
|
|
939
|
+
/* @__PURE__ */ w(
|
|
940
|
+
xe,
|
|
909
941
|
{
|
|
910
942
|
sx: {
|
|
911
943
|
borderTop: 1,
|
|
@@ -913,14 +945,14 @@ function at({
|
|
|
913
945
|
p: 2
|
|
914
946
|
},
|
|
915
947
|
children: [
|
|
916
|
-
/* @__PURE__ */
|
|
917
|
-
/* @__PURE__ */
|
|
948
|
+
/* @__PURE__ */ o(N, { onClick: d, variant: "outlined", children: a("common.cancel") }),
|
|
949
|
+
/* @__PURE__ */ o(
|
|
918
950
|
N,
|
|
919
951
|
{
|
|
920
|
-
onClick:
|
|
952
|
+
onClick: m,
|
|
921
953
|
variant: "contained",
|
|
922
|
-
disabled: !
|
|
923
|
-
children:
|
|
954
|
+
disabled: !t.selectedComponent || p && Array.isArray(t.selectedComponent) && t.selectedComponent.length === 0,
|
|
955
|
+
children: p && Array.isArray(t.selectedComponent) && t.selectedComponent.length > 0 ? a("common.addMultiple", { count: t.selectedComponent.length }) : a("common.add")
|
|
924
956
|
}
|
|
925
957
|
)
|
|
926
958
|
]
|
|
@@ -930,22 +962,22 @@ function at({
|
|
|
930
962
|
}
|
|
931
963
|
);
|
|
932
964
|
}
|
|
933
|
-
function
|
|
965
|
+
function qe({
|
|
934
966
|
containerHeight: e,
|
|
935
|
-
component:
|
|
936
|
-
minScale:
|
|
937
|
-
components:
|
|
967
|
+
component: c,
|
|
968
|
+
minScale: d = 0.1,
|
|
969
|
+
components: l
|
|
938
970
|
}) {
|
|
939
|
-
const { locale:
|
|
971
|
+
const { locale: v } = F(), i = Q({
|
|
940
972
|
scale: 1,
|
|
941
973
|
shouldScroll: !1,
|
|
942
974
|
isVisible: !1,
|
|
943
975
|
hadInit: !1
|
|
944
|
-
}), { currentPage:
|
|
945
|
-
|
|
976
|
+
}), { currentPage: x } = G(), u = E(null), p = E(null), f = E(0), b = E(null);
|
|
977
|
+
M(() => {
|
|
946
978
|
const C = new IntersectionObserver(
|
|
947
|
-
([
|
|
948
|
-
i.isVisible =
|
|
979
|
+
([I]) => {
|
|
980
|
+
i.isVisible = I.isIntersecting;
|
|
949
981
|
},
|
|
950
982
|
{
|
|
951
983
|
root: null,
|
|
@@ -953,34 +985,34 @@ function Qe({
|
|
|
953
985
|
threshold: 0
|
|
954
986
|
}
|
|
955
987
|
);
|
|
956
|
-
return
|
|
957
|
-
}, []),
|
|
988
|
+
return p.current && C.observe(p.current), () => C.disconnect();
|
|
989
|
+
}, []), M(() => {
|
|
958
990
|
const C = () => {
|
|
959
|
-
if (
|
|
960
|
-
|
|
991
|
+
if (f.current += 1, f.current > Ye) {
|
|
992
|
+
I.disconnect();
|
|
961
993
|
return;
|
|
962
994
|
}
|
|
963
|
-
if (!
|
|
964
|
-
const
|
|
965
|
-
|
|
995
|
+
if (!c.previewImage && u.current) {
|
|
996
|
+
const T = u.current.scrollHeight, R = e / T;
|
|
997
|
+
R < d ? (i.scale = d, i.shouldScroll = !0) : R < 1 ? (i.scale = R, i.shouldScroll = !1) : (i.scale = 1, i.shouldScroll = !1);
|
|
966
998
|
}
|
|
967
|
-
|
|
999
|
+
b.current && clearTimeout(b.current), b.current = setTimeout(() => {
|
|
968
1000
|
i.hadInit = !0;
|
|
969
1001
|
}, 200);
|
|
970
|
-
},
|
|
1002
|
+
}, I = new ResizeObserver(() => {
|
|
971
1003
|
setTimeout(C, 20);
|
|
972
1004
|
});
|
|
973
|
-
return
|
|
974
|
-
|
|
1005
|
+
return u.current && i.isVisible && I.observe(u.current), () => {
|
|
1006
|
+
I.disconnect();
|
|
975
1007
|
};
|
|
976
|
-
}, [e,
|
|
977
|
-
const { id:
|
|
1008
|
+
}, [e, d, i.isVisible, c]);
|
|
1009
|
+
const { id: a, type: t, component: h, properties: y, previewImage: m } = c, S = P(() => i.isVisible ? m ? /* @__PURE__ */ o(
|
|
978
1010
|
n,
|
|
979
1011
|
{
|
|
980
1012
|
component: "img",
|
|
981
1013
|
loading: "lazy",
|
|
982
|
-
src:
|
|
983
|
-
alt:
|
|
1014
|
+
src: re(m),
|
|
1015
|
+
alt: c.name,
|
|
984
1016
|
sx: {
|
|
985
1017
|
width: "100%",
|
|
986
1018
|
height: "100%",
|
|
@@ -989,29 +1021,29 @@ function Qe({
|
|
|
989
1021
|
cursor: "pointer"
|
|
990
1022
|
}
|
|
991
1023
|
},
|
|
992
|
-
|
|
993
|
-
) :
|
|
994
|
-
|
|
1024
|
+
a
|
|
1025
|
+
) : t === "basic" ? /* @__PURE__ */ o(
|
|
1026
|
+
V,
|
|
995
1027
|
{
|
|
996
|
-
id:
|
|
997
|
-
type:
|
|
998
|
-
section:
|
|
1028
|
+
id: a,
|
|
1029
|
+
type: h,
|
|
1030
|
+
section: y,
|
|
999
1031
|
config: {
|
|
1000
|
-
...
|
|
1001
|
-
locale:
|
|
1032
|
+
...y,
|
|
1033
|
+
locale: v,
|
|
1002
1034
|
editing: !1,
|
|
1003
1035
|
dev: {
|
|
1004
1036
|
mode: "draft"
|
|
1005
1037
|
}
|
|
1006
1038
|
},
|
|
1007
|
-
page:
|
|
1039
|
+
page: x
|
|
1008
1040
|
},
|
|
1009
|
-
|
|
1010
|
-
) : /* @__PURE__ */
|
|
1011
|
-
return /* @__PURE__ */
|
|
1041
|
+
a
|
|
1042
|
+
) : /* @__PURE__ */ o(Xe, { componentId: a, locale: v, components: l }, a) : null, [a, t, h, y, v, m, i.isVisible]);
|
|
1043
|
+
return /* @__PURE__ */ o(
|
|
1012
1044
|
n,
|
|
1013
1045
|
{
|
|
1014
|
-
ref:
|
|
1046
|
+
ref: p,
|
|
1015
1047
|
sx: {
|
|
1016
1048
|
position: "relative",
|
|
1017
1049
|
width: "100%",
|
|
@@ -1020,7 +1052,7 @@ function Qe({
|
|
|
1020
1052
|
overflowY: i.shouldScroll ? "auto" : "hidden",
|
|
1021
1053
|
transition: "all 0.3s ease"
|
|
1022
1054
|
},
|
|
1023
|
-
children: /* @__PURE__ */
|
|
1055
|
+
children: /* @__PURE__ */ w(
|
|
1024
1056
|
n,
|
|
1025
1057
|
{
|
|
1026
1058
|
sx: {
|
|
@@ -1030,18 +1062,18 @@ function Qe({
|
|
|
1030
1062
|
height: i.hadInit && i.shouldScroll ? "100%" : `${100 / i.scale}%`
|
|
1031
1063
|
},
|
|
1032
1064
|
children: [
|
|
1033
|
-
!i.hadInit && /* @__PURE__ */
|
|
1034
|
-
/* @__PURE__ */
|
|
1065
|
+
!i.hadInit && /* @__PURE__ */ o(he, { variant: "rectangular", width: "100%", height: "100%" }),
|
|
1066
|
+
/* @__PURE__ */ o(
|
|
1035
1067
|
n,
|
|
1036
1068
|
{
|
|
1037
|
-
ref:
|
|
1069
|
+
ref: u,
|
|
1038
1070
|
sx: {
|
|
1039
1071
|
width: "100%",
|
|
1040
|
-
height:
|
|
1072
|
+
height: m ? "100%" : "auto",
|
|
1041
1073
|
pointerEvents: "none",
|
|
1042
1074
|
opacity: i.hadInit ? 1 : 0
|
|
1043
1075
|
},
|
|
1044
|
-
children:
|
|
1076
|
+
children: S
|
|
1045
1077
|
}
|
|
1046
1078
|
)
|
|
1047
1079
|
]
|
|
@@ -1050,25 +1082,25 @@ function Qe({
|
|
|
1050
1082
|
}
|
|
1051
1083
|
);
|
|
1052
1084
|
}
|
|
1053
|
-
function
|
|
1085
|
+
function Je({
|
|
1054
1086
|
groups: e,
|
|
1055
|
-
emptyText:
|
|
1056
|
-
renderItem:
|
|
1057
|
-
wrapperComponent:
|
|
1058
|
-
wrapperComponentProps:
|
|
1087
|
+
emptyText: c,
|
|
1088
|
+
renderItem: d,
|
|
1089
|
+
wrapperComponent: l = n,
|
|
1090
|
+
wrapperComponentProps: v = {
|
|
1059
1091
|
display: "inline-flex",
|
|
1060
1092
|
flexWrap: "wrap",
|
|
1061
1093
|
gap: 1
|
|
1062
1094
|
}
|
|
1063
1095
|
}) {
|
|
1064
|
-
return /* @__PURE__ */
|
|
1096
|
+
return /* @__PURE__ */ o(n, { children: Object.keys(e).length > 0 ? Object.entries(e).map(([i, { title: x, components: u }]) => /* @__PURE__ */ w(
|
|
1065
1097
|
n,
|
|
1066
1098
|
{
|
|
1067
1099
|
sx: {
|
|
1068
1100
|
mb: 3
|
|
1069
1101
|
},
|
|
1070
1102
|
children: [
|
|
1071
|
-
i !==
|
|
1103
|
+
i !== K && /* @__PURE__ */ w(
|
|
1072
1104
|
W,
|
|
1073
1105
|
{
|
|
1074
1106
|
className: "blocklet-title",
|
|
@@ -1082,7 +1114,7 @@ function Ue({
|
|
|
1082
1114
|
gap: 1
|
|
1083
1115
|
},
|
|
1084
1116
|
children: [
|
|
1085
|
-
/* @__PURE__ */
|
|
1117
|
+
/* @__PURE__ */ o(
|
|
1086
1118
|
n,
|
|
1087
1119
|
{
|
|
1088
1120
|
component: "span",
|
|
@@ -1095,21 +1127,21 @@ function Ue({
|
|
|
1095
1127
|
}
|
|
1096
1128
|
}
|
|
1097
1129
|
),
|
|
1098
|
-
|
|
1130
|
+
x
|
|
1099
1131
|
]
|
|
1100
1132
|
}
|
|
1101
1133
|
),
|
|
1102
|
-
/* @__PURE__ */
|
|
1134
|
+
/* @__PURE__ */ o(l, { ...v, children: u.map((p) => d(p)) })
|
|
1103
1135
|
]
|
|
1104
1136
|
},
|
|
1105
1137
|
i
|
|
1106
|
-
)) : /* @__PURE__ */
|
|
1138
|
+
)) : /* @__PURE__ */ o($, { children: c }) });
|
|
1107
1139
|
}
|
|
1108
1140
|
export {
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1141
|
+
dt as AddComponent,
|
|
1142
|
+
qe as AutoScaledComponentRenderer,
|
|
1143
|
+
Ke as BASIC_COMPONENT_LIST,
|
|
1144
|
+
Je as GroupedComponentsList,
|
|
1145
|
+
dt as default,
|
|
1146
|
+
B as formatComponent
|
|
1115
1147
|
};
|