@blocklet/list 0.16.38 → 0.16.40

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.
Files changed (2) hide show
  1. package/lib/index.es.js +253 -228
  2. package/package.json +4 -4
package/lib/index.es.js CHANGED
@@ -4,8 +4,8 @@ import et from "@mui/material/styles/createTheme";
4
4
  import tt from "@mui/material/styles/ThemeProvider";
5
5
  import { pick as rt, omitBy as se, orderBy as ot, isEmpty as nt, merge as it } from "lodash-es";
6
6
  import { ErrorFallback as be } from "@arcblock/ux/lib/ErrorBoundary";
7
- import y from "@mui/material/Box";
8
- import F from "@mui/material/Stack";
7
+ import w from "@mui/material/Box";
8
+ import O from "@mui/material/Stack";
9
9
  import { createContext as _e, useState as E, useMemo as V, useContext as Me, useCallback as ge, useEffect as G, forwardRef as lt, useRef as re, memo as at } from "react";
10
10
  import { ErrorBoundary as st } from "react-error-boundary";
11
11
  import ct from "@iconify-icons/tabler/compass";
@@ -37,25 +37,25 @@ import He from "@arcblock/ux/lib/Avatar";
37
37
  import It from "@iconify-icons/tabler/cloud-download";
38
38
  import Bt from "@mui/icons-material/ChevronLeft";
39
39
  import Rt from "@mui/icons-material/ChevronRight";
40
- import O from "@mui/material/Skeleton";
41
- import Tt from "react-image-gallery";
40
+ import L from "@mui/material/Skeleton";
41
+ import Pt from "react-image-gallery";
42
42
  import "react-image-gallery/styles/css/image-gallery.css";
43
- import Te from "@mui/material/Grid";
44
- import Pt from "react-infinite-scroll-hook";
43
+ import Pe from "@mui/material/Grid";
44
+ import Tt from "react-infinite-scroll-hook";
45
45
  import At from "@iconify-icons/tabler/square";
46
46
  import Et from "@iconify-icons/tabler/square-check-filled";
47
- import Pe from "@mui/material/Chip";
47
+ import Te from "@mui/material/Chip";
48
48
  import te from "@mui/icons-material/Search";
49
- import Ft from "@mui/material/Autocomplete";
50
- import Lt from "@mui/material/Dialog";
49
+ import Ot from "@mui/material/Autocomplete";
50
+ import Ft from "@mui/material/Dialog";
51
51
  import Ue from "@mui/material/OutlinedInput";
52
- import Ot from "@mui/material/TextField";
52
+ import Lt from "@mui/material/TextField";
53
53
  import { useHotkeys as _t } from "react-hotkeys-hook";
54
54
  import Ae from "@mui/material/InputAdornment";
55
55
  import Mt from "@arcblock/ux/lib/Empty";
56
56
  import zt from "json-stable-stringify";
57
57
  import Dt from "@mui/icons-material/Menu";
58
- import { Card as Nt, Box as ce, Skeleton as L } from "@mui/material";
58
+ import { Card as Nt, Box as ce, Skeleton as F } from "@mui/material";
59
59
  import Wt from "@arcblock/ux/lib/Img";
60
60
  const Ve = _e({
61
61
  open: !1,
@@ -71,7 +71,7 @@ function $t({ children: e }) {
71
71
  function Ce() {
72
72
  return Me(Ve);
73
73
  }
74
- const P = {
74
+ const T = {
75
75
  nameAsc: "title",
76
76
  nameDesc: "title",
77
77
  popularity: "stats.downloads",
@@ -87,7 +87,7 @@ const P = {
87
87
  cacheSize: 100
88
88
  }, jt = (e) => ne(
89
89
  async () => {
90
- const { data: r } = await e.get(P.categoriesPath);
90
+ const { data: r } = await e.get(T.categoriesPath);
91
91
  return Array.isArray(r) ? r : [];
92
92
  },
93
93
  { manual: !0 }
@@ -179,10 +179,14 @@ const Ut = (e, r, o) => e && r || !o, Ge = (e) => [
179
179
  }, Vt = (e) => [
180
180
  { name: e("blocklet.free"), value: "free" },
181
181
  { name: e("blocklet.payment"), value: "payment" }
182
- ], Gt = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), qt = (e, r) => (
182
+ ], Gt = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), qt = (e) => {
183
+ var r, o;
184
+ return Array.isArray(e) ? e.map((n) => n.message).join(`
185
+ `) : (o = (r = e.response) == null ? void 0 : r.data) != null && o.error ? e.response.data.error.message || e.response.data.error : e.message || e;
186
+ }, Kt = (e, r) => (
183
187
  // eslint-disable-next-line no-prototype-builtins
184
188
  e == null ? void 0 : e.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
185
- ), Kt = () => window.innerWidth <= 600, Xt = {
189
+ ), Xt = () => window.innerWidth <= 600, Qt = {
186
190
  common: {
187
191
  title: "Blocklet Store",
188
192
  searchStore: "Search Blocklet",
@@ -194,7 +198,8 @@ const Ut = (e, r, o) => e && r || !o, Ge = (e) => [
194
198
  clear: "Clear",
195
199
  cancel: "Cancel",
196
200
  search: "Search",
197
- fetchError: "Failed to fetch data, please try again later"
201
+ fetchError: "Failed to fetch data, please try again later",
202
+ searchPlaceholder: "Search blocklet"
198
203
  },
199
204
  explore: {
200
205
  title: "Explore",
@@ -233,7 +238,7 @@ const Ut = (e, r, o) => e && r || !o, Ge = (e) => [
233
238
  autocomplete: {
234
239
  expandResult: 'View all search results for "{name}"'
235
240
  }
236
- }, Qt = {
241
+ }, Yt = {
237
242
  common: {
238
243
  title: "Blocklet 商店",
239
244
  searchStore: "搜索 Blocklet",
@@ -245,7 +250,8 @@ const Ut = (e, r, o) => e && r || !o, Ge = (e) => [
245
250
  clear: "清除",
246
251
  cancel: "取消",
247
252
  search: "搜索",
248
- fetchError: "获取数据失败, 请稍后再试"
253
+ fetchError: "获取数据失败, 请稍后再试",
254
+ searchPlaceholder: "搜索 Blocklet"
249
255
  },
250
256
  explore: {
251
257
  title: "探索",
@@ -285,14 +291,14 @@ const Ut = (e, r, o) => e && r || !o, Ge = (e) => [
285
291
  expandResult: "查看 “{name}” 的所有搜索结果"
286
292
  }
287
293
  }, de = {
288
- en: Re(Xt),
289
- zh: Re(Qt)
294
+ en: Re(Qt),
295
+ zh: Re(Yt)
290
296
  }, Ke = (e, r) => {
291
297
  const o = {};
292
298
  return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
293
- }, Yt = (e) => (r, o) => {
299
+ }, Zt = (e) => (r, o) => {
294
300
  const n = de[e] ? de[e][r] : de.en[r];
295
- return qt(n, o) || r;
301
+ return Kt(n, o) || r;
296
302
  }, Xe = {
297
303
  errors: {
298
304
  fetchCategoriesError: null
@@ -348,8 +354,8 @@ const Ut = (e, r, o) => e && r || !o, Ge = (e) => [
348
354
  handlePage: () => {
349
355
  }
350
356
  }
351
- }, Qe = _e(Xe), { Provider: Zt, Consumer: Ao } = Qe;
352
- function Jt(e) {
357
+ }, Qe = _e(Xe), { Provider: Jt, Consumer: Eo } = Qe;
358
+ function er(e) {
353
359
  const {
354
360
  locale: r = "zh",
355
361
  filters: o = {},
@@ -359,14 +365,14 @@ function Jt(e) {
359
365
  minItemWidth: a = 350,
360
366
  queryFilter: s = !0,
361
367
  layout: i = {},
362
- wrapChildren: m = (T) => T,
363
- extraFilter: d = (T) => T,
368
+ wrapChildren: m = (P) => P,
369
+ extraFilter: d = (P) => P,
364
370
  baseSearch: f = !1,
365
371
  fetchCategoryDelay: u = 0,
366
- showResourcesSwitch: x = !1,
367
- showCategory: w = !0,
372
+ showResourcesSwitch: g = !1,
373
+ showCategory: y = !0,
368
374
  tagFilters: I = [],
369
- children: g,
375
+ children: x,
370
376
  storeVersion: B,
371
377
  onSearchSelect: p = () => {
372
378
  },
@@ -379,9 +385,9 @@ function Jt(e) {
379
385
  loading: Y,
380
386
  run: Z
381
387
  } = jt(z), H = V(() => {
382
- const T = ot(j, [(W) => W.name], ["asc"]), _ = T.findIndex((W) => W.name === "All" || W.locales.en === "All");
383
- return _ > -1 ? [{ ...T[_], _id: "All" }, ...T.slice(0, _), ...T.slice(_ + 1)] : T;
384
- }, [j]), K = ge(Yt(r), [r]), c = V(() => Gt(H, r), [H, r]), S = Vt(K), N = {
388
+ const P = ot(j, [(W) => W.name], ["asc"]), _ = P.findIndex((W) => W.name === "All" || W.locales.en === "All");
389
+ return _ > -1 ? [{ ...P[_], _id: "All" }, ...P.slice(0, _), ...P.slice(_ + 1)] : P;
390
+ }, [j]), K = ge(Zt(r), [r]), c = V(() => Gt(H, r), [H, r]), S = Vt(K), N = {
385
391
  search: $,
386
392
  compact: k,
387
393
  errors: { fetchCategoriesError: ae },
@@ -410,13 +416,13 @@ function Jt(e) {
410
416
  priceOptions: S,
411
417
  storeApi: z,
412
418
  baseSearch: f,
413
- showResourcesSwitch: x,
414
- showCategory: w,
419
+ showResourcesSwitch: g,
420
+ showCategory: y,
415
421
  tagFilters: I,
416
422
  onFilterChange: l,
417
- getCategoryLocale: (T) => {
418
- if (!T) return null;
419
- const _ = j.find((W) => W._id === T || W.locales.en === "All");
423
+ getCategoryLocale: (P) => {
424
+ if (!P) return null;
425
+ const _ = j.find((W) => W._id === P || W.locales.en === "All");
420
426
  return _ ? _.locales[r] || _.locales.en : null;
421
427
  },
422
428
  get developerName() {
@@ -426,7 +432,7 @@ function Jt(e) {
426
432
  };
427
433
  return G(() => {
428
434
  setTimeout(Z, u || 0);
429
- }, [C, Z, u]), /* @__PURE__ */ t(Zt, { value: N, children: g });
435
+ }, [C, Z, u]), /* @__PURE__ */ t(Jt, { value: N, children: x });
430
436
  }
431
437
  function R() {
432
438
  const e = Me(Qe);
@@ -479,17 +485,17 @@ function Se({
479
485
  let u = e;
480
486
  return i || (u = J(r, u), m) || (u = J(o, u), d) || (u = J(n, u), f) ? u : J(l, u);
481
487
  }
482
- function er({ children: e }) {
488
+ function tr({ children: e }) {
483
489
  const { open: r, toggleOpen: o } = Ce();
484
490
  return /* @__PURE__ */ t(
485
491
  Se,
486
492
  {
487
493
  xs: /* @__PURE__ */ t(xt, { open: r, onClose: () => o(!1), children: e }),
488
- md: /* @__PURE__ */ t(y, { children: e })
494
+ md: /* @__PURE__ */ t(w, { children: e })
489
495
  }
490
496
  );
491
497
  }
492
- const tr = lt(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
498
+ const rr = lt(({ loading: e, disabled: r, ...o }, n) => /* @__PURE__ */ t(
493
499
  ie,
494
500
  {
495
501
  ref: n,
@@ -506,23 +512,23 @@ function xe({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
506
512
  G(() => {
507
513
  f(e !== null ? e : "");
508
514
  }, [e]);
509
- const x = ge(() => {
515
+ const g = ge(() => {
510
516
  m(!1);
511
- }, []), w = ge(() => {
517
+ }, []), y = ge(() => {
512
518
  m(!0);
513
519
  }, []);
514
520
  function I(p) {
515
- f(p.value), o(p.value), u && x();
521
+ f(p.value), o(p.value), u && g();
516
522
  }
517
- function g(p) {
523
+ function x(p) {
518
524
  return p === d;
519
525
  }
520
526
  return /* @__PURE__ */ h(M, { children: [
521
527
  /* @__PURE__ */ h(
522
- rr,
528
+ or,
523
529
  {
524
530
  ref: a,
525
- onClick: w,
531
+ onClick: y,
526
532
  variant: "outlined",
527
533
  size: "medium",
528
534
  className: ["my-select__selector", nt(d) ? "" : "my-select__selector--active"].join(" "),
@@ -539,11 +545,11 @@ function xe({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
539
545
  {
540
546
  ...p,
541
547
  style: { transformOrigin: C === "bottom" ? "center top" : "center bottom" },
542
- children: /* @__PURE__ */ t(vt, { children: /* @__PURE__ */ t(bt, { onClickAway: x, children: /* @__PURE__ */ t(or, { autoFocusItem: i, onMouseEnter: w, onMouseLeave: x, children: r.map((b) => /* @__PURE__ */ h($e, { onClick: () => I(b), sx: { fontSize: 14 }, children: [
548
+ children: /* @__PURE__ */ t(vt, { children: /* @__PURE__ */ t(bt, { onClickAway: g, children: /* @__PURE__ */ t(nr, { autoFocusItem: i, onMouseEnter: y, onMouseLeave: g, children: r.map((b) => /* @__PURE__ */ h($e, { onClick: () => I(b), sx: { fontSize: 14 }, children: [
543
549
  /* @__PURE__ */ t(
544
550
  yt,
545
551
  {
546
- sx: { mr: 1, fontSize: 16, visibility: g(b.value) ? "visible" : "hidden" }
552
+ sx: { mr: 1, fontSize: 16, visibility: x(b.value) ? "visible" : "hidden" }
547
553
  }
548
554
  ),
549
555
  b.name
@@ -552,7 +558,7 @@ function xe({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
552
558
  ) })
553
559
  ] });
554
560
  }
555
- const rr = Q(tr)`
561
+ const or = Q(rr)`
556
562
  border: 1px solid #f0f0f0;
557
563
  padding: 6px 8px 6px 12px;
558
564
  font-weight: ${(e) => e.theme.typography.fontWeightRegular};
@@ -580,7 +586,7 @@ const rr = Q(tr)`
580
586
  margin-right: 3px;
581
587
  }
582
588
  }
583
- `, or = Q(je)`
589
+ `, nr = Q(je)`
584
590
  .my-select__option__icon {
585
591
  color: transparent;
586
592
  font-size: 14px;
@@ -600,7 +606,7 @@ const rr = Q(tr)`
600
606
  function Ze() {
601
607
  const { search: e, t: r } = R(), { filters: o, handleSort: n, handlePrice: l } = e, a = Ge(r);
602
608
  return /* @__PURE__ */ h(
603
- F,
609
+ O,
604
610
  {
605
611
  direction: { xs: "row", md: "column" },
606
612
  alignItems: { xs: "center", md: "flex-start" },
@@ -636,18 +642,18 @@ function Ze() {
636
642
  }
637
643
  );
638
644
  }
639
- function nr({ menus: e }) {
640
- const { selectedCategory: r, search: o, t: n, categoryOptions: l, loadings: a, layout: s, baseSearch: i, compact: m } = R(), { filters: d, handleActiveMenu: f, handleCategory: u, cleanFilter: x } = o, { toggleOpen: w } = Ce();
645
+ function ir({ menus: e }) {
646
+ const { selectedCategory: r, search: o, t: n, categoryOptions: l, loadings: a, layout: s, baseSearch: i, compact: m } = R(), { filters: d, handleActiveMenu: f, handleCategory: u, cleanFilter: g } = o, { toggleOpen: y } = Ce();
641
647
  G(() => {
642
- w(!1);
648
+ y(!1);
643
649
  }, [Object.values(d).join("")]);
644
650
  const I = Ut(i, s.showSearch, d.keyword);
645
- return s.showCategory && !m ? /* @__PURE__ */ h(er, { children: [
651
+ return s.showCategory && !m ? /* @__PURE__ */ h(tr, { children: [
646
652
  /* @__PURE__ */ t(
647
653
  Se,
648
654
  {
649
655
  xs: /* @__PURE__ */ h(
650
- F,
656
+ O,
651
657
  {
652
658
  direction: "row",
653
659
  justifyContent: "space-between",
@@ -658,7 +664,7 @@ function nr({ menus: e }) {
658
664
  borderBottom: 1,
659
665
  borderColor: "divider",
660
666
  children: [
661
- /* @__PURE__ */ t(Ye, { onClick: () => w(!1), children: /* @__PURE__ */ t(ke, {}) }),
667
+ /* @__PURE__ */ t(Ye, { onClick: () => y(!1), children: /* @__PURE__ */ t(ke, {}) }),
662
668
  /* @__PURE__ */ t(v, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: n("common.category") })
663
669
  ]
664
670
  }
@@ -667,7 +673,7 @@ function nr({ menus: e }) {
667
673
  }
668
674
  ),
669
675
  /* @__PURE__ */ t(
670
- F,
676
+ O,
671
677
  {
672
678
  visibility: a.fetchCategoriesLoading ? "hidden" : "visible",
673
679
  width: { xs: 268, md: 200 },
@@ -675,8 +681,8 @@ function nr({ menus: e }) {
675
681
  p: { xs: 2, md: 0 },
676
682
  pr: { md: 6 },
677
683
  children: I ? /* @__PURE__ */ h(M, { children: [
678
- s.showExplore && /* @__PURE__ */ h(y, { mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
679
- /* @__PURE__ */ h(y, { display: "flex", alignItems: "center", gap: 1, children: [
684
+ s.showExplore && /* @__PURE__ */ h(w, { mb: 3, pb: 3, borderBottom: 1, borderColor: "divider", children: [
685
+ /* @__PURE__ */ h(w, { display: "flex", alignItems: "center", gap: 1, children: [
680
686
  /* @__PURE__ */ t(X, { icon: ct, width: 20, height: 20 }),
681
687
  /* @__PURE__ */ t(
682
688
  v,
@@ -686,45 +692,45 @@ function nr({ menus: e }) {
686
692
  fontWeight: !r && !d.menu ? "fontWeightMedium" : void 0,
687
693
  sx: { cursor: "pointer" },
688
694
  onClick: () => {
689
- w(!1), x();
695
+ y(!1), g();
690
696
  },
691
697
  children: n("explore.title")
692
698
  }
693
699
  )
694
700
  ] }),
695
- e == null ? void 0 : e.map((g) => /* @__PURE__ */ h(y, { display: "flex", alignItems: "center", mt: 2, gap: 1, children: [
696
- typeof g.icon == "string" ? /* @__PURE__ */ t(X, { icon: g.icon, width: 20, height: 20 }) : g.icon,
701
+ e == null ? void 0 : e.map((x) => /* @__PURE__ */ h(w, { display: "flex", alignItems: "center", mt: 2, gap: 1, children: [
702
+ typeof x.icon == "string" ? /* @__PURE__ */ t(X, { icon: x.icon, width: 20, height: 20 }) : x.icon,
697
703
  /* @__PURE__ */ t(
698
704
  v,
699
705
  {
700
706
  variant: "body1",
701
- color: d.menu === g.key ? "text.primary" : "text.lighter",
702
- fontWeight: d.menu === g.key ? "fontWeightMedium" : void 0,
707
+ color: d.menu === x.key ? "text.primary" : "text.lighter",
708
+ fontWeight: d.menu === x.key ? "fontWeightMedium" : void 0,
703
709
  sx: { cursor: "pointer" },
704
710
  onClick: () => {
705
711
  var B;
706
- w(!1), f(g.key), (B = g.onClick) == null || B.call(g);
712
+ y(!1), f(x.key), (B = x.onClick) == null || B.call(x);
707
713
  },
708
- children: g.title
714
+ children: x.title
709
715
  }
710
716
  )
711
- ] }, g.key))
717
+ ] }, x.key))
712
718
  ] }),
713
- !!l.length && /* @__PURE__ */ t(F, { gap: 2, children: l.map((g) => /* @__PURE__ */ t(
719
+ !!l.length && /* @__PURE__ */ t(O, { gap: 2, children: l.map((x) => /* @__PURE__ */ t(
714
720
  v,
715
721
  {
716
722
  variant: "body1",
717
- title: g.name,
723
+ title: x.name,
718
724
  sx: { cursor: "pointer" },
719
725
  "data-cy": "filter",
720
- color: r === g.value ? "text.primary" : "text.lighter",
726
+ color: r === x.value ? "text.primary" : "text.lighter",
721
727
  textTransform: "capitalize",
722
728
  onClick: () => {
723
- r === g.value ? x() : u(g.value), w(!1);
729
+ r === x.value ? g() : u(x.value), y(!1);
724
730
  },
725
- children: g.name
731
+ children: x.name
726
732
  },
727
- g.value
733
+ x.value
728
734
  )) })
729
735
  ] }) : /* @__PURE__ */ t(Ze, {})
730
736
  }
@@ -748,7 +754,7 @@ function Ie() {
748
754
  };
749
755
  }
750
756
  const Je = at(function(r) {
751
- return /* @__PURE__ */ t(y, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(le, {}) });
757
+ return /* @__PURE__ */ t(w, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", ...r, children: /* @__PURE__ */ t(le, {}) });
752
758
  });
753
759
  function Ee({
754
760
  icon: e,
@@ -756,7 +762,7 @@ function Ee({
756
762
  maxWidth: o = 100,
757
763
  title: n
758
764
  }) {
759
- return (r === 0 || r) && /* @__PURE__ */ h(F, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
765
+ return (r === 0 || r) && /* @__PURE__ */ h(O, { direction: "row", alignItems: "center", gap: 1, sx: { maxWidth: o, overflow: "hidden" }, children: [
760
766
  e,
761
767
  /* @__PURE__ */ t(
762
768
  v,
@@ -770,16 +776,16 @@ function Ee({
770
776
  )
771
777
  ] });
772
778
  }
773
- const ir = 16 / 9, ue = 292, ye = 189, oe = 336;
774
- function lr() {
775
- var g, B;
776
- const { t: e, search: r } = R(), { get: o } = Ie(), n = we(), l = U(n.breakpoints.down("md")), a = ((B = (g = window.blocklet) == null ? void 0 : g.preferences) == null ? void 0 : B.homeBanner) || [], {
779
+ const lr = 16 / 9, ue = 292, ye = 189, oe = 336;
780
+ function ar() {
781
+ var x, B;
782
+ const { t: e, search: r } = R(), { get: o } = Ie(), n = we(), l = U(n.breakpoints.down("md")), a = ((B = (x = window.blocklet) == null ? void 0 : x.preferences) == null ? void 0 : B.homeBanner) || [], {
777
783
  data: s = [],
778
784
  error: i,
779
785
  loading: m
780
786
  } = ne(async () => {
781
787
  const p = await o(
782
- ve(P.blockletsPath, { didList: a.map((C) => C.did).join(",") })
788
+ ve(T.blockletsPath, { didList: a.map((C) => C.did).join(",") })
783
789
  );
784
790
  return p != null && p.dataList ? a.map((C) => p.dataList.find((b) => b.did === C.did)) : [];
785
791
  });
@@ -795,7 +801,7 @@ function lr() {
795
801
  return !i && a.length > 0 ? /* @__PURE__ */ h(M, { children: [
796
802
  /* @__PURE__ */ t(v, { component: "h2", variant: "h2", mt: { xs: 2, md: 0 }, mb: 3, children: e("explore.title") }),
797
803
  /* @__PURE__ */ t(
798
- y,
804
+ w,
799
805
  {
800
806
  height: { xs: "auto", md: ue },
801
807
  minHeight: ue,
@@ -804,20 +810,20 @@ function lr() {
804
810
  borderColor: "divider",
805
811
  borderRadius: 3,
806
812
  overflow: "hidden",
807
- children: m ? /* @__PURE__ */ h(y, { p: 5, display: { md: "flex" }, gap: 5, alignItems: "center", justifyContent: "center", children: [
808
- /* @__PURE__ */ t(O, { variant: "rounded", height: ye, width: oe }),
809
- /* @__PURE__ */ h(y, { flex: 1, height: "100%", children: [
810
- /* @__PURE__ */ t(O, { variant: "text", height: 50, width: 100 }),
811
- /* @__PURE__ */ t(O, { variant: "text", height: 40, width: "100%" }),
812
- /* @__PURE__ */ t(O, { variant: "text", height: 40, width: 300 }),
813
- /* @__PURE__ */ h(y, { display: "flex", gap: 1, my: 2, children: [
814
- /* @__PURE__ */ t(O, { variant: "circular", height: 20, width: 20 }),
815
- /* @__PURE__ */ t(O, { variant: "text", height: 20, width: 50 })
813
+ children: m ? /* @__PURE__ */ h(w, { p: 5, display: { md: "flex" }, gap: 5, alignItems: "center", justifyContent: "center", children: [
814
+ /* @__PURE__ */ t(L, { variant: "rounded", height: ye, width: oe }),
815
+ /* @__PURE__ */ h(w, { flex: 1, height: "100%", children: [
816
+ /* @__PURE__ */ t(L, { variant: "text", height: 50, width: 100 }),
817
+ /* @__PURE__ */ t(L, { variant: "text", height: 40, width: "100%" }),
818
+ /* @__PURE__ */ t(L, { variant: "text", height: 40, width: 300 }),
819
+ /* @__PURE__ */ h(w, { display: "flex", gap: 1, my: 2, children: [
820
+ /* @__PURE__ */ t(L, { variant: "circular", height: 20, width: 20 }),
821
+ /* @__PURE__ */ t(L, { variant: "text", height: 20, width: 50 })
816
822
  ] }),
817
- /* @__PURE__ */ t(O, { variant: "rounded", height: 30, width: 100 })
823
+ /* @__PURE__ */ t(L, { variant: "rounded", height: 30, width: 100 })
818
824
  ] })
819
825
  ] }) : /* @__PURE__ */ t(
820
- Tt,
826
+ Pt,
821
827
  {
822
828
  showNav: !0,
823
829
  autoPlay: !0,
@@ -828,15 +834,15 @@ function lr() {
828
834
  showBullets: !1,
829
835
  showThumbnails: !1,
830
836
  showFullscreenButton: !1,
831
- renderLeftNav: (p) => /* @__PURE__ */ t(y, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Bt, { sx: { ...d, left: 5 } }) }),
832
- renderRightNav: (p) => /* @__PURE__ */ t(y, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Rt, { sx: { ...d, right: 5 } }) }),
837
+ renderLeftNav: (p) => /* @__PURE__ */ t(w, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Bt, { sx: { ...d, left: 5 } }) }),
838
+ renderRightNav: (p) => /* @__PURE__ */ t(w, { onClick: p, sx: { display: { xs: "none", md: "block" } }, children: /* @__PURE__ */ t(Rt, { sx: { ...d, right: 5 } }) }),
833
839
  items: a.map((p, C) => ({
834
840
  original: p.did,
835
841
  renderItem: () => {
836
842
  var z;
837
- const b = s[C] || {}, k = p.cover || sr(p.did, (z = b.screenshots) == null ? void 0 : z[0]), A = qe(k, n.breakpoints.values.md * 2);
843
+ const b = s[C] || {}, k = p.cover || cr(p.did, (z = b.screenshots) == null ? void 0 : z[0]), A = qe(k, n.breakpoints.values.md * 2);
838
844
  return /* @__PURE__ */ h(
839
- F,
845
+ O,
840
846
  {
841
847
  height: { xs: "auto", md: ue },
842
848
  sx: {
@@ -864,12 +870,12 @@ function lr() {
864
870
  gap: { xs: 2, md: 5 },
865
871
  children: [
866
872
  f(A),
867
- /* @__PURE__ */ h(F, { flex: 1, height: "100%", gap: 3, children: [
868
- /* @__PURE__ */ h(y, { flex: 1, children: [
873
+ /* @__PURE__ */ h(O, { flex: 1, height: "100%", gap: 3, children: [
874
+ /* @__PURE__ */ h(w, { flex: 1, children: [
869
875
  u(p.name || b.title || p.name),
870
- x(p.desc || b.description)
876
+ g(p.desc || b.description)
871
877
  ] }),
872
- b.did && w(b, p.baseNum),
878
+ b.did && y(b, p.baseNum),
873
879
  I(b)
874
880
  ] })
875
881
  ]
@@ -883,12 +889,12 @@ function lr() {
883
889
  )
884
890
  ] }) : null;
885
891
  function f(p) {
886
- return /* @__PURE__ */ t(y, { borderRadius: 2, overflow: "hidden", position: "relative", width: { xs: "100%", md: oe }, children: /* @__PURE__ */ t(cr, { url: p }) });
892
+ return /* @__PURE__ */ t(w, { borderRadius: 2, overflow: "hidden", position: "relative", width: { xs: "100%", md: oe }, children: /* @__PURE__ */ t(dr, { url: p }) });
887
893
  }
888
894
  function u(p) {
889
895
  return /* @__PURE__ */ t(v, { variant: "h2", width: "100%", children: p });
890
896
  }
891
- function x(p) {
897
+ function g(p) {
892
898
  return /* @__PURE__ */ t(
893
899
  v,
894
900
  {
@@ -912,11 +918,11 @@ function lr() {
912
918
  }
913
919
  );
914
920
  }
915
- function w(p, C = 0) {
921
+ function y(p, C = 0) {
916
922
  const { did: b, owner: k, stats: A } = p;
917
- return /* @__PURE__ */ h(y, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
923
+ return /* @__PURE__ */ h(w, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
918
924
  /* @__PURE__ */ t(Ee, { icon: /* @__PURE__ */ t(He, { src: k.avatar, did: b, size: 20, variant: "circle" }), children: k.fullName }),
919
- /* @__PURE__ */ t(Ee, { icon: /* @__PURE__ */ t(X, { icon: It }), title: `${A.downloads + C}`, children: ar(A.downloads + C) })
925
+ /* @__PURE__ */ t(Ee, { icon: /* @__PURE__ */ t(X, { icon: It }), title: `${A.downloads + C}`, children: sr(A.downloads + C) })
920
926
  ] });
921
927
  }
922
928
  function I(p) {
@@ -939,12 +945,12 @@ function lr() {
939
945
  );
940
946
  }
941
947
  }
942
- const ar = (e) => Number.isNaN(e) ? 0 : e < 1e3 ? e : e < 1e6 ? `${(e / 1e3).toFixed(1)}k` : e < 1e9 ? `${(e / 1e6).toFixed(1)}m` : `${(e / 1e9).toFixed(1)}b`, sr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
943
- function cr({ url: e }) {
948
+ const sr = (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`, cr = (e, r) => e && r ? `/assets/${e}/screenshots/${r}` : "";
949
+ function dr({ url: e }) {
944
950
  const [r, o] = E(!0);
945
951
  return /* @__PURE__ */ h(M, { children: [
946
952
  r && /* @__PURE__ */ t(
947
- O,
953
+ L,
948
954
  {
949
955
  variant: "rectangular",
950
956
  sx: {
@@ -954,7 +960,7 @@ function cr({ url: e }) {
954
960
  }
955
961
  ),
956
962
  /* @__PURE__ */ t(
957
- y,
963
+ w,
958
964
  {
959
965
  display: r ? "none" : "block",
960
966
  component: "img",
@@ -965,41 +971,41 @@ function cr({ url: e }) {
965
971
  borderRadius: 2,
966
972
  border: 1,
967
973
  borderColor: "divider",
968
- sx: { objectFit: "container", cursor: "pointer", aspectRatio: ir },
974
+ sx: { objectFit: "container", cursor: "pointer", aspectRatio: lr },
969
975
  onLoad: () => o(!1),
970
976
  onError: () => o(!1)
971
977
  }
972
978
  )
973
979
  ] });
974
980
  }
975
- function dr({ title: e, blocklets: r }) {
981
+ function ur({ title: e, blocklets: r }) {
976
982
  const { blockletRender: o, serverVersion: n } = R();
977
- return /* @__PURE__ */ h(y, { mt: 3, children: [
983
+ return /* @__PURE__ */ h(w, { mt: 3, children: [
978
984
  /* @__PURE__ */ t(v, { component: "h3", variant: "h3", sx: { mb: 2 }, children: e }),
979
- /* @__PURE__ */ t(Te, { container: !0, spacing: 2, boxSizing: "border-box", maxWidth: "calc(100vw - 16px)", children: r.map((l) => /* @__PURE__ */ t(Te, { item: !0, xs: 12, md: 6, p: "2px", "data-blocklet-did": l.did, children: /* @__PURE__ */ t(y, { padding: "1px", children: o({ blocklet: l, blocklets: r, serverVersion: n }) }) }, l.did)) })
985
+ /* @__PURE__ */ t(Pe, { container: !0, spacing: 2, boxSizing: "border-box", maxWidth: "calc(100vw - 16px)", children: r.map((l) => /* @__PURE__ */ t(Pe, { 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)) })
980
986
  ] });
981
987
  }
982
- function ur() {
988
+ function hr() {
983
989
  const { get: e } = Ie(), { t: r } = R(), {
984
990
  data: o = [],
985
991
  error: n,
986
992
  loading: l
987
993
  } = ne(async () => {
988
- const a = await e(P.explorePath);
994
+ const a = await e(T.explorePath);
989
995
  return Array.isArray(a) ? a : [];
990
996
  });
991
- return n ? /* @__PURE__ */ t(be, { error: new Error(`Failed to fetch blocklets from ${P.explorePath}`) }) : l ? /* @__PURE__ */ t(Je, { mt: 15 }) : /* @__PURE__ */ h(M, { children: [
992
- /* @__PURE__ */ t(lr, {}),
997
+ return n ? /* @__PURE__ */ t(be, { error: new Error(`Failed to fetch blocklets from ${T.explorePath}`) }) : l ? /* @__PURE__ */ t(Je, { mt: 15 }) : /* @__PURE__ */ h(M, { children: [
998
+ /* @__PURE__ */ t(ar, {}),
993
999
  o.map(
994
1000
  (a) => {
995
1001
  var s;
996
- return ((s = a.blocklets) == null ? void 0 : s.length) > 0 ? /* @__PURE__ */ t(dr, { title: r(`explore.${a.type}`), blocklets: a.blocklets }, a.type) : null;
1002
+ return ((s = a.blocklets) == null ? void 0 : s.length) > 0 ? /* @__PURE__ */ t(ur, { title: r(`explore.${a.type}`), blocklets: a.blocklets }, a.type) : null;
997
1003
  }
998
1004
  )
999
1005
  ] });
1000
1006
  }
1001
- const he = "__FREE_TEXT__", Fe = "__NO_RESULT__", pe = 40;
1002
- function hr({
1007
+ const he = "__FREE_TEXT__", Oe = "__NO_RESULT__", pe = 40;
1008
+ function pr({
1003
1009
  endpoint: e,
1004
1010
  t: r,
1005
1011
  locale: o,
@@ -1008,13 +1014,13 @@ function hr({
1008
1014
  handleSearchSelect: a,
1009
1015
  ...s
1010
1016
  }) {
1011
- const i = re(null), m = re(!1), [d, f] = E(!1), [u, x] = E(""), [w, I] = E(!1), g = Ie(), [B, p] = E(!1), C = (s == null ? void 0 : s.placeholder) || r("common.searchStore"), b = async (c) => {
1017
+ const i = re(null), m = re(!1), [d, f] = E(!1), [u, g] = E(""), [y, I] = E(!1), x = Ie(), [B, p] = E(!1), C = (s == null ? void 0 : s.placeholder) || r("common.searchStore"), b = async (c) => {
1012
1018
  p(!0);
1013
- const S = await g.get(Be(e, ve(P.blockletsPath, c)));
1019
+ const S = await x.get(Be(e, ve(T.blockletsPath, c)));
1014
1020
  return p(!1), S.dataList || [];
1015
1021
  }, { data: k, run: A } = ne(
1016
1022
  (c) => c ? b({
1017
- sortBy: P.nameDesc,
1023
+ sortBy: T.nameDesc,
1018
1024
  page: 1,
1019
1025
  pageSize: 10,
1020
1026
  keyword: c,
@@ -1025,7 +1031,7 @@ function hr({
1025
1031
  }
1026
1032
  );
1027
1033
  G(() => {
1028
- p(!0), A(n.keyword), x(n.keyword || "");
1034
+ p(!0), A(n.keyword), g(n.keyword || "");
1029
1035
  }, [n.keyword, A]), _t(
1030
1036
  "ctrl + k, command + k",
1031
1037
  (c) => {
@@ -1036,9 +1042,9 @@ function hr({
1036
1042
  );
1037
1043
  const z = De((c) => A(c), { wait: 300 }), $ = { name: he, title: u, did: "" };
1038
1044
  let D = [];
1039
- return u && (B ? D = [$] : k != null && k.length ? D = [$, ...k] : D = [{ name: Fe, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ h(M, { children: [
1040
- /* @__PURE__ */ h(Lt, { fullScreen: !0, open: w, sx: { display: { md: "none" } }, children: [
1041
- /* @__PURE__ */ h(y, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
1045
+ return u && (B ? D = [$] : k != null && k.length ? D = [$, ...k] : D = [{ name: Oe, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ h(M, { children: [
1046
+ /* @__PURE__ */ h(Ft, { fullScreen: !0, open: y, sx: { display: { md: "none" } }, children: [
1047
+ /* @__PURE__ */ h(w, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
1042
1048
  /* @__PURE__ */ t(
1043
1049
  Ue,
1044
1050
  {
@@ -1062,7 +1068,7 @@ function hr({
1062
1068
  className: "bl-autocomplete-input",
1063
1069
  value: u,
1064
1070
  onChange: (c) => q(c.target.value),
1065
- startAdornment: H(w),
1071
+ startAdornment: H(y),
1066
1072
  endAdornment: K()
1067
1073
  }
1068
1074
  ),
@@ -1071,7 +1077,7 @@ function hr({
1071
1077
  {
1072
1078
  variant: "outlined",
1073
1079
  onClick: () => {
1074
- I(!1), x(n.keyword || "");
1080
+ I(!1), g(n.keyword || "");
1075
1081
  },
1076
1082
  children: r("common.cancel")
1077
1083
  }
@@ -1087,7 +1093,7 @@ function hr({
1087
1093
  }
1088
1094
  ),
1089
1095
  /* @__PURE__ */ t(
1090
- Ft,
1096
+ Ot,
1091
1097
  {
1092
1098
  ref: i,
1093
1099
  open: !!u && d,
@@ -1119,7 +1125,7 @@ function hr({
1119
1125
  }
1120
1126
  },
1121
1127
  renderInput: (c) => /* @__PURE__ */ t(
1122
- Ot,
1128
+ Lt,
1123
1129
  {
1124
1130
  ...c,
1125
1131
  InputProps: {
@@ -1158,13 +1164,13 @@ function hr({
1158
1164
  )
1159
1165
  ] });
1160
1166
  function q(c) {
1161
- p(!0), x(c), m.current = !1, z.run(c);
1167
+ p(!0), g(c), m.current = !1, z.run(c);
1162
1168
  }
1163
1169
  function j() {
1164
- I(!1), x(""), q(""), l("");
1170
+ I(!1), g(""), q(""), l("");
1165
1171
  }
1166
1172
  function ae(c) {
1167
- c != null && c.did ? (I(!1), m.current = !0, x(""), a(c)) : c.name === he && (I(!1), l(u));
1173
+ c != null && c.did ? (I(!1), m.current = !0, g(""), a(c)) : c.name === he && (I(!1), l(u));
1168
1174
  }
1169
1175
  function Y(c) {
1170
1176
  var S, N;
@@ -1185,9 +1191,9 @@ function hr({
1185
1191
  );
1186
1192
  }
1187
1193
  function Z(c) {
1188
- if ([he, Fe].includes(c.name))
1194
+ if ([he, Oe].includes(c.name))
1189
1195
  return /* @__PURE__ */ t(
1190
- y,
1196
+ w,
1191
1197
  {
1192
1198
  width: pe,
1193
1199
  p: "6px",
@@ -1204,39 +1210,41 @@ function hr({
1204
1210
  return c.logo && (S = Be(e, "assets", c.did, qe(c.logo, pe, c.version))), /* @__PURE__ */ t(He, { src: S, size: pe, style: { borderRadius: "8px", overflow: "hidden" } });
1205
1211
  }
1206
1212
  function H(c = !0) {
1207
- return /* @__PURE__ */ t(y, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: c && u && B ? /* @__PURE__ */ t(le, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(te, { sx: { fontSize: 16, cursor: "default" } }) });
1213
+ return /* @__PURE__ */ t(w, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: c && u && B ? /* @__PURE__ */ t(le, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(te, { sx: { fontSize: 16, cursor: "default" } }) });
1208
1214
  }
1209
1215
  function K() {
1210
- return u ? /* @__PURE__ */ t(y, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(ke, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => j() }) }) : null;
1216
+ return u ? /* @__PURE__ */ t(w, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(ke, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => j() }) }) : null;
1211
1217
  }
1212
1218
  }
1213
- function pr({ placeholder: e = "Type to search...", ...r }) {
1214
- const { search: o } = R(), { filters: n, handleKeyword: l } = o, [a, s] = E(n.keyword || ""), i = De(l, { wait: 300 }), m = (f) => {
1215
- const { value: u } = f.target;
1216
- s(u), i.run(u);
1217
- }, d = () => {
1218
- s(""), l("");
1219
+ function mr({ placeholder: e, ...r }) {
1220
+ const { search: o, t: n } = R(), { filters: l, handleKeyword: a } = o, [s, i] = E(l.keyword || ""), m = De(a, { wait: 300 }), d = (g) => {
1221
+ const { value: y } = g.target;
1222
+ i(y), m.run(y);
1223
+ }, f = () => {
1224
+ i(""), a("");
1219
1225
  };
1220
- return G(() => {
1221
- s(n.keyword || "");
1222
- }, [n.keyword]), /* @__PURE__ */ t(
1223
- mr,
1226
+ G(() => {
1227
+ i(l.keyword || "");
1228
+ }, [l.keyword]);
1229
+ const u = e || n("common.searchPlaceholder");
1230
+ return /* @__PURE__ */ t(
1231
+ fr,
1224
1232
  {
1225
1233
  inputProps: {
1226
1234
  "data-cy": "search-blocklet"
1227
1235
  },
1228
- startAdornment: /* @__PURE__ */ t(Ae, { position: "start", children: /* @__PURE__ */ t(fr, { sx: { fontSize: 18, ml: -0.5 } }) }),
1229
- onChange: m,
1230
- placeholder: e,
1231
- value: a,
1232
- title: e,
1236
+ startAdornment: /* @__PURE__ */ t(Ae, { position: "start", children: /* @__PURE__ */ t(gr, { sx: { fontSize: 18, ml: -0.5 } }) }),
1237
+ onChange: d,
1238
+ placeholder: u,
1239
+ value: s,
1240
+ title: u,
1233
1241
  "data-cy": "search",
1234
- endAdornment: a && /* @__PURE__ */ t(Ae, { position: "end", children: /* @__PURE__ */ t(gr, { "data-cy": "search-delete", onClick: d }) }),
1242
+ endAdornment: s && /* @__PURE__ */ t(Ae, { position: "end", children: /* @__PURE__ */ t(xr, { "data-cy": "search-delete", onClick: f }) }),
1235
1243
  ...r
1236
1244
  }
1237
1245
  );
1238
1246
  }
1239
- const mr = Q(Ue)`
1247
+ const fr = Q(Ue)`
1240
1248
  background-color: ${(e) => e.theme.palette.grey[50]};
1241
1249
  font-size: 14px;
1242
1250
  border-radius: 6px;
@@ -1253,14 +1261,14 @@ const mr = Q(Ue)`
1253
1261
  color: transparent;
1254
1262
  }
1255
1263
  }
1256
- `, fr = Q(te)`
1264
+ `, gr = Q(te)`
1257
1265
  color: ${(e) => e.theme.palette.grey[500]};
1258
- `, gr = Q(ke)`
1266
+ `, xr = Q(ke)`
1259
1267
  color: ${(e) => e.theme.palette.grey[500]};
1260
1268
  font-size: 16px;
1261
1269
  cursor: pointer;
1262
1270
  `;
1263
- function xr() {
1271
+ function yr() {
1264
1272
  var b;
1265
1273
  const {
1266
1274
  search: e,
@@ -1274,9 +1282,9 @@ function xr() {
1274
1282
  baseSearch: m,
1275
1283
  categoryOptions: d,
1276
1284
  compact: f
1277
- } = R(), { filters: u, handleSort: x, handlePrice: w, handleDeveloper: I, handleSwitchShowResources: g, cleanFilter: B, handleCategory: p } = e, C = Ge(r);
1285
+ } = R(), { filters: u, handleSort: g, handlePrice: y, handleDeveloper: I, handleSwitchShowResources: x, cleanFilter: B, handleCategory: p } = e, C = Ge(r);
1278
1286
  return /* @__PURE__ */ h(
1279
- F,
1287
+ O,
1280
1288
  {
1281
1289
  position: "sticky",
1282
1290
  top: 0,
@@ -1294,7 +1302,7 @@ function xr() {
1294
1302
  children: [
1295
1303
  !f && /* @__PURE__ */ t(v, { variant: "h2", textTransform: "capitalize", children: l(u.category) }),
1296
1304
  /* @__PURE__ */ h(
1297
- F,
1305
+ O,
1298
1306
  {
1299
1307
  flex: 1,
1300
1308
  direction: "row",
@@ -1304,8 +1312,8 @@ function xr() {
1304
1312
  justifyContent: { xs: "flex-start", md: "flex-end" },
1305
1313
  gap: 2,
1306
1314
  children: [
1307
- i.showSearch ? /* @__PURE__ */ t(y, { flex: 1, flexBasis: { xs: "100%", md: "auto" }, children: m ? /* @__PURE__ */ t(pr, {}) : /* @__PURE__ */ t(
1308
- hr,
1315
+ i.showSearch ? /* @__PURE__ */ t(w, { flex: 1, flexBasis: { xs: "100%", md: "auto" }, children: m ? /* @__PURE__ */ t(mr, {}) : /* @__PURE__ */ t(
1316
+ pr,
1309
1317
  {
1310
1318
  locale: n,
1311
1319
  endpoint: o,
@@ -1322,7 +1330,7 @@ function xr() {
1322
1330
  }
1323
1331
  ) }) : null,
1324
1332
  u.owner && a && /* @__PURE__ */ t(
1325
- Pe,
1333
+ Te,
1326
1334
  {
1327
1335
  label: r("blocklet.authorTag", { name: a }),
1328
1336
  size: "small",
@@ -1330,7 +1338,7 @@ function xr() {
1330
1338
  }
1331
1339
  ),
1332
1340
  u.resourceDid && u.resourceBlocklet && /* @__PURE__ */ t(
1333
- Pe,
1341
+ Te,
1334
1342
  {
1335
1343
  label: r("blocklet.resourceTag", { name: u.resourceBlocklet }),
1336
1344
  size: "small",
@@ -1338,22 +1346,22 @@ function xr() {
1338
1346
  }
1339
1347
  ),
1340
1348
  s ? /* @__PURE__ */ t(
1341
- Le,
1349
+ Fe,
1342
1350
  {
1343
1351
  checked: u.showResources !== "false",
1344
- onChange: (k) => g(k ? "true" : "false"),
1352
+ onChange: (k) => x(k ? "true" : "false"),
1345
1353
  label: r("common.showResources")
1346
1354
  }
1347
1355
  ) : null,
1348
1356
  /* @__PURE__ */ t(
1349
- Le,
1357
+ Fe,
1350
1358
  {
1351
1359
  checked: u.price === "free",
1352
- onChange: (k) => w(k ? "free" : ""),
1360
+ onChange: (k) => y(k ? "free" : ""),
1353
1361
  label: r("blocklet.free")
1354
1362
  }
1355
1363
  ),
1356
- f && /* @__PURE__ */ t(y, { children: /* @__PURE__ */ t(
1364
+ f && /* @__PURE__ */ t(w, { children: /* @__PURE__ */ t(
1357
1365
  xe,
1358
1366
  {
1359
1367
  value: u.category || ((b = d[0]) == null ? void 0 : b.value),
@@ -1368,7 +1376,7 @@ function xr() {
1368
1376
  value: u.sortBy || C[0].value,
1369
1377
  options: C,
1370
1378
  placeholder: r("sort.sort"),
1371
- onChange: (k) => x(k)
1379
+ onChange: (k) => g(k)
1372
1380
  }
1373
1381
  )
1374
1382
  ]
@@ -1378,7 +1386,7 @@ function xr() {
1378
1386
  }
1379
1387
  );
1380
1388
  }
1381
- function Le({
1389
+ function Fe({
1382
1390
  checked: e,
1383
1391
  onChange: r,
1384
1392
  label: o
@@ -1404,18 +1412,18 @@ function Le({
1404
1412
  );
1405
1413
  }
1406
1414
  function ee({ children: e }) {
1407
- return /* @__PURE__ */ h(y, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.lighter", children: [
1415
+ return /* @__PURE__ */ h(w, { display: "flex", mt: 2, flexDirection: "column", alignItems: "center", justifyContent: "center", color: "text.lighter", children: [
1408
1416
  /* @__PURE__ */ t(Mt, {}),
1409
1417
  e
1410
1418
  ] });
1411
1419
  }
1412
- function Oe() {
1420
+ function Le() {
1413
1421
  const { t: e } = R();
1414
1422
  return /* @__PURE__ */ t(v, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
1415
1423
  }
1416
1424
  function me({ filterTip: e, keywordTip: r }) {
1417
1425
  const { t: o, locale: n } = R(), l = () => n === "zh" ? "、" : " , ";
1418
- return /* @__PURE__ */ h(y, { mt: 1, display: "flex", children: [
1426
+ return /* @__PURE__ */ h(w, { mt: 1, display: "flex", children: [
1419
1427
  /* @__PURE__ */ t(v, { style: { marginRight: "16px" }, children: o("blocklet.emptyTip") }),
1420
1428
  e && /* @__PURE__ */ t(v, { children: o("blocklet.filterTip") }),
1421
1429
  e && r && l(),
@@ -1429,14 +1437,22 @@ function fe({
1429
1437
  }) {
1430
1438
  return /* @__PURE__ */ h(v, { variant: "subtitle2", display: "flex", gap: 0.5, mx: 0.5, children: [
1431
1439
  /* @__PURE__ */ t(v, { children: e }),
1432
- /* @__PURE__ */ t(v, { color: "primary", children: o }),
1440
+ /* @__PURE__ */ t(
1441
+ v,
1442
+ {
1443
+ title: o,
1444
+ color: "primary",
1445
+ sx: { maxWidth: "30vw", overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
1446
+ children: o
1447
+ }
1448
+ ),
1433
1449
  /* @__PURE__ */ h(v, { children: [
1434
1450
  r,
1435
1451
  " "
1436
1452
  ] })
1437
1453
  ] });
1438
1454
  }
1439
- function yr() {
1455
+ function wr() {
1440
1456
  const { t: e, search: r, getCategoryLocale: o, selectedCategory: n } = R(), { filters: l } = r, a = !!n || !!l.price;
1441
1457
  if (l.keyword && a)
1442
1458
  return /* @__PURE__ */ h(ee, { children: [
@@ -1472,24 +1488,24 @@ function yr() {
1472
1488
  primaryEnd: e("blocklet.noCategoryResults2"),
1473
1489
  filter: s
1474
1490
  }
1475
- ) : /* @__PURE__ */ t(Oe, {}),
1491
+ ) : /* @__PURE__ */ t(Le, {}),
1476
1492
  /* @__PURE__ */ t(me, { filterTip: !0 })
1477
1493
  ] });
1478
1494
  }
1479
- return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(Oe, {}) });
1495
+ return /* @__PURE__ */ t(ee, { children: /* @__PURE__ */ t(Le, {}) });
1480
1496
  }
1481
- const wr = (e, r, o, n) => dt(
1497
+ const br = (e, r, o, n) => dt(
1482
1498
  async (l) => {
1483
1499
  l || (o.currentPage = o.defaultCurrentPage);
1484
1500
  const { currentPage: a, pageSize: s } = o, i = {
1485
1501
  ...r,
1486
1502
  category: r.category === "All" ? "" : r.category,
1487
- sortBy: P[r.sortBy],
1503
+ sortBy: T[r.sortBy],
1488
1504
  page: a,
1489
1505
  pageSize: s
1490
1506
  };
1491
1507
  n(null);
1492
- const { data: m = {} } = await e.get(P.blockletsPath, { params: i });
1508
+ const { data: m = {} } = await e.get(T.blockletsPath, { params: i });
1493
1509
  return o.currentPage++, { page: a, pageSize: s, list: (m == null ? void 0 : m.dataList) || [], total: (m == null ? void 0 : m.total) || 0 };
1494
1510
  },
1495
1511
  {
@@ -1498,22 +1514,22 @@ const wr = (e, r, o, n) => dt(
1498
1514
  onError: n
1499
1515
  }
1500
1516
  );
1501
- function br() {
1517
+ function kr() {
1502
1518
  var u;
1503
1519
  const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: l } = R(), { filters: a } = r, s = ut({
1504
- currentPage: P.currentPage,
1505
- pageSize: Kt() ? P.mobilePageSize : P.pageSize,
1506
- defaultCurrentPage: P.defaultCurrentPage
1507
- }), [i, m] = E(null), d = wr(e, a, s, m), f = V(
1520
+ currentPage: T.currentPage,
1521
+ pageSize: Xt() ? T.mobilePageSize : T.pageSize,
1522
+ defaultCurrentPage: T.defaultCurrentPage
1523
+ }), [i, m] = E(null), d = br(e, a, s, m), f = V(
1508
1524
  () => {
1509
- var x, w;
1510
- return o ? o(((x = d.data) == null ? void 0 : x.list) || []) : ((w = d.data) == null ? void 0 : w.list) || [];
1525
+ var g, y;
1526
+ return o ? o(((g = d.data) == null ? void 0 : g.list) || []) : ((y = d.data) == null ? void 0 : y.list) || [];
1511
1527
  },
1512
1528
  [d.data, o]
1513
1529
  );
1514
1530
  return G(() => {
1515
- const x = f.find((w) => w.owner.did === a.owner);
1516
- l((x == null ? void 0 : x.owner.fullName) || (x == null ? void 0 : x.author.name) || "");
1531
+ const g = f.find((y) => y.owner.did === a.owner);
1532
+ l((g == null ? void 0 : g.owner.fullName) || (g == null ? void 0 : g.author.name) || "");
1517
1533
  }, [a.owner, f, l]), {
1518
1534
  blocklets: f,
1519
1535
  fetchBlockletsError: i,
@@ -1530,28 +1546,28 @@ function br() {
1530
1546
  }
1531
1547
  };
1532
1548
  }
1533
- function kr() {
1534
- const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: l, minItemWidth: a, layout: s, baseSearch: i, compact: m } = R(), { filters: d } = r, { blocklets: f, errors: u, loadMore: x, loadings: w, hasNextPage: I, total: g } = br(), [B] = Pt({
1535
- loading: w.fetchBlockletsLoading || w.loadingMore,
1549
+ function vr() {
1550
+ const { t: e, search: r, endpoint: o, blockletRender: n, serverVersion: l, minItemWidth: a, layout: s, baseSearch: i, compact: m } = R(), { filters: d } = r, { blocklets: f, errors: u, loadMore: g, loadings: y, hasNextPage: I, total: x } = kr(), [B] = Tt({
1551
+ loading: y.fetchBlockletsLoading || y.loadingMore,
1536
1552
  hasNextPage: I,
1537
- onLoadMore: x
1553
+ onLoadMore: g
1538
1554
  });
1539
1555
  if (u.fetchBlockletsError) {
1540
- const k = new Error(`Failed to fetch blocklets from ${o}: ${u.fetchBlockletsError.message}`);
1556
+ const k = new Error(`Failed to fetch blocklets from ${o}: ${qt(u.fetchBlockletsError)}`);
1541
1557
  return /* @__PURE__ */ t(be, { error: k });
1542
1558
  }
1543
1559
  const p = i && s.showSearch || !d.keyword;
1544
1560
  return /* @__PURE__ */ h(M, { children: [
1545
- p ? /* @__PURE__ */ t(xr, {}) : /* @__PURE__ */ h(M, { children: [
1561
+ p ? /* @__PURE__ */ t(yr, {}) : /* @__PURE__ */ h(M, { children: [
1546
1562
  /* @__PURE__ */ t(Se, { xs: /* @__PURE__ */ t(Ze, {}), md: null }),
1547
1563
  b()
1548
1564
  ] }),
1549
1565
  C(),
1550
- !w.fetchBlockletsLoading && I && /* @__PURE__ */ t(y, { height: 70, minHeight: 70, display: "flex", justifyContent: "center", py: 2, overflow: "hidden", ref: B, children: /* @__PURE__ */ t(le, {}) })
1566
+ !y.fetchBlockletsLoading && I && /* @__PURE__ */ t(w, { height: 70, minHeight: 70, display: "flex", justifyContent: "center", py: 2, overflow: "hidden", ref: B, children: /* @__PURE__ */ t(le, {}) })
1551
1567
  ] });
1552
1568
  function C() {
1553
- return w.fetchBlockletsLoading ? /* @__PURE__ */ t(Je, { mt: 15 }) : f.length ? /* @__PURE__ */ t(
1554
- y,
1569
+ return y.fetchBlockletsLoading ? /* @__PURE__ */ t(Je, { mt: 15 }) : f.length ? /* @__PURE__ */ t(
1570
+ w,
1555
1571
  {
1556
1572
  className: "blocklet-list",
1557
1573
  display: "grid",
@@ -1563,7 +1579,7 @@ function kr() {
1563
1579
  rowGap: 2,
1564
1580
  columnGap: m ? 0 : 2,
1565
1581
  children: f.map((k) => /* @__PURE__ */ t(
1566
- y,
1582
+ w,
1567
1583
  {
1568
1584
  "data-blocklet-did": k.did,
1569
1585
  minWidth: {
@@ -1576,11 +1592,11 @@ function kr() {
1576
1592
  k.did
1577
1593
  ))
1578
1594
  }
1579
- ) : /* @__PURE__ */ t(yr, {});
1595
+ ) : /* @__PURE__ */ t(wr, {});
1580
1596
  }
1581
1597
  function b() {
1582
1598
  return /* @__PURE__ */ h(
1583
- F,
1599
+ O,
1584
1600
  {
1585
1601
  direction: "row",
1586
1602
  className: "search-result-title",
@@ -1589,14 +1605,23 @@ function kr() {
1589
1605
  mb: 2,
1590
1606
  mt: { xs: 2, md: 0 },
1591
1607
  children: [
1592
- /* @__PURE__ */ t(v, { variant: "h3", children: e("blocklet.search", { keyword: d.keyword }) }),
1593
- /* @__PURE__ */ t(v, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count: g }) })
1608
+ /* @__PURE__ */ t(
1609
+ v,
1610
+ {
1611
+ variant: "h3",
1612
+ title: d.keyword,
1613
+ maxWidth: "50vw",
1614
+ sx: { overflow: "hidden", textOverflow: "ellipsis", whiteSpace: "nowrap" },
1615
+ children: e("blocklet.search", { keyword: d.keyword })
1616
+ }
1617
+ ),
1618
+ /* @__PURE__ */ t(v, { variant: "body1", color: "text.lighter", fontSize: 13, children: e("blocklet.resultCount", { count: x }) })
1594
1619
  ]
1595
1620
  }
1596
1621
  );
1597
1622
  }
1598
1623
  }
1599
- function vr() {
1624
+ function Cr() {
1600
1625
  const { t: e, selectedCategory: r, getCategoryLocale: o } = R(), { toggleOpen: n } = Ce();
1601
1626
  return /* @__PURE__ */ h(
1602
1627
  v,
@@ -1614,13 +1639,13 @@ function vr() {
1614
1639
  }
1615
1640
  );
1616
1641
  }
1617
- function Cr({ menus: e, children: r }) {
1642
+ function Sr({ menus: e, children: r }) {
1618
1643
  var d;
1619
1644
  const { search: o, layout: n, compact: l } = R(), { filters: a } = o, s = re(null), i = a.category || a.keyword || a.price, m = (d = e == null ? void 0 : e.find((f) => f.key === a.menu)) == null ? void 0 : d.key;
1620
1645
  return /* @__PURE__ */ t($t, { children: /* @__PURE__ */ h(st, { FallbackComponent: be, children: [
1621
- !l && /* @__PURE__ */ t(vr, {}),
1646
+ !l && /* @__PURE__ */ t(Cr, {}),
1622
1647
  /* @__PURE__ */ h(
1623
- y,
1648
+ w,
1624
1649
  {
1625
1650
  ref: s,
1626
1651
  display: "flex",
@@ -1628,9 +1653,9 @@ function Cr({ menus: e, children: r }) {
1628
1653
  className: "list-container",
1629
1654
  pt: { xs: 0, md: l ? 0 : 5 },
1630
1655
  children: [
1631
- /* @__PURE__ */ t(nr, { menus: e }),
1656
+ /* @__PURE__ */ t(ir, { menus: e }),
1632
1657
  /* @__PURE__ */ h(
1633
- F,
1658
+ O,
1634
1659
  {
1635
1660
  height: "100%",
1636
1661
  position: "relative",
@@ -1643,7 +1668,7 @@ function Cr({ menus: e, children: r }) {
1643
1668
  } : { overflow: "visible" },
1644
1669
  children: [
1645
1670
  m && (r == null ? void 0 : r(m)),
1646
- !m && (n.showExplore && !i ? /* @__PURE__ */ t(ur, {}) : /* @__PURE__ */ t(kr, {}))
1671
+ !m && (n.showExplore && !i ? /* @__PURE__ */ t(hr, {}) : /* @__PURE__ */ t(vr, {}))
1647
1672
  ]
1648
1673
  }
1649
1674
  )
@@ -1652,27 +1677,27 @@ function Cr({ menus: e, children: r }) {
1652
1677
  )
1653
1678
  ] }) });
1654
1679
  }
1655
- function Eo(e) {
1680
+ function Oo(e) {
1656
1681
  return /* @__PURE__ */ h(Nt, { variant: "outlined", ...e, sx: { maxWidth: 400, borderRadius: "8px", p: { xs: 2, md: 3 }, ...e.sx }, children: [
1657
1682
  /* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 2, pb: 1, children: [
1658
1683
  /* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 2, flex: 1, children: [
1659
- /* @__PURE__ */ t(L, { variant: "rounded", width: 48, height: 48 }),
1660
- /* @__PURE__ */ t(L, { variant: "text", width: 60, height: 28 })
1684
+ /* @__PURE__ */ t(F, { variant: "rounded", width: 48, height: 48 }),
1685
+ /* @__PURE__ */ t(F, { variant: "text", width: 60, height: 28 })
1661
1686
  ] }),
1662
- /* @__PURE__ */ t(L, { variant: "text", width: 70, height: 40 })
1687
+ /* @__PURE__ */ t(F, { variant: "text", width: 70, height: 40 })
1663
1688
  ] }),
1664
- /* @__PURE__ */ t(L, { variant: "text", width: "100%", height: 24 }),
1665
- /* @__PURE__ */ t(L, { variant: "text", width: "90%", height: 24 }),
1689
+ /* @__PURE__ */ t(F, { variant: "text", width: "100%", height: 24 }),
1690
+ /* @__PURE__ */ t(F, { variant: "text", width: "90%", height: 24 }),
1666
1691
  /* @__PURE__ */ h(ce, { display: "flex", alignItems: "center", gap: 1, pt: 1.5, children: [
1667
- /* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24 }),
1668
- /* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 }),
1669
- /* @__PURE__ */ t(L, { variant: "rounded", width: 24, height: 24, sx: { ml: 1 } }),
1670
- /* @__PURE__ */ t(L, { variant: "text", width: "15%", height: 20 })
1692
+ /* @__PURE__ */ t(F, { variant: "rounded", width: 24, height: 24 }),
1693
+ /* @__PURE__ */ t(F, { variant: "text", width: "15%", height: 20 }),
1694
+ /* @__PURE__ */ t(F, { variant: "rounded", width: 24, height: 24, sx: { ml: 1 } }),
1695
+ /* @__PURE__ */ t(F, { variant: "text", width: "15%", height: 20 })
1671
1696
  ] })
1672
1697
  ] });
1673
1698
  }
1674
1699
  function Fo({ showSkeleton: e, ...r }) {
1675
- return e ? /* @__PURE__ */ t(O, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(Wt, { ...r });
1700
+ return e ? /* @__PURE__ */ t(L, { variant: "rectangular", width: r.width, height: r.height }) : /* @__PURE__ */ t(Wt, { ...r });
1676
1701
  }
1677
1702
  function Lo(e) {
1678
1703
  const { menus: r, children: o, ...n } = e, l = we(), a = et(
@@ -1704,11 +1729,11 @@ function Lo(e) {
1704
1729
  }
1705
1730
  })
1706
1731
  );
1707
- return /* @__PURE__ */ t(tt, { theme: a, children: /* @__PURE__ */ t(Jt, { ...n, children: /* @__PURE__ */ t(Cr, { menus: r, children: o }) }) });
1732
+ return /* @__PURE__ */ t(tt, { theme: a, children: /* @__PURE__ */ t(er, { ...n, children: /* @__PURE__ */ t(Sr, { menus: r, children: o }) }) });
1708
1733
  }
1709
1734
  export {
1710
- hr as Autocomplete,
1711
- Eo as CardSkeleton,
1735
+ pr as Autocomplete,
1736
+ Oo as CardSkeleton,
1712
1737
  Fo as Image,
1713
1738
  Lo as default,
1714
1739
  Ht as useSearch
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/list",
3
- "version": "0.16.38",
3
+ "version": "0.16.40",
4
4
  "description": "Common ux components of blocklet",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -52,8 +52,8 @@
52
52
  "react-dom": ">=18.2.0"
53
53
  },
54
54
  "dependencies": {
55
- "@blocklet/js-sdk": "^1.16.41",
56
- "@blocklet/util": "0.16.38",
55
+ "@blocklet/js-sdk": "^1.16.42-beta-20250409-161010-b0a88c5c",
56
+ "@blocklet/util": "0.16.40",
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": "ce784e7b9f5609af000976cb0df98a50d73b588b"
94
+ "gitHead": "3d69f26ee1e72f584704e34100922d24b207f5e5"
95
95
  }