@blocklet/discuss-kit-ux 2.3.89 → 2.3.91

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 { lazyRetry } from "@arcblock/ux/lib/Util";
7
- import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-BkSohJfw.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-Cdy8-Zg8.mjs";
8
8
  const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -7,7 +7,7 @@ import { jsx, jsxs, Fragment } from "react/jsx-runtime";
7
7
  import { useTheme, ThemeProvider, styled as styled$2 } from "@mui/material/styles";
8
8
  import { create as create$1, styled } from "@arcblock/ux/lib/Theme";
9
9
  import { useEffect, useRef, useState, createElement, useContext, useMemo, useLayoutEffect, useCallback, isValidElement, Suspense, createContext, Fragment as Fragment$1, forwardRef, useImperativeHandle } from "react";
10
- import { Box, useTheme as useTheme$1, useMediaQuery, styled as styled$1, Button as Button$1, Stack as Stack$1, Dialog, DialogTitle, DialogContent, DialogActions, DialogContentText, IconButton as IconButton$3, Tooltip as Tooltip$1, Chip as Chip$1, alpha, ClickAwayListener, Divider, Skeleton, InputBase, Badge as Badge$1, tooltipClasses as tooltipClasses$1, CircularProgress, Backdrop, Autocomplete, Typography as Typography$1, TextField, InputAdornment, SwipeableDrawer, ToggleButtonGroup, ToggleButton, Link as Link$1 } from "@mui/material";
10
+ import { Box, useTheme as useTheme$1, useMediaQuery, styled as styled$1, Button as Button$1, Stack as Stack$1, Dialog, DialogTitle, DialogContent, DialogActions, DialogContentText, IconButton as IconButton$3, Tooltip as Tooltip$1, Chip as Chip$1, alpha, ClickAwayListener, Divider, Skeleton, InputBase, Badge as Badge$1, tooltipClasses as tooltipClasses$1, CircularProgress, Backdrop, Autocomplete, Typography as Typography$1, TextField, InputAdornment, ToggleButtonGroup, ToggleButton, Link as Link$1 } from "@mui/material";
11
11
  import isNil from "lodash/isNil";
12
12
  import { useEditorConfig, EditorConfigProvider } from "@blocklet/editor/lib/config";
13
13
  import { lazyWithPreload } from "react-lazy-with-preload";
@@ -30,7 +30,7 @@ import AvatarGroup from "@mui/material/AvatarGroup";
30
30
  import { grey, green, amber } from "@mui/material/colors";
31
31
  import useMediaQuery$1 from "@mui/material/useMediaQuery";
32
32
  import DID from "@arcblock/ux/lib/DID";
33
- import { useNavigate, useMatch, Link, useLocation, useParams, Outlet, useSearchParams, useBlocker } from "react-router-dom";
33
+ import { useNavigate, useMatch, Link, useLocation, useParams, useSearchParams, useBlocker } from "react-router-dom";
34
34
  import UserCard from "@arcblock/ux/lib/UserCard";
35
35
  import { CardType, InfoType } from "@arcblock/ux/lib/UserCard/types";
36
36
  import { useBrowser } from "@arcblock/react-hooks";
@@ -1318,7 +1318,7 @@ function ProfileCard({ user, click, ...rest }) {
1318
1318
  ] })
1319
1319
  ] }),
1320
1320
  chatUrl && (user == null ? void 0 : user.did) !== window.blocklet.appId && ((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did) && ((_c2 = session == null ? void 0 : session.user) == null ? void 0 : _c2.did) !== user.did && /* @__PURE__ */ jsxs(Fragment, { children: [
1321
- /* @__PURE__ */ jsx(Box, { sx: { my: 2, borderTop: "1px solid #eee" } }),
1321
+ /* @__PURE__ */ jsx(Box, { sx: { my: 2, borderTop: "1px solid", borderColor: "divider" } }),
1322
1322
  /* @__PURE__ */ jsx(Box, { children: /* @__PURE__ */ jsx(
1323
1323
  Button$1,
1324
1324
  {
@@ -5093,7 +5093,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
5093
5093
  }
5094
5094
  const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M10 14L21 3m0 0l-6.5 18a.55.55 0 0 1-1 0L10 14l-7-3.5a.55.55 0 0 1 0-1z" }) });
5095
5095
  const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "none", stroke: "currentColor", strokeLinecap: "round", strokeLinejoin: "round", strokeWidth: 2, d: "M14 15.5a3.5 3.5 0 1 0 7 0a3.5 3.5 0 1 0-7 0M3 19V8.5a3.5 3.5 0 0 1 7 0V19m-7-6h7m11-1v7" }) });
5096
- const Editor = lazyRetry(() => import("./editor-Dky1WFks.mjs"));
5096
+ const Editor = lazyRetry(() => import("./editor-B-PsBOgd.mjs"));
5097
5097
  function LazyEditor(props) {
5098
5098
  const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
5099
5099
  /* @__PURE__ */ jsx(Skeleton, {}),
@@ -5912,7 +5912,17 @@ function ChatInWallet({ sx, ...rest }) {
5912
5912
  };
5913
5913
  }, [downMd, activeChatId]);
5914
5914
  if (!initialized) {
5915
- return /* @__PURE__ */ jsx(CircularProgress$1, {});
5915
+ return /* @__PURE__ */ jsx(
5916
+ Backdrop,
5917
+ {
5918
+ open: true,
5919
+ sx: {
5920
+ zIndex: (theme) => theme.zIndex.drawer + 1,
5921
+ bgcolor: "transparent"
5922
+ },
5923
+ children: /* @__PURE__ */ jsx(CircularProgress$1, {})
5924
+ }
5925
+ );
5916
5926
  }
5917
5927
  const mergedSx = [
5918
5928
  { display: "flex", height: "100%", bgcolor: "background.default" },
@@ -5941,32 +5951,12 @@ function Empty({ sx }) {
5941
5951
  /* @__PURE__ */ jsx(Box$1, { component: "span", sx: { fontSize: 14, fontWeight: 500 }, children: t("chat.noChats") })
5942
5952
  ] });
5943
5953
  }
5944
- function DrawerInner(props) {
5945
- const ref = useRef(null);
5946
- useEffect(() => {
5947
- const onTouchMove = (e) => {
5948
- var _a2;
5949
- if ((_a2 = window == null ? void 0 : window.getSelection()) == null ? void 0 : _a2.toString()) {
5950
- e.stopPropagation();
5951
- }
5952
- };
5953
- if (ref.current) {
5954
- ref.current.addEventListener("touchmove", onTouchMove);
5955
- return () => {
5956
- document.removeEventListener("touchmove", onTouchMove);
5957
- };
5958
- }
5959
- return () => {
5960
- };
5961
- }, []);
5962
- return /* @__PURE__ */ jsx(Box$1, { ref, ...props });
5963
- }
5964
5954
  function ChatListInWallet({ sx, ...rest }) {
5965
- var _a2, _b2, _c2, _d2;
5955
+ var _a2, _b2, _c2;
5966
5956
  const { session } = useSessionContext();
5967
- const { initialized, chats, activeChatId } = useChatContext();
5957
+ const { initialized, chats } = useChatContext();
5968
5958
  const { unreadMessageCount } = useUnreadNotification();
5969
- const { navigateToChatList, updateUnreadState, isWebNavbar } = useChatInWallet();
5959
+ const { updateUnreadState, isWebNavbar } = useChatInWallet();
5970
5960
  useEffect(() => {
5971
5961
  updateUnreadState({ unread: unreadMessageCount > 0, unreadMessageCount });
5972
5962
  }, [unreadMessageCount, updateUnreadState]);
@@ -6039,32 +6029,7 @@ function ChatListInWallet({ sx, ...rest }) {
6039
6029
  ] }),
6040
6030
  /* @__PURE__ */ jsx(Divider, {}),
6041
6031
  !!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsx(ChatList, { sx: { flex: 1, overflowY: "auto" }, inWallet: true }),
6042
- !(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsx(Empty, { sx: { flex: 1 } }),
6043
- /* @__PURE__ */ jsx(
6044
- SwipeableDrawer,
6045
- {
6046
- disableSwipeToOpen: true,
6047
- PaperProps: { sx: { width: 1 } },
6048
- anchor: "right",
6049
- open: !!activeChatId,
6050
- onClose: () => navigateToChatList(),
6051
- onOpen: () => {
6052
- },
6053
- children: /* @__PURE__ */ jsx(
6054
- DrawerInner,
6055
- {
6056
- sx: {
6057
- width: 1,
6058
- height: 1,
6059
- ...((_d2 = window.chatInWallet) == null ? void 0 : _d2.safeAreaInsetTop) && {
6060
- pt: `${window.chatInWallet.safeAreaInsetTop}px`
6061
- }
6062
- },
6063
- children: /* @__PURE__ */ jsx(Outlet, {})
6064
- }
6065
- )
6066
- }
6067
- )
6032
+ !(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsx(Empty, { sx: { flex: 1 } })
6068
6033
  ]
6069
6034
  }
6070
6035
  ) });
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { W, o, Y, aQ, A, n, af, B, G, N, L, O, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, aR, aS, v, aE, aF, R, S, ab, as, aD, q, aP, a4, a6, ak, an, am, aM, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, aN, aL, l, az, h, p, r, k, aw, t, j, ac, aB, X, aT, c, a2, E, a9, ad, aV, e, u, ap, d, av, aU, aO, a5, al, f } from "./index-BkSohJfw.mjs";
2
+ import { W, o, Y, aQ, A, n, af, B, G, N, L, O, ar, _, Z, a1, $, a0, a3, x, C, y, z, F, a7, a8, aj, aa, T, U, ae, D, ai, ah, K, H, J, aG, aH, b, m, ag, M, P, aC, aq, w, aR, aS, v, aE, aF, R, S, ab, as, aD, q, aP, a4, a6, ak, an, am, aM, aI, aA, at, Q, ao, aK, au, aJ, ax, ay, aN, aL, l, az, h, p, r, k, aw, t, j, ac, aB, X, aT, c, a2, E, a9, ad, aV, e, u, ap, d, av, aU, aO, a5, al, f } from "./index-Cdy8-Zg8.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -1235,7 +1235,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
1235
1235
  ] })
1236
1236
  ] }),
1237
1237
  chatUrl && (user == null ? void 0 : user.did) !== window.blocklet.appId && ((_b2 = session == null ? void 0 : session.user) == null ? void 0 : _b2.did) && ((_c2 = session == null ? void 0 : session.user) == null ? void 0 : _c2.did) !== user.did && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
1238
- /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { my: 2, borderTop: "1px solid #eee" } }),
1238
+ /* @__PURE__ */ jsxRuntime.jsx(material.Box, { sx: { my: 2, borderTop: "1px solid", borderColor: "divider" } }),
1239
1239
  /* @__PURE__ */ jsxRuntime.jsx(material.Box, { children: /* @__PURE__ */ jsxRuntime.jsx(
1240
1240
  material.Button,
1241
1241
  {
@@ -5829,7 +5829,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5829
5829
  };
5830
5830
  }, [downMd, activeChatId]);
5831
5831
  if (!initialized) {
5832
- return /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, {});
5832
+ return /* @__PURE__ */ jsxRuntime.jsx(
5833
+ material.Backdrop,
5834
+ {
5835
+ open: true,
5836
+ sx: {
5837
+ zIndex: (theme) => theme.zIndex.drawer + 1,
5838
+ bgcolor: "transparent"
5839
+ },
5840
+ children: /* @__PURE__ */ jsxRuntime.jsx(CircularProgress, {})
5841
+ }
5842
+ );
5833
5843
  }
5834
5844
  const mergedSx = [
5835
5845
  { display: "flex", height: "100%", bgcolor: "background.default" },
@@ -5858,32 +5868,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5858
5868
  /* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontSize: 14, fontWeight: 500 }, children: t("chat.noChats") })
5859
5869
  ] });
5860
5870
  }
5861
- function DrawerInner(props) {
5862
- const ref = react.useRef(null);
5863
- react.useEffect(() => {
5864
- const onTouchMove = (e) => {
5865
- var _a2;
5866
- if ((_a2 = window == null ? void 0 : window.getSelection()) == null ? void 0 : _a2.toString()) {
5867
- e.stopPropagation();
5868
- }
5869
- };
5870
- if (ref.current) {
5871
- ref.current.addEventListener("touchmove", onTouchMove);
5872
- return () => {
5873
- document.removeEventListener("touchmove", onTouchMove);
5874
- };
5875
- }
5876
- return () => {
5877
- };
5878
- }, []);
5879
- return /* @__PURE__ */ jsxRuntime.jsx(Box, { ref, ...props });
5880
- }
5881
5871
  function ChatListInWallet({ sx, ...rest }) {
5882
- var _a2, _b2, _c2, _d2;
5872
+ var _a2, _b2, _c2;
5883
5873
  const { session } = useSessionContext();
5884
- const { initialized, chats, activeChatId } = useChatContext();
5874
+ const { initialized, chats } = useChatContext();
5885
5875
  const { unreadMessageCount } = useUnreadNotification();
5886
- const { navigateToChatList, updateUnreadState, isWebNavbar } = useChatInWallet();
5876
+ const { updateUnreadState, isWebNavbar } = useChatInWallet();
5887
5877
  react.useEffect(() => {
5888
5878
  updateUnreadState({ unread: unreadMessageCount > 0, unreadMessageCount });
5889
5879
  }, [unreadMessageCount, updateUnreadState]);
@@ -5956,32 +5946,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
5956
5946
  ] }),
5957
5947
  /* @__PURE__ */ jsxRuntime.jsx(material.Divider, {}),
5958
5948
  !!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsxRuntime.jsx(ChatList, { sx: { flex: 1, overflowY: "auto" }, inWallet: true }),
5959
- !(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsxRuntime.jsx(Empty, { sx: { flex: 1 } }),
5960
- /* @__PURE__ */ jsxRuntime.jsx(
5961
- material.SwipeableDrawer,
5962
- {
5963
- disableSwipeToOpen: true,
5964
- PaperProps: { sx: { width: 1 } },
5965
- anchor: "right",
5966
- open: !!activeChatId,
5967
- onClose: () => navigateToChatList(),
5968
- onOpen: () => {
5969
- },
5970
- children: /* @__PURE__ */ jsxRuntime.jsx(
5971
- DrawerInner,
5972
- {
5973
- sx: {
5974
- width: 1,
5975
- height: 1,
5976
- ...((_d2 = window.chatInWallet) == null ? void 0 : _d2.safeAreaInsetTop) && {
5977
- pt: `${window.chatInWallet.safeAreaInsetTop}px`
5978
- }
5979
- },
5980
- children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
5981
- }
5982
- )
5983
- }
5984
- )
5949
+ !(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsxRuntime.jsx(Empty, { sx: { flex: 1 } })
5985
5950
  ]
5986
5951
  }
5987
5952
  ) });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "2.3.89",
3
+ "version": "2.3.91",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -48,8 +48,8 @@
48
48
  "unstated-next": "^1.1.0",
49
49
  "url-join": "^4.0.1",
50
50
  "zustand": "^4.5.5",
51
- "@blocklet/editor": "^2.3.89",
52
- "@blocklet/labels": "^2.3.89"
51
+ "@blocklet/editor": "^2.3.91",
52
+ "@blocklet/labels": "^2.3.91"
53
53
  },
54
54
  "peerDependencies": {
55
55
  "@arcblock/did-connect": "^2.10.36",