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

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.
@@ -1,19 +1,19 @@
1
- import { jsx as r, jsxs as y } from "react/jsx-runtime";
2
- import { i as j, a as G, h as q, j as J, k as Z, f as ee } from "./chunks/state-Biqa_a5U.js";
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 H } from "@arcblock/ux/lib/Locale/context";
4
+ import { useLocaleContext as F } from "@arcblock/ux/lib/Locale/context";
5
5
  import { Icon as L } from "@iconify-icon/react";
6
- import oe from "@mui/icons-material/Check";
7
- import { Box as n, styled as F, alpha as te, Dialog as re, DialogTitle as ie, TextField as ne, IconButton as ae, DialogContent as se, Tabs as le, Tab as pe, Grid as P, Card as de, CardMedia as ce, CardContent as me, Typography as W, DialogActions as ue, Button as N, Skeleton as fe } from "@mui/material";
8
- import { useReactive as V } from "ahooks";
9
- import { createContext as A, useMemo as M, useEffect as E, useRef as S } from "react";
10
- import { c as be, T as ge, I as xe, B as he } from "./chunks/index-CjNVgrdz.js";
11
- import { styled as m } from "@arcblock/ux/lib/Theme";
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 ye, pink as Ce, purple as ve, indigo as ke, blue as we, cyan as Ie, teal as Te, green as Re, lime as ze, yellow as Se, amber as Me, orange as _e, brown as Ee, grey as Ae, blueGrey as Oe } from "@mui/material/colors";
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 Le from "@mui/material/Box";
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 Pe } from "@emotion/react";
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 Q, createTextCompletionApi as Ne } from "@blocklet/aigne-hub/api";
48
- import { createFetch as Be } from "@blocklet/js-sdk";
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 U from "dayjs";
54
- import De from "dayjs/plugin/timezone";
55
- import je from "dayjs/plugin/utc";
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 X } from "@blocklet/pages-kit/utils/common";
64
- import { CustomComponentRenderer as Ge } from "@blocklet/pages-kit/components";
65
- ye[300], Ce[300], ve[300], // deepPurple['300'],
66
- ke[300], we[300], // lightBlue['300'],
67
- Ie[300], Te[300], Re[300], // lightGreen['300'],
68
- ze[300], Se[300], Me[300], _e[300], // deepOrange['300'],
69
- Ee[300], Ae[300], Oe[300];
70
- m(n)`
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
- F(n)(({ theme: e }) => ({
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: te(e.palette.background.paper, 0.8),
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
- F(n)`
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 $e = A({ embed: !1 }), { Provider: nt } = $e;
234
- A(void 0);
235
- Q({
236
- axios: j,
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
- Q({
240
- axios: j,
239
+ U({
240
+ axios: D,
241
241
  path: "/api/ai/agent-status"
242
242
  });
243
- Ne({
244
- fetch: Be(),
243
+ $e({
244
+ fetch: Fe(),
245
245
  path: "/api/ai/completions"
246
246
  });
247
- U.extend(je);
248
- U.extend(De);
249
- m(n)`
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
- A({});
354
- m(n)`
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
- m(n)`
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
- m(Le)`
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
- m(n)`
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
- Pe`
441
+ Ge`
442
442
  .MuiMenu-root {
443
443
  z-index: 13010 !important;
444
444
  }
445
445
  `;
446
- m(n)`
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
- m(n)`
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
- m(n)`
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
- m(n)`
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
- m(n)`
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
- X();
546
- const He = {
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: X(),
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 Fe({
568
+ function Xe({
569
569
  componentId: e,
570
- locale: p,
571
- components: l
570
+ locale: c,
571
+ components: d
572
572
  }) {
573
573
  const {
574
574
  state: {
575
- config: { defaultLocale: d }
575
+ config: { defaultLocale: l }
576
576
  },
577
- localState: { customComponentPreviewerProperties: u }
578
- } = G(), i = q();
579
- return /* @__PURE__ */ r(
580
- Ge,
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: p,
615
+ locale: c,
584
616
  dev: {
585
617
  mode: "draft",
586
- components: l || i,
587
- defaultLocale: d
618
+ components: x,
619
+ defaultLocale: l
588
620
  },
589
- properties: u?.[e] ?? {}
621
+ properties: v?.[e] ?? {}
590
622
  }
591
623
  );
592
624
  }
593
- const B = 260, We = 5, Y = "IGNORE_RENDER_BLOCKLET_TITLE", D = (e, p) => e ? Object.entries(e).map(([l, d]) => ({
594
- id: l,
595
- component: l,
596
- name: d?.data?.name || d?.component?.name || l,
597
- properties: d?.data || d.component,
598
- previewImage: d?.data?.previewImage || null,
599
- type: p,
600
- blockletId: d?.blockletId,
601
- blockletTitle: d?.blockletTitle
602
- })) : [], Ve = [
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: be
638
+ properties: Ce
607
639
  },
608
640
  {
609
641
  id: "section-card-list",
610
642
  name: "Section Card List",
611
- properties: He
643
+ properties: Ue
612
644
  },
613
645
  {
614
646
  id: "toc",
615
647
  name: "Toc",
616
- properties: ge
648
+ properties: ke
617
649
  },
618
650
  {
619
651
  id: "iframe",
620
652
  name: "Embed",
621
- properties: xe
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 at({
661
+ function dt({
630
662
  state: e,
631
- open: p,
632
- onClose: l,
633
- onSelect: d,
634
- defaultTab: u,
663
+ open: c,
664
+ onClose: d,
665
+ onSelect: l,
666
+ defaultTab: v,
635
667
  title: i,
636
- componentGroups: k,
637
- components: f,
638
- multiple: c = !1,
639
- defaultSelected: b,
640
- emptyText: R
668
+ componentGroups: x,
669
+ components: u,
670
+ multiple: p = !1,
671
+ defaultSelected: f,
672
+ emptyText: b
641
673
  }) {
642
- const { t: s } = H(), o = V({
674
+ const { t: a } = F(), t = Q({
643
675
  selectedComponent: null,
644
- activeTab: u,
676
+ activeTab: v,
645
677
  searchQuery: ""
646
- }), x = M(() => k || [
678
+ }), h = P(() => x || [
647
679
  {
648
680
  name: "basic",
649
- label: s("maker.components.basicGroup"),
650
- components: Ve
681
+ label: a("maker.components.basicGroup"),
682
+ components: Ke
651
683
  },
652
684
  e && {
653
685
  name: "custom",
654
- label: s("maker.components.customGroup"),
655
- components: D(J(e), "custom")
686
+ label: a("maker.components.customGroup"),
687
+ components: B(oe(e), "custom")
656
688
  },
657
689
  e && {
658
690
  name: "resource",
659
- label: s("maker.components.resourceGroup"),
660
- components: D(Z(e), "resource")
691
+ label: a("maker.components.resourceGroup"),
692
+ components: B(te(e), "resource")
661
693
  }
662
- ].filter(Boolean), [k, s, e, p]), h = o.activeTab || x[0]?.name, w = () => {
663
- o.selectedComponent && (d(o.selectedComponent), l());
664
- }, _ = (t) => {
665
- if (t) {
666
- if (C(t)) {
667
- c ? o.selectedComponent = o.selectedComponent.filter((a) => a.id !== t.id) : o.selectedComponent = null;
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 (c) {
671
- const a = Array.isArray(o.selectedComponent) ? o.selectedComponent : [], g = a.some((z) => z.id === t.id);
672
- o.selectedComponent = g ? a.filter((z) => z.id !== t.id) : [...a, t];
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
- o.selectedComponent = t;
706
+ t.selectedComponent = r;
675
707
  }
676
- }, C = (t) => o.selectedComponent ? c ? o.selectedComponent.some((a) => a.id === t.id) : o.selectedComponent.id === t.id : !1, v = x?.length === 0, I = M(() => {
677
- const t = x.find((a) => a?.name === h)?.components || [];
678
- return o.searchQuery ? t.filter((a) => a.name.toLowerCase().includes(o.searchQuery.toLowerCase())) : t;
679
- }, [h, x, o.searchQuery]);
680
- E(() => {
681
- o.searchQuery = "", p && b ? o.selectedComponent = c ? Array.isArray(b) ? b : [b] : b : o.selectedComponent = null;
682
- }, [p, b, c]);
683
- const T = I?.length === 0, O = R || s(h === "resource" ? "maker.components.needAddResource" : "maker.components.noComponents"), K = M(() => I ? I.reduce(
684
- (t, a) => {
685
- const g = a.blockletId || Y, z = a.blockletTitle || s("maker.components.defaultGroup");
686
- return t[g] || (t[g] = {
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
- }), t[g].components.push(a), t;
721
+ }), r[k].components.push(s), r;
690
722
  },
691
723
  {}
692
- ) : {}, [I]);
693
- return /* @__PURE__ */ y(
694
- re,
724
+ ) : {}, [T]);
725
+ return /* @__PURE__ */ w(
726
+ se,
695
727
  {
696
- open: p,
697
- onClose: l,
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__ */ y(ie, { className: "between", sx: { display: "flex", gap: 2 }, children: [
712
- /* @__PURE__ */ r(n, { children: i || s("maker.components.addComponent") }),
713
- /* @__PURE__ */ r(
714
- ne,
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: s("maker.components.searchComponent"),
718
- value: o.searchQuery,
719
- onChange: (t) => o.searchQuery = t.target.value,
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__ */ r(
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__ */ r(ae, { size: "small", onClick: l, children: /* @__PURE__ */ r(n, { component: L, icon: "tabler:x", sx: { color: "text.primary" } }) })
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__ */ y(
739
- se,
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
- !v && /* @__PURE__ */ r(n, { sx: { width: 150, borderRight: 1, borderColor: "divider" }, children: /* @__PURE__ */ r(
750
- le,
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: h,
754
- onChange: (t, a) => o.activeTab = a,
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: x.map((t, a) => /* @__PURE__ */ r(pe, { label: t?.label, value: t?.name }, a))
796
+ children: h.map((r, s) => /* @__PURE__ */ o(ue, { label: r?.label, value: r?.name }, s))
765
797
  }
766
798
  ) }),
767
- /* @__PURE__ */ r(
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: T ? /* @__PURE__ */ r($, { children: O }) : /* @__PURE__ */ r(
777
- Ue,
808
+ children: R ? /* @__PURE__ */ o($, { children: A }) : /* @__PURE__ */ o(
809
+ Je,
778
810
  {
779
- wrapperComponent: P,
811
+ wrapperComponent: O,
780
812
  wrapperComponentProps: {
781
813
  container: !0,
782
814
  spacing: 2,
783
- sx: T ? {
815
+ sx: R ? {
784
816
  height: "100%"
785
817
  } : {}
786
818
  },
787
- groups: K,
788
- emptyText: O,
789
- renderItem: (t) => {
790
- const a = C(t);
791
- return /* @__PURE__ */ r(
792
- P,
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: a ? "primary.main" : "grey.200",
831
+ borderColor: s ? "primary.main" : "grey.200",
800
832
  "& .check-container": {
801
- display: a ? "flex" : "none",
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: (g) => `solid 15px ${g.palette.primary.main}`,
821
- borderRight: (g) => `solid 15px ${g.palette.primary.main}`,
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__ */ y(
841
- de,
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: () => _(t),
881
+ onClick: () => S(r),
850
882
  children: [
851
- /* @__PURE__ */ r(
852
- ce,
883
+ /* @__PURE__ */ o(
884
+ be,
853
885
  {
854
886
  sx: {
855
887
  width: "100%",
856
- height: B,
888
+ height: j,
857
889
  overflow: "auto",
858
890
  position: "relative"
859
891
  },
860
- children: /* @__PURE__ */ r(
861
- Qe,
892
+ children: /* @__PURE__ */ o(
893
+ qe,
862
894
  {
863
- components: f,
864
- containerHeight: B,
865
- component: t
895
+ components: u,
896
+ containerHeight: j,
897
+ component: r
866
898
  },
867
- t.id
899
+ r.id
868
900
  )
869
901
  }
870
902
  ),
871
- /* @__PURE__ */ r(
872
- me,
903
+ /* @__PURE__ */ o(
904
+ ge,
873
905
  {
874
906
  sx: {
875
907
  bgcolor: "background.paper",
876
908
  borderTop: 1,
877
- borderColor: a ? "primary.main" : "grey.200"
909
+ borderColor: s ? "primary.main" : "grey.200"
878
910
  },
879
- children: /* @__PURE__ */ r(
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: t.name
919
+ children: r.name
888
920
  }
889
921
  )
890
922
  }
891
923
  ),
892
- /* @__PURE__ */ r(n, { className: "check-container", children: /* @__PURE__ */ r(oe, { className: "check-icon" }) })
924
+ /* @__PURE__ */ o(n, { className: "check-container", children: /* @__PURE__ */ o(ie, { className: "check-icon" }) })
893
925
  ]
894
926
  }
895
927
  )
896
928
  },
897
- t.id
929
+ r.id
898
930
  );
899
931
  }
900
932
  }
@@ -904,8 +936,8 @@ function at({
904
936
  ]
905
937
  }
906
938
  ),
907
- /* @__PURE__ */ y(
908
- ue,
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__ */ r(N, { onClick: l, variant: "outlined", children: s("common.cancel") }),
917
- /* @__PURE__ */ r(
948
+ /* @__PURE__ */ o(N, { onClick: d, variant: "outlined", children: a("common.cancel") }),
949
+ /* @__PURE__ */ o(
918
950
  N,
919
951
  {
920
- onClick: w,
952
+ onClick: m,
921
953
  variant: "contained",
922
- disabled: !o.selectedComponent || c && Array.isArray(o.selectedComponent) && o.selectedComponent.length === 0,
923
- children: c && Array.isArray(o.selectedComponent) && o.selectedComponent.length > 0 ? s("common.addMultiple", { count: o.selectedComponent.length }) : s("common.add")
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 Qe({
965
+ function qe({
934
966
  containerHeight: e,
935
- component: p,
936
- minScale: l = 0.1,
937
- components: d
967
+ component: c,
968
+ minScale: d = 0.1,
969
+ components: l
938
970
  }) {
939
- const { locale: u } = H(), i = V({
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: k } = G(), f = S(null), c = S(null), b = S(0), R = S(null);
945
- E(() => {
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
- ([v]) => {
948
- i.isVisible = v.isIntersecting;
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 c.current && C.observe(c.current), () => C.disconnect();
957
- }, []), E(() => {
988
+ return p.current && C.observe(p.current), () => C.disconnect();
989
+ }, []), M(() => {
958
990
  const C = () => {
959
- if (b.current += 1, b.current > We) {
960
- v.disconnect();
991
+ if (f.current += 1, f.current > Ye) {
992
+ I.disconnect();
961
993
  return;
962
994
  }
963
- if (!p.previewImage && f.current) {
964
- const I = f.current.scrollHeight, T = e / I;
965
- T < l ? (i.scale = l, i.shouldScroll = !0) : T < 1 ? (i.scale = T, i.shouldScroll = !1) : (i.scale = 1, i.shouldScroll = !1);
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
- R.current && clearTimeout(R.current), R.current = setTimeout(() => {
999
+ b.current && clearTimeout(b.current), b.current = setTimeout(() => {
968
1000
  i.hadInit = !0;
969
1001
  }, 200);
970
- }, v = new ResizeObserver(() => {
1002
+ }, I = new ResizeObserver(() => {
971
1003
  setTimeout(C, 20);
972
1004
  });
973
- return f.current && i.isVisible && v.observe(f.current), () => {
974
- v.disconnect();
1005
+ return u.current && i.isVisible && I.observe(u.current), () => {
1006
+ I.disconnect();
975
1007
  };
976
- }, [e, l, i.isVisible, p]);
977
- const { id: s, type: o, component: x, properties: h, previewImage: w } = p, _ = M(() => i.isVisible ? w ? /* @__PURE__ */ r(
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: ee(w),
983
- alt: p.name,
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
- s
993
- ) : o === "basic" ? /* @__PURE__ */ r(
994
- he,
1024
+ a
1025
+ ) : t === "basic" ? /* @__PURE__ */ o(
1026
+ V,
995
1027
  {
996
- id: s,
997
- type: x,
998
- section: h,
1028
+ id: a,
1029
+ type: h,
1030
+ section: y,
999
1031
  config: {
1000
- ...h,
1001
- locale: u,
1032
+ ...y,
1033
+ locale: v,
1002
1034
  editing: !1,
1003
1035
  dev: {
1004
1036
  mode: "draft"
1005
1037
  }
1006
1038
  },
1007
- page: k
1039
+ page: x
1008
1040
  },
1009
- s
1010
- ) : /* @__PURE__ */ r(Fe, { componentId: s, locale: u, components: d }, s) : null, [s, o, x, h, u, w, i.isVisible]);
1011
- return /* @__PURE__ */ r(
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: c,
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__ */ y(
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__ */ r(fe, { variant: "rectangular", width: "100%", height: "100%" }),
1034
- /* @__PURE__ */ r(
1065
+ !i.hadInit && /* @__PURE__ */ o(he, { variant: "rectangular", width: "100%", height: "100%" }),
1066
+ /* @__PURE__ */ o(
1035
1067
  n,
1036
1068
  {
1037
- ref: f,
1069
+ ref: u,
1038
1070
  sx: {
1039
1071
  width: "100%",
1040
- height: w ? "100%" : "auto",
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 Ue({
1085
+ function Je({
1054
1086
  groups: e,
1055
- emptyText: p,
1056
- renderItem: l,
1057
- wrapperComponent: d = n,
1058
- wrapperComponentProps: u = {
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__ */ r(n, { children: Object.keys(e).length > 0 ? Object.entries(e).map(([i, { title: k, components: f }]) => /* @__PURE__ */ y(
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 !== Y && /* @__PURE__ */ y(
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__ */ r(
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
- k
1130
+ x
1099
1131
  ]
1100
1132
  }
1101
1133
  ),
1102
- /* @__PURE__ */ r(d, { ...u, children: f.map((c) => l(c)) })
1134
+ /* @__PURE__ */ o(l, { ...v, children: u.map((p) => d(p)) })
1103
1135
  ]
1104
1136
  },
1105
1137
  i
1106
- )) : /* @__PURE__ */ r($, { children: p }) });
1138
+ )) : /* @__PURE__ */ o($, { children: c }) });
1107
1139
  }
1108
1140
  export {
1109
- at as AddComponent,
1110
- Qe as AutoScaledComponentRenderer,
1111
- Ve as BASIC_COMPONENT_LIST,
1112
- Ue as GroupedComponentsList,
1113
- at as default,
1114
- D as formatComponent
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
  };