@blocklet/list 0.16.36 → 0.16.38
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/index.es.js +587 -536
- package/package.json +4 -4
package/lib/index.es.js
CHANGED
|
@@ -1,75 +1,75 @@
|
|
|
1
1
|
import { jsx as t, jsxs as h, Fragment as M } from "react/jsx-runtime";
|
|
2
|
-
import { styled as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { pick as
|
|
6
|
-
import { ErrorFallback as
|
|
2
|
+
import { styled as Q, useTheme as we } from "@arcblock/ux/lib/Theme";
|
|
3
|
+
import et from "@mui/material/styles/createTheme";
|
|
4
|
+
import tt from "@mui/material/styles/ThemeProvider";
|
|
5
|
+
import { pick as rt, omitBy as se, orderBy as ot, isEmpty as nt, merge as it } from "lodash-es";
|
|
6
|
+
import { ErrorFallback as be } from "@arcblock/ux/lib/ErrorBoundary";
|
|
7
7
|
import y from "@mui/material/Box";
|
|
8
8
|
import F from "@mui/material/Stack";
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import
|
|
12
|
-
import
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
import { createAxios as
|
|
16
|
-
import { useRequest as
|
|
9
|
+
import { createContext as _e, useState as E, useMemo as V, useContext as Me, useCallback as ge, useEffect as G, forwardRef as lt, useRef as re, memo as at } from "react";
|
|
10
|
+
import { ErrorBoundary as st } from "react-error-boundary";
|
|
11
|
+
import ct from "@iconify-icons/tabler/compass";
|
|
12
|
+
import { Icon as X } from "@iconify/react";
|
|
13
|
+
import ke from "@mui/icons-material/Close";
|
|
14
|
+
import v from "@mui/material/Typography";
|
|
15
|
+
import { createAxios as ze } from "@blocklet/js-sdk";
|
|
16
|
+
import { useRequest as ne, useDebounceFn as De, useInfiniteScroll as dt, useReactive as ut } from "ahooks";
|
|
17
17
|
import "color";
|
|
18
|
-
import { parseURL as
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
28
|
-
import
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import
|
|
34
|
-
import
|
|
35
|
-
import
|
|
36
|
-
import
|
|
37
|
-
import
|
|
38
|
-
import
|
|
39
|
-
import
|
|
18
|
+
import { parseURL as ht, parseQuery as pt, parseFilename as mt, stringifyParsedURL as ft, withQuery as ve, joinURL as Be } from "ufo";
|
|
19
|
+
import Re from "flat";
|
|
20
|
+
import ie from "@mui/material/Button";
|
|
21
|
+
import gt from "@mui/material/styles/useTheme";
|
|
22
|
+
import U from "@mui/material/useMediaQuery";
|
|
23
|
+
import xt from "@mui/material/Drawer";
|
|
24
|
+
import Ne from "@mui/material/Checkbox";
|
|
25
|
+
import We from "@mui/material/FormControlLabel";
|
|
26
|
+
import yt from "@mui/icons-material/Check";
|
|
27
|
+
import wt from "@mui/icons-material/KeyboardArrowDown";
|
|
28
|
+
import bt from "@mui/material/ClickAwayListener";
|
|
29
|
+
import kt from "@mui/material/Grow";
|
|
30
|
+
import $e from "@mui/material/MenuItem";
|
|
31
|
+
import je from "@mui/material/MenuList";
|
|
32
|
+
import vt from "@mui/material/Paper";
|
|
33
|
+
import Ct from "@mui/material/Popper";
|
|
34
|
+
import St from "@mui/material/SvgIcon";
|
|
35
|
+
import le from "@mui/material/CircularProgress";
|
|
36
|
+
import He from "@arcblock/ux/lib/Avatar";
|
|
37
|
+
import It from "@iconify-icons/tabler/cloud-download";
|
|
38
|
+
import Bt from "@mui/icons-material/ChevronLeft";
|
|
39
|
+
import Rt from "@mui/icons-material/ChevronRight";
|
|
40
40
|
import O from "@mui/material/Skeleton";
|
|
41
|
-
import
|
|
41
|
+
import Tt from "react-image-gallery";
|
|
42
42
|
import "react-image-gallery/styles/css/image-gallery.css";
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
47
|
-
import
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import { useHotkeys as
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import
|
|
58
|
-
import { Card as
|
|
59
|
-
import
|
|
60
|
-
const
|
|
43
|
+
import Te from "@mui/material/Grid";
|
|
44
|
+
import Pt from "react-infinite-scroll-hook";
|
|
45
|
+
import At from "@iconify-icons/tabler/square";
|
|
46
|
+
import Et from "@iconify-icons/tabler/square-check-filled";
|
|
47
|
+
import Pe from "@mui/material/Chip";
|
|
48
|
+
import te from "@mui/icons-material/Search";
|
|
49
|
+
import Ft from "@mui/material/Autocomplete";
|
|
50
|
+
import Lt from "@mui/material/Dialog";
|
|
51
|
+
import Ue from "@mui/material/OutlinedInput";
|
|
52
|
+
import Ot from "@mui/material/TextField";
|
|
53
|
+
import { useHotkeys as _t } from "react-hotkeys-hook";
|
|
54
|
+
import Ae from "@mui/material/InputAdornment";
|
|
55
|
+
import Mt from "@arcblock/ux/lib/Empty";
|
|
56
|
+
import zt from "json-stable-stringify";
|
|
57
|
+
import Dt from "@mui/icons-material/Menu";
|
|
58
|
+
import { Card as Nt, Box as ce, Skeleton as L } from "@mui/material";
|
|
59
|
+
import Wt from "@arcblock/ux/lib/Img";
|
|
60
|
+
const Ve = _e({
|
|
61
61
|
open: !1,
|
|
62
62
|
toggleOpen: (e) => {
|
|
63
63
|
}
|
|
64
64
|
});
|
|
65
|
-
function
|
|
66
|
-
const [r, o] = E(!1), n = (
|
|
67
|
-
o(
|
|
68
|
-
}, l =
|
|
69
|
-
return /* @__PURE__ */ t(
|
|
65
|
+
function $t({ children: e }) {
|
|
66
|
+
const [r, o] = E(!1), n = (a) => {
|
|
67
|
+
o(a ?? !a);
|
|
68
|
+
}, l = V(() => ({ open: r, toggleOpen: n }), [r]);
|
|
69
|
+
return /* @__PURE__ */ t(Ve.Provider, { value: l, children: e });
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
return
|
|
71
|
+
function Ce() {
|
|
72
|
+
return Me(Ve);
|
|
73
73
|
}
|
|
74
74
|
const P = {
|
|
75
75
|
nameAsc: "title",
|
|
@@ -85,19 +85,19 @@ const P = {
|
|
|
85
85
|
explorePath: "/api/blocklets/explore",
|
|
86
86
|
exploreDidsPath: "/api/blocklets/dids",
|
|
87
87
|
cacheSize: 100
|
|
88
|
-
},
|
|
88
|
+
}, jt = (e) => ne(
|
|
89
89
|
async () => {
|
|
90
90
|
const { data: r } = await e.get(P.categoriesPath);
|
|
91
91
|
return Array.isArray(r) ? r : [];
|
|
92
92
|
},
|
|
93
93
|
{ manual: !0 }
|
|
94
94
|
);
|
|
95
|
-
function
|
|
95
|
+
function Ht(e, r) {
|
|
96
96
|
const o = e.menu ? {
|
|
97
97
|
sortBy: "popularity",
|
|
98
98
|
sortDirection: "desc",
|
|
99
99
|
showResources: "true",
|
|
100
|
-
...
|
|
100
|
+
...rt(e, ["sortBy", "sortDirection", "showResources"])
|
|
101
101
|
} : {
|
|
102
102
|
sortBy: "popularity",
|
|
103
103
|
sortDirection: "desc",
|
|
@@ -109,49 +109,49 @@ function jt(e, r) {
|
|
|
109
109
|
onSearchSelect: l = (i) => {
|
|
110
110
|
r.onFilterChange({ ...o, keyword: i.title });
|
|
111
111
|
},
|
|
112
|
-
emptyCategory:
|
|
112
|
+
emptyCategory: a
|
|
113
113
|
} = r;
|
|
114
|
-
!o.category && !
|
|
115
|
-
const
|
|
116
|
-
const
|
|
117
|
-
n(
|
|
114
|
+
!o.category && !a && (o.category = "All");
|
|
115
|
+
const s = (i) => {
|
|
116
|
+
const m = { ...o, ...i };
|
|
117
|
+
n(se(m, (d) => d === "" || d === void 0));
|
|
118
118
|
};
|
|
119
119
|
return {
|
|
120
120
|
filters: e,
|
|
121
121
|
cleanFilter: (i) => {
|
|
122
|
-
const
|
|
123
|
-
n(
|
|
122
|
+
const m = i ? se(o, (d, f) => i.includes(f)) : {};
|
|
123
|
+
n(se(m, (d) => d === "" || d === void 0));
|
|
124
124
|
},
|
|
125
125
|
handleActiveMenu: (i) => {
|
|
126
126
|
i !== e.menu && n({ menu: i });
|
|
127
127
|
},
|
|
128
|
-
handleSort: (i,
|
|
129
|
-
|
|
128
|
+
handleSort: (i, m) => {
|
|
129
|
+
s({ sortBy: i, sortDirection: m || i === "nameAsc" ? "asc" : "desc" });
|
|
130
130
|
},
|
|
131
131
|
handleKeyword: (i) => {
|
|
132
|
-
|
|
132
|
+
s({ category: void 0, keyword: i || void 0 });
|
|
133
133
|
},
|
|
134
134
|
handlePrice: (i) => {
|
|
135
|
-
|
|
135
|
+
s({ price: i === e.price ? void 0 : i });
|
|
136
136
|
},
|
|
137
137
|
handleCategory: (i) => {
|
|
138
|
-
|
|
138
|
+
s({ category: i === e.category ? "" : i });
|
|
139
139
|
},
|
|
140
140
|
handleDeveloper: (i) => {
|
|
141
|
-
|
|
141
|
+
s({ owner: i || void 0 });
|
|
142
142
|
},
|
|
143
143
|
handlePage: (i) => {
|
|
144
|
-
|
|
144
|
+
s({ currentPage: i });
|
|
145
145
|
},
|
|
146
146
|
handleSwitchShowResources: (i) => {
|
|
147
|
-
|
|
147
|
+
s({ showResources: i });
|
|
148
148
|
},
|
|
149
149
|
handleSearchSelect: (i) => {
|
|
150
150
|
l(i);
|
|
151
151
|
}
|
|
152
152
|
};
|
|
153
153
|
}
|
|
154
|
-
const
|
|
154
|
+
const Ut = (e, r, o) => e && r || !o, Ge = (e) => [
|
|
155
155
|
{
|
|
156
156
|
name: e("sort.popularity"),
|
|
157
157
|
value: "popularity"
|
|
@@ -164,25 +164,25 @@ const Ht = (e, r, o) => e && r || !o, Ue = (e) => [
|
|
|
164
164
|
// name: t('sort.rating'),
|
|
165
165
|
// value: 'rating',
|
|
166
166
|
// },
|
|
167
|
-
],
|
|
168
|
-
var d,
|
|
169
|
-
const n =
|
|
170
|
-
if ((d =
|
|
171
|
-
return l.imageFilter ?
|
|
167
|
+
], qe = (e, r, o) => {
|
|
168
|
+
var d, f;
|
|
169
|
+
const n = ht(e), l = pt(n.search);
|
|
170
|
+
if ((d = mt(e, { strict: !0 })) == null ? void 0 : d.endsWith(".gif"))
|
|
171
|
+
return l.imageFilter ? ft({ ...n, search: "" }) : e;
|
|
172
172
|
if (l.imageFilter)
|
|
173
173
|
return e;
|
|
174
|
-
const
|
|
175
|
-
return
|
|
176
|
-
...i ||
|
|
177
|
-
v:
|
|
174
|
+
const s = o || ((f = window.blocklet) == null ? void 0 : f.version), { w: i, h: m } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
|
|
175
|
+
return ve(e, {
|
|
176
|
+
...i || m ? { imageFilter: "resize", w: i, h: m } : {},
|
|
177
|
+
v: s
|
|
178
178
|
});
|
|
179
|
-
},
|
|
179
|
+
}, Vt = (e) => [
|
|
180
180
|
{ name: e("blocklet.free"), value: "free" },
|
|
181
181
|
{ name: e("blocklet.payment"), value: "payment" }
|
|
182
|
-
],
|
|
182
|
+
], Gt = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), qt = (e, r) => (
|
|
183
183
|
// eslint-disable-next-line no-prototype-builtins
|
|
184
184
|
e == null ? void 0 : e.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
|
|
185
|
-
),
|
|
185
|
+
), Kt = () => window.innerWidth <= 600, Xt = {
|
|
186
186
|
common: {
|
|
187
187
|
title: "Blocklet Store",
|
|
188
188
|
searchStore: "Search Blocklet",
|
|
@@ -233,7 +233,7 @@ const Ht = (e, r, o) => e && r || !o, Ue = (e) => [
|
|
|
233
233
|
autocomplete: {
|
|
234
234
|
expandResult: 'View all search results for "{name}"'
|
|
235
235
|
}
|
|
236
|
-
},
|
|
236
|
+
}, Qt = {
|
|
237
237
|
common: {
|
|
238
238
|
title: "Blocklet 商店",
|
|
239
239
|
searchStore: "搜索 Blocklet",
|
|
@@ -284,22 +284,23 @@ const Ht = (e, r, o) => e && r || !o, Ue = (e) => [
|
|
|
284
284
|
autocomplete: {
|
|
285
285
|
expandResult: "查看 “{name}” 的所有搜索结果"
|
|
286
286
|
}
|
|
287
|
-
},
|
|
288
|
-
en:
|
|
289
|
-
zh:
|
|
290
|
-
},
|
|
287
|
+
}, de = {
|
|
288
|
+
en: Re(Xt),
|
|
289
|
+
zh: Re(Qt)
|
|
290
|
+
}, Ke = (e, r) => {
|
|
291
291
|
const o = {};
|
|
292
292
|
return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
|
|
293
|
-
},
|
|
294
|
-
const n =
|
|
293
|
+
}, Yt = (e) => (r, o) => {
|
|
294
|
+
const n = de[e] ? de[e][r] : de.en[r];
|
|
295
295
|
return qt(n, o) || r;
|
|
296
|
-
},
|
|
296
|
+
}, Xe = {
|
|
297
297
|
errors: {
|
|
298
298
|
fetchCategoriesError: null
|
|
299
299
|
},
|
|
300
300
|
loadings: {
|
|
301
301
|
fetchCategoriesLoading: !1
|
|
302
302
|
},
|
|
303
|
+
compact: !1,
|
|
303
304
|
endpoint: "",
|
|
304
305
|
wrapChildren: () => null,
|
|
305
306
|
t: (e) => e,
|
|
@@ -347,96 +348,98 @@ const Ht = (e, r, o) => e && r || !o, Ue = (e) => [
|
|
|
347
348
|
handlePage: () => {
|
|
348
349
|
}
|
|
349
350
|
}
|
|
350
|
-
},
|
|
351
|
-
function
|
|
351
|
+
}, Qe = _e(Xe), { Provider: Zt, Consumer: Ao } = Qe;
|
|
352
|
+
function Jt(e) {
|
|
352
353
|
const {
|
|
353
354
|
locale: r = "zh",
|
|
354
355
|
filters: o = {},
|
|
355
356
|
serverVersion: n = "",
|
|
356
357
|
onFilterChange: l = () => {
|
|
357
358
|
},
|
|
358
|
-
minItemWidth:
|
|
359
|
-
queryFilter:
|
|
359
|
+
minItemWidth: a = 350,
|
|
360
|
+
queryFilter: s = !0,
|
|
360
361
|
layout: i = {},
|
|
361
|
-
wrapChildren:
|
|
362
|
-
extraFilter: d = (
|
|
363
|
-
baseSearch:
|
|
364
|
-
fetchCategoryDelay:
|
|
365
|
-
showResourcesSwitch:
|
|
366
|
-
showCategory:
|
|
367
|
-
tagFilters:
|
|
368
|
-
children:
|
|
369
|
-
storeVersion:
|
|
362
|
+
wrapChildren: m = (T) => T,
|
|
363
|
+
extraFilter: d = (T) => T,
|
|
364
|
+
baseSearch: f = !1,
|
|
365
|
+
fetchCategoryDelay: u = 0,
|
|
366
|
+
showResourcesSwitch: x = !1,
|
|
367
|
+
showCategory: w = !0,
|
|
368
|
+
tagFilters: I = [],
|
|
369
|
+
children: g,
|
|
370
|
+
storeVersion: B,
|
|
370
371
|
onSearchSelect: p = () => {
|
|
371
372
|
},
|
|
372
|
-
endpoint:
|
|
373
|
-
blockletRender:
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
373
|
+
endpoint: C,
|
|
374
|
+
blockletRender: b,
|
|
375
|
+
compact: k = !1
|
|
376
|
+
} = e, A = Ke(n, B), z = V(() => ze({ baseURL: C, headers: A }), [C]), $ = Ht(o, { onFilterChange: l, emptyCategory: !i.showExplore, onSearchSelect: p }), [D, q] = E(""), {
|
|
377
|
+
data: j = [],
|
|
378
|
+
error: ae,
|
|
379
|
+
loading: Y,
|
|
380
|
+
run: Z
|
|
381
|
+
} = jt(z), H = V(() => {
|
|
382
|
+
const T = ot(j, [(W) => W.name], ["asc"]), _ = T.findIndex((W) => W.name === "All" || W.locales.en === "All");
|
|
383
|
+
return _ > -1 ? [{ ...T[_], _id: "All" }, ...T.slice(0, _), ...T.slice(_ + 1)] : T;
|
|
384
|
+
}, [j]), K = ge(Yt(r), [r]), c = V(() => Gt(H, r), [H, r]), S = Vt(K), N = {
|
|
385
|
+
search: $,
|
|
386
|
+
compact: k,
|
|
387
|
+
errors: { fetchCategoriesError: ae },
|
|
385
388
|
loadings: {
|
|
386
|
-
fetchCategoriesLoading:
|
|
389
|
+
fetchCategoriesLoading: Y
|
|
387
390
|
},
|
|
388
391
|
extraFilter: d,
|
|
389
|
-
endpoint:
|
|
390
|
-
queryFilter:
|
|
392
|
+
endpoint: C,
|
|
393
|
+
queryFilter: s,
|
|
391
394
|
layout: {
|
|
392
395
|
showExplore: i.showExplore ?? !1,
|
|
393
396
|
showCategory: i.showCategory ?? !0,
|
|
394
397
|
showTitle: i.showTitle ?? !0,
|
|
395
398
|
showSearch: i.showSearch ?? !0
|
|
396
399
|
},
|
|
397
|
-
minItemWidth:
|
|
398
|
-
wrapChildren:
|
|
399
|
-
t:
|
|
400
|
-
storeVersion:
|
|
400
|
+
minItemWidth: a,
|
|
401
|
+
wrapChildren: m,
|
|
402
|
+
t: K,
|
|
403
|
+
storeVersion: B,
|
|
401
404
|
serverVersion: n,
|
|
402
|
-
selectedCategory:
|
|
403
|
-
categoryList:
|
|
404
|
-
blockletRender:
|
|
405
|
+
selectedCategory: $.filters.category || (i.showExplore ? "" : "All"),
|
|
406
|
+
categoryList: H,
|
|
407
|
+
blockletRender: b,
|
|
405
408
|
locale: r,
|
|
406
|
-
categoryOptions:
|
|
407
|
-
priceOptions:
|
|
408
|
-
storeApi:
|
|
409
|
-
baseSearch:
|
|
410
|
-
showResourcesSwitch:
|
|
411
|
-
showCategory:
|
|
412
|
-
tagFilters:
|
|
409
|
+
categoryOptions: c,
|
|
410
|
+
priceOptions: S,
|
|
411
|
+
storeApi: z,
|
|
412
|
+
baseSearch: f,
|
|
413
|
+
showResourcesSwitch: x,
|
|
414
|
+
showCategory: w,
|
|
415
|
+
tagFilters: I,
|
|
413
416
|
onFilterChange: l,
|
|
414
|
-
getCategoryLocale: (
|
|
415
|
-
if (!
|
|
416
|
-
const _ =
|
|
417
|
+
getCategoryLocale: (T) => {
|
|
418
|
+
if (!T) return null;
|
|
419
|
+
const _ = j.find((W) => W._id === T || W.locales.en === "All");
|
|
417
420
|
return _ ? _.locales[r] || _.locales.en : null;
|
|
418
421
|
},
|
|
419
422
|
get developerName() {
|
|
420
|
-
return
|
|
423
|
+
return D;
|
|
421
424
|
},
|
|
422
|
-
updateDeveloperName:
|
|
425
|
+
updateDeveloperName: q
|
|
423
426
|
};
|
|
424
|
-
return
|
|
425
|
-
setTimeout(
|
|
426
|
-
}, [
|
|
427
|
+
return G(() => {
|
|
428
|
+
setTimeout(Z, u || 0);
|
|
429
|
+
}, [C, Z, u]), /* @__PURE__ */ t(Zt, { value: N, children: g });
|
|
427
430
|
}
|
|
428
431
|
function R() {
|
|
429
|
-
const e =
|
|
430
|
-
return e ||
|
|
432
|
+
const e = Me(Qe);
|
|
433
|
+
return e || Xe;
|
|
431
434
|
}
|
|
432
|
-
function
|
|
435
|
+
function Ye({
|
|
433
436
|
children: e,
|
|
434
437
|
onClick: r,
|
|
435
438
|
size: o = 32,
|
|
436
439
|
...n
|
|
437
440
|
}) {
|
|
438
441
|
return /* @__PURE__ */ t(
|
|
439
|
-
|
|
442
|
+
ie,
|
|
440
443
|
{
|
|
441
444
|
...n,
|
|
442
445
|
onClick: r,
|
|
@@ -459,97 +462,97 @@ function Xe({
|
|
|
459
462
|
}
|
|
460
463
|
);
|
|
461
464
|
}
|
|
462
|
-
function
|
|
465
|
+
function J(e, r) {
|
|
463
466
|
return e === void 0 ? r : e;
|
|
464
467
|
}
|
|
465
|
-
function
|
|
468
|
+
function Se({
|
|
466
469
|
xs: e,
|
|
467
470
|
sm: r,
|
|
468
471
|
md: o,
|
|
469
472
|
lg: n,
|
|
470
473
|
xl: l,
|
|
471
|
-
exact:
|
|
474
|
+
exact: a
|
|
472
475
|
}) {
|
|
473
|
-
const
|
|
474
|
-
if (
|
|
475
|
-
return i ? e || null :
|
|
476
|
-
let
|
|
477
|
-
return i || (
|
|
476
|
+
const s = gt(), i = U(s.breakpoints.down("sm")), m = U(s.breakpoints.between("sm", "md")), d = U(s.breakpoints.between("md", "lg")), f = U(s.breakpoints.between("lg", "xl"));
|
|
477
|
+
if (a)
|
|
478
|
+
return i ? e || null : m ? r || null : d ? o || null : f ? n || null : l || null;
|
|
479
|
+
let u = e;
|
|
480
|
+
return i || (u = J(r, u), m) || (u = J(o, u), d) || (u = J(n, u), f) ? u : J(l, u);
|
|
478
481
|
}
|
|
479
|
-
function
|
|
480
|
-
const { open: r, toggleOpen: o } =
|
|
482
|
+
function er({ children: e }) {
|
|
483
|
+
const { open: r, toggleOpen: o } = Ce();
|
|
481
484
|
return /* @__PURE__ */ t(
|
|
482
|
-
|
|
485
|
+
Se,
|
|
483
486
|
{
|
|
484
|
-
xs: /* @__PURE__ */ t(
|
|
487
|
+
xs: /* @__PURE__ */ t(xt, { open: r, onClose: () => o(!1), children: e }),
|
|
485
488
|
md: /* @__PURE__ */ t(y, { children: e })
|
|
486
489
|
}
|
|
487
490
|
);
|
|
488
491
|
}
|
|
489
|
-
const
|
|
490
|
-
|
|
492
|
+
const tr = lt(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
|
|
493
|
+
ie,
|
|
491
494
|
{
|
|
492
495
|
ref: n,
|
|
493
496
|
disableElevation: !0,
|
|
494
497
|
disabled: r || e,
|
|
495
498
|
...o,
|
|
496
499
|
sx: [{ borderRadius: "4px" }, ...Array.isArray(o.sx) ? o.sx : [o.sx]],
|
|
497
|
-
startIcon: e && /* @__PURE__ */ t(
|
|
500
|
+
startIcon: e && /* @__PURE__ */ t(le, { size: "1em" })
|
|
498
501
|
}
|
|
499
502
|
));
|
|
500
|
-
function
|
|
501
|
-
var
|
|
502
|
-
const
|
|
503
|
-
|
|
504
|
-
|
|
503
|
+
function xe({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
|
|
504
|
+
var B;
|
|
505
|
+
const a = re(null), s = we(), [i, m] = E(!1), [d, f] = E(e !== null ? e : ""), u = U(s.breakpoints.down("sm"));
|
|
506
|
+
G(() => {
|
|
507
|
+
f(e !== null ? e : "");
|
|
505
508
|
}, [e]);
|
|
506
|
-
const
|
|
507
|
-
|
|
508
|
-
}, []),
|
|
509
|
-
|
|
509
|
+
const x = ge(() => {
|
|
510
|
+
m(!1);
|
|
511
|
+
}, []), w = ge(() => {
|
|
512
|
+
m(!0);
|
|
510
513
|
}, []);
|
|
511
|
-
function
|
|
512
|
-
|
|
514
|
+
function I(p) {
|
|
515
|
+
f(p.value), o(p.value), u && x();
|
|
513
516
|
}
|
|
514
|
-
function
|
|
517
|
+
function g(p) {
|
|
515
518
|
return p === d;
|
|
516
519
|
}
|
|
517
520
|
return /* @__PURE__ */ h(M, { children: [
|
|
518
521
|
/* @__PURE__ */ h(
|
|
519
|
-
|
|
522
|
+
rr,
|
|
520
523
|
{
|
|
521
|
-
ref:
|
|
522
|
-
onClick:
|
|
524
|
+
ref: a,
|
|
525
|
+
onClick: w,
|
|
523
526
|
variant: "outlined",
|
|
524
527
|
size: "medium",
|
|
525
|
-
className: ["my-select__selector",
|
|
526
|
-
sx: { minWidth: "auto", color: "text.primary", borderRadius: "8px" },
|
|
528
|
+
className: ["my-select__selector", nt(d) ? "" : "my-select__selector--active"].join(" "),
|
|
529
|
+
sx: { minWidth: { xs: "100px", md: "auto" }, color: "text.primary", borderRadius: "8px" },
|
|
527
530
|
...l,
|
|
528
531
|
children: [
|
|
529
|
-
((
|
|
530
|
-
/* @__PURE__ */ t(
|
|
532
|
+
((B = r.find((p) => p.value === d)) == null ? void 0 : B.name) || n,
|
|
533
|
+
/* @__PURE__ */ t(St, { className: "my-select__arrowdown", component: wt, sx: { width: 18, height: 18 } })
|
|
531
534
|
]
|
|
532
535
|
}
|
|
533
536
|
),
|
|
534
|
-
/* @__PURE__ */ t(
|
|
535
|
-
|
|
537
|
+
/* @__PURE__ */ t(Ct, { open: i, anchorEl: a.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: p, placement: C }) => /* @__PURE__ */ t(
|
|
538
|
+
kt,
|
|
536
539
|
{
|
|
537
540
|
...p,
|
|
538
|
-
style: { transformOrigin:
|
|
539
|
-
children: /* @__PURE__ */ t(
|
|
541
|
+
style: { transformOrigin: C === "bottom" ? "center top" : "center bottom" },
|
|
542
|
+
children: /* @__PURE__ */ t(vt, { children: /* @__PURE__ */ t(bt, { onClickAway: x, children: /* @__PURE__ */ t(or, { autoFocusItem: i, onMouseEnter: w, onMouseLeave: x, children: r.map((b) => /* @__PURE__ */ h($e, { onClick: () => I(b), sx: { fontSize: 14 }, children: [
|
|
540
543
|
/* @__PURE__ */ t(
|
|
541
|
-
|
|
544
|
+
yt,
|
|
542
545
|
{
|
|
543
|
-
sx: { mr: 1, fontSize: 16, visibility:
|
|
546
|
+
sx: { mr: 1, fontSize: 16, visibility: g(b.value) ? "visible" : "hidden" }
|
|
544
547
|
}
|
|
545
548
|
),
|
|
546
|
-
|
|
547
|
-
] },
|
|
549
|
+
b.name
|
|
550
|
+
] }, b.value)) }) }) })
|
|
548
551
|
}
|
|
549
552
|
) })
|
|
550
553
|
] });
|
|
551
554
|
}
|
|
552
|
-
const
|
|
555
|
+
const rr = Q(tr)`
|
|
553
556
|
border: 1px solid #f0f0f0;
|
|
554
557
|
padding: 6px 8px 6px 12px;
|
|
555
558
|
font-weight: ${(e) => e.theme.typography.fontWeightRegular};
|
|
@@ -577,7 +580,7 @@ const tr = X(er)`
|
|
|
577
580
|
margin-right: 3px;
|
|
578
581
|
}
|
|
579
582
|
}
|
|
580
|
-
`,
|
|
583
|
+
`, or = Q(je)`
|
|
581
584
|
.my-select__option__icon {
|
|
582
585
|
color: transparent;
|
|
583
586
|
font-size: 14px;
|
|
@@ -594,8 +597,8 @@ const tr = X(er)`
|
|
|
594
597
|
}
|
|
595
598
|
}
|
|
596
599
|
`;
|
|
597
|
-
function
|
|
598
|
-
const { search: e, t: r } = R(), { filters: o, handleSort: n, handlePrice: l } = e,
|
|
600
|
+
function Ze() {
|
|
601
|
+
const { search: e, t: r } = R(), { filters: o, handleSort: n, handlePrice: l } = e, a = Ge(r);
|
|
599
602
|
return /* @__PURE__ */ h(
|
|
600
603
|
F,
|
|
601
604
|
{
|
|
@@ -606,26 +609,26 @@ function Ye() {
|
|
|
606
609
|
justifyContent: "space-between",
|
|
607
610
|
children: [
|
|
608
611
|
/* @__PURE__ */ t(
|
|
609
|
-
|
|
612
|
+
We,
|
|
610
613
|
{
|
|
611
614
|
control: /* @__PURE__ */ t(
|
|
612
|
-
|
|
615
|
+
Ne,
|
|
613
616
|
{
|
|
614
617
|
checked: o.price === "free",
|
|
615
618
|
size: "small",
|
|
616
619
|
sx: { "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
|
|
617
|
-
onChange: (
|
|
620
|
+
onChange: (s) => l(s.target.checked ? "free" : "")
|
|
618
621
|
}
|
|
619
622
|
),
|
|
620
623
|
label: r("blocklet.free")
|
|
621
624
|
}
|
|
622
625
|
),
|
|
623
626
|
/* @__PURE__ */ t(
|
|
624
|
-
|
|
627
|
+
xe,
|
|
625
628
|
{
|
|
626
|
-
value: o.sortBy ||
|
|
627
|
-
options:
|
|
628
|
-
onChange: (
|
|
629
|
+
value: o.sortBy || a[0].value,
|
|
630
|
+
options: a,
|
|
631
|
+
onChange: (s) => n(s),
|
|
629
632
|
placeholder: r("sort.sort")
|
|
630
633
|
}
|
|
631
634
|
)
|
|
@@ -633,15 +636,15 @@ function Ye() {
|
|
|
633
636
|
}
|
|
634
637
|
);
|
|
635
638
|
}
|
|
636
|
-
function
|
|
637
|
-
const { selectedCategory: r, search: o, t: n, categoryOptions: l, loadings:
|
|
638
|
-
|
|
639
|
-
|
|
640
|
-
}, [Object.values(
|
|
641
|
-
const
|
|
642
|
-
return
|
|
639
|
+
function nr({ menus: e }) {
|
|
640
|
+
const { selectedCategory: r, search: o, t: n, categoryOptions: l, loadings: a, layout: s, baseSearch: i, compact: m } = R(), { filters: d, handleActiveMenu: f, handleCategory: u, cleanFilter: x } = o, { toggleOpen: w } = Ce();
|
|
641
|
+
G(() => {
|
|
642
|
+
w(!1);
|
|
643
|
+
}, [Object.values(d).join("")]);
|
|
644
|
+
const I = Ut(i, s.showSearch, d.keyword);
|
|
645
|
+
return s.showCategory && !m ? /* @__PURE__ */ h(er, { children: [
|
|
643
646
|
/* @__PURE__ */ t(
|
|
644
|
-
|
|
647
|
+
Se,
|
|
645
648
|
{
|
|
646
649
|
xs: /* @__PURE__ */ h(
|
|
647
650
|
F,
|
|
@@ -655,8 +658,8 @@ function or({ menus: e }) {
|
|
|
655
658
|
borderBottom: 1,
|
|
656
659
|
borderColor: "divider",
|
|
657
660
|
children: [
|
|
658
|
-
/* @__PURE__ */ t(
|
|
659
|
-
/* @__PURE__ */ t(
|
|
661
|
+
/* @__PURE__ */ t(Ye, { onClick: () => w(!1), children: /* @__PURE__ */ t(ke, {}) }),
|
|
662
|
+
/* @__PURE__ */ t(v, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: n("common.category") })
|
|
660
663
|
]
|
|
661
664
|
}
|
|
662
665
|
),
|
|
@@ -666,41 +669,41 @@ function or({ menus: e }) {
|
|
|
666
669
|
/* @__PURE__ */ t(
|
|
667
670
|
F,
|
|
668
671
|
{
|
|
669
|
-
visibility:
|
|
672
|
+
visibility: a.fetchCategoriesLoading ? "hidden" : "visible",
|
|
670
673
|
width: { xs: 268, md: 200 },
|
|
671
674
|
boxSizing: "content-box",
|
|
672
675
|
p: { xs: 2, md: 0 },
|
|
673
676
|
pr: { md: 6 },
|
|
674
|
-
children:
|
|
675
|
-
|
|
677
|
+
children: I ? /* @__PURE__ */ h(M, { children: [
|
|
678
|
+
s.showExplore && /* @__PURE__ */ h(y, { mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
|
|
676
679
|
/* @__PURE__ */ h(y, { display: "flex", alignItems: "center", gap: 1, children: [
|
|
677
|
-
/* @__PURE__ */ t(
|
|
680
|
+
/* @__PURE__ */ t(X, { icon: ct, width: 20, height: 20 }),
|
|
678
681
|
/* @__PURE__ */ t(
|
|
679
|
-
|
|
682
|
+
v,
|
|
680
683
|
{
|
|
681
684
|
variant: "body1",
|
|
682
|
-
color: !r && !
|
|
683
|
-
fontWeight: !r && !
|
|
685
|
+
color: !r && !d.menu ? "text.primary" : "text.lighter",
|
|
686
|
+
fontWeight: !r && !d.menu ? "fontWeightMedium" : void 0,
|
|
684
687
|
sx: { cursor: "pointer" },
|
|
685
688
|
onClick: () => {
|
|
686
|
-
|
|
689
|
+
w(!1), x();
|
|
687
690
|
},
|
|
688
691
|
children: n("explore.title")
|
|
689
692
|
}
|
|
690
693
|
)
|
|
691
694
|
] }),
|
|
692
695
|
e == null ? void 0 : e.map((g) => /* @__PURE__ */ h(y, { display: "flex", alignItems: "center", mt: 2, gap: 1, children: [
|
|
693
|
-
typeof g.icon == "string" ? /* @__PURE__ */ t(
|
|
696
|
+
typeof g.icon == "string" ? /* @__PURE__ */ t(X, { icon: g.icon, width: 20, height: 20 }) : g.icon,
|
|
694
697
|
/* @__PURE__ */ t(
|
|
695
|
-
|
|
698
|
+
v,
|
|
696
699
|
{
|
|
697
700
|
variant: "body1",
|
|
698
|
-
color:
|
|
699
|
-
fontWeight:
|
|
701
|
+
color: d.menu === g.key ? "text.primary" : "text.lighter",
|
|
702
|
+
fontWeight: d.menu === g.key ? "fontWeightMedium" : void 0,
|
|
700
703
|
sx: { cursor: "pointer" },
|
|
701
704
|
onClick: () => {
|
|
702
705
|
var B;
|
|
703
|
-
|
|
706
|
+
w(!1), f(g.key), (B = g.onClick) == null || B.call(g);
|
|
704
707
|
},
|
|
705
708
|
children: g.title
|
|
706
709
|
}
|
|
@@ -708,7 +711,7 @@ function or({ menus: e }) {
|
|
|
708
711
|
] }, g.key))
|
|
709
712
|
] }),
|
|
710
713
|
!!l.length && /* @__PURE__ */ t(F, { gap: 2, children: l.map((g) => /* @__PURE__ */ t(
|
|
711
|
-
|
|
714
|
+
v,
|
|
712
715
|
{
|
|
713
716
|
variant: "body1",
|
|
714
717
|
title: g.name,
|
|
@@ -717,37 +720,37 @@ function or({ menus: e }) {
|
|
|
717
720
|
color: r === g.value ? "text.primary" : "text.lighter",
|
|
718
721
|
textTransform: "capitalize",
|
|
719
722
|
onClick: () => {
|
|
720
|
-
r === g.value ?
|
|
723
|
+
r === g.value ? x() : u(g.value), w(!1);
|
|
721
724
|
},
|
|
722
725
|
children: g.name
|
|
723
726
|
},
|
|
724
727
|
g.value
|
|
725
728
|
)) })
|
|
726
|
-
] }) : /* @__PURE__ */ t(
|
|
729
|
+
] }) : /* @__PURE__ */ t(Ze, {})
|
|
727
730
|
}
|
|
728
731
|
)
|
|
729
732
|
] }) : null;
|
|
730
733
|
}
|
|
731
|
-
function
|
|
732
|
-
const { endpoint: e, serverVersion: r, storeVersion: o } = R(), n =
|
|
734
|
+
function Ie() {
|
|
735
|
+
const { endpoint: e, serverVersion: r, storeVersion: o } = R(), n = Ke(r, o), l = V(() => ze({
|
|
733
736
|
baseURL: e,
|
|
734
737
|
headers: n
|
|
735
738
|
}), [e]);
|
|
736
739
|
return {
|
|
737
|
-
get: async (
|
|
738
|
-
const { data:
|
|
739
|
-
return
|
|
740
|
+
get: async (a) => {
|
|
741
|
+
const { data: s } = await l.get(a);
|
|
742
|
+
return s;
|
|
740
743
|
},
|
|
741
|
-
post: async (
|
|
742
|
-
const { data: i } = await l.post(
|
|
744
|
+
post: async (a, s) => {
|
|
745
|
+
const { data: i } = await l.post(a, s);
|
|
743
746
|
return i;
|
|
744
747
|
}
|
|
745
748
|
};
|
|
746
749
|
}
|
|
747
|
-
const
|
|
748
|
-
return /* @__PURE__ */ t(y, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(
|
|
750
|
+
const Je = at(function(r) {
|
|
751
|
+
return /* @__PURE__ */ t(y, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(le, {}) });
|
|
749
752
|
});
|
|
750
|
-
function
|
|
753
|
+
function Ee({
|
|
751
754
|
icon: e,
|
|
752
755
|
children: r,
|
|
753
756
|
maxWidth: o = 100,
|
|
@@ -756,7 +759,7 @@ function Pe({
|
|
|
756
759
|
return (r === 0 || r) && /* @__PURE__ */ h(F, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
|
|
757
760
|
e,
|
|
758
761
|
/* @__PURE__ */ t(
|
|
759
|
-
|
|
762
|
+
v,
|
|
760
763
|
{
|
|
761
764
|
flex: 1,
|
|
762
765
|
variant: "body2",
|
|
@@ -767,18 +770,18 @@ function Pe({
|
|
|
767
770
|
)
|
|
768
771
|
] });
|
|
769
772
|
}
|
|
770
|
-
const
|
|
771
|
-
function
|
|
772
|
-
var
|
|
773
|
-
const { t: e, search: r } = R(), { get: o } =
|
|
774
|
-
data:
|
|
773
|
+
const ir = 16 / 9, ue = 292, ye = 189, oe = 336;
|
|
774
|
+
function lr() {
|
|
775
|
+
var g, B;
|
|
776
|
+
const { t: e, search: r } = R(), { get: o } = Ie(), n = we(), l = U(n.breakpoints.down("md")), a = ((B = (g = window.blocklet) == null ? void 0 : g.preferences) == null ? void 0 : B.homeBanner) || [], {
|
|
777
|
+
data: s = [],
|
|
775
778
|
error: i,
|
|
776
|
-
loading:
|
|
777
|
-
} =
|
|
779
|
+
loading: m
|
|
780
|
+
} = ne(async () => {
|
|
778
781
|
const p = await o(
|
|
779
|
-
|
|
782
|
+
ve(P.blockletsPath, { didList: a.map((C) => C.did).join(",") })
|
|
780
783
|
);
|
|
781
|
-
return p != null && p.dataList ?
|
|
784
|
+
return p != null && p.dataList ? a.map((C) => p.dataList.find((b) => b.did === C.did)) : [];
|
|
782
785
|
});
|
|
783
786
|
i && console.error("Get Banner Blocklets error:", i);
|
|
784
787
|
const d = {
|
|
@@ -789,20 +792,20 @@ function ir() {
|
|
|
789
792
|
cursor: "pointer",
|
|
790
793
|
color: "text.lighter"
|
|
791
794
|
};
|
|
792
|
-
return !i &&
|
|
793
|
-
/* @__PURE__ */ t(
|
|
795
|
+
return !i && a.length > 0 ? /* @__PURE__ */ h(M, { children: [
|
|
796
|
+
/* @__PURE__ */ t(v, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
|
|
794
797
|
/* @__PURE__ */ t(
|
|
795
798
|
y,
|
|
796
799
|
{
|
|
797
|
-
height: { xs: "auto", md:
|
|
798
|
-
minHeight:
|
|
800
|
+
height: { xs: "auto", md: ue },
|
|
801
|
+
minHeight: ue,
|
|
799
802
|
position: "relative",
|
|
800
803
|
border: 1,
|
|
801
804
|
borderColor: "divider",
|
|
802
805
|
borderRadius: 3,
|
|
803
806
|
overflow: "hidden",
|
|
804
|
-
children:
|
|
805
|
-
/* @__PURE__ */ t(O, { variant: "rounded", height:
|
|
807
|
+
children: m ? /* @__PURE__ */ h(y, { p: 5, display: { md: "flex" }, gap: 5, alignItems: "center", justifyContent: "center", children: [
|
|
808
|
+
/* @__PURE__ */ t(O, { variant: "rounded", height: ye, width: oe }),
|
|
806
809
|
/* @__PURE__ */ h(y, { flex: 1, height: "100%", children: [
|
|
807
810
|
/* @__PURE__ */ t(O, { variant: "text", height: 50, width: 100 }),
|
|
808
811
|
/* @__PURE__ */ t(O, { variant: "text", height: 40, width: "100%" }),
|
|
@@ -814,7 +817,7 @@ function ir() {
|
|
|
814
817
|
/* @__PURE__ */ t(O, { variant: "rounded", height: 30, width: 100 })
|
|
815
818
|
] })
|
|
816
819
|
] }) : /* @__PURE__ */ t(
|
|
817
|
-
|
|
820
|
+
Tt,
|
|
818
821
|
{
|
|
819
822
|
showNav: !0,
|
|
820
823
|
autoPlay: !0,
|
|
@@ -825,17 +828,17 @@ function ir() {
|
|
|
825
828
|
showBullets: !1,
|
|
826
829
|
showThumbnails: !1,
|
|
827
830
|
showFullscreenButton: !1,
|
|
828
|
-
renderLeftNav: (p) => /* @__PURE__ */ t(y, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(
|
|
829
|
-
renderRightNav: (p) => /* @__PURE__ */ t(y, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(
|
|
830
|
-
items:
|
|
831
|
+
renderLeftNav: (p) => /* @__PURE__ */ t(y, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Bt, { sx: { ...d, left: 5 } }) }),
|
|
832
|
+
renderRightNav: (p) => /* @__PURE__ */ t(y, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Rt, { sx: { ...d, right: 5 } }) }),
|
|
833
|
+
items: a.map((p, C) => ({
|
|
831
834
|
original: p.did,
|
|
832
835
|
renderItem: () => {
|
|
833
836
|
var z;
|
|
834
|
-
const
|
|
837
|
+
const b = s[C] || {}, k = p.cover || sr(p.did, (z = b.screenshots) == null ? void 0 : z[0]), A = qe(k, n.breakpoints.values.md * 2);
|
|
835
838
|
return /* @__PURE__ */ h(
|
|
836
839
|
F,
|
|
837
840
|
{
|
|
838
|
-
height: { xs: "auto", md:
|
|
841
|
+
height: { xs: "auto", md: ue },
|
|
839
842
|
sx: {
|
|
840
843
|
cursor: "pointer",
|
|
841
844
|
"&::before": {
|
|
@@ -845,7 +848,7 @@ function ir() {
|
|
|
845
848
|
left: 0,
|
|
846
849
|
right: 0,
|
|
847
850
|
bottom: 0,
|
|
848
|
-
backgroundImage: `url("${
|
|
851
|
+
backgroundImage: `url("${A}")`,
|
|
849
852
|
backgroundSize: "cover",
|
|
850
853
|
filter: "blur(50px)",
|
|
851
854
|
opacity: 0.15,
|
|
@@ -857,17 +860,17 @@ function ir() {
|
|
|
857
860
|
justifyContent: "center",
|
|
858
861
|
alignItems: { xs: "flex-start", md: "center" },
|
|
859
862
|
p: { xs: 2, md: 5 },
|
|
860
|
-
onClick: () => r.handleSearchSelect(
|
|
863
|
+
onClick: () => r.handleSearchSelect(b),
|
|
861
864
|
gap: { xs: 2, md: 5 },
|
|
862
865
|
children: [
|
|
863
|
-
|
|
866
|
+
f(A),
|
|
864
867
|
/* @__PURE__ */ h(F, { flex: 1, height: "100%", gap: 3, children: [
|
|
865
868
|
/* @__PURE__ */ h(y, { flex: 1, children: [
|
|
866
|
-
|
|
867
|
-
|
|
869
|
+
u(p.name || b.title || p.name),
|
|
870
|
+
x(p.desc || b.description)
|
|
868
871
|
] }),
|
|
869
|
-
|
|
870
|
-
|
|
872
|
+
b.did && w(b, p.baseNum),
|
|
873
|
+
I(b)
|
|
871
874
|
] })
|
|
872
875
|
]
|
|
873
876
|
}
|
|
@@ -879,15 +882,15 @@ function ir() {
|
|
|
879
882
|
}
|
|
880
883
|
)
|
|
881
884
|
] }) : null;
|
|
882
|
-
function
|
|
883
|
-
return /* @__PURE__ */ t(y, { borderRadius: 2, overflow: "hidden", position: "relative", width: { xs: "100%", md:
|
|
885
|
+
function f(p) {
|
|
886
|
+
return /* @__PURE__ */ t(y, { borderRadius: 2, overflow: "hidden", position: "relative", width: { xs: "100%", md: oe }, children: /* @__PURE__ */ t(cr, { url: p }) });
|
|
884
887
|
}
|
|
885
|
-
function
|
|
886
|
-
return /* @__PURE__ */ t(
|
|
888
|
+
function u(p) {
|
|
889
|
+
return /* @__PURE__ */ t(v, { variant: "h2", width: "100%", children: p });
|
|
887
890
|
}
|
|
888
|
-
function
|
|
891
|
+
function x(p) {
|
|
889
892
|
return /* @__PURE__ */ t(
|
|
890
|
-
|
|
893
|
+
v,
|
|
891
894
|
{
|
|
892
895
|
variant: "body2",
|
|
893
896
|
color: "text.secondary",
|
|
@@ -909,16 +912,16 @@ function ir() {
|
|
|
909
912
|
}
|
|
910
913
|
);
|
|
911
914
|
}
|
|
912
|
-
function
|
|
913
|
-
const { did:
|
|
915
|
+
function w(p, C = 0) {
|
|
916
|
+
const { did: b, owner: k, stats: A } = p;
|
|
914
917
|
return /* @__PURE__ */ h(y, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
|
|
915
|
-
/* @__PURE__ */ t(
|
|
916
|
-
/* @__PURE__ */ t(
|
|
918
|
+
/* @__PURE__ */ t(Ee, { icon: /* @__PURE__ */ t(He, { src: k.avatar, did: b, size: 20, variant: "circle" }), children: k.fullName }),
|
|
919
|
+
/* @__PURE__ */ t(Ee, { icon: /* @__PURE__ */ t(X, { icon: It }), title: `${A.downloads + C}`, children: ar(A.downloads + C) })
|
|
917
920
|
] });
|
|
918
921
|
}
|
|
919
|
-
function
|
|
922
|
+
function I(p) {
|
|
920
923
|
return /* @__PURE__ */ t(
|
|
921
|
-
|
|
924
|
+
ie,
|
|
922
925
|
{
|
|
923
926
|
variant: "outlined",
|
|
924
927
|
size: "small",
|
|
@@ -936,8 +939,8 @@ function ir() {
|
|
|
936
939
|
);
|
|
937
940
|
}
|
|
938
941
|
}
|
|
939
|
-
const
|
|
940
|
-
function
|
|
942
|
+
const ar = (e) => Number.isNaN(e) ? 0 : e < 1e3 ? e : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : e < 1e9 ? `${(e / 1e6).toFixed(1)}m` : `${(e / 1e9).toFixed(1)}b`, sr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
|
|
943
|
+
function cr({ url: e }) {
|
|
941
944
|
const [r, o] = E(!0);
|
|
942
945
|
return /* @__PURE__ */ h(M, { children: [
|
|
943
946
|
r && /* @__PURE__ */ t(
|
|
@@ -945,8 +948,8 @@ function sr({ url: e }) {
|
|
|
945
948
|
{
|
|
946
949
|
variant: "rectangular",
|
|
947
950
|
sx: {
|
|
948
|
-
width: { xs: "100%", md:
|
|
949
|
-
height: { xs: "auto", md:
|
|
951
|
+
width: { xs: "100%", md: oe },
|
|
952
|
+
height: { xs: "auto", md: ye }
|
|
950
953
|
}
|
|
951
954
|
}
|
|
952
955
|
),
|
|
@@ -957,60 +960,60 @@ function sr({ url: e }) {
|
|
|
957
960
|
component: "img",
|
|
958
961
|
src: e,
|
|
959
962
|
alt: "",
|
|
960
|
-
width: { xs: "100%", md:
|
|
961
|
-
height: { xs: "auto", md:
|
|
963
|
+
width: { xs: "100%", md: oe },
|
|
964
|
+
height: { xs: "auto", md: ye },
|
|
962
965
|
borderRadius: 2,
|
|
963
966
|
border: 1,
|
|
964
967
|
borderColor: "divider",
|
|
965
|
-
sx: { objectFit: "container", cursor: "pointer", aspectRatio:
|
|
968
|
+
sx: { objectFit: "container", cursor: "pointer", aspectRatio: ir },
|
|
966
969
|
onLoad: () => o(!1),
|
|
967
970
|
onError: () => o(!1)
|
|
968
971
|
}
|
|
969
972
|
)
|
|
970
973
|
] });
|
|
971
974
|
}
|
|
972
|
-
function
|
|
975
|
+
function dr({ title: e, blocklets: r }) {
|
|
973
976
|
const { blockletRender: o, serverVersion: n } = R();
|
|
974
977
|
return /* @__PURE__ */ h(y, { mt: 3, children: [
|
|
975
|
-
/* @__PURE__ */ t(
|
|
976
|
-
/* @__PURE__ */ t(
|
|
978
|
+
/* @__PURE__ */ t(v, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
|
|
979
|
+
/* @__PURE__ */ t(Te, { container: !0, spacing: 2, boxSizing: "border-box", maxWidth: "calc(100vw - 16px)", children: r.map((l) => /* @__PURE__ */ t(Te, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": l.did, children: /* @__PURE__ */ t(y, { padding: "1px", children: o({ blocklet: l, blocklets: r, serverVersion: n }) }) }, l.did)) })
|
|
977
980
|
] });
|
|
978
981
|
}
|
|
979
|
-
function
|
|
980
|
-
const { get: e } =
|
|
982
|
+
function ur() {
|
|
983
|
+
const { get: e } = Ie(), { t: r } = R(), {
|
|
981
984
|
data: o = [],
|
|
982
985
|
error: n,
|
|
983
986
|
loading: l
|
|
984
|
-
} =
|
|
985
|
-
const
|
|
986
|
-
return Array.isArray(
|
|
987
|
+
} = ne(async () => {
|
|
988
|
+
const a = await e(P.explorePath);
|
|
989
|
+
return Array.isArray(a) ? a : [];
|
|
987
990
|
});
|
|
988
|
-
return n ? /* @__PURE__ */ t(
|
|
989
|
-
/* @__PURE__ */ t(
|
|
991
|
+
return n ? /* @__PURE__ */ t(be, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : l ? /* @__PURE__ */ t(Je, { mt: 15 }) : /* @__PURE__ */ h(M, { children: [
|
|
992
|
+
/* @__PURE__ */ t(lr, {}),
|
|
990
993
|
o.map(
|
|
991
|
-
(
|
|
992
|
-
var
|
|
993
|
-
return ((
|
|
994
|
+
(a) => {
|
|
995
|
+
var s;
|
|
996
|
+
return ((s = a.blocklets) == null ? void 0 : s.length) > 0 ? /* @__PURE__ */ t(dr, { title: r(`explore.${a.type}`), blocklets: a.blocklets }, a.type) : null;
|
|
994
997
|
}
|
|
995
998
|
)
|
|
996
999
|
] });
|
|
997
1000
|
}
|
|
998
|
-
const
|
|
999
|
-
function
|
|
1001
|
+
const he = "__FREE_TEXT__", Fe = "__NO_RESULT__", pe = 40;
|
|
1002
|
+
function hr({
|
|
1000
1003
|
endpoint: e,
|
|
1001
1004
|
t: r,
|
|
1002
1005
|
locale: o,
|
|
1003
1006
|
filters: n,
|
|
1004
1007
|
handleKeyword: l,
|
|
1005
|
-
handleSearchSelect:
|
|
1006
|
-
...
|
|
1008
|
+
handleSearchSelect: a,
|
|
1009
|
+
...s
|
|
1007
1010
|
}) {
|
|
1008
|
-
const i =
|
|
1011
|
+
const i = re(null), m = re(!1), [d, f] = E(!1), [u, x] = E(""), [w, I] = E(!1), g = Ie(), [B, p] = E(!1), C = (s == null ? void 0 : s.placeholder) || r("common.searchStore"), b = async (c) => {
|
|
1009
1012
|
p(!0);
|
|
1010
|
-
const
|
|
1011
|
-
return p(!1),
|
|
1012
|
-
}, { data:
|
|
1013
|
-
(c) => c ?
|
|
1013
|
+
const S = await g.get(Be(e, ve(P.blockletsPath, c)));
|
|
1014
|
+
return p(!1), S.dataList || [];
|
|
1015
|
+
}, { data: k, run: A } = ne(
|
|
1016
|
+
(c) => c ? b({
|
|
1014
1017
|
sortBy: P.nameDesc,
|
|
1015
1018
|
page: 1,
|
|
1016
1019
|
pageSize: 10,
|
|
@@ -1021,23 +1024,23 @@ function ur({
|
|
|
1021
1024
|
manual: !0
|
|
1022
1025
|
}
|
|
1023
1026
|
);
|
|
1024
|
-
|
|
1025
|
-
p(!0),
|
|
1026
|
-
}, [n.keyword,
|
|
1027
|
+
G(() => {
|
|
1028
|
+
p(!0), A(n.keyword), x(n.keyword || "");
|
|
1029
|
+
}, [n.keyword, A]), _t(
|
|
1027
1030
|
"ctrl + k, command + k",
|
|
1028
1031
|
(c) => {
|
|
1029
|
-
var
|
|
1030
|
-
return c.stopPropagation(), c.preventDefault(), (
|
|
1032
|
+
var S, N;
|
|
1033
|
+
return c.stopPropagation(), c.preventDefault(), (N = (S = i.current) == null ? void 0 : S.querySelector("input")) == null || N.focus(), !1;
|
|
1031
1034
|
},
|
|
1032
1035
|
{ enableOnTags: ["INPUT"] }
|
|
1033
1036
|
);
|
|
1034
|
-
const z =
|
|
1037
|
+
const z = De((c) => A(c), { wait: 300 }), $ = { name: he, title: u, did: "" };
|
|
1035
1038
|
let D = [];
|
|
1036
|
-
return
|
|
1037
|
-
/* @__PURE__ */ h(
|
|
1039
|
+
return u && (B ? D = [$] : k != null && k.length ? D = [$, ...k] : D = [{ name: Fe, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ h(M, { children: [
|
|
1040
|
+
/* @__PURE__ */ h(Lt, { fullScreen: !0, open: w, sx: { display: { md: "none" } }, children: [
|
|
1038
1041
|
/* @__PURE__ */ h(y, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
|
|
1039
1042
|
/* @__PURE__ */ t(
|
|
1040
|
-
|
|
1043
|
+
Ue,
|
|
1041
1044
|
{
|
|
1042
1045
|
fullWidth: !0,
|
|
1043
1046
|
sx: {
|
|
@@ -1055,51 +1058,51 @@ function ur({
|
|
|
1055
1058
|
}
|
|
1056
1059
|
},
|
|
1057
1060
|
autoFocus: !0,
|
|
1058
|
-
placeholder:
|
|
1061
|
+
placeholder: C,
|
|
1059
1062
|
className: "bl-autocomplete-input",
|
|
1060
|
-
value:
|
|
1061
|
-
onChange: (c) =>
|
|
1062
|
-
startAdornment:
|
|
1063
|
-
endAdornment:
|
|
1063
|
+
value: u,
|
|
1064
|
+
onChange: (c) => q(c.target.value),
|
|
1065
|
+
startAdornment: H(w),
|
|
1066
|
+
endAdornment: K()
|
|
1064
1067
|
}
|
|
1065
1068
|
),
|
|
1066
1069
|
/* @__PURE__ */ t(
|
|
1067
|
-
|
|
1070
|
+
ie,
|
|
1068
1071
|
{
|
|
1069
1072
|
variant: "outlined",
|
|
1070
1073
|
onClick: () => {
|
|
1071
|
-
|
|
1074
|
+
I(!1), x(n.keyword || "");
|
|
1072
1075
|
},
|
|
1073
1076
|
children: r("common.cancel")
|
|
1074
1077
|
}
|
|
1075
1078
|
)
|
|
1076
1079
|
] }),
|
|
1077
|
-
/* @__PURE__ */ t(
|
|
1080
|
+
/* @__PURE__ */ t(je, { sx: { p: 0.5 }, children: D.map((c) => Y(c)) })
|
|
1078
1081
|
] }),
|
|
1079
1082
|
/* @__PURE__ */ t(
|
|
1080
|
-
|
|
1083
|
+
te,
|
|
1081
1084
|
{
|
|
1082
1085
|
sx: { display: { sx: "block", md: "none" }, fontSize: 28, color: "text.lighter" },
|
|
1083
|
-
onClick: () =>
|
|
1086
|
+
onClick: () => I(!0)
|
|
1084
1087
|
}
|
|
1085
1088
|
),
|
|
1086
1089
|
/* @__PURE__ */ t(
|
|
1087
|
-
|
|
1090
|
+
Ft,
|
|
1088
1091
|
{
|
|
1089
1092
|
ref: i,
|
|
1090
|
-
open: !!
|
|
1093
|
+
open: !!u && d,
|
|
1091
1094
|
size: "small",
|
|
1092
|
-
onOpen: () =>
|
|
1093
|
-
onClose: (c,
|
|
1094
|
-
|
|
1095
|
+
onOpen: () => f(!0),
|
|
1096
|
+
onClose: (c, S) => {
|
|
1097
|
+
f(!1), S === "selectOption" && !m.current && l(u);
|
|
1095
1098
|
},
|
|
1096
1099
|
onKeyDown: (c) => {
|
|
1097
|
-
c.key === "Enter" && !
|
|
1100
|
+
c.key === "Enter" && !u && j();
|
|
1098
1101
|
},
|
|
1099
1102
|
disableClearable: !0,
|
|
1100
|
-
inputValue:
|
|
1101
|
-
onInputChange: (c,
|
|
1102
|
-
isOptionEqualToValue: (c,
|
|
1103
|
+
inputValue: u,
|
|
1104
|
+
onInputChange: (c, S) => q(S),
|
|
1105
|
+
isOptionEqualToValue: (c, S) => c.name === S.name,
|
|
1103
1106
|
getOptionLabel: (c) => c.title,
|
|
1104
1107
|
getOptionKey: (c) => c.name,
|
|
1105
1108
|
noOptionsText: r("blocklet.noResults"),
|
|
@@ -1116,25 +1119,25 @@ function ur({
|
|
|
1116
1119
|
}
|
|
1117
1120
|
},
|
|
1118
1121
|
renderInput: (c) => /* @__PURE__ */ t(
|
|
1119
|
-
|
|
1122
|
+
Ot,
|
|
1120
1123
|
{
|
|
1121
1124
|
...c,
|
|
1122
1125
|
InputProps: {
|
|
1123
1126
|
...c.InputProps,
|
|
1124
1127
|
autoFocus: !0,
|
|
1125
|
-
placeholder:
|
|
1128
|
+
placeholder: C,
|
|
1126
1129
|
className: "bl-autocomplete-input",
|
|
1127
|
-
value:
|
|
1128
|
-
startAdornment:
|
|
1129
|
-
endAdornment:
|
|
1130
|
+
value: u,
|
|
1131
|
+
startAdornment: H(d),
|
|
1132
|
+
endAdornment: K()
|
|
1130
1133
|
}
|
|
1131
1134
|
}
|
|
1132
1135
|
),
|
|
1133
1136
|
filterOptions: (c) => c,
|
|
1134
|
-
...
|
|
1137
|
+
...s,
|
|
1135
1138
|
options: D,
|
|
1136
|
-
renderOption: (c,
|
|
1137
|
-
value:
|
|
1139
|
+
renderOption: (c, S) => Y(S),
|
|
1140
|
+
value: $,
|
|
1138
1141
|
sx: [
|
|
1139
1142
|
{
|
|
1140
1143
|
bgcolor: "#F9FAFB",
|
|
@@ -1149,44 +1152,44 @@ function ur({
|
|
|
1149
1152
|
borderWidth: "1px"
|
|
1150
1153
|
}
|
|
1151
1154
|
},
|
|
1152
|
-
...Array.isArray(
|
|
1155
|
+
...Array.isArray(s.sx) ? s.sx : [s.sx]
|
|
1153
1156
|
]
|
|
1154
1157
|
}
|
|
1155
1158
|
)
|
|
1156
1159
|
] });
|
|
1157
|
-
function
|
|
1158
|
-
p(!0),
|
|
1160
|
+
function q(c) {
|
|
1161
|
+
p(!0), x(c), m.current = !1, z.run(c);
|
|
1159
1162
|
}
|
|
1160
|
-
function
|
|
1161
|
-
|
|
1163
|
+
function j() {
|
|
1164
|
+
I(!1), x(""), q(""), l("");
|
|
1162
1165
|
}
|
|
1163
|
-
function
|
|
1164
|
-
c != null && c.did ? (
|
|
1166
|
+
function ae(c) {
|
|
1167
|
+
c != null && c.did ? (I(!1), m.current = !0, x(""), a(c)) : c.name === he && (I(!1), l(u));
|
|
1165
1168
|
}
|
|
1166
|
-
function
|
|
1167
|
-
var
|
|
1169
|
+
function Y(c) {
|
|
1170
|
+
var S, N;
|
|
1168
1171
|
return /* @__PURE__ */ h(
|
|
1169
|
-
|
|
1172
|
+
$e,
|
|
1170
1173
|
{
|
|
1171
1174
|
sx: { display: "flex", alignItems: "center", gap: 1, p: 1.5, borderRadius: "8px" },
|
|
1172
|
-
onClick: () =>
|
|
1175
|
+
onClick: () => ae(c),
|
|
1173
1176
|
children: [
|
|
1174
|
-
|
|
1175
|
-
/* @__PURE__ */ h(
|
|
1176
|
-
/* @__PURE__ */ t(
|
|
1177
|
-
/* @__PURE__ */ t(
|
|
1177
|
+
Z(c),
|
|
1178
|
+
/* @__PURE__ */ h(v, { variant: "body1", children: [
|
|
1179
|
+
/* @__PURE__ */ t(v, { fontWeight: "fontWeightMedium", display: "flex", alignItems: "center", gap: 1, children: c.title }),
|
|
1180
|
+
/* @__PURE__ */ t(v, { sx: { color: "text.lighter" }, fontSize: "13px", children: ((N = (S = c.category) == null ? void 0 : S.locales) == null ? void 0 : N[o || "en"]) || "" })
|
|
1178
1181
|
] })
|
|
1179
1182
|
]
|
|
1180
1183
|
},
|
|
1181
1184
|
c.did
|
|
1182
1185
|
);
|
|
1183
1186
|
}
|
|
1184
|
-
function
|
|
1185
|
-
if ([
|
|
1187
|
+
function Z(c) {
|
|
1188
|
+
if ([he, Fe].includes(c.name))
|
|
1186
1189
|
return /* @__PURE__ */ t(
|
|
1187
1190
|
y,
|
|
1188
1191
|
{
|
|
1189
|
-
width:
|
|
1192
|
+
width: pe,
|
|
1190
1193
|
p: "6px",
|
|
1191
1194
|
display: "flex",
|
|
1192
1195
|
justifyContent: "center",
|
|
@@ -1194,52 +1197,52 @@ function ur({
|
|
|
1194
1197
|
color: "text.lighter",
|
|
1195
1198
|
bgcolor: "#F1F3F5",
|
|
1196
1199
|
borderRadius: "8px",
|
|
1197
|
-
children: /* @__PURE__ */ t(
|
|
1200
|
+
children: /* @__PURE__ */ t(te, { sx: { fontSize: 28 } })
|
|
1198
1201
|
}
|
|
1199
1202
|
);
|
|
1200
|
-
let
|
|
1201
|
-
return c.logo && (
|
|
1203
|
+
let S = "";
|
|
1204
|
+
return c.logo && (S = Be(e, "assets", c.did, qe(c.logo, pe, c.version))), /* @__PURE__ */ t(He, { src: S, size: pe, style: { borderRadius: "8px", overflow: "hidden" } });
|
|
1202
1205
|
}
|
|
1203
|
-
function
|
|
1204
|
-
return /* @__PURE__ */ t(y, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: c &&
|
|
1206
|
+
function H(c = !0) {
|
|
1207
|
+
return /* @__PURE__ */ t(y, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: c && u && B ? /* @__PURE__ */ t(le, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(te, { sx: { fontSize: 16, cursor: "default" } }) });
|
|
1205
1208
|
}
|
|
1206
|
-
function
|
|
1207
|
-
return
|
|
1209
|
+
function K() {
|
|
1210
|
+
return u ? /* @__PURE__ */ t(y, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(ke, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => j() }) }) : null;
|
|
1208
1211
|
}
|
|
1209
1212
|
}
|
|
1210
|
-
function
|
|
1211
|
-
const { search: o } = R(), { filters: n, handleKeyword: l } = o, [
|
|
1212
|
-
const { value:
|
|
1213
|
-
|
|
1213
|
+
function pr({ placeholder: e = "Type to search...", ...r }) {
|
|
1214
|
+
const { search: o } = R(), { filters: n, handleKeyword: l } = o, [a, s] = E(n.keyword || ""), i = De(l, { wait: 300 }), m = (f) => {
|
|
1215
|
+
const { value: u } = f.target;
|
|
1216
|
+
s(u), i.run(u);
|
|
1214
1217
|
}, d = () => {
|
|
1215
|
-
|
|
1218
|
+
s(""), l("");
|
|
1216
1219
|
};
|
|
1217
|
-
return
|
|
1218
|
-
|
|
1220
|
+
return G(() => {
|
|
1221
|
+
s(n.keyword || "");
|
|
1219
1222
|
}, [n.keyword]), /* @__PURE__ */ t(
|
|
1220
|
-
|
|
1223
|
+
mr,
|
|
1221
1224
|
{
|
|
1222
1225
|
inputProps: {
|
|
1223
1226
|
"data-cy": "search-blocklet"
|
|
1224
1227
|
},
|
|
1225
|
-
startAdornment: /* @__PURE__ */ t(
|
|
1226
|
-
onChange:
|
|
1228
|
+
startAdornment: /* @__PURE__ */ t(Ae, { position: "start", children: /* @__PURE__ */ t(fr, { sx: { fontSize: 18, ml: -0.5 } }) }),
|
|
1229
|
+
onChange: m,
|
|
1227
1230
|
placeholder: e,
|
|
1228
|
-
value:
|
|
1231
|
+
value: a,
|
|
1229
1232
|
title: e,
|
|
1230
1233
|
"data-cy": "search",
|
|
1231
|
-
endAdornment:
|
|
1234
|
+
endAdornment: a && /* @__PURE__ */ t(Ae, { position: "end", children: /* @__PURE__ */ t(gr, { "data-cy": "search-delete", onClick: d }) }),
|
|
1232
1235
|
...r
|
|
1233
1236
|
}
|
|
1234
1237
|
);
|
|
1235
1238
|
}
|
|
1236
|
-
const
|
|
1239
|
+
const mr = Q(Ue)`
|
|
1237
1240
|
background-color: ${(e) => e.theme.palette.grey[50]};
|
|
1238
1241
|
font-size: 14px;
|
|
1239
1242
|
border-radius: 6px;
|
|
1240
1243
|
width: 100%;
|
|
1241
1244
|
.MuiInputBase-input {
|
|
1242
|
-
padding: 8px 0 8px
|
|
1245
|
+
padding: 8px 0 8px 0px;
|
|
1243
1246
|
}
|
|
1244
1247
|
.MuiOutlinedInput-notchedOutline {
|
|
1245
1248
|
border: none;
|
|
@@ -1250,22 +1253,34 @@ const pr = X(je)`
|
|
|
1250
1253
|
color: transparent;
|
|
1251
1254
|
}
|
|
1252
1255
|
}
|
|
1253
|
-
`,
|
|
1256
|
+
`, fr = Q(te)`
|
|
1254
1257
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1255
|
-
|
|
1256
|
-
@media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
|
|
1257
|
-
font-size: 24px;
|
|
1258
|
-
}
|
|
1259
|
-
`, fr = X(we)`
|
|
1258
|
+
`, gr = Q(ke)`
|
|
1260
1259
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1261
1260
|
font-size: 16px;
|
|
1262
1261
|
cursor: pointer;
|
|
1263
1262
|
`;
|
|
1264
|
-
function
|
|
1265
|
-
|
|
1263
|
+
function xr() {
|
|
1264
|
+
var b;
|
|
1265
|
+
const {
|
|
1266
|
+
search: e,
|
|
1267
|
+
t: r,
|
|
1268
|
+
endpoint: o,
|
|
1269
|
+
locale: n,
|
|
1270
|
+
getCategoryLocale: l,
|
|
1271
|
+
developerName: a,
|
|
1272
|
+
showResourcesSwitch: s,
|
|
1273
|
+
layout: i,
|
|
1274
|
+
baseSearch: m,
|
|
1275
|
+
categoryOptions: d,
|
|
1276
|
+
compact: f
|
|
1277
|
+
} = R(), { filters: u, handleSort: x, handlePrice: w, handleDeveloper: I, handleSwitchShowResources: g, cleanFilter: B, handleCategory: p } = e, C = Ge(r);
|
|
1266
1278
|
return /* @__PURE__ */ h(
|
|
1267
1279
|
F,
|
|
1268
1280
|
{
|
|
1281
|
+
position: "sticky",
|
|
1282
|
+
top: 0,
|
|
1283
|
+
zIndex: 1e3,
|
|
1269
1284
|
className: "filter-bar",
|
|
1270
1285
|
direction: { xs: "column", md: "row" },
|
|
1271
1286
|
alignItems: { xs: "flex-start", md: "center" },
|
|
@@ -1274,21 +1289,23 @@ function gr() {
|
|
|
1274
1289
|
spacing: { xs: 1, md: 0 },
|
|
1275
1290
|
pt: { xs: 2, md: 0 },
|
|
1276
1291
|
px: 0,
|
|
1277
|
-
pb: 3,
|
|
1292
|
+
pb: f ? 2 : 3,
|
|
1293
|
+
sx: { backgroundColor: "background.default" },
|
|
1278
1294
|
children: [
|
|
1279
|
-
/* @__PURE__ */ t(
|
|
1295
|
+
!f && /* @__PURE__ */ t(v, { variant: "h2", textTransform: "capitalize", children: l(u.category) }),
|
|
1280
1296
|
/* @__PURE__ */ h(
|
|
1281
1297
|
F,
|
|
1282
1298
|
{
|
|
1283
1299
|
flex: 1,
|
|
1284
1300
|
direction: "row",
|
|
1285
1301
|
alignItems: "center",
|
|
1302
|
+
flexWrap: { xs: "wrap", md: "nowrap" },
|
|
1286
1303
|
width: "100%",
|
|
1287
|
-
justifyContent: { xs: "
|
|
1304
|
+
justifyContent: { xs: "flex-start", md: "flex-end" },
|
|
1288
1305
|
gap: 2,
|
|
1289
1306
|
children: [
|
|
1290
|
-
i.showSearch ? /* @__PURE__ */ t(y, { flex: 1, children:
|
|
1291
|
-
|
|
1307
|
+
i.showSearch ? /* @__PURE__ */ t(y, { flex: 1, flexBasis: { xs: "100%", md: "auto" }, children: m ? /* @__PURE__ */ t(pr, {}) : /* @__PURE__ */ t(
|
|
1308
|
+
hr,
|
|
1292
1309
|
{
|
|
1293
1310
|
locale: n,
|
|
1294
1311
|
endpoint: o,
|
|
@@ -1304,45 +1321,54 @@ function gr() {
|
|
|
1304
1321
|
handleSearchSelect: e.handleSearchSelect
|
|
1305
1322
|
}
|
|
1306
1323
|
) }) : null,
|
|
1307
|
-
|
|
1308
|
-
|
|
1324
|
+
u.owner && a && /* @__PURE__ */ t(
|
|
1325
|
+
Pe,
|
|
1309
1326
|
{
|
|
1310
|
-
label: r("blocklet.authorTag", { name:
|
|
1327
|
+
label: r("blocklet.authorTag", { name: a }),
|
|
1311
1328
|
size: "small",
|
|
1312
|
-
onDelete: () =>
|
|
1329
|
+
onDelete: () => I("")
|
|
1313
1330
|
}
|
|
1314
1331
|
),
|
|
1315
|
-
|
|
1316
|
-
|
|
1332
|
+
u.resourceDid && u.resourceBlocklet && /* @__PURE__ */ t(
|
|
1333
|
+
Pe,
|
|
1317
1334
|
{
|
|
1318
|
-
label: r("blocklet.resourceTag", { name:
|
|
1335
|
+
label: r("blocklet.resourceTag", { name: u.resourceBlocklet }),
|
|
1319
1336
|
size: "small",
|
|
1320
|
-
onDelete: () =>
|
|
1337
|
+
onDelete: () => B(["resourceDid", "resourceBlocklet", "showResources"])
|
|
1321
1338
|
}
|
|
1322
1339
|
),
|
|
1323
|
-
|
|
1324
|
-
|
|
1340
|
+
s ? /* @__PURE__ */ t(
|
|
1341
|
+
Le,
|
|
1325
1342
|
{
|
|
1326
|
-
checked:
|
|
1327
|
-
onChange: (
|
|
1343
|
+
checked: u.showResources !== "false",
|
|
1344
|
+
onChange: (k) => g(k ? "true" : "false"),
|
|
1328
1345
|
label: r("common.showResources")
|
|
1329
1346
|
}
|
|
1330
1347
|
) : null,
|
|
1331
1348
|
/* @__PURE__ */ t(
|
|
1332
|
-
|
|
1349
|
+
Le,
|
|
1333
1350
|
{
|
|
1334
|
-
checked:
|
|
1335
|
-
onChange: (
|
|
1351
|
+
checked: u.price === "free",
|
|
1352
|
+
onChange: (k) => w(k ? "free" : ""),
|
|
1336
1353
|
label: r("blocklet.free")
|
|
1337
1354
|
}
|
|
1338
1355
|
),
|
|
1356
|
+
f && /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t(
|
|
1357
|
+
xe,
|
|
1358
|
+
{
|
|
1359
|
+
value: u.category || ((b = d[0]) == null ? void 0 : b.value),
|
|
1360
|
+
options: d,
|
|
1361
|
+
placeholder: r("common.category"),
|
|
1362
|
+
onChange: (k) => p(k)
|
|
1363
|
+
}
|
|
1364
|
+
) }),
|
|
1339
1365
|
/* @__PURE__ */ t(
|
|
1340
|
-
|
|
1366
|
+
xe,
|
|
1341
1367
|
{
|
|
1342
|
-
value:
|
|
1343
|
-
options:
|
|
1368
|
+
value: u.sortBy || C[0].value,
|
|
1369
|
+
options: C,
|
|
1344
1370
|
placeholder: r("sort.sort"),
|
|
1345
|
-
onChange: (
|
|
1371
|
+
onChange: (k) => x(k)
|
|
1346
1372
|
}
|
|
1347
1373
|
)
|
|
1348
1374
|
]
|
|
@@ -1352,22 +1378,22 @@ function gr() {
|
|
|
1352
1378
|
}
|
|
1353
1379
|
);
|
|
1354
1380
|
}
|
|
1355
|
-
function
|
|
1381
|
+
function Le({
|
|
1356
1382
|
checked: e,
|
|
1357
1383
|
onChange: r,
|
|
1358
1384
|
label: o
|
|
1359
1385
|
}) {
|
|
1360
1386
|
return /* @__PURE__ */ t(
|
|
1361
|
-
|
|
1387
|
+
We,
|
|
1362
1388
|
{
|
|
1363
1389
|
sx: { m: 0, p: 0 },
|
|
1364
1390
|
className: "check-button",
|
|
1365
1391
|
control: /* @__PURE__ */ t(
|
|
1366
|
-
|
|
1392
|
+
Ne,
|
|
1367
1393
|
{
|
|
1368
1394
|
checked: e,
|
|
1369
|
-
icon: /* @__PURE__ */ t(
|
|
1370
|
-
checkedIcon: /* @__PURE__ */ t(
|
|
1395
|
+
icon: /* @__PURE__ */ t(X, { style: { padding: 0 }, icon: At }),
|
|
1396
|
+
checkedIcon: /* @__PURE__ */ t(X, { style: { padding: 0, color: "#3478E2" }, icon: Et }),
|
|
1371
1397
|
size: "large",
|
|
1372
1398
|
sx: { p: 0, mr: 1 },
|
|
1373
1399
|
onChange: (n) => r(n.target.checked)
|
|
@@ -1377,123 +1403,123 @@ function Ee({
|
|
|
1377
1403
|
}
|
|
1378
1404
|
);
|
|
1379
1405
|
}
|
|
1380
|
-
function
|
|
1406
|
+
function ee({ children: e }) {
|
|
1381
1407
|
return /* @__PURE__ */ h(y, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.lighter", children: [
|
|
1382
|
-
/* @__PURE__ */ t(
|
|
1408
|
+
/* @__PURE__ */ t(Mt, {}),
|
|
1383
1409
|
e
|
|
1384
1410
|
] });
|
|
1385
1411
|
}
|
|
1386
|
-
function
|
|
1412
|
+
function Oe() {
|
|
1387
1413
|
const { t: e } = R();
|
|
1388
|
-
return /* @__PURE__ */ t(
|
|
1414
|
+
return /* @__PURE__ */ t(v, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
|
|
1389
1415
|
}
|
|
1390
|
-
function
|
|
1416
|
+
function me({ filterTip: e, keywordTip: r }) {
|
|
1391
1417
|
const { t: o, locale: n } = R(), l = () => n === "zh" ? "、" : " , ";
|
|
1392
1418
|
return /* @__PURE__ */ h(y, { mt: 1, display: "flex", children: [
|
|
1393
|
-
/* @__PURE__ */ t(
|
|
1394
|
-
e && /* @__PURE__ */ t(
|
|
1419
|
+
/* @__PURE__ */ t(v, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
|
|
1420
|
+
e && /* @__PURE__ */ t(v, { children: o("blocklet.filterTip") }),
|
|
1395
1421
|
e && r && l(),
|
|
1396
|
-
r && /* @__PURE__ */ t(
|
|
1422
|
+
r && /* @__PURE__ */ t(v, { children: o("blocklet.keywordTip") })
|
|
1397
1423
|
] });
|
|
1398
1424
|
}
|
|
1399
|
-
function
|
|
1425
|
+
function fe({
|
|
1400
1426
|
primaryStart: e,
|
|
1401
1427
|
primaryEnd: r,
|
|
1402
1428
|
filter: o
|
|
1403
1429
|
}) {
|
|
1404
|
-
return /* @__PURE__ */ h(
|
|
1405
|
-
/* @__PURE__ */ t(
|
|
1406
|
-
/* @__PURE__ */ t(
|
|
1407
|
-
/* @__PURE__ */ h(
|
|
1430
|
+
return /* @__PURE__ */ h(v, { variant: "subtitle2", display: "flex", gap: 0.5, mx: 0.5, children: [
|
|
1431
|
+
/* @__PURE__ */ t(v, { children: e }),
|
|
1432
|
+
/* @__PURE__ */ t(v, { color: "primary", children: o }),
|
|
1433
|
+
/* @__PURE__ */ h(v, { children: [
|
|
1408
1434
|
r,
|
|
1409
1435
|
" "
|
|
1410
1436
|
] })
|
|
1411
1437
|
] });
|
|
1412
1438
|
}
|
|
1413
|
-
function
|
|
1414
|
-
const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = R(), { filters: l } = r,
|
|
1415
|
-
if (l.keyword &&
|
|
1416
|
-
return /* @__PURE__ */ h(
|
|
1439
|
+
function yr() {
|
|
1440
|
+
const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = R(), { filters: l } = r, a = !!n || !!l.price;
|
|
1441
|
+
if (l.keyword && a)
|
|
1442
|
+
return /* @__PURE__ */ h(ee, { children: [
|
|
1417
1443
|
/* @__PURE__ */ t(
|
|
1418
|
-
|
|
1444
|
+
fe,
|
|
1419
1445
|
{
|
|
1420
1446
|
primaryStart: e("blocklet.noBlockletPart1"),
|
|
1421
1447
|
primaryEnd: e("blocklet.noBlockletPart2"),
|
|
1422
1448
|
filter: l.keyword
|
|
1423
1449
|
}
|
|
1424
1450
|
),
|
|
1425
|
-
/* @__PURE__ */ t(
|
|
1451
|
+
/* @__PURE__ */ t(me, { keywordTip: !0, filterTip: !0 })
|
|
1426
1452
|
] });
|
|
1427
1453
|
if (l.keyword)
|
|
1428
|
-
return /* @__PURE__ */ h(
|
|
1454
|
+
return /* @__PURE__ */ h(ee, { children: [
|
|
1429
1455
|
/* @__PURE__ */ t(
|
|
1430
|
-
|
|
1456
|
+
fe,
|
|
1431
1457
|
{
|
|
1432
1458
|
primaryStart: e("blocklet.noBlockletPart1"),
|
|
1433
1459
|
primaryEnd: e("blocklet.noBlockletPart2"),
|
|
1434
1460
|
filter: l.keyword
|
|
1435
1461
|
}
|
|
1436
1462
|
),
|
|
1437
|
-
/* @__PURE__ */ t(
|
|
1463
|
+
/* @__PURE__ */ t(me, { keywordTip: !0 })
|
|
1438
1464
|
] });
|
|
1439
|
-
if (
|
|
1440
|
-
const
|
|
1441
|
-
return /* @__PURE__ */ h(
|
|
1442
|
-
|
|
1443
|
-
|
|
1465
|
+
if (a) {
|
|
1466
|
+
const s = o(n);
|
|
1467
|
+
return /* @__PURE__ */ h(ee, { children: [
|
|
1468
|
+
s ? /* @__PURE__ */ t(
|
|
1469
|
+
fe,
|
|
1444
1470
|
{
|
|
1445
1471
|
primaryStart: e("blocklet.noCategoryResults1"),
|
|
1446
1472
|
primaryEnd: e("blocklet.noCategoryResults2"),
|
|
1447
|
-
filter:
|
|
1473
|
+
filter: s
|
|
1448
1474
|
}
|
|
1449
|
-
) : /* @__PURE__ */ t(
|
|
1450
|
-
/* @__PURE__ */ t(
|
|
1475
|
+
) : /* @__PURE__ */ t(Oe, {}),
|
|
1476
|
+
/* @__PURE__ */ t(me, { filterTip: !0 })
|
|
1451
1477
|
] });
|
|
1452
1478
|
}
|
|
1453
|
-
return /* @__PURE__ */ t(
|
|
1479
|
+
return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(Oe, {}) });
|
|
1454
1480
|
}
|
|
1455
|
-
const
|
|
1481
|
+
const wr = (e, r, o, n) => dt(
|
|
1456
1482
|
async (l) => {
|
|
1457
1483
|
l || (o.currentPage = o.defaultCurrentPage);
|
|
1458
|
-
const { currentPage:
|
|
1484
|
+
const { currentPage: a, pageSize: s } = o, i = {
|
|
1459
1485
|
...r,
|
|
1460
1486
|
category: r.category === "All" ? "" : r.category,
|
|
1461
1487
|
sortBy: P[r.sortBy],
|
|
1462
|
-
page:
|
|
1463
|
-
pageSize:
|
|
1488
|
+
page: a,
|
|
1489
|
+
pageSize: s
|
|
1464
1490
|
};
|
|
1465
1491
|
n(null);
|
|
1466
|
-
const { data:
|
|
1467
|
-
return o.currentPage++, { page:
|
|
1492
|
+
const { data: m = {} } = await e.get(P.blockletsPath, { params: i });
|
|
1493
|
+
return o.currentPage++, { page: a, pageSize: s, list: (m == null ? void 0 : m.dataList) || [], total: (m == null ? void 0 : m.total) || 0 };
|
|
1468
1494
|
},
|
|
1469
1495
|
{
|
|
1470
1496
|
isNoMore: (l) => l ? l.page * l.pageSize >= l.total : !1,
|
|
1471
|
-
reloadDeps: [e,
|
|
1497
|
+
reloadDeps: [e, zt(r)],
|
|
1472
1498
|
onError: n
|
|
1473
1499
|
}
|
|
1474
1500
|
);
|
|
1475
|
-
function
|
|
1476
|
-
var
|
|
1477
|
-
const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: l } = R(), { filters:
|
|
1501
|
+
function br() {
|
|
1502
|
+
var u;
|
|
1503
|
+
const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: l } = R(), { filters: a } = r, s = ut({
|
|
1478
1504
|
currentPage: P.currentPage,
|
|
1479
|
-
pageSize:
|
|
1505
|
+
pageSize: Kt() ? P.mobilePageSize : P.pageSize,
|
|
1480
1506
|
defaultCurrentPage: P.defaultCurrentPage
|
|
1481
|
-
}), [i,
|
|
1507
|
+
}), [i, m] = E(null), d = wr(e, a, s, m), f = V(
|
|
1482
1508
|
() => {
|
|
1483
|
-
var
|
|
1484
|
-
return o ? o(((
|
|
1509
|
+
var x, w;
|
|
1510
|
+
return o ? o(((x = d.data) == null ? void 0 : x.list) || []) : ((w = d.data) == null ? void 0 : w.list) || [];
|
|
1485
1511
|
},
|
|
1486
1512
|
[d.data, o]
|
|
1487
1513
|
);
|
|
1488
|
-
return
|
|
1489
|
-
const
|
|
1490
|
-
l((
|
|
1491
|
-
}, [
|
|
1492
|
-
blocklets:
|
|
1514
|
+
return G(() => {
|
|
1515
|
+
const x = f.find((w) => w.owner.did === a.owner);
|
|
1516
|
+
l((x == null ? void 0 : x.owner.fullName) || (x == null ? void 0 : x.author.name) || "");
|
|
1517
|
+
}, [a.owner, f, l]), {
|
|
1518
|
+
blocklets: f,
|
|
1493
1519
|
fetchBlockletsError: i,
|
|
1494
1520
|
loadMore: d.loadMore,
|
|
1495
1521
|
hasNextPage: !d.noMore,
|
|
1496
|
-
total: ((
|
|
1522
|
+
total: ((u = d.data) == null ? void 0 : u.total) || 0,
|
|
1497
1523
|
loadings: {
|
|
1498
1524
|
fetchBlockletsLoading: d.loading,
|
|
1499
1525
|
loadingMore: d.loadingMore
|
|
@@ -1504,54 +1530,55 @@ function wr() {
|
|
|
1504
1530
|
}
|
|
1505
1531
|
};
|
|
1506
1532
|
}
|
|
1507
|
-
function
|
|
1508
|
-
const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: l, minItemWidth:
|
|
1509
|
-
loading:
|
|
1510
|
-
hasNextPage:
|
|
1511
|
-
onLoadMore:
|
|
1533
|
+
function kr() {
|
|
1534
|
+
const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: l, minItemWidth: a, layout: s, baseSearch: i, compact: m } = R(), { filters: d } = r, { blocklets: f, errors: u, loadMore: x, loadings: w, hasNextPage: I, total: g } = br(), [B] = Pt({
|
|
1535
|
+
loading: w.fetchBlockletsLoading || w.loadingMore,
|
|
1536
|
+
hasNextPage: I,
|
|
1537
|
+
onLoadMore: x
|
|
1512
1538
|
});
|
|
1513
|
-
if (
|
|
1514
|
-
const
|
|
1515
|
-
return /* @__PURE__ */ t(
|
|
1539
|
+
if (u.fetchBlockletsError) {
|
|
1540
|
+
const k = new Error(`Failed to fetch blocklets from ${o}: ${u.fetchBlockletsError.message}`);
|
|
1541
|
+
return /* @__PURE__ */ t(be, { error: k });
|
|
1516
1542
|
}
|
|
1517
|
-
const
|
|
1543
|
+
const p = i && s.showSearch || !d.keyword;
|
|
1518
1544
|
return /* @__PURE__ */ h(M, { children: [
|
|
1519
|
-
|
|
1520
|
-
/* @__PURE__ */ t(
|
|
1521
|
-
|
|
1545
|
+
p ? /* @__PURE__ */ t(xr, {}) : /* @__PURE__ */ h(M, { children: [
|
|
1546
|
+
/* @__PURE__ */ t(Se, { xs: /* @__PURE__ */ t(Ze, {}), md: null }),
|
|
1547
|
+
b()
|
|
1522
1548
|
] }),
|
|
1523
|
-
|
|
1524
|
-
!
|
|
1549
|
+
C(),
|
|
1550
|
+
!w.fetchBlockletsLoading && I && /* @__PURE__ */ t(y, { height: 70, minHeight: 70, display: "flex", justifyContent: "center", py: 2, overflow: "hidden", ref: B, children: /* @__PURE__ */ t(le, {}) })
|
|
1525
1551
|
] });
|
|
1526
|
-
function
|
|
1527
|
-
return
|
|
1552
|
+
function C() {
|
|
1553
|
+
return w.fetchBlockletsLoading ? /* @__PURE__ */ t(Je, { mt: 15 }) : f.length ? /* @__PURE__ */ t(
|
|
1528
1554
|
y,
|
|
1529
1555
|
{
|
|
1530
1556
|
className: "blocklet-list",
|
|
1531
1557
|
display: "grid",
|
|
1532
1558
|
gridTemplateColumns: {
|
|
1533
1559
|
xs: "1fr",
|
|
1534
|
-
sm: `repeat(auto-fill, minmax(${
|
|
1560
|
+
sm: `repeat(auto-fill, minmax(${a}px, 1fr))`
|
|
1535
1561
|
},
|
|
1536
1562
|
p: "2px",
|
|
1537
|
-
|
|
1538
|
-
|
|
1563
|
+
rowGap: 2,
|
|
1564
|
+
columnGap: m ? 0 : 2,
|
|
1565
|
+
children: f.map((k) => /* @__PURE__ */ t(
|
|
1539
1566
|
y,
|
|
1540
1567
|
{
|
|
1541
|
-
"data-blocklet-did":
|
|
1568
|
+
"data-blocklet-did": k.did,
|
|
1542
1569
|
minWidth: {
|
|
1543
1570
|
xs: "100%",
|
|
1544
|
-
sm:
|
|
1571
|
+
sm: a
|
|
1545
1572
|
},
|
|
1546
1573
|
maxWidth: "calc(100vw - 32px)",
|
|
1547
|
-
children: n({ blocklet:
|
|
1574
|
+
children: n({ blocklet: k, blocklets: f, serverVersion: l })
|
|
1548
1575
|
},
|
|
1549
|
-
|
|
1576
|
+
k.did
|
|
1550
1577
|
))
|
|
1551
1578
|
}
|
|
1552
|
-
) : /* @__PURE__ */ t(
|
|
1579
|
+
) : /* @__PURE__ */ t(yr, {});
|
|
1553
1580
|
}
|
|
1554
|
-
function
|
|
1581
|
+
function b() {
|
|
1555
1582
|
return /* @__PURE__ */ h(
|
|
1556
1583
|
F,
|
|
1557
1584
|
{
|
|
@@ -1562,17 +1589,17 @@ function br() {
|
|
|
1562
1589
|
mb: 2,
|
|
1563
1590
|
mt: { xs: 2, md: 0 },
|
|
1564
1591
|
children: [
|
|
1565
|
-
/* @__PURE__ */ t(
|
|
1566
|
-
/* @__PURE__ */ t(
|
|
1592
|
+
/* @__PURE__ */ t(v, { variant: "h3", children: e("blocklet.search", { keyword: d.keyword }) }),
|
|
1593
|
+
/* @__PURE__ */ t(v, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count: g }) })
|
|
1567
1594
|
]
|
|
1568
1595
|
}
|
|
1569
1596
|
);
|
|
1570
1597
|
}
|
|
1571
1598
|
}
|
|
1572
|
-
function
|
|
1573
|
-
const { t: e, selectedCategory: r, getCategoryLocale: o } = R(), { toggleOpen: n } =
|
|
1599
|
+
function vr() {
|
|
1600
|
+
const { t: e, selectedCategory: r, getCategoryLocale: o } = R(), { toggleOpen: n } = Ce();
|
|
1574
1601
|
return /* @__PURE__ */ h(
|
|
1575
|
-
|
|
1602
|
+
v,
|
|
1576
1603
|
{
|
|
1577
1604
|
variant: "body1",
|
|
1578
1605
|
display: { xs: "flex", md: "none" },
|
|
@@ -1581,30 +1608,54 @@ function kr() {
|
|
|
1581
1608
|
py: 2,
|
|
1582
1609
|
fontWeight: "fontWeightMedium",
|
|
1583
1610
|
children: [
|
|
1584
|
-
/* @__PURE__ */ t(
|
|
1611
|
+
/* @__PURE__ */ t(Ye, { onClick: () => n(!0), children: /* @__PURE__ */ t(Dt, {}) }),
|
|
1585
1612
|
o(r) || e("common.category")
|
|
1586
1613
|
]
|
|
1587
1614
|
}
|
|
1588
1615
|
);
|
|
1589
1616
|
}
|
|
1590
|
-
function
|
|
1591
|
-
var
|
|
1592
|
-
const { search: o, layout: n } = R(), { filters:
|
|
1593
|
-
return /* @__PURE__ */ t(
|
|
1594
|
-
/* @__PURE__ */ t(
|
|
1595
|
-
/* @__PURE__ */ h(
|
|
1596
|
-
|
|
1597
|
-
|
|
1598
|
-
|
|
1599
|
-
|
|
1600
|
-
|
|
1601
|
-
|
|
1617
|
+
function Cr({ menus: e, children: r }) {
|
|
1618
|
+
var d;
|
|
1619
|
+
const { search: o, layout: n, compact: l } = R(), { filters: a } = o, s = re(null), i = a.category || a.keyword || a.price, m = (d = e == null ? void 0 : e.find((f) => f.key === a.menu)) == null ? void 0 : d.key;
|
|
1620
|
+
return /* @__PURE__ */ t($t, { children: /* @__PURE__ */ h(st, { FallbackComponent: be, children: [
|
|
1621
|
+
!l && /* @__PURE__ */ t(vr, {}),
|
|
1622
|
+
/* @__PURE__ */ h(
|
|
1623
|
+
y,
|
|
1624
|
+
{
|
|
1625
|
+
ref: s,
|
|
1626
|
+
display: "flex",
|
|
1627
|
+
height: "100%",
|
|
1628
|
+
className: "list-container",
|
|
1629
|
+
pt: { xs: 0, md: l ? 0 : 5 },
|
|
1630
|
+
children: [
|
|
1631
|
+
/* @__PURE__ */ t(nr, { menus: e }),
|
|
1632
|
+
/* @__PURE__ */ h(
|
|
1633
|
+
F,
|
|
1634
|
+
{
|
|
1635
|
+
height: "100%",
|
|
1636
|
+
position: "relative",
|
|
1637
|
+
flex: 1,
|
|
1638
|
+
sx: l ? {
|
|
1639
|
+
overflowY: "auto",
|
|
1640
|
+
ml: -2,
|
|
1641
|
+
pr: 1,
|
|
1642
|
+
pb: 2
|
|
1643
|
+
} : { overflow: "visible" },
|
|
1644
|
+
children: [
|
|
1645
|
+
m && (r == null ? void 0 : r(m)),
|
|
1646
|
+
!m && (n.showExplore && !i ? /* @__PURE__ */ t(ur, {}) : /* @__PURE__ */ t(kr, {}))
|
|
1647
|
+
]
|
|
1648
|
+
}
|
|
1649
|
+
)
|
|
1650
|
+
]
|
|
1651
|
+
}
|
|
1652
|
+
)
|
|
1602
1653
|
] }) });
|
|
1603
1654
|
}
|
|
1604
|
-
function
|
|
1605
|
-
return /* @__PURE__ */ h(
|
|
1606
|
-
/* @__PURE__ */ h(
|
|
1607
|
-
/* @__PURE__ */ h(
|
|
1655
|
+
function Eo(e) {
|
|
1656
|
+
return /* @__PURE__ */ h(Nt, { variant: "outlined", ...e, sx: { maxWidth: 400, borderRadius: "8px", p: { xs: 2, md: 3 }, ...e.sx }, children: [
|
|
1657
|
+
/* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 2, pb: 1, children: [
|
|
1658
|
+
/* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 2, flex: 1, children: [
|
|
1608
1659
|
/* @__PURE__ */ t(L, { variant: "rounded", width: 48, height: 48 }),
|
|
1609
1660
|
/* @__PURE__ */ t(L, { variant: "text", width: 60, height: 28 })
|
|
1610
1661
|
] }),
|
|
@@ -1612,7 +1663,7 @@ function Ao(e) {
|
|
|
1612
1663
|
] }),
|
|
1613
1664
|
/* @__PURE__ */ t(L, { variant: "text", width: "100%", height: 24 }),
|
|
1614
1665
|
/* @__PURE__ */ t(L, { variant: "text", width: "90%", height: 24 }),
|
|
1615
|
-
/* @__PURE__ */ h(
|
|
1666
|
+
/* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 1, pt: 1.5, children: [
|
|
1616
1667
|
/* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24 }),
|
|
1617
1668
|
/* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 }),
|
|
1618
1669
|
/* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24, sx: { ml: 1 } }),
|
|
@@ -1620,12 +1671,12 @@ function Ao(e) {
|
|
|
1620
1671
|
] })
|
|
1621
1672
|
] });
|
|
1622
1673
|
}
|
|
1623
|
-
function
|
|
1624
|
-
return e ? /* @__PURE__ */ t(O, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(
|
|
1674
|
+
function Fo({ showSkeleton: e, ...r }) {
|
|
1675
|
+
return e ? /* @__PURE__ */ t(O, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(Wt, { ...r });
|
|
1625
1676
|
}
|
|
1626
|
-
function
|
|
1627
|
-
const { menus: r, children: o, ...n } = e, l =
|
|
1628
|
-
|
|
1677
|
+
function Lo(e) {
|
|
1678
|
+
const { menus: r, children: o, ...n } = e, l = we(), a = et(
|
|
1679
|
+
it({
|
|
1629
1680
|
...l,
|
|
1630
1681
|
typography: {
|
|
1631
1682
|
h1: {
|
|
@@ -1653,12 +1704,12 @@ function Fo(e) {
|
|
|
1653
1704
|
}
|
|
1654
1705
|
})
|
|
1655
1706
|
);
|
|
1656
|
-
return /* @__PURE__ */ t(
|
|
1707
|
+
return /* @__PURE__ */ t(tt, { theme: a, children: /* @__PURE__ */ t(Jt, { ...n, children: /* @__PURE__ */ t(Cr, { menus: r, children: o }) }) });
|
|
1657
1708
|
}
|
|
1658
1709
|
export {
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1710
|
+
hr as Autocomplete,
|
|
1711
|
+
Eo as CardSkeleton,
|
|
1712
|
+
Fo as Image,
|
|
1713
|
+
Lo as default,
|
|
1714
|
+
Ht as useSearch
|
|
1664
1715
|
};
|