@blocklet/discuss-kit-ux 1.6.210 → 1.6.212
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/api-error-handler/api-error-handler.d.ts +2 -1
- package/dist/components/api-error-handler/default-handler.d.ts +1 -0
- package/dist/components/api-error-handler/json-validation-interceptor.d.ts +2 -1
- package/dist/components/authz/access-control.d.ts +3 -3
- package/dist/components/avatars/Avatars.stories.d.ts +2 -1
- package/dist/components/avatars/author-info.d.ts +2 -2
- package/dist/components/avatars/avatars.d.ts +3 -2
- package/dist/components/back.d.ts +1 -0
- package/dist/components/blog/blog-link.d.ts +1 -0
- package/dist/components/blog/blog-list.d.ts +3 -3
- package/dist/components/blog/cover-image.d.ts +2 -2
- package/dist/components/blog/permalink.d.ts +2 -1
- package/dist/components/blog/types.d.ts +2 -1
- package/dist/components/chat/channel-group.d.ts +2 -2
- package/dist/components/chat/chat-client.d.ts +3 -2
- package/dist/components/chat/chat-list.d.ts +1 -0
- package/dist/components/chat/chat-room.d.ts +2 -1
- package/dist/components/chat/chat.d.ts +1 -0
- package/dist/components/chat/context.d.ts +4 -4
- package/dist/components/chat/message-list.d.ts +2 -1
- package/dist/components/chat/message.d.ts +2 -1
- package/dist/components/chat/participants.d.ts +2 -1
- package/dist/components/chat/time.d.ts +2 -1
- package/dist/components/chat/types.d.ts +2 -1
- package/dist/components/chat/unread-notification.d.ts +2 -1
- package/dist/components/confirm.d.ts +3 -2
- package/dist/components/dayjs.d.ts +2 -1
- package/dist/components/default-editor-config-provider.d.ts +2 -2
- package/dist/components/dirty-prompt.d.ts +1 -1
- package/dist/components/editor/editor.d.ts +3 -3
- package/dist/components/editor/lazy-editor.d.ts +2 -1
- package/dist/components/editor/preview.d.ts +2 -2
- package/dist/components/emoji-icon.d.ts +1 -0
- package/dist/components/hooks/responsive.d.ts +2 -1
- package/dist/components/input/auto-clear-plugin.d.ts +1 -0
- package/dist/components/input/comment-input.d.ts +1 -1
- package/dist/components/input/input.d.ts +2 -2
- package/dist/components/input/post-edit.d.ts +1 -0
- package/dist/components/input/scrollable-editor-wrapper.d.ts +1 -1
- package/dist/components/label-picker.d.ts +1 -0
- package/dist/components/lexical.d.ts +1 -0
- package/dist/components/pagination.d.ts +2 -1
- package/dist/components/posts/Post.stories.d.ts +3 -2
- package/dist/components/posts/comment-list/context.d.ts +3 -2
- package/dist/components/posts/comment.d.ts +2 -1
- package/dist/components/posts/menu.d.ts +3 -3
- package/dist/components/posts/post-content.d.ts +1 -0
- package/dist/components/posts/post.d.ts +4 -3
- package/dist/components/profile-card/ProfileCard.stories.d.ts +2 -1
- package/dist/components/profile-card/profile-card.d.ts +2 -1
- package/dist/components/rating/binary-thumb.d.ts +3 -2
- package/dist/components/rating/github-reaction.d.ts +3 -3
- package/dist/components/rating/rater-list.d.ts +2 -1
- package/dist/components/rating/rating.d.ts +1 -1
- package/dist/components/segmented-control.d.ts +2 -2
- package/dist/components/shared/dialog.d.ts +1 -1
- package/dist/components/shared/theme.d.ts +2 -1
- package/dist/components/uploader/index.d.ts +2 -1
- package/dist/components/utils.d.ts +3 -2
- package/dist/editor-D7VjqD2F.mjs +37 -0
- package/dist/{index-KsyZ0KOb.mjs → index-MrnIrDMc.mjs} +1 -1
- package/dist/index.es.js +1 -63
- package/dist/preferences.d.ts +7 -0
- package/dist/test/fixtures/index.d.ts +2 -1
- package/package.json +8 -8
- package/dist/editor-5I4Vr3U6.mjs +0 -105
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { SessionContextUser } from '../hooks/session';
|
|
2
|
+
|
|
3
3
|
interface AccessControlProps {
|
|
4
4
|
authenticated?: boolean;
|
|
5
5
|
permissions?: string | string[];
|
|
@@ -7,5 +7,5 @@ interface AccessControlProps {
|
|
|
7
7
|
check?: (user: SessionContextUser) => boolean;
|
|
8
8
|
children: React.ReactElement;
|
|
9
9
|
}
|
|
10
|
-
export default function AccessControl({ authenticated, permissions, roles, check, children, }: AccessControlProps): import(
|
|
10
|
+
export default function AccessControl({ authenticated, permissions, roles, check, children, }: AccessControlProps): import('react').ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
11
11
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { default as Avatars } from './avatars';
|
|
1
2
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
|
|
3
|
+
|
|
3
4
|
declare const _default: ComponentMeta<typeof Avatars>;
|
|
4
5
|
export default _default;
|
|
5
6
|
export declare const Basic: ComponentStory<typeof Avatars>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { User } from '../../types';
|
|
2
|
+
import { AvatarGroupProps } from '@mui/material/AvatarGroup';
|
|
3
|
+
|
|
3
4
|
interface AvatarsProps extends Omit<AvatarGroupProps, 'variant'> {
|
|
4
5
|
users: User[];
|
|
5
6
|
variant?: 'circle' | 'rounded';
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { BlogPost } from './types';
|
|
2
|
+
|
|
3
3
|
interface BlogListProps {
|
|
4
4
|
posts: BlogPost[];
|
|
5
5
|
boardId?: string;
|
|
@@ -20,7 +20,7 @@ type CardProps = {
|
|
|
20
20
|
compactLayout?: '0' | '1';
|
|
21
21
|
loading?: boolean;
|
|
22
22
|
};
|
|
23
|
-
export declare const BlogCard: import(
|
|
23
|
+
export declare const BlogCard: import('react').ForwardRefExoticComponent<CardProps & import("react").RefAttributes<HTMLDivElement>>;
|
|
24
24
|
export default function BlogListWrapper({ variant, cardsLayout, ...rest }: BlogListProps & {
|
|
25
25
|
variant?: 'card' | 'list';
|
|
26
26
|
}): import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { User } from '../../types';
|
|
2
|
+
import { Chat, Message, Channel } from './types';
|
|
1
3
|
import { Emitter } from 'mitt';
|
|
2
|
-
|
|
3
|
-
import type { User } from '../../types';
|
|
4
|
+
|
|
4
5
|
type Events = {
|
|
5
6
|
init: {
|
|
6
7
|
chats: Chat[];
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
import
|
|
4
|
-
|
|
1
|
+
import { User } from '../../types';
|
|
2
|
+
import { Chat as ChatType } from './types';
|
|
3
|
+
import { default as ChatClient } from './chat-client';
|
|
4
|
+
|
|
5
5
|
export interface ChatProviderProps {
|
|
6
6
|
children: React.ReactNode;
|
|
7
7
|
client: ChatClient;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { Chat, Message as MessageType, NotificationMessage as NotificationMessageType } from './types';
|
|
2
|
+
|
|
2
3
|
interface MessageProps {
|
|
3
4
|
message: MessageType;
|
|
4
5
|
prevMessage?: MessageType;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
|
|
2
3
|
interface UnreadNotificationProviderProps {
|
|
3
4
|
fetchUnreadState: () => Promise<boolean>;
|
|
4
5
|
children: ReactNode;
|
|
@@ -7,7 +8,7 @@ interface UnreadNotificationContextType {
|
|
|
7
8
|
unread: boolean;
|
|
8
9
|
markAsUnread: (value?: boolean) => void;
|
|
9
10
|
}
|
|
10
|
-
export declare const UnreadNotificationContext: import(
|
|
11
|
+
export declare const UnreadNotificationContext: import('react').Context<UnreadNotificationContextType>;
|
|
11
12
|
export declare const useUnreadNotification: () => UnreadNotificationContextType;
|
|
12
13
|
export declare function UnreadNotificationProvider({ fetchUnreadState, children }: UnreadNotificationProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
13
14
|
export {};
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { DialogProps, ButtonProps } from '@mui/material';
|
|
2
1
|
import { ReactNode } from 'react';
|
|
2
|
+
import { DialogProps, ButtonProps } from '@mui/material';
|
|
3
|
+
|
|
3
4
|
interface ConfirmProviderProps {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
}
|
|
@@ -23,7 +24,7 @@ interface ConfirmProps extends Omit<DialogProps, 'title'>, Omit<ConfirmOptions,
|
|
|
23
24
|
handleCancel: () => void;
|
|
24
25
|
}
|
|
25
26
|
export declare function Confirm({ open, title, description, handleOk, handleCancel, okText, okButtonProps, cancelText, cancelButtonProps, actions, ...rest }: ConfirmProps): import("react/jsx-runtime").JSX.Element | null;
|
|
26
|
-
export declare const ConfirmContext: import(
|
|
27
|
+
export declare const ConfirmContext: import('react').Context<ConfirmContextType>;
|
|
27
28
|
export declare const useConfirm: () => ConfirmContextType;
|
|
28
29
|
export declare function ConfirmProvider({ children }: ConfirmProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
29
30
|
export {};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import
|
|
3
|
-
|
|
1
|
+
import { EditorState, LexicalEditor } from 'lexical';
|
|
2
|
+
import { BlockletEditorProps } from '@blocklet/editor';
|
|
3
|
+
|
|
4
4
|
export type OnChangeHandler = ({ content, editorState, editor, isEmpty, getExcerpt, }: {
|
|
5
5
|
content: string;
|
|
6
6
|
editorState: EditorState;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { BlockletEditorProps } from '@blocklet/editor';
|
|
2
|
+
|
|
3
3
|
export interface EditorProps extends Omit<BlockletEditorProps, 'onChange' | 'ref'> {
|
|
4
4
|
content: string;
|
|
5
5
|
children?: React.ReactNode;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Breakpoint } from '@mui/material';
|
|
2
|
+
|
|
2
3
|
export declare const useDownBreakpoint: (breakpoint: Breakpoint) => boolean;
|
|
3
4
|
export declare const useUpBreakpoint: (breakpoint: Breakpoint) => boolean;
|
|
4
5
|
export declare function useResponsive(): (responsiveValues: {
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
import { default as Comment } from './comment';
|
|
2
|
+
import { default as Post } from './post';
|
|
1
3
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
|
|
3
|
-
import Comment from './comment';
|
|
4
|
+
|
|
4
5
|
declare const _default: ComponentMeta<typeof Post>;
|
|
5
6
|
export default _default;
|
|
6
7
|
export declare const Basic: ComponentStory<typeof Post>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { Post, Target, CommentAPI } from '../../../types';
|
|
2
|
+
import { default as React } from 'react';
|
|
3
|
+
|
|
3
4
|
type Order = 'asc' | 'desc';
|
|
4
5
|
interface CommentsProviderProps {
|
|
5
6
|
target: Target;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
import { default as MuiMenuItem } from '@mui/material/MenuItem';
|
|
2
|
+
|
|
3
3
|
interface MenuProps {
|
|
4
4
|
items: React.ReactElement<typeof MuiMenuItem>[];
|
|
5
5
|
style?: React.CSSProperties;
|
|
@@ -7,6 +7,6 @@ interface MenuProps {
|
|
|
7
7
|
}
|
|
8
8
|
declare function Menu({ items, ...rest }: MenuProps): import("react/jsx-runtime").JSX.Element | null;
|
|
9
9
|
declare namespace Menu {
|
|
10
|
-
var Item: import(
|
|
10
|
+
var Item: import('@mui/material').ExtendButtonBase<import("@mui/material/MenuItem").MenuItemTypeMap<{}, "li">>;
|
|
11
11
|
}
|
|
12
12
|
export default Menu;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import
|
|
2
|
-
import MuiMenuItem from '@mui/material/MenuItem';
|
|
3
|
-
import
|
|
1
|
+
import { Post } from '../../types';
|
|
2
|
+
import { default as MuiMenuItem } from '@mui/material/MenuItem';
|
|
3
|
+
import { default as React } from 'react';
|
|
4
|
+
|
|
4
5
|
export interface PostProps {
|
|
5
6
|
post: Post;
|
|
6
7
|
interactive?: boolean;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { default as ProfileCard } from './profile-card';
|
|
1
2
|
import { ComponentStory, ComponentMeta } from '@storybook/react';
|
|
2
|
-
|
|
3
|
+
|
|
3
4
|
declare const _default: ComponentMeta<typeof ProfileCard>;
|
|
4
5
|
export default _default;
|
|
5
6
|
export declare const Basic: ComponentStory<typeof ProfileCard>;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { Rating as RatingType } from '../../types';
|
|
2
|
+
import { RatingProps } from './rating';
|
|
3
|
+
|
|
3
4
|
export type BinaryThumbProps = {
|
|
4
5
|
data: RatingType[];
|
|
5
6
|
variant?: 'default' | 'inverse';
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
|
|
1
|
+
import { Rating as RatingType } from '../../types';
|
|
2
|
+
import { BoxProps } from '@mui/material';
|
|
3
|
+
|
|
4
4
|
type GithubReactionProps = {
|
|
5
5
|
data: RatingType[];
|
|
6
6
|
onRate: ({ ratingType, value }: {
|
|
@@ -23,5 +23,5 @@ export interface RatingProps {
|
|
|
23
23
|
}) => Promise<any>;
|
|
24
24
|
onUnrate: () => Promise<any>;
|
|
25
25
|
}
|
|
26
|
-
declare function Rating({ ratingType, values, countPerValue, selectedValue, render, onRate, onUnrate }: RatingProps): import(
|
|
26
|
+
declare function Rating({ ratingType, values, countPerValue, selectedValue, render, onRate, onUnrate }: RatingProps): import('react').ReactElement<any, string | import("react").JSXElementConstructor<any>> | null;
|
|
27
27
|
export default Rating;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { ReactNode } from 'react';
|
|
2
|
+
|
|
2
3
|
export * from './utils';
|
|
3
4
|
interface UploaderProviderProps {
|
|
4
5
|
children: ReactNode;
|
|
5
6
|
}
|
|
6
|
-
export declare const UploaderContext: import(
|
|
7
|
+
export declare const UploaderContext: import('react').Context<null>;
|
|
7
8
|
export declare function useUploader(): never;
|
|
8
9
|
export declare function UploaderTrigger({ onChange, children }: {
|
|
9
10
|
onChange?: Function;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
1
|
+
import { SystemStyleObject } from '@mui/system';
|
|
2
|
+
import { SxProps, Theme } from '@mui/material';
|
|
3
|
+
|
|
3
4
|
export declare const repairBase64Avatar: (avatar?: string) => string | undefined;
|
|
4
5
|
export declare const getResizedAvatar: (avatar: string, size?: number) => string;
|
|
5
6
|
export declare const sleep: (ms: number) => Promise<unknown>;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { styled, Box } from "@mui/material";
|
|
3
|
+
import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangePlugin";
|
|
4
|
+
import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
|
|
5
|
+
import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
|
|
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-MrnIrDMc.mjs";
|
|
8
|
+
const BlockletEditor = lazy(() => import("@blocklet/editor"));
|
|
9
|
+
const Root = styled(Box)`
|
|
10
|
+
.be-editable,
|
|
11
|
+
.be-content {
|
|
12
|
+
min-height: 150px;
|
|
13
|
+
}
|
|
14
|
+
`;
|
|
15
|
+
function Editor({ initialContent, onChange, children, onSave, ...rest }) {
|
|
16
|
+
const handleChange = async (editorState, editor) => {
|
|
17
|
+
const isEmpty = await isEmptyContent(editorState, editor);
|
|
18
|
+
onChange == null ? void 0 : onChange({
|
|
19
|
+
content: isEmpty ? "" : stringify(editorState),
|
|
20
|
+
editorState,
|
|
21
|
+
editor,
|
|
22
|
+
isEmpty,
|
|
23
|
+
getExcerpt: () => getExcerptSync(editorState)
|
|
24
|
+
});
|
|
25
|
+
};
|
|
26
|
+
return /* @__PURE__ */ jsx(Root, { children: /* @__PURE__ */ jsxs(BlockletEditor, { editorState: inferInitialEditorState(initialContent), ...rest, children: [
|
|
27
|
+
/* @__PURE__ */ jsx(ImagePathFixerPlugin, {}),
|
|
28
|
+
/* @__PURE__ */ jsx(VideoPathFixerPlugin, {}),
|
|
29
|
+
/* @__PURE__ */ jsx(OnContentChangePlugin, { onChange: handleChange }),
|
|
30
|
+
onSave && /* @__PURE__ */ jsx(CtrlsShortcutPlugin, { callback: onSave }),
|
|
31
|
+
/* @__PURE__ */ jsx(SafeAreaPlugin, {}),
|
|
32
|
+
children
|
|
33
|
+
] }) });
|
|
34
|
+
}
|
|
35
|
+
export {
|
|
36
|
+
Editor as default
|
|
37
|
+
};
|
|
@@ -5179,7 +5179,7 @@ function Pagination({
|
|
|
5179
5179
|
}
|
|
5180
5180
|
);
|
|
5181
5181
|
}
|
|
5182
|
-
const Editor = lazy(() => import("./editor-
|
|
5182
|
+
const Editor = lazy(() => import("./editor-D7VjqD2F.mjs"));
|
|
5183
5183
|
function LazyEditor(props) {
|
|
5184
5184
|
const fallback = /* @__PURE__ */ jsxs(Fragment, { children: [
|
|
5185
5185
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import { O, k, T, A, j, aa, B, z, H, F, J, am, W, U, X, Z, q, C, v, w, y, a1, a2, ae, a4, L, N, a8, D, ad, ac, E, G, b, h, ab, M, P, al, o, n, a9, R, S, a5, an, m, _, a0, af, ai, ah, aj, ao, K, ap, l, p, r, f, t, a6, Q, c, Y, x, a3, a7, u, ak, d, aq, $, ag, e } from "./index-
|
|
2
|
+
import { O, k, T, A, j, aa, B, z, H, F, J, am, W, U, X, Z, q, C, v, w, y, a1, a2, ae, a4, L, N, a8, D, ad, ac, E, G, b, h, ab, M, P, al, o, n, a9, R, S, a5, an, m, _, a0, af, ai, ah, aj, ao, K, ap, l, p, r, f, t, a6, Q, c, Y, x, a3, a7, u, ak, d, aq, $, ag, e } from "./index-MrnIrDMc.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
|
@@ -8,68 +8,6 @@ import "@mui/lab/LoadingButton";
|
|
|
8
8
|
import "@mui/icons-material";
|
|
9
9
|
import "@arcblock/ux/lib/Locale/context";
|
|
10
10
|
import "@mui/material";
|
|
11
|
-
import "@mui/material/styles";
|
|
12
|
-
import "lodash/isNil";
|
|
13
|
-
import "@blocklet/editor/lib/config";
|
|
14
|
-
import "lexical";
|
|
15
|
-
import "@lexical/text";
|
|
16
|
-
import "url-join";
|
|
17
|
-
import "@lexical/react/LexicalComposerContext";
|
|
18
|
-
import "@blocklet/editor/lib/main/nodes/ImageNode";
|
|
19
|
-
import "@blocklet/editor/lib/ext/VideoPlugin/VideoNode";
|
|
20
|
-
import "ahooks";
|
|
21
|
-
import "@mui/material/Alert";
|
|
22
|
-
import "lodash/isBoolean";
|
|
23
|
-
import "@arcblock/ux/lib/Theme";
|
|
24
|
-
import "@arcblock/did-connect/lib/Avatar";
|
|
25
|
-
import "@mui/material/AvatarGroup";
|
|
26
|
-
import "@mui/material/colors";
|
|
27
|
-
import "@mui/material/useMediaQuery";
|
|
28
|
-
import "@arcblock/ux/lib/DID";
|
|
29
|
-
import "@mui/material/Tooltip";
|
|
30
|
-
import "react-router-dom";
|
|
31
|
-
import "@arcblock/ux/lib/RelativeTime";
|
|
32
|
-
import "@mui/material/Chip";
|
|
33
|
-
import "@mui/material/Stack";
|
|
34
|
-
import "lodash/groupBy";
|
|
35
|
-
import "lodash/flatMap";
|
|
36
|
-
import "lodash/uniqBy";
|
|
37
|
-
import "lodash/trim";
|
|
38
|
-
import "@mui/material/Avatar";
|
|
39
|
-
import "@mui/icons-material/BrokenImage";
|
|
40
|
-
import "@iconify/react";
|
|
41
|
-
import "@arcblock/ux/lib/Empty";
|
|
42
|
-
import "@arcblock/did-connect/lib/Session";
|
|
43
|
-
import "@mui/icons-material/NotificationsActiveOutlined";
|
|
44
|
-
import "@blocklet/editor/lib/ext/CheckboxPlugin";
|
|
45
|
-
import "@arcblock/did-connect/lib/Address";
|
|
46
|
-
import "@mui/material/MenuItem";
|
|
47
|
-
import "clsx";
|
|
48
|
-
import "@mui/material/IconButton";
|
|
49
|
-
import "@mui/material/Menu";
|
|
50
|
-
import "@arcblock/ux/lib/Dialog";
|
|
51
|
-
import "lodash/orderBy";
|
|
52
|
-
import "@mui/material/Typography";
|
|
53
|
-
import "@mui/material/Skeleton";
|
|
54
|
-
import "react-dom";
|
|
55
|
-
import "dayjs";
|
|
56
|
-
import "dayjs/plugin/relativeTime";
|
|
57
|
-
import "mitt";
|
|
58
|
-
import "@mui/material/CircularProgress";
|
|
59
|
-
import "react-helmet";
|
|
60
|
-
import "react-flip-toolkit";
|
|
61
|
-
import "@mui/material/colors/grey";
|
|
62
|
-
import "@mui/material/Fab";
|
|
63
|
-
import "lodash/debounce";
|
|
64
|
-
import "@mui/material/TextField";
|
|
65
|
-
import "@mui/icons-material/Add";
|
|
66
|
-
import "axios";
|
|
67
|
-
import "@arcblock/ux/lib/Toast";
|
|
68
|
-
import "@mui/material/Pagination";
|
|
69
|
-
import "unstated-next";
|
|
70
|
-
import "js-cookie";
|
|
71
|
-
import "@arcblock/ws";
|
|
72
|
-
import "@emotion/css";
|
|
73
11
|
export {
|
|
74
12
|
O as AccessControl,
|
|
75
13
|
k as AuthorInfo,
|
package/dist/preferences.d.ts
CHANGED
|
@@ -50,5 +50,12 @@ declare const preferences: {
|
|
|
50
50
|
bannerDescBookmarkEn: string;
|
|
51
51
|
bannerDescBookmarkZh: string;
|
|
52
52
|
discussionsVisiblePostTypes: string[];
|
|
53
|
+
allowDonationOnDiscussion: boolean;
|
|
54
|
+
allowDonationAmountCustom: boolean;
|
|
55
|
+
discussionDonationButtonText: string;
|
|
56
|
+
discussionDonationHistoryStyle: string;
|
|
57
|
+
discussionDonationMaximum: string;
|
|
58
|
+
discussionDonationMinimum: string;
|
|
59
|
+
discussionDonationPresets: string;
|
|
53
60
|
};
|
|
54
61
|
export default preferences;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { User } from '../../types';
|
|
2
|
+
|
|
2
3
|
export declare const editorContent = "{\"root\":{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"h1\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"heading\",\"version\":1,\"tag\":\"h1\"},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"h2\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"heading\",\"version\":1,\"tag\":\"h2\"},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"h3\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"heading\",\"version\":1,\"tag\":\"h3\"},{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 1\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":1},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 2\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":2}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"Labore in aliqua laboris aute velit. Ea adipisicing velit ut deserunt veniam nulla cupidatat anim excepteur mollit nostrud quis. Amet laboris proident proident consectetur amet occaecat est adipisicing. Proident anim sit est fugiat pariatur excepteur cillum labore nostrud id cillum eu officia.\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"paragraph\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}";
|
|
3
4
|
export declare const longEditorContent = "{\"root\":{\"children\":[{\"children\":[{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 1\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":1},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 2\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":2},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 3\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":3},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 4\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":4},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 5\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":5},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 6\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":6},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 7\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":7},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 8\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":8},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 9\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":9},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 10\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":10},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 11\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":11},{\"children\":[{\"detail\":0,\"format\":0,\"mode\":\"normal\",\"style\":\"\",\"text\":\"item 12\",\"type\":\"text\",\"version\":1}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"listitem\",\"version\":1,\"value\":12}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"list\",\"version\":1,\"listType\":\"bullet\",\"start\":1,\"tag\":\"ul\"}],\"direction\":\"ltr\",\"format\":\"\",\"indent\":0,\"type\":\"root\",\"version\":1}}";
|
|
4
5
|
export declare const mockUsers: User[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "1.6.
|
|
3
|
+
"version": "1.6.212",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -29,9 +29,9 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@arcblock/ws": "^1.18.115",
|
|
32
|
-
"@blocklet/editor": "1.6.
|
|
33
|
-
"@blocklet/labels": "1.6.
|
|
34
|
-
"@blocklet/uploader": "^0.0.
|
|
32
|
+
"@blocklet/editor": "1.6.212",
|
|
33
|
+
"@blocklet/labels": "1.6.212",
|
|
34
|
+
"@blocklet/uploader": "^0.0.77",
|
|
35
35
|
"@emotion/css": "^11.10.5",
|
|
36
36
|
"@emotion/react": "^11.10.5",
|
|
37
37
|
"@emotion/styled": "^11.10.5",
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
"@storybook/addon-essentials": "^6.5.13",
|
|
74
74
|
"@storybook/addon-interactions": "^6.5.13",
|
|
75
75
|
"@storybook/addon-links": "^6.5.13",
|
|
76
|
-
"@storybook/builder-vite": "^0.
|
|
76
|
+
"@storybook/builder-vite": "^8.0.6",
|
|
77
77
|
"@storybook/react": "^6.5.13",
|
|
78
78
|
"@storybook/testing-library": "^0.0.13",
|
|
79
79
|
"@svgr/core": "^6.5.1",
|
|
@@ -87,12 +87,12 @@
|
|
|
87
87
|
"rollup-plugin-node-externals": "^5.1.3",
|
|
88
88
|
"typescript": "^4.6.4",
|
|
89
89
|
"unplugin-icons": "^0.14.14",
|
|
90
|
-
"vite": "^5.
|
|
91
|
-
"vite-plugin-dts": "^3.
|
|
90
|
+
"vite": "^5.2.8",
|
|
91
|
+
"vite-plugin-dts": "^3.8.1",
|
|
92
92
|
"vite-plugin-libcss": "^1.1.1"
|
|
93
93
|
},
|
|
94
94
|
"resolutions": {
|
|
95
95
|
"react": "^18.2.0"
|
|
96
96
|
},
|
|
97
|
-
"gitHead": "
|
|
97
|
+
"gitHead": "3f73487eb255540445ffbf9f9a9a84df7af8d0e6"
|
|
98
98
|
}
|
package/dist/editor-5I4Vr3U6.mjs
DELETED
|
@@ -1,105 +0,0 @@
|
|
|
1
|
-
import { jsx, jsxs } from "react/jsx-runtime";
|
|
2
|
-
import { styled, Box } from "@mui/material";
|
|
3
|
-
import { OnContentChangePlugin } from "@blocklet/editor/lib/ext/OnContentChangePlugin";
|
|
4
|
-
import { CtrlsShortcutPlugin } from "@blocklet/editor/lib/ext/ShortcutPlugin";
|
|
5
|
-
import { SafeAreaPlugin } from "@blocklet/editor/lib/ext/SafeAreaPlugin";
|
|
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-KsyZ0KOb.mjs";
|
|
8
|
-
import "@blocklet/labels";
|
|
9
|
-
import "@mui/material/styles";
|
|
10
|
-
import "@mui/material/Box";
|
|
11
|
-
import "lodash/isNil";
|
|
12
|
-
import "@blocklet/editor/lib/config";
|
|
13
|
-
import "lexical";
|
|
14
|
-
import "@lexical/text";
|
|
15
|
-
import "url-join";
|
|
16
|
-
import "@lexical/react/LexicalComposerContext";
|
|
17
|
-
import "@blocklet/editor/lib/main/nodes/ImageNode";
|
|
18
|
-
import "@blocklet/editor/lib/ext/VideoPlugin/VideoNode";
|
|
19
|
-
import "ahooks";
|
|
20
|
-
import "@mui/lab/LoadingButton";
|
|
21
|
-
import "@mui/icons-material";
|
|
22
|
-
import "@arcblock/ux/lib/Locale/context";
|
|
23
|
-
import "@mui/material/Alert";
|
|
24
|
-
import "lodash/isBoolean";
|
|
25
|
-
import "@mui/material/Button";
|
|
26
|
-
import "@arcblock/ux/lib/Theme";
|
|
27
|
-
import "@arcblock/did-connect/lib/Avatar";
|
|
28
|
-
import "@mui/material/AvatarGroup";
|
|
29
|
-
import "@mui/material/colors";
|
|
30
|
-
import "@mui/material/useMediaQuery";
|
|
31
|
-
import "@arcblock/ux/lib/DID";
|
|
32
|
-
import "@mui/material/Tooltip";
|
|
33
|
-
import "react-router-dom";
|
|
34
|
-
import "@arcblock/ux/lib/RelativeTime";
|
|
35
|
-
import "@mui/material/Chip";
|
|
36
|
-
import "@mui/material/Stack";
|
|
37
|
-
import "lodash/groupBy";
|
|
38
|
-
import "lodash/flatMap";
|
|
39
|
-
import "lodash/uniqBy";
|
|
40
|
-
import "lodash/trim";
|
|
41
|
-
import "@mui/material/Avatar";
|
|
42
|
-
import "@mui/icons-material/BrokenImage";
|
|
43
|
-
import "@iconify/react";
|
|
44
|
-
import "@arcblock/ux/lib/Empty";
|
|
45
|
-
import "@arcblock/did-connect/lib/Session";
|
|
46
|
-
import "@mui/icons-material/NotificationsActiveOutlined";
|
|
47
|
-
import "@blocklet/editor/lib/ext/CheckboxPlugin";
|
|
48
|
-
import "@arcblock/did-connect/lib/Address";
|
|
49
|
-
import "@mui/material/MenuItem";
|
|
50
|
-
import "clsx";
|
|
51
|
-
import "@mui/material/IconButton";
|
|
52
|
-
import "@mui/material/Menu";
|
|
53
|
-
import "@arcblock/ux/lib/Dialog";
|
|
54
|
-
import "lodash/orderBy";
|
|
55
|
-
import "@mui/material/Typography";
|
|
56
|
-
import "@mui/material/Skeleton";
|
|
57
|
-
import "react-dom";
|
|
58
|
-
import "dayjs";
|
|
59
|
-
import "dayjs/plugin/relativeTime";
|
|
60
|
-
import "mitt";
|
|
61
|
-
import "@mui/material/CircularProgress";
|
|
62
|
-
import "react-helmet";
|
|
63
|
-
import "react-flip-toolkit";
|
|
64
|
-
import "@mui/material/colors/grey";
|
|
65
|
-
import "@mui/material/Fab";
|
|
66
|
-
import "lodash/debounce";
|
|
67
|
-
import "@mui/material/TextField";
|
|
68
|
-
import "@mui/icons-material/Add";
|
|
69
|
-
import "axios";
|
|
70
|
-
import "@arcblock/ux/lib/Toast";
|
|
71
|
-
import "@mui/material/Pagination";
|
|
72
|
-
import "unstated-next";
|
|
73
|
-
import "js-cookie";
|
|
74
|
-
import "@arcblock/ws";
|
|
75
|
-
import "@emotion/css";
|
|
76
|
-
const BlockletEditor = lazy(() => import("@blocklet/editor"));
|
|
77
|
-
const Root = styled(Box)`
|
|
78
|
-
.be-editable,
|
|
79
|
-
.be-content {
|
|
80
|
-
min-height: 150px;
|
|
81
|
-
}
|
|
82
|
-
`;
|
|
83
|
-
function Editor({ initialContent, onChange, children, onSave, ...rest }) {
|
|
84
|
-
const handleChange = async (editorState, editor) => {
|
|
85
|
-
const isEmpty = await isEmptyContent(editorState, editor);
|
|
86
|
-
onChange == null ? void 0 : onChange({
|
|
87
|
-
content: isEmpty ? "" : stringify(editorState),
|
|
88
|
-
editorState,
|
|
89
|
-
editor,
|
|
90
|
-
isEmpty,
|
|
91
|
-
getExcerpt: () => getExcerptSync(editorState)
|
|
92
|
-
});
|
|
93
|
-
};
|
|
94
|
-
return /* @__PURE__ */ jsx(Root, { children: /* @__PURE__ */ jsxs(BlockletEditor, { editorState: inferInitialEditorState(initialContent), ...rest, children: [
|
|
95
|
-
/* @__PURE__ */ jsx(ImagePathFixerPlugin, {}),
|
|
96
|
-
/* @__PURE__ */ jsx(VideoPathFixerPlugin, {}),
|
|
97
|
-
/* @__PURE__ */ jsx(OnContentChangePlugin, { onChange: handleChange }),
|
|
98
|
-
onSave && /* @__PURE__ */ jsx(CtrlsShortcutPlugin, { callback: onSave }),
|
|
99
|
-
/* @__PURE__ */ jsx(SafeAreaPlugin, {}),
|
|
100
|
-
children
|
|
101
|
-
] }) });
|
|
102
|
-
}
|
|
103
|
-
export {
|
|
104
|
-
Editor as default
|
|
105
|
-
};
|