@blocklet/discuss-kit-ux 2.0.161 → 2.0.163
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.
|
@@ -13,7 +13,7 @@ export interface PostProps {
|
|
|
13
13
|
autoCollapse?: boolean;
|
|
14
14
|
showProfileCard?: boolean;
|
|
15
15
|
className?: string;
|
|
16
|
-
|
|
16
|
+
resolveAuthorInfoAppend?: (post: Post) => React.ReactNode;
|
|
17
17
|
}
|
|
18
18
|
interface PostContext {
|
|
19
19
|
isAdmin: boolean;
|
|
@@ -21,5 +21,5 @@ interface PostContext {
|
|
|
21
21
|
interactive: boolean;
|
|
22
22
|
post: Post;
|
|
23
23
|
}
|
|
24
|
-
export default function PostComponent({ post, render, renderExtraContent, customMenu, interactive, onContentUpdate, allowCopyLink, autoCollapse, showProfileCard,
|
|
24
|
+
export default function PostComponent({ post, render, renderExtraContent, customMenu, interactive, onContentUpdate, allowCopyLink, autoCollapse, showProfileCard, resolveAuthorInfoAppend, ...rest }: PostProps): import("react/jsx-runtime").JSX.Element;
|
|
25
25
|
export {};
|
|
@@ -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-
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, s as stringify, g as getExcerptSync } from "./index-BjrIjCcP.mjs";
|
|
8
8
|
const BlockletEditor = lazy(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|
|
@@ -1227,27 +1227,29 @@ function ProfileCard({ user, click, ...rest }) {
|
|
|
1227
1227
|
);
|
|
1228
1228
|
}
|
|
1229
1229
|
const useChatInWallet = () => {
|
|
1230
|
+
var _a2;
|
|
1230
1231
|
const navigate = useNavigate();
|
|
1231
1232
|
const { walletVersion, mobile } = useBrowser();
|
|
1232
1233
|
const chatInWallet = useMatch("/chat-in-wallet/:chatId?");
|
|
1234
|
+
const isInArcSphere = ((_a2 = window == null ? void 0 : window.navigator) == null ? void 0 : _a2.userAgent.indexOf("ArcSphere")) > -1;
|
|
1233
1235
|
const isChatInWalletV2 = useMemo(() => {
|
|
1234
1236
|
try {
|
|
1235
1237
|
const targetVersion = mobile.apple.device ? "5.3.5" : "5.3.1";
|
|
1236
|
-
return !!walletVersion && cmp(walletVersion, targetVersion) === 1;
|
|
1238
|
+
return isInArcSphere || !!walletVersion && cmp(walletVersion, targetVersion) === 1;
|
|
1237
1239
|
} catch (e) {
|
|
1238
1240
|
console.error(e);
|
|
1239
1241
|
return false;
|
|
1240
1242
|
}
|
|
1241
|
-
}, [walletVersion, mobile]);
|
|
1243
|
+
}, [walletVersion, mobile, isInArcSphere]);
|
|
1242
1244
|
const isWebNavbar = useMemo(() => {
|
|
1243
1245
|
try {
|
|
1244
1246
|
const targetVersion = mobile.apple.device ? "5.4.6" : "5.4.4";
|
|
1245
|
-
return !!walletVersion && cmp(walletVersion, targetVersion) === 1;
|
|
1247
|
+
return isInArcSphere || !!walletVersion && cmp(walletVersion, targetVersion) === 1;
|
|
1246
1248
|
} catch (e) {
|
|
1247
1249
|
console.error(e);
|
|
1248
1250
|
return false;
|
|
1249
1251
|
}
|
|
1250
|
-
}, [walletVersion, mobile]);
|
|
1252
|
+
}, [walletVersion, mobile, isInArcSphere]);
|
|
1251
1253
|
const navigateToChat = ({ id: id2, title }) => {
|
|
1252
1254
|
if (isChatInWalletV2) {
|
|
1253
1255
|
navigate(`/chat-in-wallet/${id2}`);
|
|
@@ -1703,7 +1705,7 @@ function PostComponent({
|
|
|
1703
1705
|
allowCopyLink = false,
|
|
1704
1706
|
autoCollapse,
|
|
1705
1707
|
showProfileCard,
|
|
1706
|
-
|
|
1708
|
+
resolveAuthorInfoAppend = () => void 0,
|
|
1707
1709
|
...rest
|
|
1708
1710
|
}) {
|
|
1709
1711
|
var _a2;
|
|
@@ -1765,7 +1767,7 @@ function PostComponent({
|
|
|
1765
1767
|
user: post.author,
|
|
1766
1768
|
createdAt: renderTime(),
|
|
1767
1769
|
showProfileCard,
|
|
1768
|
-
append:
|
|
1770
|
+
append: resolveAuthorInfoAppend(post)
|
|
1769
1771
|
}
|
|
1770
1772
|
),
|
|
1771
1773
|
/* @__PURE__ */ jsx(Menu, { items: menuItems, style: { position: "absolute", right: 0, top: 0 } })
|
|
@@ -2465,7 +2467,7 @@ function Comment({
|
|
|
2465
2467
|
allowCopyLink: rest.allowCopyLink,
|
|
2466
2468
|
showProfileCard: rest.showProfileCard,
|
|
2467
2469
|
interactive: rest.interactive,
|
|
2468
|
-
|
|
2470
|
+
resolveAuthorInfoAppend: rest.resolveAuthorInfoAppend,
|
|
2469
2471
|
renderDonation,
|
|
2470
2472
|
renderActions
|
|
2471
2473
|
},
|
|
@@ -4713,7 +4715,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
|
|
|
4713
4715
|
}
|
|
4714
4716
|
const tablerSend = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", 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" }) });
|
|
4715
4717
|
const tablerLetterCase = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", "data-iconify": "tabler", 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" }) });
|
|
4716
|
-
const Editor = lazy(() => import("./editor-
|
|
4718
|
+
const Editor = lazy(() => import("./editor-WBSInDaE.mjs"));
|
|
4717
4719
|
function LazyEditor(props) {
|
|
4718
4720
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
4719
4721
|
/* @__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-
|
|
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-BjrIjCcP.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -1152,27 +1152,29 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1152
1152
|
);
|
|
1153
1153
|
}
|
|
1154
1154
|
const useChatInWallet = () => {
|
|
1155
|
+
var _a2;
|
|
1155
1156
|
const navigate = reactRouterDom.useNavigate();
|
|
1156
1157
|
const { walletVersion, mobile } = reactHooks.useBrowser();
|
|
1157
1158
|
const chatInWallet = reactRouterDom.useMatch("/chat-in-wallet/:chatId?");
|
|
1159
|
+
const isInArcSphere = ((_a2 = window == null ? void 0 : window.navigator) == null ? void 0 : _a2.userAgent.indexOf("ArcSphere")) > -1;
|
|
1158
1160
|
const isChatInWalletV2 = react.useMemo(() => {
|
|
1159
1161
|
try {
|
|
1160
1162
|
const targetVersion = mobile.apple.device ? "5.3.5" : "5.3.1";
|
|
1161
|
-
return !!walletVersion && cmp(walletVersion, targetVersion) === 1;
|
|
1163
|
+
return isInArcSphere || !!walletVersion && cmp(walletVersion, targetVersion) === 1;
|
|
1162
1164
|
} catch (e) {
|
|
1163
1165
|
console.error(e);
|
|
1164
1166
|
return false;
|
|
1165
1167
|
}
|
|
1166
|
-
}, [walletVersion, mobile]);
|
|
1168
|
+
}, [walletVersion, mobile, isInArcSphere]);
|
|
1167
1169
|
const isWebNavbar = react.useMemo(() => {
|
|
1168
1170
|
try {
|
|
1169
1171
|
const targetVersion = mobile.apple.device ? "5.4.6" : "5.4.4";
|
|
1170
|
-
return !!walletVersion && cmp(walletVersion, targetVersion) === 1;
|
|
1172
|
+
return isInArcSphere || !!walletVersion && cmp(walletVersion, targetVersion) === 1;
|
|
1171
1173
|
} catch (e) {
|
|
1172
1174
|
console.error(e);
|
|
1173
1175
|
return false;
|
|
1174
1176
|
}
|
|
1175
|
-
}, [walletVersion, mobile]);
|
|
1177
|
+
}, [walletVersion, mobile, isInArcSphere]);
|
|
1176
1178
|
const navigateToChat = ({ id: id2, title }) => {
|
|
1177
1179
|
if (isChatInWalletV2) {
|
|
1178
1180
|
navigate(`/chat-in-wallet/${id2}`);
|
|
@@ -1628,7 +1630,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1628
1630
|
allowCopyLink = false,
|
|
1629
1631
|
autoCollapse,
|
|
1630
1632
|
showProfileCard,
|
|
1631
|
-
|
|
1633
|
+
resolveAuthorInfoAppend = () => void 0,
|
|
1632
1634
|
...rest
|
|
1633
1635
|
}) {
|
|
1634
1636
|
var _a2;
|
|
@@ -1690,7 +1692,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1690
1692
|
user: post.author,
|
|
1691
1693
|
createdAt: renderTime(),
|
|
1692
1694
|
showProfileCard,
|
|
1693
|
-
append:
|
|
1695
|
+
append: resolveAuthorInfoAppend(post)
|
|
1694
1696
|
}
|
|
1695
1697
|
),
|
|
1696
1698
|
/* @__PURE__ */ jsxRuntime.jsx(Menu, { items: menuItems, style: { position: "absolute", right: 0, top: 0 } })
|
|
@@ -2390,7 +2392,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2390
2392
|
allowCopyLink: rest.allowCopyLink,
|
|
2391
2393
|
showProfileCard: rest.showProfileCard,
|
|
2392
2394
|
interactive: rest.interactive,
|
|
2393
|
-
|
|
2395
|
+
resolveAuthorInfoAppend: rest.resolveAuthorInfoAppend,
|
|
2394
2396
|
renderDonation,
|
|
2395
2397
|
renderActions
|
|
2396
2398
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.163",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@arcblock/bridge": "^2.10.28",
|
|
32
32
|
"@arcblock/react-hooks": "^2.10.28",
|
|
33
33
|
"@arcblock/ws": "^1.18.135",
|
|
34
|
-
"@blocklet/editor": "2.0.
|
|
35
|
-
"@blocklet/labels": "2.0.
|
|
34
|
+
"@blocklet/editor": "2.0.163",
|
|
35
|
+
"@blocklet/labels": "2.0.163",
|
|
36
36
|
"@blocklet/uploader": "^0.1.28",
|
|
37
37
|
"@emotion/css": "^11.10.5",
|
|
38
38
|
"@emotion/react": "^11.10.5",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"resolutions": {
|
|
101
101
|
"react": "^18.2.0"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "8a4a1e7b7fc29511f64954a7a05d5eff5eff1069"
|
|
104
104
|
}
|