@blocklet/pages-kit-inner-components 0.6.51 → 0.6.52

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,24 +1,26 @@
1
- import { jsx as t, jsxs as y } from "react/jsx-runtime";
2
- import { i as G, a as j, h as J, j as Z, k as ee, f as oe } from "./chunks/state-DRjnlQY_.js";
3
- import W from "@arcblock/ux/lib/Empty";
4
- import { useLocaleContext as F } from "@arcblock/ux/lib/Locale/context";
5
- import { Icon as P } from "@iconify-icon/react";
6
- import te from "@mui/icons-material/Check";
7
- import { Box as n, styled as H, Dialog as re, DialogTitle as ie, TextField as ne, IconButton as ae, DialogContent as se, Tabs as le, Tab as pe, Grid as N, Card as de, CardMedia as ce, CardContent as me, Typography as V, DialogActions as ue, Button as $, Skeleton as fe } from "@mui/material";
8
- import { useReactive as Q } from "ahooks";
9
- import { createContext as L, useMemo as M, useEffect as A, useRef as S } from "react";
10
- import { c as be, T as he, I as ge, B as xe } from "./chunks/index-NQgjITtC.js";
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-DdT-7UdS.js";
3
+ import $ from "@arcblock/ux/lib/Empty";
4
+ import { useLocaleContext as H } from "@arcblock/ux/lib/Locale/context";
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-ni6tn8EL.js";
11
11
  import { styled as m } 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 ve, purple as Ce, indigo as we, blue as ke, cyan as Te, teal as Ie, green as ze, lime as Re, yellow as Se, amber as Me, orange as _e, brown as Ee, grey as Ae, blueGrey as Le } from "@mui/material/colors";
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";
17
17
  import "@blocklet/pages-kit/builtin/uploader";
18
18
  import "react-use";
19
19
  import "lodash/cloneDeep";
20
+ import "@dnd-kit/core";
21
+ import "@dnd-kit/sortable";
20
22
  import "@mui/icons-material";
21
- import "react-dnd";
23
+ import "@dnd-kit/utilities";
22
24
  import "@mui/lab";
23
25
  import "immer";
24
26
  import "lodash/omit";
@@ -28,7 +30,7 @@ import "is-uri";
28
30
  import "@arcblock/ux/lib/Toast";
29
31
  import "@mui/material/Tooltip";
30
32
  import "@mui/icons-material/KeyboardArrowLeft";
31
- import Oe from "@mui/material/Box";
33
+ import Le from "@mui/material/Box";
32
34
  import "@mui/material/DialogTitle";
33
35
  import "@mui/material/IconButton";
34
36
  import "@mui/material/Dialog";
@@ -42,15 +44,15 @@ import "lodash/isEmpty";
42
44
  import "yaml";
43
45
  import "@mui/material/Typography";
44
46
  import "joi";
45
- import { createStatusApi as U, createTextCompletionApi as Ne } from "@blocklet/aigne-hub/api";
46
- import { createFetch as $e } from "@blocklet/js-sdk";
47
+ import { createStatusApi as Q, createTextCompletionApi as Ne } from "@blocklet/aigne-hub/api";
48
+ import { createFetch as Be } from "@blocklet/js-sdk";
47
49
  import "@mui/x-date-pickers";
48
50
  import "@mui/x-date-pickers/AdapterDayjs";
49
51
  import "@mui/x-date-pickers/LocalizationProvider";
50
52
  import "circular-natal-horoscope-js/dist";
51
- import X from "dayjs";
53
+ import U from "dayjs";
52
54
  import De from "dayjs/plugin/timezone";
53
- import Be from "dayjs/plugin/utc";
55
+ import je from "dayjs/plugin/utc";
54
56
  import "fast-deep-equal";
55
57
  import "lodash/isNil";
56
58
  import "tz-lookup";
@@ -58,13 +60,13 @@ import "@mui/icons-material/CheckCircleOutline";
58
60
  import "lodash/uniq";
59
61
  import "lodash/get";
60
62
  import "lodash/set";
61
- import { nextId as Y } from "@blocklet/pages-kit/utils/common";
63
+ import { nextId as X } from "@blocklet/pages-kit/utils/common";
62
64
  import { CustomComponentRenderer as Ge } from "@blocklet/pages-kit/components";
63
- ye[300], ve[300], Ce[300], // deepPurple['300'],
64
- we[300], ke[300], // lightBlue['300'],
65
- Te[300], Ie[300], ze[300], // lightGreen['300'],
66
- Re[300], Se[300], Me[300], _e[300], // deepOrange['300'],
67
- Ee[300], Ae[300], Le[300];
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];
68
70
  m(n)`
69
71
  .color-item {
70
72
  position: relative;
@@ -86,100 +88,124 @@ m(n)`
86
88
  right: 0;
87
89
  }
88
90
  `;
89
- const E = 0.5;
90
- H(n)`
91
- display: flex;
92
- align-items: center;
93
- padding: 8px;
94
- border-bottom: ${({ theme: i }) => `1px solid ${i.palette.divider}`};
95
- user-select: none;
96
- cursor: pointer;
97
- position: relative;
98
-
99
- :hover {
100
- background-color: rgba(200, 200, 200, 0.3);
101
- }
102
-
103
- &.selected {
104
- background-color: rgba(200, 200, 200, 0.3);
105
- }
106
-
107
- &.sub-selected {
108
- background-color: rgba(200, 200, 200, 0.3);
109
- }
110
-
111
- &.disabledDrag {
112
- cursor: default;
113
- }
114
-
115
- > .drag,
116
- > .actions {
117
- line-height: 1;
118
-
119
- svg {
120
- font-size: 16px;
121
- vertical-align: middle;
91
+ F(n)(({ theme: e }) => ({
92
+ display: "flex",
93
+ alignItems: "center",
94
+ padding: "8px",
95
+ borderBottom: `1px solid ${e.palette.divider}`,
96
+ userSelect: "none",
97
+ cursor: "pointer",
98
+ position: "relative",
99
+ "&:hover": {
100
+ backgroundColor: "rgba(200, 200, 200, 0.3)",
101
+ "& .actions": {
102
+ opacity: 1
122
103
  }
123
- }
124
-
125
- > .drag {
126
- cursor: grab;
127
- opacity: ${E};
128
- position: relative;
129
-
130
- &.disabledDrag {
131
- cursor: default;
132
-
133
- &:has(.origin-drag-icon):after {
134
- content: '';
135
- position: absolute;
136
- top: 50%;
137
- left: 50%;
138
- width: 120%;
139
- height: 1px;
140
- background-color: ${({ theme: i }) => i.palette.error.main};
141
- transform: translate(-50%, -50%) rotate(-45deg);
142
- z-index: 1;
143
- }
144
- }
145
- }
146
-
147
- > .actions {
148
- display: flex;
149
- align-items: center;
150
- overflow: hidden;
151
-
152
- > * {
153
- margin-right: 0.5em;
154
- opacity: 0;
155
- display: inline-block;
156
- cursor: pointer;
104
+ },
105
+ "&.selected": {
106
+ backgroundColor: "rgba(200, 200, 200, 0.3)"
107
+ },
108
+ "&.sub-selected": {
109
+ backgroundColor: "rgba(200, 200, 200, 0.3)"
110
+ },
111
+ "&.section-hidden": {
112
+ "& .drag-handle, & .content": {
113
+ color: e.palette.text.disabled
157
114
  }
158
-
159
- > .visible {
160
- display: inline-block;
161
- opacity: ${E};
115
+ },
116
+ "&.dragging": {
117
+ opacity: 0.4,
118
+ zIndex: 1e3
119
+ // filter: 'blur(0.5px)',
120
+ },
121
+ // Pre-embedded drop indicator lines - controlled by CSS classes
122
+ "&.drop-target-top::before": {
123
+ content: '""',
124
+ position: "absolute",
125
+ top: -2,
126
+ left: 0,
127
+ right: 0,
128
+ height: 2,
129
+ backgroundColor: e.palette.primary.main,
130
+ borderRadius: 1,
131
+ zIndex: 10
132
+ },
133
+ "&.drop-target-bottom::after": {
134
+ content: '""',
135
+ position: "absolute",
136
+ bottom: -2,
137
+ left: 0,
138
+ right: 0,
139
+ height: 2,
140
+ backgroundColor: e.palette.primary.main,
141
+ borderRadius: 1,
142
+ zIndex: 10
143
+ },
144
+ "& .drag-handle": {
145
+ cursor: "grab",
146
+ opacity: 0.5,
147
+ position: "relative",
148
+ lineHeight: 1,
149
+ svg: {
150
+ fontSize: "16px",
151
+ verticalAlign: "middle"
152
+ },
153
+ "&:active": {
154
+ cursor: "grabbing"
162
155
  }
163
- }
164
-
165
- &:hover {
166
- > .actions {
167
- > * {
168
- display: inline-block;
169
- opacity: ${E} !important;
156
+ },
157
+ "& .content": {
158
+ flex: 1,
159
+ overflow: "hidden",
160
+ textOverflow: "ellipsis",
161
+ padding: "0 4px",
162
+ fontSize: "14px"
163
+ },
164
+ "& .actions": {
165
+ position: "absolute",
166
+ maxHeight: "32px",
167
+ top: 0,
168
+ right: 0,
169
+ bottom: 0,
170
+ display: "flex",
171
+ alignItems: "center",
172
+ justifyContent: "center",
173
+ gap: e.spacing(0.5),
174
+ padding: e.spacing(0.5),
175
+ opacity: 0,
176
+ transition: "opacity 0.2s ease",
177
+ backgroundColor: te(e.palette.background.paper, 0.8),
178
+ backdropFilter: "blur(2px)",
179
+ borderRadius: e.spacing(0.5),
180
+ margin: `auto ${e.spacing(0.5)}`,
181
+ "& > *": {
182
+ display: "flex",
183
+ alignItems: "center",
184
+ justifyContent: "center",
185
+ cursor: "pointer",
186
+ padding: e.spacing(0.25),
187
+ borderRadius: e.spacing(0.5),
188
+ transition: "all 0.2s ease",
189
+ color: e.palette.text.secondary,
190
+ "&:hover": {
191
+ backgroundColor: e.palette.action.hover,
192
+ color: e.palette.text.primary
193
+ },
194
+ svg: {
195
+ fontSize: "16px"
170
196
  }
197
+ },
198
+ // 常驻显示的状态图标
199
+ "& > .visible": {
200
+ opacity: 1
171
201
  }
202
+ },
203
+ // 特殊状态的元素 - 常驻显示状态图标
204
+ "&.section-hidden .actions, &.section-locked .actions": {
205
+ opacity: 0.7
172
206
  }
173
-
174
- > .name {
175
- flex: 1;
176
- overflow: hidden;
177
- text-overflow: ellipsis;
178
- padding: 0 4px;
179
- font-size: 14px;
180
- }
181
- `;
182
- H(n)`
207
+ }));
208
+ F(n)`
183
209
  position: relative;
184
210
  border: 1px solid #c0c0c0;
185
211
  min-height: 40px;
@@ -197,29 +223,29 @@ H(n)`
197
223
  .label-box__label,
198
224
  .label-box__actions {
199
225
  position: absolute;
200
- background: ${({ theme: i }) => i.palette.background.paper};
226
+ background: ${({ theme: e }) => e.palette.background.paper};
201
227
  overflow: visible;
202
228
  display: inline-block;
203
229
  top: 0;
204
230
  transform: translateY(-50%);
205
231
  }
206
232
  `;
207
- const je = L({ embed: !1 }), { Provider: rt } = je;
208
- L(void 0);
209
- U({
210
- axios: G,
233
+ const $e = A({ embed: !1 }), { Provider: nt } = $e;
234
+ A(void 0);
235
+ Q({
236
+ axios: j,
211
237
  path: "/api/ai/status"
212
238
  });
213
- U({
214
- axios: G,
239
+ Q({
240
+ axios: j,
215
241
  path: "/api/ai/agent-status"
216
242
  });
217
243
  Ne({
218
- fetch: $e(),
244
+ fetch: Be(),
219
245
  path: "/api/ai/completions"
220
246
  });
221
- X.extend(Be);
222
- X.extend(De);
247
+ U.extend(je);
248
+ U.extend(De);
223
249
  m(n)`
224
250
  flex-grow: 1;
225
251
  display: flex;
@@ -324,7 +350,7 @@ m(n)`
324
350
  }
325
351
  }
326
352
  `;
327
- L({});
353
+ A({});
328
354
  m(n)`
329
355
  display: flex;
330
356
  flex-direction: column;
@@ -360,7 +386,7 @@ m(n)`
360
386
  cursor: pointer;
361
387
  }
362
388
  `;
363
- m(Oe)`
389
+ m(Le)`
364
390
  background: #f6f2ff;
365
391
  margin-bottom: 20px;
366
392
 
@@ -516,8 +542,8 @@ m(n)`
516
542
  }
517
543
  }
518
544
  `;
519
- Y();
520
- const We = {
545
+ X();
546
+ const He = {
521
547
  type: "default",
522
548
  title: "Section CardList",
523
549
  description: "This is Section CardList",
@@ -532,7 +558,7 @@ const We = {
532
558
  padding: "normal",
533
559
  list: [
534
560
  {
535
- id: Y(),
561
+ id: X(),
536
562
  title: "Simplified Service Delivery",
537
563
  description: "Block Server's Service Gateway makes networking easy with access to load balancing, SSL termination, automatic and customizable URL mapping, and redirects.",
538
564
  image: "https://www.arcblock.io/static/ead0cabde7f2b7ff34db8f3e8ceca271/afc4b/builder.png"
@@ -540,7 +566,7 @@ const We = {
540
566
  ]
541
567
  };
542
568
  function Fe({
543
- componentId: i,
569
+ componentId: e,
544
570
  locale: p,
545
571
  components: l
546
572
  }) {
@@ -549,22 +575,22 @@ function Fe({
549
575
  config: { defaultLocale: d }
550
576
  },
551
577
  localState: { customComponentPreviewerProperties: u }
552
- } = j(), r = J();
553
- return /* @__PURE__ */ t(
578
+ } = G(), i = q();
579
+ return /* @__PURE__ */ r(
554
580
  Ge,
555
581
  {
556
- componentId: i,
582
+ componentId: e,
557
583
  locale: p,
558
584
  dev: {
559
585
  mode: "draft",
560
- components: l || r,
586
+ components: l || i,
561
587
  defaultLocale: d
562
588
  },
563
- properties: u?.[i] ?? {}
589
+ properties: u?.[e] ?? {}
564
590
  }
565
591
  );
566
592
  }
567
- const D = 260, He = 5, K = "IGNORE_RENDER_BLOCKLET_TITLE", B = (i, p) => i ? Object.entries(i).map(([l, d]) => ({
593
+ const B = 260, We = 5, Y = "IGNORE_RENDER_BLOCKLET_TITLE", D = (e, p) => e ? Object.entries(e).map(([l, d]) => ({
568
594
  id: l,
569
595
  component: l,
570
596
  name: d?.data?.name || d?.component?.name || l,
@@ -582,88 +608,88 @@ const D = 260, He = 5, K = "IGNORE_RENDER_BLOCKLET_TITLE", B = (i, p) => i ? Obj
582
608
  {
583
609
  id: "section-card-list",
584
610
  name: "Section Card List",
585
- properties: We
611
+ properties: He
586
612
  },
587
613
  {
588
614
  id: "toc",
589
615
  name: "Toc",
590
- properties: he
616
+ properties: ge
591
617
  },
592
618
  {
593
619
  id: "iframe",
594
620
  name: "Embed",
595
- properties: ge
621
+ properties: xe
596
622
  },
597
623
  {
598
624
  id: "layout-block",
599
625
  name: "Section Layout",
600
626
  properties: {}
601
627
  }
602
- ].map((i) => ({ ...i, type: "basic", component: i.id }));
603
- function it({
604
- state: i,
628
+ ].map((e) => ({ ...e, type: "basic", component: e.id }));
629
+ function at({
630
+ state: e,
605
631
  open: p,
606
632
  onClose: l,
607
633
  onSelect: d,
608
634
  defaultTab: u,
609
- title: r,
610
- componentGroups: w,
635
+ title: i,
636
+ componentGroups: k,
611
637
  components: f,
612
638
  multiple: c = !1,
613
639
  defaultSelected: b,
614
- emptyText: z
640
+ emptyText: R
615
641
  }) {
616
- const { t: s } = F(), e = Q({
642
+ const { t: s } = H(), o = V({
617
643
  selectedComponent: null,
618
644
  activeTab: u,
619
645
  searchQuery: ""
620
- }), g = M(() => w || [
646
+ }), x = M(() => k || [
621
647
  {
622
648
  name: "basic",
623
649
  label: s("maker.components.basicGroup"),
624
650
  components: Ve
625
651
  },
626
- i && {
652
+ e && {
627
653
  name: "custom",
628
654
  label: s("maker.components.customGroup"),
629
- components: B(Z(i), "custom")
655
+ components: D(J(e), "custom")
630
656
  },
631
- i && {
657
+ e && {
632
658
  name: "resource",
633
659
  label: s("maker.components.resourceGroup"),
634
- components: B(ee(i), "resource")
660
+ components: D(Z(e), "resource")
635
661
  }
636
- ].filter(Boolean), [w, s, i, p]), x = e.activeTab || g[0]?.name, k = () => {
637
- e.selectedComponent && (d(e.selectedComponent), l());
638
- }, _ = (o) => {
639
- if (o) {
640
- if (v(o)) {
641
- c ? e.selectedComponent = e.selectedComponent.filter((a) => a.id !== o.id) : e.selectedComponent = null;
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;
642
668
  return;
643
669
  }
644
670
  if (c) {
645
- const a = Array.isArray(e.selectedComponent) ? e.selectedComponent : [], h = a.some((R) => R.id === o.id);
646
- e.selectedComponent = h ? a.filter((R) => R.id !== o.id) : [...a, o];
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];
647
673
  } else
648
- e.selectedComponent = o;
674
+ o.selectedComponent = t;
649
675
  }
650
- }, v = (o) => e.selectedComponent ? c ? e.selectedComponent.some((a) => a.id === o.id) : e.selectedComponent.id === o.id : !1, C = g?.length === 0, T = M(() => {
651
- const o = g.find((a) => a?.name === x)?.components || [];
652
- return e.searchQuery ? o.filter((a) => a.name.toLowerCase().includes(e.searchQuery.toLowerCase())) : o;
653
- }, [x, g, e.searchQuery]);
654
- A(() => {
655
- e.searchQuery = "", p && b ? e.selectedComponent = c ? Array.isArray(b) ? b : [b] : b : e.selectedComponent = null;
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;
656
682
  }, [p, b, c]);
657
- const I = T?.length === 0, O = z || s(x === "resource" ? "maker.components.needAddResource" : "maker.components.noComponents"), q = M(() => T ? T.reduce(
658
- (o, a) => {
659
- const h = a.blockletId || K, R = a.blockletTitle || s("maker.components.defaultGroup");
660
- return o[h] || (o[h] = {
661
- title: R,
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] = {
687
+ title: z,
662
688
  components: []
663
- }), o[h].components.push(a), o;
689
+ }), t[g].components.push(a), t;
664
690
  },
665
691
  {}
666
- ) : {}, [T]);
692
+ ) : {}, [I]);
667
693
  return /* @__PURE__ */ y(
668
694
  re,
669
695
  {
@@ -683,19 +709,19 @@ function it({
683
709
  },
684
710
  children: [
685
711
  /* @__PURE__ */ y(ie, { className: "between", sx: { display: "flex", gap: 2 }, children: [
686
- /* @__PURE__ */ t(n, { children: r || s("maker.components.addComponent") }),
687
- /* @__PURE__ */ t(
712
+ /* @__PURE__ */ r(n, { children: i || s("maker.components.addComponent") }),
713
+ /* @__PURE__ */ r(
688
714
  ne,
689
715
  {
690
716
  size: "small",
691
717
  placeholder: s("maker.components.searchComponent"),
692
- value: e.searchQuery,
693
- onChange: (o) => e.searchQuery = o.target.value,
718
+ value: o.searchQuery,
719
+ onChange: (t) => o.searchQuery = t.target.value,
694
720
  sx: { flex: 1, maxWidth: 350 },
695
721
  slotProps: {
696
722
  input: {
697
- startAdornment: /* @__PURE__ */ t(
698
- P,
723
+ startAdornment: /* @__PURE__ */ r(
724
+ L,
699
725
  {
700
726
  icon: "tabler:search",
701
727
  style: {
@@ -707,7 +733,7 @@ function it({
707
733
  }
708
734
  }
709
735
  ),
710
- /* @__PURE__ */ t(ae, { size: "small", onClick: l, children: /* @__PURE__ */ t(n, { component: P, icon: "tabler:x", sx: { color: "text.primary" } }) })
736
+ /* @__PURE__ */ r(ae, { size: "small", onClick: l, children: /* @__PURE__ */ r(n, { component: L, icon: "tabler:x", sx: { color: "text.primary" } }) })
711
737
  ] }),
712
738
  /* @__PURE__ */ y(
713
739
  se,
@@ -720,12 +746,12 @@ function it({
720
746
  overflow: "hidden"
721
747
  },
722
748
  children: [
723
- !C && /* @__PURE__ */ t(n, { sx: { width: 150, borderRight: 1, borderColor: "divider" }, children: /* @__PURE__ */ t(
749
+ !v && /* @__PURE__ */ r(n, { sx: { width: 150, borderRight: 1, borderColor: "divider" }, children: /* @__PURE__ */ r(
724
750
  le,
725
751
  {
726
752
  orientation: "vertical",
727
- value: x,
728
- onChange: (o, a) => e.activeTab = a,
753
+ value: h,
754
+ onChange: (t, a) => o.activeTab = a,
729
755
  sx: {
730
756
  "& .MuiTab-root": {
731
757
  alignItems: "flex-start",
@@ -735,10 +761,10 @@ function it({
735
761
  px: 2
736
762
  }
737
763
  },
738
- children: g.map((o, a) => /* @__PURE__ */ t(pe, { label: o?.label, value: o?.name }, a))
764
+ children: x.map((t, a) => /* @__PURE__ */ r(pe, { label: t?.label, value: t?.name }, a))
739
765
  }
740
766
  ) }),
741
- /* @__PURE__ */ t(
767
+ /* @__PURE__ */ r(
742
768
  n,
743
769
  {
744
770
  sx: {
@@ -747,23 +773,23 @@ function it({
747
773
  overflowY: "auto",
748
774
  pr: 1
749
775
  },
750
- children: I ? /* @__PURE__ */ t(W, { children: O }) : /* @__PURE__ */ t(
776
+ children: T ? /* @__PURE__ */ r($, { children: O }) : /* @__PURE__ */ r(
751
777
  Ue,
752
778
  {
753
- wrapperComponent: N,
779
+ wrapperComponent: P,
754
780
  wrapperComponentProps: {
755
781
  container: !0,
756
782
  spacing: 2,
757
- sx: I ? {
783
+ sx: T ? {
758
784
  height: "100%"
759
785
  } : {}
760
786
  },
761
- groups: q,
787
+ groups: K,
762
788
  emptyText: O,
763
- renderItem: (o) => {
764
- const a = v(o);
765
- return /* @__PURE__ */ t(
766
- N,
789
+ renderItem: (t) => {
790
+ const a = C(t);
791
+ return /* @__PURE__ */ r(
792
+ P,
767
793
  {
768
794
  sx: {
769
795
  width: "100%",
@@ -791,8 +817,8 @@ function it({
791
817
  height: 0,
792
818
  borderTop: "transparent solid 15px",
793
819
  borderLeft: "transparent solid 15px",
794
- borderBottom: (h) => `solid 15px ${h.palette.primary.main}`,
795
- borderRight: (h) => `solid 15px ${h.palette.primary.main}`,
820
+ borderBottom: (g) => `solid 15px ${g.palette.primary.main}`,
821
+ borderRight: (g) => `solid 15px ${g.palette.primary.main}`,
796
822
  transition: "all 0.1s ease",
797
823
  content: '""'
798
824
  },
@@ -820,29 +846,29 @@ function it({
820
846
  width: "100%",
821
847
  cursor: "pointer"
822
848
  },
823
- onClick: () => _(o),
849
+ onClick: () => _(t),
824
850
  children: [
825
- /* @__PURE__ */ t(
851
+ /* @__PURE__ */ r(
826
852
  ce,
827
853
  {
828
854
  sx: {
829
855
  width: "100%",
830
- height: D,
856
+ height: B,
831
857
  overflow: "auto",
832
858
  position: "relative"
833
859
  },
834
- children: /* @__PURE__ */ t(
860
+ children: /* @__PURE__ */ r(
835
861
  Qe,
836
862
  {
837
863
  components: f,
838
- containerHeight: D,
839
- component: o
864
+ containerHeight: B,
865
+ component: t
840
866
  },
841
- o.id
867
+ t.id
842
868
  )
843
869
  }
844
870
  ),
845
- /* @__PURE__ */ t(
871
+ /* @__PURE__ */ r(
846
872
  me,
847
873
  {
848
874
  sx: {
@@ -850,25 +876,25 @@ function it({
850
876
  borderTop: 1,
851
877
  borderColor: a ? "primary.main" : "grey.200"
852
878
  },
853
- children: /* @__PURE__ */ t(
854
- V,
879
+ children: /* @__PURE__ */ r(
880
+ W,
855
881
  {
856
882
  variant: "body1",
857
883
  noWrap: !0,
858
884
  sx: {
859
885
  fontWeight: "bold"
860
886
  },
861
- children: o.name
887
+ children: t.name
862
888
  }
863
889
  )
864
890
  }
865
891
  ),
866
- /* @__PURE__ */ t(n, { className: "check-container", children: /* @__PURE__ */ t(te, { className: "check-icon" }) })
892
+ /* @__PURE__ */ r(n, { className: "check-container", children: /* @__PURE__ */ r(oe, { className: "check-icon" }) })
867
893
  ]
868
894
  }
869
895
  )
870
896
  },
871
- o.id
897
+ t.id
872
898
  );
873
899
  }
874
900
  }
@@ -887,14 +913,14 @@ function it({
887
913
  p: 2
888
914
  },
889
915
  children: [
890
- /* @__PURE__ */ t($, { onClick: l, variant: "outlined", children: s("common.cancel") }),
891
- /* @__PURE__ */ t(
892
- $,
916
+ /* @__PURE__ */ r(N, { onClick: l, variant: "outlined", children: s("common.cancel") }),
917
+ /* @__PURE__ */ r(
918
+ N,
893
919
  {
894
- onClick: k,
920
+ onClick: w,
895
921
  variant: "contained",
896
- disabled: !e.selectedComponent || c && Array.isArray(e.selectedComponent) && e.selectedComponent.length === 0,
897
- children: c && Array.isArray(e.selectedComponent) && e.selectedComponent.length > 0 ? s("common.addMultiple", { count: e.selectedComponent.length }) : s("common.add")
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")
898
924
  }
899
925
  )
900
926
  ]
@@ -905,21 +931,21 @@ function it({
905
931
  );
906
932
  }
907
933
  function Qe({
908
- containerHeight: i,
934
+ containerHeight: e,
909
935
  component: p,
910
936
  minScale: l = 0.1,
911
937
  components: d
912
938
  }) {
913
- const { locale: u } = F(), r = Q({
939
+ const { locale: u } = H(), i = V({
914
940
  scale: 1,
915
941
  shouldScroll: !1,
916
942
  isVisible: !1,
917
943
  hadInit: !1
918
- }), { currentPage: w } = j(), f = S(null), c = S(null), b = S(0), z = S(null);
919
- A(() => {
920
- const v = new IntersectionObserver(
921
- ([C]) => {
922
- r.isVisible = C.isIntersecting;
944
+ }), { currentPage: k } = G(), f = S(null), c = S(null), b = S(0), R = S(null);
945
+ E(() => {
946
+ const C = new IntersectionObserver(
947
+ ([v]) => {
948
+ i.isVisible = v.isIntersecting;
923
949
  },
924
950
  {
925
951
  root: null,
@@ -927,33 +953,33 @@ function Qe({
927
953
  threshold: 0
928
954
  }
929
955
  );
930
- return c.current && v.observe(c.current), () => v.disconnect();
931
- }, []), A(() => {
932
- const v = () => {
933
- if (b.current += 1, b.current > He) {
934
- C.disconnect();
956
+ return c.current && C.observe(c.current), () => C.disconnect();
957
+ }, []), E(() => {
958
+ const C = () => {
959
+ if (b.current += 1, b.current > We) {
960
+ v.disconnect();
935
961
  return;
936
962
  }
937
963
  if (!p.previewImage && f.current) {
938
- const T = f.current.scrollHeight, I = i / T;
939
- I < l ? (r.scale = l, r.shouldScroll = !0) : I < 1 ? (r.scale = I, r.shouldScroll = !1) : (r.scale = 1, r.shouldScroll = !1);
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);
940
966
  }
941
- z.current && clearTimeout(z.current), z.current = setTimeout(() => {
942
- r.hadInit = !0;
967
+ R.current && clearTimeout(R.current), R.current = setTimeout(() => {
968
+ i.hadInit = !0;
943
969
  }, 200);
944
- }, C = new ResizeObserver(() => {
945
- setTimeout(v, 20);
970
+ }, v = new ResizeObserver(() => {
971
+ setTimeout(C, 20);
946
972
  });
947
- return f.current && r.isVisible && C.observe(f.current), () => {
948
- C.disconnect();
973
+ return f.current && i.isVisible && v.observe(f.current), () => {
974
+ v.disconnect();
949
975
  };
950
- }, [i, l, r.isVisible, p]);
951
- const { id: s, type: e, component: g, properties: x, previewImage: k } = p, _ = M(() => r.isVisible ? k ? /* @__PURE__ */ t(
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(
952
978
  n,
953
979
  {
954
980
  component: "img",
955
981
  loading: "lazy",
956
- src: oe(k),
982
+ src: ee(w),
957
983
  alt: p.name,
958
984
  sx: {
959
985
  width: "100%",
@@ -964,25 +990,25 @@ function Qe({
964
990
  }
965
991
  },
966
992
  s
967
- ) : e === "basic" ? /* @__PURE__ */ t(
968
- xe,
993
+ ) : o === "basic" ? /* @__PURE__ */ r(
994
+ he,
969
995
  {
970
996
  id: s,
971
- type: g,
972
- section: x,
997
+ type: x,
998
+ section: h,
973
999
  config: {
974
- ...x,
1000
+ ...h,
975
1001
  locale: u,
976
1002
  editing: !1,
977
1003
  dev: {
978
1004
  mode: "draft"
979
1005
  }
980
1006
  },
981
- page: w
1007
+ page: k
982
1008
  },
983
1009
  s
984
- ) : /* @__PURE__ */ t(Fe, { componentId: s, locale: u, components: d }, s) : null, [s, e, g, x, u, k, r.isVisible]);
985
- return /* @__PURE__ */ t(
1010
+ ) : /* @__PURE__ */ r(Fe, { componentId: s, locale: u, components: d }, s) : null, [s, o, x, h, u, w, i.isVisible]);
1011
+ return /* @__PURE__ */ r(
986
1012
  n,
987
1013
  {
988
1014
  ref: c,
@@ -991,29 +1017,29 @@ function Qe({
991
1017
  width: "100%",
992
1018
  height: "100%",
993
1019
  overflowX: "hidden",
994
- overflowY: r.shouldScroll ? "auto" : "hidden",
1020
+ overflowY: i.shouldScroll ? "auto" : "hidden",
995
1021
  transition: "all 0.3s ease"
996
1022
  },
997
1023
  children: /* @__PURE__ */ y(
998
1024
  n,
999
1025
  {
1000
1026
  sx: {
1001
- transform: `scale(${r.scale})`,
1027
+ transform: `scale(${i.scale})`,
1002
1028
  transformOrigin: "top left",
1003
- width: `${100 / r.scale}%`,
1004
- height: r.hadInit && r.shouldScroll ? "100%" : `${100 / r.scale}%`
1029
+ width: `${100 / i.scale}%`,
1030
+ height: i.hadInit && i.shouldScroll ? "100%" : `${100 / i.scale}%`
1005
1031
  },
1006
1032
  children: [
1007
- !r.hadInit && /* @__PURE__ */ t(fe, { variant: "rectangular", width: "100%", height: "100%" }),
1008
- /* @__PURE__ */ t(
1033
+ !i.hadInit && /* @__PURE__ */ r(fe, { variant: "rectangular", width: "100%", height: "100%" }),
1034
+ /* @__PURE__ */ r(
1009
1035
  n,
1010
1036
  {
1011
1037
  ref: f,
1012
1038
  sx: {
1013
1039
  width: "100%",
1014
- height: k ? "100%" : "auto",
1040
+ height: w ? "100%" : "auto",
1015
1041
  pointerEvents: "none",
1016
- opacity: r.hadInit ? 1 : 0
1042
+ opacity: i.hadInit ? 1 : 0
1017
1043
  },
1018
1044
  children: _
1019
1045
  }
@@ -1025,7 +1051,7 @@ function Qe({
1025
1051
  );
1026
1052
  }
1027
1053
  function Ue({
1028
- groups: i,
1054
+ groups: e,
1029
1055
  emptyText: p,
1030
1056
  renderItem: l,
1031
1057
  wrapperComponent: d = n,
@@ -1035,15 +1061,15 @@ function Ue({
1035
1061
  gap: 1
1036
1062
  }
1037
1063
  }) {
1038
- return /* @__PURE__ */ t(n, { children: Object.keys(i).length > 0 ? Object.entries(i).map(([r, { title: w, components: f }]) => /* @__PURE__ */ y(
1064
+ return /* @__PURE__ */ r(n, { children: Object.keys(e).length > 0 ? Object.entries(e).map(([i, { title: k, components: f }]) => /* @__PURE__ */ y(
1039
1065
  n,
1040
1066
  {
1041
1067
  sx: {
1042
1068
  mb: 3
1043
1069
  },
1044
1070
  children: [
1045
- r !== K && /* @__PURE__ */ y(
1046
- V,
1071
+ i !== Y && /* @__PURE__ */ y(
1072
+ W,
1047
1073
  {
1048
1074
  className: "blocklet-title",
1049
1075
  variant: "subtitle2",
@@ -1056,7 +1082,7 @@ function Ue({
1056
1082
  gap: 1
1057
1083
  },
1058
1084
  children: [
1059
- /* @__PURE__ */ t(
1085
+ /* @__PURE__ */ r(
1060
1086
  n,
1061
1087
  {
1062
1088
  component: "span",
@@ -1069,21 +1095,21 @@ function Ue({
1069
1095
  }
1070
1096
  }
1071
1097
  ),
1072
- w
1098
+ k
1073
1099
  ]
1074
1100
  }
1075
1101
  ),
1076
- /* @__PURE__ */ t(d, { ...u, children: f.map((c) => l(c)) })
1102
+ /* @__PURE__ */ r(d, { ...u, children: f.map((c) => l(c)) })
1077
1103
  ]
1078
1104
  },
1079
- r
1080
- )) : /* @__PURE__ */ t(W, { children: p }) });
1105
+ i
1106
+ )) : /* @__PURE__ */ r($, { children: p }) });
1081
1107
  }
1082
1108
  export {
1083
- it as AddComponent,
1109
+ at as AddComponent,
1084
1110
  Qe as AutoScaledComponentRenderer,
1085
1111
  Ve as BASIC_COMPONENT_LIST,
1086
1112
  Ue as GroupedComponentsList,
1087
- it as default,
1088
- B as formatComponent
1113
+ at as default,
1114
+ D as formatComponent
1089
1115
  };