@blocklet/discuss-kit-ux 1.6.169 → 1.6.171

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.
@@ -4,7 +4,7 @@ import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangeP
4
4
  import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
5
5
  import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
6
6
  import { lazy } from "react";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-l7-38Nc9.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-L7b9RORw.mjs";
8
8
  import "@blocklet/labels";
9
9
  import "@mui/material/styles";
10
10
  import "@mui/material/Box";
@@ -4578,7 +4578,7 @@ function Pagination({
4578
4578
  }
4579
4579
  );
4580
4580
  }
4581
- const Editor = lazy(() => import("./editor-JXsHI10g.mjs"));
4581
+ const Editor = lazy(() => import("./editor-GXcwjd5u.mjs"));
4582
4582
  function LazyEditor(props) {
4583
4583
  const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
4584
4584
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -10461,13 +10461,16 @@ function ButtonGroup({
10461
10461
  const [selectTab, setSelectTab] = useState(urlParams ? selectedArray : [boardId]);
10462
10462
  const [selectAll, setSelectAll] = useState(false);
10463
10463
  const updateUrl = (url, newSelectTab) => {
10464
+ const formatNewSelectTab = newSelectTab.filter(Boolean);
10464
10465
  if (urlParams) {
10465
10466
  setSearchParams({
10466
10467
  ...searchParams,
10467
- [url]: newSelectTab.join(",")
10468
+ [url]: formatNewSelectTab.join(",")
10468
10469
  });
10470
+ } else if (formatNewSelectTab.length === 0) {
10471
+ navigate(`/${type}`);
10469
10472
  } else {
10470
- navigate(`/${type}/boards/${newSelectTab.join(",")}`);
10473
+ navigate(`/${type}/boards/${formatNewSelectTab.join(",")}`);
10471
10474
  }
10472
10475
  };
10473
10476
  const handleClick = (item) => {
@@ -10515,73 +10518,76 @@ function ButtonGroup({
10515
10518
  if (onSelectTab)
10516
10519
  onSelectTab(selectTab);
10517
10520
  }, [selectTab, selectedArray, boardId]);
10518
- return /* @__PURE__ */ jsxs(Box$1, { className: Group, children: [
10519
- /* @__PURE__ */ jsxs(
10520
- Box$1,
10521
- {
10522
- sx: {
10523
- bgcolor: theme === "dark" ? "#F9FAFB" : "",
10524
- width: "fit-content",
10525
- maxWidth: "calc(100% - 16px)",
10526
- borderRadius: "99999px",
10527
- borderTopRightRadius: downSm ? 0 : "99999px",
10528
- borderBottomRightRadius: downSm ? 0 : "99999px",
10529
- overflow: "scroll",
10530
- whiteSpace: "nowrap",
10531
- mr: 2
10532
- },
10533
- children: [
10534
- allButton && /* @__PURE__ */ jsx(
10535
- Button$1,
10536
- {
10537
- onClick: handleSelectAll,
10538
- sx: {
10539
- backgroundColor: selectAll ? "#ffffff" : "",
10540
- color: selectAll ? "#030712" : "#4b5563",
10541
- border: selectAll ? "1px solid #e5e7eb!important" : "1px solid transparent"
10542
- },
10543
- ...rest,
10544
- children: t("all")
10545
- }
10546
- ),
10547
- dataWithDefault == null ? void 0 : dataWithDefault.map((item, index) => {
10548
- const isActive = urlParams ? !selectAll && (selectTab == null ? void 0 : selectTab.includes(item.id)) : boardId === item.id;
10549
- return /* @__PURE__ */ jsx(
10521
+ return (
10522
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
10523
+ /* @__PURE__ */ jsxs(Box$1, { className: Group, children: [
10524
+ /* @__PURE__ */ jsxs(
10525
+ Box$1,
10526
+ {
10527
+ sx: {
10528
+ bgcolor: theme === "dark" ? "#F9FAFB" : "",
10529
+ width: "fit-content",
10530
+ maxWidth: "calc(100% - 16px)",
10531
+ borderRadius: "99999px",
10532
+ borderTopRightRadius: downSm ? 0 : "99999px",
10533
+ borderBottomRightRadius: downSm ? 0 : "99999px",
10534
+ overflow: "scroll",
10535
+ whiteSpace: "nowrap",
10536
+ mr: 2
10537
+ },
10538
+ children: [
10539
+ allButton && /* @__PURE__ */ jsx(
10550
10540
  Button$1,
10551
10541
  {
10552
- onClick: () => handleClick(item),
10542
+ onClick: handleSelectAll,
10553
10543
  sx: {
10554
- ...isActive && {
10555
- backgroundColor: "#ffffff",
10556
- color: "#030712",
10557
- border: "1px solid #e5e7eb!important"
10558
- }
10544
+ backgroundColor: selectAll ? "#ffffff" : "",
10545
+ color: selectAll ? "#030712" : "#4b5563",
10546
+ border: selectAll ? "1px solid #e5e7eb!important" : "1px solid transparent"
10559
10547
  },
10560
10548
  ...rest,
10561
- children: /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", alignItems: "center" }, children: [
10562
- item == null ? void 0 : item.icon,
10563
- " ",
10564
- item == null ? void 0 : item.title
10565
- ] })
10566
- },
10567
- index
10568
- );
10569
- })
10570
- ]
10571
- }
10572
- ),
10573
- urlName !== "type" && /* @__PURE__ */ jsx(AccessControl, { roles: ["admin", "owner"], children: /* @__PURE__ */ jsx(
10574
- IconButton$1,
10575
- {
10576
- component: Link,
10577
- color: "inherit",
10578
- size: "small",
10579
- to: `/boards?type=${type}`,
10580
- sx: { color: "grey.500" },
10581
- children: /* @__PURE__ */ jsx(BorderColorOutlined, { sx: { fontSize: 16 } })
10582
- }
10583
- ) })
10584
- ] });
10549
+ children: t("all")
10550
+ }
10551
+ ),
10552
+ dataWithDefault == null ? void 0 : dataWithDefault.map((item, index) => {
10553
+ const isActive = urlParams ? !selectAll && (selectTab == null ? void 0 : selectTab.includes(item.id)) : boardId === item.id;
10554
+ return /* @__PURE__ */ jsx(
10555
+ Button$1,
10556
+ {
10557
+ onClick: () => handleClick(item),
10558
+ sx: {
10559
+ ...isActive && {
10560
+ backgroundColor: "#ffffff",
10561
+ color: "#030712",
10562
+ border: "1px solid #e5e7eb!important"
10563
+ }
10564
+ },
10565
+ ...rest,
10566
+ children: /* @__PURE__ */ jsxs(Box$1, { sx: { display: "flex", alignItems: "center" }, children: [
10567
+ item == null ? void 0 : item.icon,
10568
+ " ",
10569
+ item == null ? void 0 : item.title
10570
+ ] })
10571
+ },
10572
+ index
10573
+ );
10574
+ })
10575
+ ]
10576
+ }
10577
+ ),
10578
+ urlName !== "type" && /* @__PURE__ */ jsx(AccessControl, { roles: ["admin", "owner"], children: /* @__PURE__ */ jsx(
10579
+ IconButton$1,
10580
+ {
10581
+ component: Link,
10582
+ color: "inherit",
10583
+ size: "small",
10584
+ to: `/boards?type=${type}`,
10585
+ sx: { color: "grey.500" },
10586
+ children: /* @__PURE__ */ jsx(BorderColorOutlined, { sx: { fontSize: 16 } })
10587
+ }
10588
+ ) })
10589
+ ] })
10590
+ );
10585
10591
  }
10586
10592
  const Group = css`
10587
10593
  display: flex;
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { N, j, Q, A, h, a8, B, y, F, z, H, ak, U, T, W, Y, o, C, q, v, x, a0, a1, ac, a3, K, L, D, ab, aa, E, G, b, f, a9, M, P, aj, n, m, a7, R, S, a4, k, Z, $, ad, ag, af, ah, al, J, am, l, p, r, e, t, a5, O, c, X, w, a2, a6, u, ai, an, _, ae, d } from "./index-l7-38Nc9.mjs";
2
+ import { N, j, Q, A, h, a8, B, y, F, z, H, ak, U, T, W, Y, o, C, q, v, x, a0, a1, ac, a3, K, L, D, ab, aa, E, G, b, f, a9, M, P, aj, n, m, a7, R, S, a4, k, Z, $, ad, ag, af, ah, al, J, am, l, p, r, e, t, a5, O, c, X, w, a2, a6, u, ai, an, _, ae, d } from "./index-L7b9RORw.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -10398,13 +10398,16 @@ var __publicField = (obj, key, value) => {
10398
10398
  const [selectTab, setSelectTab] = react.useState(urlParams ? selectedArray : [boardId]);
10399
10399
  const [selectAll, setSelectAll] = react.useState(false);
10400
10400
  const updateUrl = (url, newSelectTab) => {
10401
+ const formatNewSelectTab = newSelectTab.filter(Boolean);
10401
10402
  if (urlParams) {
10402
10403
  setSearchParams({
10403
10404
  ...searchParams,
10404
- [url]: newSelectTab.join(",")
10405
+ [url]: formatNewSelectTab.join(",")
10405
10406
  });
10407
+ } else if (formatNewSelectTab.length === 0) {
10408
+ navigate(`/${type}`);
10406
10409
  } else {
10407
- navigate(`/${type}/boards/${newSelectTab.join(",")}`);
10410
+ navigate(`/${type}/boards/${formatNewSelectTab.join(",")}`);
10408
10411
  }
10409
10412
  };
10410
10413
  const handleClick = (item) => {
@@ -10452,73 +10455,76 @@ var __publicField = (obj, key, value) => {
10452
10455
  if (onSelectTab)
10453
10456
  onSelectTab(selectTab);
10454
10457
  }, [selectTab, selectedArray, boardId]);
10455
- return /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { className: Group, children: [
10456
- /* @__PURE__ */ jsxRuntime.jsxs(
10457
- material.Box,
10458
- {
10459
- sx: {
10460
- bgcolor: theme === "dark" ? "#F9FAFB" : "",
10461
- width: "fit-content",
10462
- maxWidth: "calc(100% - 16px)",
10463
- borderRadius: "99999px",
10464
- borderTopRightRadius: downSm ? 0 : "99999px",
10465
- borderBottomRightRadius: downSm ? 0 : "99999px",
10466
- overflow: "scroll",
10467
- whiteSpace: "nowrap",
10468
- mr: 2
10469
- },
10470
- children: [
10471
- allButton && /* @__PURE__ */ jsxRuntime.jsx(
10472
- material.Button,
10473
- {
10474
- onClick: handleSelectAll,
10475
- sx: {
10476
- backgroundColor: selectAll ? "#ffffff" : "",
10477
- color: selectAll ? "#030712" : "#4b5563",
10478
- border: selectAll ? "1px solid #e5e7eb!important" : "1px solid transparent"
10479
- },
10480
- ...rest,
10481
- children: t("all")
10482
- }
10483
- ),
10484
- dataWithDefault == null ? void 0 : dataWithDefault.map((item, index) => {
10485
- const isActive = urlParams ? !selectAll && (selectTab == null ? void 0 : selectTab.includes(item.id)) : boardId === item.id;
10486
- return /* @__PURE__ */ jsxRuntime.jsx(
10458
+ return (
10459
+ // eslint-disable-next-line @typescript-eslint/no-use-before-define
10460
+ /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { className: Group, children: [
10461
+ /* @__PURE__ */ jsxRuntime.jsxs(
10462
+ material.Box,
10463
+ {
10464
+ sx: {
10465
+ bgcolor: theme === "dark" ? "#F9FAFB" : "",
10466
+ width: "fit-content",
10467
+ maxWidth: "calc(100% - 16px)",
10468
+ borderRadius: "99999px",
10469
+ borderTopRightRadius: downSm ? 0 : "99999px",
10470
+ borderBottomRightRadius: downSm ? 0 : "99999px",
10471
+ overflow: "scroll",
10472
+ whiteSpace: "nowrap",
10473
+ mr: 2
10474
+ },
10475
+ children: [
10476
+ allButton && /* @__PURE__ */ jsxRuntime.jsx(
10487
10477
  material.Button,
10488
10478
  {
10489
- onClick: () => handleClick(item),
10479
+ onClick: handleSelectAll,
10490
10480
  sx: {
10491
- ...isActive && {
10492
- backgroundColor: "#ffffff",
10493
- color: "#030712",
10494
- border: "1px solid #e5e7eb!important"
10495
- }
10481
+ backgroundColor: selectAll ? "#ffffff" : "",
10482
+ color: selectAll ? "#030712" : "#4b5563",
10483
+ border: selectAll ? "1px solid #e5e7eb!important" : "1px solid transparent"
10496
10484
  },
10497
10485
  ...rest,
10498
- children: /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", alignItems: "center" }, children: [
10499
- item == null ? void 0 : item.icon,
10500
- " ",
10501
- item == null ? void 0 : item.title
10502
- ] })
10503
- },
10504
- index
10505
- );
10506
- })
10507
- ]
10508
- }
10509
- ),
10510
- urlName !== "type" && /* @__PURE__ */ jsxRuntime.jsx(AccessControl, { roles: ["admin", "owner"], children: /* @__PURE__ */ jsxRuntime.jsx(
10511
- IconButton$1,
10512
- {
10513
- component: reactRouterDom.Link,
10514
- color: "inherit",
10515
- size: "small",
10516
- to: `/boards?type=${type}`,
10517
- sx: { color: "grey.500" },
10518
- children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.BorderColorOutlined, { sx: { fontSize: 16 } })
10519
- }
10520
- ) })
10521
- ] });
10486
+ children: t("all")
10487
+ }
10488
+ ),
10489
+ dataWithDefault == null ? void 0 : dataWithDefault.map((item, index) => {
10490
+ const isActive = urlParams ? !selectAll && (selectTab == null ? void 0 : selectTab.includes(item.id)) : boardId === item.id;
10491
+ return /* @__PURE__ */ jsxRuntime.jsx(
10492
+ material.Button,
10493
+ {
10494
+ onClick: () => handleClick(item),
10495
+ sx: {
10496
+ ...isActive && {
10497
+ backgroundColor: "#ffffff",
10498
+ color: "#030712",
10499
+ border: "1px solid #e5e7eb!important"
10500
+ }
10501
+ },
10502
+ ...rest,
10503
+ children: /* @__PURE__ */ jsxRuntime.jsxs(material.Box, { sx: { display: "flex", alignItems: "center" }, children: [
10504
+ item == null ? void 0 : item.icon,
10505
+ " ",
10506
+ item == null ? void 0 : item.title
10507
+ ] })
10508
+ },
10509
+ index
10510
+ );
10511
+ })
10512
+ ]
10513
+ }
10514
+ ),
10515
+ urlName !== "type" && /* @__PURE__ */ jsxRuntime.jsx(AccessControl, { roles: ["admin", "owner"], children: /* @__PURE__ */ jsxRuntime.jsx(
10516
+ IconButton$1,
10517
+ {
10518
+ component: reactRouterDom.Link,
10519
+ color: "inherit",
10520
+ size: "small",
10521
+ to: `/boards?type=${type}`,
10522
+ sx: { color: "grey.500" },
10523
+ children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.BorderColorOutlined, { sx: { fontSize: 16 } })
10524
+ }
10525
+ ) })
10526
+ ] })
10527
+ );
10522
10528
  }
10523
10529
  const Group = css.css`
10524
10530
  display: flex;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.169",
3
+ "version": "1.6.171",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -29,8 +29,8 @@
29
29
  },
30
30
  "dependencies": {
31
31
  "@arcblock/ws": "^1.18.112",
32
- "@blocklet/editor": "1.6.169",
33
- "@blocklet/labels": "1.6.169",
32
+ "@blocklet/editor": "1.6.171",
33
+ "@blocklet/labels": "1.6.171",
34
34
  "@blocklet/uploader": "^0.0.74",
35
35
  "@emotion/css": "^11.10.5",
36
36
  "@emotion/react": "^11.10.5",
@@ -94,5 +94,5 @@
94
94
  "resolutions": {
95
95
  "react": "^18.2.0"
96
96
  },
97
- "gitHead": "7caa727540c6b01581cf21807affab650dbb0b60"
97
+ "gitHead": "0bdf75fbab659352675e5295115ee697782908aa"
98
98
  }