@blocklet/discuss-kit-ux-lite 2.6.0
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/LICENSE +13 -0
- package/dist/axios.d.ts +8 -0
- package/dist/blocklets.d.ts +13 -0
- package/dist/blocklets.mjs +17 -0
- package/dist/components/api-error-handler/api-error-handler.d.ts +13 -0
- package/dist/components/api-error-handler/api-error-handler.mjs +25 -0
- package/dist/components/api-error-handler/default-handler.d.ts +8 -0
- package/dist/components/api-error-handler/default-handler.mjs +69 -0
- package/dist/components/api-error-handler/index.d.ts +2 -0
- package/dist/components/api-error-handler/index.mjs +2 -0
- package/dist/components/api-error-handler/json-validation-interceptor.d.ts +2 -0
- package/dist/components/api-error-handler/json-validation-interceptor.mjs +9 -0
- package/dist/components/arcsphere/index.d.ts +16 -0
- package/dist/components/arcsphere/index.mjs +52 -0
- package/dist/components/authz/access-control.d.ts +24 -0
- package/dist/components/authz/access-control.mjs +15 -0
- package/dist/components/authz/context.d.ts +13 -0
- package/dist/components/authz/context.mjs +30 -0
- package/dist/components/authz/index.d.ts +2 -0
- package/dist/components/authz/index.mjs +2 -0
- package/dist/components/auto-translate/api.d.ts +14 -0
- package/dist/components/auto-translate/api.mjs +23 -0
- package/dist/components/auto-translate/auto-translate-button.d.ts +5 -0
- package/dist/components/auto-translate/auto-translate-button.mjs +48 -0
- package/dist/components/auto-translate/editor-store-adaptor.d.ts +1 -0
- package/dist/components/auto-translate/editor-store-adaptor.mjs +14 -0
- package/dist/components/auto-translate/index.d.ts +6 -0
- package/dist/components/auto-translate/index.mjs +6 -0
- package/dist/components/auto-translate/languages.d.ts +13 -0
- package/dist/components/auto-translate/languages.mjs +61 -0
- package/dist/components/auto-translate/post-auto-translate-plugin.d.ts +14 -0
- package/dist/components/auto-translate/post-auto-translate-plugin.mjs +32 -0
- package/dist/components/auto-translate/store.d.ts +21 -0
- package/dist/components/auto-translate/store.mjs +23 -0
- package/dist/components/auto-translate/translate.d.ts +17 -0
- package/dist/components/auto-translate/translate.mjs +103 -0
- package/dist/components/auto-translate/utils.d.ts +4 -0
- package/dist/components/auto-translate/utils.mjs +14 -0
- package/dist/components/auto-translate/with-availibility-check.d.ts +2 -0
- package/dist/components/auto-translate/with-availibility-check.mjs +10 -0
- package/dist/components/avatars/author-info.d.ts +23 -0
- package/dist/components/avatars/author-info.mjs +178 -0
- package/dist/components/avatars/avatar.d.ts +7 -0
- package/dist/components/avatars/avatar.mjs +9 -0
- package/dist/components/avatars/avatars.d.ts +10 -0
- package/dist/components/avatars/avatars.mjs +49 -0
- package/dist/components/avatars/badge.d.ts +14 -0
- package/dist/components/avatars/badge.mjs +178 -0
- package/dist/components/avatars/index.d.ts +5 -0
- package/dist/components/avatars/index.mjs +5 -0
- package/dist/components/avatars/system-user.d.ts +10 -0
- package/dist/components/avatars/system-user.mjs +58 -0
- package/dist/components/button-group/button-group.d.ts +18 -0
- package/dist/components/button-group/button-group.mjs +195 -0
- package/dist/components/button-group/index.d.ts +1 -0
- package/dist/components/button-group/index.mjs +1 -0
- package/dist/components/confirm.d.ts +29 -0
- package/dist/components/confirm.mjs +103 -0
- package/dist/components/dayjs.d.ts +3 -0
- package/dist/components/dayjs.mjs +5 -0
- package/dist/components/default-editor-config-provider.d.ts +8 -0
- package/dist/components/default-editor-config-provider.mjs +108 -0
- package/dist/components/dirty-prompt.d.ts +8 -0
- package/dist/components/dirty-prompt.mjs +117 -0
- package/dist/components/editor/blocklet-editor.d.ts +1 -0
- package/dist/components/editor/blocklet-editor.mjs +1 -0
- package/dist/components/editor/editor.d.ts +17 -0
- package/dist/components/editor/editor.mjs +35 -0
- package/dist/components/editor/index.d.ts +4 -0
- package/dist/components/editor/index.mjs +3 -0
- package/dist/components/editor/lazy-editor.d.ts +3 -0
- package/dist/components/editor/lazy-editor.mjs +14 -0
- package/dist/components/editor/viewer.d.ts +10 -0
- package/dist/components/editor/viewer.mjs +18 -0
- package/dist/components/emoji-icon.d.ts +11 -0
- package/dist/components/emoji-icon.mjs +62 -0
- package/dist/components/empty-status/empty-status.d.ts +7 -0
- package/dist/components/empty-status/empty-status.mjs +24 -0
- package/dist/components/empty-status/index.d.ts +1 -0
- package/dist/components/empty-status/index.mjs +1 -0
- package/dist/components/hooks/changed.d.ts +10 -0
- package/dist/components/hooks/changed.mjs +34 -0
- package/dist/components/hooks/index.d.ts +6 -0
- package/dist/components/hooks/index.mjs +6 -0
- package/dist/components/hooks/interval.d.ts +6 -0
- package/dist/components/hooks/interval.mjs +16 -0
- package/dist/components/hooks/locale-context.d.ts +10 -0
- package/dist/components/hooks/locale-context.mjs +12 -0
- package/dist/components/hooks/measure.d.ts +5 -0
- package/dist/components/hooks/measure.mjs +8 -0
- package/dist/components/hooks/now.d.ts +1 -0
- package/dist/components/hooks/now.mjs +10 -0
- package/dist/components/hooks/responsive.d.ts +17 -0
- package/dist/components/hooks/responsive.mjs +25 -0
- package/dist/components/hooks/session.d.ts +12 -0
- package/dist/components/hooks/session.mjs +48 -0
- package/dist/components/hooks/use-event-callback.d.ts +1 -0
- package/dist/components/hooks/use-event-callback.mjs +14 -0
- package/dist/components/icon-button.d.ts +6 -0
- package/dist/components/icon-button.mjs +37 -0
- package/dist/components/input/auto-clear-plugin.d.ts +3 -0
- package/dist/components/input/auto-clear-plugin.mjs +20 -0
- package/dist/components/input/comment-input.d.ts +11 -0
- package/dist/components/input/comment-input.mjs +108 -0
- package/dist/components/input/index.d.ts +4 -0
- package/dist/components/input/index.mjs +4 -0
- package/dist/components/input/input.d.ts +29 -0
- package/dist/components/input/input.mjs +149 -0
- package/dist/components/input/post-edit.d.ts +10 -0
- package/dist/components/input/post-edit.mjs +49 -0
- package/dist/components/input/scrollable-editor-wrapper.d.ts +9 -0
- package/dist/components/input/scrollable-editor-wrapper.mjs +18 -0
- package/dist/components/input/shortcut-plugin.d.ts +7 -0
- package/dist/components/input/shortcut-plugin.mjs +28 -0
- package/dist/components/lexical.d.ts +10 -0
- package/dist/components/lexical.mjs +56 -0
- package/dist/components/locale/en.d.ts +117 -0
- package/dist/components/locale/en.mjs +116 -0
- package/dist/components/locale/index.d.ts +236 -0
- package/dist/components/locale/index.mjs +3 -0
- package/dist/components/locale/zh.d.ts +119 -0
- package/dist/components/locale/zh.mjs +118 -0
- package/dist/components/pagination.d.ts +12 -0
- package/dist/components/pagination.mjs +44 -0
- package/dist/components/posts/comment-list/comment-list.d.ts +5 -0
- package/dist/components/posts/comment-list/comment-list.mjs +163 -0
- package/dist/components/posts/comment-list/context.d.ts +76 -0
- package/dist/components/posts/comment-list/context.mjs +318 -0
- package/dist/components/posts/comment.d.ts +16 -0
- package/dist/components/posts/comment.mjs +184 -0
- package/dist/components/posts/index.d.ts +6 -0
- package/dist/components/posts/index.mjs +6 -0
- package/dist/components/posts/menu.d.ts +14 -0
- package/dist/components/posts/menu.mjs +83 -0
- package/dist/components/posts/post-content.d.ts +16 -0
- package/dist/components/posts/post-content.mjs +63 -0
- package/dist/components/posts/post.d.ts +26 -0
- package/dist/components/posts/post.mjs +198 -0
- package/dist/components/profile-card/index.d.ts +1 -0
- package/dist/components/profile-card/index.mjs +1 -0
- package/dist/components/profile-card/profile-card.d.ts +15 -0
- package/dist/components/profile-card/profile-card.mjs +140 -0
- package/dist/components/rating/binary-thumb.d.ts +9 -0
- package/dist/components/rating/binary-thumb.mjs +162 -0
- package/dist/components/rating/github-reaction-container.d.ts +9 -0
- package/dist/components/rating/github-reaction-container.mjs +46 -0
- package/dist/components/rating/github-reaction.d.ts +18 -0
- package/dist/components/rating/github-reaction.mjs +174 -0
- package/dist/components/rating/index.d.ts +3 -0
- package/dist/components/rating/index.mjs +3 -0
- package/dist/components/rating/rater-list.d.ts +10 -0
- package/dist/components/rating/rater-list.mjs +33 -0
- package/dist/components/rating/rating.d.ts +27 -0
- package/dist/components/rating/rating.mjs +50 -0
- package/dist/components/segmented-control.d.ts +14 -0
- package/dist/components/segmented-control.mjs +55 -0
- package/dist/components/shared/relative-time.d.ts +8 -0
- package/dist/components/shared/relative-time.mjs +21 -0
- package/dist/components/toast.d.ts +8 -0
- package/dist/components/toast.mjs +44 -0
- package/dist/components/uploader/index.d.ts +13 -0
- package/dist/components/uploader/index.mjs +70 -0
- package/dist/components/uploader/utils.d.ts +1 -0
- package/dist/components/uploader/utils.mjs +16 -0
- package/dist/components/utils.d.ts +22 -0
- package/dist/components/utils.mjs +103 -0
- package/dist/components/view-more.d.ts +4 -0
- package/dist/components/view-more.mjs +50 -0
- package/dist/constants.d.ts +5 -0
- package/dist/constants.mjs +14 -0
- package/dist/global.d.ts +1 -0
- package/dist/index.d.ts +29 -0
- package/dist/index.mjs +29 -0
- package/dist/preferences.d.ts +2 -0
- package/dist/preferences.mjs +9 -0
- package/dist/theme/index.d.ts +8 -0
- package/dist/theme/index.mjs +96 -0
- package/dist/theme/typography.d.ts +2 -0
- package/dist/theme/typography.mjs +66 -0
- package/dist/type-override.d.ts +7 -0
- package/dist/types.d.ts +84 -0
- package/dist/types.mjs +0 -0
- package/dist/vite-env.d.ts +1 -0
- package/dist/ws.d.ts +3 -0
- package/dist/ws.mjs +39 -0
- package/package.json +81 -0
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { jsx } from "react/jsx-runtime";
|
|
2
|
+
import { ThemeProvider, useTheme } from "@mui/material/styles";
|
|
3
|
+
import { create } from "@arcblock/ux/lib/Theme";
|
|
4
|
+
import { typography } from "./typography.mjs";
|
|
5
|
+
export { typography };
|
|
6
|
+
export const themeOverrides = {
|
|
7
|
+
shape: {
|
|
8
|
+
borderRadius: 8
|
|
9
|
+
},
|
|
10
|
+
components: {
|
|
11
|
+
MuiInputBase: {
|
|
12
|
+
defaultProps: {
|
|
13
|
+
size: "small"
|
|
14
|
+
},
|
|
15
|
+
styleOverrides: {
|
|
16
|
+
root: ({ theme }) => ({
|
|
17
|
+
fontSize: "0.875rem",
|
|
18
|
+
// 调小输入框字体大小 (16px -> 14px)
|
|
19
|
+
backgroundColor: theme.palette.grey[50]
|
|
20
|
+
})
|
|
21
|
+
}
|
|
22
|
+
},
|
|
23
|
+
MuiButton: {
|
|
24
|
+
defaultProps: {
|
|
25
|
+
size: "small",
|
|
26
|
+
disableElevation: true
|
|
27
|
+
},
|
|
28
|
+
styleOverrides: {
|
|
29
|
+
root: {
|
|
30
|
+
fontWeight: 500,
|
|
31
|
+
textTransform: "none"
|
|
32
|
+
},
|
|
33
|
+
outlinedPrimary: ({ theme }) => ({
|
|
34
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
35
|
+
backgroundColor: theme.palette.background.default,
|
|
36
|
+
"&:hover": {
|
|
37
|
+
border: `1px solid ${theme.palette.divider}`
|
|
38
|
+
}
|
|
39
|
+
}),
|
|
40
|
+
sizeSmall: {
|
|
41
|
+
height: 32
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
},
|
|
45
|
+
MuiIconButton: {
|
|
46
|
+
defaultProps: {
|
|
47
|
+
size: "small"
|
|
48
|
+
},
|
|
49
|
+
styleOverrides: {
|
|
50
|
+
root: {
|
|
51
|
+
textTransform: "none"
|
|
52
|
+
},
|
|
53
|
+
colorPrimary: ({ theme }) => ({
|
|
54
|
+
backgroundColor: theme.palette.background.default
|
|
55
|
+
})
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
MuiToggleButton: {
|
|
59
|
+
styleOverrides: {
|
|
60
|
+
root: {
|
|
61
|
+
textTransform: "none"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
MuiTab: {
|
|
66
|
+
styleOverrides: {
|
|
67
|
+
root: {
|
|
68
|
+
textTransform: "none"
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
MuiTooltip: {
|
|
73
|
+
defaultProps: {
|
|
74
|
+
enterTouchDelay: 3e3,
|
|
75
|
+
leaveTouchDelay: 100
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
MuiPopover: {
|
|
79
|
+
styleOverrides: {
|
|
80
|
+
paper: ({ theme }) => ({
|
|
81
|
+
border: `1px solid ${theme.palette.divider}`,
|
|
82
|
+
boxShadow: "0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1)"
|
|
83
|
+
})
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
export function InternalThemeProvider({ children }) {
|
|
89
|
+
const theme = useTheme();
|
|
90
|
+
const merged = create({
|
|
91
|
+
...theme,
|
|
92
|
+
typography: { ...theme.typography, ...typography },
|
|
93
|
+
...themeOverrides
|
|
94
|
+
});
|
|
95
|
+
return /* @__PURE__ */ jsx(ThemeProvider, { theme: merged, children });
|
|
96
|
+
}
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
export const typography = {
|
|
2
|
+
h1: {
|
|
3
|
+
fontSize: "1.875rem",
|
|
4
|
+
lineHeight: 1.2,
|
|
5
|
+
fontWeight: 700
|
|
6
|
+
// letterSpacing: '-.025em',
|
|
7
|
+
},
|
|
8
|
+
h2: {
|
|
9
|
+
fontSize: "1.5rem",
|
|
10
|
+
lineHeight: 1.3333333,
|
|
11
|
+
fontWeight: 700
|
|
12
|
+
// letterSpacing: '-.025em',
|
|
13
|
+
},
|
|
14
|
+
h3: {
|
|
15
|
+
fontSize: "1.25rem",
|
|
16
|
+
lineHeight: 1.4,
|
|
17
|
+
fontWeight: 700
|
|
18
|
+
// letterSpacing: '-.025em',
|
|
19
|
+
},
|
|
20
|
+
h4: {
|
|
21
|
+
fontSize: "1.125rem",
|
|
22
|
+
lineHeight: 1.55,
|
|
23
|
+
fontWeight: 600
|
|
24
|
+
},
|
|
25
|
+
h5: {
|
|
26
|
+
fontSize: "1rem",
|
|
27
|
+
lineHeight: 1.5,
|
|
28
|
+
fontWeight: 700
|
|
29
|
+
},
|
|
30
|
+
h6: {
|
|
31
|
+
fontSize: "0.875rem",
|
|
32
|
+
lineHeight: 1.43,
|
|
33
|
+
fontWeight: 700
|
|
34
|
+
},
|
|
35
|
+
subtitle1: {
|
|
36
|
+
fontSize: "1rem",
|
|
37
|
+
lineHeight: 1.5,
|
|
38
|
+
fontWeight: 500
|
|
39
|
+
},
|
|
40
|
+
subtitle2: {
|
|
41
|
+
fontSize: "0.875rem",
|
|
42
|
+
lineHeight: 1.43,
|
|
43
|
+
fontWeight: 500
|
|
44
|
+
},
|
|
45
|
+
body1: {
|
|
46
|
+
fontSize: "1rem",
|
|
47
|
+
lineHeight: 1.75
|
|
48
|
+
},
|
|
49
|
+
body2: {
|
|
50
|
+
fontSize: "0.875rem",
|
|
51
|
+
lineHeight: 1.43
|
|
52
|
+
},
|
|
53
|
+
caption: {
|
|
54
|
+
fontSize: "0.75rem",
|
|
55
|
+
lineHeight: 1.33
|
|
56
|
+
},
|
|
57
|
+
overline: {
|
|
58
|
+
fontSize: "0.75rem",
|
|
59
|
+
lineHeight: 1.33,
|
|
60
|
+
fontWeight: 500
|
|
61
|
+
},
|
|
62
|
+
fontWeightLight: 300,
|
|
63
|
+
fontWeightRegular: 400,
|
|
64
|
+
fontWeightMedium: 500,
|
|
65
|
+
fontWeightBold: 700
|
|
66
|
+
};
|
package/dist/types.d.ts
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
export interface User {
|
|
2
|
+
did: string;
|
|
3
|
+
fullName: string;
|
|
4
|
+
avatar?: string;
|
|
5
|
+
role?: string;
|
|
6
|
+
passports?: string[];
|
|
7
|
+
pointInfo?: any;
|
|
8
|
+
}
|
|
9
|
+
export interface Post {
|
|
10
|
+
id: string;
|
|
11
|
+
author: User;
|
|
12
|
+
content: string;
|
|
13
|
+
rating?: Rating[];
|
|
14
|
+
createdAt: Date;
|
|
15
|
+
updatedAt?: Date;
|
|
16
|
+
deletedAt?: Date;
|
|
17
|
+
objectId: string;
|
|
18
|
+
replies?: Post[];
|
|
19
|
+
totalReplies?: number;
|
|
20
|
+
replyTo?: User;
|
|
21
|
+
parentId?: string;
|
|
22
|
+
rootId?: string;
|
|
23
|
+
synced?: number;
|
|
24
|
+
pinnedAt?: Date | null;
|
|
25
|
+
}
|
|
26
|
+
export interface Target {
|
|
27
|
+
id: string;
|
|
28
|
+
title?: string;
|
|
29
|
+
desc?: string;
|
|
30
|
+
owner?: string;
|
|
31
|
+
link?: string;
|
|
32
|
+
}
|
|
33
|
+
interface FetchCommentsResponse {
|
|
34
|
+
data: Post[];
|
|
35
|
+
nextCursor: string | null;
|
|
36
|
+
total: number;
|
|
37
|
+
}
|
|
38
|
+
type FetchComments = (params: {
|
|
39
|
+
objectId: string;
|
|
40
|
+
rootId?: string;
|
|
41
|
+
cursor?: string;
|
|
42
|
+
limit?: number;
|
|
43
|
+
order: 'asc' | 'desc';
|
|
44
|
+
skip?: boolean;
|
|
45
|
+
includeReplies?: 1 | null;
|
|
46
|
+
initialRepliesLimit?: number;
|
|
47
|
+
}) => Promise<FetchCommentsResponse>;
|
|
48
|
+
type FetchCommentPosition = (params: {
|
|
49
|
+
id: string;
|
|
50
|
+
objectId: string;
|
|
51
|
+
order: 'asc' | 'desc';
|
|
52
|
+
includeReplies?: 1 | null;
|
|
53
|
+
}) => Promise<number | {
|
|
54
|
+
position: number;
|
|
55
|
+
rootId: string;
|
|
56
|
+
}>;
|
|
57
|
+
type DeleteComment = (post: Post) => Promise<any>;
|
|
58
|
+
type UpdateComment = (post: Post, content: string) => Promise<any>;
|
|
59
|
+
type Rate = (post: Post, value: string, ratingType: string) => Promise<any>;
|
|
60
|
+
type Unrate = (post: Post) => Promise<any>;
|
|
61
|
+
type Reply = (post: Post, content: string) => Promise<any>;
|
|
62
|
+
export type Rating = {
|
|
63
|
+
rater: User;
|
|
64
|
+
value: string;
|
|
65
|
+
};
|
|
66
|
+
export type FetchRatings = (id: string) => Promise<Rating[]>;
|
|
67
|
+
export interface CommentAPI {
|
|
68
|
+
fetchComments: FetchComments;
|
|
69
|
+
fetchPinnedComments: (id: string) => Promise<Post[]>;
|
|
70
|
+
fetchCommentPosition: FetchCommentPosition;
|
|
71
|
+
deleteComment: DeleteComment;
|
|
72
|
+
updateComment: UpdateComment;
|
|
73
|
+
rate: Rate;
|
|
74
|
+
unrate: Unrate;
|
|
75
|
+
reply: Reply;
|
|
76
|
+
togglePin: ({ post, value }: {
|
|
77
|
+
post: Post;
|
|
78
|
+
value: boolean;
|
|
79
|
+
}) => Promise<void>;
|
|
80
|
+
}
|
|
81
|
+
export type WithRequiredProperty<Type, Key extends keyof Type> = Type & {
|
|
82
|
+
[Property in Key]-?: Type[Property];
|
|
83
|
+
};
|
|
84
|
+
export {};
|
package/dist/types.mjs
ADDED
|
File without changes
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
/// <reference types="vite/client" />
|
package/dist/ws.d.ts
ADDED
package/dist/ws.mjs
ADDED
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import Cookie from "js-cookie";
|
|
3
|
+
import { WsClient } from "@arcblock/ws";
|
|
4
|
+
let client;
|
|
5
|
+
export function create(prefix) {
|
|
6
|
+
const pathPrefix = prefix;
|
|
7
|
+
const url = `//${window.location.host}${pathPrefix.replace(/\/$/, "")}`;
|
|
8
|
+
return new WsClient(url, {
|
|
9
|
+
heartbeatIntervalMs: 10 * 1e3,
|
|
10
|
+
reconnectAfterMs: (tries) => {
|
|
11
|
+
if (Cookie.get("login_token")) {
|
|
12
|
+
return Math.floor(Math.random() * 2 ** tries * 1e3);
|
|
13
|
+
}
|
|
14
|
+
return 2 ** tries * 1e3;
|
|
15
|
+
}
|
|
16
|
+
});
|
|
17
|
+
}
|
|
18
|
+
export function getWsClient(prefix = window.blocklet?.prefix || "/") {
|
|
19
|
+
if (!client) {
|
|
20
|
+
client = create(prefix);
|
|
21
|
+
}
|
|
22
|
+
return client;
|
|
23
|
+
}
|
|
24
|
+
export const useSubscription = (event, cb = () => {
|
|
25
|
+
}, deps = [], prefix = window.blocklet?.prefix || "/") => {
|
|
26
|
+
useEffect(() => {
|
|
27
|
+
if (event) {
|
|
28
|
+
if (!client) {
|
|
29
|
+
client = getWsClient(prefix);
|
|
30
|
+
}
|
|
31
|
+
client.on(event, cb);
|
|
32
|
+
return () => {
|
|
33
|
+
client.off(event, cb);
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
return () => {
|
|
37
|
+
};
|
|
38
|
+
}, [event, ...deps]);
|
|
39
|
+
};
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@blocklet/discuss-kit-ux-lite",
|
|
3
|
+
"version": "2.6.0",
|
|
4
|
+
"files": [
|
|
5
|
+
"dist"
|
|
6
|
+
],
|
|
7
|
+
"exports": {
|
|
8
|
+
".": "./dist/index.mjs"
|
|
9
|
+
},
|
|
10
|
+
"main": "./dist/index.mjs",
|
|
11
|
+
"module": "./dist/index.mjs",
|
|
12
|
+
"types": "./dist/index.d.ts",
|
|
13
|
+
"sideEffects": false,
|
|
14
|
+
"publishConfig": {
|
|
15
|
+
"access": "public"
|
|
16
|
+
},
|
|
17
|
+
"dependencies": {
|
|
18
|
+
"@arcblock/bridge": "^3.2.19",
|
|
19
|
+
"@arcblock/react-hooks": "^3.2.19",
|
|
20
|
+
"@arcblock/ws": "^1.27.16",
|
|
21
|
+
"@blocklet/js-sdk": "^1.17.7-beta-20251225-073259-cb6ecf68",
|
|
22
|
+
"@blocklet/uploader": "^0.3.18",
|
|
23
|
+
"@emotion/css": "^11.13.5",
|
|
24
|
+
"@emotion/react": "^11.14.0",
|
|
25
|
+
"@emotion/styled": "^11.14.1",
|
|
26
|
+
"@iconify/icons-iconoir": "^1.2.30",
|
|
27
|
+
"@iconify/icons-material-symbols": "^1.2.58",
|
|
28
|
+
"@iconify/icons-mdi": "^1.2.48",
|
|
29
|
+
"@iconify/icons-tabler": "^1.2.95",
|
|
30
|
+
"@iconify/react": "^4.1.1",
|
|
31
|
+
"@lexical/react": "^0.38.2",
|
|
32
|
+
"@lexical/text": "^0.38.2",
|
|
33
|
+
"ahooks": "^3.8.1",
|
|
34
|
+
"axios": "^0.27.2",
|
|
35
|
+
"dayjs": "^1.11.13",
|
|
36
|
+
"js-cookie": "^3.0.5",
|
|
37
|
+
"lexical": "^0.38.2",
|
|
38
|
+
"murmurhash": "^2.0.1",
|
|
39
|
+
"react-helmet": "^6.1.0",
|
|
40
|
+
"react-hot-toast": "^2.4.1",
|
|
41
|
+
"react-lazy-with-preload": "^2.2.1",
|
|
42
|
+
"react-select": "^5.8.1",
|
|
43
|
+
"semver-compare": "^1.0.0",
|
|
44
|
+
"ufo": "^1.5.4",
|
|
45
|
+
"unstated-next": "^1.1.0",
|
|
46
|
+
"zustand": "^4.5.5",
|
|
47
|
+
"@blocklet/editor-lite": "2.6.0"
|
|
48
|
+
},
|
|
49
|
+
"peerDependencies": {
|
|
50
|
+
"@arcblock/did-connect-react": "^3.1.5",
|
|
51
|
+
"@arcblock/ux": "^3.1.5",
|
|
52
|
+
"@mui/icons-material": "^7.1.2",
|
|
53
|
+
"@mui/lab": "^7.0.0-beta.14",
|
|
54
|
+
"@mui/material": "^7.1.2",
|
|
55
|
+
"clsx": "^1.2.1",
|
|
56
|
+
"lodash": "^4.17.21",
|
|
57
|
+
"react": "^19.1.0",
|
|
58
|
+
"react-dom": "^19.1.0",
|
|
59
|
+
"react-router-dom": "^6.4.0"
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"@arcblock/eslint-config-ts": "^0.3.3",
|
|
63
|
+
"@svgr/core": "^6.5.1",
|
|
64
|
+
"@types/react": "^18.3.9",
|
|
65
|
+
"@types/react-color": "^3.0.12",
|
|
66
|
+
"@types/react-dom": "^18.3.0",
|
|
67
|
+
"@types/semver-compare": "^1.0.3",
|
|
68
|
+
"@vitejs/plugin-react": "^4.6.0",
|
|
69
|
+
"react": "^19.1.0",
|
|
70
|
+
"react-dom": "^19.1.0",
|
|
71
|
+
"typescript": "^4.9.5",
|
|
72
|
+
"unbuild": "^3.6.0",
|
|
73
|
+
"vite": "^7.0.0",
|
|
74
|
+
"vite-plugin-dts": "^4.5.4"
|
|
75
|
+
},
|
|
76
|
+
"scripts": {
|
|
77
|
+
"build": "unbuild",
|
|
78
|
+
"lint": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx",
|
|
79
|
+
"lint:fix": "eslint src --ext .mjs,.js,.jsx,.ts,.tsx --fix"
|
|
80
|
+
}
|
|
81
|
+
}
|