@blocklet/list 0.13.26 → 0.13.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 +298 -294
  2. package/package.json +3 -3
package/lib/index.es.js CHANGED
@@ -1,12 +1,12 @@
1
- import { jsx as t, jsxs as f, Fragment as le } from "react/jsx-runtime";
2
- import { styled as T, useTheme as ae } from "@arcblock/ux/lib/Theme";
1
+ import { jsx as t, jsxs as h, Fragment as le } from "react/jsx-runtime";
2
+ import { styled as P, useTheme as ae } from "@arcblock/ux/lib/Theme";
3
3
  import { Global as xe, css as ke } from "@emotion/react";
4
4
  import _e from "@mui/icons-material/Sort";
5
- import { Button as Ne, CircularProgress as oe, MenuList as Le, useMediaQuery as Se, SvgIcon as Me, Popper as Oe, Grow as Fe, Paper as Ae, ClickAwayListener as Ee, MenuItem as qe, Chip as Ce, Box as D, Unstable_Grid2 as te, OutlinedInput as je, InputAdornment as ge, Typography as ve, Hidden as ye, Stack as Ue } from "@mui/material";
6
- import We from "@mui/icons-material/Face";
7
- import { ErrorBoundary as Ge } from "react-error-boundary";
5
+ import { Button as Ne, CircularProgress as oe, MenuList as Le, useMediaQuery as Se, SvgIcon as Me, Popper as Oe, Grow as Fe, Paper as Ae, ClickAwayListener as Ee, MenuItem as qe, Chip as Ce, Box as _, Unstable_Grid2 as te, OutlinedInput as je, InputAdornment as ge, Typography as ve, Hidden as ye, Stack as Ue } from "@mui/material";
6
+ import Ve from "@mui/icons-material/Face";
7
+ import { ErrorBoundary as We } from "react-error-boundary";
8
8
  import { ErrorFallback as Te } from "@arcblock/ux/lib/ErrorBoundary";
9
- import { createContext as Ke, useMemo as Q, useState as E, useCallback as ne, useEffect as j, useContext as He, forwardRef as Ve, useRef as J, createElement as Qe, Fragment as Je } from "react";
9
+ import { createContext as Ge, useMemo as Q, useState as E, useCallback as ne, useEffect as j, useContext as Ke, forwardRef as He, useRef as J, createElement as Qe, Fragment as Je } from "react";
10
10
  import { useReactive as Pe, useInfiniteScroll as Xe, useRequest as Ye, useSize as Ze, useDebounceFn as et, useMemoizedFn as tt, useCreation as rt, useMount as ot } from "ahooks";
11
11
  import { joinURL as nt, parseQuery as lt } from "ufo";
12
12
  import o from "prop-types";
@@ -157,6 +157,7 @@ const zt = It((e) => Promise.resolve(e), 300), Dt = {
157
157
  }),
158
158
  wrapChildren: o.func,
159
159
  extraFilter: o.func,
160
+ serverVersion: o.string,
160
161
  endpoint: o.string.isRequired,
161
162
  blockletRender: o.func.isRequired,
162
163
  onFilterChange: o.func,
@@ -171,6 +172,7 @@ const zt = It((e) => Promise.resolve(e), 300), Dt = {
171
172
  }, $e = {
172
173
  locale: "zh",
173
174
  filters: {},
175
+ serverVersion: "",
174
176
  onFilterChange: () => {
175
177
  },
176
178
  onSearchSelect: ({ detailUrl: e }) => {
@@ -183,7 +185,7 @@ const zt = It((e) => Promise.resolve(e), 300), Dt = {
183
185
  showResourcesSwitch: !1,
184
186
  showCategory: !0,
185
187
  tagFilters: []
186
- }, _ = {
188
+ }, N = {
187
189
  nameAsc: "title",
188
190
  nameDesc: "title",
189
191
  popularity: "stats.downloads",
@@ -195,7 +197,7 @@ const zt = It((e) => Promise.resolve(e), 300), Dt = {
195
197
  blockletsPath: "/api/v2/blocklets.json",
196
198
  categoriesPath: "/api/blocklets/categories",
197
199
  cacheSize: 100
198
- }, Ie = Ke({}), { Provider: Nt, Consumer: $r } = Ie;
200
+ }, Ie = Ge({}), { Provider: Nt, Consumer: $r } = Ie;
199
201
  function ie({
200
202
  filters: e,
201
203
  children: n,
@@ -203,161 +205,162 @@ function ie({
203
205
  locale: a,
204
206
  blockletRender: s,
205
207
  onFilterChange: c,
206
- onSearchSelect: x,
207
- extraFilter: y,
208
- wrapChildren: u,
209
- baseSearch: b,
210
- serverVersion: d,
211
- storeVersion: C,
212
- fetchCategoryDelay: v,
213
- showResourcesSwitch: S,
214
- showCategory: P,
215
- tagFilters: R
208
+ onSearchSelect: w,
209
+ extraFilter: g,
210
+ wrapChildren: m,
211
+ baseSearch: x,
212
+ serverVersion: u,
213
+ storeVersion: S,
214
+ fetchCategoryDelay: R,
215
+ showResourcesSwitch: T,
216
+ showCategory: B,
217
+ tagFilters: C
216
218
  }) {
217
- const i = {};
218
- d && (i["x-blocklet-server-version"] = d), C && (i["x-blocklet-store-version"] = C);
219
- const h = Q(() => it.create({
219
+ const y = {};
220
+ u && (y["x-blocklet-server-version"] = u), S && (y["x-blocklet-store-version"] = S);
221
+ const d = Q(() => it.create({
220
222
  baseURL: r,
221
- headers: i
222
- }), [r]), m = Q(() => ({
223
+ headers: y
224
+ }), [r]), i = Q(() => ({
223
225
  sortBy: "popularity",
224
226
  sortDirection: "desc",
225
227
  ...e
226
- }), [e]), k = m.category, $ = Pe({
227
- currentPage: _.currentPage,
228
- pageSize: Bt() ? _.mobilePageSize : _.pageSize,
229
- defaultCurrentPage: _.defaultCurrentPage
230
- }), [w, L] = E(null), I = Xe(
228
+ }), [e]), b = i.category, k = Pe({
229
+ currentPage: N.currentPage,
230
+ pageSize: Bt() ? N.mobilePageSize : N.pageSize,
231
+ defaultCurrentPage: N.defaultCurrentPage
232
+ }), [z, $] = E(null), v = Xe(
231
233
  async (l) => {
232
- l || ($.currentPage = $.defaultCurrentPage);
233
- const { currentPage: p, pageSize: B } = $, A = {
234
- ...m,
235
- sortBy: _[m.sortBy],
234
+ l || (k.currentPage = k.defaultCurrentPage);
235
+ const { currentPage: p, pageSize: I } = k, A = {
236
+ ...i,
237
+ sortBy: N[i.sortBy],
236
238
  page: p,
237
- pageSize: B
239
+ pageSize: I
238
240
  };
239
- L(null);
240
- const { data: z = {} } = await h.get(_.blockletsPath, {
241
+ $(null);
242
+ const { data: D = {} } = await d.get(N.blockletsPath, {
241
243
  params: A
242
244
  });
243
- return $.currentPage++, {
245
+ return k.currentPage++, {
244
246
  page: p,
245
- pageSize: B,
246
- list: (z == null ? void 0 : z.dataList) || [],
247
- total: (z == null ? void 0 : z.total) || 0
247
+ pageSize: I,
248
+ list: (D == null ? void 0 : D.dataList) || [],
249
+ total: (D == null ? void 0 : D.total) || 0
248
250
  };
249
251
  },
250
252
  {
251
253
  isNoMore: (l) => l ? l.page * l.pageSize >= l.total : !1,
252
254
  reloadDeps: [r, st(e)],
253
255
  onError: (l) => {
254
- L(l);
256
+ $(l);
255
257
  }
256
258
  }
257
259
  ), {
258
- data: W = [],
260
+ data: V = [],
259
261
  error: ee,
260
262
  loading: O,
261
- run: G
263
+ run: W
262
264
  } = Ye(
263
265
  async () => {
264
- const { data: l } = await h.get(_.categoriesPath);
266
+ const { data: l } = await d.get(N.categoriesPath);
265
267
  return Array.isArray(l) ? l : [];
266
268
  },
267
269
  { manual: !0 }
268
- ), F = Q(() => at(W || [], [(p) => p.name], ["asc"]), [W]), K = ne(
270
+ ), F = Q(() => at(V || [], [(p) => p.name], ["asc"]), [V]), G = ne(
269
271
  (l, p) => {
270
- const B = re[a] ? re[a][l] : re.en[l];
271
- return Rt(B, p);
272
+ const I = re[a] ? re[a][l] : re.en[l];
273
+ return Rt(I, p);
272
274
  },
273
275
  [a]
274
- ), H = Q(() => {
276
+ ), K = Q(() => {
275
277
  var p;
276
- let l = ((p = I.data) == null ? void 0 : p.list) || [];
277
- return l = y(l), l;
278
- }, [I.data, y]), g = Q(() => Pt(F, a), [F, a]), V = Tt(K), M = {
279
- errors: { fetchBlockletsError: w, fetchCategoriesError: ee },
278
+ let l = ((p = v.data) == null ? void 0 : p.list) || [];
279
+ return l = g(l), l;
280
+ }, [v.data, g]), f = Q(() => Pt(F, a), [F, a]), H = Tt(G), M = {
281
+ errors: { fetchBlockletsError: z, fetchCategoriesError: ee },
280
282
  loadings: {
281
- fetchBlockletsLoading: I.loading,
283
+ fetchBlockletsLoading: v.loading,
282
284
  fetchCategoriesLoading: O,
283
- loadingMore: I.loadingMore
285
+ loadingMore: v.loadingMore
284
286
  },
285
287
  endpoint: r,
286
- blockletList: H,
287
- wrapChildren: u,
288
- t: K,
289
- filters: m,
290
- selectedCategory: k,
288
+ blockletList: K,
289
+ wrapChildren: m,
290
+ t: G,
291
+ serverVersion: u,
292
+ filters: i,
293
+ selectedCategory: b,
291
294
  categoryList: F,
292
295
  blockletRender: s,
293
296
  locale: a,
294
- categoryOptions: g,
295
- priceOptions: V,
296
- storeApi: h,
297
- baseSearch: b,
298
- showResourcesSwitch: S,
299
- showCategory: P,
300
- tagFilters: R,
301
- hasNextPage: !I.noMore,
297
+ categoryOptions: f,
298
+ priceOptions: H,
299
+ storeApi: d,
300
+ baseSearch: x,
301
+ showResourcesSwitch: T,
302
+ showCategory: B,
303
+ tagFilters: C,
304
+ hasNextPage: !v.noMore,
302
305
  onFilterChange: c,
303
306
  handleSort: (l) => {
304
307
  const p = {
305
- ...m,
308
+ ...i,
306
309
  sortBy: l,
307
310
  sortDirection: l === "nameAsc" ? "asc" : "desc"
308
311
  };
309
312
  c(p);
310
313
  },
311
314
  handleKeyword: (l) => {
312
- const p = { ...m, keyword: l || void 0 };
315
+ const p = { ...i, keyword: l || void 0 };
313
316
  c(p);
314
317
  },
315
318
  handlePrice: (l) => {
316
319
  const p = {
317
- ...m,
318
- price: l === m.price ? void 0 : l
320
+ ...i,
321
+ price: l === i.price ? void 0 : l
319
322
  };
320
323
  c(p);
321
324
  },
322
325
  handleCategory: (l) => {
323
326
  let p = l;
324
- (l === "all" || l === m.category) && (p = void 0);
325
- const B = { ...m, category: p };
326
- c(B);
327
+ (l === "all" || l === i.category) && (p = void 0);
328
+ const I = { ...i, category: p };
329
+ c(I);
327
330
  },
328
331
  handleDeveloper: (l) => {
329
- const p = { ...m, owner: l || void 0 };
332
+ const p = { ...i, owner: l || void 0 };
330
333
  c(p);
331
334
  },
332
335
  handlePage: (l) => {
333
- const p = { ...m, currentPage: l };
336
+ const p = { ...i, currentPage: l };
334
337
  c(p);
335
338
  },
336
339
  handleSwitchShowResources: () => {
337
- const l = { ...m };
340
+ const l = { ...i };
338
341
  c(l);
339
342
  },
340
- loadMore: I.loadMore,
343
+ loadMore: v.loadMore,
341
344
  getCategoryLocale: (l) => {
342
345
  if (!l)
343
346
  return null;
344
347
  let p = null;
345
- const B = W.find((A) => A._id === l);
346
- return B && (p = B.locales[a]), p;
348
+ const I = V.find((A) => A._id === l);
349
+ return I && (p = I.locales[a]), p;
347
350
  },
348
351
  get developerName() {
349
- var p, B;
350
- return ((B = (p = H.find((A) => {
351
- var z;
352
- return ((z = A == null ? void 0 : A.owner) == null ? void 0 : z.did) === m.owner;
353
- })) == null ? void 0 : p.owner) == null ? void 0 : B.name) || "";
352
+ var p, I;
353
+ return ((I = (p = K.find((A) => {
354
+ var D;
355
+ return ((D = A == null ? void 0 : A.owner) == null ? void 0 : D.did) === i.owner;
356
+ })) == null ? void 0 : p.owner) == null ? void 0 : I.name) || "";
354
357
  },
355
- handleSearchSelect: x
358
+ handleSearchSelect: w
356
359
  };
357
360
  return j(() => {
358
361
  setTimeout(() => {
359
- G();
360
- }, v || 0);
362
+ W();
363
+ }, R || 0);
361
364
  }, [r]), /* @__PURE__ */ t(Nt, { value: M, children: n });
362
365
  }
363
366
  ie.propTypes = {
@@ -365,13 +368,13 @@ ie.propTypes = {
365
368
  children: o.any.isRequired
366
369
  };
367
370
  ie.defaultProps = $e;
368
- function N() {
369
- const e = He(Ie);
371
+ function L() {
372
+ const e = Ke(Ie);
370
373
  return e || {};
371
374
  }
372
- const Lt = T(Ne)`
375
+ const Lt = P(Ne)`
373
376
  border-radius: 4px;
374
- `, se = Ve(({ children: e, rounded: n, loading: r, disabled: a, ...s }, c) => /* @__PURE__ */ t(
377
+ `, se = He(({ children: e, rounded: n, loading: r, disabled: a, ...s }, c) => /* @__PURE__ */ t(
375
378
  Lt,
376
379
  {
377
380
  ref: c,
@@ -394,33 +397,33 @@ se.defaultProps = {
394
397
  loading: !1,
395
398
  disabled: !1
396
399
  };
397
- function ce({ title: e, value: n, icon: r, prepend: a, options: s, onChange: c, itemRender: x, ...y }) {
398
- const u = J(null), b = ae(), [d, C] = E(!1), [v, S] = E(n !== null ? n : ""), P = Se(b.breakpoints.down("sm"));
400
+ function ce({ title: e, value: n, icon: r, prepend: a, options: s, onChange: c, itemRender: w, ...g }) {
401
+ const m = J(null), x = ae(), [u, S] = E(!1), [R, T] = E(n !== null ? n : ""), B = Se(x.breakpoints.down("sm"));
399
402
  j(() => {
400
- S(n !== null ? n : "");
403
+ T(n !== null ? n : "");
401
404
  }, [n]);
402
- const R = ne(() => {
403
- C(!1);
404
- }, []), i = ne(() => {
405
- C(!0);
405
+ const C = ne(() => {
406
+ S(!1);
407
+ }, []), y = ne(() => {
408
+ S(!0);
406
409
  }, []);
407
- function h(k) {
408
- S(k.value), c(k.value), P && R();
410
+ function d(b) {
411
+ T(b.value), c(b.value), B && C();
409
412
  }
410
- function m(k) {
411
- return k === v;
413
+ function i(b) {
414
+ return b === R;
412
415
  }
413
- return /* @__PURE__ */ f(le, { children: [
414
- /* @__PURE__ */ f(
416
+ return /* @__PURE__ */ h(le, { children: [
417
+ /* @__PURE__ */ h(
415
418
  Mt,
416
419
  {
417
- ref: u,
418
- onClick: i,
420
+ ref: m,
421
+ onClick: y,
419
422
  variant: "outlined",
420
423
  size: "small",
421
- className: ["my-select__selector", ut(v) ? "" : "my-select__selector--active"].join(" "),
424
+ className: ["my-select__selector", ut(R) ? "" : "my-select__selector--active"].join(" "),
422
425
  sx: { minWidth: "auto" },
423
- ...y,
426
+ ...g,
424
427
  children: [
425
428
  /* @__PURE__ */ t("div", { className: "my-select__icon", children: r }),
426
429
  e,
@@ -428,19 +431,19 @@ function ce({ title: e, value: n, icon: r, prepend: a, options: s, onChange: c,
428
431
  ]
429
432
  }
430
433
  ),
431
- /* @__PURE__ */ t(Oe, { open: d, anchorEl: u.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: k, placement: $ }) => /* @__PURE__ */ t(Fe, { ...k, sx: { transformOrigin: $ === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(Ee, { onClickAway: R, children: /* @__PURE__ */ f(Ot, { autoFocusItem: d, onMouseEnter: i, onMouseLeave: R, children: [
434
+ /* @__PURE__ */ t(Oe, { open: u, anchorEl: m.current, transition: !0, sx: { zIndex: "9999" }, children: ({ TransitionProps: b, placement: k }) => /* @__PURE__ */ t(Fe, { ...b, sx: { transformOrigin: k === "bottom" ? "center top" : "center bottom" }, children: /* @__PURE__ */ t(Ae, { children: /* @__PURE__ */ t(Ee, { onClickAway: C, children: /* @__PURE__ */ h(Ot, { autoFocusItem: u, onMouseEnter: y, onMouseLeave: C, children: [
432
435
  a,
433
- s.map((w) => x ? x(w) : /* @__PURE__ */ t(
436
+ s.map((z) => w ? w(z) : /* @__PURE__ */ t(
434
437
  qe,
435
438
  {
436
- onClick: () => h(w),
439
+ onClick: () => d(z),
437
440
  className: [
438
441
  "my-select__option",
439
- m(w.value) ? "my-select__option--active" : ""
442
+ i(z.value) ? "my-select__option--active" : ""
440
443
  ].join(" "),
441
- children: w.name
444
+ children: z.name
442
445
  },
443
- w.value
446
+ z.value
444
447
  ))
445
448
  ] }) }) }) }) })
446
449
  ] });
@@ -462,7 +465,7 @@ ce.defaultProps = {
462
465
  onChange: () => {
463
466
  }
464
467
  };
465
- const Mt = T(se)`
468
+ const Mt = P(se)`
466
469
  border: 1px solid #f0f0f0;
467
470
  padding: 6px 8px 6px 12px;
468
471
  font-weight: ${(e) => e.theme.typography.fontWeightBold};
@@ -493,7 +496,7 @@ const Mt = T(se)`
493
496
  margin-right: 3px;
494
497
  }
495
498
  }
496
- `, Ot = T(Le)`
499
+ `, Ot = P(Le)`
497
500
  .my-select__option__icon {
498
501
  color: transparent;
499
502
  font-size: 16px;
@@ -511,7 +514,7 @@ const Mt = T(se)`
511
514
  }
512
515
  `;
513
516
  function U({ options: e, onChange: n, title: r, value: a }) {
514
- return /* @__PURE__ */ f(Ft, { children: [
517
+ return /* @__PURE__ */ h(Ft, { children: [
515
518
  /* @__PURE__ */ t("div", { className: "title", children: r }),
516
519
  /* @__PURE__ */ t("div", { className: "list", children: e.map((s) => /* @__PURE__ */ t(
517
520
  "div",
@@ -526,7 +529,7 @@ function U({ options: e, onChange: n, title: r, value: a }) {
526
529
  )) })
527
530
  ] });
528
531
  }
529
- const Ft = T("div")`
532
+ const Ft = P("div")`
530
533
  .title {
531
534
  font-size: 18px;
532
535
  font-weight: bold;
@@ -564,20 +567,20 @@ U.defaultProps = {
564
567
  value: null
565
568
  };
566
569
  function pe() {
567
- const { selectedCategory: e, handleCategory: n, t: r, handlePrice: a, filters: s, categoryOptions: c, priceOptions: x } = N(), [y, u] = E(!1), b = (d, C) => {
568
- d === "category" && n(C), d === "price" && a(C), u(!1);
570
+ const { selectedCategory: e, handleCategory: n, t: r, handlePrice: a, filters: s, categoryOptions: c, priceOptions: w } = L(), [g, m] = E(!1), x = (u, S) => {
571
+ u === "category" && n(S), u === "price" && a(S), m(!1);
569
572
  };
570
- return /* @__PURE__ */ f(At, { children: [
571
- /* @__PURE__ */ t(ht, { variant: "outlined", className: "filter-button", onClick: () => u(!0), children: /* @__PURE__ */ t(dt, { className: "filter-icon", fontSize: "small" }) }),
572
- /* @__PURE__ */ f(mt, { fullWidth: !0, title: "", open: y, onClose: () => u(!1), children: [
573
+ return /* @__PURE__ */ h(At, { children: [
574
+ /* @__PURE__ */ t(ht, { variant: "outlined", className: "filter-button", onClick: () => m(!0), children: /* @__PURE__ */ t(dt, { className: "filter-icon", fontSize: "small" }) }),
575
+ /* @__PURE__ */ h(mt, { fullWidth: !0, title: "", open: g, onClose: () => m(!1), children: [
573
576
  /* @__PURE__ */ t(
574
577
  U,
575
578
  {
576
579
  title: r("common.price"),
577
- options: x,
580
+ options: w,
578
581
  value: s.price,
579
- onChange: (d) => {
580
- b("price", d);
582
+ onChange: (u) => {
583
+ x("price", u);
581
584
  }
582
585
  }
583
586
  ),
@@ -587,15 +590,15 @@ function pe() {
587
590
  title: r("common.category"),
588
591
  options: c,
589
592
  value: e,
590
- onChange: (d) => {
591
- b("category", d);
593
+ onChange: (u) => {
594
+ x("category", u);
592
595
  }
593
596
  }
594
597
  ) })
595
598
  ] })
596
599
  ] });
597
600
  }
598
- const At = T("div")`
601
+ const At = P("div")`
599
602
  .filter-button {
600
603
  border-color: rgb(240, 240, 240);
601
604
  padding: 5px 8px;
@@ -608,7 +611,7 @@ const At = T("div")`
608
611
  `;
609
612
  pe.propTypes = {};
610
613
  pe.defaultProps = {};
611
- const Et = T("div")`
614
+ const Et = P("div")`
612
615
  .MuiChip-root {
613
616
  border-radius: 4px;
614
617
  height: initial;
@@ -631,12 +634,12 @@ q.defaultProps = {
631
634
  label: null
632
635
  };
633
636
  function we() {
634
- const { t: e } = N();
637
+ const { t: e } = L();
635
638
  return /* @__PURE__ */ t(Re, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
636
639
  }
637
640
  function X({ filterTip: e, keywordTip: n }) {
638
- const { t: r, locale: a } = N(), s = () => a === "zh" ? "、" : " , ";
639
- return /* @__PURE__ */ f(yt, { className: "tips", children: [
641
+ const { t: r, locale: a } = L(), s = () => a === "zh" ? "、" : " , ";
642
+ return /* @__PURE__ */ h(yt, { className: "tips", children: [
640
643
  /* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: r("blocklet.emptyTip") }),
641
644
  e && /* @__PURE__ */ t("span", { children: r("blocklet.filterTip") }),
642
645
  e && n && s(),
@@ -652,14 +655,14 @@ X.defaultProps = {
652
655
  keywordTip: !1
653
656
  };
654
657
  function Z({ primaryStart: e, primaryEnd: n, filter: r }) {
655
- return /* @__PURE__ */ f(Re, { variant: "subtitle2", children: [
658
+ return /* @__PURE__ */ h(Re, { variant: "subtitle2", children: [
656
659
  /* @__PURE__ */ t("span", { children: e }),
657
- /* @__PURE__ */ f("span", { className: "primary", children: [
660
+ /* @__PURE__ */ h("span", { className: "primary", children: [
658
661
  " ",
659
662
  r,
660
663
  " "
661
664
  ] }),
662
- /* @__PURE__ */ f("span", { children: [
665
+ /* @__PURE__ */ h("span", { children: [
663
666
  n,
664
667
  " "
665
668
  ] })
@@ -688,79 +691,80 @@ function ue({ blocklets: e, ...n }) {
688
691
  errors: a,
689
692
  loadings: s,
690
693
  selectedCategory: c,
691
- getCategoryLocale: x,
692
- filters: y,
693
- t: u,
694
- hasNextPage: b,
695
- loadMore: d,
696
- endpoint: C
697
- } = N(), v = !!c || !!y.price, [S] = gt({
694
+ getCategoryLocale: w,
695
+ filters: g,
696
+ t: m,
697
+ serverVersion: x,
698
+ hasNextPage: u,
699
+ loadMore: S,
700
+ endpoint: R
701
+ } = L(), T = !!c || !!g.price, [B] = gt({
698
702
  loading: s.fetchBlockletsLoading || s.loadingMore,
699
- hasNextPage: b,
700
- onLoadMore: d
703
+ hasNextPage: u,
704
+ onLoadMore: S
701
705
  });
702
706
  if (a.fetchBlockletsError)
703
707
  return /* @__PURE__ */ t(
704
708
  Te,
705
709
  {
706
- error: new Error(`Failed to fetch blocklets from ${C}: ${a.fetchBlockletsError.message}`)
710
+ error: new Error(`Failed to fetch blocklets from ${R}: ${a.fetchBlockletsError.message}`)
707
711
  }
708
712
  );
709
713
  if (s.fetchBlockletsLoading)
710
- return /* @__PURE__ */ t(D, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ t(oe, {}) });
711
- if (y.keyword && v && e.length === 0)
712
- return /* @__PURE__ */ f(Y, { children: [
714
+ return /* @__PURE__ */ t(_, { height: 60, display: "flex", alignItems: "center", justifyContent: "center", children: /* @__PURE__ */ t(oe, {}) });
715
+ if (g.keyword && T && e.length === 0)
716
+ return /* @__PURE__ */ h(Y, { children: [
713
717
  /* @__PURE__ */ t(
714
718
  Z,
715
719
  {
716
- primaryStart: u("blocklet.noBlockletPart1"),
717
- primaryEnd: u("blocklet.noBlockletPart2"),
718
- filter: y.keyword
720
+ primaryStart: m("blocklet.noBlockletPart1"),
721
+ primaryEnd: m("blocklet.noBlockletPart2"),
722
+ filter: g.keyword
719
723
  }
720
724
  ),
721
725
  /* @__PURE__ */ t(X, { keywordTip: !0, filterTip: !0 })
722
726
  ] });
723
- if (y.keyword && e.length === 0)
724
- return /* @__PURE__ */ f(Y, { children: [
727
+ if (g.keyword && e.length === 0)
728
+ return /* @__PURE__ */ h(Y, { children: [
725
729
  /* @__PURE__ */ t(
726
730
  Z,
727
731
  {
728
- primaryStart: u("blocklet.noBlockletPart1"),
729
- primaryEnd: u("blocklet.noBlockletPart2"),
730
- filter: y.keyword
732
+ primaryStart: m("blocklet.noBlockletPart1"),
733
+ primaryEnd: m("blocklet.noBlockletPart2"),
734
+ filter: g.keyword
731
735
  }
732
736
  ),
733
737
  /* @__PURE__ */ t(X, { keywordTip: !0 })
734
738
  ] });
735
- if (v && e.length === 0) {
736
- const P = x(c);
737
- return /* @__PURE__ */ f(Y, { children: [
738
- P ? /* @__PURE__ */ t(
739
+ if (T && e.length === 0) {
740
+ const C = w(c);
741
+ return /* @__PURE__ */ h(Y, { children: [
742
+ C ? /* @__PURE__ */ t(
739
743
  Z,
740
744
  {
741
- primaryStart: u("blocklet.noCategoryResults1"),
742
- primaryEnd: u("blocklet.noCategoryResults2"),
743
- filter: P
745
+ primaryStart: m("blocklet.noCategoryResults1"),
746
+ primaryEnd: m("blocklet.noCategoryResults2"),
747
+ filter: C
744
748
  }
745
749
  ) : /* @__PURE__ */ t(we, {}),
746
750
  /* @__PURE__ */ t(X, { filterTip: !0 })
747
751
  ] });
748
752
  }
749
- return e.length === 0 ? /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(we, {}) }) : /* @__PURE__ */ t(ze, { children: (P, R) => /* @__PURE__ */ f(
753
+ return e.length === 0 ? /* @__PURE__ */ t(Y, { children: /* @__PURE__ */ t(we, {}) }) : /* @__PURE__ */ t(ze, { children: (C, y) => /* @__PURE__ */ h(
750
754
  te,
751
755
  {
752
756
  ...n,
753
757
  container: !0,
754
758
  spacing: 2,
755
- columns: R,
759
+ columns: y,
756
760
  disableEqualOverflow: !0,
757
- ref: P,
761
+ ref: C,
758
762
  sx: {
759
- opacity: () => R > 0 ? 1 : 0
763
+ opacity: () => y > 0 ? 1 : 0
760
764
  },
761
765
  children: [
762
- e.map((i) => /* @__PURE__ */ t(te, { xs: 4, "data-blocklet-did": i.did, children: r({ blocklet: i, blocklets: e }) }, i.did)),
763
- b && /* @__PURE__ */ t(te, { xs: 12, ref: S, children: /* @__PURE__ */ t(D, { height: 60, display: "flex", justifyContent: "center", children: /* @__PURE__ */ t(oe, {}) }) })
766
+ e.map((d) => /* @__PURE__ */ t(te, { xs: 4, "data-blocklet-did": d.did, children: r({ blocklet: d, blocklets: e, serverVersion: x }) }, d.did)),
767
+ u && /* @__PURE__ */ t(te, { xs: 12, ref: B, children: /* @__PURE__ */ t(_, { height: 60, display: "flex", justifyContent: "center", children: /* @__PURE__ */ t(oe, {}) }) })
764
768
  ]
765
769
  }
766
770
  ) });
@@ -769,7 +773,7 @@ ue.propTypes = {
769
773
  blocklets: o.array.isRequired
770
774
  };
771
775
  ue.defaultProps = {};
772
- const Y = T(ft)`
776
+ const Y = P(ft)`
773
777
  text-align: center;
774
778
  .primary {
775
779
  color: ${(e) => e.theme.palette.primary.main};
@@ -779,9 +783,9 @@ const Y = T(ft)`
779
783
  }
780
784
  `;
781
785
  function de() {
782
- const { selectedCategory: e, handleCategory: n, t: r, handlePrice: a, filters: s, categoryOptions: c, priceOptions: x } = N();
783
- return /* @__PURE__ */ f(jt, { children: [
784
- /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(U, { title: r("common.price"), options: x, value: s.price, onChange: a }) }),
786
+ const { selectedCategory: e, handleCategory: n, t: r, handlePrice: a, filters: s, categoryOptions: c, priceOptions: w } = L();
787
+ return /* @__PURE__ */ h(jt, { children: [
788
+ /* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(U, { title: r("common.price"), options: w, value: s.price, onChange: a }) }),
785
789
  c.length > 0 && /* @__PURE__ */ t("div", { style: { marginTop: "16px" }, children: /* @__PURE__ */ t(
786
790
  U,
787
791
  {
@@ -793,7 +797,7 @@ function de() {
793
797
  ) })
794
798
  ] });
795
799
  }
796
- const jt = T("aside")`
800
+ const jt = P("aside")`
797
801
  width: 220px;
798
802
  margin-right: ${(e) => e.theme.spacing(2)};
799
803
  height: 100%;
@@ -805,10 +809,10 @@ const jt = T("aside")`
805
809
  de.propTypes = {};
806
810
  de.defaultProps = {};
807
811
  function me({ placeholder: e, ...n }) {
808
- const { filters: r, handleKeyword: a } = N(), [s, c] = E(r.keyword || ""), x = et(a, { wait: 300 }), y = (b) => {
809
- const { value: d } = b.target;
810
- c(d), x.run(d);
811
- }, u = () => {
812
+ const { filters: r, handleKeyword: a } = L(), [s, c] = E(r.keyword || ""), w = et(a, { wait: 300 }), g = (x) => {
813
+ const { value: u } = x.target;
814
+ c(u), w.run(u);
815
+ }, m = () => {
812
816
  c(""), a();
813
817
  };
814
818
  return j(() => {
@@ -819,13 +823,13 @@ function me({ placeholder: e, ...n }) {
819
823
  inputProps: {
820
824
  "data-cy": "search-blocklet"
821
825
  },
822
- startAdornment: /* @__PURE__ */ t(ge, { position: "start", children: /* @__PURE__ */ t(Wt, {}) }),
823
- onChange: y,
826
+ startAdornment: /* @__PURE__ */ t(ge, { position: "start", children: /* @__PURE__ */ t(Vt, {}) }),
827
+ onChange: g,
824
828
  placeholder: e,
825
829
  value: s,
826
830
  title: e,
827
831
  "data-cy": "search",
828
- endAdornment: s && /* @__PURE__ */ t(ge, { position: "end", children: /* @__PURE__ */ t(Gt, { "data-cy": "search-delete", onClick: u }) }),
832
+ endAdornment: s && /* @__PURE__ */ t(ge, { position: "end", children: /* @__PURE__ */ t(Wt, { "data-cy": "search-delete", onClick: m }) }),
829
833
  ...n
830
834
  }
831
835
  );
@@ -836,7 +840,7 @@ me.propTypes = {
836
840
  me.defaultProps = {
837
841
  placeholder: "Type to search..."
838
842
  };
839
- const Ut = T(je)`
843
+ const Ut = P(je)`
840
844
  background-color: ${(e) => e.theme.palette.grey[50]};
841
845
  font-size: 14px;
842
846
  border-radius: 6px;
@@ -853,49 +857,49 @@ const Ut = T(je)`
853
857
  color: transparent;
854
858
  }
855
859
  }
856
- `, Wt = T(bt)`
860
+ `, Vt = P(bt)`
857
861
  color: ${(e) => e.theme.palette.grey[500]};
858
862
  font-size: 28px;
859
863
  @media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
860
864
  font-size: 24px;
861
865
  }
862
- `, Gt = T(wt)`
866
+ `, Wt = P(wt)`
863
867
  color: ${(e) => e.theme.palette.grey[500]};
864
868
  font-size: 16px;
865
869
  cursor: pointer;
866
870
  `;
867
871
  function he({ onSelect: e, wrapChildren: n }) {
868
- const r = J(null), a = J(null), s = J(null), { storeApi: c, blockletRender: x, filters: y, endpoint: u, handleKeyword: b, t: d } = N(), C = async (i) => {
869
- const { data: h } = await c.get(_.blockletsPath, { params: i }), m = h.dataList || [];
870
- return m.length > 0 && m.unshift({ type: "more-result", total: h.total || 0 }), m;
871
- }, v = (i) => {
872
- b(i.state.query), i.setIsOpen(!1);
873
- }, S = () => {
872
+ const r = J(null), a = J(null), s = J(null), { storeApi: c, blockletRender: w, filters: g, endpoint: m, handleKeyword: x, t: u, serverVersion: S } = L(), R = async (d) => {
873
+ const { data: i } = await c.get(N.blockletsPath, { params: d }), b = i.dataList || [];
874
+ return b.length > 0 && b.unshift({ type: "more-result", total: i.total || 0 }), b;
875
+ }, T = (d) => {
876
+ x(d.state.query), d.setIsOpen(!1);
877
+ }, B = () => {
874
878
  r.current && setTimeout(() => {
875
- const i = r.current.querySelector("input.bl-autocomplete-input");
876
- i && i.focus();
879
+ const d = r.current.querySelector("input.bl-autocomplete-input");
880
+ d && d.focus();
877
881
  });
878
- }, P = (i) => {
879
- i.setIsOpen(!1), S();
880
- }, R = ({ prevState: i, state: h }) => {
881
- i.query !== h.query && (h.query || (b(), S()));
882
+ }, C = (d) => {
883
+ d.setIsOpen(!1), B();
884
+ }, y = ({ prevState: d, state: i }) => {
885
+ d.query !== i.query && (i.query || (x(), B()));
882
886
  };
883
887
  return St(
884
888
  "ctrl + k, command + k",
885
- (i) => (i.stopPropagation(), i.preventDefault(), S(), !1),
889
+ (d) => (d.stopPropagation(), d.preventDefault(), B(), !1),
886
890
  { enableOnTags: ["INPUT"] }
887
891
  ), j(() => {
888
- S();
889
- }, [u]), j(() => {
892
+ B();
893
+ }, [m]), j(() => {
890
894
  if (!r.current)
891
895
  return;
892
- const i = kt({
896
+ const d = kt({
893
897
  container: r.current,
894
898
  renderer: { createElement: Qe, Fragment: Je, render: () => {
895
899
  } },
896
- render({ children: h }, m) {
900
+ render({ children: i }, b) {
897
901
  var k;
898
- (!a.current || s.current !== m) && (s.current = m, (k = a.current) == null || k.unmount(), a.current = xt(m)), a.current.render(n(h));
902
+ (!a.current || s.current !== b) && (s.current = b, (k = a.current) == null || k.unmount(), a.current = xt(b)), a.current.render(n(i));
899
903
  },
900
904
  autoFocus: !0,
901
905
  openOnFocus: !1,
@@ -909,54 +913,54 @@ function he({ onSelect: e, wrapChildren: n }) {
909
913
  detachedContainer: "bl-autocomplete-detached-container"
910
914
  },
911
915
  translations: {
912
- clearButtonTitle: d("common.clear"),
913
- detachedCancelButtonText: d("common.cancel"),
914
- submitButtonTitle: d("common.search"),
915
- detachedSearchButtonTitle: d("common.search")
916
+ clearButtonTitle: u("common.clear"),
917
+ detachedCancelButtonText: u("common.cancel"),
918
+ submitButtonTitle: u("common.search"),
919
+ detachedSearchButtonTitle: u("common.search")
916
920
  },
917
- placeholder: d("common.searchStore"),
921
+ placeholder: u("common.searchStore"),
918
922
  initialState: {
919
- query: y.keyword
923
+ query: g.keyword
920
924
  },
921
- onStateChange(h) {
922
- R(h);
925
+ onStateChange(i) {
926
+ y(i);
923
927
  },
924
- onSubmit: v,
925
- onReset(h) {
926
- P(h);
928
+ onSubmit: T,
929
+ onReset(i) {
930
+ C(i);
927
931
  },
928
- getSources({ query: h, state: m, ...k }) {
929
- const $ = {
930
- ...y,
931
- sortBy: _[y.sortBy],
932
+ getSources({ query: i, state: b, ...k }) {
933
+ const z = {
934
+ ...g,
935
+ sortBy: N[g.sortBy],
932
936
  page: 1,
933
937
  pageSize: 10,
934
- keyword: h
938
+ keyword: i
935
939
  };
936
940
  return zt([
937
941
  {
938
942
  sourceId: "blocklets",
939
943
  getItems() {
940
- return C($);
944
+ return R(z);
941
945
  },
942
946
  // 选中后填充 搜索框中值
943
- getItemInputValue({ item: w }) {
944
- return w.type === "more-result" ? h : w.title;
947
+ getItemInputValue({ item: $ }) {
948
+ return $.type === "more-result" ? i : $.title;
945
949
  },
946
950
  // 选中或者点击自动完成列表中的 item 时触发
947
- onSelect({ event: w, item: L }) {
948
- return L.type === "more-result" ? (k.setIsOpen(!1), b(h)) : w.type === "keydown" ? b(L.title) : e({
949
- blocklet: L,
950
- detailUrl: nt(u, "/blocklets", L.did),
951
- storeUrl: u
951
+ onSelect({ event: $, item: v }) {
952
+ return v.type === "more-result" ? (k.setIsOpen(!1), x(i)) : $.type === "keydown" ? x(v.title) : e({
953
+ blocklet: v,
954
+ detailUrl: nt(m, "/blocklets", v.did),
955
+ storeUrl: m
952
956
  });
953
957
  },
954
958
  templates: {
955
- item({ item: w }) {
956
- return w.type === "more-result" ? /* @__PURE__ */ t("div", { children: d("autocomplete.expandResult", { name: h, number: w.total.toLocaleString() }) }) : x({ blocklet: w, autocompleteSetters: k });
959
+ item({ item: $ }) {
960
+ return $.type === "more-result" ? /* @__PURE__ */ t("div", { children: u("autocomplete.expandResult", { name: i, number: $.total.toLocaleString() }) }) : w({ blocklet: $, autocompleteSetters: k, serverVersion: S });
957
961
  },
958
962
  noResults() {
959
- return d("blocklet.noResults");
963
+ return u("blocklet.noResults");
960
964
  }
961
965
  }
962
966
  }
@@ -964,9 +968,9 @@ function he({ onSelect: e, wrapChildren: n }) {
964
968
  }
965
969
  });
966
970
  return () => {
967
- i.destroy();
971
+ d.destroy();
968
972
  };
969
- }, [y, x]), /* @__PURE__ */ f(le, { children: [
973
+ }, [g, w]), /* @__PURE__ */ h(le, { children: [
970
974
  /* @__PURE__ */ t(
971
975
  xe,
972
976
  {
@@ -990,7 +994,7 @@ he.defaultProps = {
990
994
  wrapChildren: (e) => e
991
995
  };
992
996
  function fe({ t: e }) {
993
- const { filters: n, handleSwitchShowResources: r } = N(), a = () => {
997
+ const { filters: n, handleSwitchShowResources: r } = L(), a = () => {
994
998
  n.showResources = !n.showResources, r();
995
999
  };
996
1000
  return /* @__PURE__ */ t(
@@ -1008,8 +1012,8 @@ fe.propTypes = {
1008
1012
  t: o.func.isRequired
1009
1013
  };
1010
1014
  fe.defaultProps = {};
1011
- function Kt() {
1012
- var K, H;
1015
+ function Gt() {
1016
+ var G, K;
1013
1017
  const {
1014
1018
  handleDeveloper: e,
1015
1019
  blockletList: n,
@@ -1017,53 +1021,53 @@ function Kt() {
1017
1021
  developerName: a,
1018
1022
  handleSort: s,
1019
1023
  handleCategory: c,
1020
- handlePrice: x,
1021
- handleSearchSelect: y,
1022
- t: u,
1023
- getCategoryLocale: b,
1024
- priceOptions: d,
1025
- wrapChildren: C,
1026
- showResourcesSwitch: v,
1027
- showCategory: S,
1028
- baseSearch: P,
1029
- onFilterChange: R,
1030
- tagFilters: i
1031
- } = N(), h = vt(u), m = ((K = h.find((g) => g.value === r.sortBy)) == null ? void 0 : K.name) || u("sort.sort"), k = b(r.category), { resourceType: $ } = r || {}, w = (H = d.find((g) => g.value === r.price)) == null ? void 0 : H.name, [L, I] = E(!1), W = ae(), ee = Se(() => W.breakpoints.down("md")), O = Pe({
1024
+ handlePrice: w,
1025
+ handleSearchSelect: g,
1026
+ t: m,
1027
+ getCategoryLocale: x,
1028
+ priceOptions: u,
1029
+ wrapChildren: S,
1030
+ showResourcesSwitch: R,
1031
+ showCategory: T,
1032
+ baseSearch: B,
1033
+ onFilterChange: C,
1034
+ tagFilters: y
1035
+ } = L(), d = vt(m), i = ((G = d.find((f) => f.value === r.sortBy)) == null ? void 0 : G.name) || m("sort.sort"), b = x(r.category), { resourceType: k } = r || {}, z = (K = u.find((f) => f.value === r.price)) == null ? void 0 : K.name, [$, v] = E(!1), V = ae(), ee = Se(() => V.breakpoints.down("md")), O = Pe({
1032
1036
  chooseTagId: ""
1033
- }), G = tt((g) => {
1034
- O.chooseTagId = g.id, ["category", "resourceType", "resourceDid"].forEach((M) => {
1035
- typeof g.params[M] > "u" ? delete r[M] : r[M] = g.params[M];
1036
- }), R(r);
1037
- }), F = rt(() => i.find((g) => g.id === O.chooseTagId), [O.chooseTagId]);
1037
+ }), W = tt((f) => {
1038
+ O.chooseTagId = f.id, ["category", "resourceType", "resourceDid"].forEach((M) => {
1039
+ typeof f.params[M] > "u" ? delete r[M] : r[M] = f.params[M];
1040
+ }), C(r);
1041
+ }), F = rt(() => y.find((f) => f.id === O.chooseTagId), [O.chooseTagId]);
1038
1042
  return ot(() => {
1039
- const g = lt(window.location.search), V = i.find((M) => {
1043
+ const f = lt(window.location.search), H = y.find((M) => {
1040
1044
  const l = M.params;
1041
- return l ? Object.keys(l).every((p) => g[p] === l[p]) : !1;
1045
+ return l ? Object.keys(l).every((p) => f[p] === l[p]) : !1;
1042
1046
  });
1043
- V ? G(V) : i.length > 0 && G(i[0]);
1044
- }), /* @__PURE__ */ f(D, { display: "flex", alignItems: "flex-start", height: "100%", children: [
1045
- S ? /* @__PURE__ */ t(ye, { mdDown: !0, children: /* @__PURE__ */ t(de, {}) }) : null,
1046
- /* @__PURE__ */ f(Ht, { children: [
1047
- /* @__PURE__ */ f(Vt, { children: [
1048
- /* @__PURE__ */ f(
1049
- D,
1047
+ H ? W(H) : y.length > 0 && W(y[0]);
1048
+ }), /* @__PURE__ */ h(_, { display: "flex", alignItems: "flex-start", height: "100%", children: [
1049
+ T ? /* @__PURE__ */ t(ye, { mdDown: !0, children: /* @__PURE__ */ t(de, {}) }) : null,
1050
+ /* @__PURE__ */ h(Kt, { children: [
1051
+ /* @__PURE__ */ h(Ht, { children: [
1052
+ /* @__PURE__ */ h(
1053
+ _,
1050
1054
  {
1051
1055
  className: "filter-bar",
1052
1056
  sx: {
1053
1057
  display: "flex",
1054
1058
  flexDirection: {
1055
1059
  lg: "row",
1056
- md: v ? "column" : "row"
1060
+ md: R ? "column" : "row"
1057
1061
  },
1058
1062
  alignItems: {
1059
1063
  lg: "center",
1060
- md: v ? "flex-start" : "center",
1064
+ md: R ? "flex-start" : "center",
1061
1065
  xs: "center"
1062
1066
  },
1063
1067
  gap: 1
1064
1068
  },
1065
1069
  children: [
1066
- S ? /* @__PURE__ */ t(ye, { mdUp: !0, children: /* @__PURE__ */ t(pe, {}) }) : null,
1070
+ T ? /* @__PURE__ */ t(ye, { mdUp: !0, children: /* @__PURE__ */ t(pe, {}) }) : null,
1067
1071
  /* @__PURE__ */ t(
1068
1072
  "form",
1069
1073
  {
@@ -1072,29 +1076,29 @@ function Kt() {
1072
1076
  flex: 1,
1073
1077
  width: "100%"
1074
1078
  },
1075
- onSubmit: (g) => {
1076
- g.preventDefault(), g.stopPropagation();
1079
+ onSubmit: (f) => {
1080
+ f.preventDefault(), f.stopPropagation();
1077
1081
  },
1078
1082
  onFocus: () => {
1079
- I(!0);
1083
+ v(!0);
1080
1084
  },
1081
1085
  onBlur: () => {
1082
- I(!1);
1086
+ v(!1);
1083
1087
  },
1084
- children: P ? /* @__PURE__ */ t(me, { className: "bl-search-container", placeholder: u("common.searchStore") }) : /* @__PURE__ */ t(he, { onSelect: y, wrapChildren: C })
1088
+ children: B ? /* @__PURE__ */ t(me, { className: "bl-search-container", placeholder: m("common.searchStore") }) : /* @__PURE__ */ t(he, { onSelect: g, wrapChildren: S })
1085
1089
  }
1086
1090
  ),
1087
- /* @__PURE__ */ f(D, { className: "filter-container", display: "flex", alignItems: "center", children: [
1088
- !ee && v && /* @__PURE__ */ t(D, { ml: 1, mr: 1, children: /* @__PURE__ */ t(fe, { t: u }) }),
1091
+ /* @__PURE__ */ h(_, { className: "filter-container", display: "flex", alignItems: "center", children: [
1092
+ !ee && R && /* @__PURE__ */ t(_, { ml: 1, mr: 1, children: /* @__PURE__ */ t(fe, { t: m }) }),
1089
1093
  /* @__PURE__ */ t(
1090
1094
  ce,
1091
1095
  {
1092
1096
  value: r.sortBy,
1093
- options: h,
1094
- title: m,
1097
+ options: d,
1098
+ title: i,
1095
1099
  icon: /* @__PURE__ */ t(_e, {}),
1096
- onChange: (g) => {
1097
- s(g);
1100
+ onChange: (f) => {
1101
+ s(f);
1098
1102
  }
1099
1103
  }
1100
1104
  )
@@ -1102,12 +1106,12 @@ function Kt() {
1102
1106
  ]
1103
1107
  }
1104
1108
  ),
1105
- S ? /* @__PURE__ */ f(D, { display: "flex", flexWrap: "wrap", alignItems: "center", mb: "16px", children: [
1109
+ T ? /* @__PURE__ */ h(_, { display: "flex", flexWrap: "wrap", alignItems: "center", mb: "16px", children: [
1106
1110
  /* @__PURE__ */ t(
1107
1111
  q,
1108
1112
  {
1109
1113
  label: a,
1110
- icon: /* @__PURE__ */ t(We, {}),
1114
+ icon: /* @__PURE__ */ t(Ve, {}),
1111
1115
  onDelete: () => {
1112
1116
  e(null);
1113
1117
  }
@@ -1116,7 +1120,7 @@ function Kt() {
1116
1120
  /* @__PURE__ */ t(
1117
1121
  q,
1118
1122
  {
1119
- label: k,
1123
+ label: b,
1120
1124
  onDelete: () => {
1121
1125
  c(null);
1122
1126
  }
@@ -1125,36 +1129,36 @@ function Kt() {
1125
1129
  /* @__PURE__ */ t(
1126
1130
  q,
1127
1131
  {
1128
- label: w,
1132
+ label: z,
1129
1133
  onDelete: () => {
1130
- x(null);
1134
+ w(null);
1131
1135
  }
1132
1136
  }
1133
1137
  ),
1134
- $ && /* @__PURE__ */ t(q, { label: `${u("common.resourceType")}: ${$}` })
1138
+ k && /* @__PURE__ */ t(q, { label: `${m("common.resourceType")}: ${k}` })
1135
1139
  ] }) : null
1136
1140
  ] }),
1137
- /* @__PURE__ */ t(Ge, { FallbackComponent: Te, children: /* @__PURE__ */ f(D, { sx: { position: "relative", flex: 1, overflow: "auto" }, children: [
1138
- (i == null ? void 0 : i.length) > 0 ? /* @__PURE__ */ f(le, { children: [
1139
- /* @__PURE__ */ t(Ue, { my: 1, direction: "row", spacing: 1.5, useFlexGap: !0, flexWrap: "wrap", justifyContent: "flex-start", children: i.map((g) => /* @__PURE__ */ t(
1141
+ /* @__PURE__ */ t(We, { FallbackComponent: Te, children: /* @__PURE__ */ h(_, { sx: { position: "relative", flex: 1, overflow: "auto" }, children: [
1142
+ (y == null ? void 0 : y.length) > 0 ? /* @__PURE__ */ h(le, { children: [
1143
+ /* @__PURE__ */ t(Ue, { my: 1, direction: "row", spacing: 1.5, useFlexGap: !0, flexWrap: "wrap", justifyContent: "flex-start", children: y.map((f) => /* @__PURE__ */ t(
1140
1144
  Ce,
1141
1145
  {
1142
- label: g.title,
1146
+ label: f.title,
1143
1147
  size: "small",
1144
- variant: O.chooseTagId === g.id ? "contained" : "outlined",
1145
- onClick: () => G(g),
1146
- color: O.chooseTagId === g.id ? "primary" : "default"
1148
+ variant: O.chooseTagId === f.id ? "contained" : "outlined",
1149
+ onClick: () => W(f),
1150
+ color: O.chooseTagId === f.id ? "primary" : "default"
1147
1151
  },
1148
- g.id
1152
+ f.id
1149
1153
  )) }),
1150
- F ? /* @__PURE__ */ t(D, { mb: 2, children: F.description ? /* @__PURE__ */ t(ve, { variant: "body1", children: F.description }) : null }) : null
1154
+ F ? /* @__PURE__ */ t(_, { mb: 2, children: F.description ? /* @__PURE__ */ t(ve, { variant: "body1", children: F.description }) : null }) : null
1151
1155
  ] }) : null,
1152
1156
  /* @__PURE__ */ t(ue, { blocklets: n })
1153
1157
  ] }) })
1154
1158
  ] })
1155
1159
  ] });
1156
1160
  }
1157
- const Ht = T("main")`
1161
+ const Kt = P("main")`
1158
1162
  display: flex;
1159
1163
  flex-direction: column;
1160
1164
  flex: 1;
@@ -1192,7 +1196,7 @@ const Ht = T("main")`
1192
1196
  font-size: 12px;
1193
1197
  }
1194
1198
  }
1195
- `, Vt = T("div")`
1199
+ `, Ht = P("div")`
1196
1200
  position: sticky;
1197
1201
  top: 0;
1198
1202
  z-index: 9;
@@ -1238,9 +1242,9 @@ function De(e) {
1238
1242
  }
1239
1243
  `
1240
1244
  };
1241
- return /* @__PURE__ */ f(ie, { ...e, children: [
1245
+ return /* @__PURE__ */ h(ie, { ...e, children: [
1242
1246
  /* @__PURE__ */ t(xe, { styles: a.autocomplete }),
1243
- /* @__PURE__ */ t(Kt, {})
1247
+ /* @__PURE__ */ t(Gt, {})
1244
1248
  ] });
1245
1249
  }
1246
1250
  De.propTypes = Be;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/list",
3
- "version": "0.13.26",
3
+ "version": "0.13.28",
4
4
  "description": "Common ux components of blocklet",
5
5
  "publishConfig": {
6
6
  "access": "public"
@@ -52,7 +52,7 @@
52
52
  "dependencies": {
53
53
  "@algolia/autocomplete-js": "^1.17.0",
54
54
  "@algolia/autocomplete-theme-classic": "^1.17.0",
55
- "@blocklet/util": "0.13.26",
55
+ "@blocklet/util": "0.13.28",
56
56
  "@emotion/react": "^11.10.0",
57
57
  "@emotion/styled": "^11.10.0",
58
58
  "@mui/icons-material": "^5.16.4",
@@ -83,5 +83,5 @@
83
83
  "prettier": "^3.3.2",
84
84
  "vite": "^5.2.12"
85
85
  },
86
- "gitHead": "737fdc5f0aac370db8cde9485aa50e6ed36f3adb"
86
+ "gitHead": "ba5b362b8e1a797a79e51f6aed61e8e3bed42dae"
87
87
  }