@blocklet/list 0.16.46 → 0.16.47
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 +166 -166
- 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 }),
|
|
@@ -949,14 +949,14 @@ function sr() {
|
|
|
949
949
|
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
950
|
function ur({ url: e }) {
|
|
951
951
|
const [r, o] = E(!0);
|
|
952
|
-
return /* @__PURE__ */ h(
|
|
952
|
+
return /* @__PURE__ */ h(z, { children: [
|
|
953
953
|
r && /* @__PURE__ */ t(
|
|
954
|
-
|
|
954
|
+
_,
|
|
955
955
|
{
|
|
956
956
|
variant: "rectangular",
|
|
957
957
|
sx: {
|
|
958
958
|
width: { xs: "100%", md: oe },
|
|
959
|
-
height: { xs: "auto", md:
|
|
959
|
+
height: { xs: "auto", md: xe }
|
|
960
960
|
}
|
|
961
961
|
}
|
|
962
962
|
),
|
|
@@ -968,7 +968,7 @@ function ur({ url: e }) {
|
|
|
968
968
|
src: e,
|
|
969
969
|
alt: "",
|
|
970
970
|
width: { xs: "100%", md: oe },
|
|
971
|
-
height: { xs: "auto", md:
|
|
971
|
+
height: { xs: "auto", md: xe },
|
|
972
972
|
borderRadius: 2,
|
|
973
973
|
border: 1,
|
|
974
974
|
borderColor: "divider",
|
|
@@ -980,14 +980,14 @@ function ur({ url: e }) {
|
|
|
980
980
|
] });
|
|
981
981
|
}
|
|
982
982
|
function hr({ title: e, blocklets: r }) {
|
|
983
|
-
const { blockletRender: o, serverVersion: n } =
|
|
983
|
+
const { blockletRender: o, serverVersion: n } = B();
|
|
984
984
|
return /* @__PURE__ */ h(w, { mt: 3, children: [
|
|
985
985
|
/* @__PURE__ */ t(v, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
|
|
986
986
|
/* @__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
987
|
] });
|
|
988
988
|
}
|
|
989
989
|
function pr() {
|
|
990
|
-
const { get: e } = Ie(), { t: r } =
|
|
990
|
+
const { get: e } = Ie(), { t: r } = B(), {
|
|
991
991
|
data: o = [],
|
|
992
992
|
error: n,
|
|
993
993
|
loading: l
|
|
@@ -995,7 +995,7 @@ function pr() {
|
|
|
995
995
|
const a = await e(P.explorePath);
|
|
996
996
|
return Array.isArray(a) ? a : [];
|
|
997
997
|
});
|
|
998
|
-
return n ? /* @__PURE__ */ t(be, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : l ? /* @__PURE__ */ t(Je, { mt: 15 }) : /* @__PURE__ */ h(
|
|
998
|
+
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
999
|
/* @__PURE__ */ t(sr, {}),
|
|
1000
1000
|
o.map(
|
|
1001
1001
|
(a) => {
|
|
@@ -1015,9 +1015,9 @@ function mr({
|
|
|
1015
1015
|
handleSearchSelect: a,
|
|
1016
1016
|
...s
|
|
1017
1017
|
}) {
|
|
1018
|
-
const i = re(null), m = re(!1), [d, f] = E(!1), [u, g] = E(""), [
|
|
1018
|
+
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
1019
|
p(!0);
|
|
1020
|
-
const S = await
|
|
1020
|
+
const S = await y.get(Re(e, ve(P.blockletsPath, c)));
|
|
1021
1021
|
return p(!1), S.dataList || [];
|
|
1022
1022
|
}, { data: k, run: A } = ne(
|
|
1023
1023
|
(c) => c ? b({
|
|
@@ -1033,7 +1033,7 @@ function mr({
|
|
|
1033
1033
|
);
|
|
1034
1034
|
G(() => {
|
|
1035
1035
|
p(!0), A(n.keyword), g(n.keyword || "");
|
|
1036
|
-
}, [n.keyword, A]),
|
|
1036
|
+
}, [n.keyword, A]), zt(
|
|
1037
1037
|
"ctrl + k, command + k",
|
|
1038
1038
|
(c) => {
|
|
1039
1039
|
var S, N;
|
|
@@ -1041,17 +1041,17 @@ function mr({
|
|
|
1041
1041
|
},
|
|
1042
1042
|
{ enableOnTags: ["INPUT"] }
|
|
1043
1043
|
);
|
|
1044
|
-
const
|
|
1044
|
+
const F = De((c) => A(c), { wait: 300 }), $ = { name: he, title: u, did: "" };
|
|
1045
1045
|
let D = [];
|
|
1046
|
-
return u && (
|
|
1047
|
-
/* @__PURE__ */ h(
|
|
1046
|
+
return u && (R ? D = [$] : k != null && k.length ? D = [$, ...k] : D = [{ name: Oe, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ h(z, { children: [
|
|
1047
|
+
/* @__PURE__ */ h(_t, { fullScreen: !0, open: x, sx: { display: { md: "none" } }, children: [
|
|
1048
1048
|
/* @__PURE__ */ h(w, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
|
|
1049
1049
|
/* @__PURE__ */ t(
|
|
1050
1050
|
Ue,
|
|
1051
1051
|
{
|
|
1052
1052
|
fullWidth: !0,
|
|
1053
1053
|
sx: {
|
|
1054
|
-
bgcolor: "
|
|
1054
|
+
bgcolor: "grey.50",
|
|
1055
1055
|
px: 1,
|
|
1056
1056
|
py: 0.5,
|
|
1057
1057
|
".MuiInputBase-input": { p: 1 },
|
|
@@ -1069,7 +1069,7 @@ function mr({
|
|
|
1069
1069
|
className: "bl-autocomplete-input",
|
|
1070
1070
|
value: u,
|
|
1071
1071
|
onChange: (c) => q(c.target.value),
|
|
1072
|
-
startAdornment: H(
|
|
1072
|
+
startAdornment: H(x),
|
|
1073
1073
|
endAdornment: K()
|
|
1074
1074
|
}
|
|
1075
1075
|
),
|
|
@@ -1094,7 +1094,7 @@ function mr({
|
|
|
1094
1094
|
}
|
|
1095
1095
|
),
|
|
1096
1096
|
/* @__PURE__ */ t(
|
|
1097
|
-
|
|
1097
|
+
Lt,
|
|
1098
1098
|
{
|
|
1099
1099
|
ref: i,
|
|
1100
1100
|
open: !!u && d,
|
|
@@ -1126,7 +1126,7 @@ function mr({
|
|
|
1126
1126
|
}
|
|
1127
1127
|
},
|
|
1128
1128
|
renderInput: (c) => /* @__PURE__ */ t(
|
|
1129
|
-
|
|
1129
|
+
Mt,
|
|
1130
1130
|
{
|
|
1131
1131
|
...c,
|
|
1132
1132
|
InputProps: {
|
|
@@ -1147,7 +1147,7 @@ function mr({
|
|
|
1147
1147
|
value: $,
|
|
1148
1148
|
sx: [
|
|
1149
1149
|
{
|
|
1150
|
-
bgcolor: "
|
|
1150
|
+
bgcolor: "grey.50",
|
|
1151
1151
|
borderRadius: "8px",
|
|
1152
1152
|
overflow: "hidden",
|
|
1153
1153
|
".MuiOutlinedInput-notchedOutline": {
|
|
@@ -1165,7 +1165,7 @@ function mr({
|
|
|
1165
1165
|
)
|
|
1166
1166
|
] });
|
|
1167
1167
|
function q(c) {
|
|
1168
|
-
p(!0), g(c), m.current = !1,
|
|
1168
|
+
p(!0), g(c), m.current = !1, F.run(c);
|
|
1169
1169
|
}
|
|
1170
1170
|
function j() {
|
|
1171
1171
|
I(!1), g(""), q(""), l("");
|
|
@@ -1202,25 +1202,25 @@ function mr({
|
|
|
1202
1202
|
justifyContent: "center",
|
|
1203
1203
|
alignItems: "center",
|
|
1204
1204
|
color: "text.hint",
|
|
1205
|
-
bgcolor: "
|
|
1205
|
+
bgcolor: "grey.100",
|
|
1206
1206
|
borderRadius: "8px",
|
|
1207
1207
|
children: /* @__PURE__ */ t(te, { sx: { fontSize: 28 } })
|
|
1208
1208
|
}
|
|
1209
1209
|
);
|
|
1210
1210
|
let S = "";
|
|
1211
|
-
return c.logo && (S =
|
|
1211
|
+
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
1212
|
}
|
|
1213
1213
|
function H(c = !0) {
|
|
1214
|
-
return /* @__PURE__ */ t(w, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.hint" }, children: c && u &&
|
|
1214
|
+
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
1215
|
}
|
|
1216
1216
|
function K() {
|
|
1217
1217
|
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
1218
|
}
|
|
1219
1219
|
}
|
|
1220
1220
|
function fr({ placeholder: e, ...r }) {
|
|
1221
|
-
const { search: o, t: n } =
|
|
1222
|
-
const { value:
|
|
1223
|
-
i(
|
|
1221
|
+
const { search: o, t: n } = B(), { filters: l, handleKeyword: a } = o, [s, i] = E(l.keyword || ""), m = De(a, { wait: 300 }), d = (g) => {
|
|
1222
|
+
const { value: x } = g.target;
|
|
1223
|
+
i(x), m.run(x);
|
|
1224
1224
|
}, f = () => {
|
|
1225
1225
|
i(""), a("");
|
|
1226
1226
|
};
|
|
@@ -1234,13 +1234,13 @@ function fr({ placeholder: e, ...r }) {
|
|
|
1234
1234
|
inputProps: {
|
|
1235
1235
|
"data-cy": "search-blocklet"
|
|
1236
1236
|
},
|
|
1237
|
-
startAdornment: /* @__PURE__ */ t(Ae, { position: "start", children: /* @__PURE__ */ t(
|
|
1237
|
+
startAdornment: /* @__PURE__ */ t(Ae, { position: "start", children: /* @__PURE__ */ t(yr, { sx: { fontSize: 18, ml: -0.5 } }) }),
|
|
1238
1238
|
onChange: d,
|
|
1239
1239
|
placeholder: u,
|
|
1240
1240
|
value: s,
|
|
1241
1241
|
title: u,
|
|
1242
1242
|
"data-cy": "search",
|
|
1243
|
-
endAdornment: s && /* @__PURE__ */ t(Ae, { position: "end", children: /* @__PURE__ */ t(
|
|
1243
|
+
endAdornment: s && /* @__PURE__ */ t(Ae, { position: "end", children: /* @__PURE__ */ t(xr, { "data-cy": "search-delete", onClick: f }) }),
|
|
1244
1244
|
...r
|
|
1245
1245
|
}
|
|
1246
1246
|
);
|
|
@@ -1262,9 +1262,9 @@ const gr = Q(Ue)`
|
|
|
1262
1262
|
color: transparent;
|
|
1263
1263
|
}
|
|
1264
1264
|
}
|
|
1265
|
-
`,
|
|
1265
|
+
`, yr = Q(te)`
|
|
1266
1266
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1267
|
-
`,
|
|
1267
|
+
`, xr = Q(ke)`
|
|
1268
1268
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
1269
1269
|
font-size: 16px;
|
|
1270
1270
|
cursor: pointer;
|
|
@@ -1283,7 +1283,7 @@ function wr() {
|
|
|
1283
1283
|
baseSearch: m,
|
|
1284
1284
|
categoryOptions: d,
|
|
1285
1285
|
compact: f
|
|
1286
|
-
} =
|
|
1286
|
+
} = B(), { filters: u, handleSort: g, handlePrice: x, handleDeveloper: I, handleSwitchShowResources: y, cleanFilter: R, handleCategory: p } = e, C = Ge(r);
|
|
1287
1287
|
return /* @__PURE__ */ h(
|
|
1288
1288
|
O,
|
|
1289
1289
|
{
|
|
@@ -1343,27 +1343,27 @@ function wr() {
|
|
|
1343
1343
|
{
|
|
1344
1344
|
label: r("blocklet.resourceTag", { name: u.resourceBlocklet }),
|
|
1345
1345
|
size: "small",
|
|
1346
|
-
onDelete: () =>
|
|
1346
|
+
onDelete: () => R(["resourceDid", "resourceBlocklet", "showResources"])
|
|
1347
1347
|
}
|
|
1348
1348
|
),
|
|
1349
1349
|
s ? /* @__PURE__ */ t(
|
|
1350
|
-
|
|
1350
|
+
Le,
|
|
1351
1351
|
{
|
|
1352
1352
|
checked: u.showResources !== "false",
|
|
1353
|
-
onChange: (k) =>
|
|
1353
|
+
onChange: (k) => y(k ? "true" : "false"),
|
|
1354
1354
|
label: r("common.showResources")
|
|
1355
1355
|
}
|
|
1356
1356
|
) : null,
|
|
1357
1357
|
/* @__PURE__ */ t(
|
|
1358
|
-
|
|
1358
|
+
Le,
|
|
1359
1359
|
{
|
|
1360
1360
|
checked: u.price === "free",
|
|
1361
|
-
onChange: (k) =>
|
|
1361
|
+
onChange: (k) => x(k ? "free" : ""),
|
|
1362
1362
|
label: r("blocklet.free")
|
|
1363
1363
|
}
|
|
1364
1364
|
),
|
|
1365
1365
|
f && /* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(
|
|
1366
|
-
|
|
1366
|
+
ye,
|
|
1367
1367
|
{
|
|
1368
1368
|
value: u.category || ((b = d[0]) == null ? void 0 : b.value),
|
|
1369
1369
|
options: d,
|
|
@@ -1372,7 +1372,7 @@ function wr() {
|
|
|
1372
1372
|
}
|
|
1373
1373
|
) }),
|
|
1374
1374
|
/* @__PURE__ */ t(
|
|
1375
|
-
|
|
1375
|
+
ye,
|
|
1376
1376
|
{
|
|
1377
1377
|
value: u.sortBy || C[0].value,
|
|
1378
1378
|
options: C,
|
|
@@ -1387,7 +1387,7 @@ function wr() {
|
|
|
1387
1387
|
}
|
|
1388
1388
|
);
|
|
1389
1389
|
}
|
|
1390
|
-
function
|
|
1390
|
+
function Le({
|
|
1391
1391
|
checked: e,
|
|
1392
1392
|
onChange: r,
|
|
1393
1393
|
label: o
|
|
@@ -1402,7 +1402,7 @@ function Fe({
|
|
|
1402
1402
|
Ne,
|
|
1403
1403
|
{
|
|
1404
1404
|
checked: e,
|
|
1405
|
-
icon: /* @__PURE__ */ t(X, { style: { padding: 0 }, icon: At }),
|
|
1405
|
+
icon: /* @__PURE__ */ t(X, { style: { padding: 0, color: n.palette.text.secondary }, icon: At }),
|
|
1406
1406
|
checkedIcon: /* @__PURE__ */ t(X, { style: { padding: 0, color: n.palette.primary.main }, icon: Et }),
|
|
1407
1407
|
size: "large",
|
|
1408
1408
|
sx: { p: 0, mr: 1 },
|
|
@@ -1415,16 +1415,16 @@ function Fe({
|
|
|
1415
1415
|
}
|
|
1416
1416
|
function ee({ children: e }) {
|
|
1417
1417
|
return /* @__PURE__ */ h(w, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.hint", children: [
|
|
1418
|
-
/* @__PURE__ */ t(
|
|
1418
|
+
/* @__PURE__ */ t(Ft, {}),
|
|
1419
1419
|
e
|
|
1420
1420
|
] });
|
|
1421
1421
|
}
|
|
1422
|
-
function
|
|
1423
|
-
const { t: e } =
|
|
1422
|
+
function _e() {
|
|
1423
|
+
const { t: e } = B();
|
|
1424
1424
|
return /* @__PURE__ */ t(v, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
|
|
1425
1425
|
}
|
|
1426
1426
|
function me({ filterTip: e, keywordTip: r }) {
|
|
1427
|
-
const { t: o, locale: n } =
|
|
1427
|
+
const { t: o, locale: n } = B(), l = () => n === "zh" ? "、" : " , ";
|
|
1428
1428
|
return /* @__PURE__ */ h(w, { mt: 1, display: "flex", children: [
|
|
1429
1429
|
/* @__PURE__ */ t(v, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
|
|
1430
1430
|
e && /* @__PURE__ */ t(v, { children: o("blocklet.filterTip") }),
|
|
@@ -1455,7 +1455,7 @@ function fe({
|
|
|
1455
1455
|
] });
|
|
1456
1456
|
}
|
|
1457
1457
|
function br() {
|
|
1458
|
-
const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } =
|
|
1458
|
+
const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = B(), { filters: l } = r, a = !!n || !!l.price;
|
|
1459
1459
|
if (l.keyword && a)
|
|
1460
1460
|
return /* @__PURE__ */ h(ee, { children: [
|
|
1461
1461
|
/* @__PURE__ */ t(
|
|
@@ -1490,11 +1490,11 @@ function br() {
|
|
|
1490
1490
|
primaryEnd: e("blocklet.noCategoryResults2"),
|
|
1491
1491
|
filter: s
|
|
1492
1492
|
}
|
|
1493
|
-
) : /* @__PURE__ */ t(
|
|
1493
|
+
) : /* @__PURE__ */ t(_e, {}),
|
|
1494
1494
|
/* @__PURE__ */ t(me, { filterTip: !0 })
|
|
1495
1495
|
] });
|
|
1496
1496
|
}
|
|
1497
|
-
return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(
|
|
1497
|
+
return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(_e, {}) });
|
|
1498
1498
|
}
|
|
1499
1499
|
const kr = (e, r, o, n) => dt(
|
|
1500
1500
|
async (l) => {
|
|
@@ -1518,19 +1518,19 @@ const kr = (e, r, o, n) => dt(
|
|
|
1518
1518
|
);
|
|
1519
1519
|
function vr() {
|
|
1520
1520
|
var u;
|
|
1521
|
-
const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: l } =
|
|
1521
|
+
const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: l } = B(), { filters: a } = r, s = ut({
|
|
1522
1522
|
currentPage: P.currentPage,
|
|
1523
1523
|
pageSize: Qt() ? P.mobilePageSize : P.pageSize,
|
|
1524
1524
|
defaultCurrentPage: P.defaultCurrentPage
|
|
1525
1525
|
}), [i, m] = E(null), d = kr(e, a, s, m), f = V(
|
|
1526
1526
|
() => {
|
|
1527
|
-
var g,
|
|
1528
|
-
return o ? o(((g = d.data) == null ? void 0 : g.list) || []) : ((
|
|
1527
|
+
var g, x;
|
|
1528
|
+
return o ? o(((g = d.data) == null ? void 0 : g.list) || []) : ((x = d.data) == null ? void 0 : x.list) || [];
|
|
1529
1529
|
},
|
|
1530
1530
|
[d.data, o]
|
|
1531
1531
|
);
|
|
1532
1532
|
return G(() => {
|
|
1533
|
-
const g = f.find((
|
|
1533
|
+
const g = f.find((x) => x.owner.did === a.owner);
|
|
1534
1534
|
l((g == null ? void 0 : g.owner.fullName) || (g == null ? void 0 : g.author.name) || "");
|
|
1535
1535
|
}, [a.owner, f, l]), {
|
|
1536
1536
|
blocklets: f,
|
|
@@ -1549,8 +1549,8 @@ function vr() {
|
|
|
1549
1549
|
};
|
|
1550
1550
|
}
|
|
1551
1551
|
function Cr() {
|
|
1552
|
-
const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: l, minItemWidth: a, layout: s, baseSearch: i, compact: m } =
|
|
1553
|
-
loading:
|
|
1552
|
+
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({
|
|
1553
|
+
loading: x.fetchBlockletsLoading || x.loadingMore,
|
|
1554
1554
|
hasNextPage: I,
|
|
1555
1555
|
onLoadMore: g
|
|
1556
1556
|
});
|
|
@@ -1559,16 +1559,16 @@ function Cr() {
|
|
|
1559
1559
|
return /* @__PURE__ */ t(be, { error: k });
|
|
1560
1560
|
}
|
|
1561
1561
|
const p = i && s.showSearch || !d.keyword;
|
|
1562
|
-
return /* @__PURE__ */ h(
|
|
1563
|
-
p ? /* @__PURE__ */ t(wr, {}) : /* @__PURE__ */ h(
|
|
1562
|
+
return /* @__PURE__ */ h(z, { children: [
|
|
1563
|
+
p ? /* @__PURE__ */ t(wr, {}) : /* @__PURE__ */ h(z, { children: [
|
|
1564
1564
|
/* @__PURE__ */ t(Se, { xs: /* @__PURE__ */ t(Ze, {}), md: null }),
|
|
1565
1565
|
b()
|
|
1566
1566
|
] }),
|
|
1567
1567
|
C(),
|
|
1568
|
-
!
|
|
1568
|
+
!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
1569
|
] });
|
|
1570
1570
|
function C() {
|
|
1571
|
-
return
|
|
1571
|
+
return x.fetchBlockletsLoading ? /* @__PURE__ */ t(Je, { mt: 15 }) : f.length ? /* @__PURE__ */ t(
|
|
1572
1572
|
w,
|
|
1573
1573
|
{
|
|
1574
1574
|
className: "blocklet-list",
|
|
@@ -1617,14 +1617,14 @@ function Cr() {
|
|
|
1617
1617
|
children: e("blocklet.search", { keyword: d.keyword })
|
|
1618
1618
|
}
|
|
1619
1619
|
),
|
|
1620
|
-
/* @__PURE__ */ t(v, { variant: "body1", color: "text.hint", fontSize: 13, children: e("blocklet.resultCount", { count:
|
|
1620
|
+
/* @__PURE__ */ t(v, { variant: "body1", color: "text.hint", fontSize: 13, children: e("blocklet.resultCount", { count: y }) })
|
|
1621
1621
|
]
|
|
1622
1622
|
}
|
|
1623
1623
|
);
|
|
1624
1624
|
}
|
|
1625
1625
|
}
|
|
1626
1626
|
function Sr() {
|
|
1627
|
-
const { t: e, selectedCategory: r, getCategoryLocale: o } =
|
|
1627
|
+
const { t: e, selectedCategory: r, getCategoryLocale: o } = B(), { toggleOpen: n } = Ce();
|
|
1628
1628
|
return /* @__PURE__ */ h(
|
|
1629
1629
|
v,
|
|
1630
1630
|
{
|
|
@@ -1643,7 +1643,7 @@ function Sr() {
|
|
|
1643
1643
|
}
|
|
1644
1644
|
function Ir({ menus: e, children: r }) {
|
|
1645
1645
|
var d;
|
|
1646
|
-
const { search: o, layout: n, compact: l } =
|
|
1646
|
+
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
1647
|
return /* @__PURE__ */ t(jt, { children: /* @__PURE__ */ h(st, { FallbackComponent: be, children: [
|
|
1648
1648
|
!l && /* @__PURE__ */ t(Sr, {}),
|
|
1649
1649
|
/* @__PURE__ */ h(
|
|
@@ -1679,29 +1679,29 @@ function Ir({ menus: e, children: r }) {
|
|
|
1679
1679
|
)
|
|
1680
1680
|
] }) });
|
|
1681
1681
|
}
|
|
1682
|
-
function
|
|
1682
|
+
function _o(e) {
|
|
1683
1683
|
return /* @__PURE__ */ h(Wt, { variant: "outlined", ...e, sx: { maxWidth: 400, borderRadius: "8px", p: { xs: 2, md: 3 }, ...e.sx }, children: [
|
|
1684
1684
|
/* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 2, pb: 1, children: [
|
|
1685
1685
|
/* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 2, flex: 1, children: [
|
|
1686
|
-
/* @__PURE__ */ t(
|
|
1687
|
-
/* @__PURE__ */ t(
|
|
1686
|
+
/* @__PURE__ */ t(L, { variant: "rounded", width: 48, height: 48 }),
|
|
1687
|
+
/* @__PURE__ */ t(L, { variant: "text", width: 60, height: 28 })
|
|
1688
1688
|
] }),
|
|
1689
|
-
/* @__PURE__ */ t(
|
|
1689
|
+
/* @__PURE__ */ t(L, { variant: "text", width: 70, height: 40 })
|
|
1690
1690
|
] }),
|
|
1691
|
-
/* @__PURE__ */ t(
|
|
1692
|
-
/* @__PURE__ */ t(
|
|
1691
|
+
/* @__PURE__ */ t(L, { variant: "text", width: "100%", height: 24 }),
|
|
1692
|
+
/* @__PURE__ */ t(L, { variant: "text", width: "90%", height: 24 }),
|
|
1693
1693
|
/* @__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(
|
|
1694
|
+
/* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24 }),
|
|
1695
|
+
/* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 }),
|
|
1696
|
+
/* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24, sx: { ml: 1 } }),
|
|
1697
|
+
/* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 })
|
|
1698
1698
|
] })
|
|
1699
1699
|
] });
|
|
1700
1700
|
}
|
|
1701
|
-
function
|
|
1702
|
-
return e ? /* @__PURE__ */ t(
|
|
1701
|
+
function Mo({ showSkeleton: e, ...r }) {
|
|
1702
|
+
return e ? /* @__PURE__ */ t(_, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t($t, { ...r });
|
|
1703
1703
|
}
|
|
1704
|
-
function
|
|
1704
|
+
function zo(e) {
|
|
1705
1705
|
const { menus: r, children: o, ...n } = e, l = we(), a = et(
|
|
1706
1706
|
it({}, l, {
|
|
1707
1707
|
typography: {
|
|
@@ -1734,8 +1734,8 @@ function Mo(e) {
|
|
|
1734
1734
|
}
|
|
1735
1735
|
export {
|
|
1736
1736
|
mr as Autocomplete,
|
|
1737
|
-
|
|
1738
|
-
|
|
1739
|
-
|
|
1737
|
+
_o as CardSkeleton,
|
|
1738
|
+
Mo as Image,
|
|
1739
|
+
zo as default,
|
|
1740
1740
|
Ut as useSearch
|
|
1741
1741
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.47",
|
|
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.47",
|
|
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": "cd5cb3db9dfd37efddbf0e637fd0c72c54e1bb4c"
|
|
95
95
|
}
|