@blocklet/list 0.14.26 → 0.14.28

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 +24 -23
  2. package/package.json +3 -3
package/lib/index.es.js CHANGED
@@ -46,7 +46,7 @@ import Bt from "react-image-gallery";
46
46
  import "react-image-gallery/styles/css/image-gallery.css";
47
47
  import Be from "@mui/material/Grid";
48
48
  import Rt from "react-infinite-scroll-hook";
49
- import Tt from "@iconify-icons/tabler/square-check";
49
+ import Tt from "@iconify-icons/tabler/square";
50
50
  import Pt from "@iconify-icons/tabler/square-check-filled";
51
51
  import Re from "@mui/material/Chip";
52
52
  import J from "@mui/icons-material/Search";
@@ -97,7 +97,7 @@ const T = {
97
97
  { manual: !0 }
98
98
  );
99
99
  function $t(e, r) {
100
- const o = { sortBy: "popularity", sortDirection: "desc", ...e }, {
100
+ const o = { sortBy: "popularity", sortDirection: "desc", showResources: "true", ...e }, {
101
101
  onFilterChange: n,
102
102
  onSearchSelect: l = (i) => {
103
103
  r.onFilterChange({ ...o, keyword: i.title });
@@ -172,11 +172,11 @@ const jt = (e, r, o) => e && r || !o, Ue = (e) => [
172
172
  ], Ut = (e = [], r = "en") => e.map((o) => ({ name: o.locales[r] || o.locales.en, value: o._id })), Vt = (e, r) => (
173
173
  // eslint-disable-next-line no-prototype-builtins
174
174
  e == null ? void 0 : e.replace(/{(\w*)}/g, (o, n) => r.hasOwnProperty(n) ? r[n] : "")
175
- ), Gt = () => window.innerWidth <= 600, qt = {
175
+ ), qt = () => window.innerWidth <= 600, Gt = {
176
176
  common: {
177
177
  title: "Blocklet Store",
178
178
  searchStore: "Search Blocklet",
179
- showResources: "Show resources",
179
+ showResources: "Show extensions",
180
180
  price: "Price",
181
181
  category: "Category",
182
182
  categories: "Categories",
@@ -227,7 +227,7 @@ const jt = (e, r, o) => e && r || !o, Ue = (e) => [
227
227
  common: {
228
228
  title: "Blocklet 商店",
229
229
  searchStore: "搜索 Blocklet",
230
- showResources: "显示资源型应用",
230
+ showResources: "显示扩展",
231
231
  price: "价格",
232
232
  category: "类别",
233
233
  categories: "类别",
@@ -275,15 +275,15 @@ const jt = (e, r, o) => e && r || !o, Ue = (e) => [
275
275
  expandResult: "查看 “{name}” 的所有搜索结果"
276
276
  }
277
277
  }, se = {
278
- en: Ie(qt),
278
+ en: Ie(Gt),
279
279
  zh: Ie(Kt)
280
- }, Ge = (e, r) => {
280
+ }, qe = (e, r) => {
281
281
  const o = {};
282
282
  return e && (o["x-blocklet-server-version"] = e), r && (o["x-blocklet-store-version"] = r), o;
283
283
  }, Xt = (e) => (r, o) => {
284
284
  const n = se[e] ? se[e][r] : se.en[r];
285
285
  return Vt(n, o) || r;
286
- }, qe = {
286
+ }, Ge = {
287
287
  errors: {
288
288
  fetchCategoriesError: null
289
289
  },
@@ -335,7 +335,7 @@ const jt = (e, r, o) => e && r || !o, Ue = (e) => [
335
335
  handlePage: () => {
336
336
  }
337
337
  }
338
- }, Ke = Le(qe), { Provider: Qt, Consumer: Fo } = Ke;
338
+ }, Ke = Le(Ge), { Provider: Qt, Consumer: Fo } = Ke;
339
339
  function Yt(e) {
340
340
  const {
341
341
  locale: r = "zh",
@@ -359,15 +359,15 @@ function Yt(e) {
359
359
  },
360
360
  endpoint: C,
361
361
  blockletRender: x
362
- } = e, E = Ge(n, v), F = H(() => _e({ baseURL: C, headers: E }), [C]), L = $t(o, { onFilterChange: l, emptyCategory: !i.showExplore, onSearchSelect: u }), [N, V] = P(""), {
363
- data: G = [],
362
+ } = e, E = qe(n, v), F = H(() => _e({ baseURL: C, headers: E }), [C]), L = $t(o, { onFilterChange: l, emptyCategory: !i.showExplore, onSearchSelect: u }), [N, V] = P(""), {
363
+ data: q = [],
364
364
  error: ie,
365
365
  loading: X,
366
366
  run: Q
367
367
  } = Wt(F), $ = H(() => {
368
- const R = lt(G, [(W) => W.name], ["asc"]), z = R.findIndex((W) => W.name === "All" || W.locales.en === "All");
368
+ const R = lt(q, [(W) => W.name], ["asc"]), z = R.findIndex((W) => W.name === "All" || W.locales.en === "All");
369
369
  return z > -1 ? [{ ...R[z], _id: "All" }, ...R.slice(0, z), ...R.slice(z + 1)] : R;
370
- }, [G]), q = me(Xt(r), [r]), s = H(() => Ut($, r), [$, r]), b = Ht(q), D = {
370
+ }, [q]), G = me(Xt(r), [r]), s = H(() => Ut($, r), [$, r]), b = Ht(G), D = {
371
371
  search: L,
372
372
  errors: { fetchCategoriesError: ie },
373
373
  loadings: {
@@ -384,7 +384,7 @@ function Yt(e) {
384
384
  },
385
385
  minItemWidth: a,
386
386
  wrapChildren: m,
387
- t: q,
387
+ t: G,
388
388
  storeVersion: v,
389
389
  serverVersion: n,
390
390
  selectedCategory: L.filters.category || (i.showExplore ? "" : "All"),
@@ -401,7 +401,7 @@ function Yt(e) {
401
401
  onFilterChange: l,
402
402
  getCategoryLocale: (R) => {
403
403
  if (!R) return null;
404
- const z = G.find((W) => W._id === R || W.locales.en === "All");
404
+ const z = q.find((W) => W._id === R || W.locales.en === "All");
405
405
  return z ? z.locales[r] || z.locales.en : null;
406
406
  },
407
407
  get developerName() {
@@ -415,7 +415,7 @@ function Yt(e) {
415
415
  }
416
416
  function I() {
417
417
  const e = Oe(Ke);
418
- return e || qe;
418
+ return e || Ge;
419
419
  }
420
420
  function Xe({
421
421
  children: e,
@@ -698,7 +698,7 @@ function rr() {
698
698
  ] }) : null;
699
699
  }
700
700
  function Ce() {
701
- const { endpoint: e, serverVersion: r, storeVersion: o } = I(), n = Ge(r, o), l = H(() => _e({
701
+ const { endpoint: e, serverVersion: r, storeVersion: o } = I(), n = qe(r, o), l = H(() => _e({
702
702
  baseURL: e,
703
703
  headers: n
704
704
  }), [e]);
@@ -925,6 +925,7 @@ function ar({ url: e }) {
925
925
  display: r ? "none" : "block",
926
926
  component: "img",
927
927
  src: e,
928
+ alt: "",
928
929
  width: { xs: "100%", md: te },
929
930
  height: { xs: "auto", md: ge },
930
931
  borderRadius: 2,
@@ -1025,7 +1026,7 @@ function dr({
1025
1026
  value: p,
1026
1027
  onChange: (s) => V(s.target.value),
1027
1028
  startAdornment: $(k),
1028
- endAdornment: q()
1029
+ endAdornment: G()
1029
1030
  }
1030
1031
  ),
1031
1032
  /* @__PURE__ */ t(
@@ -1088,7 +1089,7 @@ function dr({
1088
1089
  className: "bl-autocomplete-input",
1089
1090
  value: p,
1090
1091
  startAdornment: $(d),
1091
- endAdornment: q()
1092
+ endAdornment: G()
1092
1093
  }
1093
1094
  }
1094
1095
  ),
@@ -1119,7 +1120,7 @@ function dr({
1119
1120
  function V(s) {
1120
1121
  u(!0), f(s), m.current = !1, F.run(s);
1121
1122
  }
1122
- function G() {
1123
+ function q() {
1123
1124
  S(!1), f(""), V(""), l("");
1124
1125
  }
1125
1126
  function ie(s) {
@@ -1165,8 +1166,8 @@ function dr({
1165
1166
  function $(s = !0) {
1166
1167
  return /* @__PURE__ */ t(y, { sx: { display: "flex", pl: 0.5, alignItems: "center", color: "text.lighter" }, children: s && p && v ? /* @__PURE__ */ t(ne, { color: "inherit", size: 16 }) : /* @__PURE__ */ t(J, { sx: { fontSize: 16, cursor: "default" } }) });
1167
1168
  }
1168
- function q() {
1169
- return p ? /* @__PURE__ */ t(y, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(we, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => G() }) }) : null;
1169
+ function G() {
1170
+ return p ? /* @__PURE__ */ t(y, { sx: { display: "flex", alignItems: "center", color: "text.lighter" }, children: /* @__PURE__ */ t(we, { sx: { fontSize: 20, cursor: "pointer" }, onClick: () => q() }) }) : null;
1170
1171
  }
1171
1172
  }
1172
1173
  function ur({ placeholder: e = "Type to search...", ...r }) {
@@ -1438,7 +1439,7 @@ function yr() {
1438
1439
  var p;
1439
1440
  const { storeApi: e, search: r, extraFilter: o, errors: n, updateDeveloperName: l } = I(), { filters: a } = r, c = st({
1440
1441
  currentPage: T.currentPage,
1441
- pageSize: Gt() ? T.mobilePageSize : T.pageSize,
1442
+ pageSize: qt() ? T.mobilePageSize : T.pageSize,
1442
1443
  defaultCurrentPage: T.defaultCurrentPage
1443
1444
  }), [i, m] = P(null), d = xr(e, a, c, m), g = H(
1444
1445
  () => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/list",
3
- "version": "0.14.26",
3
+ "version": "0.14.28",
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.33",
56
- "@blocklet/util": "0.14.26",
56
+ "@blocklet/util": "0.14.28",
57
57
  "@emotion/react": "^11.10.0",
58
58
  "@emotion/styled": "^11.10.0",
59
59
  "@iconify-icons/tabler": "^1.2.95",
@@ -90,5 +90,5 @@
90
90
  "prettier": "^3.3.2",
91
91
  "vite": "^5.4.10"
92
92
  },
93
- "gitHead": "17b2b2d4b22dc03a6bb10fef0b3160a7de9473c3"
93
+ "gitHead": "07a0abb38aee865d5f483f12919431e1b94eae07"
94
94
  }