@blocklet/discuss-kit-ux 2.4.7 → 2.4.9
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.
- package/dist/components/auto-translate/store.d.ts +1 -1
- package/dist/components/blog/index.d.ts +1 -1
- package/dist/components/blog/permalink.d.ts +2 -1
- package/dist/{editor-CDCMSBkq.mjs → editor-CNbLg21V.mjs} +1 -1
- package/dist/{index-CMUop2jt.mjs → index--sBlM7vl.mjs} +31 -28
- package/dist/index.es.js +2 -2
- package/dist/index.umd.js +30 -27
- package/package.json +9 -9
|
@@ -17,5 +17,5 @@ export declare const useAutoTranslateStore: import('zustand').UseBoundStore<Omit
|
|
|
17
17
|
getOptions: () => Partial<import('zustand/middleware').PersistOptions<State & Action, State & Action>>;
|
|
18
18
|
};
|
|
19
19
|
}>;
|
|
20
|
-
export declare const useTargetLanguage: () =>
|
|
20
|
+
export declare const useTargetLanguage: () => string;
|
|
21
21
|
export {};
|
|
@@ -2,6 +2,7 @@ import { BoxProps } from '@mui/material';
|
|
|
2
2
|
interface Props extends Omit<BoxProps, 'onChange'> {
|
|
3
3
|
slug: string;
|
|
4
4
|
onChange: (slug: string) => void;
|
|
5
|
+
prefix?: string;
|
|
5
6
|
}
|
|
6
|
-
export declare function
|
|
7
|
+
export declare function PostPermaLink({ slug, onChange, prefix, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
7
8
|
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 { lazyRetry } from "@arcblock/ux/lib/Util";
|
|
7
|
-
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, g as getExcerptSync, s as stringify } from "./index
|
|
7
|
+
import { i as inferInitialEditorState, I as ImagePathFixerPlugin, V as VideoPathFixerPlugin, a as isEmptyContent, g as getExcerptSync, s as stringify } from "./index--sBlM7vl.mjs";
|
|
8
8
|
const BlockletEditor = lazyRetry(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|
|
@@ -1056,7 +1056,7 @@ function Badge({
|
|
|
1056
1056
|
const { badgeName, badgeIcon, badgeColor, badgeBackground } = item;
|
|
1057
1057
|
let icon;
|
|
1058
1058
|
if (badgeIcon) {
|
|
1059
|
-
const isHttpIcon = ["http", "/", "data"].some((
|
|
1059
|
+
const isHttpIcon = ["http", "/", "data"].some((prefix) => badgeIcon.startsWith(prefix));
|
|
1060
1060
|
const badgeIconStyle = showIconOnly ? iconOnlyStyle : iconStyle;
|
|
1061
1061
|
if (!isHttpIcon) {
|
|
1062
1062
|
icon = /* @__PURE__ */ jsx(Icon, { className: "badge-icon", icon: badgeIcon, color: badgeColor, style: { ...badgeIconStyle } });
|
|
@@ -2723,7 +2723,7 @@ function Comment({
|
|
|
2723
2723
|
};
|
|
2724
2724
|
const render = ({ post, interactive }) => {
|
|
2725
2725
|
return /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
2726
|
-
post.pinnedAt && /* @__PURE__ */ jsx(Box$1, { sx: { display: "flex", alignItems: "end", gap: 3, mt: 1 }, children: /* @__PURE__ */ jsxs(
|
|
2726
|
+
post.pinnedAt && /* @__PURE__ */ jsx(Box$1, { sx: { display: "flex", alignItems: "end", gap: 3, mt: 1, mb: 1 }, children: /* @__PURE__ */ jsxs(
|
|
2727
2727
|
Box$1,
|
|
2728
2728
|
{
|
|
2729
2729
|
component: "span",
|
|
@@ -3312,10 +3312,10 @@ function CommentList(props) {
|
|
|
3312
3312
|
}
|
|
3313
3313
|
const materialSymbolsUpload = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z" }) });
|
|
3314
3314
|
const getUploadedImageUrl = (imageUrl, width = 320) => {
|
|
3315
|
-
const
|
|
3315
|
+
const prefix = joinURL(window.blocklet?.prefix || "/", "uploads");
|
|
3316
3316
|
let result = imageUrl;
|
|
3317
|
-
if (imageUrl && imageUrl.startsWith("/") && !imageUrl.startsWith(
|
|
3318
|
-
result = joinURL(
|
|
3317
|
+
if (imageUrl && imageUrl.startsWith("/") && !imageUrl.startsWith(prefix)) {
|
|
3318
|
+
result = joinURL(prefix, imageUrl);
|
|
3319
3319
|
const tmp = new URL(result, window.location.origin);
|
|
3320
3320
|
if (!imageUrl.endsWith(".gif")) {
|
|
3321
3321
|
tmp.searchParams.set("imageFilter", "resize");
|
|
@@ -4019,8 +4019,8 @@ function BlogListWrapper({
|
|
|
4019
4019
|
}
|
|
4020
4020
|
return /* @__PURE__ */ jsx(BlogList, { ...rest });
|
|
4021
4021
|
}
|
|
4022
|
-
const
|
|
4023
|
-
function
|
|
4022
|
+
const baseURL$1 = joinURL(window.location.origin, discussKitMountPoint || "");
|
|
4023
|
+
function PostPermaLink({ slug, onChange, prefix = "blog", ...rest }) {
|
|
4024
4024
|
return /* @__PURE__ */ jsx(Box, { ...rest, className: "blog-permalink-container", children: /* @__PURE__ */ jsxs(
|
|
4025
4025
|
Box,
|
|
4026
4026
|
{
|
|
@@ -4039,16 +4039,16 @@ function BlogPermaLink({ slug, onChange, ...rest }) {
|
|
|
4039
4039
|
sx: {
|
|
4040
4040
|
display: "flex",
|
|
4041
4041
|
alignItems: "center",
|
|
4042
|
-
width:
|
|
4042
|
+
width: 140,
|
|
4043
4043
|
alignSelf: "stretch",
|
|
4044
4044
|
px: 1.25,
|
|
4045
|
-
bgcolor: "grey.
|
|
4045
|
+
bgcolor: "grey.100"
|
|
4046
4046
|
},
|
|
4047
4047
|
children: /* @__PURE__ */ jsx(
|
|
4048
4048
|
Box,
|
|
4049
4049
|
{
|
|
4050
4050
|
component: "input",
|
|
4051
|
-
value: prefix,
|
|
4051
|
+
value: joinURL(baseURL$1, prefix),
|
|
4052
4052
|
readOnly: true,
|
|
4053
4053
|
sx: {
|
|
4054
4054
|
width: 1,
|
|
@@ -4077,7 +4077,7 @@ function BlogPermaLink({ slug, onChange, ...rest }) {
|
|
|
4077
4077
|
{
|
|
4078
4078
|
sx: { px: 1 },
|
|
4079
4079
|
onClick: () => {
|
|
4080
|
-
copy(joinURL(prefix, slug));
|
|
4080
|
+
copy(joinURL(baseURL$1, prefix, slug));
|
|
4081
4081
|
},
|
|
4082
4082
|
children: /* @__PURE__ */ jsx(ContentCopy, { sx: { fontSize: 18 } })
|
|
4083
4083
|
}
|
|
@@ -5210,7 +5210,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, icon, ...rest }) {
|
|
|
5210
5210
|
}
|
|
5211
5211
|
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" }) });
|
|
5212
5212
|
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" }) });
|
|
5213
|
-
const Editor = lazyRetry(() => import("./editor-
|
|
5213
|
+
const Editor = lazyRetry(() => import("./editor-CNbLg21V.mjs"));
|
|
5214
5214
|
function LazyEditor(props) {
|
|
5215
5215
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
5216
5216
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
|
@@ -6166,15 +6166,18 @@ function ChatHeaderAddon({ ...rest }) {
|
|
|
6166
6166
|
if (!preferences.enableNotificationBadge || !preferences.chatEnabled) {
|
|
6167
6167
|
return null;
|
|
6168
6168
|
}
|
|
6169
|
-
return
|
|
6170
|
-
|
|
6171
|
-
|
|
6172
|
-
|
|
6173
|
-
|
|
6174
|
-
|
|
6175
|
-
|
|
6176
|
-
|
|
6177
|
-
|
|
6169
|
+
return (
|
|
6170
|
+
// @ts-expect-error
|
|
6171
|
+
/* @__PURE__ */ jsx(
|
|
6172
|
+
AddonButton,
|
|
6173
|
+
{
|
|
6174
|
+
size: "medium",
|
|
6175
|
+
icon: /* @__PURE__ */ jsx(Badge$1, { color: "error", invisible: !unread, badgeContent: unreadMessageCount, children: /* @__PURE__ */ jsx(tablerMessageCircle, {}) }),
|
|
6176
|
+
...rest,
|
|
6177
|
+
component: Link,
|
|
6178
|
+
to: "/chat"
|
|
6179
|
+
}
|
|
6180
|
+
)
|
|
6178
6181
|
);
|
|
6179
6182
|
}
|
|
6180
6183
|
const materialSymbolsEditOutline = (props) => /* @__PURE__ */ jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsx("path", { fill: "currentColor", d: "M5 19h1.425L16.2 9.225L14.775 7.8L5 17.575zm-2 2v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM19 6.4L17.6 5zm-3.525 2.125l-.7-.725L16.2 9.225z" }) });
|
|
@@ -6819,8 +6822,8 @@ const boxAnimation = {
|
|
|
6819
6822
|
layers
|
|
6820
6823
|
};
|
|
6821
6824
|
let client;
|
|
6822
|
-
function create(
|
|
6823
|
-
const pathPrefix =
|
|
6825
|
+
function create(prefix) {
|
|
6826
|
+
const pathPrefix = prefix;
|
|
6824
6827
|
const url = `//${window.location.host}${pathPrefix.replace(/\/$/, "")}`;
|
|
6825
6828
|
return new WsClient(url, {
|
|
6826
6829
|
heartbeatIntervalMs: 10 * 1e3,
|
|
@@ -6832,18 +6835,18 @@ function create(prefix2) {
|
|
|
6832
6835
|
}
|
|
6833
6836
|
});
|
|
6834
6837
|
}
|
|
6835
|
-
function getWsClient(
|
|
6838
|
+
function getWsClient(prefix = window.blocklet?.prefix || "/") {
|
|
6836
6839
|
if (!client) {
|
|
6837
|
-
client = create(
|
|
6840
|
+
client = create(prefix);
|
|
6838
6841
|
}
|
|
6839
6842
|
return client;
|
|
6840
6843
|
}
|
|
6841
6844
|
const useSubscription = (event, cb = () => {
|
|
6842
|
-
}, deps = [],
|
|
6845
|
+
}, deps = [], prefix = window.blocklet?.prefix || "/") => {
|
|
6843
6846
|
useEffect(() => {
|
|
6844
6847
|
if (event) {
|
|
6845
6848
|
if (!client) {
|
|
6846
|
-
client = getWsClient(
|
|
6849
|
+
client = getWsClient(prefix);
|
|
6847
6850
|
}
|
|
6848
6851
|
client.on(event, cb);
|
|
6849
6852
|
return () => {
|
|
@@ -7526,7 +7529,7 @@ export {
|
|
|
7526
7529
|
BlogListWrapper as L,
|
|
7527
7530
|
Menu as M,
|
|
7528
7531
|
BlogCard as N,
|
|
7529
|
-
|
|
7532
|
+
PostPermaLink as O,
|
|
7530
7533
|
Pagination as P,
|
|
7531
7534
|
getBlogLink as Q,
|
|
7532
7535
|
RelativeTime as R,
|
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,
|
|
2
|
+
import { W, o, Y, aQ, A, n, af, B, G, N, L, 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, O, 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--sBlM7vl.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
|
@@ -20,7 +20,6 @@ export {
|
|
|
20
20
|
G as BinaryThumb,
|
|
21
21
|
N as BlogCard,
|
|
22
22
|
L as BlogList,
|
|
23
|
-
O as BlogPermaLink,
|
|
24
23
|
ar as ButtonGroup,
|
|
25
24
|
_ as Chat,
|
|
26
25
|
Z as ChatClient,
|
|
@@ -59,6 +58,7 @@ export {
|
|
|
59
58
|
aR as PostAutoTranslatePlugin,
|
|
60
59
|
aS as PostAutoTranslationContainer,
|
|
61
60
|
v as PostContent,
|
|
61
|
+
O as PostPermaLink,
|
|
62
62
|
aE as ProfileCard,
|
|
63
63
|
aF as ProfileCardTooltip,
|
|
64
64
|
R as RelativeTime,
|
package/dist/index.umd.js
CHANGED
|
@@ -975,7 +975,7 @@
|
|
|
975
975
|
const { badgeName, badgeIcon, badgeColor, badgeBackground } = item;
|
|
976
976
|
let icon;
|
|
977
977
|
if (badgeIcon) {
|
|
978
|
-
const isHttpIcon = ["http", "/", "data"].some((
|
|
978
|
+
const isHttpIcon = ["http", "/", "data"].some((prefix) => badgeIcon.startsWith(prefix));
|
|
979
979
|
const badgeIconStyle = showIconOnly ? iconOnlyStyle : iconStyle;
|
|
980
980
|
if (!isHttpIcon) {
|
|
981
981
|
icon = /* @__PURE__ */ jsxRuntime.jsx(react$1.Icon, { className: "badge-icon", icon: badgeIcon, color: badgeColor, style: { ...badgeIconStyle } });
|
|
@@ -2642,7 +2642,7 @@
|
|
|
2642
2642
|
};
|
|
2643
2643
|
const render = ({ post, interactive }) => {
|
|
2644
2644
|
return /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
2645
|
-
post.pinnedAt && /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", alignItems: "end", gap: 3, mt: 1 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2645
|
+
post.pinnedAt && /* @__PURE__ */ jsxRuntime.jsx(Box, { sx: { display: "flex", alignItems: "end", gap: 3, mt: 1, mb: 1 }, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2646
2646
|
Box,
|
|
2647
2647
|
{
|
|
2648
2648
|
component: "span",
|
|
@@ -3231,10 +3231,10 @@
|
|
|
3231
3231
|
}
|
|
3232
3232
|
const materialSymbolsUpload = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "M11 16V7.85l-2.6 2.6L7 9l5-5l5 5l-1.4 1.45l-2.6-2.6V16zm-5 4q-.825 0-1.412-.587T4 18v-3h2v3h12v-3h2v3q0 .825-.587 1.413T18 20z" }) });
|
|
3233
3233
|
const getUploadedImageUrl = (imageUrl, width = 320) => {
|
|
3234
|
-
const
|
|
3234
|
+
const prefix = ufo.joinURL(window.blocklet?.prefix || "/", "uploads");
|
|
3235
3235
|
let result = imageUrl;
|
|
3236
|
-
if (imageUrl && imageUrl.startsWith("/") && !imageUrl.startsWith(
|
|
3237
|
-
result = ufo.joinURL(
|
|
3236
|
+
if (imageUrl && imageUrl.startsWith("/") && !imageUrl.startsWith(prefix)) {
|
|
3237
|
+
result = ufo.joinURL(prefix, imageUrl);
|
|
3238
3238
|
const tmp = new URL(result, window.location.origin);
|
|
3239
3239
|
if (!imageUrl.endsWith(".gif")) {
|
|
3240
3240
|
tmp.searchParams.set("imageFilter", "resize");
|
|
@@ -3938,8 +3938,8 @@
|
|
|
3938
3938
|
}
|
|
3939
3939
|
return /* @__PURE__ */ jsxRuntime.jsx(BlogList, { ...rest });
|
|
3940
3940
|
}
|
|
3941
|
-
const
|
|
3942
|
-
function
|
|
3941
|
+
const baseURL$1 = ufo.joinURL(window.location.origin, discussKitMountPoint || "");
|
|
3942
|
+
function PostPermaLink({ slug, onChange, prefix = "blog", ...rest }) {
|
|
3943
3943
|
return /* @__PURE__ */ jsxRuntime.jsx(material.Box, { ...rest, className: "blog-permalink-container", children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
3944
3944
|
material.Box,
|
|
3945
3945
|
{
|
|
@@ -3958,16 +3958,16 @@
|
|
|
3958
3958
|
sx: {
|
|
3959
3959
|
display: "flex",
|
|
3960
3960
|
alignItems: "center",
|
|
3961
|
-
width:
|
|
3961
|
+
width: 140,
|
|
3962
3962
|
alignSelf: "stretch",
|
|
3963
3963
|
px: 1.25,
|
|
3964
|
-
bgcolor: "grey.
|
|
3964
|
+
bgcolor: "grey.100"
|
|
3965
3965
|
},
|
|
3966
3966
|
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
3967
3967
|
material.Box,
|
|
3968
3968
|
{
|
|
3969
3969
|
component: "input",
|
|
3970
|
-
value: prefix,
|
|
3970
|
+
value: ufo.joinURL(baseURL$1, prefix),
|
|
3971
3971
|
readOnly: true,
|
|
3972
3972
|
sx: {
|
|
3973
3973
|
width: 1,
|
|
@@ -3996,7 +3996,7 @@
|
|
|
3996
3996
|
{
|
|
3997
3997
|
sx: { px: 1 },
|
|
3998
3998
|
onClick: () => {
|
|
3999
|
-
copy(ufo.joinURL(prefix, slug));
|
|
3999
|
+
copy(ufo.joinURL(baseURL$1, prefix, slug));
|
|
4000
4000
|
},
|
|
4001
4001
|
children: /* @__PURE__ */ jsxRuntime.jsx(iconsMaterial.ContentCopy, { sx: { fontSize: 18 } })
|
|
4002
4002
|
}
|
|
@@ -6085,15 +6085,18 @@
|
|
|
6085
6085
|
if (!preferences.enableNotificationBadge || !preferences.chatEnabled) {
|
|
6086
6086
|
return null;
|
|
6087
6087
|
}
|
|
6088
|
-
return
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6088
|
+
return (
|
|
6089
|
+
// @ts-expect-error
|
|
6090
|
+
/* @__PURE__ */ jsxRuntime.jsx(
|
|
6091
|
+
addonButton.AddonButton,
|
|
6092
|
+
{
|
|
6093
|
+
size: "medium",
|
|
6094
|
+
icon: /* @__PURE__ */ jsxRuntime.jsx(material.Badge, { color: "error", invisible: !unread, badgeContent: unreadMessageCount, children: /* @__PURE__ */ jsxRuntime.jsx(tablerMessageCircle, {}) }),
|
|
6095
|
+
...rest,
|
|
6096
|
+
component: reactRouterDom.Link,
|
|
6097
|
+
to: "/chat"
|
|
6098
|
+
}
|
|
6099
|
+
)
|
|
6097
6100
|
);
|
|
6098
6101
|
}
|
|
6099
6102
|
const materialSymbolsEditOutline = (props) => /* @__PURE__ */ jsxRuntime.jsx("svg", { viewBox: "0 0 24 24", width: "1.2em", height: "1.2em", ...props, children: /* @__PURE__ */ jsxRuntime.jsx("path", { fill: "currentColor", d: "M5 19h1.425L16.2 9.225L14.775 7.8L5 17.575zm-2 2v-4.25L16.2 3.575q.3-.275.663-.425t.762-.15t.775.15t.65.45L20.425 5q.3.275.438.65T21 6.4q0 .4-.137.763t-.438.662L7.25 21zM19 6.4L17.6 5zm-3.525 2.125l-.7-.725L16.2 9.225z" }) });
|
|
@@ -6738,8 +6741,8 @@
|
|
|
6738
6741
|
layers
|
|
6739
6742
|
};
|
|
6740
6743
|
let client;
|
|
6741
|
-
function create(
|
|
6742
|
-
const pathPrefix =
|
|
6744
|
+
function create(prefix) {
|
|
6745
|
+
const pathPrefix = prefix;
|
|
6743
6746
|
const url = `//${window.location.host}${pathPrefix.replace(/\/$/, "")}`;
|
|
6744
6747
|
return new ws.WsClient(url, {
|
|
6745
6748
|
heartbeatIntervalMs: 10 * 1e3,
|
|
@@ -6751,18 +6754,18 @@
|
|
|
6751
6754
|
}
|
|
6752
6755
|
});
|
|
6753
6756
|
}
|
|
6754
|
-
function getWsClient(
|
|
6757
|
+
function getWsClient(prefix = window.blocklet?.prefix || "/") {
|
|
6755
6758
|
if (!client) {
|
|
6756
|
-
client = create(
|
|
6759
|
+
client = create(prefix);
|
|
6757
6760
|
}
|
|
6758
6761
|
return client;
|
|
6759
6762
|
}
|
|
6760
6763
|
const useSubscription = (event, cb = () => {
|
|
6761
|
-
}, deps = [],
|
|
6764
|
+
}, deps = [], prefix = window.blocklet?.prefix || "/") => {
|
|
6762
6765
|
react.useEffect(() => {
|
|
6763
6766
|
if (event) {
|
|
6764
6767
|
if (!client) {
|
|
6765
|
-
client = getWsClient(
|
|
6768
|
+
client = getWsClient(prefix);
|
|
6766
6769
|
}
|
|
6767
6770
|
client.on(event, cb);
|
|
6768
6771
|
return () => {
|
|
@@ -7479,7 +7482,6 @@
|
|
|
7479
7482
|
exports2.BinaryThumb = BinaryThumb;
|
|
7480
7483
|
exports2.BlogCard = BlogCard;
|
|
7481
7484
|
exports2.BlogList = BlogListWrapper;
|
|
7482
|
-
exports2.BlogPermaLink = BlogPermaLink;
|
|
7483
7485
|
exports2.ButtonGroup = ButtonGroup;
|
|
7484
7486
|
exports2.Chat = Chat;
|
|
7485
7487
|
exports2.ChatClient = ChatClient;
|
|
@@ -7518,6 +7520,7 @@
|
|
|
7518
7520
|
exports2.PostAutoTranslatePlugin = PostAutoTranslatePlugin;
|
|
7519
7521
|
exports2.PostAutoTranslationContainer = PostAutoTranslationContainer;
|
|
7520
7522
|
exports2.PostContent = PostContent;
|
|
7523
|
+
exports2.PostPermaLink = PostPermaLink;
|
|
7521
7524
|
exports2.ProfileCard = ProfileCard;
|
|
7522
7525
|
exports2.ProfileCardTooltip = ProfileCardTooltip;
|
|
7523
7526
|
exports2.RelativeTime = RelativeTime;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.9",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -18,11 +18,11 @@
|
|
|
18
18
|
"access": "public"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@arcblock/bridge": "^3.0.
|
|
22
|
-
"@arcblock/react-hooks": "^3.0.
|
|
23
|
-
"@arcblock/ws": "^1.20.
|
|
24
|
-
"@blocklet/js-sdk": "^1.16.
|
|
25
|
-
"@blocklet/uploader": "^0.
|
|
21
|
+
"@arcblock/bridge": "^3.0.22",
|
|
22
|
+
"@arcblock/react-hooks": "^3.0.22",
|
|
23
|
+
"@arcblock/ws": "^1.20.15",
|
|
24
|
+
"@blocklet/js-sdk": "^1.16.45",
|
|
25
|
+
"@blocklet/uploader": "^0.2.4",
|
|
26
26
|
"@emotion/css": "^11.13.5",
|
|
27
27
|
"@emotion/react": "^11.14.0",
|
|
28
28
|
"@emotion/styled": "^11.14.1",
|
|
@@ -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.4.
|
|
52
|
-
"@blocklet/labels": "^2.4.
|
|
51
|
+
"@blocklet/editor": "^2.4.9",
|
|
52
|
+
"@blocklet/labels": "^2.4.9"
|
|
53
53
|
},
|
|
54
54
|
"peerDependencies": {
|
|
55
55
|
"@arcblock/did-connect": "^3.0.1",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"devDependencies": {
|
|
67
67
|
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
68
68
|
"@babel/core": "^7.25.2",
|
|
69
|
-
"@blocklet/sdk": "^1.16.
|
|
69
|
+
"@blocklet/sdk": "^1.16.45",
|
|
70
70
|
"@iconify-json/iconoir": "^1.2.1",
|
|
71
71
|
"@iconify-json/material-symbols": "^1.2.1",
|
|
72
72
|
"@iconify-json/mdi": "^1.2.0",
|