@blocklet/list 0.14.12 → 0.14.14
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 +476 -435
- package/package.json +3 -3
package/lib/index.es.js
CHANGED
|
@@ -1,79 +1,80 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import { styled as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { ErrorFallback as
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import { ErrorBoundary as
|
|
10
|
-
import
|
|
11
|
-
import { Icon as
|
|
12
|
-
import
|
|
1
|
+
import { jsx as t, jsxs as h, Fragment as W } from "react/jsx-runtime";
|
|
2
|
+
import { styled as K, useTheme as me } from "@arcblock/ux/lib/Theme";
|
|
3
|
+
import Ye from "@mui/material/styles/createTheme";
|
|
4
|
+
import Ze from "@mui/material/styles/ThemeProvider";
|
|
5
|
+
import Je from "lodash/merge";
|
|
6
|
+
import { ErrorFallback as fe } from "@arcblock/ux/lib/ErrorBoundary";
|
|
7
|
+
import y from "@mui/material/Box";
|
|
8
|
+
import P from "@mui/material/Stack";
|
|
9
|
+
import { ErrorBoundary as et } from "react-error-boundary";
|
|
10
|
+
import tt from "@iconify-icons/tabler/compass";
|
|
11
|
+
import { Icon as Ae } from "@iconify/react";
|
|
12
|
+
import ge from "@mui/icons-material/Close";
|
|
13
13
|
import w from "@mui/material/Typography";
|
|
14
|
-
import { createContext as
|
|
15
|
-
import { createAxios as
|
|
16
|
-
import
|
|
17
|
-
import { useRequest as
|
|
18
|
-
import
|
|
14
|
+
import { createContext as Fe, useState as E, useMemo as H, useContext as Ee, useCallback as he, useEffect as U, forwardRef as rt, useRef as pe, memo as ot } from "react";
|
|
15
|
+
import { createAxios as Le } from "@blocklet/js-sdk";
|
|
16
|
+
import nt from "lodash/orderBy";
|
|
17
|
+
import { useRequest as ee, useDebounceFn as Oe, useInfiniteScroll as lt, useReactive as it } from "ahooks";
|
|
18
|
+
import ne from "lodash/omitBy";
|
|
19
19
|
import "color";
|
|
20
20
|
import "lodash/cloneDeep";
|
|
21
|
-
import { parseURL as
|
|
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
|
|
40
|
-
import
|
|
41
|
-
import
|
|
42
|
-
import
|
|
43
|
-
import
|
|
44
|
-
import
|
|
45
|
-
import
|
|
46
|
-
import
|
|
21
|
+
import { parseURL as at, parseQuery as st, parseFilename as ct, stringifyParsedURL as dt, withQuery as xe, joinURL as ke } from "ufo";
|
|
22
|
+
import ve from "flat";
|
|
23
|
+
import te from "@mui/material/Button";
|
|
24
|
+
import ut from "@mui/material/styles/useTheme";
|
|
25
|
+
import j from "@mui/material/useMediaQuery";
|
|
26
|
+
import ht from "@mui/material/Drawer";
|
|
27
|
+
import _e from "@mui/material/Checkbox";
|
|
28
|
+
import ze from "@mui/material/FormControlLabel";
|
|
29
|
+
import pt from "@mui/icons-material/Check";
|
|
30
|
+
import mt from "@mui/icons-material/KeyboardArrowDown";
|
|
31
|
+
import ft from "@mui/material/ClickAwayListener";
|
|
32
|
+
import gt from "@mui/material/Grow";
|
|
33
|
+
import Me from "@mui/material/MenuItem";
|
|
34
|
+
import De from "@mui/material/MenuList";
|
|
35
|
+
import xt from "@mui/material/Paper";
|
|
36
|
+
import yt from "@mui/material/Popper";
|
|
37
|
+
import wt from "@mui/material/SvgIcon";
|
|
38
|
+
import bt from "lodash/isEmpty";
|
|
39
|
+
import re from "@mui/material/CircularProgress";
|
|
40
|
+
import Ne from "@arcblock/ux/lib/Avatar";
|
|
41
|
+
import kt from "@iconify-icons/tabler/cloud-download";
|
|
42
|
+
import vt from "@mui/icons-material/ChevronLeft";
|
|
43
|
+
import Ct from "@mui/icons-material/ChevronRight";
|
|
44
|
+
import z from "@mui/material/Skeleton";
|
|
45
|
+
import St from "react-image-gallery";
|
|
46
|
+
import It from "@arcblock/ux/lib/Img";
|
|
47
47
|
import "react-image-gallery/styles/css/image-gallery.css";
|
|
48
|
-
import
|
|
49
|
-
import
|
|
50
|
-
import
|
|
51
|
-
import
|
|
52
|
-
import
|
|
53
|
-
import
|
|
54
|
-
import
|
|
55
|
-
import
|
|
56
|
-
import
|
|
57
|
-
import { useHotkeys as
|
|
58
|
-
import
|
|
59
|
-
import
|
|
60
|
-
import
|
|
61
|
-
import
|
|
62
|
-
|
|
48
|
+
import Ce from "@mui/material/Grid";
|
|
49
|
+
import Bt from "react-infinite-scroll-hook";
|
|
50
|
+
import Se from "@mui/material/Chip";
|
|
51
|
+
import J from "@mui/icons-material/Search";
|
|
52
|
+
import Rt from "@mui/icons-material/Verified";
|
|
53
|
+
import Tt from "@mui/material/Autocomplete";
|
|
54
|
+
import Pt from "@mui/material/Dialog";
|
|
55
|
+
import We from "@mui/material/OutlinedInput";
|
|
56
|
+
import At from "@mui/material/TextField";
|
|
57
|
+
import { useHotkeys as Ft } from "react-hotkeys-hook";
|
|
58
|
+
import Ie from "@mui/material/InputAdornment";
|
|
59
|
+
import Et from "@arcblock/ux/lib/Empty";
|
|
60
|
+
import Lt from "json-stable-stringify";
|
|
61
|
+
import Ot from "@mui/icons-material/Menu";
|
|
62
|
+
import { Card as _t, Box as le, Skeleton as O } from "@mui/material";
|
|
63
|
+
const $e = Fe({
|
|
63
64
|
open: !1,
|
|
64
65
|
toggleOpen: (e) => {
|
|
65
66
|
}
|
|
66
67
|
});
|
|
67
|
-
function
|
|
68
|
-
const [r, o] =
|
|
68
|
+
function zt({ children: e }) {
|
|
69
|
+
const [r, o] = E(!1), n = (a) => {
|
|
69
70
|
o(a ?? !a);
|
|
70
|
-
}, i =
|
|
71
|
-
return /* @__PURE__ */ t(
|
|
71
|
+
}, i = H(() => ({ open: r, toggleOpen: n }), [r]);
|
|
72
|
+
return /* @__PURE__ */ t($e.Provider, { value: i, children: e });
|
|
72
73
|
}
|
|
73
|
-
function
|
|
74
|
-
return
|
|
74
|
+
function ye() {
|
|
75
|
+
return Ee($e);
|
|
75
76
|
}
|
|
76
|
-
const
|
|
77
|
+
const T = {
|
|
77
78
|
nameAsc: "title",
|
|
78
79
|
nameDesc: "title",
|
|
79
80
|
popularity: "stats.downloads",
|
|
@@ -87,14 +88,14 @@ const P = {
|
|
|
87
88
|
explorePath: "/api/blocklets/explore",
|
|
88
89
|
exploreDidsPath: "/api/blocklets/dids",
|
|
89
90
|
cacheSize: 100
|
|
90
|
-
},
|
|
91
|
+
}, Mt = (e) => ee(
|
|
91
92
|
async () => {
|
|
92
|
-
const { data: r } = await e.get(
|
|
93
|
+
const { data: r } = await e.get(T.categoriesPath);
|
|
93
94
|
return Array.isArray(r) ? r : [];
|
|
94
95
|
},
|
|
95
96
|
{ manual: !0 }
|
|
96
97
|
);
|
|
97
|
-
function
|
|
98
|
+
function Dt(e, r) {
|
|
98
99
|
const o = { sortBy: "popularity", sortDirection: "desc", ...e }, {
|
|
99
100
|
onFilterChange: n,
|
|
100
101
|
onSearchSelect: i = (l) => {
|
|
@@ -104,17 +105,17 @@ function Et(e, r) {
|
|
|
104
105
|
} = r;
|
|
105
106
|
!o.category && !a && (o.category = "All");
|
|
106
107
|
const c = (l) => {
|
|
107
|
-
const
|
|
108
|
-
n(
|
|
108
|
+
const p = { ...o, ...l };
|
|
109
|
+
n(ne(p, (d) => d === "" || d === void 0));
|
|
109
110
|
};
|
|
110
111
|
return {
|
|
111
112
|
filters: e,
|
|
112
113
|
cleanFilter: (l) => {
|
|
113
|
-
const
|
|
114
|
-
n(
|
|
114
|
+
const p = l ? ne(o, (d, g) => l.includes(g)) : {};
|
|
115
|
+
n(ne(p, (d) => d === "" || d === void 0));
|
|
115
116
|
},
|
|
116
|
-
handleSort: (l,
|
|
117
|
-
c({ sortBy: l, sortDirection:
|
|
117
|
+
handleSort: (l, p) => {
|
|
118
|
+
c({ sortBy: l, sortDirection: p || l === "nameAsc" ? "asc" : "desc" });
|
|
118
119
|
},
|
|
119
120
|
handleKeyword: (l) => {
|
|
120
121
|
c({ category: void 0, keyword: l || void 0 });
|
|
@@ -139,7 +140,7 @@ function Et(e, r) {
|
|
|
139
140
|
}
|
|
140
141
|
};
|
|
141
142
|
}
|
|
142
|
-
const
|
|
143
|
+
const Nt = (e, r, o) => e && r || !o, je = (e) => [
|
|
143
144
|
{
|
|
144
145
|
name: e("sort.popularity"),
|
|
145
146
|
value: "popularity"
|
|
@@ -152,25 +153,25 @@ const zt = (e, r, o) => e && r || !o, De = (e) => [
|
|
|
152
153
|
// name: t('sort.rating'),
|
|
153
154
|
// value: 'rating',
|
|
154
155
|
// },
|
|
155
|
-
],
|
|
156
|
+
], He = (e, r, o) => {
|
|
156
157
|
var d, g;
|
|
157
|
-
const n =
|
|
158
|
-
if ((d =
|
|
159
|
-
return i.imageFilter ?
|
|
158
|
+
const n = at(e), i = st(n.search);
|
|
159
|
+
if ((d = ct(e, { strict: !0 })) == null ? void 0 : d.endsWith(".gif"))
|
|
160
|
+
return i.imageFilter ? dt({ ...n, search: "" }) : e;
|
|
160
161
|
if (i.imageFilter)
|
|
161
162
|
return e;
|
|
162
|
-
const c = o || ((g = window.blocklet) == null ? void 0 : g.version), { w: l, h } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
|
|
163
|
-
return
|
|
164
|
-
...l ||
|
|
163
|
+
const c = o || ((g = window.blocklet) == null ? void 0 : g.version), { w: l, h: p } = typeof r == "object" ? { w: r.w, h: r.h } : { w: r, h: r };
|
|
164
|
+
return xe(e, {
|
|
165
|
+
...l || p ? { imageFilter: "resize", w: l, h: p } : {},
|
|
165
166
|
v: c
|
|
166
167
|
});
|
|
167
|
-
},
|
|
168
|
+
}, Wt = (e) => [
|
|
168
169
|
{ name: e("blocklet.free"), value: "free" },
|
|
169
170
|
{ name: e("blocklet.payment"), value: "payment" }
|
|
170
|
-
],
|
|
171
|
+
], $t = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), jt = (e, r) => (
|
|
171
172
|
// eslint-disable-next-line no-prototype-builtins
|
|
172
173
|
e == null ? void 0 : e.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
|
|
173
|
-
),
|
|
174
|
+
), Ht = () => window.innerWidth <= 600, Ut = {
|
|
174
175
|
common: {
|
|
175
176
|
title: "Blocklet Store",
|
|
176
177
|
searchStore: "Search Blocklet",
|
|
@@ -206,6 +207,8 @@ const zt = (e, r, o) => e && r || !o, De = (e) => [
|
|
|
206
207
|
noResults: "No blocklet found.",
|
|
207
208
|
free: "Free",
|
|
208
209
|
search: 'Results for "{keyword}"',
|
|
210
|
+
authorTag: "Blocklet by {name}",
|
|
211
|
+
resourceTag: "Extensions for {name}",
|
|
209
212
|
resultCount: "{count} Blocklets",
|
|
210
213
|
emptyTip: "Tips:",
|
|
211
214
|
filterTip: "Appropriately reduce the filter conditions",
|
|
@@ -219,7 +222,7 @@ const zt = (e, r, o) => e && r || !o, De = (e) => [
|
|
|
219
222
|
autocomplete: {
|
|
220
223
|
expandResult: 'View all search results for "{name}"'
|
|
221
224
|
}
|
|
222
|
-
},
|
|
225
|
+
}, Vt = {
|
|
223
226
|
common: {
|
|
224
227
|
title: "Blocklet 商店",
|
|
225
228
|
searchStore: "搜索 Blocklet",
|
|
@@ -255,6 +258,8 @@ const zt = (e, r, o) => e && r || !o, De = (e) => [
|
|
|
255
258
|
noResults: "未搜索到 Blocklet",
|
|
256
259
|
free: "免费",
|
|
257
260
|
search: '搜索 "{keyword}" 的结果',
|
|
261
|
+
authorTag: "{name} 的 Blocklet",
|
|
262
|
+
resourceTag: "{name} 的拓展",
|
|
258
263
|
resultCount: "{count} 个 Blocklet",
|
|
259
264
|
emptyTip: "建议:",
|
|
260
265
|
filterTip: "适当减少筛选条件",
|
|
@@ -268,16 +273,16 @@ const zt = (e, r, o) => e && r || !o, De = (e) => [
|
|
|
268
273
|
autocomplete: {
|
|
269
274
|
expandResult: "查看 “{name}” 的所有搜索结果"
|
|
270
275
|
}
|
|
271
|
-
},
|
|
272
|
-
en:
|
|
273
|
-
zh:
|
|
274
|
-
},
|
|
276
|
+
}, ie = {
|
|
277
|
+
en: ve(Ut),
|
|
278
|
+
zh: ve(Vt)
|
|
279
|
+
}, Ue = (e, r) => {
|
|
275
280
|
const o = {};
|
|
276
281
|
return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
|
|
277
|
-
},
|
|
278
|
-
const n =
|
|
279
|
-
return
|
|
280
|
-
},
|
|
282
|
+
}, Gt = (e) => (r, o) => {
|
|
283
|
+
const n = ie[e] ? ie[e][r] : ie.en[r];
|
|
284
|
+
return jt(n, o) || r;
|
|
285
|
+
}, Ve = {
|
|
281
286
|
errors: {
|
|
282
287
|
fetchCategoriesError: null
|
|
283
288
|
},
|
|
@@ -329,8 +334,8 @@ const zt = (e, r, o) => e && r || !o, De = (e) => [
|
|
|
329
334
|
handlePage: () => {
|
|
330
335
|
}
|
|
331
336
|
}
|
|
332
|
-
},
|
|
333
|
-
function
|
|
337
|
+
}, Ge = Fe(Ve), { Provider: qt, Consumer: Po } = Ge;
|
|
338
|
+
function Kt(e) {
|
|
334
339
|
const {
|
|
335
340
|
locale: r = "zh",
|
|
336
341
|
filters: o = {},
|
|
@@ -340,35 +345,35 @@ function Vt(e) {
|
|
|
340
345
|
minItemWidth: a = 350,
|
|
341
346
|
queryFilter: c = !0,
|
|
342
347
|
layout: l = {},
|
|
343
|
-
wrapChildren:
|
|
348
|
+
wrapChildren: p = (R) => R,
|
|
344
349
|
extraFilter: d = (R) => R,
|
|
345
350
|
baseSearch: g = !1,
|
|
346
|
-
fetchCategoryDelay:
|
|
351
|
+
fetchCategoryDelay: m = 0,
|
|
347
352
|
showResourcesSwitch: f = !1,
|
|
348
353
|
showCategory: k = !0,
|
|
349
|
-
tagFilters:
|
|
350
|
-
children:
|
|
351
|
-
storeVersion:
|
|
354
|
+
tagFilters: S = [],
|
|
355
|
+
children: B,
|
|
356
|
+
storeVersion: v,
|
|
352
357
|
onSearchSelect: u = () => {
|
|
353
358
|
},
|
|
354
|
-
endpoint:
|
|
355
|
-
blockletRender:
|
|
356
|
-
} = e, A =
|
|
357
|
-
data:
|
|
358
|
-
error:
|
|
359
|
-
loading:
|
|
360
|
-
run:
|
|
361
|
-
} =
|
|
362
|
-
const R =
|
|
359
|
+
endpoint: C,
|
|
360
|
+
blockletRender: x
|
|
361
|
+
} = e, A = Ue(n, v), F = H(() => Le({ baseURL: C, headers: A }), [C]), L = Dt(o, { onFilterChange: i, emptyCategory: !l.showExplore, onSearchSelect: u }), [M, V] = E(""), {
|
|
362
|
+
data: G = [],
|
|
363
|
+
error: oe,
|
|
364
|
+
loading: X,
|
|
365
|
+
run: Q
|
|
366
|
+
} = Mt(F), $ = H(() => {
|
|
367
|
+
const R = nt(G, [(N) => N.name], ["asc"]), _ = R.findIndex((N) => N.name === "All" || N.locales.en === "All");
|
|
363
368
|
return _ > -1 ? [{ ...R[_], _id: "All" }, ...R.slice(0, _), ...R.slice(_ + 1)] : R;
|
|
364
|
-
}, [
|
|
365
|
-
search:
|
|
366
|
-
errors: { fetchCategoriesError:
|
|
369
|
+
}, [G]), q = he(Gt(r), [r]), s = H(() => $t($, r), [$, r]), b = Wt(q), D = {
|
|
370
|
+
search: L,
|
|
371
|
+
errors: { fetchCategoriesError: oe },
|
|
367
372
|
loadings: {
|
|
368
|
-
fetchCategoriesLoading:
|
|
373
|
+
fetchCategoriesLoading: X
|
|
369
374
|
},
|
|
370
375
|
extraFilter: d,
|
|
371
|
-
endpoint:
|
|
376
|
+
endpoint: C,
|
|
372
377
|
queryFilter: c,
|
|
373
378
|
layout: {
|
|
374
379
|
showExplore: l.showExplore ?? !1,
|
|
@@ -377,13 +382,13 @@ function Vt(e) {
|
|
|
377
382
|
showSearch: l.showSearch ?? !0
|
|
378
383
|
},
|
|
379
384
|
minItemWidth: a,
|
|
380
|
-
wrapChildren:
|
|
381
|
-
t:
|
|
382
|
-
storeVersion:
|
|
385
|
+
wrapChildren: p,
|
|
386
|
+
t: q,
|
|
387
|
+
storeVersion: v,
|
|
383
388
|
serverVersion: n,
|
|
384
|
-
selectedCategory:
|
|
385
|
-
categoryList:
|
|
386
|
-
blockletRender:
|
|
389
|
+
selectedCategory: L.filters.category || (l.showExplore ? "" : "All"),
|
|
390
|
+
categoryList: $,
|
|
391
|
+
blockletRender: x,
|
|
387
392
|
locale: r,
|
|
388
393
|
categoryOptions: s,
|
|
389
394
|
priceOptions: b,
|
|
@@ -391,35 +396,35 @@ function Vt(e) {
|
|
|
391
396
|
baseSearch: g,
|
|
392
397
|
showResourcesSwitch: f,
|
|
393
398
|
showCategory: k,
|
|
394
|
-
tagFilters:
|
|
399
|
+
tagFilters: S,
|
|
395
400
|
onFilterChange: i,
|
|
396
401
|
getCategoryLocale: (R) => {
|
|
397
402
|
if (!R)
|
|
398
403
|
return null;
|
|
399
|
-
const _ =
|
|
404
|
+
const _ = G.find((N) => N._id === R || N.locales.en === "All");
|
|
400
405
|
return _ ? _.locales[r] || _.locales.en : null;
|
|
401
406
|
},
|
|
402
407
|
get developerName() {
|
|
403
|
-
return
|
|
408
|
+
return M;
|
|
404
409
|
},
|
|
405
|
-
updateDeveloperName:
|
|
410
|
+
updateDeveloperName: V
|
|
406
411
|
};
|
|
407
|
-
return
|
|
408
|
-
setTimeout(
|
|
409
|
-
}, [
|
|
412
|
+
return U(() => {
|
|
413
|
+
setTimeout(Q, m || 0);
|
|
414
|
+
}, [C, Q, m]), /* @__PURE__ */ t(qt, { value: D, children: B });
|
|
410
415
|
}
|
|
411
416
|
function I() {
|
|
412
|
-
const e =
|
|
413
|
-
return e ||
|
|
417
|
+
const e = Ee(Ge);
|
|
418
|
+
return e || Ve;
|
|
414
419
|
}
|
|
415
|
-
function
|
|
420
|
+
function qe({
|
|
416
421
|
children: e,
|
|
417
422
|
onClick: r,
|
|
418
423
|
size: o = 32,
|
|
419
424
|
...n
|
|
420
425
|
}) {
|
|
421
426
|
return /* @__PURE__ */ t(
|
|
422
|
-
|
|
427
|
+
te,
|
|
423
428
|
{
|
|
424
429
|
...n,
|
|
425
430
|
onClick: r,
|
|
@@ -442,10 +447,10 @@ function Ue({
|
|
|
442
447
|
}
|
|
443
448
|
);
|
|
444
449
|
}
|
|
445
|
-
function
|
|
450
|
+
function Y(e, r) {
|
|
446
451
|
return e === void 0 ? r : e;
|
|
447
452
|
}
|
|
448
|
-
function
|
|
453
|
+
function we({
|
|
449
454
|
xs: e,
|
|
450
455
|
sm: r,
|
|
451
456
|
md: o,
|
|
@@ -453,86 +458,86 @@ function ye({
|
|
|
453
458
|
xl: i,
|
|
454
459
|
exact: a
|
|
455
460
|
}) {
|
|
456
|
-
const c =
|
|
461
|
+
const c = ut(), l = j(c.breakpoints.down("sm")), p = j(c.breakpoints.between("sm", "md")), d = j(c.breakpoints.between("md", "lg")), g = j(c.breakpoints.between("lg", "xl"));
|
|
457
462
|
if (a)
|
|
458
|
-
return l ? e || null :
|
|
459
|
-
let
|
|
460
|
-
return l || (
|
|
463
|
+
return l ? e || null : p ? r || null : d ? o || null : g ? n || null : i || null;
|
|
464
|
+
let m = e;
|
|
465
|
+
return l || (m = Y(r, m), p) || (m = Y(o, m), d) || (m = Y(n, m), g) ? m : Y(i, m);
|
|
461
466
|
}
|
|
462
|
-
function
|
|
463
|
-
const { open: r, toggleOpen: o } =
|
|
467
|
+
function Xt({ children: e }) {
|
|
468
|
+
const { open: r, toggleOpen: o } = ye();
|
|
464
469
|
return /* @__PURE__ */ t(
|
|
465
|
-
|
|
470
|
+
we,
|
|
466
471
|
{
|
|
467
|
-
xs: /* @__PURE__ */ t(
|
|
468
|
-
md: /* @__PURE__ */ t(
|
|
472
|
+
xs: /* @__PURE__ */ t(ht, { open: r, onClose: () => o(!1), children: e }),
|
|
473
|
+
md: /* @__PURE__ */ t(y, { children: e })
|
|
469
474
|
}
|
|
470
475
|
);
|
|
471
476
|
}
|
|
472
|
-
const
|
|
473
|
-
|
|
477
|
+
const Qt = rt(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
|
|
478
|
+
te,
|
|
474
479
|
{
|
|
475
480
|
ref: n,
|
|
476
481
|
disableElevation: !0,
|
|
477
482
|
disabled: r || e,
|
|
478
483
|
...o,
|
|
479
484
|
sx: [{ borderRadius: "4px" }, ...Array.isArray(o.sx) ? o.sx : [o.sx]],
|
|
480
|
-
startIcon: e && /* @__PURE__ */ t(
|
|
485
|
+
startIcon: e && /* @__PURE__ */ t(re, { size: "1em" })
|
|
481
486
|
}
|
|
482
487
|
));
|
|
483
|
-
function
|
|
484
|
-
var
|
|
485
|
-
const a =
|
|
486
|
-
|
|
488
|
+
function Ke({ value: e, options: r, onChange: o, placeholder: n, ...i }) {
|
|
489
|
+
var v;
|
|
490
|
+
const a = pe(null), c = me(), [l, p] = E(!1), [d, g] = E(e !== null ? e : ""), m = j(c.breakpoints.down("sm"));
|
|
491
|
+
U(() => {
|
|
487
492
|
g(e !== null ? e : "");
|
|
488
493
|
}, [e]);
|
|
489
|
-
const f =
|
|
490
|
-
|
|
491
|
-
}, []), k =
|
|
492
|
-
|
|
494
|
+
const f = he(() => {
|
|
495
|
+
p(!1);
|
|
496
|
+
}, []), k = he(() => {
|
|
497
|
+
p(!0);
|
|
493
498
|
}, []);
|
|
494
|
-
function C(u) {
|
|
495
|
-
g(u.value), o(u.value), p && f();
|
|
496
|
-
}
|
|
497
499
|
function S(u) {
|
|
500
|
+
g(u.value), o(u.value), m && f();
|
|
501
|
+
}
|
|
502
|
+
function B(u) {
|
|
498
503
|
return u === d;
|
|
499
504
|
}
|
|
500
|
-
return /* @__PURE__ */
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
|
|
505
|
+
return /* @__PURE__ */ h(W, { children: [
|
|
506
|
+
/* @__PURE__ */ h(
|
|
507
|
+
Yt,
|
|
503
508
|
{
|
|
504
509
|
ref: a,
|
|
505
510
|
onClick: k,
|
|
506
511
|
variant: "outlined",
|
|
507
512
|
size: "small",
|
|
508
|
-
className: ["my-select__selector",
|
|
513
|
+
className: ["my-select__selector", bt(d) ? "" : "my-select__selector--active"].join(" "),
|
|
509
514
|
sx: { minWidth: "auto", color: "text.primary" },
|
|
510
515
|
...i,
|
|
511
516
|
children: [
|
|
512
|
-
((
|
|
513
|
-
/* @__PURE__ */ t(
|
|
517
|
+
((v = r.find((u) => u.value === d)) == null ? void 0 : v.name) || n,
|
|
518
|
+
/* @__PURE__ */ t(wt, { className: "my-select__arrowdown", component: mt, fontSize: "small" })
|
|
514
519
|
]
|
|
515
520
|
}
|
|
516
521
|
),
|
|
517
|
-
/* @__PURE__ */ t(
|
|
518
|
-
|
|
522
|
+
/* @__PURE__ */ t(yt, { open: l, anchorEl: a.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: u, placement: C }) => /* @__PURE__ */ t(
|
|
523
|
+
gt,
|
|
519
524
|
{
|
|
520
525
|
...u,
|
|
521
|
-
style: { transformOrigin:
|
|
522
|
-
children: /* @__PURE__ */ t(
|
|
526
|
+
style: { transformOrigin: C === "bottom" ? "center top" : "center bottom" },
|
|
527
|
+
children: /* @__PURE__ */ t(xt, { children: /* @__PURE__ */ t(ft, { onClickAway: f, children: /* @__PURE__ */ t(Zt, { autoFocusItem: l, onMouseEnter: k, onMouseLeave: f, children: r.map((x) => /* @__PURE__ */ h(Me, { onClick: () => S(x), children: [
|
|
523
528
|
/* @__PURE__ */ t(
|
|
524
|
-
|
|
529
|
+
pt,
|
|
525
530
|
{
|
|
526
|
-
sx: { mr: 1, fontSize: 16, visibility:
|
|
531
|
+
sx: { mr: 1, fontSize: 16, visibility: B(x.value) ? "visible" : "hidden" }
|
|
527
532
|
}
|
|
528
533
|
),
|
|
529
|
-
|
|
530
|
-
] },
|
|
534
|
+
x.name
|
|
535
|
+
] }, x.value)) }) }) })
|
|
531
536
|
}
|
|
532
537
|
) })
|
|
533
538
|
] });
|
|
534
539
|
}
|
|
535
|
-
const
|
|
540
|
+
const Yt = K(Qt)`
|
|
536
541
|
border: 1px solid #f0f0f0;
|
|
537
542
|
padding: 6px 8px 6px 12px;
|
|
538
543
|
font-weight: ${(e) => e.theme.typography.fontWeightRegular};
|
|
@@ -560,7 +565,7 @@ const Kt = q(qt)`
|
|
|
560
565
|
margin-right: 3px;
|
|
561
566
|
}
|
|
562
567
|
}
|
|
563
|
-
`,
|
|
568
|
+
`, Zt = K(De)`
|
|
564
569
|
.my-select__option__icon {
|
|
565
570
|
color: transparent;
|
|
566
571
|
font-size: 14px;
|
|
@@ -577,10 +582,10 @@ const Kt = q(qt)`
|
|
|
577
582
|
}
|
|
578
583
|
}
|
|
579
584
|
`;
|
|
580
|
-
function
|
|
581
|
-
const { search: e, t: r } = I(), { filters: o, handleSort: n, handlePrice: i } = e, a =
|
|
582
|
-
return /* @__PURE__ */
|
|
583
|
-
|
|
585
|
+
function Xe() {
|
|
586
|
+
const { search: e, t: r } = I(), { filters: o, handleSort: n, handlePrice: i } = e, a = je(r);
|
|
587
|
+
return /* @__PURE__ */ h(
|
|
588
|
+
P,
|
|
584
589
|
{
|
|
585
590
|
direction: { xs: "row", md: "column" },
|
|
586
591
|
alignItems: { xs: "center", md: "flex-start" },
|
|
@@ -589,10 +594,10 @@ function Ge() {
|
|
|
589
594
|
justifyContent: "space-between",
|
|
590
595
|
children: [
|
|
591
596
|
/* @__PURE__ */ t(
|
|
592
|
-
|
|
597
|
+
ze,
|
|
593
598
|
{
|
|
594
599
|
control: /* @__PURE__ */ t(
|
|
595
|
-
|
|
600
|
+
_e,
|
|
596
601
|
{
|
|
597
602
|
checked: o.price === "free",
|
|
598
603
|
size: "small",
|
|
@@ -604,7 +609,7 @@ function Ge() {
|
|
|
604
609
|
}
|
|
605
610
|
),
|
|
606
611
|
/* @__PURE__ */ t(
|
|
607
|
-
|
|
612
|
+
Ke,
|
|
608
613
|
{
|
|
609
614
|
value: o.sortBy || a[0].value,
|
|
610
615
|
options: a,
|
|
@@ -616,18 +621,18 @@ function Ge() {
|
|
|
616
621
|
}
|
|
617
622
|
);
|
|
618
623
|
}
|
|
619
|
-
function
|
|
620
|
-
const { selectedCategory: e, search: r, t: o, categoryOptions: n, loadings: i, layout: a, baseSearch: c } = I(), { filters: l, handleCategory:
|
|
621
|
-
|
|
624
|
+
function Jt() {
|
|
625
|
+
const { selectedCategory: e, search: r, t: o, categoryOptions: n, loadings: i, layout: a, baseSearch: c } = I(), { filters: l, handleCategory: p, cleanFilter: d } = r, { toggleOpen: g } = ye();
|
|
626
|
+
U(() => {
|
|
622
627
|
g(!1);
|
|
623
628
|
}, [Object.values(l).join("")]);
|
|
624
|
-
const
|
|
625
|
-
return a.showCategory ? /* @__PURE__ */
|
|
629
|
+
const m = Nt(c, a.showSearch, l.keyword);
|
|
630
|
+
return a.showCategory ? /* @__PURE__ */ h(Xt, { children: [
|
|
626
631
|
/* @__PURE__ */ t(
|
|
627
|
-
|
|
632
|
+
we,
|
|
628
633
|
{
|
|
629
|
-
xs: /* @__PURE__ */
|
|
630
|
-
|
|
634
|
+
xs: /* @__PURE__ */ h(
|
|
635
|
+
P,
|
|
631
636
|
{
|
|
632
637
|
direction: "row",
|
|
633
638
|
justifyContent: "space-between",
|
|
@@ -638,7 +643,7 @@ function Qt() {
|
|
|
638
643
|
borderBottom: 1,
|
|
639
644
|
borderColor: "divider",
|
|
640
645
|
children: [
|
|
641
|
-
/* @__PURE__ */ t(
|
|
646
|
+
/* @__PURE__ */ t(qe, { onClick: () => g(!1), children: /* @__PURE__ */ t(ge, {}) }),
|
|
642
647
|
/* @__PURE__ */ t(w, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: o("common.category") })
|
|
643
648
|
]
|
|
644
649
|
}
|
|
@@ -647,16 +652,16 @@ function Qt() {
|
|
|
647
652
|
}
|
|
648
653
|
),
|
|
649
654
|
/* @__PURE__ */ t(
|
|
650
|
-
|
|
655
|
+
P,
|
|
651
656
|
{
|
|
652
657
|
visibility: i.fetchCategoriesLoading ? "hidden" : "visible",
|
|
653
658
|
width: { xs: 268, md: 200 },
|
|
654
659
|
boxSizing: "content-box",
|
|
655
660
|
p: { xs: 2, md: 0 },
|
|
656
661
|
pr: { md: 6 },
|
|
657
|
-
children:
|
|
658
|
-
a.showExplore && /* @__PURE__ */
|
|
659
|
-
/* @__PURE__ */ t(
|
|
662
|
+
children: m ? /* @__PURE__ */ h(W, { children: [
|
|
663
|
+
a.showExplore && /* @__PURE__ */ h(y, { display: "flex", alignItems: "center", gap: 1, mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
|
|
664
|
+
/* @__PURE__ */ t(Ae, { icon: tt }),
|
|
660
665
|
/* @__PURE__ */ t(
|
|
661
666
|
w,
|
|
662
667
|
{
|
|
@@ -671,7 +676,7 @@ function Qt() {
|
|
|
671
676
|
}
|
|
672
677
|
)
|
|
673
678
|
] }),
|
|
674
|
-
!!n.length && /* @__PURE__ */ t(
|
|
679
|
+
!!n.length && /* @__PURE__ */ t(P, { gap: 2, children: n.map((f) => /* @__PURE__ */ t(
|
|
675
680
|
w,
|
|
676
681
|
{
|
|
677
682
|
variant: "body1",
|
|
@@ -681,19 +686,19 @@ function Qt() {
|
|
|
681
686
|
color: e === f.value ? "text.primary" : "text.lighter",
|
|
682
687
|
textTransform: "capitalize",
|
|
683
688
|
onClick: () => {
|
|
684
|
-
e === f.value ? d() :
|
|
689
|
+
e === f.value ? d() : p(f.value), g(!1);
|
|
685
690
|
},
|
|
686
691
|
children: f.name
|
|
687
692
|
},
|
|
688
693
|
f.value
|
|
689
694
|
)) })
|
|
690
|
-
] }) : /* @__PURE__ */ t(
|
|
695
|
+
] }) : /* @__PURE__ */ t(Xe, {})
|
|
691
696
|
}
|
|
692
697
|
)
|
|
693
698
|
] }) : null;
|
|
694
699
|
}
|
|
695
|
-
function
|
|
696
|
-
const { endpoint: e, serverVersion: r, storeVersion: o } = I(), n =
|
|
700
|
+
function be() {
|
|
701
|
+
const { endpoint: e, serverVersion: r, storeVersion: o } = I(), n = Ue(r, o), i = H(() => Le({
|
|
697
702
|
baseURL: e,
|
|
698
703
|
headers: n
|
|
699
704
|
}), [e]);
|
|
@@ -708,19 +713,19 @@ function xe() {
|
|
|
708
713
|
}
|
|
709
714
|
};
|
|
710
715
|
}
|
|
711
|
-
const
|
|
712
|
-
return /* @__PURE__ */ t(
|
|
716
|
+
const Qe = ot(function(r) {
|
|
717
|
+
return /* @__PURE__ */ t(y, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(re, {}) });
|
|
713
718
|
});
|
|
714
|
-
function
|
|
715
|
-
return e ? /* @__PURE__ */ t(
|
|
719
|
+
function er({ showSkeleton: e, ...r }) {
|
|
720
|
+
return e ? /* @__PURE__ */ t(z, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(It, { ...r });
|
|
716
721
|
}
|
|
717
|
-
function
|
|
722
|
+
function Be({
|
|
718
723
|
icon: e,
|
|
719
724
|
children: r,
|
|
720
725
|
maxWidth: o = 100,
|
|
721
726
|
title: n
|
|
722
727
|
}) {
|
|
723
|
-
return (r === 0 || r) && /* @__PURE__ */
|
|
728
|
+
return (r === 0 || r) && /* @__PURE__ */ h(P, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
|
|
724
729
|
e,
|
|
725
730
|
/* @__PURE__ */ t(
|
|
726
731
|
w,
|
|
@@ -734,18 +739,18 @@ function Ce({
|
|
|
734
739
|
)
|
|
735
740
|
] });
|
|
736
741
|
}
|
|
737
|
-
const
|
|
738
|
-
function
|
|
739
|
-
var
|
|
740
|
-
const { t: e, search: r } = I(), { get: o } =
|
|
742
|
+
const ae = 292, tr = 210, rr = 338;
|
|
743
|
+
function or() {
|
|
744
|
+
var B, v;
|
|
745
|
+
const { t: e, search: r } = I(), { get: o } = be(), n = me(), i = j(n.breakpoints.down("md")), a = ((v = (B = window.blocklet) == null ? void 0 : B.preferences) == null ? void 0 : v.homeBanner) || [], {
|
|
741
746
|
data: c = [],
|
|
742
747
|
error: l,
|
|
743
|
-
loading:
|
|
744
|
-
} =
|
|
748
|
+
loading: p
|
|
749
|
+
} = ee(async () => {
|
|
745
750
|
const u = await o(
|
|
746
|
-
|
|
751
|
+
xe(T.blockletsPath, { didList: a.map((C) => C.did).join(",") })
|
|
747
752
|
);
|
|
748
|
-
return u != null && u.dataList ? a.map((
|
|
753
|
+
return u != null && u.dataList ? a.map((C) => u.dataList.find((x) => x.did === C.did)) : [];
|
|
749
754
|
});
|
|
750
755
|
l && console.error("Get Banner Blocklets error:", l);
|
|
751
756
|
const d = {
|
|
@@ -756,31 +761,31 @@ function er() {
|
|
|
756
761
|
cursor: "pointer",
|
|
757
762
|
color: "text.lighter"
|
|
758
763
|
};
|
|
759
|
-
return !l && a.length > 0 ? /* @__PURE__ */
|
|
764
|
+
return !l && a.length > 0 ? /* @__PURE__ */ h(W, { children: [
|
|
760
765
|
/* @__PURE__ */ t(w, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
|
|
761
766
|
/* @__PURE__ */ t(
|
|
762
|
-
|
|
767
|
+
y,
|
|
763
768
|
{
|
|
764
|
-
height: { xs: "auto", md:
|
|
769
|
+
height: { xs: "auto", md: ae },
|
|
765
770
|
position: "relative",
|
|
766
771
|
border: 1,
|
|
767
772
|
borderColor: "divider",
|
|
768
773
|
borderRadius: 3,
|
|
769
774
|
overflow: "hidden",
|
|
770
|
-
children:
|
|
771
|
-
/* @__PURE__ */ t(
|
|
772
|
-
/* @__PURE__ */
|
|
773
|
-
/* @__PURE__ */ t(
|
|
774
|
-
/* @__PURE__ */ t(
|
|
775
|
-
/* @__PURE__ */ t(
|
|
776
|
-
/* @__PURE__ */
|
|
777
|
-
/* @__PURE__ */ t(
|
|
778
|
-
/* @__PURE__ */ t(
|
|
775
|
+
children: p ? /* @__PURE__ */ h(y, { p: 5, display: "flex", gap: 5, height: ae, alignItems: "center", justifyContent: "center", children: [
|
|
776
|
+
/* @__PURE__ */ t(z, { variant: "rounded", height: tr, width: rr }),
|
|
777
|
+
/* @__PURE__ */ h(y, { flex: 1, height: "100%", children: [
|
|
778
|
+
/* @__PURE__ */ t(z, { variant: "text", height: 50, width: 100 }),
|
|
779
|
+
/* @__PURE__ */ t(z, { variant: "text", height: 40, width: "100%" }),
|
|
780
|
+
/* @__PURE__ */ t(z, { variant: "text", height: 40, width: 300 }),
|
|
781
|
+
/* @__PURE__ */ h(y, { display: "flex", gap: 1, my: 2, children: [
|
|
782
|
+
/* @__PURE__ */ t(z, { variant: "circular", height: 20, width: 20 }),
|
|
783
|
+
/* @__PURE__ */ t(z, { variant: "text", height: 20, width: 50 })
|
|
779
784
|
] }),
|
|
780
|
-
/* @__PURE__ */ t(
|
|
785
|
+
/* @__PURE__ */ t(z, { variant: "rounded", height: 30, width: 100 })
|
|
781
786
|
] })
|
|
782
787
|
] }) : /* @__PURE__ */ t(
|
|
783
|
-
|
|
788
|
+
St,
|
|
784
789
|
{
|
|
785
790
|
showNav: !0,
|
|
786
791
|
autoPlay: !0,
|
|
@@ -791,18 +796,19 @@ function er() {
|
|
|
791
796
|
showBullets: !1,
|
|
792
797
|
showThumbnails: !1,
|
|
793
798
|
showFullscreenButton: !1,
|
|
794
|
-
renderLeftNav: (u) => /* @__PURE__ */ t(
|
|
795
|
-
renderRightNav: (u) => /* @__PURE__ */ t(
|
|
796
|
-
items: a.map((u,
|
|
799
|
+
renderLeftNav: (u) => /* @__PURE__ */ t(y, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(vt, { sx: { ...d, left: 5 } }) }),
|
|
800
|
+
renderRightNav: (u) => /* @__PURE__ */ t(y, { onClick: u, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Ct, { sx: { ...d, right: 5 } }) }),
|
|
801
|
+
items: a.map((u, C) => ({
|
|
797
802
|
original: u.did,
|
|
798
803
|
renderItem: () => {
|
|
799
|
-
var
|
|
800
|
-
const
|
|
801
|
-
return /* @__PURE__ */
|
|
802
|
-
|
|
804
|
+
var L;
|
|
805
|
+
const x = c[C] || {}, A = u.cover || lr(u.did, (L = x.screenshots) == null ? void 0 : L[0]), F = He(A, { h: 400, w: 700 });
|
|
806
|
+
return /* @__PURE__ */ h(
|
|
807
|
+
P,
|
|
803
808
|
{
|
|
804
|
-
height: { xs: "auto", md:
|
|
809
|
+
height: { xs: "auto", md: ae },
|
|
805
810
|
sx: {
|
|
811
|
+
cursor: "pointer",
|
|
806
812
|
"&::before": {
|
|
807
813
|
content: '""',
|
|
808
814
|
position: "absolute",
|
|
@@ -810,7 +816,6 @@ function er() {
|
|
|
810
816
|
left: 0,
|
|
811
817
|
right: 0,
|
|
812
818
|
bottom: 0,
|
|
813
|
-
cursor: "pointer",
|
|
814
819
|
backgroundImage: `url("${F}")`,
|
|
815
820
|
backgroundSize: "cover",
|
|
816
821
|
filter: "blur(50px)",
|
|
@@ -823,17 +828,17 @@ function er() {
|
|
|
823
828
|
justifyContent: "center",
|
|
824
829
|
alignItems: { xs: "flex-start", md: "center" },
|
|
825
830
|
p: { xs: 2, md: 5 },
|
|
826
|
-
onClick: () => r.handleSearchSelect(
|
|
831
|
+
onClick: () => r.handleSearchSelect(x),
|
|
827
832
|
gap: { xs: 2, md: 5 },
|
|
828
833
|
children: [
|
|
829
834
|
g(F),
|
|
830
|
-
/* @__PURE__ */
|
|
831
|
-
/* @__PURE__ */
|
|
832
|
-
|
|
833
|
-
f(u.desc ||
|
|
835
|
+
/* @__PURE__ */ h(P, { flex: 1, height: "100%", gap: 3, children: [
|
|
836
|
+
/* @__PURE__ */ h(y, { flex: 1, children: [
|
|
837
|
+
m(u.name || x.title || u.name),
|
|
838
|
+
f(u.desc || x.description)
|
|
834
839
|
] }),
|
|
835
|
-
|
|
836
|
-
|
|
840
|
+
x.did && k(x, u.baseNum),
|
|
841
|
+
S(x)
|
|
837
842
|
] })
|
|
838
843
|
]
|
|
839
844
|
}
|
|
@@ -846,19 +851,19 @@ function er() {
|
|
|
846
851
|
)
|
|
847
852
|
] }) : null;
|
|
848
853
|
function g(u) {
|
|
849
|
-
return /* @__PURE__ */ t(
|
|
850
|
-
|
|
854
|
+
return /* @__PURE__ */ t(y, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", position: "relative", children: /* @__PURE__ */ t(
|
|
855
|
+
er,
|
|
851
856
|
{
|
|
852
|
-
showSkeleton:
|
|
857
|
+
showSkeleton: p,
|
|
853
858
|
src: u,
|
|
854
859
|
alt: "",
|
|
855
860
|
width: i ? void 0 : 338,
|
|
856
861
|
height: 210,
|
|
857
|
-
style: { objectFit: "cover" }
|
|
862
|
+
style: { objectFit: "cover", cursor: "pointer" }
|
|
858
863
|
}
|
|
859
864
|
) });
|
|
860
865
|
}
|
|
861
|
-
function
|
|
866
|
+
function m(u) {
|
|
862
867
|
return /* @__PURE__ */ t(w, { variant: "h2", width: "100%", children: u });
|
|
863
868
|
}
|
|
864
869
|
function f(u) {
|
|
@@ -885,16 +890,16 @@ function er() {
|
|
|
885
890
|
}
|
|
886
891
|
);
|
|
887
892
|
}
|
|
888
|
-
function k(u,
|
|
889
|
-
const { did:
|
|
890
|
-
return /* @__PURE__ */
|
|
891
|
-
/* @__PURE__ */ t(
|
|
892
|
-
/* @__PURE__ */ t(
|
|
893
|
+
function k(u, C = 0) {
|
|
894
|
+
const { did: x, owner: A, stats: F } = u;
|
|
895
|
+
return /* @__PURE__ */ h(y, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
|
|
896
|
+
/* @__PURE__ */ t(Be, { icon: /* @__PURE__ */ t(Ne, { src: A.avatar, did: x, size: 20, variant: "circle" }), children: A.fullName }),
|
|
897
|
+
/* @__PURE__ */ t(Be, { icon: /* @__PURE__ */ t(Ae, { icon: kt }), title: `${F.downloads + C}`, children: nr(F.downloads + C) })
|
|
893
898
|
] });
|
|
894
899
|
}
|
|
895
|
-
function
|
|
900
|
+
function S(u) {
|
|
896
901
|
return /* @__PURE__ */ t(
|
|
897
|
-
|
|
902
|
+
te,
|
|
898
903
|
{
|
|
899
904
|
variant: "outlined",
|
|
900
905
|
size: "small",
|
|
@@ -912,32 +917,32 @@ function er() {
|
|
|
912
917
|
);
|
|
913
918
|
}
|
|
914
919
|
}
|
|
915
|
-
const
|
|
916
|
-
function
|
|
920
|
+
const nr = (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`, lr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
|
|
921
|
+
function ir({ title: e, blocklets: r }) {
|
|
917
922
|
const { blockletRender: o, serverVersion: n } = I();
|
|
918
|
-
return /* @__PURE__ */
|
|
923
|
+
return /* @__PURE__ */ h(y, { mt: 3, children: [
|
|
919
924
|
/* @__PURE__ */ t(w, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
|
|
920
|
-
/* @__PURE__ */ t(
|
|
925
|
+
/* @__PURE__ */ t(Ce, { container: !0, spacing: 2, children: r.map((i) => /* @__PURE__ */ t(Ce, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": i.did, children: /* @__PURE__ */ t(y, { padding: "1px", children: o({ blocklet: i, blocklets: r, serverVersion: n }) }) }, i.did)) })
|
|
921
926
|
] });
|
|
922
927
|
}
|
|
923
|
-
function
|
|
924
|
-
const { get: e } =
|
|
928
|
+
function ar() {
|
|
929
|
+
const { get: e } = be(), { t: r } = I(), {
|
|
925
930
|
data: o = [],
|
|
926
931
|
error: n,
|
|
927
932
|
loading: i
|
|
928
|
-
} =
|
|
929
|
-
const a = await e(
|
|
933
|
+
} = ee(async () => {
|
|
934
|
+
const a = await e(T.explorePath);
|
|
930
935
|
return Array.isArray(a) ? a : [];
|
|
931
936
|
});
|
|
932
|
-
return n ? /* @__PURE__ */ t(
|
|
933
|
-
/* @__PURE__ */ t(
|
|
937
|
+
return n ? /* @__PURE__ */ t(fe, { error: new Error(`Failed to fetch blocklets from ${T.explorePath}`) }) : i ? /* @__PURE__ */ t(Qe, { mt: 15 }) : /* @__PURE__ */ h(W, { children: [
|
|
938
|
+
/* @__PURE__ */ t(or, {}),
|
|
934
939
|
o.map(
|
|
935
|
-
(a) => a.blocklets.length > 0 ? /* @__PURE__ */ t(
|
|
940
|
+
(a) => a.blocklets.length > 0 ? /* @__PURE__ */ t(ir, { title: r(`explore.${a.type}`), blocklets: a.blocklets }, a.type) : null
|
|
936
941
|
)
|
|
937
942
|
] });
|
|
938
943
|
}
|
|
939
|
-
const
|
|
940
|
-
function
|
|
944
|
+
const se = "__FREE_TEXT__", Re = "__NO_RESULT__", ce = 40;
|
|
945
|
+
function sr({
|
|
941
946
|
endpoint: e,
|
|
942
947
|
t: r,
|
|
943
948
|
locale: o,
|
|
@@ -946,38 +951,39 @@ function lr({
|
|
|
946
951
|
handleSearchSelect: a,
|
|
947
952
|
...c
|
|
948
953
|
}) {
|
|
949
|
-
const l =
|
|
954
|
+
const l = pe(null), p = pe(!1), [d, g] = E(!1), [m, f] = E(""), [k, S] = E(!1), B = be(), [v, u] = E(!1), C = async (s) => {
|
|
950
955
|
u(!0);
|
|
951
|
-
const b = await
|
|
956
|
+
const b = await B.get(ke(e, xe(T.blockletsPath, s)));
|
|
952
957
|
return u(!1), b.dataList || [];
|
|
953
|
-
}, { data:
|
|
954
|
-
(s) => s ?
|
|
955
|
-
sortBy:
|
|
958
|
+
}, { data: x, run: A } = ee(
|
|
959
|
+
(s) => s ? C({
|
|
960
|
+
sortBy: T.nameDesc,
|
|
956
961
|
page: 1,
|
|
957
962
|
pageSize: 10,
|
|
958
|
-
keyword: s
|
|
963
|
+
keyword: s,
|
|
964
|
+
showResources: "true"
|
|
959
965
|
}) : Promise.resolve([]),
|
|
960
966
|
{
|
|
961
967
|
manual: !0
|
|
962
968
|
}
|
|
963
969
|
);
|
|
964
|
-
|
|
970
|
+
U(() => {
|
|
965
971
|
u(!0), A(n.keyword), f(n.keyword || "");
|
|
966
|
-
}, [n.keyword, A]),
|
|
972
|
+
}, [n.keyword, A]), Ft(
|
|
967
973
|
"ctrl + k, command + k",
|
|
968
974
|
(s) => {
|
|
969
|
-
var b,
|
|
970
|
-
return s.stopPropagation(), s.preventDefault(), (
|
|
975
|
+
var b, D;
|
|
976
|
+
return s.stopPropagation(), s.preventDefault(), (D = (b = l.current) == null ? void 0 : b.querySelector("input")) == null || D.focus(), !1;
|
|
971
977
|
},
|
|
972
978
|
{ enableOnTags: ["INPUT"] }
|
|
973
979
|
);
|
|
974
|
-
const F =
|
|
975
|
-
let
|
|
976
|
-
return
|
|
977
|
-
/* @__PURE__ */
|
|
978
|
-
/* @__PURE__ */
|
|
980
|
+
const F = Oe((s) => A(s), { wait: 300 }), L = { name: se, title: m, did: "" };
|
|
981
|
+
let M = [];
|
|
982
|
+
return m && (v ? M = [L] : x != null && x.length ? M = [L, ...x] : M = [{ name: Re, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ h(W, { children: [
|
|
983
|
+
/* @__PURE__ */ h(Pt, { fullScreen: !0, open: k, sx: { display: { md: "none" } }, children: [
|
|
984
|
+
/* @__PURE__ */ h(y, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
|
|
979
985
|
/* @__PURE__ */ t(
|
|
980
|
-
|
|
986
|
+
We,
|
|
981
987
|
{
|
|
982
988
|
fullWidth: !0,
|
|
983
989
|
sx: {
|
|
@@ -997,45 +1003,45 @@ function lr({
|
|
|
997
1003
|
autoFocus: !0,
|
|
998
1004
|
placeholder: r("common.searchStore"),
|
|
999
1005
|
className: "bl-autocomplete-input",
|
|
1000
|
-
value:
|
|
1001
|
-
onChange: (s) =>
|
|
1002
|
-
startAdornment:
|
|
1003
|
-
endAdornment:
|
|
1006
|
+
value: m,
|
|
1007
|
+
onChange: (s) => V(s.target.value),
|
|
1008
|
+
startAdornment: $(k),
|
|
1009
|
+
endAdornment: q()
|
|
1004
1010
|
}
|
|
1005
1011
|
),
|
|
1006
1012
|
/* @__PURE__ */ t(
|
|
1007
|
-
|
|
1013
|
+
te,
|
|
1008
1014
|
{
|
|
1009
1015
|
variant: "outlined",
|
|
1010
1016
|
onClick: () => {
|
|
1011
|
-
|
|
1017
|
+
S(!1), f(n.keyword || "");
|
|
1012
1018
|
},
|
|
1013
1019
|
children: r("common.cancel")
|
|
1014
1020
|
}
|
|
1015
1021
|
)
|
|
1016
1022
|
] }),
|
|
1017
|
-
/* @__PURE__ */ t(
|
|
1023
|
+
/* @__PURE__ */ t(De, { sx: { p: 0.5 }, children: M.map((s) => X(s)) })
|
|
1018
1024
|
] }),
|
|
1019
1025
|
/* @__PURE__ */ t(
|
|
1020
|
-
|
|
1026
|
+
J,
|
|
1021
1027
|
{
|
|
1022
1028
|
sx: { display: { sx: "block", md: "none" }, fontSize: 28, color: "text.lighter" },
|
|
1023
|
-
onClick: () =>
|
|
1029
|
+
onClick: () => S(!0)
|
|
1024
1030
|
}
|
|
1025
1031
|
),
|
|
1026
1032
|
/* @__PURE__ */ t(
|
|
1027
|
-
|
|
1033
|
+
Tt,
|
|
1028
1034
|
{
|
|
1029
1035
|
ref: l,
|
|
1030
|
-
open: !!
|
|
1036
|
+
open: !!m && d,
|
|
1031
1037
|
size: "small",
|
|
1032
1038
|
onOpen: () => g(!0),
|
|
1033
1039
|
onClose: (s, b) => {
|
|
1034
|
-
g(!1), b === "selectOption" && !
|
|
1040
|
+
g(!1), b === "selectOption" && !p.current && i(m);
|
|
1035
1041
|
},
|
|
1036
1042
|
disableClearable: !0,
|
|
1037
|
-
inputValue:
|
|
1038
|
-
onInputChange: (s, b) =>
|
|
1043
|
+
inputValue: m,
|
|
1044
|
+
onInputChange: (s, b) => V(b),
|
|
1039
1045
|
isOptionEqualToValue: (s, b) => s.name === b.name,
|
|
1040
1046
|
getOptionLabel: (s) => s.title,
|
|
1041
1047
|
getOptionKey: (s) => s.name,
|
|
@@ -1053,7 +1059,7 @@ function lr({
|
|
|
1053
1059
|
}
|
|
1054
1060
|
},
|
|
1055
1061
|
renderInput: (s) => /* @__PURE__ */ t(
|
|
1056
|
-
|
|
1062
|
+
At,
|
|
1057
1063
|
{
|
|
1058
1064
|
...s,
|
|
1059
1065
|
InputProps: {
|
|
@@ -1061,17 +1067,17 @@ function lr({
|
|
|
1061
1067
|
autoFocus: !0,
|
|
1062
1068
|
placeholder: r("common.searchStore"),
|
|
1063
1069
|
className: "bl-autocomplete-input",
|
|
1064
|
-
value:
|
|
1065
|
-
startAdornment:
|
|
1066
|
-
endAdornment:
|
|
1070
|
+
value: m,
|
|
1071
|
+
startAdornment: $(d),
|
|
1072
|
+
endAdornment: q()
|
|
1067
1073
|
}
|
|
1068
1074
|
}
|
|
1069
1075
|
),
|
|
1070
1076
|
filterOptions: (s) => s,
|
|
1071
1077
|
...c,
|
|
1072
|
-
options:
|
|
1073
|
-
renderOption: (s, b) =>
|
|
1074
|
-
value:
|
|
1078
|
+
options: M,
|
|
1079
|
+
renderOption: (s, b) => X(b),
|
|
1080
|
+
value: L,
|
|
1075
1081
|
sx: [
|
|
1076
1082
|
{
|
|
1077
1083
|
bgcolor: "#F9FAFB",
|
|
@@ -1091,43 +1097,43 @@ function lr({
|
|
|
1091
1097
|
}
|
|
1092
1098
|
)
|
|
1093
1099
|
] });
|
|
1094
|
-
function
|
|
1095
|
-
u(!0), f(s),
|
|
1100
|
+
function V(s) {
|
|
1101
|
+
u(!0), f(s), p.current = !1, F.run(s);
|
|
1096
1102
|
}
|
|
1097
|
-
function
|
|
1098
|
-
|
|
1103
|
+
function G() {
|
|
1104
|
+
S(!1), f(""), V(""), i("");
|
|
1099
1105
|
}
|
|
1100
|
-
function
|
|
1101
|
-
s != null && s.did ? (
|
|
1106
|
+
function oe(s) {
|
|
1107
|
+
s != null && s.did ? (S(!1), p.current = !0, f(""), a(s)) : s.name === se && (S(!1), i(m));
|
|
1102
1108
|
}
|
|
1103
|
-
function
|
|
1104
|
-
var b,
|
|
1105
|
-
return /* @__PURE__ */
|
|
1106
|
-
|
|
1109
|
+
function X(s) {
|
|
1110
|
+
var b, D;
|
|
1111
|
+
return /* @__PURE__ */ h(
|
|
1112
|
+
Me,
|
|
1107
1113
|
{
|
|
1108
1114
|
sx: { display: "flex", alignItems: "center", gap: 1, p: 1.5, borderRadius: "8px" },
|
|
1109
|
-
onClick: () =>
|
|
1115
|
+
onClick: () => oe(s),
|
|
1110
1116
|
children: [
|
|
1111
|
-
|
|
1112
|
-
/* @__PURE__ */
|
|
1113
|
-
/* @__PURE__ */
|
|
1117
|
+
Q(s),
|
|
1118
|
+
/* @__PURE__ */ h(w, { variant: "body1", children: [
|
|
1119
|
+
/* @__PURE__ */ h(w, { fontWeight: "fontWeightMedium", display: "flex", alignItems: "center", gap: 1, children: [
|
|
1114
1120
|
s.title,
|
|
1115
1121
|
" ",
|
|
1116
|
-
/* @__PURE__ */ t(
|
|
1122
|
+
/* @__PURE__ */ t(Rt, { sx: { color: "#D97706", fontSize: 16, display: "none" } })
|
|
1117
1123
|
] }),
|
|
1118
|
-
/* @__PURE__ */ t(w, { sx: { color: "text.lighter" }, fontSize: "13px", children: ((
|
|
1124
|
+
/* @__PURE__ */ t(w, { sx: { color: "text.lighter" }, fontSize: "13px", children: ((D = (b = s.category) == null ? void 0 : b.locales) == null ? void 0 : D[o || "en"]) || "" })
|
|
1119
1125
|
] })
|
|
1120
1126
|
]
|
|
1121
1127
|
},
|
|
1122
1128
|
s.did
|
|
1123
1129
|
);
|
|
1124
1130
|
}
|
|
1125
|
-
function
|
|
1126
|
-
if ([
|
|
1131
|
+
function Q(s) {
|
|
1132
|
+
if ([se, Re].includes(s.name))
|
|
1127
1133
|
return /* @__PURE__ */ t(
|
|
1128
|
-
|
|
1134
|
+
y,
|
|
1129
1135
|
{
|
|
1130
|
-
width:
|
|
1136
|
+
width: ce,
|
|
1131
1137
|
p: "6px",
|
|
1132
1138
|
display: "flex",
|
|
1133
1139
|
justifyContent: "center",
|
|
@@ -1135,46 +1141,46 @@ function lr({
|
|
|
1135
1141
|
color: "text.lighter",
|
|
1136
1142
|
bgcolor: "#F1F3F5",
|
|
1137
1143
|
borderRadius: "8px",
|
|
1138
|
-
children: /* @__PURE__ */ t(
|
|
1144
|
+
children: /* @__PURE__ */ t(J, { sx: { fontSize: 28 } })
|
|
1139
1145
|
}
|
|
1140
1146
|
);
|
|
1141
1147
|
let b = "";
|
|
1142
|
-
return s.logo && (b =
|
|
1148
|
+
return s.logo && (b = ke(e, "assets", s.did, He(s.logo, ce, s.version))), /* @__PURE__ */ t(Ne, { src: b, size: ce, style: { borderRadius: "8px", overflow: "hidden" } });
|
|
1143
1149
|
}
|
|
1144
|
-
function
|
|
1145
|
-
return /* @__PURE__ */ t(
|
|
1150
|
+
function $(s = !0) {
|
|
1151
|
+
return /* @__PURE__ */ t(y, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: s && m && v ? /* @__PURE__ */ t(re, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(J, { sx: { fontSize: 16, cursor: "default" } }) });
|
|
1146
1152
|
}
|
|
1147
|
-
function
|
|
1148
|
-
return
|
|
1153
|
+
function q() {
|
|
1154
|
+
return m ? /* @__PURE__ */ t(y, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(ge, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => G() }) }) : null;
|
|
1149
1155
|
}
|
|
1150
1156
|
}
|
|
1151
|
-
function
|
|
1152
|
-
const { search: o } = I(), { filters: n, handleKeyword: i } = o, [a, c] =
|
|
1153
|
-
const { value:
|
|
1154
|
-
c(
|
|
1157
|
+
function cr({ placeholder: e = "Type to search...", ...r }) {
|
|
1158
|
+
const { search: o } = I(), { filters: n, handleKeyword: i } = o, [a, c] = E(n.keyword || ""), l = Oe(i, { wait: 300 }), p = (g) => {
|
|
1159
|
+
const { value: m } = g.target;
|
|
1160
|
+
c(m), l.run(m);
|
|
1155
1161
|
}, d = () => {
|
|
1156
1162
|
c(""), i("");
|
|
1157
1163
|
};
|
|
1158
|
-
return
|
|
1164
|
+
return U(() => {
|
|
1159
1165
|
c(n.keyword || "");
|
|
1160
1166
|
}, [n.keyword]), /* @__PURE__ */ t(
|
|
1161
|
-
|
|
1167
|
+
dr,
|
|
1162
1168
|
{
|
|
1163
1169
|
inputProps: {
|
|
1164
1170
|
"data-cy": "search-blocklet"
|
|
1165
1171
|
},
|
|
1166
|
-
startAdornment: /* @__PURE__ */ t(
|
|
1167
|
-
onChange:
|
|
1172
|
+
startAdornment: /* @__PURE__ */ t(Ie, { position: "start", children: /* @__PURE__ */ t(ur, {}) }),
|
|
1173
|
+
onChange: p,
|
|
1168
1174
|
placeholder: e,
|
|
1169
1175
|
value: a,
|
|
1170
1176
|
title: e,
|
|
1171
1177
|
"data-cy": "search",
|
|
1172
|
-
endAdornment: a && /* @__PURE__ */ t(
|
|
1178
|
+
endAdornment: a && /* @__PURE__ */ t(Ie, { position: "end", children: /* @__PURE__ */ t(hr, { "data-cy": "search-delete", onClick: d }) }),
|
|
1173
1179
|
...r
|
|
1174
1180
|
}
|
|
1175
1181
|
);
|
|
1176
1182
|
}
|
|
1177
|
-
const
|
|
1183
|
+
const dr = K(We)`
|
|
1178
1184
|
background-color: ${(e) => e.theme.palette.grey[50]};
|
|
1179
1185
|
font-size: 14px;
|
|
1180
1186
|
border-radius: 6px;
|
|
@@ -1191,21 +1197,21 @@ const ar = q(Me)`
|
|
|
1191
1197
|
color: transparent;
|
|
1192
1198
|
}
|
|
1193
1199
|
}
|
|
1194
|
-
`,
|
|
1200
|
+
`, ur = K(J)`
|
|
1195
1201
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1196
1202
|
font-size: 28px;
|
|
1197
1203
|
@media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
|
|
1198
1204
|
font-size: 24px;
|
|
1199
1205
|
}
|
|
1200
|
-
`,
|
|
1206
|
+
`, hr = K(ge)`
|
|
1201
1207
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1202
1208
|
font-size: 16px;
|
|
1203
1209
|
cursor: pointer;
|
|
1204
1210
|
`;
|
|
1205
|
-
function
|
|
1206
|
-
const { search: e, t: r, endpoint: o, locale: n, getCategoryLocale: i, developerName: a, showResourcesSwitch: c, layout: l, baseSearch:
|
|
1207
|
-
return /* @__PURE__ */
|
|
1208
|
-
|
|
1211
|
+
function pr() {
|
|
1212
|
+
const { search: e, t: r, endpoint: o, locale: n, getCategoryLocale: i, developerName: a, showResourcesSwitch: c, layout: l, baseSearch: p } = I(), { filters: d, handleSort: g, handlePrice: m, handleDeveloper: f, handleSwitchShowResources: k, cleanFilter: S } = e, B = je(r);
|
|
1213
|
+
return /* @__PURE__ */ h(
|
|
1214
|
+
P,
|
|
1209
1215
|
{
|
|
1210
1216
|
className: "filter-bar",
|
|
1211
1217
|
direction: { xs: "column", md: "row" },
|
|
@@ -1218,8 +1224,8 @@ function dr() {
|
|
|
1218
1224
|
pb: 3,
|
|
1219
1225
|
children: [
|
|
1220
1226
|
/* @__PURE__ */ t(w, { variant: "h2", textTransform: "capitalize", children: i(d.category) }),
|
|
1221
|
-
/* @__PURE__ */
|
|
1222
|
-
|
|
1227
|
+
/* @__PURE__ */ h(
|
|
1228
|
+
P,
|
|
1223
1229
|
{
|
|
1224
1230
|
flex: 1,
|
|
1225
1231
|
direction: "row",
|
|
@@ -1228,8 +1234,8 @@ function dr() {
|
|
|
1228
1234
|
justifyContent: { xs: "space-between", md: "flex-end" },
|
|
1229
1235
|
gap: 2,
|
|
1230
1236
|
children: [
|
|
1231
|
-
l.showSearch ? /* @__PURE__ */ t(
|
|
1232
|
-
|
|
1237
|
+
l.showSearch ? /* @__PURE__ */ t(y, { flex: 1, children: p ? /* @__PURE__ */ t(cr, {}) : /* @__PURE__ */ t(
|
|
1238
|
+
sr,
|
|
1233
1239
|
{
|
|
1234
1240
|
locale: n,
|
|
1235
1241
|
endpoint: o,
|
|
@@ -1245,30 +1251,45 @@ function dr() {
|
|
|
1245
1251
|
handleSearchSelect: e.handleSearchSelect
|
|
1246
1252
|
}
|
|
1247
1253
|
) }) : null,
|
|
1248
|
-
d.owner && a && /* @__PURE__ */ t(
|
|
1254
|
+
d.owner && a && /* @__PURE__ */ t(
|
|
1255
|
+
Se,
|
|
1256
|
+
{
|
|
1257
|
+
label: r("blocklet.authorTag", { name: a }),
|
|
1258
|
+
size: "small",
|
|
1259
|
+
onDelete: () => f("")
|
|
1260
|
+
}
|
|
1261
|
+
),
|
|
1262
|
+
d.resourceDid && d.resourceBlocklet && /* @__PURE__ */ t(
|
|
1263
|
+
Se,
|
|
1264
|
+
{
|
|
1265
|
+
label: r("blocklet.resourceTag", { name: d.resourceBlocklet }),
|
|
1266
|
+
size: "small",
|
|
1267
|
+
onDelete: () => S(["resourceDid", "resourceBlocklet", "showResources"])
|
|
1268
|
+
}
|
|
1269
|
+
),
|
|
1249
1270
|
c ? /* @__PURE__ */ t(
|
|
1250
|
-
|
|
1271
|
+
Te,
|
|
1251
1272
|
{
|
|
1252
1273
|
checked: d.showResources === "true",
|
|
1253
|
-
onChange: (
|
|
1274
|
+
onChange: (v) => k(v ? "true" : ""),
|
|
1254
1275
|
label: r("common.showResources")
|
|
1255
1276
|
}
|
|
1256
1277
|
) : null,
|
|
1257
1278
|
/* @__PURE__ */ t(
|
|
1258
|
-
|
|
1279
|
+
Te,
|
|
1259
1280
|
{
|
|
1260
1281
|
checked: d.price === "free",
|
|
1261
|
-
onChange: (
|
|
1282
|
+
onChange: (v) => m(v ? "free" : ""),
|
|
1262
1283
|
label: r("blocklet.free")
|
|
1263
1284
|
}
|
|
1264
1285
|
),
|
|
1265
1286
|
/* @__PURE__ */ t(
|
|
1266
|
-
|
|
1287
|
+
Ke,
|
|
1267
1288
|
{
|
|
1268
|
-
value: d.sortBy ||
|
|
1269
|
-
options:
|
|
1289
|
+
value: d.sortBy || B[0].value,
|
|
1290
|
+
options: B,
|
|
1270
1291
|
placeholder: r("sort.sort"),
|
|
1271
|
-
onChange: (
|
|
1292
|
+
onChange: (v) => g(v)
|
|
1272
1293
|
}
|
|
1273
1294
|
)
|
|
1274
1295
|
]
|
|
@@ -1278,17 +1299,17 @@ function dr() {
|
|
|
1278
1299
|
}
|
|
1279
1300
|
);
|
|
1280
1301
|
}
|
|
1281
|
-
function
|
|
1302
|
+
function Te({
|
|
1282
1303
|
checked: e,
|
|
1283
1304
|
onChange: r,
|
|
1284
1305
|
label: o
|
|
1285
1306
|
}) {
|
|
1286
1307
|
return /* @__PURE__ */ t(
|
|
1287
|
-
|
|
1308
|
+
ze,
|
|
1288
1309
|
{
|
|
1289
1310
|
sx: { m: 0 },
|
|
1290
1311
|
control: /* @__PURE__ */ t(
|
|
1291
|
-
|
|
1312
|
+
_e,
|
|
1292
1313
|
{
|
|
1293
1314
|
checked: e,
|
|
1294
1315
|
size: "small",
|
|
@@ -1300,115 +1321,115 @@ function Ie({
|
|
|
1300
1321
|
}
|
|
1301
1322
|
);
|
|
1302
1323
|
}
|
|
1303
|
-
function
|
|
1304
|
-
return /* @__PURE__ */
|
|
1305
|
-
/* @__PURE__ */ t(
|
|
1324
|
+
function Z({ children: e }) {
|
|
1325
|
+
return /* @__PURE__ */ h(y, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.lighter", children: [
|
|
1326
|
+
/* @__PURE__ */ t(Et, {}),
|
|
1306
1327
|
e
|
|
1307
1328
|
] });
|
|
1308
1329
|
}
|
|
1309
|
-
function
|
|
1330
|
+
function Pe() {
|
|
1310
1331
|
const { t: e } = I();
|
|
1311
1332
|
return /* @__PURE__ */ t(w, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
|
|
1312
1333
|
}
|
|
1313
|
-
function
|
|
1334
|
+
function de({ filterTip: e, keywordTip: r }) {
|
|
1314
1335
|
const { t: o, locale: n } = I(), i = () => n === "zh" ? "、" : " , ";
|
|
1315
|
-
return /* @__PURE__ */
|
|
1336
|
+
return /* @__PURE__ */ h(y, { mt: 1, display: "flex", children: [
|
|
1316
1337
|
/* @__PURE__ */ t(w, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
|
|
1317
1338
|
e && /* @__PURE__ */ t(w, { children: o("blocklet.filterTip") }),
|
|
1318
1339
|
e && r && i(),
|
|
1319
1340
|
r && /* @__PURE__ */ t(w, { children: o("blocklet.keywordTip") })
|
|
1320
1341
|
] });
|
|
1321
1342
|
}
|
|
1322
|
-
function
|
|
1343
|
+
function ue({
|
|
1323
1344
|
primaryStart: e,
|
|
1324
1345
|
primaryEnd: r,
|
|
1325
1346
|
filter: o
|
|
1326
1347
|
}) {
|
|
1327
|
-
return /* @__PURE__ */
|
|
1348
|
+
return /* @__PURE__ */ h(w, { variant: "subtitle2", display: "flex", gap: 0.5, mx: 0.5, children: [
|
|
1328
1349
|
/* @__PURE__ */ t(w, { children: e }),
|
|
1329
1350
|
/* @__PURE__ */ t(w, { color: "primary", children: o }),
|
|
1330
|
-
/* @__PURE__ */
|
|
1351
|
+
/* @__PURE__ */ h(w, { children: [
|
|
1331
1352
|
r,
|
|
1332
1353
|
" "
|
|
1333
1354
|
] })
|
|
1334
1355
|
] });
|
|
1335
1356
|
}
|
|
1336
|
-
function
|
|
1357
|
+
function mr() {
|
|
1337
1358
|
const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = I(), { filters: i } = r, a = !!n || !!i.price;
|
|
1338
1359
|
if (i.keyword && a)
|
|
1339
|
-
return /* @__PURE__ */
|
|
1360
|
+
return /* @__PURE__ */ h(Z, { children: [
|
|
1340
1361
|
/* @__PURE__ */ t(
|
|
1341
|
-
|
|
1362
|
+
ue,
|
|
1342
1363
|
{
|
|
1343
1364
|
primaryStart: e("blocklet.noBlockletPart1"),
|
|
1344
1365
|
primaryEnd: e("blocklet.noBlockletPart2"),
|
|
1345
1366
|
filter: i.keyword
|
|
1346
1367
|
}
|
|
1347
1368
|
),
|
|
1348
|
-
/* @__PURE__ */ t(
|
|
1369
|
+
/* @__PURE__ */ t(de, { keywordTip: !0, filterTip: !0 })
|
|
1349
1370
|
] });
|
|
1350
1371
|
if (i.keyword)
|
|
1351
|
-
return /* @__PURE__ */
|
|
1372
|
+
return /* @__PURE__ */ h(Z, { children: [
|
|
1352
1373
|
/* @__PURE__ */ t(
|
|
1353
|
-
|
|
1374
|
+
ue,
|
|
1354
1375
|
{
|
|
1355
1376
|
primaryStart: e("blocklet.noBlockletPart1"),
|
|
1356
1377
|
primaryEnd: e("blocklet.noBlockletPart2"),
|
|
1357
1378
|
filter: i.keyword
|
|
1358
1379
|
}
|
|
1359
1380
|
),
|
|
1360
|
-
/* @__PURE__ */ t(
|
|
1381
|
+
/* @__PURE__ */ t(de, { keywordTip: !0 })
|
|
1361
1382
|
] });
|
|
1362
1383
|
if (a) {
|
|
1363
1384
|
const c = o(n);
|
|
1364
|
-
return /* @__PURE__ */
|
|
1385
|
+
return /* @__PURE__ */ h(Z, { children: [
|
|
1365
1386
|
c ? /* @__PURE__ */ t(
|
|
1366
|
-
|
|
1387
|
+
ue,
|
|
1367
1388
|
{
|
|
1368
1389
|
primaryStart: e("blocklet.noCategoryResults1"),
|
|
1369
1390
|
primaryEnd: e("blocklet.noCategoryResults2"),
|
|
1370
1391
|
filter: c
|
|
1371
1392
|
}
|
|
1372
|
-
) : /* @__PURE__ */ t(
|
|
1373
|
-
/* @__PURE__ */ t(
|
|
1393
|
+
) : /* @__PURE__ */ t(Pe, {}),
|
|
1394
|
+
/* @__PURE__ */ t(de, { filterTip: !0 })
|
|
1374
1395
|
] });
|
|
1375
1396
|
}
|
|
1376
|
-
return /* @__PURE__ */ t(
|
|
1397
|
+
return /* @__PURE__ */ t(Z, { children: /* @__PURE__ */ t(Pe, {}) });
|
|
1377
1398
|
}
|
|
1378
|
-
const
|
|
1399
|
+
const fr = (e, r, o, n) => lt(
|
|
1379
1400
|
async (i) => {
|
|
1380
1401
|
i || (o.currentPage = o.defaultCurrentPage);
|
|
1381
1402
|
const { currentPage: a, pageSize: c } = o, l = {
|
|
1382
1403
|
...r,
|
|
1383
1404
|
category: r.category === "All" ? "" : r.category,
|
|
1384
|
-
sortBy:
|
|
1405
|
+
sortBy: T[r.sortBy],
|
|
1385
1406
|
page: a,
|
|
1386
1407
|
pageSize: c
|
|
1387
1408
|
};
|
|
1388
1409
|
n(null);
|
|
1389
|
-
const { data:
|
|
1390
|
-
return o.currentPage++, { page: a, pageSize: c, list: (
|
|
1410
|
+
const { data: p = {} } = await e.get(T.blockletsPath, { params: l });
|
|
1411
|
+
return o.currentPage++, { page: a, pageSize: c, list: (p == null ? void 0 : p.dataList) || [], total: (p == null ? void 0 : p.total) || 0 };
|
|
1391
1412
|
},
|
|
1392
1413
|
{
|
|
1393
1414
|
isNoMore: (i) => i ? i.page * i.pageSize >= i.total : !1,
|
|
1394
|
-
reloadDeps: [e,
|
|
1415
|
+
reloadDeps: [e, Lt(r)],
|
|
1395
1416
|
onError: n
|
|
1396
1417
|
}
|
|
1397
1418
|
);
|
|
1398
|
-
function
|
|
1399
|
-
var
|
|
1400
|
-
const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: i } = I(), { filters: a } = r, c =
|
|
1401
|
-
currentPage:
|
|
1402
|
-
pageSize:
|
|
1403
|
-
defaultCurrentPage:
|
|
1404
|
-
}), [l,
|
|
1419
|
+
function gr() {
|
|
1420
|
+
var m;
|
|
1421
|
+
const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: i } = I(), { filters: a } = r, c = it({
|
|
1422
|
+
currentPage: T.currentPage,
|
|
1423
|
+
pageSize: Ht() ? T.mobilePageSize : T.pageSize,
|
|
1424
|
+
defaultCurrentPage: T.defaultCurrentPage
|
|
1425
|
+
}), [l, p] = E(null), d = fr(e, a, c, p), g = H(
|
|
1405
1426
|
() => {
|
|
1406
1427
|
var f, k;
|
|
1407
1428
|
return o ? o(((f = d.data) == null ? void 0 : f.list) || []) : ((k = d.data) == null ? void 0 : k.list) || [];
|
|
1408
1429
|
},
|
|
1409
1430
|
[d.data, o]
|
|
1410
1431
|
);
|
|
1411
|
-
return
|
|
1432
|
+
return U(() => {
|
|
1412
1433
|
const f = g.find((k) => k.owner.did === a.owner);
|
|
1413
1434
|
i((f == null ? void 0 : f.owner.fullName) || (f == null ? void 0 : f.author.name) || "");
|
|
1414
1435
|
}, [a.owner, g, i]), {
|
|
@@ -1416,7 +1437,7 @@ function pr() {
|
|
|
1416
1437
|
fetchBlockletsError: l,
|
|
1417
1438
|
loadMore: d.loadMore,
|
|
1418
1439
|
hasNextPage: !d.noMore,
|
|
1419
|
-
total: (
|
|
1440
|
+
total: ((m = d.data) == null ? void 0 : m.total) || 0,
|
|
1420
1441
|
loadings: {
|
|
1421
1442
|
fetchBlockletsLoading: d.loading,
|
|
1422
1443
|
loadingMore: d.loadingMore
|
|
@@ -1427,41 +1448,41 @@ function pr() {
|
|
|
1427
1448
|
}
|
|
1428
1449
|
};
|
|
1429
1450
|
}
|
|
1430
|
-
function
|
|
1431
|
-
const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: i, minItemWidth: a, layout: c, baseSearch: l } = I(), { filters:
|
|
1451
|
+
function xr() {
|
|
1452
|
+
const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: i, minItemWidth: a, layout: c, baseSearch: l } = I(), { filters: p } = r, { blocklets: d, errors: g, loadMore: m, loadings: f, hasNextPage: k, total: S } = gr(), [B] = Bt({
|
|
1432
1453
|
loading: f.fetchBlockletsLoading || f.loadingMore,
|
|
1433
1454
|
hasNextPage: k,
|
|
1434
|
-
onLoadMore:
|
|
1455
|
+
onLoadMore: m
|
|
1435
1456
|
});
|
|
1436
1457
|
if (g.fetchBlockletsError) {
|
|
1437
|
-
const
|
|
1438
|
-
return /* @__PURE__ */ t(
|
|
1458
|
+
const x = new Error(`Failed to fetch blocklets from ${o}: ${g.fetchBlockletsError.message}`);
|
|
1459
|
+
return /* @__PURE__ */ t(fe, { error: x });
|
|
1439
1460
|
}
|
|
1440
|
-
const
|
|
1441
|
-
return /* @__PURE__ */
|
|
1442
|
-
|
|
1443
|
-
/* @__PURE__ */ t(
|
|
1444
|
-
|
|
1461
|
+
const v = l && c.showSearch || !p.keyword;
|
|
1462
|
+
return /* @__PURE__ */ h(W, { children: [
|
|
1463
|
+
v ? /* @__PURE__ */ t(pr, {}) : /* @__PURE__ */ h(W, { children: [
|
|
1464
|
+
/* @__PURE__ */ t(we, { xs: /* @__PURE__ */ t(Xe, {}), md: null }),
|
|
1465
|
+
C()
|
|
1445
1466
|
] }),
|
|
1446
1467
|
u(),
|
|
1447
|
-
!f.fetchBlockletsLoading && k && /* @__PURE__ */ t(
|
|
1468
|
+
!f.fetchBlockletsLoading && k && /* @__PURE__ */ t(y, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: B, children: /* @__PURE__ */ t(re, {}) })
|
|
1448
1469
|
] });
|
|
1449
1470
|
function u() {
|
|
1450
|
-
return f.fetchBlockletsLoading ? /* @__PURE__ */ t(
|
|
1451
|
-
|
|
1471
|
+
return f.fetchBlockletsLoading ? /* @__PURE__ */ t(Qe, { mt: 15 }) : d.length ? /* @__PURE__ */ t(
|
|
1472
|
+
y,
|
|
1452
1473
|
{
|
|
1453
1474
|
className: "blocklet-list",
|
|
1454
1475
|
display: "grid",
|
|
1455
1476
|
gridTemplateColumns: `repeat(auto-fill, minmax(${a}px, 1fr))`,
|
|
1456
1477
|
p: "2px",
|
|
1457
1478
|
gap: 2,
|
|
1458
|
-
children: d.map((
|
|
1479
|
+
children: d.map((x) => /* @__PURE__ */ t(y, { "data-blocklet-did": x.did, sx: { minWidth: a }, children: n({ blocklet: x, blocklets: d, serverVersion: i }) }, x.did))
|
|
1459
1480
|
}
|
|
1460
|
-
) : /* @__PURE__ */ t(
|
|
1481
|
+
) : /* @__PURE__ */ t(mr, {});
|
|
1461
1482
|
}
|
|
1462
|
-
function
|
|
1463
|
-
return /* @__PURE__ */
|
|
1464
|
-
|
|
1483
|
+
function C() {
|
|
1484
|
+
return /* @__PURE__ */ h(
|
|
1485
|
+
P,
|
|
1465
1486
|
{
|
|
1466
1487
|
direction: "row",
|
|
1467
1488
|
className: "search-result-title",
|
|
@@ -1470,16 +1491,16 @@ function mr() {
|
|
|
1470
1491
|
mb: 2,
|
|
1471
1492
|
mt: { xs: 2, md: 0 },
|
|
1472
1493
|
children: [
|
|
1473
|
-
/* @__PURE__ */ t(w, { variant: "h3", children: e("blocklet.search", { keyword:
|
|
1474
|
-
/* @__PURE__ */ t(w, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count:
|
|
1494
|
+
/* @__PURE__ */ t(w, { variant: "h3", children: e("blocklet.search", { keyword: p.keyword }) }),
|
|
1495
|
+
/* @__PURE__ */ t(w, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count: S }) })
|
|
1475
1496
|
]
|
|
1476
1497
|
}
|
|
1477
1498
|
);
|
|
1478
1499
|
}
|
|
1479
1500
|
}
|
|
1480
|
-
function
|
|
1481
|
-
const { t: e, selectedCategory: r, getCategoryLocale: o } = I(), { toggleOpen: n } =
|
|
1482
|
-
return /* @__PURE__ */
|
|
1501
|
+
function yr() {
|
|
1502
|
+
const { t: e, selectedCategory: r, getCategoryLocale: o } = I(), { toggleOpen: n } = ye();
|
|
1503
|
+
return /* @__PURE__ */ h(
|
|
1483
1504
|
w,
|
|
1484
1505
|
{
|
|
1485
1506
|
variant: "body1",
|
|
@@ -1489,25 +1510,44 @@ function fr() {
|
|
|
1489
1510
|
py: 2,
|
|
1490
1511
|
fontWeight: "fontWeightMedium",
|
|
1491
1512
|
children: [
|
|
1492
|
-
/* @__PURE__ */ t(
|
|
1513
|
+
/* @__PURE__ */ t(qe, { onClick: () => n(!0), children: /* @__PURE__ */ t(Ot, {}) }),
|
|
1493
1514
|
o(r) || e("common.category")
|
|
1494
1515
|
]
|
|
1495
1516
|
}
|
|
1496
1517
|
);
|
|
1497
1518
|
}
|
|
1498
|
-
function
|
|
1519
|
+
function wr() {
|
|
1499
1520
|
const { search: e, layout: r } = I(), { filters: o } = e, n = o.category || o.keyword || o.price;
|
|
1500
|
-
return /* @__PURE__ */ t(
|
|
1501
|
-
/* @__PURE__ */ t(
|
|
1502
|
-
/* @__PURE__ */
|
|
1503
|
-
/* @__PURE__ */ t(
|
|
1504
|
-
/* @__PURE__ */ t(
|
|
1521
|
+
return /* @__PURE__ */ t(zt, { children: /* @__PURE__ */ h(et, { FallbackComponent: fe, children: [
|
|
1522
|
+
/* @__PURE__ */ t(yr, {}),
|
|
1523
|
+
/* @__PURE__ */ h(y, { display: "flex", height: "100%", className: "list-container", pt: { xs: 0, md: 5 }, children: [
|
|
1524
|
+
/* @__PURE__ */ t(Jt, {}),
|
|
1525
|
+
/* @__PURE__ */ t(P, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: r.showExplore && !n ? /* @__PURE__ */ t(ar, {}) : /* @__PURE__ */ t(xr, {}) })
|
|
1505
1526
|
] })
|
|
1506
1527
|
] }) });
|
|
1507
1528
|
}
|
|
1508
|
-
function
|
|
1509
|
-
|
|
1510
|
-
|
|
1529
|
+
function Ao(e) {
|
|
1530
|
+
return /* @__PURE__ */ h(_t, { variant: "outlined", ...e, sx: { maxWidth: 400, borderRadius: "8px", p: { xs: 2, md: 3 }, ...e.sx }, children: [
|
|
1531
|
+
/* @__PURE__ */ h(le, { display: "flex", alignItems: "center", gap: 2, pb: 1, children: [
|
|
1532
|
+
/* @__PURE__ */ h(le, { display: "flex", alignItems: "center", gap: 2, flex: 1, children: [
|
|
1533
|
+
/* @__PURE__ */ t(O, { variant: "rounded", width: 48, height: 48 }),
|
|
1534
|
+
/* @__PURE__ */ t(O, { variant: "text", width: 60, height: 28 })
|
|
1535
|
+
] }),
|
|
1536
|
+
/* @__PURE__ */ t(O, { variant: "text", width: 70, height: 40 })
|
|
1537
|
+
] }),
|
|
1538
|
+
/* @__PURE__ */ t(O, { variant: "text", width: "100%", height: 24 }),
|
|
1539
|
+
/* @__PURE__ */ t(O, { variant: "text", width: "90%", height: 24 }),
|
|
1540
|
+
/* @__PURE__ */ h(le, { display: "flex", alignItems: "center", gap: 1, pt: 1.5, children: [
|
|
1541
|
+
/* @__PURE__ */ t(O, { variant: "rounded", width: 24, height: 24 }),
|
|
1542
|
+
/* @__PURE__ */ t(O, { variant: "text", width: "15%", height: 20 }),
|
|
1543
|
+
/* @__PURE__ */ t(O, { variant: "rounded", width: 24, height: 24, sx: { ml: 1 } }),
|
|
1544
|
+
/* @__PURE__ */ t(O, { variant: "text", width: "15%", height: 20 })
|
|
1545
|
+
] })
|
|
1546
|
+
] });
|
|
1547
|
+
}
|
|
1548
|
+
function Fo(e) {
|
|
1549
|
+
const r = me(), o = Ye(
|
|
1550
|
+
Je({
|
|
1511
1551
|
...r,
|
|
1512
1552
|
typography: {
|
|
1513
1553
|
h1: {
|
|
@@ -1535,11 +1575,12 @@ function Bo(e) {
|
|
|
1535
1575
|
}
|
|
1536
1576
|
})
|
|
1537
1577
|
);
|
|
1538
|
-
return /* @__PURE__ */ t(
|
|
1578
|
+
return /* @__PURE__ */ t(Ze, { theme: o, children: /* @__PURE__ */ t(Kt, { ...e, children: /* @__PURE__ */ t(wr, {}) }) });
|
|
1539
1579
|
}
|
|
1540
1580
|
export {
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1581
|
+
sr as Autocomplete,
|
|
1582
|
+
Ao as CardSkeleton,
|
|
1583
|
+
er as Image,
|
|
1584
|
+
Fo as default,
|
|
1585
|
+
Dt as useSearch
|
|
1545
1586
|
};
|