@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.
- package/lib/cjs/add-component.js +15 -106
- package/lib/cjs/chunks/{draft-data-CBA2Fr-1.js → draft-data-Bhf423Y1.js} +1 -1
- package/lib/cjs/chunks/{home-BcAK1oy2.js → home-BKn7-Ncc.js} +2 -2
- package/lib/cjs/chunks/{index-Bs3OlRQc.js → index-HSHOGLHs.js} +25 -25
- package/lib/cjs/chunks/{publish-button-DHrxOxEB.js → publish-button-CeewavTH.js} +1 -1
- package/lib/cjs/chunks/state-DH94MEh-.js +1 -0
- package/lib/cjs/home.js +1 -1
- package/lib/cjs/locales.js +3 -3
- package/lib/cjs/setting.js +3 -3
- package/lib/es/add-component.js +288 -262
- package/lib/es/chunks/{draft-data-mNAXJMtq.js → draft-data-oEuh4Tps.js} +1 -1
- package/lib/es/chunks/{home-BIMdDiCg.js → home-CmH9KpXZ.js} +3 -3
- package/lib/es/chunks/{index-NQgjITtC.js → index-ni6tn8EL.js} +662 -630
- package/lib/es/chunks/{publish-button-DjP_C3Xb.js → publish-button-DdJy6U4r.js} +3 -3
- package/lib/es/chunks/state-DdT-7UdS.js +684 -0
- package/lib/es/home.js +3 -3
- package/lib/es/locales.js +16 -4
- package/lib/es/setting.js +779 -782
- package/package.json +9 -11
- package/lib/cjs/chunks/state-B5PBvcI6.js +0 -1
- package/lib/es/chunks/state-DRjnlQY_.js +0 -604
package/lib/es/add-component.js
CHANGED
|
@@ -1,24 +1,26 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { i as
|
|
3
|
-
import
|
|
4
|
-
import { useLocaleContext as
|
|
5
|
-
import { Icon as
|
|
6
|
-
import
|
|
7
|
-
import { Box as n, styled as
|
|
8
|
-
import { useReactive as
|
|
9
|
-
import { createContext as
|
|
10
|
-
import { c as be, T as
|
|
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
|
|
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 "
|
|
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
|
|
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
|
|
46
|
-
import { createFetch as
|
|
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
|
|
53
|
+
import U from "dayjs";
|
|
52
54
|
import De from "dayjs/plugin/timezone";
|
|
53
|
-
import
|
|
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
|
|
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],
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
Ee[300], Ae[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
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
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
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
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
|
-
|
|
160
|
-
|
|
161
|
-
|
|
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
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
axios:
|
|
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
|
-
|
|
214
|
-
axios:
|
|
239
|
+
Q({
|
|
240
|
+
axios: j,
|
|
215
241
|
path: "/api/ai/agent-status"
|
|
216
242
|
});
|
|
217
243
|
Ne({
|
|
218
|
-
fetch:
|
|
244
|
+
fetch: Be(),
|
|
219
245
|
path: "/api/ai/completions"
|
|
220
246
|
});
|
|
221
|
-
|
|
222
|
-
|
|
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
|
-
|
|
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(
|
|
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
|
-
|
|
520
|
-
const
|
|
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:
|
|
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:
|
|
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
|
-
} =
|
|
553
|
-
return /* @__PURE__ */
|
|
578
|
+
} = G(), i = q();
|
|
579
|
+
return /* @__PURE__ */ r(
|
|
554
580
|
Ge,
|
|
555
581
|
{
|
|
556
|
-
componentId:
|
|
582
|
+
componentId: e,
|
|
557
583
|
locale: p,
|
|
558
584
|
dev: {
|
|
559
585
|
mode: "draft",
|
|
560
|
-
components: l ||
|
|
586
|
+
components: l || i,
|
|
561
587
|
defaultLocale: d
|
|
562
588
|
},
|
|
563
|
-
properties: u?.[
|
|
589
|
+
properties: u?.[e] ?? {}
|
|
564
590
|
}
|
|
565
591
|
);
|
|
566
592
|
}
|
|
567
|
-
const
|
|
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:
|
|
611
|
+
properties: He
|
|
586
612
|
},
|
|
587
613
|
{
|
|
588
614
|
id: "toc",
|
|
589
615
|
name: "Toc",
|
|
590
|
-
properties:
|
|
616
|
+
properties: ge
|
|
591
617
|
},
|
|
592
618
|
{
|
|
593
619
|
id: "iframe",
|
|
594
620
|
name: "Embed",
|
|
595
|
-
properties:
|
|
621
|
+
properties: xe
|
|
596
622
|
},
|
|
597
623
|
{
|
|
598
624
|
id: "layout-block",
|
|
599
625
|
name: "Section Layout",
|
|
600
626
|
properties: {}
|
|
601
627
|
}
|
|
602
|
-
].map((
|
|
603
|
-
function
|
|
604
|
-
state:
|
|
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:
|
|
610
|
-
componentGroups:
|
|
635
|
+
title: i,
|
|
636
|
+
componentGroups: k,
|
|
611
637
|
components: f,
|
|
612
638
|
multiple: c = !1,
|
|
613
639
|
defaultSelected: b,
|
|
614
|
-
emptyText:
|
|
640
|
+
emptyText: R
|
|
615
641
|
}) {
|
|
616
|
-
const { t: s } =
|
|
642
|
+
const { t: s } = H(), o = V({
|
|
617
643
|
selectedComponent: null,
|
|
618
644
|
activeTab: u,
|
|
619
645
|
searchQuery: ""
|
|
620
|
-
}),
|
|
646
|
+
}), x = M(() => k || [
|
|
621
647
|
{
|
|
622
648
|
name: "basic",
|
|
623
649
|
label: s("maker.components.basicGroup"),
|
|
624
650
|
components: Ve
|
|
625
651
|
},
|
|
626
|
-
|
|
652
|
+
e && {
|
|
627
653
|
name: "custom",
|
|
628
654
|
label: s("maker.components.customGroup"),
|
|
629
|
-
components:
|
|
655
|
+
components: D(J(e), "custom")
|
|
630
656
|
},
|
|
631
|
-
|
|
657
|
+
e && {
|
|
632
658
|
name: "resource",
|
|
633
659
|
label: s("maker.components.resourceGroup"),
|
|
634
|
-
components:
|
|
660
|
+
components: D(Z(e), "resource")
|
|
635
661
|
}
|
|
636
|
-
].filter(Boolean), [
|
|
637
|
-
|
|
638
|
-
}, _ = (
|
|
639
|
-
if (
|
|
640
|
-
if (
|
|
641
|
-
c ?
|
|
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(
|
|
646
|
-
|
|
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
|
-
|
|
674
|
+
o.selectedComponent = t;
|
|
649
675
|
}
|
|
650
|
-
},
|
|
651
|
-
const
|
|
652
|
-
return
|
|
653
|
-
}, [
|
|
654
|
-
|
|
655
|
-
|
|
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
|
|
658
|
-
(
|
|
659
|
-
const
|
|
660
|
-
return
|
|
661
|
-
title:
|
|
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
|
-
}),
|
|
689
|
+
}), t[g].components.push(a), t;
|
|
664
690
|
},
|
|
665
691
|
{}
|
|
666
|
-
) : {}, [
|
|
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__ */
|
|
687
|
-
/* @__PURE__ */
|
|
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:
|
|
693
|
-
onChange: (
|
|
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__ */
|
|
698
|
-
|
|
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__ */
|
|
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
|
-
!
|
|
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:
|
|
728
|
-
onChange: (
|
|
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:
|
|
764
|
+
children: x.map((t, a) => /* @__PURE__ */ r(pe, { label: t?.label, value: t?.name }, a))
|
|
739
765
|
}
|
|
740
766
|
) }),
|
|
741
|
-
/* @__PURE__ */
|
|
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:
|
|
776
|
+
children: T ? /* @__PURE__ */ r($, { children: O }) : /* @__PURE__ */ r(
|
|
751
777
|
Ue,
|
|
752
778
|
{
|
|
753
|
-
wrapperComponent:
|
|
779
|
+
wrapperComponent: P,
|
|
754
780
|
wrapperComponentProps: {
|
|
755
781
|
container: !0,
|
|
756
782
|
spacing: 2,
|
|
757
|
-
sx:
|
|
783
|
+
sx: T ? {
|
|
758
784
|
height: "100%"
|
|
759
785
|
} : {}
|
|
760
786
|
},
|
|
761
|
-
groups:
|
|
787
|
+
groups: K,
|
|
762
788
|
emptyText: O,
|
|
763
|
-
renderItem: (
|
|
764
|
-
const a =
|
|
765
|
-
return /* @__PURE__ */
|
|
766
|
-
|
|
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: (
|
|
795
|
-
borderRight: (
|
|
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: () => _(
|
|
849
|
+
onClick: () => _(t),
|
|
824
850
|
children: [
|
|
825
|
-
/* @__PURE__ */
|
|
851
|
+
/* @__PURE__ */ r(
|
|
826
852
|
ce,
|
|
827
853
|
{
|
|
828
854
|
sx: {
|
|
829
855
|
width: "100%",
|
|
830
|
-
height:
|
|
856
|
+
height: B,
|
|
831
857
|
overflow: "auto",
|
|
832
858
|
position: "relative"
|
|
833
859
|
},
|
|
834
|
-
children: /* @__PURE__ */
|
|
860
|
+
children: /* @__PURE__ */ r(
|
|
835
861
|
Qe,
|
|
836
862
|
{
|
|
837
863
|
components: f,
|
|
838
|
-
containerHeight:
|
|
839
|
-
component:
|
|
864
|
+
containerHeight: B,
|
|
865
|
+
component: t
|
|
840
866
|
},
|
|
841
|
-
|
|
867
|
+
t.id
|
|
842
868
|
)
|
|
843
869
|
}
|
|
844
870
|
),
|
|
845
|
-
/* @__PURE__ */
|
|
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__ */
|
|
854
|
-
|
|
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:
|
|
887
|
+
children: t.name
|
|
862
888
|
}
|
|
863
889
|
)
|
|
864
890
|
}
|
|
865
891
|
),
|
|
866
|
-
/* @__PURE__ */
|
|
892
|
+
/* @__PURE__ */ r(n, { className: "check-container", children: /* @__PURE__ */ r(oe, { className: "check-icon" }) })
|
|
867
893
|
]
|
|
868
894
|
}
|
|
869
895
|
)
|
|
870
896
|
},
|
|
871
|
-
|
|
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__ */
|
|
891
|
-
/* @__PURE__ */
|
|
892
|
-
|
|
916
|
+
/* @__PURE__ */ r(N, { onClick: l, variant: "outlined", children: s("common.cancel") }),
|
|
917
|
+
/* @__PURE__ */ r(
|
|
918
|
+
N,
|
|
893
919
|
{
|
|
894
|
-
onClick:
|
|
920
|
+
onClick: w,
|
|
895
921
|
variant: "contained",
|
|
896
|
-
disabled: !
|
|
897
|
-
children: c && Array.isArray(
|
|
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:
|
|
934
|
+
containerHeight: e,
|
|
909
935
|
component: p,
|
|
910
936
|
minScale: l = 0.1,
|
|
911
937
|
components: d
|
|
912
938
|
}) {
|
|
913
|
-
const { locale: u } =
|
|
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:
|
|
919
|
-
|
|
920
|
-
const
|
|
921
|
-
([
|
|
922
|
-
|
|
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 &&
|
|
931
|
-
}, []),
|
|
932
|
-
const
|
|
933
|
-
if (b.current += 1, b.current >
|
|
934
|
-
|
|
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
|
|
939
|
-
|
|
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
|
-
|
|
942
|
-
|
|
967
|
+
R.current && clearTimeout(R.current), R.current = setTimeout(() => {
|
|
968
|
+
i.hadInit = !0;
|
|
943
969
|
}, 200);
|
|
944
|
-
},
|
|
945
|
-
setTimeout(
|
|
970
|
+
}, v = new ResizeObserver(() => {
|
|
971
|
+
setTimeout(C, 20);
|
|
946
972
|
});
|
|
947
|
-
return f.current &&
|
|
948
|
-
|
|
973
|
+
return f.current && i.isVisible && v.observe(f.current), () => {
|
|
974
|
+
v.disconnect();
|
|
949
975
|
};
|
|
950
|
-
}, [
|
|
951
|
-
const { id: s, type:
|
|
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:
|
|
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
|
-
) :
|
|
968
|
-
|
|
993
|
+
) : o === "basic" ? /* @__PURE__ */ r(
|
|
994
|
+
he,
|
|
969
995
|
{
|
|
970
996
|
id: s,
|
|
971
|
-
type:
|
|
972
|
-
section:
|
|
997
|
+
type: x,
|
|
998
|
+
section: h,
|
|
973
999
|
config: {
|
|
974
|
-
...
|
|
1000
|
+
...h,
|
|
975
1001
|
locale: u,
|
|
976
1002
|
editing: !1,
|
|
977
1003
|
dev: {
|
|
978
1004
|
mode: "draft"
|
|
979
1005
|
}
|
|
980
1006
|
},
|
|
981
|
-
page:
|
|
1007
|
+
page: k
|
|
982
1008
|
},
|
|
983
1009
|
s
|
|
984
|
-
) : /* @__PURE__ */
|
|
985
|
-
return /* @__PURE__ */
|
|
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:
|
|
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(${
|
|
1027
|
+
transform: `scale(${i.scale})`,
|
|
1002
1028
|
transformOrigin: "top left",
|
|
1003
|
-
width: `${100 /
|
|
1004
|
-
height:
|
|
1029
|
+
width: `${100 / i.scale}%`,
|
|
1030
|
+
height: i.hadInit && i.shouldScroll ? "100%" : `${100 / i.scale}%`
|
|
1005
1031
|
},
|
|
1006
1032
|
children: [
|
|
1007
|
-
!
|
|
1008
|
-
/* @__PURE__ */
|
|
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:
|
|
1040
|
+
height: w ? "100%" : "auto",
|
|
1015
1041
|
pointerEvents: "none",
|
|
1016
|
-
opacity:
|
|
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:
|
|
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__ */
|
|
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
|
-
|
|
1046
|
-
|
|
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__ */
|
|
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
|
-
|
|
1098
|
+
k
|
|
1073
1099
|
]
|
|
1074
1100
|
}
|
|
1075
1101
|
),
|
|
1076
|
-
/* @__PURE__ */
|
|
1102
|
+
/* @__PURE__ */ r(d, { ...u, children: f.map((c) => l(c)) })
|
|
1077
1103
|
]
|
|
1078
1104
|
},
|
|
1079
|
-
|
|
1080
|
-
)) : /* @__PURE__ */
|
|
1105
|
+
i
|
|
1106
|
+
)) : /* @__PURE__ */ r($, { children: p }) });
|
|
1081
1107
|
}
|
|
1082
1108
|
export {
|
|
1083
|
-
|
|
1109
|
+
at as AddComponent,
|
|
1084
1110
|
Qe as AutoScaledComponentRenderer,
|
|
1085
1111
|
Ve as BASIC_COMPONENT_LIST,
|
|
1086
1112
|
Ue as GroupedComponentsList,
|
|
1087
|
-
|
|
1088
|
-
|
|
1113
|
+
at as default,
|
|
1114
|
+
D as formatComponent
|
|
1089
1115
|
};
|