@blocklet/list 0.16.46 → 0.16.48
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 +168 -169
- package/package.json +3 -3
package/lib/index.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { jsx as t, jsxs as h, Fragment as
|
|
1
|
+
import { jsx as t, jsxs as h, Fragment as z } from "react/jsx-runtime";
|
|
2
2
|
import { styled as Q, useTheme as we } from "@arcblock/ux/lib/Theme";
|
|
3
3
|
import et from "@mui/material/styles/createTheme";
|
|
4
4
|
import tt from "@mui/material/styles/ThemeProvider";
|
|
@@ -6,24 +6,24 @@ import { pick as rt, omitBy as se, orderBy as ot, isEmpty as nt, merge as it } f
|
|
|
6
6
|
import { ErrorFallback as be } from "@arcblock/ux/lib/ErrorBoundary";
|
|
7
7
|
import w from "@mui/material/Box";
|
|
8
8
|
import O from "@mui/material/Stack";
|
|
9
|
-
import { createContext as
|
|
9
|
+
import { createContext as Me, useState as E, useMemo as V, useContext as ze, useCallback as ge, useEffect as G, forwardRef as lt, useRef as re, memo as at } from "react";
|
|
10
10
|
import { ErrorBoundary as st } from "react-error-boundary";
|
|
11
11
|
import ct from "@iconify-icons/tabler/compass";
|
|
12
12
|
import { Icon as X } from "@iconify/react";
|
|
13
13
|
import ke from "@mui/icons-material/Close";
|
|
14
14
|
import v from "@mui/material/Typography";
|
|
15
|
-
import { createAxios as
|
|
15
|
+
import { createAxios as Fe } from "@blocklet/js-sdk";
|
|
16
16
|
import { useRequest as ne, useDebounceFn as De, useInfiniteScroll as dt, useReactive as ut } from "ahooks";
|
|
17
17
|
import "color";
|
|
18
|
-
import { parseURL as ht, parseQuery as pt, parseFilename as mt, stringifyParsedURL as ft, withQuery as ve, joinURL as
|
|
19
|
-
import
|
|
18
|
+
import { parseURL as ht, parseQuery as pt, parseFilename as mt, stringifyParsedURL as ft, withQuery as ve, joinURL as Re } from "ufo";
|
|
19
|
+
import Be from "flat";
|
|
20
20
|
import ie from "@mui/material/Button";
|
|
21
21
|
import gt from "@mui/material/styles/useTheme";
|
|
22
22
|
import U from "@mui/material/useMediaQuery";
|
|
23
|
-
import
|
|
23
|
+
import yt from "@mui/material/Drawer";
|
|
24
24
|
import Ne from "@mui/material/Checkbox";
|
|
25
25
|
import We from "@mui/material/FormControlLabel";
|
|
26
|
-
import
|
|
26
|
+
import xt from "@mui/icons-material/Check";
|
|
27
27
|
import wt from "@mui/icons-material/KeyboardArrowDown";
|
|
28
28
|
import bt from "@mui/material/ClickAwayListener";
|
|
29
29
|
import kt from "@mui/material/Grow";
|
|
@@ -35,9 +35,9 @@ import St from "@mui/material/SvgIcon";
|
|
|
35
35
|
import le from "@mui/material/CircularProgress";
|
|
36
36
|
import He from "@arcblock/ux/lib/Avatar";
|
|
37
37
|
import It from "@iconify-icons/tabler/cloud-download";
|
|
38
|
-
import
|
|
39
|
-
import
|
|
40
|
-
import
|
|
38
|
+
import Rt from "@mui/icons-material/ChevronLeft";
|
|
39
|
+
import Bt from "@mui/icons-material/ChevronRight";
|
|
40
|
+
import _ from "@mui/material/Skeleton";
|
|
41
41
|
import Tt from "react-image-gallery";
|
|
42
42
|
import "react-image-gallery/styles/css/image-gallery.css";
|
|
43
43
|
import Te from "@mui/material/Grid";
|
|
@@ -47,18 +47,18 @@ import Et from "@iconify-icons/tabler/square-check-filled";
|
|
|
47
47
|
import Pe from "@mui/material/Chip";
|
|
48
48
|
import { useTheme as Ot } from "@mui/material/styles";
|
|
49
49
|
import te from "@mui/icons-material/Search";
|
|
50
|
-
import
|
|
51
|
-
import
|
|
50
|
+
import Lt from "@mui/material/Autocomplete";
|
|
51
|
+
import _t from "@mui/material/Dialog";
|
|
52
52
|
import Ue from "@mui/material/OutlinedInput";
|
|
53
|
-
import
|
|
54
|
-
import { useHotkeys as
|
|
53
|
+
import Mt from "@mui/material/TextField";
|
|
54
|
+
import { useHotkeys as zt } from "react-hotkeys-hook";
|
|
55
55
|
import Ae from "@mui/material/InputAdornment";
|
|
56
|
-
import
|
|
56
|
+
import Ft from "@arcblock/ux/lib/Empty";
|
|
57
57
|
import Dt from "json-stable-stringify";
|
|
58
58
|
import Nt from "@mui/icons-material/Menu";
|
|
59
|
-
import { Card as Wt, Box as ce, Skeleton as
|
|
59
|
+
import { Card as Wt, Box as ce, Skeleton as L } from "@mui/material";
|
|
60
60
|
import $t from "@arcblock/ux/lib/Img";
|
|
61
|
-
const Ve =
|
|
61
|
+
const Ve = Me({
|
|
62
62
|
open: !1,
|
|
63
63
|
toggleOpen: (e) => {
|
|
64
64
|
}
|
|
@@ -70,7 +70,7 @@ function jt({ children: e }) {
|
|
|
70
70
|
return /* @__PURE__ */ t(Ve.Provider, { value: l, children: e });
|
|
71
71
|
}
|
|
72
72
|
function Ce() {
|
|
73
|
-
return
|
|
73
|
+
return ze(Ve);
|
|
74
74
|
}
|
|
75
75
|
const P = {
|
|
76
76
|
nameAsc: "title",
|
|
@@ -292,8 +292,8 @@ const Vt = (e, r, o) => e && r || !o, Ge = (e) => [
|
|
|
292
292
|
expandResult: "查看 “{name}” 的所有搜索结果"
|
|
293
293
|
}
|
|
294
294
|
}, de = {
|
|
295
|
-
en:
|
|
296
|
-
zh:
|
|
295
|
+
en: Be(Yt),
|
|
296
|
+
zh: Be(Zt)
|
|
297
297
|
}, Ke = (e, r) => {
|
|
298
298
|
const o = {};
|
|
299
299
|
return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
|
|
@@ -355,7 +355,7 @@ const Vt = (e, r, o) => e && r || !o, Ge = (e) => [
|
|
|
355
355
|
handlePage: () => {
|
|
356
356
|
}
|
|
357
357
|
}
|
|
358
|
-
}, Qe =
|
|
358
|
+
}, Qe = Me(Xe), { Provider: er, Consumer: Lo } = Qe;
|
|
359
359
|
function tr(e) {
|
|
360
360
|
const {
|
|
361
361
|
locale: r = "zh",
|
|
@@ -371,23 +371,23 @@ function tr(e) {
|
|
|
371
371
|
baseSearch: f = !1,
|
|
372
372
|
fetchCategoryDelay: u = 0,
|
|
373
373
|
showResourcesSwitch: g = !1,
|
|
374
|
-
showCategory:
|
|
374
|
+
showCategory: x = !0,
|
|
375
375
|
tagFilters: I = [],
|
|
376
|
-
children:
|
|
377
|
-
storeVersion:
|
|
376
|
+
children: y,
|
|
377
|
+
storeVersion: R,
|
|
378
378
|
onSearchSelect: p = () => {
|
|
379
379
|
},
|
|
380
380
|
endpoint: C,
|
|
381
381
|
blockletRender: b,
|
|
382
382
|
compact: k = !1
|
|
383
|
-
} = e, A = Ke(n,
|
|
383
|
+
} = e, A = Ke(n, R), F = V(() => Fe({ baseURL: C, headers: A }), [C]), $ = Ut(o, { onFilterChange: l, emptyCategory: !i.showExplore, onSearchSelect: p }), [D, q] = E(""), {
|
|
384
384
|
data: j = [],
|
|
385
385
|
error: ae,
|
|
386
386
|
loading: Y,
|
|
387
387
|
run: Z
|
|
388
|
-
} = Ht(
|
|
389
|
-
const T = ot(j, [(W) => W.name], ["asc"]),
|
|
390
|
-
return
|
|
388
|
+
} = Ht(F), H = V(() => {
|
|
389
|
+
const T = ot(j, [(W) => W.name], ["asc"]), M = T.findIndex((W) => W.name === "All" || W.locales.en === "All");
|
|
390
|
+
return M > -1 ? [{ ...T[M], _id: "All" }, ...T.slice(0, M), ...T.slice(M + 1)] : T;
|
|
391
391
|
}, [j]), K = ge(Jt(r), [r]), c = V(() => qt(H, r), [H, r]), S = Gt(K), N = {
|
|
392
392
|
search: $,
|
|
393
393
|
compact: k,
|
|
@@ -407,7 +407,7 @@ function tr(e) {
|
|
|
407
407
|
minItemWidth: a,
|
|
408
408
|
wrapChildren: m,
|
|
409
409
|
t: K,
|
|
410
|
-
storeVersion:
|
|
410
|
+
storeVersion: R,
|
|
411
411
|
serverVersion: n,
|
|
412
412
|
selectedCategory: $.filters.category || (i.showExplore ? "" : "All"),
|
|
413
413
|
categoryList: H,
|
|
@@ -415,16 +415,16 @@ function tr(e) {
|
|
|
415
415
|
locale: r,
|
|
416
416
|
categoryOptions: c,
|
|
417
417
|
priceOptions: S,
|
|
418
|
-
storeApi:
|
|
418
|
+
storeApi: F,
|
|
419
419
|
baseSearch: f,
|
|
420
420
|
showResourcesSwitch: g,
|
|
421
|
-
showCategory:
|
|
421
|
+
showCategory: x,
|
|
422
422
|
tagFilters: I,
|
|
423
423
|
onFilterChange: l,
|
|
424
424
|
getCategoryLocale: (T) => {
|
|
425
425
|
if (!T) return null;
|
|
426
|
-
const
|
|
427
|
-
return
|
|
426
|
+
const M = j.find((W) => W._id === T || W.locales.en === "All");
|
|
427
|
+
return M ? M.locales[r] || M.locales.en : null;
|
|
428
428
|
},
|
|
429
429
|
get developerName() {
|
|
430
430
|
return D;
|
|
@@ -433,10 +433,10 @@ function tr(e) {
|
|
|
433
433
|
};
|
|
434
434
|
return G(() => {
|
|
435
435
|
setTimeout(Z, u || 0);
|
|
436
|
-
}, [C, Z, u]), /* @__PURE__ */ t(er, { value: N, children:
|
|
436
|
+
}, [C, Z, u]), /* @__PURE__ */ t(er, { value: N, children: y });
|
|
437
437
|
}
|
|
438
|
-
function
|
|
439
|
-
const e =
|
|
438
|
+
function B() {
|
|
439
|
+
const e = ze(Qe);
|
|
440
440
|
return e || Xe;
|
|
441
441
|
}
|
|
442
442
|
function Ye({
|
|
@@ -491,7 +491,7 @@ function rr({ children: e }) {
|
|
|
491
491
|
return /* @__PURE__ */ t(
|
|
492
492
|
Se,
|
|
493
493
|
{
|
|
494
|
-
xs: /* @__PURE__ */ t(
|
|
494
|
+
xs: /* @__PURE__ */ t(yt, { open: r, onClose: () => o(!1), children: e }),
|
|
495
495
|
md: /* @__PURE__ */ t(w, { children: e })
|
|
496
496
|
}
|
|
497
497
|
);
|
|
@@ -507,36 +507,36 @@ const or = lt(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
|
|
|
507
507
|
startIcon: e && /* @__PURE__ */ t(le, { size: "1em" })
|
|
508
508
|
}
|
|
509
509
|
));
|
|
510
|
-
function
|
|
511
|
-
var
|
|
510
|
+
function ye({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
|
|
511
|
+
var R;
|
|
512
512
|
const a = re(null), s = we(), [i, m] = E(!1), [d, f] = E(e !== null ? e : ""), u = U(s.breakpoints.down("sm"));
|
|
513
513
|
G(() => {
|
|
514
514
|
f(e !== null ? e : "");
|
|
515
515
|
}, [e]);
|
|
516
516
|
const g = ge(() => {
|
|
517
517
|
m(!1);
|
|
518
|
-
}, []),
|
|
518
|
+
}, []), x = ge(() => {
|
|
519
519
|
m(!0);
|
|
520
520
|
}, []);
|
|
521
521
|
function I(p) {
|
|
522
522
|
f(p.value), o(p.value), u && g();
|
|
523
523
|
}
|
|
524
|
-
function
|
|
524
|
+
function y(p) {
|
|
525
525
|
return p === d;
|
|
526
526
|
}
|
|
527
|
-
return /* @__PURE__ */ h(
|
|
527
|
+
return /* @__PURE__ */ h(z, { children: [
|
|
528
528
|
/* @__PURE__ */ h(
|
|
529
529
|
nr,
|
|
530
530
|
{
|
|
531
531
|
ref: a,
|
|
532
|
-
onClick:
|
|
532
|
+
onClick: x,
|
|
533
533
|
variant: "outlined",
|
|
534
534
|
size: "medium",
|
|
535
535
|
className: ["my-select__selector", nt(d) ? "" : "my-select__selector--active"].join(" "),
|
|
536
536
|
sx: { minWidth: { xs: "100px", md: "auto" }, color: "text.primary", borderRadius: "8px" },
|
|
537
537
|
...l,
|
|
538
538
|
children: [
|
|
539
|
-
((
|
|
539
|
+
((R = r.find((p) => p.value === d)) == null ? void 0 : R.name) || n,
|
|
540
540
|
/* @__PURE__ */ t(St, { className: "my-select__arrowdown", component: wt, sx: { width: 18, height: 18 } })
|
|
541
541
|
]
|
|
542
542
|
}
|
|
@@ -546,11 +546,11 @@ function xe({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
|
|
|
546
546
|
{
|
|
547
547
|
...p,
|
|
548
548
|
style: { transformOrigin: C === "bottom" ? "center top" : "center bottom" },
|
|
549
|
-
children: /* @__PURE__ */ t(vt, { children: /* @__PURE__ */ t(bt, { onClickAway: g, children: /* @__PURE__ */ t(ir, { autoFocusItem: i, onMouseEnter:
|
|
549
|
+
children: /* @__PURE__ */ t(vt, { children: /* @__PURE__ */ t(bt, { onClickAway: g, children: /* @__PURE__ */ t(ir, { autoFocusItem: i, onMouseEnter: x, onMouseLeave: g, children: r.map((b) => /* @__PURE__ */ h($e, { onClick: () => I(b), sx: { fontSize: 14 }, children: [
|
|
550
550
|
/* @__PURE__ */ t(
|
|
551
|
-
|
|
551
|
+
xt,
|
|
552
552
|
{
|
|
553
|
-
sx: { mr: 1, fontSize: 16, visibility:
|
|
553
|
+
sx: { mr: 1, fontSize: 16, visibility: y(b.value) ? "visible" : "hidden" }
|
|
554
554
|
}
|
|
555
555
|
),
|
|
556
556
|
b.name
|
|
@@ -560,11 +560,11 @@ function xe({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
|
|
|
560
560
|
] });
|
|
561
561
|
}
|
|
562
562
|
const nr = Q(or)`
|
|
563
|
-
border: 1px solid
|
|
563
|
+
border: 1px solid ${(e) => e.theme.palette.divider};
|
|
564
564
|
padding: 6px 8px 6px 12px;
|
|
565
565
|
font-weight: ${(e) => e.theme.typography.fontWeightRegular};
|
|
566
566
|
font-size: 14px;
|
|
567
|
-
color:
|
|
567
|
+
color: ${(e) => e.theme.palette.text.secondary};
|
|
568
568
|
line-height: 1;
|
|
569
569
|
text-transform: none;
|
|
570
570
|
& + & {
|
|
@@ -575,14 +575,14 @@ const nr = Q(or)`
|
|
|
575
575
|
.my-select__arrowdown,
|
|
576
576
|
}
|
|
577
577
|
.my-select__arrowdown {
|
|
578
|
-
color:
|
|
578
|
+
color: ${(e) => e.theme.palette.grey[400]};
|
|
579
579
|
font-size: 14px;
|
|
580
580
|
margin-left: 6px;
|
|
581
581
|
}
|
|
582
582
|
.my-select__icon {
|
|
583
583
|
font-size: 0;
|
|
584
584
|
svg {
|
|
585
|
-
color:
|
|
585
|
+
color: ${(e) => e.theme.palette.grey[400]};
|
|
586
586
|
font-size: 18px;
|
|
587
587
|
margin-right: 3px;
|
|
588
588
|
}
|
|
@@ -605,7 +605,7 @@ const nr = Q(or)`
|
|
|
605
605
|
}
|
|
606
606
|
`;
|
|
607
607
|
function Ze() {
|
|
608
|
-
const { search: e, t: r } =
|
|
608
|
+
const { search: e, t: r } = B(), { filters: o, handleSort: n, handlePrice: l } = e, a = Ge(r);
|
|
609
609
|
return /* @__PURE__ */ h(
|
|
610
610
|
O,
|
|
611
611
|
{
|
|
@@ -631,7 +631,7 @@ function Ze() {
|
|
|
631
631
|
}
|
|
632
632
|
),
|
|
633
633
|
/* @__PURE__ */ t(
|
|
634
|
-
|
|
634
|
+
ye,
|
|
635
635
|
{
|
|
636
636
|
value: o.sortBy || a[0].value,
|
|
637
637
|
options: a,
|
|
@@ -644,9 +644,9 @@ function Ze() {
|
|
|
644
644
|
);
|
|
645
645
|
}
|
|
646
646
|
function lr({ menus: e }) {
|
|
647
|
-
const { selectedCategory: r, search: o, t: n, categoryOptions: l, loadings: a, layout: s, baseSearch: i, compact: m } =
|
|
647
|
+
const { selectedCategory: r, search: o, t: n, categoryOptions: l, loadings: a, layout: s, baseSearch: i, compact: m } = B(), { filters: d, handleActiveMenu: f, handleCategory: u, cleanFilter: g } = o, { toggleOpen: x } = Ce();
|
|
648
648
|
G(() => {
|
|
649
|
-
|
|
649
|
+
x(!1);
|
|
650
650
|
}, [Object.values(d).join("")]);
|
|
651
651
|
const I = Vt(i, s.showSearch, d.keyword);
|
|
652
652
|
return s.showCategory && !m ? /* @__PURE__ */ h(rr, { children: [
|
|
@@ -665,7 +665,7 @@ function lr({ menus: e }) {
|
|
|
665
665
|
borderBottom: 1,
|
|
666
666
|
borderColor: "divider",
|
|
667
667
|
children: [
|
|
668
|
-
/* @__PURE__ */ t(Ye, { onClick: () =>
|
|
668
|
+
/* @__PURE__ */ t(Ye, { onClick: () => x(!1), children: /* @__PURE__ */ t(ke, {}) }),
|
|
669
669
|
/* @__PURE__ */ t(v, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: n("common.category") })
|
|
670
670
|
]
|
|
671
671
|
}
|
|
@@ -681,7 +681,7 @@ function lr({ menus: e }) {
|
|
|
681
681
|
boxSizing: "content-box",
|
|
682
682
|
p: { xs: 2, md: 0 },
|
|
683
683
|
pr: { md: 6 },
|
|
684
|
-
children: I ? /* @__PURE__ */ h(
|
|
684
|
+
children: I ? /* @__PURE__ */ h(z, { children: [
|
|
685
685
|
s.showExplore && /* @__PURE__ */ h(w, { mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
|
|
686
686
|
/* @__PURE__ */ h(w, { display: "flex", alignItems: "center", gap: 1, children: [
|
|
687
687
|
/* @__PURE__ */ t(X, { icon: ct, width: 20, height: 20 }),
|
|
@@ -689,49 +689,49 @@ function lr({ menus: e }) {
|
|
|
689
689
|
v,
|
|
690
690
|
{
|
|
691
691
|
variant: "body1",
|
|
692
|
-
color: !r && !d.menu ? "text.primary" : "
|
|
692
|
+
color: !r && !d.menu ? "text.primary" : "grey.400",
|
|
693
693
|
fontWeight: !r && !d.menu ? "fontWeightMedium" : void 0,
|
|
694
694
|
sx: { cursor: "pointer" },
|
|
695
695
|
onClick: () => {
|
|
696
|
-
|
|
696
|
+
x(!1), g();
|
|
697
697
|
},
|
|
698
698
|
children: n("explore.title")
|
|
699
699
|
}
|
|
700
700
|
)
|
|
701
701
|
] }),
|
|
702
|
-
e == null ? void 0 : e.map((
|
|
703
|
-
typeof
|
|
702
|
+
e == null ? void 0 : e.map((y) => /* @__PURE__ */ h(w, { display: "flex", alignItems: "center", mt: 2, gap: 1, children: [
|
|
703
|
+
typeof y.icon == "string" ? /* @__PURE__ */ t(X, { icon: y.icon, width: 20, height: 20 }) : y.icon,
|
|
704
704
|
/* @__PURE__ */ t(
|
|
705
705
|
v,
|
|
706
706
|
{
|
|
707
707
|
variant: "body1",
|
|
708
|
-
color: d.menu ===
|
|
709
|
-
fontWeight: d.menu ===
|
|
708
|
+
color: d.menu === y.key ? "text.primary" : "grey.400",
|
|
709
|
+
fontWeight: d.menu === y.key ? "fontWeightMedium" : void 0,
|
|
710
710
|
sx: { cursor: "pointer" },
|
|
711
711
|
onClick: () => {
|
|
712
|
-
var
|
|
713
|
-
|
|
712
|
+
var R;
|
|
713
|
+
x(!1), f(y.key), (R = y.onClick) == null || R.call(y);
|
|
714
714
|
},
|
|
715
|
-
children:
|
|
715
|
+
children: y.title
|
|
716
716
|
}
|
|
717
717
|
)
|
|
718
|
-
] },
|
|
718
|
+
] }, y.key))
|
|
719
719
|
] }),
|
|
720
|
-
!!l.length && /* @__PURE__ */ t(O, { gap: 2, children: l.map((
|
|
720
|
+
!!l.length && /* @__PURE__ */ t(O, { gap: 2, children: l.map((y) => /* @__PURE__ */ t(
|
|
721
721
|
v,
|
|
722
722
|
{
|
|
723
723
|
variant: "body1",
|
|
724
|
-
title:
|
|
724
|
+
title: y.name,
|
|
725
725
|
sx: { cursor: "pointer" },
|
|
726
726
|
"data-cy": "filter",
|
|
727
|
-
color: r ===
|
|
727
|
+
color: r === y.value ? "text.primary" : "grey.400",
|
|
728
728
|
textTransform: "capitalize",
|
|
729
729
|
onClick: () => {
|
|
730
|
-
r ===
|
|
730
|
+
r === y.value ? g() : u(y.value), x(!1);
|
|
731
731
|
},
|
|
732
|
-
children:
|
|
732
|
+
children: y.name
|
|
733
733
|
},
|
|
734
|
-
|
|
734
|
+
y.value
|
|
735
735
|
)) })
|
|
736
736
|
] }) : /* @__PURE__ */ t(Ze, {})
|
|
737
737
|
}
|
|
@@ -739,7 +739,7 @@ function lr({ menus: e }) {
|
|
|
739
739
|
] }) : null;
|
|
740
740
|
}
|
|
741
741
|
function Ie() {
|
|
742
|
-
const { endpoint: e, serverVersion: r, storeVersion: o } =
|
|
742
|
+
const { endpoint: e, serverVersion: r, storeVersion: o } = B(), n = Ke(r, o), l = V(() => Fe({
|
|
743
743
|
baseURL: e,
|
|
744
744
|
headers: n
|
|
745
745
|
}), [e]);
|
|
@@ -777,10 +777,10 @@ function Ee({
|
|
|
777
777
|
)
|
|
778
778
|
] });
|
|
779
779
|
}
|
|
780
|
-
const ar = 16 / 9, ue = 292,
|
|
780
|
+
const ar = 16 / 9, ue = 292, xe = 189, oe = 336;
|
|
781
781
|
function sr() {
|
|
782
|
-
var
|
|
783
|
-
const { t: e, search: r } =
|
|
782
|
+
var y, R;
|
|
783
|
+
const { t: e, search: r } = B(), { get: o } = Ie(), n = we(), l = U(n.breakpoints.down("md")), a = ((R = (y = window.blocklet) == null ? void 0 : y.preferences) == null ? void 0 : R.homeBanner) || [], {
|
|
784
784
|
data: s = [],
|
|
785
785
|
error: i,
|
|
786
786
|
loading: m
|
|
@@ -799,7 +799,7 @@ function sr() {
|
|
|
799
799
|
cursor: "pointer",
|
|
800
800
|
color: "text.hint"
|
|
801
801
|
};
|
|
802
|
-
return !i && a.length > 0 ? /* @__PURE__ */ h(
|
|
802
|
+
return !i && a.length > 0 ? /* @__PURE__ */ h(z, { children: [
|
|
803
803
|
/* @__PURE__ */ t(v, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
|
|
804
804
|
/* @__PURE__ */ t(
|
|
805
805
|
w,
|
|
@@ -812,16 +812,16 @@ function sr() {
|
|
|
812
812
|
borderRadius: 3,
|
|
813
813
|
overflow: "hidden",
|
|
814
814
|
children: m ? /* @__PURE__ */ h(w, { p: 5, display: { md: "flex" }, gap: 5, alignItems: "center", justifyContent: "center", children: [
|
|
815
|
-
/* @__PURE__ */ t(
|
|
815
|
+
/* @__PURE__ */ t(_, { variant: "rounded", height: xe, width: oe }),
|
|
816
816
|
/* @__PURE__ */ h(w, { flex: 1, height: "100%", children: [
|
|
817
|
-
/* @__PURE__ */ t(
|
|
818
|
-
/* @__PURE__ */ t(
|
|
819
|
-
/* @__PURE__ */ t(
|
|
817
|
+
/* @__PURE__ */ t(_, { variant: "text", height: 50, width: 100 }),
|
|
818
|
+
/* @__PURE__ */ t(_, { variant: "text", height: 40, width: "100%" }),
|
|
819
|
+
/* @__PURE__ */ t(_, { variant: "text", height: 40, width: 300 }),
|
|
820
820
|
/* @__PURE__ */ h(w, { display: "flex", gap: 1, my: 2, children: [
|
|
821
|
-
/* @__PURE__ */ t(
|
|
822
|
-
/* @__PURE__ */ t(
|
|
821
|
+
/* @__PURE__ */ t(_, { variant: "circular", height: 20, width: 20 }),
|
|
822
|
+
/* @__PURE__ */ t(_, { variant: "text", height: 20, width: 50 })
|
|
823
823
|
] }),
|
|
824
|
-
/* @__PURE__ */ t(
|
|
824
|
+
/* @__PURE__ */ t(_, { variant: "rounded", height: 30, width: 100 })
|
|
825
825
|
] })
|
|
826
826
|
] }) : /* @__PURE__ */ t(
|
|
827
827
|
Tt,
|
|
@@ -835,13 +835,13 @@ function sr() {
|
|
|
835
835
|
showBullets: !1,
|
|
836
836
|
showThumbnails: !1,
|
|
837
837
|
showFullscreenButton: !1,
|
|
838
|
-
renderLeftNav: (p) => /* @__PURE__ */ t(w, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(
|
|
839
|
-
renderRightNav: (p) => /* @__PURE__ */ t(w, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(
|
|
838
|
+
renderLeftNav: (p) => /* @__PURE__ */ t(w, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Rt, { sx: { ...d, left: 5 } }) }),
|
|
839
|
+
renderRightNav: (p) => /* @__PURE__ */ t(w, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Bt, { sx: { ...d, right: 5 } }) }),
|
|
840
840
|
items: a.map((p, C) => ({
|
|
841
841
|
original: p.did,
|
|
842
842
|
renderItem: () => {
|
|
843
|
-
var
|
|
844
|
-
const b = s[C] || {}, k = p.cover || dr(p.did, (
|
|
843
|
+
var F;
|
|
844
|
+
const b = s[C] || {}, k = p.cover || dr(p.did, (F = b.screenshots) == null ? void 0 : F[0]), A = qe(k, n.breakpoints.values.md * 2);
|
|
845
845
|
return /* @__PURE__ */ h(
|
|
846
846
|
O,
|
|
847
847
|
{
|
|
@@ -876,7 +876,7 @@ function sr() {
|
|
|
876
876
|
u(p.name || b.title || p.name),
|
|
877
877
|
g(p.desc || b.description)
|
|
878
878
|
] }),
|
|
879
|
-
b.did &&
|
|
879
|
+
b.did && x(b, p.baseNum),
|
|
880
880
|
I(b)
|
|
881
881
|
] })
|
|
882
882
|
]
|
|
@@ -919,7 +919,7 @@ function sr() {
|
|
|
919
919
|
}
|
|
920
920
|
);
|
|
921
921
|
}
|
|
922
|
-
function
|
|
922
|
+
function x(p, C = 0) {
|
|
923
923
|
const { did: b, owner: k, stats: A } = p;
|
|
924
924
|
return /* @__PURE__ */ h(w, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
|
|
925
925
|
/* @__PURE__ */ t(Ee, { icon: /* @__PURE__ */ t(He, { src: k.avatar, did: b, size: 20, variant: "circle" }), children: k.fullName }),
|
|
@@ -936,9 +936,8 @@ function sr() {
|
|
|
936
936
|
sx: {
|
|
937
937
|
width: "fit-content",
|
|
938
938
|
textTransform: "none",
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
borderColor: "divider",
|
|
939
|
+
borderRadius: 1,
|
|
940
|
+
borderColor: "grey.300",
|
|
942
941
|
"&:hover": { borderColor: "divider" }
|
|
943
942
|
},
|
|
944
943
|
children: e("explore.viewDetail")
|
|
@@ -949,14 +948,14 @@ function sr() {
|
|
|
949
948
|
const cr = (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`, dr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
|
|
950
949
|
function ur({ url: e }) {
|
|
951
950
|
const [r, o] = E(!0);
|
|
952
|
-
return /* @__PURE__ */ h(
|
|
951
|
+
return /* @__PURE__ */ h(z, { children: [
|
|
953
952
|
r && /* @__PURE__ */ t(
|
|
954
|
-
|
|
953
|
+
_,
|
|
955
954
|
{
|
|
956
955
|
variant: "rectangular",
|
|
957
956
|
sx: {
|
|
958
957
|
width: { xs: "100%", md: oe },
|
|
959
|
-
height: { xs: "auto", md:
|
|
958
|
+
height: { xs: "auto", md: xe }
|
|
960
959
|
}
|
|
961
960
|
}
|
|
962
961
|
),
|
|
@@ -968,7 +967,7 @@ function ur({ url: e }) {
|
|
|
968
967
|
src: e,
|
|
969
968
|
alt: "",
|
|
970
969
|
width: { xs: "100%", md: oe },
|
|
971
|
-
height: { xs: "auto", md:
|
|
970
|
+
height: { xs: "auto", md: xe },
|
|
972
971
|
borderRadius: 2,
|
|
973
972
|
border: 1,
|
|
974
973
|
borderColor: "divider",
|
|
@@ -980,14 +979,14 @@ function ur({ url: e }) {
|
|
|
980
979
|
] });
|
|
981
980
|
}
|
|
982
981
|
function hr({ title: e, blocklets: r }) {
|
|
983
|
-
const { blockletRender: o, serverVersion: n } =
|
|
982
|
+
const { blockletRender: o, serverVersion: n } = B();
|
|
984
983
|
return /* @__PURE__ */ h(w, { mt: 3, children: [
|
|
985
984
|
/* @__PURE__ */ t(v, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
|
|
986
985
|
/* @__PURE__ */ t(Te, { container: !0, spacing: 2, boxSizing: "border-box", maxWidth: "calc(100vw - 16px)", children: r.map((l) => /* @__PURE__ */ t(Te, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": l.did, children: /* @__PURE__ */ t(w, { padding: "1px", children: o({ blocklet: l, blocklets: r, serverVersion: n }) }) }, l.did)) })
|
|
987
986
|
] });
|
|
988
987
|
}
|
|
989
988
|
function pr() {
|
|
990
|
-
const { get: e } = Ie(), { t: r } =
|
|
989
|
+
const { get: e } = Ie(), { t: r } = B(), {
|
|
991
990
|
data: o = [],
|
|
992
991
|
error: n,
|
|
993
992
|
loading: l
|
|
@@ -995,7 +994,7 @@ function pr() {
|
|
|
995
994
|
const a = await e(P.explorePath);
|
|
996
995
|
return Array.isArray(a) ? a : [];
|
|
997
996
|
});
|
|
998
|
-
return n ? /* @__PURE__ */ t(be, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : l ? /* @__PURE__ */ t(Je, { mt: 15 }) : /* @__PURE__ */ h(
|
|
997
|
+
return n ? /* @__PURE__ */ t(be, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : l ? /* @__PURE__ */ t(Je, { mt: 15 }) : /* @__PURE__ */ h(z, { children: [
|
|
999
998
|
/* @__PURE__ */ t(sr, {}),
|
|
1000
999
|
o.map(
|
|
1001
1000
|
(a) => {
|
|
@@ -1015,9 +1014,9 @@ function mr({
|
|
|
1015
1014
|
handleSearchSelect: a,
|
|
1016
1015
|
...s
|
|
1017
1016
|
}) {
|
|
1018
|
-
const i = re(null), m = re(!1), [d, f] = E(!1), [u, g] = E(""), [
|
|
1017
|
+
const i = re(null), m = re(!1), [d, f] = E(!1), [u, g] = E(""), [x, I] = E(!1), y = Ie(), [R, p] = E(!1), C = (s == null ? void 0 : s.placeholder) || r("common.searchStore"), b = async (c) => {
|
|
1019
1018
|
p(!0);
|
|
1020
|
-
const S = await
|
|
1019
|
+
const S = await y.get(Re(e, ve(P.blockletsPath, c)));
|
|
1021
1020
|
return p(!1), S.dataList || [];
|
|
1022
1021
|
}, { data: k, run: A } = ne(
|
|
1023
1022
|
(c) => c ? b({
|
|
@@ -1033,7 +1032,7 @@ function mr({
|
|
|
1033
1032
|
);
|
|
1034
1033
|
G(() => {
|
|
1035
1034
|
p(!0), A(n.keyword), g(n.keyword || "");
|
|
1036
|
-
}, [n.keyword, A]),
|
|
1035
|
+
}, [n.keyword, A]), zt(
|
|
1037
1036
|
"ctrl + k, command + k",
|
|
1038
1037
|
(c) => {
|
|
1039
1038
|
var S, N;
|
|
@@ -1041,17 +1040,17 @@ function mr({
|
|
|
1041
1040
|
},
|
|
1042
1041
|
{ enableOnTags: ["INPUT"] }
|
|
1043
1042
|
);
|
|
1044
|
-
const
|
|
1043
|
+
const F = De((c) => A(c), { wait: 300 }), $ = { name: he, title: u, did: "" };
|
|
1045
1044
|
let D = [];
|
|
1046
|
-
return u && (
|
|
1047
|
-
/* @__PURE__ */ h(
|
|
1045
|
+
return u && (R ? D = [$] : k != null && k.length ? D = [$, ...k] : D = [{ name: Oe, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ h(z, { children: [
|
|
1046
|
+
/* @__PURE__ */ h(_t, { fullScreen: !0, open: x, sx: { display: { md: "none" } }, children: [
|
|
1048
1047
|
/* @__PURE__ */ h(w, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
|
|
1049
1048
|
/* @__PURE__ */ t(
|
|
1050
1049
|
Ue,
|
|
1051
1050
|
{
|
|
1052
1051
|
fullWidth: !0,
|
|
1053
1052
|
sx: {
|
|
1054
|
-
bgcolor: "
|
|
1053
|
+
bgcolor: "grey.50",
|
|
1055
1054
|
px: 1,
|
|
1056
1055
|
py: 0.5,
|
|
1057
1056
|
".MuiInputBase-input": { p: 1 },
|
|
@@ -1069,7 +1068,7 @@ function mr({
|
|
|
1069
1068
|
className: "bl-autocomplete-input",
|
|
1070
1069
|
value: u,
|
|
1071
1070
|
onChange: (c) => q(c.target.value),
|
|
1072
|
-
startAdornment: H(
|
|
1071
|
+
startAdornment: H(x),
|
|
1073
1072
|
endAdornment: K()
|
|
1074
1073
|
}
|
|
1075
1074
|
),
|
|
@@ -1094,7 +1093,7 @@ function mr({
|
|
|
1094
1093
|
}
|
|
1095
1094
|
),
|
|
1096
1095
|
/* @__PURE__ */ t(
|
|
1097
|
-
|
|
1096
|
+
Lt,
|
|
1098
1097
|
{
|
|
1099
1098
|
ref: i,
|
|
1100
1099
|
open: !!u && d,
|
|
@@ -1126,7 +1125,7 @@ function mr({
|
|
|
1126
1125
|
}
|
|
1127
1126
|
},
|
|
1128
1127
|
renderInput: (c) => /* @__PURE__ */ t(
|
|
1129
|
-
|
|
1128
|
+
Mt,
|
|
1130
1129
|
{
|
|
1131
1130
|
...c,
|
|
1132
1131
|
InputProps: {
|
|
@@ -1147,7 +1146,7 @@ function mr({
|
|
|
1147
1146
|
value: $,
|
|
1148
1147
|
sx: [
|
|
1149
1148
|
{
|
|
1150
|
-
bgcolor: "
|
|
1149
|
+
bgcolor: "grey.50",
|
|
1151
1150
|
borderRadius: "8px",
|
|
1152
1151
|
overflow: "hidden",
|
|
1153
1152
|
".MuiOutlinedInput-notchedOutline": {
|
|
@@ -1165,7 +1164,7 @@ function mr({
|
|
|
1165
1164
|
)
|
|
1166
1165
|
] });
|
|
1167
1166
|
function q(c) {
|
|
1168
|
-
p(!0), g(c), m.current = !1,
|
|
1167
|
+
p(!0), g(c), m.current = !1, F.run(c);
|
|
1169
1168
|
}
|
|
1170
1169
|
function j() {
|
|
1171
1170
|
I(!1), g(""), q(""), l("");
|
|
@@ -1202,25 +1201,25 @@ function mr({
|
|
|
1202
1201
|
justifyContent: "center",
|
|
1203
1202
|
alignItems: "center",
|
|
1204
1203
|
color: "text.hint",
|
|
1205
|
-
bgcolor: "
|
|
1204
|
+
bgcolor: "grey.100",
|
|
1206
1205
|
borderRadius: "8px",
|
|
1207
1206
|
children: /* @__PURE__ */ t(te, { sx: { fontSize: 28 } })
|
|
1208
1207
|
}
|
|
1209
1208
|
);
|
|
1210
1209
|
let S = "";
|
|
1211
|
-
return c.logo && (S =
|
|
1210
|
+
return c.logo && (S = Re(e, "assets", c.did, qe(c.logo, pe, c.version))), /* @__PURE__ */ t(He, { src: S, size: pe, style: { borderRadius: "8px", overflow: "hidden" } });
|
|
1212
1211
|
}
|
|
1213
1212
|
function H(c = !0) {
|
|
1214
|
-
return /* @__PURE__ */ t(w, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.hint" }, children: c && u &&
|
|
1213
|
+
return /* @__PURE__ */ t(w, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.hint" }, children: c && u && R ? /* @__PURE__ */ t(le, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(te, { sx: { fontSize: 16, cursor: "default" } }) });
|
|
1215
1214
|
}
|
|
1216
1215
|
function K() {
|
|
1217
1216
|
return u ? /* @__PURE__ */ t(w, { sx: { display: "flex", alignItems: "center", color: "text.hint" }, children: /* @__PURE__ */ t(ke, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => j() }) }) : null;
|
|
1218
1217
|
}
|
|
1219
1218
|
}
|
|
1220
1219
|
function fr({ placeholder: e, ...r }) {
|
|
1221
|
-
const { search: o, t: n } =
|
|
1222
|
-
const { value:
|
|
1223
|
-
i(
|
|
1220
|
+
const { search: o, t: n } = B(), { filters: l, handleKeyword: a } = o, [s, i] = E(l.keyword || ""), m = De(a, { wait: 300 }), d = (g) => {
|
|
1221
|
+
const { value: x } = g.target;
|
|
1222
|
+
i(x), m.run(x);
|
|
1224
1223
|
}, f = () => {
|
|
1225
1224
|
i(""), a("");
|
|
1226
1225
|
};
|
|
@@ -1234,13 +1233,13 @@ function fr({ placeholder: e, ...r }) {
|
|
|
1234
1233
|
inputProps: {
|
|
1235
1234
|
"data-cy": "search-blocklet"
|
|
1236
1235
|
},
|
|
1237
|
-
startAdornment: /* @__PURE__ */ t(Ae, { position: "start", children: /* @__PURE__ */ t(
|
|
1236
|
+
startAdornment: /* @__PURE__ */ t(Ae, { position: "start", children: /* @__PURE__ */ t(yr, { sx: { fontSize: 18, ml: -0.5 } }) }),
|
|
1238
1237
|
onChange: d,
|
|
1239
1238
|
placeholder: u,
|
|
1240
1239
|
value: s,
|
|
1241
1240
|
title: u,
|
|
1242
1241
|
"data-cy": "search",
|
|
1243
|
-
endAdornment: s && /* @__PURE__ */ t(Ae, { position: "end", children: /* @__PURE__ */ t(
|
|
1242
|
+
endAdornment: s && /* @__PURE__ */ t(Ae, { position: "end", children: /* @__PURE__ */ t(xr, { "data-cy": "search-delete", onClick: f }) }),
|
|
1244
1243
|
...r
|
|
1245
1244
|
}
|
|
1246
1245
|
);
|
|
@@ -1262,9 +1261,9 @@ const gr = Q(Ue)`
|
|
|
1262
1261
|
color: transparent;
|
|
1263
1262
|
}
|
|
1264
1263
|
}
|
|
1265
|
-
`,
|
|
1264
|
+
`, yr = Q(te)`
|
|
1266
1265
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1267
|
-
`,
|
|
1266
|
+
`, xr = Q(ke)`
|
|
1268
1267
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1269
1268
|
font-size: 16px;
|
|
1270
1269
|
cursor: pointer;
|
|
@@ -1283,7 +1282,7 @@ function wr() {
|
|
|
1283
1282
|
baseSearch: m,
|
|
1284
1283
|
categoryOptions: d,
|
|
1285
1284
|
compact: f
|
|
1286
|
-
} =
|
|
1285
|
+
} = B(), { filters: u, handleSort: g, handlePrice: x, handleDeveloper: I, handleSwitchShowResources: y, cleanFilter: R, handleCategory: p } = e, C = Ge(r);
|
|
1287
1286
|
return /* @__PURE__ */ h(
|
|
1288
1287
|
O,
|
|
1289
1288
|
{
|
|
@@ -1343,27 +1342,27 @@ function wr() {
|
|
|
1343
1342
|
{
|
|
1344
1343
|
label: r("blocklet.resourceTag", { name: u.resourceBlocklet }),
|
|
1345
1344
|
size: "small",
|
|
1346
|
-
onDelete: () =>
|
|
1345
|
+
onDelete: () => R(["resourceDid", "resourceBlocklet", "showResources"])
|
|
1347
1346
|
}
|
|
1348
1347
|
),
|
|
1349
1348
|
s ? /* @__PURE__ */ t(
|
|
1350
|
-
|
|
1349
|
+
Le,
|
|
1351
1350
|
{
|
|
1352
1351
|
checked: u.showResources !== "false",
|
|
1353
|
-
onChange: (k) =>
|
|
1352
|
+
onChange: (k) => y(k ? "true" : "false"),
|
|
1354
1353
|
label: r("common.showResources")
|
|
1355
1354
|
}
|
|
1356
1355
|
) : null,
|
|
1357
1356
|
/* @__PURE__ */ t(
|
|
1358
|
-
|
|
1357
|
+
Le,
|
|
1359
1358
|
{
|
|
1360
1359
|
checked: u.price === "free",
|
|
1361
|
-
onChange: (k) =>
|
|
1360
|
+
onChange: (k) => x(k ? "free" : ""),
|
|
1362
1361
|
label: r("blocklet.free")
|
|
1363
1362
|
}
|
|
1364
1363
|
),
|
|
1365
1364
|
f && /* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(
|
|
1366
|
-
|
|
1365
|
+
ye,
|
|
1367
1366
|
{
|
|
1368
1367
|
value: u.category || ((b = d[0]) == null ? void 0 : b.value),
|
|
1369
1368
|
options: d,
|
|
@@ -1372,7 +1371,7 @@ function wr() {
|
|
|
1372
1371
|
}
|
|
1373
1372
|
) }),
|
|
1374
1373
|
/* @__PURE__ */ t(
|
|
1375
|
-
|
|
1374
|
+
ye,
|
|
1376
1375
|
{
|
|
1377
1376
|
value: u.sortBy || C[0].value,
|
|
1378
1377
|
options: C,
|
|
@@ -1387,7 +1386,7 @@ function wr() {
|
|
|
1387
1386
|
}
|
|
1388
1387
|
);
|
|
1389
1388
|
}
|
|
1390
|
-
function
|
|
1389
|
+
function Le({
|
|
1391
1390
|
checked: e,
|
|
1392
1391
|
onChange: r,
|
|
1393
1392
|
label: o
|
|
@@ -1402,7 +1401,7 @@ function Fe({
|
|
|
1402
1401
|
Ne,
|
|
1403
1402
|
{
|
|
1404
1403
|
checked: e,
|
|
1405
|
-
icon: /* @__PURE__ */ t(X, { style: { padding: 0 }, icon: At }),
|
|
1404
|
+
icon: /* @__PURE__ */ t(X, { style: { padding: 0, color: n.palette.text.secondary }, icon: At }),
|
|
1406
1405
|
checkedIcon: /* @__PURE__ */ t(X, { style: { padding: 0, color: n.palette.primary.main }, icon: Et }),
|
|
1407
1406
|
size: "large",
|
|
1408
1407
|
sx: { p: 0, mr: 1 },
|
|
@@ -1415,16 +1414,16 @@ function Fe({
|
|
|
1415
1414
|
}
|
|
1416
1415
|
function ee({ children: e }) {
|
|
1417
1416
|
return /* @__PURE__ */ h(w, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.hint", children: [
|
|
1418
|
-
/* @__PURE__ */ t(
|
|
1417
|
+
/* @__PURE__ */ t(Ft, {}),
|
|
1419
1418
|
e
|
|
1420
1419
|
] });
|
|
1421
1420
|
}
|
|
1422
|
-
function
|
|
1423
|
-
const { t: e } =
|
|
1421
|
+
function _e() {
|
|
1422
|
+
const { t: e } = B();
|
|
1424
1423
|
return /* @__PURE__ */ t(v, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
|
|
1425
1424
|
}
|
|
1426
1425
|
function me({ filterTip: e, keywordTip: r }) {
|
|
1427
|
-
const { t: o, locale: n } =
|
|
1426
|
+
const { t: o, locale: n } = B(), l = () => n === "zh" ? "、" : " , ";
|
|
1428
1427
|
return /* @__PURE__ */ h(w, { mt: 1, display: "flex", children: [
|
|
1429
1428
|
/* @__PURE__ */ t(v, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
|
|
1430
1429
|
e && /* @__PURE__ */ t(v, { children: o("blocklet.filterTip") }),
|
|
@@ -1455,7 +1454,7 @@ function fe({
|
|
|
1455
1454
|
] });
|
|
1456
1455
|
}
|
|
1457
1456
|
function br() {
|
|
1458
|
-
const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } =
|
|
1457
|
+
const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = B(), { filters: l } = r, a = !!n || !!l.price;
|
|
1459
1458
|
if (l.keyword && a)
|
|
1460
1459
|
return /* @__PURE__ */ h(ee, { children: [
|
|
1461
1460
|
/* @__PURE__ */ t(
|
|
@@ -1490,11 +1489,11 @@ function br() {
|
|
|
1490
1489
|
primaryEnd: e("blocklet.noCategoryResults2"),
|
|
1491
1490
|
filter: s
|
|
1492
1491
|
}
|
|
1493
|
-
) : /* @__PURE__ */ t(
|
|
1492
|
+
) : /* @__PURE__ */ t(_e, {}),
|
|
1494
1493
|
/* @__PURE__ */ t(me, { filterTip: !0 })
|
|
1495
1494
|
] });
|
|
1496
1495
|
}
|
|
1497
|
-
return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(
|
|
1496
|
+
return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(_e, {}) });
|
|
1498
1497
|
}
|
|
1499
1498
|
const kr = (e, r, o, n) => dt(
|
|
1500
1499
|
async (l) => {
|
|
@@ -1518,19 +1517,19 @@ const kr = (e, r, o, n) => dt(
|
|
|
1518
1517
|
);
|
|
1519
1518
|
function vr() {
|
|
1520
1519
|
var u;
|
|
1521
|
-
const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: l } =
|
|
1520
|
+
const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: l } = B(), { filters: a } = r, s = ut({
|
|
1522
1521
|
currentPage: P.currentPage,
|
|
1523
1522
|
pageSize: Qt() ? P.mobilePageSize : P.pageSize,
|
|
1524
1523
|
defaultCurrentPage: P.defaultCurrentPage
|
|
1525
1524
|
}), [i, m] = E(null), d = kr(e, a, s, m), f = V(
|
|
1526
1525
|
() => {
|
|
1527
|
-
var g,
|
|
1528
|
-
return o ? o(((g = d.data) == null ? void 0 : g.list) || []) : ((
|
|
1526
|
+
var g, x;
|
|
1527
|
+
return o ? o(((g = d.data) == null ? void 0 : g.list) || []) : ((x = d.data) == null ? void 0 : x.list) || [];
|
|
1529
1528
|
},
|
|
1530
1529
|
[d.data, o]
|
|
1531
1530
|
);
|
|
1532
1531
|
return G(() => {
|
|
1533
|
-
const g = f.find((
|
|
1532
|
+
const g = f.find((x) => x.owner.did === a.owner);
|
|
1534
1533
|
l((g == null ? void 0 : g.owner.fullName) || (g == null ? void 0 : g.author.name) || "");
|
|
1535
1534
|
}, [a.owner, f, l]), {
|
|
1536
1535
|
blocklets: f,
|
|
@@ -1549,8 +1548,8 @@ function vr() {
|
|
|
1549
1548
|
};
|
|
1550
1549
|
}
|
|
1551
1550
|
function Cr() {
|
|
1552
|
-
const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: l, minItemWidth: a, layout: s, baseSearch: i, compact: m } =
|
|
1553
|
-
loading:
|
|
1551
|
+
const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: l, minItemWidth: a, layout: s, baseSearch: i, compact: m } = B(), { filters: d } = r, { blocklets: f, errors: u, loadMore: g, loadings: x, hasNextPage: I, total: y } = vr(), [R] = Pt({
|
|
1552
|
+
loading: x.fetchBlockletsLoading || x.loadingMore,
|
|
1554
1553
|
hasNextPage: I,
|
|
1555
1554
|
onLoadMore: g
|
|
1556
1555
|
});
|
|
@@ -1559,16 +1558,16 @@ function Cr() {
|
|
|
1559
1558
|
return /* @__PURE__ */ t(be, { error: k });
|
|
1560
1559
|
}
|
|
1561
1560
|
const p = i && s.showSearch || !d.keyword;
|
|
1562
|
-
return /* @__PURE__ */ h(
|
|
1563
|
-
p ? /* @__PURE__ */ t(wr, {}) : /* @__PURE__ */ h(
|
|
1561
|
+
return /* @__PURE__ */ h(z, { children: [
|
|
1562
|
+
p ? /* @__PURE__ */ t(wr, {}) : /* @__PURE__ */ h(z, { children: [
|
|
1564
1563
|
/* @__PURE__ */ t(Se, { xs: /* @__PURE__ */ t(Ze, {}), md: null }),
|
|
1565
1564
|
b()
|
|
1566
1565
|
] }),
|
|
1567
1566
|
C(),
|
|
1568
|
-
!
|
|
1567
|
+
!x.fetchBlockletsLoading && I && /* @__PURE__ */ t(w, { height: 70, minHeight: 70, display: "flex", justifyContent: "center", py: 2, overflow: "hidden", ref: R, children: /* @__PURE__ */ t(le, {}) })
|
|
1569
1568
|
] });
|
|
1570
1569
|
function C() {
|
|
1571
|
-
return
|
|
1570
|
+
return x.fetchBlockletsLoading ? /* @__PURE__ */ t(Je, { mt: 15 }) : f.length ? /* @__PURE__ */ t(
|
|
1572
1571
|
w,
|
|
1573
1572
|
{
|
|
1574
1573
|
className: "blocklet-list",
|
|
@@ -1617,14 +1616,14 @@ function Cr() {
|
|
|
1617
1616
|
children: e("blocklet.search", { keyword: d.keyword })
|
|
1618
1617
|
}
|
|
1619
1618
|
),
|
|
1620
|
-
/* @__PURE__ */ t(v, { variant: "body1", color: "text.hint", fontSize: 13, children: e("blocklet.resultCount", { count:
|
|
1619
|
+
/* @__PURE__ */ t(v, { variant: "body1", color: "text.hint", fontSize: 13, children: e("blocklet.resultCount", { count: y }) })
|
|
1621
1620
|
]
|
|
1622
1621
|
}
|
|
1623
1622
|
);
|
|
1624
1623
|
}
|
|
1625
1624
|
}
|
|
1626
1625
|
function Sr() {
|
|
1627
|
-
const { t: e, selectedCategory: r, getCategoryLocale: o } =
|
|
1626
|
+
const { t: e, selectedCategory: r, getCategoryLocale: o } = B(), { toggleOpen: n } = Ce();
|
|
1628
1627
|
return /* @__PURE__ */ h(
|
|
1629
1628
|
v,
|
|
1630
1629
|
{
|
|
@@ -1643,7 +1642,7 @@ function Sr() {
|
|
|
1643
1642
|
}
|
|
1644
1643
|
function Ir({ menus: e, children: r }) {
|
|
1645
1644
|
var d;
|
|
1646
|
-
const { search: o, layout: n, compact: l } =
|
|
1645
|
+
const { search: o, layout: n, compact: l } = B(), { filters: a } = o, s = re(null), i = a.category || a.keyword || a.price, m = (d = e == null ? void 0 : e.find((f) => f.key === a.menu)) == null ? void 0 : d.key;
|
|
1647
1646
|
return /* @__PURE__ */ t(jt, { children: /* @__PURE__ */ h(st, { FallbackComponent: be, children: [
|
|
1648
1647
|
!l && /* @__PURE__ */ t(Sr, {}),
|
|
1649
1648
|
/* @__PURE__ */ h(
|
|
@@ -1679,29 +1678,29 @@ function Ir({ menus: e, children: r }) {
|
|
|
1679
1678
|
)
|
|
1680
1679
|
] }) });
|
|
1681
1680
|
}
|
|
1682
|
-
function
|
|
1681
|
+
function _o(e) {
|
|
1683
1682
|
return /* @__PURE__ */ h(Wt, { variant: "outlined", ...e, sx: { maxWidth: 400, borderRadius: "8px", p: { xs: 2, md: 3 }, ...e.sx }, children: [
|
|
1684
1683
|
/* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 2, pb: 1, children: [
|
|
1685
1684
|
/* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 2, flex: 1, children: [
|
|
1686
|
-
/* @__PURE__ */ t(
|
|
1687
|
-
/* @__PURE__ */ t(
|
|
1685
|
+
/* @__PURE__ */ t(L, { variant: "rounded", width: 48, height: 48 }),
|
|
1686
|
+
/* @__PURE__ */ t(L, { variant: "text", width: 60, height: 28 })
|
|
1688
1687
|
] }),
|
|
1689
|
-
/* @__PURE__ */ t(
|
|
1688
|
+
/* @__PURE__ */ t(L, { variant: "text", width: 70, height: 40 })
|
|
1690
1689
|
] }),
|
|
1691
|
-
/* @__PURE__ */ t(
|
|
1692
|
-
/* @__PURE__ */ t(
|
|
1690
|
+
/* @__PURE__ */ t(L, { variant: "text", width: "100%", height: 24 }),
|
|
1691
|
+
/* @__PURE__ */ t(L, { variant: "text", width: "90%", height: 24 }),
|
|
1693
1692
|
/* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 1, pt: 1.5, children: [
|
|
1694
|
-
/* @__PURE__ */ t(
|
|
1695
|
-
/* @__PURE__ */ t(
|
|
1696
|
-
/* @__PURE__ */ t(
|
|
1697
|
-
/* @__PURE__ */ t(
|
|
1693
|
+
/* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24 }),
|
|
1694
|
+
/* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 }),
|
|
1695
|
+
/* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24, sx: { ml: 1 } }),
|
|
1696
|
+
/* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 })
|
|
1698
1697
|
] })
|
|
1699
1698
|
] });
|
|
1700
1699
|
}
|
|
1701
|
-
function
|
|
1702
|
-
return e ? /* @__PURE__ */ t(
|
|
1700
|
+
function Mo({ showSkeleton: e, ...r }) {
|
|
1701
|
+
return e ? /* @__PURE__ */ t(_, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t($t, { ...r });
|
|
1703
1702
|
}
|
|
1704
|
-
function
|
|
1703
|
+
function zo(e) {
|
|
1705
1704
|
const { menus: r, children: o, ...n } = e, l = we(), a = et(
|
|
1706
1705
|
it({}, l, {
|
|
1707
1706
|
typography: {
|
|
@@ -1734,8 +1733,8 @@ function Mo(e) {
|
|
|
1734
1733
|
}
|
|
1735
1734
|
export {
|
|
1736
1735
|
mr as Autocomplete,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1736
|
+
_o as CardSkeleton,
|
|
1737
|
+
Mo as Image,
|
|
1738
|
+
zo as default,
|
|
1740
1739
|
Ut as useSearch
|
|
1741
1740
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.48",
|
|
4
4
|
"description": "Common ux components of blocklet",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -53,7 +53,7 @@
|
|
|
53
53
|
},
|
|
54
54
|
"dependencies": {
|
|
55
55
|
"@blocklet/js-sdk": "^1.16.42",
|
|
56
|
-
"@blocklet/util": "0.16.
|
|
56
|
+
"@blocklet/util": "0.16.48",
|
|
57
57
|
"@emotion/react": "^11.10.0",
|
|
58
58
|
"@emotion/styled": "^11.10.0",
|
|
59
59
|
"@iconify-icons/tabler": "^1.2.95",
|
|
@@ -91,5 +91,5 @@
|
|
|
91
91
|
"prettier": "^3.3.2",
|
|
92
92
|
"vite": "^5.4.10"
|
|
93
93
|
},
|
|
94
|
-
"gitHead": "
|
|
94
|
+
"gitHead": "2cc1c6d728c27977209a451159d59fd73961249c"
|
|
95
95
|
}
|