@blocklet/list 0.12.18 → 0.12.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.es.js +66 -66
- package/lib/libs/utils.js +1 -14
- package/package.json +3 -3
package/lib/index.es.js
CHANGED
|
@@ -2,8 +2,8 @@ import { jsx as t, jsxs as g, Fragment as Pe } from "react/jsx-runtime";
|
|
|
2
2
|
import { useTheme as de } from "@mui/material/styles";
|
|
3
3
|
import { css as Be, Global as $e } from "@emotion/react";
|
|
4
4
|
import { styled as C } from "@arcblock/ux/lib/Theme";
|
|
5
|
-
import
|
|
6
|
-
import { Button as
|
|
5
|
+
import Te from "@mui/icons-material/Sort";
|
|
6
|
+
import { Button as Re, CircularProgress as ze, MenuList as Ie, useMediaQuery as _e, SvgIcon as De, Popper as Ne, Grow as Ae, Paper as Le, ClickAwayListener as Me, MenuItem as Oe, Chip as Fe, OutlinedInput as Ee, InputAdornment as le, Box as F, Hidden as ae } from "@mui/material";
|
|
7
7
|
import qe from "@mui/icons-material/Face";
|
|
8
8
|
import { ErrorBoundary as je } from "react-error-boundary";
|
|
9
9
|
import { ErrorFallback as ue } from "@arcblock/ux/lib/ErrorBoundary";
|
|
@@ -13,26 +13,26 @@ import { useReactive as Qe, useInfiniteScroll as Je, useRequest as Xe, useDeboun
|
|
|
13
13
|
import Ze from "lodash/orderBy";
|
|
14
14
|
import et from "axios";
|
|
15
15
|
import tt from "json-stable-stringify";
|
|
16
|
-
import rt from "url-join";
|
|
17
16
|
import "lodash/cloneDeep";
|
|
18
|
-
import
|
|
17
|
+
import rt from "color";
|
|
19
18
|
import ie from "flat";
|
|
20
|
-
import
|
|
21
|
-
import
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
import
|
|
25
|
-
import
|
|
19
|
+
import ot from "@mui/icons-material/KeyboardArrowDown";
|
|
20
|
+
import nt from "lodash/isEmpty";
|
|
21
|
+
import lt from "@mui/icons-material/FilterAltOutlined";
|
|
22
|
+
import at from "@arcblock/ux/lib/Dialog";
|
|
23
|
+
import it from "@mui/material/Button";
|
|
24
|
+
import st from "@arcblock/ux/lib/Empty";
|
|
26
25
|
import H from "@mui/material/Box";
|
|
27
26
|
import me from "@mui/material/Grid";
|
|
28
27
|
import se from "@mui/material/CircularProgress";
|
|
29
|
-
import
|
|
28
|
+
import ct from "react-infinite-scroll-hook";
|
|
30
29
|
import fe from "@mui/material/Typography";
|
|
31
|
-
import
|
|
32
|
-
import
|
|
33
|
-
import { createRoot as
|
|
34
|
-
import { autocomplete as
|
|
35
|
-
import { useHotkeys as
|
|
30
|
+
import pt from "@mui/icons-material/Search";
|
|
31
|
+
import dt from "@mui/icons-material/Close";
|
|
32
|
+
import { createRoot as ut } from "react-dom/client";
|
|
33
|
+
import { autocomplete as mt } from "@algolia/autocomplete-js";
|
|
34
|
+
import { useHotkeys as ft } from "react-hotkeys-hook";
|
|
35
|
+
import ht from "url-join";
|
|
36
36
|
import "@algolia/autocomplete-theme-classic/dist/theme.css";
|
|
37
37
|
const gt = (e) => [
|
|
38
38
|
{
|
|
@@ -60,7 +60,7 @@ const gt = (e) => [
|
|
|
60
60
|
), kt = () => window.innerWidth <= 600, wt = (e, o) => {
|
|
61
61
|
const r = (e + o) / o;
|
|
62
62
|
return r > 1 ? r.toFixed() : 1;
|
|
63
|
-
}, vt = (e) =>
|
|
63
|
+
}, vt = (e) => rt(e).rgb().object();
|
|
64
64
|
function St(e, o) {
|
|
65
65
|
let r;
|
|
66
66
|
return function(...i) {
|
|
@@ -168,7 +168,7 @@ const Ct = St((e) => Promise.resolve(e), 300), Pt = {
|
|
|
168
168
|
wrapChildren: (e) => e,
|
|
169
169
|
extraFilter: (e) => e,
|
|
170
170
|
baseSearch: !1
|
|
171
|
-
},
|
|
171
|
+
}, T = {
|
|
172
172
|
nameAsc: "title",
|
|
173
173
|
nameDesc: "title",
|
|
174
174
|
popularity: "stats.downloads",
|
|
@@ -200,9 +200,9 @@ function V({
|
|
|
200
200
|
baseURL: r,
|
|
201
201
|
headers: B
|
|
202
202
|
}), [r]), c = N(() => ({ sortBy: "popularity", sortDirection: "desc", ...e }), [e]), $ = c.category, d = Qe({
|
|
203
|
-
currentPage:
|
|
204
|
-
pageSize: kt() ?
|
|
205
|
-
defaultCurrentPage:
|
|
203
|
+
currentPage: T.currentPage,
|
|
204
|
+
pageSize: kt() ? T.mobilePageSize : T.pageSize,
|
|
205
|
+
defaultCurrentPage: T.defaultCurrentPage
|
|
206
206
|
}), [f, k] = M(null), {
|
|
207
207
|
data: h = { list: [], total: 0 },
|
|
208
208
|
loading: D,
|
|
@@ -210,15 +210,15 @@ function V({
|
|
|
210
210
|
loadingMore: I
|
|
211
211
|
} = Je(
|
|
212
212
|
async (a) => {
|
|
213
|
-
var
|
|
213
|
+
var R;
|
|
214
214
|
const u = {
|
|
215
215
|
...c,
|
|
216
|
-
sortBy:
|
|
217
|
-
page: wt(((
|
|
216
|
+
sortBy: T[c.sortBy],
|
|
217
|
+
page: wt(((R = a == null ? void 0 : a.list) == null ? void 0 : R.length) || 0, d.pageSize),
|
|
218
218
|
pageSize: d.pageSize
|
|
219
219
|
};
|
|
220
220
|
k(null);
|
|
221
|
-
const { data: v = {} } = await S.get(
|
|
221
|
+
const { data: v = {} } = await S.get(T.blockletsPath, {
|
|
222
222
|
params: u
|
|
223
223
|
});
|
|
224
224
|
return { list: (v == null ? void 0 : v.dataList) || [], total: (v == null ? void 0 : v.total) || 0 };
|
|
@@ -237,7 +237,7 @@ function V({
|
|
|
237
237
|
run: we
|
|
238
238
|
} = Xe(
|
|
239
239
|
async () => {
|
|
240
|
-
const { data: a } = await S.get(
|
|
240
|
+
const { data: a } = await S.get(T.categoriesPath);
|
|
241
241
|
return Array.isArray(a) ? a : [];
|
|
242
242
|
},
|
|
243
243
|
{ manual: !0 }
|
|
@@ -307,14 +307,14 @@ function V({
|
|
|
307
307
|
if (!a)
|
|
308
308
|
return null;
|
|
309
309
|
let u = null;
|
|
310
|
-
const v = G.find((
|
|
310
|
+
const v = G.find((R) => R._id === a);
|
|
311
311
|
return v && (u = v.locales[l]), u;
|
|
312
312
|
},
|
|
313
313
|
get developerName() {
|
|
314
314
|
var u, v;
|
|
315
|
-
return ((v = (u = oe.find((
|
|
315
|
+
return ((v = (u = oe.find((R) => {
|
|
316
316
|
var ne;
|
|
317
|
-
return ((ne =
|
|
317
|
+
return ((ne = R == null ? void 0 : R.owner) == null ? void 0 : ne.did) === c.owner;
|
|
318
318
|
})) == null ? void 0 : u.owner) == null ? void 0 : v.name) || "";
|
|
319
319
|
},
|
|
320
320
|
handleSearchSelect: x
|
|
@@ -332,10 +332,10 @@ function z() {
|
|
|
332
332
|
const e = Ue(ye);
|
|
333
333
|
return e || {};
|
|
334
334
|
}
|
|
335
|
-
const
|
|
335
|
+
const Tt = C(Re)`
|
|
336
336
|
border-radius: 4px;
|
|
337
337
|
`, Q = Ke(({ children: e, rounded: o, loading: r, disabled: l, ...i }, s) => /* @__PURE__ */ t(
|
|
338
|
-
|
|
338
|
+
Tt,
|
|
339
339
|
{
|
|
340
340
|
ref: s,
|
|
341
341
|
disableElevation: !0,
|
|
@@ -375,27 +375,27 @@ function J({ title: e, value: o, icon: r, prepend: l, options: i, onChange: s, i
|
|
|
375
375
|
}
|
|
376
376
|
return /* @__PURE__ */ g(Pe, { children: [
|
|
377
377
|
/* @__PURE__ */ g(
|
|
378
|
-
|
|
378
|
+
Rt,
|
|
379
379
|
{
|
|
380
380
|
ref: p,
|
|
381
381
|
onClick: d,
|
|
382
382
|
variant: "outlined",
|
|
383
383
|
size: "small",
|
|
384
|
-
className: ["my-select__selector",
|
|
384
|
+
className: ["my-select__selector", nt(B) ? "" : "my-select__selector--active"].join(" "),
|
|
385
385
|
...y,
|
|
386
386
|
children: [
|
|
387
387
|
/* @__PURE__ */ t("div", { className: "my-select__icon", children: r }),
|
|
388
388
|
e,
|
|
389
|
-
/* @__PURE__ */ t(De, { className: "my-select__arrowdown", component:
|
|
389
|
+
/* @__PURE__ */ t(De, { className: "my-select__arrowdown", component: ot, fontSize: "small" })
|
|
390
390
|
]
|
|
391
391
|
}
|
|
392
392
|
),
|
|
393
393
|
/* @__PURE__ */ t(Ne, { open: m, anchorEl: p.current, transition: !0, style: { zIndex: "9999" }, children: ({ TransitionProps: h, placement: D }) => /* @__PURE__ */ t(
|
|
394
|
-
|
|
394
|
+
Ae,
|
|
395
395
|
{
|
|
396
396
|
...h,
|
|
397
397
|
style: { transformOrigin: D === "bottom" ? "center top" : "center bottom" },
|
|
398
|
-
children: /* @__PURE__ */ t(
|
|
398
|
+
children: /* @__PURE__ */ t(Le, { children: /* @__PURE__ */ t(Me, { onClickAway: $, children: /* @__PURE__ */ g(zt, { autoFocusItem: m, onMouseEnter: d, onMouseLeave: $, children: [
|
|
399
399
|
l,
|
|
400
400
|
i.map((w) => x ? x(w) : /* @__PURE__ */ t(
|
|
401
401
|
Oe,
|
|
@@ -431,7 +431,7 @@ J.defaultProps = {
|
|
|
431
431
|
onChange: () => {
|
|
432
432
|
}
|
|
433
433
|
};
|
|
434
|
-
const
|
|
434
|
+
const Rt = C(Q)`
|
|
435
435
|
border: 1px solid #f0f0f0;
|
|
436
436
|
padding: 6px 8px 6px 12px;
|
|
437
437
|
font-weight: ${(e) => e.theme.typography.fontWeightBold};
|
|
@@ -538,8 +538,8 @@ function X() {
|
|
|
538
538
|
m === "category" && o(P), m === "price" && l(P), p(!1);
|
|
539
539
|
};
|
|
540
540
|
return /* @__PURE__ */ g(_t, { children: [
|
|
541
|
-
/* @__PURE__ */ t(
|
|
542
|
-
/* @__PURE__ */ g(
|
|
541
|
+
/* @__PURE__ */ t(it, { variant: "outlined", className: "filter-button", onClick: () => p(!0), children: /* @__PURE__ */ t(lt, { className: "filter-icon", fontSize: "small" }) }),
|
|
542
|
+
/* @__PURE__ */ g(at, { fullWidth: !0, title: "", open: y, onClose: () => p(!1), children: [
|
|
543
543
|
/* @__PURE__ */ t(
|
|
544
544
|
_,
|
|
545
545
|
{
|
|
@@ -588,15 +588,15 @@ const Dt = C("div")`
|
|
|
588
588
|
padding: 4px 0;
|
|
589
589
|
}
|
|
590
590
|
`;
|
|
591
|
-
function
|
|
591
|
+
function A({ label: e, icon: o, onDelete: r, ...l }) {
|
|
592
592
|
return e ? /* @__PURE__ */ t(Dt, { ...l, children: /* @__PURE__ */ t(Fe, { color: "primary", "data-cy": "filter-tag", icon: o, label: e, onDelete: r }) }) : null;
|
|
593
593
|
}
|
|
594
|
-
|
|
594
|
+
A.propTypes = {
|
|
595
595
|
label: n.string,
|
|
596
596
|
onDelete: n.func,
|
|
597
597
|
icon: n.element
|
|
598
598
|
};
|
|
599
|
-
|
|
599
|
+
A.defaultProps = {
|
|
600
600
|
onDelete: () => {
|
|
601
601
|
},
|
|
602
602
|
icon: null,
|
|
@@ -606,7 +606,7 @@ function ce() {
|
|
|
606
606
|
const { t: e } = z();
|
|
607
607
|
return /* @__PURE__ */ t(fe, { style: { textAlign: "center" }, variant: "subtitle2", children: e("blocklet.noResults") });
|
|
608
608
|
}
|
|
609
|
-
function
|
|
609
|
+
function L({ filterTip: e, keywordTip: o }) {
|
|
610
610
|
const { t: r, locale: l } = z(), i = () => l === "zh" ? "、" : " , ";
|
|
611
611
|
return /* @__PURE__ */ g(H, { className: "tips", children: [
|
|
612
612
|
/* @__PURE__ */ t("span", { style: { marginRight: "16px" }, children: r("blocklet.emptyTip") }),
|
|
@@ -615,11 +615,11 @@ function A({ filterTip: e, keywordTip: o }) {
|
|
|
615
615
|
o && /* @__PURE__ */ t("span", { children: r("blocklet.keywordTip") })
|
|
616
616
|
] });
|
|
617
617
|
}
|
|
618
|
-
|
|
618
|
+
L.propTypes = {
|
|
619
619
|
filterTip: n.bool,
|
|
620
620
|
keywordTip: n.bool
|
|
621
621
|
};
|
|
622
|
-
|
|
622
|
+
L.defaultProps = {
|
|
623
623
|
filterTip: !1,
|
|
624
624
|
keywordTip: !1
|
|
625
625
|
};
|
|
@@ -654,7 +654,7 @@ function Y({ blocklets: e, ...o }) {
|
|
|
654
654
|
hasNextPage: b,
|
|
655
655
|
loadMore: m,
|
|
656
656
|
endpoint: P
|
|
657
|
-
} = z(), B = !!s || !!y.price, [S] =
|
|
657
|
+
} = z(), B = !!s || !!y.price, [S] = ct({
|
|
658
658
|
loading: i.fetchBlockletsLoading || i.loadingMore,
|
|
659
659
|
hasNextPage: b,
|
|
660
660
|
onLoadMore: m
|
|
@@ -678,7 +678,7 @@ function Y({ blocklets: e, ...o }) {
|
|
|
678
678
|
filter: y.keyword
|
|
679
679
|
}
|
|
680
680
|
),
|
|
681
|
-
/* @__PURE__ */ t(
|
|
681
|
+
/* @__PURE__ */ t(L, { keywordTip: !0, filterTip: !0 })
|
|
682
682
|
] });
|
|
683
683
|
if (y.keyword && e.length === 0)
|
|
684
684
|
return /* @__PURE__ */ g(E, { children: [
|
|
@@ -690,7 +690,7 @@ function Y({ blocklets: e, ...o }) {
|
|
|
690
690
|
filter: y.keyword
|
|
691
691
|
}
|
|
692
692
|
),
|
|
693
|
-
/* @__PURE__ */ t(
|
|
693
|
+
/* @__PURE__ */ t(L, { keywordTip: !0 })
|
|
694
694
|
] });
|
|
695
695
|
if (B && e.length === 0) {
|
|
696
696
|
const c = x(s);
|
|
@@ -703,7 +703,7 @@ function Y({ blocklets: e, ...o }) {
|
|
|
703
703
|
filter: c
|
|
704
704
|
}
|
|
705
705
|
) : /* @__PURE__ */ t(ce, {}),
|
|
706
|
-
/* @__PURE__ */ t(
|
|
706
|
+
/* @__PURE__ */ t(L, { filterTip: !0 })
|
|
707
707
|
] });
|
|
708
708
|
}
|
|
709
709
|
return e.length === 0 ? /* @__PURE__ */ t(E, { children: /* @__PURE__ */ t(ce, {}) }) : /* @__PURE__ */ g(Nt, { container: !0, ...o, children: [
|
|
@@ -731,7 +731,7 @@ const Nt = C(me)`
|
|
|
731
731
|
margin-bottom: ${(e) => e.theme.spacing(2)};
|
|
732
732
|
}
|
|
733
733
|
}
|
|
734
|
-
`), E = C(
|
|
734
|
+
`), E = C(st)`
|
|
735
735
|
text-align: center;
|
|
736
736
|
.primary {
|
|
737
737
|
color: ${(e) => e.theme.palette.primary.main};
|
|
@@ -742,7 +742,7 @@ const Nt = C(me)`
|
|
|
742
742
|
`;
|
|
743
743
|
function Z() {
|
|
744
744
|
const { selectedCategory: e, handleCategory: o, t: r, handlePrice: l, filters: i, categoryOptions: s, priceOptions: x } = z();
|
|
745
|
-
return /* @__PURE__ */ g(
|
|
745
|
+
return /* @__PURE__ */ g(At, { children: [
|
|
746
746
|
/* @__PURE__ */ t("div", { children: /* @__PURE__ */ t(_, { title: r("common.price"), options: x, value: i.price, onChange: l }) }),
|
|
747
747
|
s.length > 0 && /* @__PURE__ */ t("div", { style: { marginTop: "16px" }, children: /* @__PURE__ */ t(
|
|
748
748
|
_,
|
|
@@ -755,7 +755,7 @@ function Z() {
|
|
|
755
755
|
) })
|
|
756
756
|
] });
|
|
757
757
|
}
|
|
758
|
-
const
|
|
758
|
+
const At = C("aside")`
|
|
759
759
|
width: 220px;
|
|
760
760
|
margin-right: ${(e) => e.theme.spacing(2)};
|
|
761
761
|
height: 100%;
|
|
@@ -776,7 +776,7 @@ function ee({ placeholder: e, ...o }) {
|
|
|
776
776
|
return O(() => {
|
|
777
777
|
s(r.keyword || "");
|
|
778
778
|
}, [r.keyword]), /* @__PURE__ */ t(
|
|
779
|
-
|
|
779
|
+
Lt,
|
|
780
780
|
{
|
|
781
781
|
inputProps: {
|
|
782
782
|
"data-cy": "search-blocklet"
|
|
@@ -798,7 +798,7 @@ ee.propTypes = {
|
|
|
798
798
|
ee.defaultProps = {
|
|
799
799
|
placeholder: "Type to search..."
|
|
800
800
|
};
|
|
801
|
-
const
|
|
801
|
+
const Lt = C(Ee)`
|
|
802
802
|
background-color: ${(e) => e.theme.palette.grey[50]};
|
|
803
803
|
font-size: 14px;
|
|
804
804
|
border-radius: 6px;
|
|
@@ -814,20 +814,20 @@ const At = C(Ee)`
|
|
|
814
814
|
color: transparent;
|
|
815
815
|
}
|
|
816
816
|
}
|
|
817
|
-
`, Mt = C(
|
|
817
|
+
`, Mt = C(pt)`
|
|
818
818
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
819
819
|
font-size: 28px;
|
|
820
820
|
@media (max-width: ${(e) => e.theme.breakpoints.values.md}px) {
|
|
821
821
|
font-size: 24px;
|
|
822
822
|
}
|
|
823
|
-
`, Ot = C(
|
|
823
|
+
`, Ot = C(dt)`
|
|
824
824
|
color: ${(e) => e.theme.palette.grey[500]};
|
|
825
825
|
font-size: 16px;
|
|
826
826
|
cursor: pointer;
|
|
827
827
|
`;
|
|
828
828
|
function te({ onSelect: e, wrapChildren: o }) {
|
|
829
829
|
const r = q(null), l = q(null), i = q(null), { storeApi: s, blockletRender: x, filters: y, endpoint: p, handleKeyword: b, t: m } = z(), P = async (d) => {
|
|
830
|
-
const { data: f } = await s.get(
|
|
830
|
+
const { data: f } = await s.get(T.blockletsPath, { params: d }), k = f.dataList || [];
|
|
831
831
|
return k.length > 0 && k.unshift({ type: "more-result", total: f.total || 0 }), k;
|
|
832
832
|
}, B = (d) => {
|
|
833
833
|
b(d.state.query), d.setIsOpen(!1);
|
|
@@ -841,7 +841,7 @@ function te({ onSelect: e, wrapChildren: o }) {
|
|
|
841
841
|
}, $ = ({ prevState: d, state: f }) => {
|
|
842
842
|
d.query !== f.query && (f.query || b());
|
|
843
843
|
};
|
|
844
|
-
return
|
|
844
|
+
return ft(
|
|
845
845
|
"ctrl + k, command + k",
|
|
846
846
|
(d) => (d.stopPropagation(), d.preventDefault(), S(), !1),
|
|
847
847
|
{ enableOnTags: ["INPUT"] }
|
|
@@ -850,13 +850,13 @@ function te({ onSelect: e, wrapChildren: o }) {
|
|
|
850
850
|
}, [p]), O(() => {
|
|
851
851
|
if (!r.current)
|
|
852
852
|
return;
|
|
853
|
-
const d =
|
|
853
|
+
const d = mt({
|
|
854
854
|
container: r.current,
|
|
855
855
|
renderer: { createElement: He, Fragment: Ve, render: () => {
|
|
856
856
|
} },
|
|
857
857
|
render({ children: f }, k) {
|
|
858
858
|
var h;
|
|
859
|
-
(!l.current || i.current !== k) && (i.current = k, (h = l.current) == null || h.unmount(), l.current =
|
|
859
|
+
(!l.current || i.current !== k) && (i.current = k, (h = l.current) == null || h.unmount(), l.current = ut(k)), l.current.render(o(f));
|
|
860
860
|
},
|
|
861
861
|
autoFocus: !0,
|
|
862
862
|
openOnFocus: !1,
|
|
@@ -881,7 +881,7 @@ function te({ onSelect: e, wrapChildren: o }) {
|
|
|
881
881
|
getSources({ query: f, state: k, ...h }) {
|
|
882
882
|
const D = {
|
|
883
883
|
...y,
|
|
884
|
-
sortBy:
|
|
884
|
+
sortBy: T[y.sortBy],
|
|
885
885
|
page: 1,
|
|
886
886
|
pageSize: 10,
|
|
887
887
|
keyword: f
|
|
@@ -900,7 +900,7 @@ function te({ onSelect: e, wrapChildren: o }) {
|
|
|
900
900
|
onSelect({ event: w, item: I }) {
|
|
901
901
|
return I.type === "more-result" ? (h.setIsOpen(!1), b(f)) : w.type === "keydown" ? b(I.title) : e({
|
|
902
902
|
blocklet: I,
|
|
903
|
-
detailUrl:
|
|
903
|
+
detailUrl: ht(p, `/blocklets/${I.did}`),
|
|
904
904
|
storeUrl: p
|
|
905
905
|
});
|
|
906
906
|
},
|
|
@@ -959,7 +959,7 @@ function Ft() {
|
|
|
959
959
|
value: r.sortBy,
|
|
960
960
|
options: S,
|
|
961
961
|
title: c,
|
|
962
|
-
icon: /* @__PURE__ */ t(
|
|
962
|
+
icon: /* @__PURE__ */ t(Te, {}),
|
|
963
963
|
onChange: (h) => {
|
|
964
964
|
i(h);
|
|
965
965
|
}
|
|
@@ -969,7 +969,7 @@ function Ft() {
|
|
|
969
969
|
] }),
|
|
970
970
|
/* @__PURE__ */ g(F, { display: "flex", flexWrap: "wrap", alignItems: "center", mb: "16px", children: [
|
|
971
971
|
/* @__PURE__ */ t(
|
|
972
|
-
|
|
972
|
+
A,
|
|
973
973
|
{
|
|
974
974
|
label: l,
|
|
975
975
|
icon: /* @__PURE__ */ t(qe, {}),
|
|
@@ -979,7 +979,7 @@ function Ft() {
|
|
|
979
979
|
}
|
|
980
980
|
),
|
|
981
981
|
/* @__PURE__ */ t(
|
|
982
|
-
|
|
982
|
+
A,
|
|
983
983
|
{
|
|
984
984
|
label: $,
|
|
985
985
|
onDelete: () => {
|
|
@@ -988,7 +988,7 @@ function Ft() {
|
|
|
988
988
|
}
|
|
989
989
|
),
|
|
990
990
|
/* @__PURE__ */ t(
|
|
991
|
-
|
|
991
|
+
A,
|
|
992
992
|
{
|
|
993
993
|
label: d,
|
|
994
994
|
onDelete: () => {
|
package/lib/libs/utils.js
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
-
exports.urlStringify = exports.toColorRgb = exports.replaceTranslate = exports.removeUndefined = exports.isMobileScreen = exports.
|
|
7
|
-
var _urlJoin = _interopRequireDefault(require("url-join"));
|
|
6
|
+
exports.urlStringify = exports.toColorRgb = exports.replaceTranslate = exports.removeUndefined = exports.isMobileScreen = exports.getSortOptions = exports.getPrices = exports.getCurrentPage = exports.getCategoryOptions = exports.formatError = exports.filterBlockletByPrice = exports.debounced = void 0;
|
|
8
7
|
var _cloneDeep = _interopRequireDefault(require("lodash/cloneDeep"));
|
|
9
8
|
var _color = _interopRequireDefault(require("color"));
|
|
10
9
|
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
@@ -77,18 +76,6 @@ const formatError = error => {
|
|
|
77
76
|
return error.message;
|
|
78
77
|
};
|
|
79
78
|
exports.formatError = formatError;
|
|
80
|
-
const getStoreDetail = (storeUrl, blocklet) => {
|
|
81
|
-
return (0, _urlJoin.default)(storeUrl, "/blocklets/".concat(blocklet.did));
|
|
82
|
-
};
|
|
83
|
-
exports.getStoreDetail = getStoreDetail;
|
|
84
|
-
const formatLogoPath = function formatLogoPath(did, asset) {
|
|
85
|
-
let target = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 'assets';
|
|
86
|
-
if (asset.startsWith(target)) {
|
|
87
|
-
return asset;
|
|
88
|
-
}
|
|
89
|
-
return "".concat(target, "/").concat(did, "/").concat(asset);
|
|
90
|
-
};
|
|
91
|
-
exports.formatLogoPath = formatLogoPath;
|
|
92
79
|
const replaceTranslate = (template, data) =>
|
|
93
80
|
// eslint-disable-next-line no-prototype-builtins
|
|
94
81
|
template.replace(/{(\w*)}/g, (m, key) => data.hasOwnProperty(key) ? data[key] : '');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/list",
|
|
3
|
-
"version": "0.12.
|
|
3
|
+
"version": "0.12.20",
|
|
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.7.1",
|
|
54
54
|
"@algolia/autocomplete-theme-classic": "^1.7.1",
|
|
55
|
-
"@arcblock/ux": "^2.6.
|
|
55
|
+
"@arcblock/ux": "^2.6.4",
|
|
56
56
|
"@emotion/react": "^11.10.0",
|
|
57
57
|
"@emotion/styled": "^11.10.0",
|
|
58
58
|
"@mui/icons-material": "^5.8.4",
|
|
@@ -83,5 +83,5 @@
|
|
|
83
83
|
"prettier": "^2.7.1",
|
|
84
84
|
"vite": "^4.3.9"
|
|
85
85
|
},
|
|
86
|
-
"gitHead": "
|
|
86
|
+
"gitHead": "621b5615a646546889aaf88d0d76825ce1210e18"
|
|
87
87
|
}
|