@blocklet/list 0.16.56 → 0.16.57

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 +59 -47
  2. package/package.json +3 -3
package/lib/index.es.js CHANGED
@@ -373,9 +373,9 @@ function or(e) {
373
373
  baseSearch: f = !1,
374
374
  fetchCategoryDelay: u = 0,
375
375
  showResourcesSwitch: g = !1,
376
- showCategory: x = !0,
376
+ showCategory: y = !0,
377
377
  tagFilters: I = [],
378
- children: y,
378
+ children: x,
379
379
  storeVersion: R,
380
380
  onSearchSelect: p = () => {
381
381
  },
@@ -420,7 +420,7 @@ function or(e) {
420
420
  storeApi: D,
421
421
  baseSearch: f,
422
422
  showResourcesSwitch: g,
423
- showCategory: x,
423
+ showCategory: y,
424
424
  tagFilters: I,
425
425
  onFilterChange: l,
426
426
  getCategoryLocale: (T) => {
@@ -435,7 +435,7 @@ function or(e) {
435
435
  };
436
436
  return q(() => {
437
437
  setTimeout(Z, u || 0);
438
- }, [C, Z, u]), /* @__PURE__ */ t(rr, { value: W, children: y });
438
+ }, [C, Z, u]), /* @__PURE__ */ t(rr, { value: W, children: x });
439
439
  }
440
440
  function B() {
441
441
  const e = Me(Qe);
@@ -517,13 +517,13 @@ function ye({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
517
517
  }, [e]);
518
518
  const g = ge(() => {
519
519
  m(!1);
520
- }, []), x = ge(() => {
520
+ }, []), y = ge(() => {
521
521
  m(!0);
522
522
  }, []);
523
523
  function I(p) {
524
524
  f(p.value), o(p.value), u && g();
525
525
  }
526
- function y(p) {
526
+ function x(p) {
527
527
  return p === d;
528
528
  }
529
529
  return /* @__PURE__ */ h(F, { children: [
@@ -531,7 +531,7 @@ function ye({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
531
531
  lr,
532
532
  {
533
533
  ref: a,
534
- onClick: x,
534
+ onClick: y,
535
535
  variant: "outlined",
536
536
  size: "medium",
537
537
  className: ["my-select__selector", nt(d) ? "" : "my-select__selector--active"].join(" "),
@@ -548,11 +548,11 @@ function ye({ value: e, options: r, onChange: o, placeholder: n, ...l }) {
548
548
  {
549
549
  ...p,
550
550
  style: { transformOrigin: C === "bottom" ? "center top" : "center bottom" },
551
- children: /* @__PURE__ */ t(vt, { children: /* @__PURE__ */ t(bt, { onClickAway: g, children: /* @__PURE__ */ t(ar, { autoFocusItem: i, onMouseEnter: x, onMouseLeave: g, children: r.map((b) => /* @__PURE__ */ h($e, { onClick: () => I(b), sx: { fontSize: 14 }, children: [
551
+ children: /* @__PURE__ */ t(vt, { children: /* @__PURE__ */ t(bt, { onClickAway: g, children: /* @__PURE__ */ t(ar, { autoFocusItem: i, onMouseEnter: y, onMouseLeave: g, children: r.map((b) => /* @__PURE__ */ h($e, { onClick: () => I(b), sx: { fontSize: 14 }, children: [
552
552
  /* @__PURE__ */ t(
553
553
  xt,
554
554
  {
555
- sx: { mr: 1, fontSize: 16, visibility: y(b.value) ? "visible" : "hidden" }
555
+ sx: { mr: 1, fontSize: 16, visibility: x(b.value) ? "visible" : "hidden" }
556
556
  }
557
557
  ),
558
558
  b.name
@@ -646,9 +646,9 @@ function Ze() {
646
646
  );
647
647
  }
648
648
  function sr({ menus: e }) {
649
- 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 } = ve();
649
+ 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: y } = ve();
650
650
  q(() => {
651
- x(!1);
651
+ y(!1);
652
652
  }, [Object.values(d).join("")]);
653
653
  const I = qt(i, s.showSearch, d.keyword);
654
654
  return s.showCategory && !m ? /* @__PURE__ */ h(nr, { children: [
@@ -667,7 +667,7 @@ function sr({ menus: e }) {
667
667
  borderBottom: 1,
668
668
  borderColor: "divider",
669
669
  children: [
670
- /* @__PURE__ */ t(Ye, { onClick: () => x(!1), children: /* @__PURE__ */ t(ze, {}) }),
670
+ /* @__PURE__ */ t(Ye, { onClick: () => y(!1), children: /* @__PURE__ */ t(ze, {}) }),
671
671
  /* @__PURE__ */ t(v, { flex: 1, variant: "body1", fontWeight: "fontWeightMedium", children: n("common.category") })
672
672
  ]
673
673
  }
@@ -695,45 +695,45 @@ function sr({ menus: e }) {
695
695
  fontWeight: !r && !d.menu ? "fontWeightMedium" : void 0,
696
696
  sx: { cursor: "pointer" },
697
697
  onClick: () => {
698
- x(!1), g();
698
+ y(!1), g();
699
699
  },
700
700
  children: n("explore.title")
701
701
  }
702
702
  )
703
703
  ] }),
704
- e == null ? void 0 : e.map((y) => /* @__PURE__ */ h(w, { display: "flex", alignItems: "center", mt: 2, gap: 1, children: [
705
- typeof y.icon == "string" ? /* @__PURE__ */ t(M, { icon: y.icon, width: 20, height: 20 }) : y.icon,
704
+ e == null ? void 0 : e.map((x) => /* @__PURE__ */ h(w, { display: "flex", alignItems: "center", mt: 2, gap: 1, children: [
705
+ typeof x.icon == "string" ? /* @__PURE__ */ t(M, { icon: x.icon, width: 20, height: 20 }) : x.icon,
706
706
  /* @__PURE__ */ t(
707
707
  v,
708
708
  {
709
709
  variant: "body1",
710
- color: d.menu === y.key ? "text.primary" : "grey.400",
711
- fontWeight: d.menu === y.key ? "fontWeightMedium" : void 0,
710
+ color: d.menu === x.key ? "text.primary" : "grey.400",
711
+ fontWeight: d.menu === x.key ? "fontWeightMedium" : void 0,
712
712
  sx: { cursor: "pointer" },
713
713
  onClick: () => {
714
714
  var R;
715
- x(!1), f(y.key), (R = y.onClick) == null || R.call(y);
715
+ y(!1), f(x.key), (R = x.onClick) == null || R.call(x);
716
716
  },
717
- children: y.title
717
+ children: x.title
718
718
  }
719
719
  )
720
- ] }, y.key))
720
+ ] }, x.key))
721
721
  ] }),
722
- !!l.length && /* @__PURE__ */ t(O, { gap: 2, children: l.map((y) => /* @__PURE__ */ t(
722
+ !!l.length && /* @__PURE__ */ t(O, { gap: 2, children: l.map((x) => /* @__PURE__ */ t(
723
723
  v,
724
724
  {
725
725
  variant: "body1",
726
- title: y.name,
726
+ title: x.name,
727
727
  sx: { cursor: "pointer" },
728
728
  "data-cy": "filter",
729
- color: r === y.value ? "text.primary" : "grey.400",
729
+ color: r === x.value ? "text.primary" : "grey.400",
730
730
  textTransform: "capitalize",
731
731
  onClick: () => {
732
- r === y.value ? g() : u(y.value), x(!1);
732
+ r === x.value ? g() : u(x.value), y(!1);
733
733
  },
734
- children: y.name
734
+ children: x.name
735
735
  },
736
- y.value
736
+ x.value
737
737
  )) })
738
738
  ] }) : /* @__PURE__ */ t(Ze, {})
739
739
  }
@@ -781,8 +781,8 @@ function Ae({
781
781
  }
782
782
  const cr = 16 / 9, ue = 292, xe = 189, re = 336;
783
783
  function dr() {
784
- var y, R;
785
- const { t: e, search: r } = B(), { get: o } = Se(), n = we(), l = V(n.breakpoints.down("md")), a = ((R = (y = window.blocklet) == null ? void 0 : y.preferences) == null ? void 0 : R.homeBanner) || [], {
784
+ var x, R;
785
+ const { t: e, search: r } = B(), { get: o } = Se(), n = we(), l = V(n.breakpoints.down("md")), a = ((R = (x = window.blocklet) == null ? void 0 : x.preferences) == null ? void 0 : R.homeBanner) || [], {
786
786
  data: s = [],
787
787
  error: i,
788
788
  loading: m
@@ -878,7 +878,7 @@ function dr() {
878
878
  u(p.name || b.title || p.name),
879
879
  g(p.desc || b.description)
880
880
  ] }),
881
- b.did && x(b, p.baseNum),
881
+ b.did && y(b, p.baseNum),
882
882
  I(b)
883
883
  ] })
884
884
  ]
@@ -921,7 +921,7 @@ function dr() {
921
921
  }
922
922
  );
923
923
  }
924
- function x(p, C = 0) {
924
+ function y(p, C = 0) {
925
925
  const { did: b, owner: k, stats: A } = p;
926
926
  return /* @__PURE__ */ h(w, { display: "flex", alignItems: "center", gap: 2, color: "text.secondary", children: [
927
927
  /* @__PURE__ */ t(Ae, { icon: /* @__PURE__ */ t(He, { src: k.avatar, did: b, size: 20, variant: "circle" }), children: k.fullName }),
@@ -1016,9 +1016,9 @@ function gr({
1016
1016
  handleSearchSelect: a,
1017
1017
  ...s
1018
1018
  }) {
1019
- const i = te(null), m = te(!1), [d, f] = E(!1), [u, g] = E(""), [x, I] = E(!1), y = Se(), [R, p] = E(!1), C = (s == null ? void 0 : s.placeholder) || r("common.searchStore"), b = async (c) => {
1019
+ const i = te(null), m = te(!1), [d, f] = E(!1), [u, g] = E(""), [y, I] = E(!1), x = Se(), [R, p] = E(!1), C = (s == null ? void 0 : s.placeholder) || r("common.searchStore"), b = async (c) => {
1020
1020
  p(!0);
1021
- const S = await y.get(Ie(e, ke(P.blockletsPath, c)));
1021
+ const S = await x.get(Ie(e, ke(P.blockletsPath, c)));
1022
1022
  return p(!1), S.dataList || [];
1023
1023
  }, { data: k, run: A } = oe(
1024
1024
  (c) => c ? b({
@@ -1045,7 +1045,7 @@ function gr({
1045
1045
  const D = De((c) => A(c), { wait: 300 }), j = { name: he, title: u, did: "" };
1046
1046
  let N = [];
1047
1047
  return u && (R ? N = [j] : k != null && k.length ? N = [j, ...k] : N = [{ name: Ee, title: r("blocklet.noResults"), did: "" }]), /* @__PURE__ */ h(F, { children: [
1048
- /* @__PURE__ */ h(Mt, { fullScreen: !0, open: x, sx: { display: { md: "none" } }, children: [
1048
+ /* @__PURE__ */ h(Mt, { fullScreen: !0, open: y, sx: { display: { md: "none" } }, children: [
1049
1049
  /* @__PURE__ */ h(w, { p: 2, pb: 0, display: "flex", alignItems: "center", gap: 2, children: [
1050
1050
  /* @__PURE__ */ t(
1051
1051
  Ue,
@@ -1070,7 +1070,7 @@ function gr({
1070
1070
  className: "bl-autocomplete-input",
1071
1071
  value: u,
1072
1072
  onChange: (c) => K(c.target.value),
1073
- startAdornment: U(x),
1073
+ startAdornment: U(y),
1074
1074
  endAdornment: X()
1075
1075
  }
1076
1076
  ),
@@ -1221,8 +1221,8 @@ function gr({
1221
1221
  }
1222
1222
  function yr({ placeholder: e, ...r }) {
1223
1223
  const { search: o, t: n } = B(), { filters: l, handleKeyword: a } = o, [s, i] = E(l.keyword || ""), m = De(a, { wait: 300 }), d = (g) => {
1224
- const { value: x } = g.target;
1225
- i(x), m.run(x);
1224
+ const { value: y } = g.target;
1225
+ i(y), m.run(y);
1226
1226
  }, f = () => {
1227
1227
  i(""), a("");
1228
1228
  };
@@ -1285,7 +1285,7 @@ function kr() {
1285
1285
  baseSearch: m,
1286
1286
  categoryOptions: d,
1287
1287
  compact: f
1288
- } = B(), { filters: u, handleSort: g, handlePrice: x, handleDeveloper: I, handleSwitchShowResources: y, cleanFilter: R, handleCategory: p } = e, C = Ge(r);
1288
+ } = B(), { filters: u, handleSort: g, handlePrice: y, handleDeveloper: I, handleSwitchShowResources: x, cleanFilter: R, handleCategory: p } = e, C = Ge(r);
1289
1289
  return /* @__PURE__ */ h(
1290
1290
  O,
1291
1291
  {
@@ -1352,7 +1352,7 @@ function kr() {
1352
1352
  Oe,
1353
1353
  {
1354
1354
  checked: u.showResources !== "false",
1355
- onChange: (k) => y(k ? "true" : "false"),
1355
+ onChange: (k) => x(k ? "true" : "false"),
1356
1356
  label: r("common.showResources")
1357
1357
  }
1358
1358
  ) : null,
@@ -1360,7 +1360,7 @@ function kr() {
1360
1360
  Oe,
1361
1361
  {
1362
1362
  checked: u.price === "free",
1363
- onChange: (k) => x(k ? "free" : ""),
1363
+ onChange: (k) => y(k ? "free" : ""),
1364
1364
  label: r("blocklet.free")
1365
1365
  }
1366
1366
  ),
@@ -1526,13 +1526,13 @@ function Sr() {
1526
1526
  defaultCurrentPage: P.defaultCurrentPage
1527
1527
  }), [i, m] = E(null), d = Cr(e, a, s, m), f = G(
1528
1528
  () => {
1529
- var g, x;
1530
- return o ? o(((g = d.data) == null ? void 0 : g.list) || []) : ((x = d.data) == null ? void 0 : x.list) || [];
1529
+ var g, y;
1530
+ return o ? o(((g = d.data) == null ? void 0 : g.list) || []) : ((y = d.data) == null ? void 0 : y.list) || [];
1531
1531
  },
1532
1532
  [d.data, o]
1533
1533
  );
1534
1534
  return q(() => {
1535
- const g = f.find((x) => x.owner.did === a.owner);
1535
+ const g = f.find((y) => y.owner.did === a.owner);
1536
1536
  l((g == null ? void 0 : g.owner.fullName) || (g == null ? void 0 : g.author.name) || "");
1537
1537
  }, [a.owner, f, l]), {
1538
1538
  blocklets: f,
@@ -1551,8 +1551,8 @@ function Sr() {
1551
1551
  };
1552
1552
  }
1553
1553
  function Ir() {
1554
- 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 } = Sr(), [R] = Pt({
1555
- loading: x.fetchBlockletsLoading || x.loadingMore,
1554
+ 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: y, hasNextPage: I, total: x } = Sr(), [R] = Pt({
1555
+ loading: y.fetchBlockletsLoading || y.loadingMore,
1556
1556
  hasNextPage: I,
1557
1557
  onLoadMore: g
1558
1558
  });
@@ -1567,10 +1567,22 @@ function Ir() {
1567
1567
  b()
1568
1568
  ] }),
1569
1569
  C(),
1570
- !x.fetchBlockletsLoading && I && /* @__PURE__ */ t(w, { height: 70, minHeight: 70, display: "flex", justifyContent: "center", py: 2, overflow: "hidden", ref: R, children: /* @__PURE__ */ t(ie, {}) })
1570
+ !y.fetchBlockletsLoading && I && /* @__PURE__ */ t(
1571
+ w,
1572
+ {
1573
+ height: 70,
1574
+ minHeight: 70,
1575
+ display: "flex",
1576
+ justifyContent: "center",
1577
+ py: 2,
1578
+ overflow: "hidden",
1579
+ ref: R,
1580
+ children: y.loadingMore ? /* @__PURE__ */ t(ie, {}) : null
1581
+ }
1582
+ )
1571
1583
  ] });
1572
1584
  function C() {
1573
- return x.fetchBlockletsLoading ? /* @__PURE__ */ t(Je, { mt: 15 }) : f.length ? /* @__PURE__ */ t(
1585
+ return y.fetchBlockletsLoading ? /* @__PURE__ */ t(Je, { mt: 15 }) : f.length ? /* @__PURE__ */ t(
1574
1586
  w,
1575
1587
  {
1576
1588
  className: "blocklet-list",
@@ -1619,7 +1631,7 @@ function Ir() {
1619
1631
  children: e("blocklet.search", { keyword: d.keyword })
1620
1632
  }
1621
1633
  ),
1622
- /* @__PURE__ */ t(v, { variant: "body1", color: "text.hint", fontSize: 13, children: e("blocklet.resultCount", { count: y }) })
1634
+ /* @__PURE__ */ t(v, { variant: "body1", color: "text.hint", fontSize: 13, children: e("blocklet.resultCount", { count: x }) })
1623
1635
  ]
1624
1636
  }
1625
1637
  );
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/list",
3
- "version": "0.16.56",
3
+ "version": "0.16.57",
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.44",
56
- "@blocklet/util": "0.16.56",
56
+ "@blocklet/util": "0.16.57",
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": "cd958524b32ee15ed019478300ea166559105748"
94
+ "gitHead": "87ce608bbfd1cc965d6a98068c5d3c3080f7a6dc"
95
95
  }