@blocklet/discuss-kit-ux 2.3.88 → 2.3.90
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-
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-B4yCNZSD.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,
|
|
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,
|
|
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";
|
|
@@ -1789,7 +1789,8 @@ const DISCUSS_KIT_DID = "z8ia1WEiBZ7hxURf6LwH21Wpg99vophFwSJdu";
|
|
|
1789
1789
|
function hashText(text = "") {
|
|
1790
1790
|
return murmurhash.v3(text).toString(16);
|
|
1791
1791
|
}
|
|
1792
|
-
const
|
|
1792
|
+
const autoTranslationAID = window.blocklet.preferences.inlineTranslatorAgentAid || window.blocklet.AUTO_TRANSLATION_AID;
|
|
1793
|
+
const isInlineTranslationAvailable = blockletExists([AIGNE_RUNTIME_DID, AIGNE_STUDIO_DID, DISCUSS_KIT_DID]) && !!autoTranslationAID;
|
|
1793
1794
|
function detectLanguageIso6391(src) {
|
|
1794
1795
|
return null;
|
|
1795
1796
|
}
|
|
@@ -5092,7 +5093,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
|
|
|
5092
5093
|
}
|
|
5093
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" }) });
|
|
5094
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" }) });
|
|
5095
|
-
const Editor = lazyRetry(() => import("./editor-
|
|
5096
|
+
const Editor = lazyRetry(() => import("./editor-C1B4rEI2.mjs"));
|
|
5096
5097
|
function LazyEditor(props) {
|
|
5097
5098
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
5098
5099
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
|
@@ -5911,7 +5912,17 @@ function ChatInWallet({ sx, ...rest }) {
|
|
|
5911
5912
|
};
|
|
5912
5913
|
}, [downMd, activeChatId]);
|
|
5913
5914
|
if (!initialized) {
|
|
5914
|
-
return /* @__PURE__ */ jsx(
|
|
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
|
+
);
|
|
5915
5926
|
}
|
|
5916
5927
|
const mergedSx = [
|
|
5917
5928
|
{ display: "flex", height: "100%", bgcolor: "background.default" },
|
|
@@ -5940,32 +5951,12 @@ function Empty({ sx }) {
|
|
|
5940
5951
|
/* @__PURE__ */ jsx(Box$1, { component: "span", sx: { fontSize: 14, fontWeight: 500 }, children: t("chat.noChats") })
|
|
5941
5952
|
] });
|
|
5942
5953
|
}
|
|
5943
|
-
function DrawerInner(props) {
|
|
5944
|
-
const ref = useRef(null);
|
|
5945
|
-
useEffect(() => {
|
|
5946
|
-
const onTouchMove = (e) => {
|
|
5947
|
-
var _a2;
|
|
5948
|
-
if ((_a2 = window == null ? void 0 : window.getSelection()) == null ? void 0 : _a2.toString()) {
|
|
5949
|
-
e.stopPropagation();
|
|
5950
|
-
}
|
|
5951
|
-
};
|
|
5952
|
-
if (ref.current) {
|
|
5953
|
-
ref.current.addEventListener("touchmove", onTouchMove);
|
|
5954
|
-
return () => {
|
|
5955
|
-
document.removeEventListener("touchmove", onTouchMove);
|
|
5956
|
-
};
|
|
5957
|
-
}
|
|
5958
|
-
return () => {
|
|
5959
|
-
};
|
|
5960
|
-
}, []);
|
|
5961
|
-
return /* @__PURE__ */ jsx(Box$1, { ref, ...props });
|
|
5962
|
-
}
|
|
5963
5954
|
function ChatListInWallet({ sx, ...rest }) {
|
|
5964
|
-
var _a2, _b2, _c2
|
|
5955
|
+
var _a2, _b2, _c2;
|
|
5965
5956
|
const { session } = useSessionContext();
|
|
5966
|
-
const { initialized, chats
|
|
5957
|
+
const { initialized, chats } = useChatContext();
|
|
5967
5958
|
const { unreadMessageCount } = useUnreadNotification();
|
|
5968
|
-
const {
|
|
5959
|
+
const { updateUnreadState, isWebNavbar } = useChatInWallet();
|
|
5969
5960
|
useEffect(() => {
|
|
5970
5961
|
updateUnreadState({ unread: unreadMessageCount > 0, unreadMessageCount });
|
|
5971
5962
|
}, [unreadMessageCount, updateUnreadState]);
|
|
@@ -6038,32 +6029,7 @@ function ChatListInWallet({ sx, ...rest }) {
|
|
|
6038
6029
|
] }),
|
|
6039
6030
|
/* @__PURE__ */ jsx(Divider, {}),
|
|
6040
6031
|
!!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsx(ChatList, { sx: { flex: 1, overflowY: "auto" }, inWallet: true }),
|
|
6041
|
-
!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsx(Empty, { sx: { flex: 1 } })
|
|
6042
|
-
/* @__PURE__ */ jsx(
|
|
6043
|
-
SwipeableDrawer,
|
|
6044
|
-
{
|
|
6045
|
-
disableSwipeToOpen: true,
|
|
6046
|
-
PaperProps: { sx: { width: 1 } },
|
|
6047
|
-
anchor: "right",
|
|
6048
|
-
open: !!activeChatId,
|
|
6049
|
-
onClose: () => navigateToChatList(),
|
|
6050
|
-
onOpen: () => {
|
|
6051
|
-
},
|
|
6052
|
-
children: /* @__PURE__ */ jsx(
|
|
6053
|
-
DrawerInner,
|
|
6054
|
-
{
|
|
6055
|
-
sx: {
|
|
6056
|
-
width: 1,
|
|
6057
|
-
height: 1,
|
|
6058
|
-
...((_d2 = window.chatInWallet) == null ? void 0 : _d2.safeAreaInsetTop) && {
|
|
6059
|
-
pt: `${window.chatInWallet.safeAreaInsetTop}px`
|
|
6060
|
-
}
|
|
6061
|
-
},
|
|
6062
|
-
children: /* @__PURE__ */ jsx(Outlet, {})
|
|
6063
|
-
}
|
|
6064
|
-
)
|
|
6065
|
-
}
|
|
6066
|
-
)
|
|
6032
|
+
!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsx(Empty, { sx: { flex: 1 } })
|
|
6067
6033
|
]
|
|
6068
6034
|
}
|
|
6069
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-
|
|
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-B4yCNZSD.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -1706,7 +1706,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1706
1706
|
function hashText(text2 = "") {
|
|
1707
1707
|
return murmurhash.v3(text2).toString(16);
|
|
1708
1708
|
}
|
|
1709
|
-
const
|
|
1709
|
+
const autoTranslationAID = window.blocklet.preferences.inlineTranslatorAgentAid || window.blocklet.AUTO_TRANSLATION_AID;
|
|
1710
|
+
const isInlineTranslationAvailable = blockletExists([AIGNE_RUNTIME_DID, AIGNE_STUDIO_DID, DISCUSS_KIT_DID]) && !!autoTranslationAID;
|
|
1710
1711
|
function detectLanguageIso6391(src) {
|
|
1711
1712
|
return null;
|
|
1712
1713
|
}
|
|
@@ -5828,7 +5829,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5828
5829
|
};
|
|
5829
5830
|
}, [downMd, activeChatId]);
|
|
5830
5831
|
if (!initialized) {
|
|
5831
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
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
|
+
);
|
|
5832
5843
|
}
|
|
5833
5844
|
const mergedSx = [
|
|
5834
5845
|
{ display: "flex", height: "100%", bgcolor: "background.default" },
|
|
@@ -5857,32 +5868,12 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5857
5868
|
/* @__PURE__ */ jsxRuntime.jsx(Box, { component: "span", sx: { fontSize: 14, fontWeight: 500 }, children: t("chat.noChats") })
|
|
5858
5869
|
] });
|
|
5859
5870
|
}
|
|
5860
|
-
function DrawerInner(props) {
|
|
5861
|
-
const ref = react.useRef(null);
|
|
5862
|
-
react.useEffect(() => {
|
|
5863
|
-
const onTouchMove = (e) => {
|
|
5864
|
-
var _a2;
|
|
5865
|
-
if ((_a2 = window == null ? void 0 : window.getSelection()) == null ? void 0 : _a2.toString()) {
|
|
5866
|
-
e.stopPropagation();
|
|
5867
|
-
}
|
|
5868
|
-
};
|
|
5869
|
-
if (ref.current) {
|
|
5870
|
-
ref.current.addEventListener("touchmove", onTouchMove);
|
|
5871
|
-
return () => {
|
|
5872
|
-
document.removeEventListener("touchmove", onTouchMove);
|
|
5873
|
-
};
|
|
5874
|
-
}
|
|
5875
|
-
return () => {
|
|
5876
|
-
};
|
|
5877
|
-
}, []);
|
|
5878
|
-
return /* @__PURE__ */ jsxRuntime.jsx(Box, { ref, ...props });
|
|
5879
|
-
}
|
|
5880
5871
|
function ChatListInWallet({ sx, ...rest }) {
|
|
5881
|
-
var _a2, _b2, _c2
|
|
5872
|
+
var _a2, _b2, _c2;
|
|
5882
5873
|
const { session } = useSessionContext();
|
|
5883
|
-
const { initialized, chats
|
|
5874
|
+
const { initialized, chats } = useChatContext();
|
|
5884
5875
|
const { unreadMessageCount } = useUnreadNotification();
|
|
5885
|
-
const {
|
|
5876
|
+
const { updateUnreadState, isWebNavbar } = useChatInWallet();
|
|
5886
5877
|
react.useEffect(() => {
|
|
5887
5878
|
updateUnreadState({ unread: unreadMessageCount > 0, unreadMessageCount });
|
|
5888
5879
|
}, [unreadMessageCount, updateUnreadState]);
|
|
@@ -5955,32 +5946,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
5955
5946
|
] }),
|
|
5956
5947
|
/* @__PURE__ */ jsxRuntime.jsx(material.Divider, {}),
|
|
5957
5948
|
!!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsxRuntime.jsx(ChatList, { sx: { flex: 1, overflowY: "auto" }, inWallet: true }),
|
|
5958
|
-
!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsxRuntime.jsx(Empty, { sx: { flex: 1 } })
|
|
5959
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
5960
|
-
material.SwipeableDrawer,
|
|
5961
|
-
{
|
|
5962
|
-
disableSwipeToOpen: true,
|
|
5963
|
-
PaperProps: { sx: { width: 1 } },
|
|
5964
|
-
anchor: "right",
|
|
5965
|
-
open: !!activeChatId,
|
|
5966
|
-
onClose: () => navigateToChatList(),
|
|
5967
|
-
onOpen: () => {
|
|
5968
|
-
},
|
|
5969
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
5970
|
-
DrawerInner,
|
|
5971
|
-
{
|
|
5972
|
-
sx: {
|
|
5973
|
-
width: 1,
|
|
5974
|
-
height: 1,
|
|
5975
|
-
...((_d2 = window.chatInWallet) == null ? void 0 : _d2.safeAreaInsetTop) && {
|
|
5976
|
-
pt: `${window.chatInWallet.safeAreaInsetTop}px`
|
|
5977
|
-
}
|
|
5978
|
-
},
|
|
5979
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(reactRouterDom.Outlet, {})
|
|
5980
|
-
}
|
|
5981
|
-
)
|
|
5982
|
-
}
|
|
5983
|
-
)
|
|
5949
|
+
!(chats == null ? void 0 : chats.length) && /* @__PURE__ */ jsxRuntime.jsx(Empty, { sx: { flex: 1 } })
|
|
5984
5950
|
]
|
|
5985
5951
|
}
|
|
5986
5952
|
) });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.3.
|
|
3
|
+
"version": "2.3.90",
|
|
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.
|
|
52
|
-
"@blocklet/labels": "^2.3.
|
|
51
|
+
"@blocklet/editor": "^2.3.90",
|
|
52
|
+
"@blocklet/labels": "^2.3.90"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@arcblock/did-connect": "^2.10.36",
|