@blocklet/list 0.13.40 → 0.14.0
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 +365 -362
- package/package.json +3 -3
package/lib/index.es.js
CHANGED
|
@@ -1,56 +1,56 @@
|
|
|
1
1
|
import { jsx as t, jsxs as m, Fragment as F } from "react/jsx-runtime";
|
|
2
|
-
import { styled as D, useTheme as
|
|
3
|
-
import { Global as
|
|
2
|
+
import { styled as D, useTheme as xe } from "@arcblock/ux/lib/Theme";
|
|
3
|
+
import { Global as we, css as ke } from "@emotion/react";
|
|
4
4
|
import { ErrorFallback as Z } from "@arcblock/ux/lib/ErrorBoundary";
|
|
5
|
-
import { Button as ee, useTheme as
|
|
6
|
-
import { ErrorBoundary as
|
|
7
|
-
import
|
|
8
|
-
import { Icon as
|
|
9
|
-
import
|
|
10
|
-
import { createContext as
|
|
11
|
-
import
|
|
12
|
-
import
|
|
5
|
+
import { Button as ee, useTheme as Xe, useMediaQuery as N, Drawer as Ye, Box as S, CircularProgress as te, MenuList as Je, SvgIcon as Ke, Popper as Ze, Grow as et, Paper as tt, ClickAwayListener as rt, MenuItem as ot, Stack as I, FormControlLabel as ve, Checkbox as Ce, Typography as L, Link as nt, Grid as me, OutlinedInput as lt, InputAdornment as he } from "@mui/material";
|
|
6
|
+
import { ErrorBoundary as at } from "react-error-boundary";
|
|
7
|
+
import it from "@iconify-icons/tabler/compass";
|
|
8
|
+
import { Icon as Se } from "@iconify/react";
|
|
9
|
+
import Be from "@mui/icons-material/Close";
|
|
10
|
+
import { createContext as Re, useState as q, useMemo as E, useContext as Pe, useCallback as K, useEffect as j, forwardRef as st, useRef as U, memo as ct, createElement as dt, Fragment as ut } from "react";
|
|
11
|
+
import Te from "axios";
|
|
12
|
+
import pt from "lodash/orderBy";
|
|
13
13
|
import i from "prop-types";
|
|
14
|
-
import { useInfiniteScroll as
|
|
15
|
-
import
|
|
16
|
-
import
|
|
14
|
+
import { useInfiniteScroll as mt, useRequest as re, useReactive as ht, useDebounceFn as ft } from "ahooks";
|
|
15
|
+
import gt from "lodash/omitBy";
|
|
16
|
+
import yt from "json-stable-stringify";
|
|
17
17
|
import "lodash/cloneDeep";
|
|
18
|
-
import
|
|
19
|
-
import
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
26
|
-
import
|
|
27
|
-
import
|
|
18
|
+
import bt from "color";
|
|
19
|
+
import fe from "flat";
|
|
20
|
+
import xt from "@mui/icons-material/KeyboardArrowDown";
|
|
21
|
+
import wt from "lodash/isEmpty";
|
|
22
|
+
import Ie from "@mui/material/Box";
|
|
23
|
+
import kt from "@arcblock/ux/lib/Avatar";
|
|
24
|
+
import vt from "@iconify-icons/tabler/cloud-download";
|
|
25
|
+
import Ct from "@mui/icons-material/ChevronLeft";
|
|
26
|
+
import St from "@mui/icons-material/ChevronRight";
|
|
27
|
+
import Bt from "react-image-gallery";
|
|
28
28
|
import "react-image-gallery/styles/css/image-gallery.css";
|
|
29
|
-
import
|
|
30
|
-
import
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import { createRoot as
|
|
34
|
-
import { autocomplete as
|
|
35
|
-
import { useHotkeys as
|
|
29
|
+
import Rt from "@arcblock/ux/lib/Empty";
|
|
30
|
+
import Pt from "react-infinite-scroll-hook";
|
|
31
|
+
import Le from "@mui/material/Typography";
|
|
32
|
+
import Tt from "@mui/icons-material/Menu";
|
|
33
|
+
import { createRoot as It } from "react-dom/client";
|
|
34
|
+
import { autocomplete as Lt } from "@algolia/autocomplete-js";
|
|
35
|
+
import { useHotkeys as $t } from "react-hotkeys-hook";
|
|
36
36
|
import { joinURL as zt } from "ufo";
|
|
37
|
-
import
|
|
37
|
+
import _t from "@mui/icons-material/Search";
|
|
38
38
|
import "@algolia/autocomplete-theme-classic/dist/theme.css";
|
|
39
|
-
const
|
|
39
|
+
const $e = Re({
|
|
40
40
|
open: !1,
|
|
41
41
|
toggleOpen: (e) => {
|
|
42
42
|
}
|
|
43
43
|
});
|
|
44
|
-
function
|
|
45
|
-
const [
|
|
46
|
-
|
|
47
|
-
}, a = E(() => ({ open:
|
|
48
|
-
return /* @__PURE__ */ t(
|
|
44
|
+
function At({ children: e }) {
|
|
45
|
+
const [o, r] = q(!1), n = (l) => {
|
|
46
|
+
r(l ?? !l);
|
|
47
|
+
}, a = E(() => ({ open: o, toggleOpen: n }), [o]);
|
|
48
|
+
return /* @__PURE__ */ t($e.Provider, { value: a, children: e });
|
|
49
49
|
}
|
|
50
50
|
function oe() {
|
|
51
|
-
return
|
|
51
|
+
return Pe($e);
|
|
52
52
|
}
|
|
53
|
-
const
|
|
53
|
+
const T = {
|
|
54
54
|
nameAsc: "title",
|
|
55
55
|
nameDesc: "title",
|
|
56
56
|
popularity: "stats.downloads",
|
|
@@ -64,29 +64,29 @@ const P = {
|
|
|
64
64
|
explorePath: "/api/blocklets/explore",
|
|
65
65
|
exploreDidsPath: "/api/blocklets/dids",
|
|
66
66
|
cacheSize: 100
|
|
67
|
-
},
|
|
67
|
+
}, Ft = (e, o, r, n) => mt(
|
|
68
68
|
async (a) => {
|
|
69
|
-
a || (
|
|
70
|
-
const { currentPage: l, pageSize:
|
|
71
|
-
...
|
|
72
|
-
category:
|
|
73
|
-
sortBy:
|
|
69
|
+
a || (r.currentPage = r.defaultCurrentPage);
|
|
70
|
+
const { currentPage: l, pageSize: d } = r, u = {
|
|
71
|
+
...o,
|
|
72
|
+
category: o.category === "All" ? "" : o.category,
|
|
73
|
+
sortBy: T[o.sortBy],
|
|
74
74
|
page: l,
|
|
75
|
-
pageSize:
|
|
75
|
+
pageSize: d
|
|
76
76
|
};
|
|
77
77
|
n(null);
|
|
78
|
-
const { data: s = {} } = await e.get(
|
|
79
|
-
return
|
|
78
|
+
const { data: s = {} } = await e.get(T.blockletsPath, { params: u });
|
|
79
|
+
return r.currentPage++, { page: l, pageSize: d, list: (s == null ? void 0 : s.dataList) || [], total: (s == null ? void 0 : s.total) || 0 };
|
|
80
80
|
},
|
|
81
81
|
{
|
|
82
82
|
isNoMore: (a) => a ? a.page * a.pageSize >= a.total : !1,
|
|
83
|
-
reloadDeps: [e,
|
|
83
|
+
reloadDeps: [e, yt(o)],
|
|
84
84
|
onError: n
|
|
85
85
|
}
|
|
86
|
-
),
|
|
86
|
+
), Dt = (e) => re(
|
|
87
87
|
async () => {
|
|
88
|
-
const { data:
|
|
89
|
-
return Array.isArray(
|
|
88
|
+
const { data: o } = await e.get(T.categoriesPath);
|
|
89
|
+
return Array.isArray(o) ? o : [];
|
|
90
90
|
},
|
|
91
91
|
{ manual: !0 }
|
|
92
92
|
), ze = {
|
|
@@ -113,7 +113,7 @@ const P = {
|
|
|
113
113
|
showResourcesSwitch: i.bool,
|
|
114
114
|
showCategory: i.bool,
|
|
115
115
|
tagFilters: i.array
|
|
116
|
-
},
|
|
116
|
+
}, _e = {
|
|
117
117
|
locale: "zh",
|
|
118
118
|
filters: {},
|
|
119
119
|
serverVersion: "",
|
|
@@ -129,7 +129,7 @@ const P = {
|
|
|
129
129
|
showResourcesSwitch: !1,
|
|
130
130
|
showCategory: !0,
|
|
131
131
|
tagFilters: []
|
|
132
|
-
},
|
|
132
|
+
}, Ae = (e) => [
|
|
133
133
|
{
|
|
134
134
|
name: e("sort.popularity"),
|
|
135
135
|
value: "popularity"
|
|
@@ -142,22 +142,22 @@ const P = {
|
|
|
142
142
|
// name: t('sort.rating'),
|
|
143
143
|
// value: 'rating',
|
|
144
144
|
// },
|
|
145
|
-
],
|
|
145
|
+
], Et = (e) => [
|
|
146
146
|
{ name: e("blocklet.free"), value: "free" },
|
|
147
147
|
{ name: e("blocklet.payment"), value: "payment" }
|
|
148
|
-
],
|
|
148
|
+
], Mt = (e = [], o = "en") => e.map((r) => ({ name: r.locales[o] || r.locales.en, value: r._id })), Nt = (e, o) => (
|
|
149
149
|
// eslint-disable-next-line no-prototype-builtins
|
|
150
|
-
e == null ? void 0 : e.replace(/{(\w*)}/g, (
|
|
151
|
-
),
|
|
152
|
-
function
|
|
153
|
-
let
|
|
150
|
+
e == null ? void 0 : e.replace(/{(\w*)}/g, (r, n) => o.hasOwnProperty(n) ? o[n] : "")
|
|
151
|
+
), Ot = () => window.innerWidth <= 600, qt = (e) => bt(e).rgb().object();
|
|
152
|
+
function jt(e, o) {
|
|
153
|
+
let r;
|
|
154
154
|
return function(...a) {
|
|
155
|
-
return
|
|
156
|
-
|
|
155
|
+
return r && clearTimeout(r), new Promise((l) => {
|
|
156
|
+
r = setTimeout(() => l(e(...a)), o);
|
|
157
157
|
});
|
|
158
158
|
};
|
|
159
159
|
}
|
|
160
|
-
const
|
|
160
|
+
const Vt = jt((e) => Promise.resolve(e), 300), Wt = {
|
|
161
161
|
common: {
|
|
162
162
|
title: "Blocklet Store",
|
|
163
163
|
searchStore: "Search Blocklet",
|
|
@@ -205,7 +205,7 @@ const jt = qt((e) => Promise.resolve(e), 300), Vt = {
|
|
|
205
205
|
autocomplete: {
|
|
206
206
|
expandResult: 'View all search results for "{name}"'
|
|
207
207
|
}
|
|
208
|
-
},
|
|
208
|
+
}, Ut = {
|
|
209
209
|
common: {
|
|
210
210
|
title: "Blocklet 商店",
|
|
211
211
|
searchStore: "搜索 Blocklet",
|
|
@@ -254,15 +254,15 @@ const jt = qt((e) => Promise.resolve(e), 300), Vt = {
|
|
|
254
254
|
expandResult: "查看 “{name}” 的所有搜索结果"
|
|
255
255
|
}
|
|
256
256
|
}, J = {
|
|
257
|
-
en:
|
|
258
|
-
zh:
|
|
259
|
-
},
|
|
260
|
-
const
|
|
261
|
-
return e && (
|
|
262
|
-
},
|
|
263
|
-
const n = J[e] ? J[e][
|
|
264
|
-
return
|
|
265
|
-
},
|
|
257
|
+
en: fe(Wt),
|
|
258
|
+
zh: fe(Ut)
|
|
259
|
+
}, Fe = (e, o) => {
|
|
260
|
+
const r = {};
|
|
261
|
+
return e && (r["x-blocklet-server-version"] = e), o && (r["x-blocklet-store-version"] = o), r;
|
|
262
|
+
}, Ht = (e) => (o, r) => {
|
|
263
|
+
const n = J[e] ? J[e][o] : J.en[o];
|
|
264
|
+
return Nt(n, r) || o;
|
|
265
|
+
}, De = {
|
|
266
266
|
errors: {
|
|
267
267
|
fetchBlockletsError: null,
|
|
268
268
|
fetchCategoriesError: null
|
|
@@ -281,6 +281,7 @@ const jt = qt((e) => Promise.resolve(e), 300), Vt = {
|
|
|
281
281
|
filters: {},
|
|
282
282
|
selectedCategory: void 0,
|
|
283
283
|
categoryList: [],
|
|
284
|
+
total: 0,
|
|
284
285
|
blockletRender: () => null,
|
|
285
286
|
locale: "en",
|
|
286
287
|
categoryOptions: [],
|
|
@@ -315,49 +316,51 @@ const jt = qt((e) => Promise.resolve(e), 300), Vt = {
|
|
|
315
316
|
developerName: "",
|
|
316
317
|
handleSearchSelect: () => {
|
|
317
318
|
}
|
|
318
|
-
},
|
|
319
|
+
}, Ee = Re(De), { Provider: Gt, Consumer: Qr } = Ee;
|
|
319
320
|
function ne({
|
|
320
321
|
filters: e,
|
|
321
|
-
children:
|
|
322
|
-
endpoint:
|
|
322
|
+
children: o,
|
|
323
|
+
endpoint: r,
|
|
323
324
|
locale: n,
|
|
324
325
|
blockletRender: a,
|
|
325
326
|
onFilterChange: l,
|
|
326
|
-
onSearchSelect:
|
|
327
|
-
extraFilter:
|
|
327
|
+
onSearchSelect: d,
|
|
328
|
+
extraFilter: u,
|
|
328
329
|
wrapChildren: s,
|
|
329
330
|
baseSearch: v,
|
|
330
331
|
serverVersion: f,
|
|
331
332
|
storeVersion: y,
|
|
332
|
-
fetchCategoryDelay:
|
|
333
|
+
fetchCategoryDelay: c,
|
|
333
334
|
showResourcesSwitch: w,
|
|
334
335
|
showCategory: k,
|
|
335
336
|
tagFilters: x
|
|
336
337
|
}) {
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
338
|
+
var ue;
|
|
339
|
+
const z = Fe(f, y), b = E(() => Te.create({ baseURL: r, headers: z }), [r]), h = { sortBy: "popularity", sortDirection: "desc", ...e }, C = h.category, _ = ht({
|
|
340
|
+
currentPage: T.currentPage,
|
|
341
|
+
pageSize: Ot() ? T.mobilePageSize : T.pageSize,
|
|
342
|
+
defaultCurrentPage: T.defaultCurrentPage
|
|
343
|
+
}), [A, $] = q(null), R = Ft(b, h, _, $), {
|
|
342
344
|
data: X = [],
|
|
343
|
-
error:
|
|
344
|
-
loading:
|
|
345
|
+
error: We,
|
|
346
|
+
loading: Ue,
|
|
345
347
|
run: se
|
|
346
|
-
} =
|
|
347
|
-
const p =
|
|
348
|
+
} = Dt(b), Y = E(() => {
|
|
349
|
+
const p = pt(X, [(P) => P.name], ["asc"]), g = p.findIndex((P) => P.name === "All" || P.locales.en === "All");
|
|
348
350
|
return g > -1 ? [{ ...p[g], _id: "All" }, ...p.slice(0, g), ...p.slice(g + 1)] : p;
|
|
349
351
|
}, [X]), ce = E(() => {
|
|
350
352
|
var p;
|
|
351
|
-
return
|
|
352
|
-
}, [
|
|
353
|
-
errors: { fetchBlockletsError: A, fetchCategoriesError:
|
|
353
|
+
return u(((p = R.data) == null ? void 0 : p.list) || []);
|
|
354
|
+
}, [R.data, u]), de = K(Ht(n), [n]), He = E(() => Mt(Y, n), [Y, n]), Ge = Et(de), Qe = {
|
|
355
|
+
errors: { fetchBlockletsError: A, fetchCategoriesError: We },
|
|
354
356
|
loadings: {
|
|
355
|
-
fetchBlockletsLoading:
|
|
356
|
-
fetchCategoriesLoading:
|
|
357
|
-
loadingMore:
|
|
357
|
+
fetchBlockletsLoading: R.loading,
|
|
358
|
+
fetchCategoriesLoading: Ue,
|
|
359
|
+
loadingMore: R.loadingMore
|
|
358
360
|
},
|
|
359
|
-
endpoint:
|
|
361
|
+
endpoint: r,
|
|
360
362
|
blockletList: ce,
|
|
363
|
+
total: ((ue = R.data) == null ? void 0 : ue.total) || 0,
|
|
361
364
|
wrapChildren: s,
|
|
362
365
|
t: de,
|
|
363
366
|
storeVersion: y,
|
|
@@ -367,17 +370,17 @@ function ne({
|
|
|
367
370
|
categoryList: Y,
|
|
368
371
|
blockletRender: a,
|
|
369
372
|
locale: n,
|
|
370
|
-
categoryOptions:
|
|
371
|
-
priceOptions:
|
|
373
|
+
categoryOptions: He,
|
|
374
|
+
priceOptions: Ge,
|
|
372
375
|
storeApi: b,
|
|
373
376
|
baseSearch: v,
|
|
374
377
|
showResourcesSwitch: w,
|
|
375
378
|
showCategory: k,
|
|
376
379
|
tagFilters: x,
|
|
377
|
-
hasNextPage: !
|
|
380
|
+
hasNextPage: !R.noMore,
|
|
378
381
|
onFilterChange: l,
|
|
379
382
|
cleanFilter: (p) => {
|
|
380
|
-
const g = p ?
|
|
383
|
+
const g = p ? gt(h, (P, M) => p == null ? void 0 : p.includes(M)) : {};
|
|
381
384
|
l(g);
|
|
382
385
|
},
|
|
383
386
|
handleSort: (p) => {
|
|
@@ -393,8 +396,8 @@ function ne({
|
|
|
393
396
|
l(g);
|
|
394
397
|
},
|
|
395
398
|
handleCategory: (p) => {
|
|
396
|
-
const g = p === "all" || p === h.category ? "" : p,
|
|
397
|
-
l(
|
|
399
|
+
const g = p === "all" || p === h.category ? "" : p, P = { ...h, category: g };
|
|
400
|
+
l(P);
|
|
398
401
|
},
|
|
399
402
|
handleDeveloper: (p) => {
|
|
400
403
|
const g = { ...h, owner: p || void 0 };
|
|
@@ -408,48 +411,48 @@ function ne({
|
|
|
408
411
|
const p = { ...h };
|
|
409
412
|
l(p);
|
|
410
413
|
},
|
|
411
|
-
loadMore:
|
|
414
|
+
loadMore: R.loadMore,
|
|
412
415
|
getCategoryLocale: (p) => {
|
|
413
416
|
if (!p)
|
|
414
417
|
return null;
|
|
415
|
-
const g = X.find((
|
|
418
|
+
const g = X.find((P) => P._id === p);
|
|
416
419
|
return g ? g.locales[n] || g.locales.en : null;
|
|
417
420
|
},
|
|
418
421
|
get developerName() {
|
|
419
|
-
var g,
|
|
420
|
-
return ((
|
|
421
|
-
var
|
|
422
|
-
return ((
|
|
423
|
-
})) == null ? void 0 : g.owner) == null ? void 0 :
|
|
422
|
+
var g, P;
|
|
423
|
+
return ((P = (g = ce.find((M) => {
|
|
424
|
+
var pe;
|
|
425
|
+
return ((pe = M == null ? void 0 : M.owner) == null ? void 0 : pe.did) === h.owner;
|
|
426
|
+
})) == null ? void 0 : g.owner) == null ? void 0 : P.name) || "";
|
|
424
427
|
},
|
|
425
|
-
handleSearchSelect:
|
|
428
|
+
handleSearchSelect: d
|
|
426
429
|
};
|
|
427
430
|
return j(() => {
|
|
428
|
-
setTimeout(se,
|
|
429
|
-
}, [
|
|
431
|
+
setTimeout(se, c || 0);
|
|
432
|
+
}, [r, se, c]), /* @__PURE__ */ t(Gt, { value: Qe, children: o });
|
|
430
433
|
}
|
|
431
434
|
ne.propTypes = {
|
|
432
435
|
...ze,
|
|
433
436
|
children: i.any.isRequired
|
|
434
437
|
};
|
|
435
|
-
ne.defaultProps =
|
|
438
|
+
ne.defaultProps = _e;
|
|
436
439
|
function B() {
|
|
437
|
-
const e =
|
|
438
|
-
return e ||
|
|
440
|
+
const e = Pe(Ee);
|
|
441
|
+
return e || De;
|
|
439
442
|
}
|
|
440
|
-
function
|
|
443
|
+
function Me({
|
|
441
444
|
children: e,
|
|
442
|
-
onClick:
|
|
443
|
-
size:
|
|
445
|
+
onClick: o,
|
|
446
|
+
size: r = 32
|
|
444
447
|
}) {
|
|
445
448
|
return /* @__PURE__ */ t(
|
|
446
449
|
ee,
|
|
447
450
|
{
|
|
448
|
-
onClick:
|
|
451
|
+
onClick: o,
|
|
449
452
|
variant: "outlined",
|
|
450
453
|
sx: {
|
|
451
|
-
minWidth:
|
|
452
|
-
height:
|
|
454
|
+
minWidth: r,
|
|
455
|
+
height: r,
|
|
453
456
|
p: 0,
|
|
454
457
|
borderColor: "divider",
|
|
455
458
|
"&:hover": {
|
|
@@ -462,43 +465,43 @@ function Ee({
|
|
|
462
465
|
}
|
|
463
466
|
);
|
|
464
467
|
}
|
|
465
|
-
function V(e,
|
|
466
|
-
return e === void 0 ?
|
|
468
|
+
function V(e, o) {
|
|
469
|
+
return e === void 0 ? o : e;
|
|
467
470
|
}
|
|
468
471
|
function G({
|
|
469
472
|
xs: e,
|
|
470
|
-
sm:
|
|
471
|
-
md:
|
|
473
|
+
sm: o,
|
|
474
|
+
md: r,
|
|
472
475
|
lg: n,
|
|
473
476
|
xl: a,
|
|
474
477
|
exact: l
|
|
475
478
|
}) {
|
|
476
|
-
const
|
|
479
|
+
const d = Xe(), u = N(d.breakpoints.down("sm")), s = N(d.breakpoints.between("sm", "md")), v = N(d.breakpoints.between("md", "lg")), f = N(d.breakpoints.between("lg", "xl"));
|
|
477
480
|
if (l)
|
|
478
|
-
return
|
|
481
|
+
return u ? e || null : s ? o || null : v ? r || null : f ? n || null : a || null;
|
|
479
482
|
let y = e;
|
|
480
|
-
return
|
|
483
|
+
return u || (y = V(o, y), s) || (y = V(r, y), v) || (y = V(n, y), f) ? y : V(a, y);
|
|
481
484
|
}
|
|
482
|
-
function
|
|
483
|
-
const { open:
|
|
485
|
+
function Qt({ children: e }) {
|
|
486
|
+
const { open: o, toggleOpen: r } = oe();
|
|
484
487
|
return /* @__PURE__ */ t(
|
|
485
488
|
G,
|
|
486
489
|
{
|
|
487
|
-
xs: /* @__PURE__ */ t(
|
|
490
|
+
xs: /* @__PURE__ */ t(Ye, { open: o, onClose: () => r(!1), children: e }),
|
|
488
491
|
md: /* @__PURE__ */ t(S, { children: e })
|
|
489
492
|
}
|
|
490
493
|
);
|
|
491
494
|
}
|
|
492
|
-
const
|
|
495
|
+
const Xt = D(ee)`
|
|
493
496
|
border-radius: 4px;
|
|
494
|
-
`, le =
|
|
495
|
-
|
|
497
|
+
`, le = st(({ children: e, rounded: o, loading: r, disabled: n, ...a }, l) => /* @__PURE__ */ t(
|
|
498
|
+
Xt,
|
|
496
499
|
{
|
|
497
500
|
ref: l,
|
|
498
501
|
disableElevation: !0,
|
|
499
|
-
disabled: n ||
|
|
502
|
+
disabled: n || r,
|
|
500
503
|
...a,
|
|
501
|
-
startIcon:
|
|
504
|
+
startIcon: r && /* @__PURE__ */ t(te, { size: "1em" }),
|
|
502
505
|
children: e
|
|
503
506
|
}
|
|
504
507
|
));
|
|
@@ -514,44 +517,44 @@ le.defaultProps = {
|
|
|
514
517
|
loading: !1,
|
|
515
518
|
disabled: !1
|
|
516
519
|
};
|
|
517
|
-
function Q({ title: e, value:
|
|
518
|
-
const s = U(null), v =
|
|
520
|
+
function Q({ title: e, value: o, icon: r, prepend: n, options: a, onChange: l, itemRender: d, ...u }) {
|
|
521
|
+
const s = U(null), v = xe(), [f, y] = q(!1), [c, w] = q(o !== null ? o : ""), k = N(v.breakpoints.down("sm"));
|
|
519
522
|
j(() => {
|
|
520
|
-
w(
|
|
521
|
-
}, [
|
|
523
|
+
w(o !== null ? o : "");
|
|
524
|
+
}, [o]);
|
|
522
525
|
const x = K(() => {
|
|
523
526
|
y(!1);
|
|
524
|
-
}, []),
|
|
527
|
+
}, []), z = K(() => {
|
|
525
528
|
y(!0);
|
|
526
529
|
}, []);
|
|
527
530
|
function b(C) {
|
|
528
531
|
w(C.value), l(C.value), k && x();
|
|
529
532
|
}
|
|
530
533
|
function h(C) {
|
|
531
|
-
return C ===
|
|
534
|
+
return C === c;
|
|
532
535
|
}
|
|
533
536
|
return /* @__PURE__ */ m(F, { children: [
|
|
534
537
|
/* @__PURE__ */ m(
|
|
535
|
-
|
|
538
|
+
Yt,
|
|
536
539
|
{
|
|
537
540
|
ref: s,
|
|
538
|
-
onClick:
|
|
541
|
+
onClick: z,
|
|
539
542
|
variant: "outlined",
|
|
540
543
|
size: "small",
|
|
541
|
-
className: ["my-select__selector",
|
|
544
|
+
className: ["my-select__selector", wt(c) ? "" : "my-select__selector--active"].join(" "),
|
|
542
545
|
sx: { minWidth: "auto" },
|
|
543
|
-
...
|
|
546
|
+
...u,
|
|
544
547
|
children: [
|
|
545
|
-
/* @__PURE__ */ t("div", { className: "my-select__icon", children:
|
|
548
|
+
/* @__PURE__ */ t("div", { className: "my-select__icon", children: r }),
|
|
546
549
|
e,
|
|
547
|
-
/* @__PURE__ */ t(
|
|
550
|
+
/* @__PURE__ */ t(Ke, { className: "my-select__arrowdown", component: xt, fontSize: "small" })
|
|
548
551
|
]
|
|
549
552
|
}
|
|
550
553
|
),
|
|
551
|
-
/* @__PURE__ */ t(
|
|
554
|
+
/* @__PURE__ */ t(Ze, { open: f, anchorEl: s.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: C, placement: _ }) => /* @__PURE__ */ t(et, { ...C, sx: { transformOrigin: _ === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(tt, { children: /* @__PURE__ */ t(rt, { onClickAway: x, children: /* @__PURE__ */ m(Jt, { autoFocusItem: f, onMouseEnter: z, onMouseLeave: x, children: [
|
|
552
555
|
n,
|
|
553
|
-
a.map((A) =>
|
|
554
|
-
|
|
556
|
+
a.map((A) => d ? d(A) : /* @__PURE__ */ t(
|
|
557
|
+
ot,
|
|
555
558
|
{
|
|
556
559
|
onClick: () => b(A),
|
|
557
560
|
className: [
|
|
@@ -582,7 +585,7 @@ Q.defaultProps = {
|
|
|
582
585
|
onChange: () => {
|
|
583
586
|
}
|
|
584
587
|
};
|
|
585
|
-
const
|
|
588
|
+
const Yt = D(le)`
|
|
586
589
|
border: 1px solid #f0f0f0;
|
|
587
590
|
padding: 6px 8px 6px 12px;
|
|
588
591
|
font-weight: ${(e) => e.theme.typography.fontWeightRegular};
|
|
@@ -613,7 +616,7 @@ const Xt = D(le)`
|
|
|
613
616
|
margin-right: 3px;
|
|
614
617
|
}
|
|
615
618
|
}
|
|
616
|
-
`,
|
|
619
|
+
`, Jt = D(Je)`
|
|
617
620
|
.my-select__option__icon {
|
|
618
621
|
color: transparent;
|
|
619
622
|
font-size: 14px;
|
|
@@ -630,11 +633,11 @@ const Xt = D(le)`
|
|
|
630
633
|
}
|
|
631
634
|
}
|
|
632
635
|
`;
|
|
633
|
-
function
|
|
634
|
-
var
|
|
635
|
-
const { filters: e, handleSort:
|
|
636
|
+
function Ne() {
|
|
637
|
+
var d;
|
|
638
|
+
const { filters: e, handleSort: o, handlePrice: r, t: n } = B(), a = Ae(n), l = ((d = a.find((u) => u.value === e.sortBy)) == null ? void 0 : d.name) || n("sort.sort");
|
|
636
639
|
return /* @__PURE__ */ m(
|
|
637
|
-
|
|
640
|
+
I,
|
|
638
641
|
{
|
|
639
642
|
direction: { xs: "row", md: "column" },
|
|
640
643
|
alignItems: { xs: "center", md: "flex-start" },
|
|
@@ -643,15 +646,15 @@ function Me() {
|
|
|
643
646
|
justifyContent: "space-between",
|
|
644
647
|
children: [
|
|
645
648
|
/* @__PURE__ */ t(
|
|
646
|
-
|
|
649
|
+
ve,
|
|
647
650
|
{
|
|
648
651
|
control: /* @__PURE__ */ t(
|
|
649
|
-
|
|
652
|
+
Ce,
|
|
650
653
|
{
|
|
651
654
|
checked: e.price === "free",
|
|
652
655
|
size: "small",
|
|
653
656
|
sx: { "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
|
|
654
|
-
onChange: (
|
|
657
|
+
onChange: (u) => r(u.target.checked ? "free" : "")
|
|
655
658
|
}
|
|
656
659
|
),
|
|
657
660
|
label: n("blocklet.free")
|
|
@@ -663,7 +666,7 @@ function Me() {
|
|
|
663
666
|
value: e.sortBy,
|
|
664
667
|
options: a,
|
|
665
668
|
title: l,
|
|
666
|
-
onChange:
|
|
669
|
+
onChange: o,
|
|
667
670
|
icon: null,
|
|
668
671
|
prepend: null,
|
|
669
672
|
itemRender: null
|
|
@@ -673,14 +676,14 @@ function Me() {
|
|
|
673
676
|
}
|
|
674
677
|
);
|
|
675
678
|
}
|
|
676
|
-
function
|
|
677
|
-
const { selectedCategory: e, handleCategory:
|
|
678
|
-
return /* @__PURE__ */ m(
|
|
679
|
+
function Kt() {
|
|
680
|
+
const { selectedCategory: e, handleCategory: o, t: r, categoryOptions: n, filters: a, cleanFilter: l, loadings: d } = B(), { toggleOpen: u } = oe();
|
|
681
|
+
return /* @__PURE__ */ m(Qt, { children: [
|
|
679
682
|
/* @__PURE__ */ t(
|
|
680
683
|
G,
|
|
681
684
|
{
|
|
682
685
|
xs: /* @__PURE__ */ m(
|
|
683
|
-
|
|
686
|
+
I,
|
|
684
687
|
{
|
|
685
688
|
direction: "row",
|
|
686
689
|
justifyContent: "space-between",
|
|
@@ -691,8 +694,8 @@ function Jt() {
|
|
|
691
694
|
borderBottom: 1,
|
|
692
695
|
borderColor: "divider",
|
|
693
696
|
children: [
|
|
694
|
-
/* @__PURE__ */ t(
|
|
695
|
-
/* @__PURE__ */ t(
|
|
697
|
+
/* @__PURE__ */ t(Me, { onClick: () => u(!1), children: /* @__PURE__ */ t(Be, {}) }),
|
|
698
|
+
/* @__PURE__ */ t(L, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: "Categories" })
|
|
696
699
|
]
|
|
697
700
|
}
|
|
698
701
|
),
|
|
@@ -700,32 +703,32 @@ function Jt() {
|
|
|
700
703
|
}
|
|
701
704
|
),
|
|
702
705
|
/* @__PURE__ */ t(
|
|
703
|
-
|
|
706
|
+
I,
|
|
704
707
|
{
|
|
705
|
-
visibility:
|
|
708
|
+
visibility: d.fetchCategoriesLoading ? "hidden" : "visible",
|
|
706
709
|
width: { xs: 268, md: 200 },
|
|
707
710
|
boxSizing: "content-box",
|
|
708
711
|
p: { xs: 2, md: 0 },
|
|
709
712
|
pr: { md: 6 },
|
|
710
|
-
children: a.keyword ? /* @__PURE__ */ t(
|
|
713
|
+
children: a.keyword ? /* @__PURE__ */ t(Ne, {}) : /* @__PURE__ */ m(F, { children: [
|
|
711
714
|
/* @__PURE__ */ m(S, { display: "flex", alignItems: "center", gap: 1, children: [
|
|
712
|
-
/* @__PURE__ */ t(
|
|
715
|
+
/* @__PURE__ */ t(Se, { icon: it }),
|
|
713
716
|
/* @__PURE__ */ t(
|
|
714
|
-
|
|
717
|
+
L,
|
|
715
718
|
{
|
|
716
719
|
variant: "body1",
|
|
717
720
|
color: e ? "text.lighter" : "text.primary",
|
|
718
721
|
fontWeight: e ? void 0 : "fontWeightMedium",
|
|
719
722
|
sx: { cursor: "pointer" },
|
|
720
723
|
onClick: () => {
|
|
721
|
-
|
|
724
|
+
u(!1), l();
|
|
722
725
|
},
|
|
723
|
-
children:
|
|
726
|
+
children: r("explore.title")
|
|
724
727
|
}
|
|
725
728
|
)
|
|
726
729
|
] }),
|
|
727
|
-
!!n.length && /* @__PURE__ */ t(
|
|
728
|
-
|
|
730
|
+
!!n.length && /* @__PURE__ */ t(I, { pt: 3, mt: 3, borderTop: 1, borderColor: "divider", gap: 2, children: n.map((s) => /* @__PURE__ */ t(
|
|
731
|
+
L,
|
|
729
732
|
{
|
|
730
733
|
variant: "body1",
|
|
731
734
|
title: s.name,
|
|
@@ -734,7 +737,7 @@ function Jt() {
|
|
|
734
737
|
color: e === s.value ? "text.primary" : "text.lighter",
|
|
735
738
|
textTransform: "capitalize",
|
|
736
739
|
onClick: () => {
|
|
737
|
-
e === s.value ? l() :
|
|
740
|
+
e === s.value ? l() : o(s.value), u(!1);
|
|
738
741
|
},
|
|
739
742
|
children: s.name
|
|
740
743
|
},
|
|
@@ -745,51 +748,51 @@ function Jt() {
|
|
|
745
748
|
)
|
|
746
749
|
] });
|
|
747
750
|
}
|
|
748
|
-
function
|
|
749
|
-
const { endpoint: e, serverVersion:
|
|
751
|
+
function Oe() {
|
|
752
|
+
const { endpoint: e, serverVersion: o, storeVersion: r } = B(), n = Fe(o, r), a = E(() => Te.create({
|
|
750
753
|
baseURL: e,
|
|
751
754
|
headers: n
|
|
752
755
|
}), [e]);
|
|
753
756
|
return {
|
|
754
757
|
get: async (l) => {
|
|
755
|
-
const { data:
|
|
756
|
-
return c;
|
|
757
|
-
},
|
|
758
|
-
post: async (l, c) => {
|
|
759
|
-
const { data: d } = await a.post(l, c);
|
|
758
|
+
const { data: d } = await a.get(l);
|
|
760
759
|
return d;
|
|
760
|
+
},
|
|
761
|
+
post: async (l, d) => {
|
|
762
|
+
const { data: u } = await a.post(l, d);
|
|
763
|
+
return u;
|
|
761
764
|
}
|
|
762
765
|
};
|
|
763
766
|
}
|
|
764
|
-
const
|
|
765
|
-
return /* @__PURE__ */ t(
|
|
767
|
+
const qe = ct(function(o) {
|
|
768
|
+
return /* @__PURE__ */ t(Ie, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...o, children: /* @__PURE__ */ t(te, {}) });
|
|
766
769
|
});
|
|
767
|
-
function
|
|
770
|
+
function ge({
|
|
768
771
|
icon: e,
|
|
769
|
-
children:
|
|
770
|
-
maxWidth:
|
|
772
|
+
children: o,
|
|
773
|
+
maxWidth: r = 100,
|
|
771
774
|
title: n
|
|
772
775
|
}) {
|
|
773
|
-
return (
|
|
776
|
+
return (o === 0 || o) && /* @__PURE__ */ m(I, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: r, overflow: "hidden" }, children: [
|
|
774
777
|
e,
|
|
775
778
|
/* @__PURE__ */ t(
|
|
776
|
-
|
|
779
|
+
L,
|
|
777
780
|
{
|
|
778
781
|
flex: 1,
|
|
779
782
|
variant: "body2",
|
|
780
783
|
sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
|
|
781
|
-
title: n || (typeof
|
|
782
|
-
children:
|
|
784
|
+
title: n || (typeof o == "string" ? o : void 0),
|
|
785
|
+
children: o
|
|
783
786
|
}
|
|
784
787
|
)
|
|
785
788
|
] });
|
|
786
789
|
}
|
|
787
|
-
const
|
|
788
|
-
function
|
|
790
|
+
const ye = 292;
|
|
791
|
+
function Zt() {
|
|
789
792
|
var f, y;
|
|
790
|
-
const { t: e } = B(), { post:
|
|
791
|
-
const
|
|
792
|
-
return Array.isArray(
|
|
793
|
+
const { t: e } = B(), { post: o } = Oe(), r = ((y = (f = window.blocklet) == null ? void 0 : f.preferences) == null ? void 0 : y.homeBanner) || [], { data: n = [] } = re(async () => {
|
|
794
|
+
const c = await o(T.exploreDidsPath, { didList: r.map((w) => w.did) });
|
|
795
|
+
return Array.isArray(c) ? c : [];
|
|
793
796
|
}), a = {
|
|
794
797
|
position: "absolute",
|
|
795
798
|
top: "50%",
|
|
@@ -798,10 +801,10 @@ function Kt() {
|
|
|
798
801
|
cursor: "pointer",
|
|
799
802
|
color: "text.lighter"
|
|
800
803
|
};
|
|
801
|
-
return
|
|
802
|
-
/* @__PURE__ */ t(
|
|
803
|
-
/* @__PURE__ */ t(S, { height: { xs: "auto", md:
|
|
804
|
-
|
|
804
|
+
return r.length > 0 ? /* @__PURE__ */ m(F, { children: [
|
|
805
|
+
/* @__PURE__ */ t(L, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
|
|
806
|
+
/* @__PURE__ */ t(S, { height: { xs: "auto", md: ye }, position: "relative", bgcolor: "#F0F7FF", borderRadius: 3, children: /* @__PURE__ */ t(
|
|
807
|
+
Bt,
|
|
805
808
|
{
|
|
806
809
|
showNav: !0,
|
|
807
810
|
autoPlay: !0,
|
|
@@ -812,17 +815,17 @@ function Kt() {
|
|
|
812
815
|
showBullets: !1,
|
|
813
816
|
showThumbnails: !1,
|
|
814
817
|
showFullscreenButton: !1,
|
|
815
|
-
renderLeftNav: (
|
|
816
|
-
renderRightNav: (
|
|
817
|
-
items:
|
|
818
|
-
original:
|
|
818
|
+
renderLeftNav: (c) => /* @__PURE__ */ t(S, { onClick: c, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Ct, { sx: { ...a, left: 5 } }) }),
|
|
819
|
+
renderRightNav: (c) => /* @__PURE__ */ t(S, { onClick: c, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(St, { sx: { ...a, right: 5 } }) }),
|
|
820
|
+
items: r.map((c, w) => ({
|
|
821
|
+
original: c.did,
|
|
819
822
|
renderItem: () => {
|
|
820
823
|
var x;
|
|
821
824
|
const k = n[w] || {};
|
|
822
825
|
return /* @__PURE__ */ m(
|
|
823
|
-
|
|
826
|
+
I,
|
|
824
827
|
{
|
|
825
|
-
height: { xs: "auto", md:
|
|
828
|
+
height: { xs: "auto", md: ye },
|
|
826
829
|
display: "flex",
|
|
827
830
|
direction: { xs: "column", md: "row" },
|
|
828
831
|
justifyContent: "center",
|
|
@@ -830,14 +833,14 @@ function Kt() {
|
|
|
830
833
|
p: { xs: 2, md: 5 },
|
|
831
834
|
gap: { xs: 2, md: 5 },
|
|
832
835
|
children: [
|
|
833
|
-
l(
|
|
834
|
-
/* @__PURE__ */ m(
|
|
836
|
+
l(c.cover || tr(c.did, (x = k.screenshots) == null ? void 0 : x[0])),
|
|
837
|
+
/* @__PURE__ */ m(I, { flex: 1, height: "100%", gap: 3, children: [
|
|
835
838
|
/* @__PURE__ */ m(S, { flex: 1, children: [
|
|
836
|
-
c
|
|
837
|
-
|
|
839
|
+
d(c.name || k.title || c.name),
|
|
840
|
+
u(c.desc || k.description)
|
|
838
841
|
] }),
|
|
839
|
-
k.did && s(k,
|
|
840
|
-
v(
|
|
842
|
+
k.did && s(k, c.baseNum),
|
|
843
|
+
v(c.link, c.did)
|
|
841
844
|
] })
|
|
842
845
|
]
|
|
843
846
|
}
|
|
@@ -847,15 +850,15 @@ function Kt() {
|
|
|
847
850
|
}
|
|
848
851
|
) })
|
|
849
852
|
] }) : null;
|
|
850
|
-
function l(
|
|
851
|
-
return /* @__PURE__ */ t(S, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", children: /* @__PURE__ */ t("img", { src:
|
|
853
|
+
function l(c) {
|
|
854
|
+
return /* @__PURE__ */ t(S, { width: { xs: "100%", md: 338 }, height: 210, borderRadius: 2, overflow: "hidden", children: /* @__PURE__ */ t("img", { src: c, alt: "", style: { width: "100%", height: "100%", objectFit: "cover" } }) });
|
|
852
855
|
}
|
|
853
|
-
function c
|
|
854
|
-
return /* @__PURE__ */ t(
|
|
856
|
+
function d(c) {
|
|
857
|
+
return /* @__PURE__ */ t(L, { variant: "h2", width: "100%", children: c });
|
|
855
858
|
}
|
|
856
|
-
function
|
|
859
|
+
function u(c) {
|
|
857
860
|
return /* @__PURE__ */ t(
|
|
858
|
-
|
|
861
|
+
L,
|
|
859
862
|
{
|
|
860
863
|
variant: "body2",
|
|
861
864
|
color: "text.secondary",
|
|
@@ -871,19 +874,19 @@ function Kt() {
|
|
|
871
874
|
overflow: "hidden",
|
|
872
875
|
WebkitBoxOrient: "vertical"
|
|
873
876
|
},
|
|
874
|
-
children:
|
|
877
|
+
children: c
|
|
875
878
|
}
|
|
876
879
|
);
|
|
877
880
|
}
|
|
878
|
-
function s(
|
|
879
|
-
const { did: k, owner: x, stats:
|
|
881
|
+
function s(c, w = 0) {
|
|
882
|
+
const { did: k, owner: x, stats: z } = c;
|
|
880
883
|
return /* @__PURE__ */ m(S, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
|
|
881
|
-
/* @__PURE__ */ t(
|
|
882
|
-
/* @__PURE__ */ t(
|
|
884
|
+
/* @__PURE__ */ t(ge, { icon: /* @__PURE__ */ t(kt, { src: x.avatar, did: k, size: 20, variant: "circle" }), children: x.fullName }),
|
|
885
|
+
/* @__PURE__ */ t(ge, { icon: /* @__PURE__ */ t(Se, { icon: vt }), title: `${z.downloads + w}`, children: er(z.downloads + w) })
|
|
883
886
|
] });
|
|
884
887
|
}
|
|
885
|
-
function v(
|
|
886
|
-
return /* @__PURE__ */ t(
|
|
888
|
+
function v(c, w) {
|
|
889
|
+
return /* @__PURE__ */ t(nt, { href: c || `/blocklets/${w}`, align: "left", width: 100, children: /* @__PURE__ */ t(
|
|
887
890
|
ee,
|
|
888
891
|
{
|
|
889
892
|
variant: "outlined",
|
|
@@ -899,35 +902,35 @@ function Kt() {
|
|
|
899
902
|
) });
|
|
900
903
|
}
|
|
901
904
|
}
|
|
902
|
-
const
|
|
903
|
-
function
|
|
904
|
-
const { blockletRender:
|
|
905
|
+
const er = (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`, tr = (e, o) => e && o ? `/assets/${e}/screenshots/${o}` : "";
|
|
906
|
+
function rr({ title: e, blocklets: o }) {
|
|
907
|
+
const { blockletRender: r, serverVersion: n } = B();
|
|
905
908
|
return /* @__PURE__ */ m(S, { mt: 3, children: [
|
|
906
|
-
/* @__PURE__ */ t(
|
|
907
|
-
/* @__PURE__ */ t(
|
|
909
|
+
/* @__PURE__ */ t(L, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
|
|
910
|
+
/* @__PURE__ */ t(me, { container: !0, spacing: 2, children: o.map((a) => /* @__PURE__ */ t(me, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": a.did, children: /* @__PURE__ */ t(S, { padding: "1px", children: r({ blocklet: a, blocklets: o, serverVersion: n }) }) }, a.did)) })
|
|
908
911
|
] });
|
|
909
912
|
}
|
|
910
|
-
function
|
|
911
|
-
const { get: e } =
|
|
912
|
-
data:
|
|
913
|
+
function or() {
|
|
914
|
+
const { get: e } = Oe(), { t: o } = B(), {
|
|
915
|
+
data: r = [],
|
|
913
916
|
error: n,
|
|
914
917
|
loading: a
|
|
915
918
|
} = re(async () => {
|
|
916
|
-
const l = await e(
|
|
919
|
+
const l = await e(T.explorePath);
|
|
917
920
|
return Array.isArray(l) ? l : [];
|
|
918
921
|
});
|
|
919
|
-
return n ? /* @__PURE__ */ t(Z, { error: new Error(`Failed to fetch blocklets from ${
|
|
920
|
-
/* @__PURE__ */ t(
|
|
921
|
-
|
|
922
|
-
(l) => l.blocklets.length > 0 ? /* @__PURE__ */ t(
|
|
922
|
+
return n ? /* @__PURE__ */ t(Z, { error: new Error(`Failed to fetch blocklets from ${T.explorePath}`) }) : a ? /* @__PURE__ */ t(qe, { mt: 15 }) : /* @__PURE__ */ m(F, { children: [
|
|
923
|
+
/* @__PURE__ */ t(Zt, {}),
|
|
924
|
+
r.map(
|
|
925
|
+
(l) => l.blocklets.length > 0 ? /* @__PURE__ */ t(rr, { title: o(`explore.${l.type}`), blocklets: l.blocklets }, l.type) : null
|
|
923
926
|
)
|
|
924
927
|
] });
|
|
925
928
|
}
|
|
926
|
-
function
|
|
927
|
-
var
|
|
928
|
-
const { filters: e, handleSort:
|
|
929
|
+
function nr() {
|
|
930
|
+
var u;
|
|
931
|
+
const { filters: e, handleSort: o, handlePrice: r, t: n, getCategoryLocale: a } = B(), l = Ae(n), d = ((u = l.find((s) => s.value === e.sortBy)) == null ? void 0 : u.name) || n("sort.sort");
|
|
929
932
|
return /* @__PURE__ */ m(
|
|
930
|
-
|
|
933
|
+
I,
|
|
931
934
|
{
|
|
932
935
|
direction: { xs: "column", md: "row" },
|
|
933
936
|
alignItems: { xs: "flex-start", md: "center" },
|
|
@@ -937,18 +940,18 @@ function rr() {
|
|
|
937
940
|
px: 0,
|
|
938
941
|
pb: 3,
|
|
939
942
|
children: [
|
|
940
|
-
/* @__PURE__ */ t(
|
|
941
|
-
/* @__PURE__ */ m(
|
|
943
|
+
/* @__PURE__ */ t(L, { variant: "h2", textTransform: "capitalize", children: a(e.category) }),
|
|
944
|
+
/* @__PURE__ */ m(I, { direction: "row", alignItems: "center", width: { xs: "100%", md: "auto" }, justifyContent: "space-between", children: [
|
|
942
945
|
/* @__PURE__ */ t(
|
|
943
|
-
|
|
946
|
+
ve,
|
|
944
947
|
{
|
|
945
948
|
control: /* @__PURE__ */ t(
|
|
946
|
-
|
|
949
|
+
Ce,
|
|
947
950
|
{
|
|
948
951
|
checked: e.price === "free",
|
|
949
952
|
size: "small",
|
|
950
953
|
sx: { "& .MuiSvgIcon-fontSizeSmall": { fontSize: 16, color: "text.lighter" } },
|
|
951
|
-
onChange: (s) =>
|
|
954
|
+
onChange: (s) => r(s.target.checked ? "free" : "")
|
|
952
955
|
}
|
|
953
956
|
),
|
|
954
957
|
label: n("blocklet.free")
|
|
@@ -959,8 +962,8 @@ function rr() {
|
|
|
959
962
|
{
|
|
960
963
|
value: e.sortBy,
|
|
961
964
|
options: l,
|
|
962
|
-
title:
|
|
963
|
-
onChange:
|
|
965
|
+
title: d,
|
|
966
|
+
onChange: o,
|
|
964
967
|
icon: null,
|
|
965
968
|
prepend: null,
|
|
966
969
|
itemRender: null
|
|
@@ -971,17 +974,17 @@ function rr() {
|
|
|
971
974
|
}
|
|
972
975
|
);
|
|
973
976
|
}
|
|
974
|
-
function
|
|
977
|
+
function be() {
|
|
975
978
|
const { t: e } = B();
|
|
976
|
-
return /* @__PURE__ */ t(
|
|
979
|
+
return /* @__PURE__ */ t(Le, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
|
|
977
980
|
}
|
|
978
|
-
function O({ filterTip: e, keywordTip:
|
|
979
|
-
const { t:
|
|
980
|
-
return /* @__PURE__ */ m(
|
|
981
|
-
/* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children:
|
|
982
|
-
e && /* @__PURE__ */ t("span", { children:
|
|
983
|
-
e &&
|
|
984
|
-
|
|
981
|
+
function O({ filterTip: e, keywordTip: o }) {
|
|
982
|
+
const { t: r, locale: n } = B(), a = () => n === "zh" ? "、" : " , ";
|
|
983
|
+
return /* @__PURE__ */ m(Ie, { className: "tips", children: [
|
|
984
|
+
/* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: r("blocklet.emptyTip") }),
|
|
985
|
+
e && /* @__PURE__ */ t("span", { children: r("blocklet.filterTip") }),
|
|
986
|
+
e && o && a(),
|
|
987
|
+
o && /* @__PURE__ */ t("span", { children: r("blocklet.keywordTip") })
|
|
985
988
|
] });
|
|
986
989
|
}
|
|
987
990
|
O.propTypes = {
|
|
@@ -992,16 +995,16 @@ O.defaultProps = {
|
|
|
992
995
|
filterTip: !1,
|
|
993
996
|
keywordTip: !1
|
|
994
997
|
};
|
|
995
|
-
function H({ primaryStart: e, primaryEnd:
|
|
996
|
-
return /* @__PURE__ */ m(
|
|
998
|
+
function H({ primaryStart: e, primaryEnd: o, filter: r }) {
|
|
999
|
+
return /* @__PURE__ */ m(Le, { variant: "subtitle2", children: [
|
|
997
1000
|
/* @__PURE__ */ t("span", { children: e }),
|
|
998
1001
|
/* @__PURE__ */ m("span", { className: "primary", children: [
|
|
999
1002
|
" ",
|
|
1000
|
-
|
|
1003
|
+
r,
|
|
1001
1004
|
" "
|
|
1002
1005
|
] }),
|
|
1003
1006
|
/* @__PURE__ */ m("span", { children: [
|
|
1004
|
-
|
|
1007
|
+
o,
|
|
1005
1008
|
" "
|
|
1006
1009
|
] })
|
|
1007
1010
|
] });
|
|
@@ -1011,20 +1014,20 @@ H.propTypes = {
|
|
|
1011
1014
|
primaryEnd: i.string.isRequired,
|
|
1012
1015
|
filter: i.string.isRequired
|
|
1013
1016
|
};
|
|
1014
|
-
function
|
|
1017
|
+
function je({ blocklets: e, ...o }) {
|
|
1015
1018
|
const {
|
|
1016
|
-
blockletRender:
|
|
1019
|
+
blockletRender: r,
|
|
1017
1020
|
errors: n,
|
|
1018
1021
|
loadings: a,
|
|
1019
1022
|
selectedCategory: l,
|
|
1020
|
-
getCategoryLocale:
|
|
1021
|
-
filters:
|
|
1023
|
+
getCategoryLocale: d,
|
|
1024
|
+
filters: u,
|
|
1022
1025
|
t: s,
|
|
1023
1026
|
serverVersion: v,
|
|
1024
1027
|
hasNextPage: f,
|
|
1025
1028
|
loadMore: y,
|
|
1026
|
-
endpoint:
|
|
1027
|
-
} = B(), w = !!l || !!
|
|
1029
|
+
endpoint: c
|
|
1030
|
+
} = B(), w = !!l || !!u.price, [k] = Pt({
|
|
1028
1031
|
loading: a.fetchBlockletsLoading || a.loadingMore,
|
|
1029
1032
|
hasNextPage: f,
|
|
1030
1033
|
onLoadMore: y
|
|
@@ -1033,37 +1036,37 @@ function qe({ blocklets: e, ...r }) {
|
|
|
1033
1036
|
return /* @__PURE__ */ t(
|
|
1034
1037
|
Z,
|
|
1035
1038
|
{
|
|
1036
|
-
error: new Error(`Failed to fetch blocklets from ${
|
|
1039
|
+
error: new Error(`Failed to fetch blocklets from ${c}: ${n.fetchBlockletsError.message}`)
|
|
1037
1040
|
}
|
|
1038
1041
|
);
|
|
1039
1042
|
if (a.fetchBlockletsLoading)
|
|
1040
|
-
return /* @__PURE__ */ t(
|
|
1041
|
-
if (
|
|
1043
|
+
return /* @__PURE__ */ t(qe, { mt: 15 });
|
|
1044
|
+
if (u.keyword && w && e.length === 0)
|
|
1042
1045
|
return /* @__PURE__ */ m(W, { children: [
|
|
1043
1046
|
/* @__PURE__ */ t(
|
|
1044
1047
|
H,
|
|
1045
1048
|
{
|
|
1046
1049
|
primaryStart: s("blocklet.noBlockletPart1"),
|
|
1047
1050
|
primaryEnd: s("blocklet.noBlockletPart2"),
|
|
1048
|
-
filter:
|
|
1051
|
+
filter: u.keyword
|
|
1049
1052
|
}
|
|
1050
1053
|
),
|
|
1051
1054
|
/* @__PURE__ */ t(O, { keywordTip: !0, filterTip: !0 })
|
|
1052
1055
|
] });
|
|
1053
|
-
if (
|
|
1056
|
+
if (u.keyword && e.length === 0)
|
|
1054
1057
|
return /* @__PURE__ */ m(W, { children: [
|
|
1055
1058
|
/* @__PURE__ */ t(
|
|
1056
1059
|
H,
|
|
1057
1060
|
{
|
|
1058
1061
|
primaryStart: s("blocklet.noBlockletPart1"),
|
|
1059
1062
|
primaryEnd: s("blocklet.noBlockletPart2"),
|
|
1060
|
-
filter:
|
|
1063
|
+
filter: u.keyword
|
|
1061
1064
|
}
|
|
1062
1065
|
),
|
|
1063
1066
|
/* @__PURE__ */ t(O, { keywordTip: !0 })
|
|
1064
1067
|
] });
|
|
1065
1068
|
if (w && e.length === 0) {
|
|
1066
|
-
const x =
|
|
1069
|
+
const x = d(l);
|
|
1067
1070
|
return /* @__PURE__ */ m(W, { children: [
|
|
1068
1071
|
x ? /* @__PURE__ */ t(
|
|
1069
1072
|
H,
|
|
@@ -1072,19 +1075,19 @@ function qe({ blocklets: e, ...r }) {
|
|
|
1072
1075
|
primaryEnd: s("blocklet.noCategoryResults2"),
|
|
1073
1076
|
filter: x
|
|
1074
1077
|
}
|
|
1075
|
-
) : /* @__PURE__ */ t(
|
|
1078
|
+
) : /* @__PURE__ */ t(be, {}),
|
|
1076
1079
|
/* @__PURE__ */ t(O, { filterTip: !0 })
|
|
1077
1080
|
] });
|
|
1078
1081
|
}
|
|
1079
|
-
return e.length === 0 ? /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(
|
|
1080
|
-
/* @__PURE__ */ t(S, { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, p: "2px", ...
|
|
1082
|
+
return e.length === 0 ? /* @__PURE__ */ t(W, { children: /* @__PURE__ */ t(be, {}) }) : /* @__PURE__ */ m(F, { children: [
|
|
1083
|
+
/* @__PURE__ */ t(S, { display: "grid", gridTemplateColumns: { xs: "1fr", sm: "1fr 1fr" }, p: "2px", ...o, gap: 2, children: e.map((x) => /* @__PURE__ */ t(S, { "data-blocklet-did": x.did, children: r({ blocklet: x, blocklets: e, serverVersion: v }) }, x.did)) }),
|
|
1081
1084
|
f && /* @__PURE__ */ t(S, { height: 60, display: "flex", justifyContent: "center", py: 2, ref: k, children: /* @__PURE__ */ t(te, {}) })
|
|
1082
1085
|
] });
|
|
1083
1086
|
}
|
|
1084
|
-
|
|
1087
|
+
je.propTypes = {
|
|
1085
1088
|
blocklets: i.array.isRequired
|
|
1086
1089
|
};
|
|
1087
|
-
const W = D(
|
|
1090
|
+
const W = D(Rt)`
|
|
1088
1091
|
text-align: center;
|
|
1089
1092
|
margin-top: 100px;
|
|
1090
1093
|
.primary {
|
|
@@ -1094,38 +1097,38 @@ const W = D(Bt)`
|
|
|
1094
1097
|
margin-top: ${(e) => e.theme.spacing(1)};
|
|
1095
1098
|
}
|
|
1096
1099
|
`;
|
|
1097
|
-
function ae({ onSelect: e, wrapChildren:
|
|
1098
|
-
const
|
|
1099
|
-
const { data: h } = await l.get(
|
|
1100
|
+
function ae({ onSelect: e, wrapChildren: o }) {
|
|
1101
|
+
const r = U(null), n = U(null), a = U(null), { storeApi: l, blockletRender: d, filters: u, endpoint: s, handleKeyword: v, t: f, serverVersion: y } = B(), c = async (b) => {
|
|
1102
|
+
const { data: h } = await l.get(T.blockletsPath, { params: b }), C = h.dataList || [];
|
|
1100
1103
|
return C.length > 0 && C.unshift({ type: "more-result", total: h.total || 0 }), C;
|
|
1101
1104
|
}, w = (b) => {
|
|
1102
1105
|
v(b.state.query), b.setIsOpen(!1);
|
|
1103
1106
|
}, k = () => {
|
|
1104
|
-
|
|
1105
|
-
const b =
|
|
1107
|
+
r.current && setTimeout(() => {
|
|
1108
|
+
const b = r.current.querySelector("input.bl-autocomplete-input");
|
|
1106
1109
|
b && b.focus();
|
|
1107
1110
|
});
|
|
1108
1111
|
}, x = (b) => {
|
|
1109
1112
|
b.setIsOpen(!1), k();
|
|
1110
|
-
},
|
|
1113
|
+
}, z = ({ prevState: b, state: h }) => {
|
|
1111
1114
|
b.query !== h.query && (h.query || (v(), k()));
|
|
1112
1115
|
};
|
|
1113
|
-
return
|
|
1116
|
+
return $t(
|
|
1114
1117
|
"ctrl + k, command + k",
|
|
1115
1118
|
(b) => (b.stopPropagation(), b.preventDefault(), k(), !1),
|
|
1116
1119
|
{ enableOnTags: ["INPUT"] }
|
|
1117
1120
|
), j(() => {
|
|
1118
1121
|
k();
|
|
1119
1122
|
}, [s]), j(() => {
|
|
1120
|
-
if (!
|
|
1123
|
+
if (!r.current)
|
|
1121
1124
|
return;
|
|
1122
|
-
const b =
|
|
1123
|
-
container:
|
|
1124
|
-
renderer: { createElement:
|
|
1125
|
+
const b = Lt({
|
|
1126
|
+
container: r.current,
|
|
1127
|
+
renderer: { createElement: dt, Fragment: ut, render: () => {
|
|
1125
1128
|
} },
|
|
1126
1129
|
render({ children: h }, C) {
|
|
1127
1130
|
var _;
|
|
1128
|
-
(!n.current || a.current !== C) && (a.current = C, (_ = n.current) == null || _.unmount(), n.current =
|
|
1131
|
+
(!n.current || a.current !== C) && (a.current = C, (_ = n.current) == null || _.unmount(), n.current = It(C)), n.current.render(o(h));
|
|
1129
1132
|
},
|
|
1130
1133
|
autoFocus: !0,
|
|
1131
1134
|
openOnFocus: !1,
|
|
@@ -1146,10 +1149,10 @@ function ae({ onSelect: e, wrapChildren: r }) {
|
|
|
1146
1149
|
},
|
|
1147
1150
|
placeholder: f("common.searchStore"),
|
|
1148
1151
|
initialState: {
|
|
1149
|
-
query:
|
|
1152
|
+
query: u.keyword
|
|
1150
1153
|
},
|
|
1151
1154
|
onStateChange(h) {
|
|
1152
|
-
|
|
1155
|
+
z(h);
|
|
1153
1156
|
},
|
|
1154
1157
|
onSubmit: w,
|
|
1155
1158
|
onReset(h) {
|
|
@@ -1157,32 +1160,32 @@ function ae({ onSelect: e, wrapChildren: r }) {
|
|
|
1157
1160
|
},
|
|
1158
1161
|
getSources({ query: h, state: C, ..._ }) {
|
|
1159
1162
|
const A = {
|
|
1160
|
-
sortBy:
|
|
1163
|
+
sortBy: T.nameDesc,
|
|
1161
1164
|
page: 1,
|
|
1162
1165
|
pageSize: 10,
|
|
1163
1166
|
keyword: h
|
|
1164
1167
|
};
|
|
1165
|
-
return
|
|
1168
|
+
return Vt([
|
|
1166
1169
|
{
|
|
1167
1170
|
sourceId: "blocklets",
|
|
1168
1171
|
getItems() {
|
|
1169
|
-
return
|
|
1172
|
+
return c(A);
|
|
1170
1173
|
},
|
|
1171
1174
|
// 选中后填充 搜索框中值
|
|
1172
|
-
getItemInputValue({ item:
|
|
1173
|
-
return
|
|
1175
|
+
getItemInputValue({ item: $ }) {
|
|
1176
|
+
return $.type === "more-result" ? h : $.title;
|
|
1174
1177
|
},
|
|
1175
1178
|
// 选中或者点击自动完成列表中的 item 时触发
|
|
1176
|
-
onSelect({ event:
|
|
1177
|
-
return
|
|
1178
|
-
blocklet:
|
|
1179
|
-
detailUrl: zt(s, "/blocklets",
|
|
1179
|
+
onSelect({ event: $, item: R }) {
|
|
1180
|
+
return R.type === "more-result" ? (_.setIsOpen(!1), v(h)) : $.type === "keydown" ? v(R.title) : e({
|
|
1181
|
+
blocklet: R,
|
|
1182
|
+
detailUrl: zt(s, "/blocklets", R.did),
|
|
1180
1183
|
storeUrl: s
|
|
1181
1184
|
});
|
|
1182
1185
|
},
|
|
1183
1186
|
templates: {
|
|
1184
|
-
item({ item:
|
|
1185
|
-
return
|
|
1187
|
+
item({ item: $ }) {
|
|
1188
|
+
return $.type === "more-result" ? /* @__PURE__ */ t("div", { children: f("autocomplete.expandResult", { name: h, number: $.total.toLocaleString() }) }) : d({ blocklet: $, autocompleteSetters: _, serverVersion: y });
|
|
1186
1189
|
},
|
|
1187
1190
|
noResults() {
|
|
1188
1191
|
return f("blocklet.noResults");
|
|
@@ -1195,11 +1198,11 @@ function ae({ onSelect: e, wrapChildren: r }) {
|
|
|
1195
1198
|
return () => {
|
|
1196
1199
|
b.destroy();
|
|
1197
1200
|
};
|
|
1198
|
-
}, [
|
|
1201
|
+
}, [u, d]), /* @__PURE__ */ m(F, { children: [
|
|
1199
1202
|
/* @__PURE__ */ t(
|
|
1200
|
-
|
|
1203
|
+
we,
|
|
1201
1204
|
{
|
|
1202
|
-
styles: (b) =>
|
|
1205
|
+
styles: (b) => ke`
|
|
1203
1206
|
.bl-autocomplete-detached-container {
|
|
1204
1207
|
.bl-autocomplete-detached-cancel {
|
|
1205
1208
|
white-space: nowrap;
|
|
@@ -1214,7 +1217,7 @@ function ae({ onSelect: e, wrapChildren: r }) {
|
|
|
1214
1217
|
`
|
|
1215
1218
|
}
|
|
1216
1219
|
),
|
|
1217
|
-
/* @__PURE__ */ t("div", { className: "bl-search-container", ref:
|
|
1220
|
+
/* @__PURE__ */ t("div", { className: "bl-search-container", ref: r })
|
|
1218
1221
|
] });
|
|
1219
1222
|
}
|
|
1220
1223
|
ae.propTypes = {
|
|
@@ -1224,29 +1227,29 @@ ae.propTypes = {
|
|
|
1224
1227
|
ae.defaultProps = {
|
|
1225
1228
|
wrapChildren: (e) => e
|
|
1226
1229
|
};
|
|
1227
|
-
function ie({ placeholder: e, ...
|
|
1228
|
-
const { filters:
|
|
1230
|
+
function ie({ placeholder: e, ...o }) {
|
|
1231
|
+
const { filters: r, handleKeyword: n } = B(), [a, l] = q(r.keyword || ""), d = ft(n, { wait: 300 }), u = (v) => {
|
|
1229
1232
|
const { value: f } = v.target;
|
|
1230
|
-
l(f),
|
|
1233
|
+
l(f), d.run(f);
|
|
1231
1234
|
}, s = () => {
|
|
1232
1235
|
l(""), n();
|
|
1233
1236
|
};
|
|
1234
1237
|
return j(() => {
|
|
1235
|
-
l(
|
|
1236
|
-
}, [
|
|
1237
|
-
|
|
1238
|
+
l(r.keyword || "");
|
|
1239
|
+
}, [r.keyword]), /* @__PURE__ */ t(
|
|
1240
|
+
lr,
|
|
1238
1241
|
{
|
|
1239
1242
|
inputProps: {
|
|
1240
1243
|
"data-cy": "search-blocklet"
|
|
1241
1244
|
},
|
|
1242
|
-
startAdornment: /* @__PURE__ */ t(
|
|
1243
|
-
onChange:
|
|
1245
|
+
startAdornment: /* @__PURE__ */ t(he, { position: "start", children: /* @__PURE__ */ t(ar, {}) }),
|
|
1246
|
+
onChange: u,
|
|
1244
1247
|
placeholder: e,
|
|
1245
1248
|
value: a,
|
|
1246
1249
|
title: e,
|
|
1247
1250
|
"data-cy": "search",
|
|
1248
|
-
endAdornment: a && /* @__PURE__ */ t(
|
|
1249
|
-
...
|
|
1251
|
+
endAdornment: a && /* @__PURE__ */ t(he, { position: "end", children: /* @__PURE__ */ t(ir, { "data-cy": "search-delete", onClick: s }) }),
|
|
1252
|
+
...o
|
|
1250
1253
|
}
|
|
1251
1254
|
);
|
|
1252
1255
|
}
|
|
@@ -1256,7 +1259,7 @@ ie.propTypes = {
|
|
|
1256
1259
|
ie.defaultProps = {
|
|
1257
1260
|
placeholder: "Type to search..."
|
|
1258
1261
|
};
|
|
1259
|
-
const
|
|
1262
|
+
const lr = D(lt)`
|
|
1260
1263
|
background-color: ${(e) => e.theme.palette.grey[50]};
|
|
1261
1264
|
font-size: 14px;
|
|
1262
1265
|
border-radius: 6px;
|
|
@@ -1273,21 +1276,21 @@ const or = D(nt)`
|
|
|
1273
1276
|
color: transparent;
|
|
1274
1277
|
}
|
|
1275
1278
|
}
|
|
1276
|
-
`,
|
|
1279
|
+
`, ar = D(_t)`
|
|
1277
1280
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1278
1281
|
font-size: 28px;
|
|
1279
1282
|
@media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
|
|
1280
1283
|
font-size: 24px;
|
|
1281
1284
|
}
|
|
1282
|
-
`,
|
|
1285
|
+
`, ir = D(Be)`
|
|
1283
1286
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1284
1287
|
font-size: 16px;
|
|
1285
1288
|
cursor: pointer;
|
|
1286
1289
|
`;
|
|
1287
|
-
function
|
|
1288
|
-
const { filters: e, handleSearchSelect:
|
|
1290
|
+
function sr() {
|
|
1291
|
+
const { filters: e, handleSearchSelect: o, t: r, wrapChildren: n, baseSearch: a } = B(), { toggleOpen: l } = oe(), d = !!e.keyword;
|
|
1289
1292
|
return /* @__PURE__ */ m(
|
|
1290
|
-
|
|
1293
|
+
I,
|
|
1291
1294
|
{
|
|
1292
1295
|
direction: "row",
|
|
1293
1296
|
alignItems: "center",
|
|
@@ -1301,66 +1304,66 @@ function ar() {
|
|
|
1301
1304
|
/* @__PURE__ */ t(
|
|
1302
1305
|
G,
|
|
1303
1306
|
{
|
|
1304
|
-
xs: !
|
|
1305
|
-
md: /* @__PURE__ */ t(
|
|
1307
|
+
xs: !d && /* @__PURE__ */ t(Me, { onClick: () => l(!0), children: /* @__PURE__ */ t(Tt, {}) }),
|
|
1308
|
+
md: /* @__PURE__ */ t(L, { variant: "h1", children: r("common.title") })
|
|
1306
1309
|
}
|
|
1307
1310
|
),
|
|
1308
1311
|
/* @__PURE__ */ t(
|
|
1309
1312
|
S,
|
|
1310
1313
|
{
|
|
1311
|
-
width: { xs:
|
|
1314
|
+
width: { xs: d ? "100%" : 300, md: 300 },
|
|
1312
1315
|
className: "filter-bar",
|
|
1313
1316
|
sx: {
|
|
1314
1317
|
"& .bl-autocomplete-form": { borderRadius: 2 },
|
|
1315
1318
|
"& .aa-SubmitButton, & .aa-LoadingIndicator": { width: "auto", pl: 1.5, pr: 1 },
|
|
1316
1319
|
"& .aa-SubmitIcon, & .aa-LoadingIcon": { height: 16, width: 16 }
|
|
1317
1320
|
},
|
|
1318
|
-
children: a ? /* @__PURE__ */ t(ie, { className: "bl-search-container", placeholder:
|
|
1321
|
+
children: a ? /* @__PURE__ */ t(ie, { className: "bl-search-container", placeholder: r("common.searchStore"), sx: { pl: 1.5 } }) : /* @__PURE__ */ t(ae, { onSelect: o, wrapChildren: n })
|
|
1319
1322
|
}
|
|
1320
1323
|
)
|
|
1321
1324
|
]
|
|
1322
1325
|
}
|
|
1323
1326
|
);
|
|
1324
1327
|
}
|
|
1325
|
-
function
|
|
1326
|
-
const { blockletList: e, filters: r, t:
|
|
1327
|
-
return /* @__PURE__ */ t(
|
|
1328
|
-
/* @__PURE__ */ t(
|
|
1328
|
+
function cr() {
|
|
1329
|
+
const { blockletList: e, total: o, filters: r, t: n } = B(), a = r.category || r.keyword || r.price;
|
|
1330
|
+
return /* @__PURE__ */ t(At, { children: /* @__PURE__ */ m(at, { FallbackComponent: Z, children: [
|
|
1331
|
+
/* @__PURE__ */ t(sr, {}),
|
|
1329
1332
|
/* @__PURE__ */ m(S, { display: "flex", height: "100%", children: [
|
|
1330
|
-
/* @__PURE__ */ t(
|
|
1331
|
-
/* @__PURE__ */ t(
|
|
1333
|
+
/* @__PURE__ */ t(Kt, {}),
|
|
1334
|
+
/* @__PURE__ */ t(I, { height: "100%", position: "relative", flex: 1, overflow: "visible", children: a ? /* @__PURE__ */ m(F, { children: [
|
|
1332
1335
|
r.keyword ? /* @__PURE__ */ m(F, { children: [
|
|
1333
|
-
/* @__PURE__ */ t(G, { xs: /* @__PURE__ */ t(
|
|
1334
|
-
|
|
1335
|
-
] }) : /* @__PURE__ */ t(
|
|
1336
|
-
/* @__PURE__ */ t(
|
|
1337
|
-
] }) : /* @__PURE__ */ t(
|
|
1336
|
+
/* @__PURE__ */ t(G, { xs: /* @__PURE__ */ t(Ne, {}), md: null }),
|
|
1337
|
+
l()
|
|
1338
|
+
] }) : /* @__PURE__ */ t(nr, {}),
|
|
1339
|
+
/* @__PURE__ */ t(je, { blocklets: e, height: "100%" })
|
|
1340
|
+
] }) : /* @__PURE__ */ t(or, {}) })
|
|
1338
1341
|
] })
|
|
1339
1342
|
] }) });
|
|
1340
|
-
function
|
|
1341
|
-
return /* @__PURE__ */ m(
|
|
1342
|
-
/* @__PURE__ */ t(
|
|
1343
|
-
/* @__PURE__ */ t(
|
|
1343
|
+
function l() {
|
|
1344
|
+
return /* @__PURE__ */ m(I, { direction: "row", alignItems: "center", justifyContent: "space-between", mb: 2, mt: { xs: 2, md: 0 }, children: [
|
|
1345
|
+
/* @__PURE__ */ t(L, { variant: "h3", children: n("blocklet.search", { keyword: r.keyword }) }),
|
|
1346
|
+
/* @__PURE__ */ t(L, { variant: "body1", color: "text.lighter", fontSize: 13, children: n("blocklet.resultCount", { count: o }) })
|
|
1344
1347
|
] });
|
|
1345
1348
|
}
|
|
1346
1349
|
}
|
|
1347
|
-
function
|
|
1348
|
-
const
|
|
1349
|
-
autocomplete:
|
|
1350
|
+
function Ve(e) {
|
|
1351
|
+
const o = xe(), r = qt(o.palette.primary.main), n = {
|
|
1352
|
+
autocomplete: ke`
|
|
1350
1353
|
:root {
|
|
1351
|
-
--aa-detached-media-query: (max-width: ${
|
|
1352
|
-
--aa-detached-modal-media-query: (min-width: ${
|
|
1353
|
-
--aa-detached-modal-max-width: ${
|
|
1354
|
-
--aa-selected-color-rgb: ${
|
|
1355
|
-
--aa-primary-color-rgb: ${
|
|
1354
|
+
--aa-detached-media-query: (max-width: ${o.breakpoints.values.md}px) !important;
|
|
1355
|
+
--aa-detached-modal-media-query: (min-width: ${o.breakpoints.values.md}px) !important;
|
|
1356
|
+
--aa-detached-modal-max-width: ${o.breakpoints.values.md}px !important;
|
|
1357
|
+
--aa-selected-color-rgb: ${r.r}, ${r.g}, ${r.b} !important;
|
|
1358
|
+
--aa-primary-color-rgb: ${r.r}, ${r.g}, ${r.b} !important;
|
|
1356
1359
|
--aa-input-background-color-rgb: 250, 250, 250 !important;
|
|
1357
1360
|
}
|
|
1358
1361
|
.bl-autocomplete-panel {
|
|
1359
|
-
z-index: ${
|
|
1362
|
+
z-index: ${o.zIndex.modal};
|
|
1360
1363
|
}
|
|
1361
1364
|
.bl-autocomplete-label {
|
|
1362
1365
|
.aa-SubmitIcon {
|
|
1363
|
-
color: ${
|
|
1366
|
+
color: ${o.palette.grey[500]} !important;
|
|
1364
1367
|
}
|
|
1365
1368
|
}
|
|
1366
1369
|
.bl-autocomplete-form {
|
|
@@ -1376,21 +1379,21 @@ function je(e) {
|
|
|
1376
1379
|
box-shadow: none !important;
|
|
1377
1380
|
}
|
|
1378
1381
|
.aa-SubmitIcon {
|
|
1379
|
-
color: ${
|
|
1382
|
+
color: ${o.palette.grey[500]} !important;
|
|
1380
1383
|
}
|
|
1381
1384
|
}
|
|
1382
1385
|
.aa-Panel .arcblock-blocklet button {
|
|
1383
|
-
border: 1px solid rgba(${
|
|
1386
|
+
border: 1px solid rgba(${r.r}, ${r.g}, ${r.b}, 0.5);
|
|
1384
1387
|
}
|
|
1385
1388
|
`
|
|
1386
1389
|
};
|
|
1387
1390
|
return /* @__PURE__ */ m(ne, { ...e, children: [
|
|
1388
|
-
/* @__PURE__ */ t(
|
|
1389
|
-
/* @__PURE__ */ t(
|
|
1391
|
+
/* @__PURE__ */ t(we, { styles: n.autocomplete }),
|
|
1392
|
+
/* @__PURE__ */ t(cr, {})
|
|
1390
1393
|
] });
|
|
1391
1394
|
}
|
|
1392
|
-
|
|
1393
|
-
|
|
1395
|
+
Ve.propTypes = ze;
|
|
1396
|
+
Ve.defaultProps = _e;
|
|
1394
1397
|
export {
|
|
1395
|
-
|
|
1398
|
+
Ve as default
|
|
1396
1399
|
};
|