@blocklet/discuss-kit-ux 1.6.244 → 1.6.245

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.
@@ -3,4 +3,5 @@ export declare const useChatInWallet: () => {
3
3
  id: string;
4
4
  title: string;
5
5
  }) => void;
6
+ isChatInWalletV2: boolean;
6
7
  };
@@ -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-C30pyzPN.mjs";
7
+ import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-B9C3Sh2v.mjs";
8
8
  const BlockletEditor = lazy(() => import("@blocklet/editor"));
9
9
  const Root = styled(Box)`
10
10
  .be-editable,
@@ -4811,15 +4811,23 @@ function useBrowser() {
4811
4811
  const useChatInWallet = () => {
4812
4812
  const navigate = useNavigate();
4813
4813
  const { walletVersion, mobile } = lib.useBrowser();
4814
+ const isChatInWalletV2 = useMemo(() => {
4815
+ try {
4816
+ const targetVersion = mobile.apple.device ? "5.3.2" : "5.3.0";
4817
+ return !!walletVersion && cmp(walletVersion, targetVersion) === 1;
4818
+ } catch (e) {
4819
+ console.error(e);
4820
+ return false;
4821
+ }
4822
+ }, [walletVersion, mobile]);
4814
4823
  const navigateToChat = ({ id: id2, title }) => {
4815
- const targetVersion = mobile.apple.device ? "5.3.2" : "5.3.0";
4816
- if (walletVersion && cmp(walletVersion, targetVersion) === 1) {
4824
+ if (isChatInWalletV2) {
4817
4825
  navigate(`/chat-in-wallet/${id2}`);
4818
4826
  } else {
4819
4827
  bridge.call("clickChat", { id: id2, title });
4820
4828
  }
4821
4829
  };
4822
- return { navigateToChat };
4830
+ return { navigateToChat, isChatInWalletV2 };
4823
4831
  };
4824
4832
  function ChatList({ inWallet, ...rest }) {
4825
4833
  const { t } = useLocaleContext();
@@ -5551,6 +5559,7 @@ function RoomTitle({ title }) {
5551
5559
  }
5552
5560
  function ChatRoom({ chat, inWallet, ...rest }) {
5553
5561
  var _a2;
5562
+ const { isChatInWalletV2 } = useChatInWallet();
5554
5563
  const { t } = useLocaleContext();
5555
5564
  const theme = useTheme();
5556
5565
  const downSm = useMediaQuery((currentTheme) => currentTheme.breakpoints.down("sm"));
@@ -5649,6 +5658,23 @@ function ChatRoom({ chat, inWallet, ...rest }) {
5649
5658
  ]
5650
5659
  }
5651
5660
  ),
5661
+ !!inWallet && isChatInWalletV2 && /* @__PURE__ */ jsxs(
5662
+ Box$1,
5663
+ {
5664
+ sx: {
5665
+ display: "flex",
5666
+ alignItems: "center",
5667
+ flex: "0 0 auto",
5668
+ height: 52,
5669
+ px: 2.5,
5670
+ borderBottom: "1px solid #e5e5e5"
5671
+ },
5672
+ children: [
5673
+ downSm && /* @__PURE__ */ jsx(Back, { iconOnly: true, url: "/chat-in-wallet" }),
5674
+ renderRoomHeader()
5675
+ ]
5676
+ }
5677
+ ),
5652
5678
  /* @__PURE__ */ jsx(Box$1, { sx: { flex: 1, overflow: "hidden", background: theme.palette.grey[50] }, children: /* @__PURE__ */ jsx(MessageList, { chat }) }),
5653
5679
  /* @__PURE__ */ jsx(
5654
5680
  Box$1,
@@ -6456,7 +6482,7 @@ function Pagination({
6456
6482
  }
6457
6483
  );
6458
6484
  }
6459
- const Editor = lazy(() => import("./editor-T5YWV1te.mjs"));
6485
+ const Editor = lazy(() => import("./editor-DnJ6aon9.mjs"));
6460
6486
  function LazyEditor(props) {
6461
6487
  const fallback = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
6462
6488
  /* @__PURE__ */ jsx(Skeleton, {}),
package/dist/index.es.js CHANGED
@@ -1,5 +1,5 @@
1
1
  export * from "@blocklet/labels";
2
- import { T, n, W, A, m, ad, B, F, K, J, L, ap, Y, X, $, Z, _, a1, w, C, x, y, E, a5, a6, ah, a8, O, Q, ac, D, ag, af, H, G, b, k, ae, M, P, ao, v, q, R, S, a9, aq, o, a2, a4, ai, al, ak, am, ar, N, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-C30pyzPN.mjs";
2
+ import { T, n, W, A, m, ad, B, F, K, J, L, ap, Y, X, $, Z, _, a1, w, C, x, y, E, a5, a6, ah, a8, O, Q, ac, D, ag, af, H, G, b, k, ae, M, P, ao, v, q, R, S, a9, aq, o, a2, a4, ai, al, ak, am, ar, N, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-B9C3Sh2v.mjs";
3
3
  import "react/jsx-runtime";
4
4
  import "react";
5
5
  import "@mui/material/Box";
package/dist/index.umd.js CHANGED
@@ -4741,15 +4741,23 @@ var __publicField = (obj, key, value) => {
4741
4741
  const useChatInWallet = () => {
4742
4742
  const navigate = reactRouterDom.useNavigate();
4743
4743
  const { walletVersion, mobile } = lib.useBrowser();
4744
+ const isChatInWalletV2 = require$$0.useMemo(() => {
4745
+ try {
4746
+ const targetVersion = mobile.apple.device ? "5.3.2" : "5.3.0";
4747
+ return !!walletVersion && cmp(walletVersion, targetVersion) === 1;
4748
+ } catch (e) {
4749
+ console.error(e);
4750
+ return false;
4751
+ }
4752
+ }, [walletVersion, mobile]);
4744
4753
  const navigateToChat = ({ id: id2, title }) => {
4745
- const targetVersion = mobile.apple.device ? "5.3.2" : "5.3.0";
4746
- if (walletVersion && cmp(walletVersion, targetVersion) === 1) {
4754
+ if (isChatInWalletV2) {
4747
4755
  navigate(`/chat-in-wallet/${id2}`);
4748
4756
  } else {
4749
4757
  bridge.call("clickChat", { id: id2, title });
4750
4758
  }
4751
4759
  };
4752
- return { navigateToChat };
4760
+ return { navigateToChat, isChatInWalletV2 };
4753
4761
  };
4754
4762
  function ChatList({ inWallet, ...rest }) {
4755
4763
  const { t } = context.useLocaleContext();
@@ -5481,6 +5489,7 @@ var __publicField = (obj, key, value) => {
5481
5489
  }
5482
5490
  function ChatRoom({ chat, inWallet, ...rest }) {
5483
5491
  var _a2;
5492
+ const { isChatInWalletV2 } = useChatInWallet();
5484
5493
  const { t } = context.useLocaleContext();
5485
5494
  const theme = styles.useTheme();
5486
5495
  const downSm = material.useMediaQuery((currentTheme) => currentTheme.breakpoints.down("sm"));
@@ -5579,6 +5588,23 @@ var __publicField = (obj, key, value) => {
5579
5588
  ]
5580
5589
  }
5581
5590
  ),
5591
+ !!inWallet && isChatInWalletV2 && /* @__PURE__ */ jsxRuntime.jsxs(
5592
+ Box,
5593
+ {
5594
+ sx: {
5595
+ display: "flex",
5596
+ alignItems: "center",
5597
+ flex: "0 0 auto",
5598
+ height: 52,
5599
+ px: 2.5,
5600
+ borderBottom: "1px solid #e5e5e5"
5601
+ },
5602
+ children: [
5603
+ downSm && /* @__PURE__ */ jsxRuntime.jsx(Back, { iconOnly: true, url: "/chat-in-wallet" }),
5604
+ renderRoomHeader()
5605
+ ]
5606
+ }
5607
+ ),
5582
5608
  /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { flex: 1, overflow: "hidden", background: theme.palette.grey[50] }, children: /* @__PURE__ */ jsxRuntime.jsx(MessageList, { chat }) }),
5583
5609
  /* @__PURE__ */ jsxRuntime.jsx(
5584
5610
  Box,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@blocklet/discuss-kit-ux",
3
- "version": "1.6.244",
3
+ "version": "1.6.245",
4
4
  "files": [
5
5
  "dist"
6
6
  ],
@@ -30,8 +30,8 @@
30
30
  "dependencies": {
31
31
  "@arcblock/bridge": "^2.9.77",
32
32
  "@arcblock/ws": "^1.18.116",
33
- "@blocklet/editor": "1.6.244",
34
- "@blocklet/labels": "1.6.244",
33
+ "@blocklet/editor": "1.6.245",
34
+ "@blocklet/labels": "1.6.245",
35
35
  "@blocklet/uploader": "^0.1.2",
36
36
  "@emotion/css": "^11.10.5",
37
37
  "@emotion/react": "^11.10.5",
@@ -98,5 +98,5 @@
98
98
  "resolutions": {
99
99
  "react": "^18.2.0"
100
100
  },
101
- "gitHead": "fad7100cf972c615bb08aaa6a7a033ec296c4e66"
101
+ "gitHead": "87265401750c03562e906c006dd94f46e28b1b3a"
102
102
  }