@blocklet/discuss-kit-ux 2.1.39 → 2.1.41
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/posts/comment-list/context.d.ts +3 -1
- package/dist/components/posts/comment.d.ts +2 -1
- package/dist/components/posts/post-content.d.ts +2 -1
- package/dist/components/posts/post.d.ts +2 -1
- package/dist/{editor-Dp_ggY0W.mjs → editor-CcRRm7J6.mjs} +1 -1
- package/dist/{index-BEQYUvbN.mjs → index-DlnrrOY-.mjs} +24 -11
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +24 -12
- package/package.json +4 -3
|
@@ -21,6 +21,7 @@ interface CommentsProviderProps {
|
|
|
21
21
|
renderComments?: CommentsRender;
|
|
22
22
|
renderDonation?: (post: Post) => React.ReactNode;
|
|
23
23
|
renderActions?: (post: Post) => React.ReactNode;
|
|
24
|
+
renderEditorPlugins?: (post: Post) => React.ReactNode;
|
|
24
25
|
}
|
|
25
26
|
interface State {
|
|
26
27
|
comments: Post[];
|
|
@@ -60,8 +61,9 @@ interface CommentsContextValue {
|
|
|
60
61
|
renderComments?: CommentsRender;
|
|
61
62
|
renderDonation?: (post: Post) => React.ReactNode;
|
|
62
63
|
renderActions?: (post: Post) => React.ReactNode;
|
|
64
|
+
renderEditorPlugins?: (post: Post) => React.ReactNode;
|
|
63
65
|
}
|
|
64
66
|
export declare const CommentsContext: React.Context<CommentsContextValue>;
|
|
65
67
|
export declare const useCommentsContext: () => CommentsContextValue;
|
|
66
|
-
export declare function CommentsProvider({ target, api, flatView, children, order, autoLoadComments, autoCollapse, allowCopyLink, showProfileCard, interactive, containerRef, renderComments, renderDonation, renderActions, }: CommentsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
export declare function CommentsProvider({ target, api, flatView, children, order, autoLoadComments, autoCollapse, allowCopyLink, showProfileCard, interactive, containerRef, renderComments, renderDonation, renderActions, renderEditorPlugins, }: CommentsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
67
69
|
export {};
|
|
@@ -8,5 +8,6 @@ export interface CommentProps {
|
|
|
8
8
|
onLoadMoreReplies: (rootId: string) => void;
|
|
9
9
|
renderDonation?: (post: Post) => React.ReactNode;
|
|
10
10
|
renderActions?: (post: Post) => React.ReactNode;
|
|
11
|
+
renderEditorPlugins?: (post: Post) => React.ReactNode;
|
|
11
12
|
}
|
|
12
|
-
export default function Comment({ onDelete, onRate, onUnrate, onReply, onContentUpdate, onLoadMoreReplies, renderDonation, renderActions, ...rest }: PostProps & CommentProps): import("react/jsx-runtime").JSX.Element;
|
|
13
|
+
export default function Comment({ onDelete, onRate, onUnrate, onReply, onContentUpdate, onLoadMoreReplies, renderDonation, renderActions, renderEditorPlugins, ...rest }: PostProps & CommentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -7,6 +7,7 @@ interface Props {
|
|
|
7
7
|
autoCollapse?: boolean;
|
|
8
8
|
enableHeadingsIdPlugin?: boolean;
|
|
9
9
|
onReady?: () => void;
|
|
10
|
+
children?: React.ReactNode;
|
|
10
11
|
}
|
|
11
|
-
export default function PostContent({ content, editing, onExitEditing, onSubmit, autoCollapse, enableHeadingsIdPlugin, onReady, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
|
+
export default function PostContent({ content, editing, onExitEditing, onSubmit, autoCollapse, enableHeadingsIdPlugin, onReady, children, ...rest }: Props): import("react/jsx-runtime").JSX.Element;
|
|
12
13
|
export {};
|
|
@@ -13,6 +13,7 @@ export interface PostProps {
|
|
|
13
13
|
showProfileCard?: boolean;
|
|
14
14
|
className?: string;
|
|
15
15
|
resolveAuthorInfoAppend?: (post: Post) => React.ReactNode;
|
|
16
|
+
editorPlugins?: React.ReactNode;
|
|
16
17
|
}
|
|
17
18
|
interface PostContext {
|
|
18
19
|
isAdmin: boolean;
|
|
@@ -20,5 +21,5 @@ interface PostContext {
|
|
|
20
21
|
interactive: boolean;
|
|
21
22
|
post: Post;
|
|
22
23
|
}
|
|
23
|
-
export default function PostComponent({ post, render, renderExtraContent, customMenu, interactive, onContentUpdate, allowCopyLink, autoCollapse, showProfileCard, resolveAuthorInfoAppend, ...rest }: PostProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
export default function PostComponent({ post, render, renderExtraContent, customMenu, interactive, onContentUpdate, allowCopyLink, autoCollapse, showProfileCard, resolveAuthorInfoAppend, editorPlugins, ...rest }: PostProps): import("react/jsx-runtime").JSX.Element;
|
|
24
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-DlnrrOY-.mjs";
|
|
8
8
|
const BlockletEditor = lazy(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|
|
@@ -54,6 +54,7 @@ import MuiMenuItem from "@mui/material/MenuItem";
|
|
|
54
54
|
import clsx from "clsx";
|
|
55
55
|
import IconButton$1 from "@mui/material/IconButton";
|
|
56
56
|
import MuiMenu from "@mui/material/Menu";
|
|
57
|
+
import { EditorHolderProvider } from "@blocklet/editor/lib/ext/EditorHolderPlugin";
|
|
57
58
|
import Dialog from "@arcblock/ux/lib/Dialog";
|
|
58
59
|
import orderBy from "lodash/orderBy";
|
|
59
60
|
import Typography from "@mui/material/Typography";
|
|
@@ -1568,6 +1569,7 @@ function PostContent({
|
|
|
1568
1569
|
autoCollapse,
|
|
1569
1570
|
enableHeadingsIdPlugin,
|
|
1570
1571
|
onReady,
|
|
1572
|
+
children,
|
|
1571
1573
|
...rest
|
|
1572
1574
|
}) {
|
|
1573
1575
|
if (editing && onSubmit) {
|
|
@@ -1592,7 +1594,8 @@ function PostContent({
|
|
|
1592
1594
|
children: [
|
|
1593
1595
|
/* @__PURE__ */ jsx(ImagePathFixerPlugin, {}),
|
|
1594
1596
|
/* @__PURE__ */ jsx(VideoPathFixerPlugin, {}),
|
|
1595
|
-
/* @__PURE__ */ jsx(CheckboxPlugin, { send: onSubmit })
|
|
1597
|
+
/* @__PURE__ */ jsx(CheckboxPlugin, { send: onSubmit }),
|
|
1598
|
+
children
|
|
1596
1599
|
]
|
|
1597
1600
|
}
|
|
1598
1601
|
) });
|
|
@@ -1606,7 +1609,8 @@ function PostContent({
|
|
|
1606
1609
|
onReady,
|
|
1607
1610
|
children: [
|
|
1608
1611
|
/* @__PURE__ */ jsx(ImagePathFixerPlugin, {}),
|
|
1609
|
-
/* @__PURE__ */ jsx(CheckboxPlugin, { send: onSubmit })
|
|
1612
|
+
/* @__PURE__ */ jsx(CheckboxPlugin, { send: onSubmit }),
|
|
1613
|
+
children
|
|
1610
1614
|
]
|
|
1611
1615
|
}
|
|
1612
1616
|
) }) });
|
|
@@ -1706,6 +1710,7 @@ function PostComponent({
|
|
|
1706
1710
|
autoCollapse,
|
|
1707
1711
|
showProfileCard,
|
|
1708
1712
|
resolveAuthorInfoAppend = () => void 0,
|
|
1713
|
+
editorPlugins,
|
|
1709
1714
|
...rest
|
|
1710
1715
|
}) {
|
|
1711
1716
|
var _a2;
|
|
@@ -1811,7 +1816,8 @@ function PostComponent({
|
|
|
1811
1816
|
editing,
|
|
1812
1817
|
onExitEditing: () => setEditing(false),
|
|
1813
1818
|
onSubmit: (content) => onContentUpdate(post, content),
|
|
1814
|
-
autoCollapse
|
|
1819
|
+
autoCollapse,
|
|
1820
|
+
children: editorPlugins
|
|
1815
1821
|
},
|
|
1816
1822
|
editing ? "comment-content" : post.synced || 0
|
|
1817
1823
|
) }),
|
|
@@ -2371,6 +2377,7 @@ function Comment({
|
|
|
2371
2377
|
onLoadMoreReplies,
|
|
2372
2378
|
renderDonation,
|
|
2373
2379
|
renderActions,
|
|
2380
|
+
renderEditorPlugins,
|
|
2374
2381
|
...rest
|
|
2375
2382
|
}) {
|
|
2376
2383
|
const { session } = useSessionContext();
|
|
@@ -2469,7 +2476,8 @@ function Comment({
|
|
|
2469
2476
|
interactive: rest.interactive,
|
|
2470
2477
|
resolveAuthorInfoAppend: rest.resolveAuthorInfoAppend,
|
|
2471
2478
|
renderDonation,
|
|
2472
|
-
renderActions
|
|
2479
|
+
renderActions,
|
|
2480
|
+
renderEditorPlugins
|
|
2473
2481
|
},
|
|
2474
2482
|
item.id
|
|
2475
2483
|
);
|
|
@@ -2497,16 +2505,17 @@ function Comment({
|
|
|
2497
2505
|
}
|
|
2498
2506
|
return null;
|
|
2499
2507
|
};
|
|
2500
|
-
return /* @__PURE__ */ jsx(
|
|
2508
|
+
return /* @__PURE__ */ jsx(EditorHolderProvider, { children: /* @__PURE__ */ jsx(
|
|
2501
2509
|
PostComponent,
|
|
2502
2510
|
{
|
|
2503
2511
|
...rest,
|
|
2504
2512
|
onContentUpdate,
|
|
2505
2513
|
customMenu,
|
|
2506
2514
|
render,
|
|
2507
|
-
renderExtraContent
|
|
2515
|
+
renderExtraContent,
|
|
2516
|
+
editorPlugins: renderEditorPlugins == null ? void 0 : renderEditorPlugins(rest.post)
|
|
2508
2517
|
}
|
|
2509
|
-
);
|
|
2518
|
+
) });
|
|
2510
2519
|
}
|
|
2511
2520
|
const KEY_LS_ORDER = "comment-list-order";
|
|
2512
2521
|
const getInitialState = (overrides) => ({
|
|
@@ -2589,7 +2598,8 @@ function CommentsProvider({
|
|
|
2589
2598
|
containerRef,
|
|
2590
2599
|
renderComments,
|
|
2591
2600
|
renderDonation,
|
|
2592
|
-
renderActions
|
|
2601
|
+
renderActions,
|
|
2602
|
+
renderEditorPlugins
|
|
2593
2603
|
}) {
|
|
2594
2604
|
var _a2;
|
|
2595
2605
|
const [state, setState] = useSetState(getInitialState(order ? { order } : {}));
|
|
@@ -2792,7 +2802,8 @@ function CommentsProvider({
|
|
|
2792
2802
|
findById,
|
|
2793
2803
|
renderComments,
|
|
2794
2804
|
renderDonation,
|
|
2795
|
-
renderActions
|
|
2805
|
+
renderActions,
|
|
2806
|
+
renderEditorPlugins
|
|
2796
2807
|
}),
|
|
2797
2808
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2798
2809
|
[target, state]
|
|
@@ -2900,7 +2911,8 @@ function CommentList(props) {
|
|
|
2900
2911
|
api,
|
|
2901
2912
|
renderComments,
|
|
2902
2913
|
renderDonation,
|
|
2903
|
-
renderActions
|
|
2914
|
+
renderActions,
|
|
2915
|
+
renderEditorPlugins
|
|
2904
2916
|
} = useCommentsContext();
|
|
2905
2917
|
if (highlighted) {
|
|
2906
2918
|
return /* @__PURE__ */ jsx(SegmentalList, { ...props });
|
|
@@ -2921,6 +2933,7 @@ function CommentList(props) {
|
|
|
2921
2933
|
interactive,
|
|
2922
2934
|
renderDonation,
|
|
2923
2935
|
renderActions,
|
|
2936
|
+
renderEditorPlugins,
|
|
2924
2937
|
...restProps
|
|
2925
2938
|
},
|
|
2926
2939
|
comment.id
|
|
@@ -4721,7 +4734,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
|
|
|
4721
4734
|
}
|
|
4722
4735
|
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" }) });
|
|
4723
4736
|
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" }) });
|
|
4724
|
-
const Editor = lazy(() => import("./editor-
|
|
4737
|
+
const Editor = lazy(() => import("./editor-CcRRm7J6.mjs"));
|
|
4725
4738
|
function LazyEditor(props) {
|
|
4726
4739
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
4727
4740
|
/* @__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, ar, N, am, 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, ar, N, am, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-DlnrrOY-.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
(function(global, factory) {
|
|
2
|
-
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("@arcblock/ux/lib/Theme"), require("react"), require("@mui/material"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("react-lazy-with-preload"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/material/Box"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/AvatarGroup"), require("@mui/material/colors"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/react-hooks"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@arcblock/did-connect/lib/Session"), require("semver-compare"), require("@arcblock/bridge"), require("@mui/icons-material/NotificationsActiveOutlined"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@arcblock/did-connect/lib/Address"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("react-dom"), require("ufo"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("url-join"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/colors/grey"), require("@blocklet/editor"), require("@mui/material/Fab"), require("lodash/debounce"), require("@blocklet/editor/lib/main/hooks/useIsFocused"), require("@blocklet/editor/lib/ext/BusyPlugin"), require("@mui/material/TextField"), require("@mui/icons-material/Add"), require("@mui/icons-material/ArrowBackIos"), require("@mui/icons-material/ShortText"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), require("@emotion/css"), require("@blocklet/editor/lib/ext/OnContentChangePlugin"), require("@blocklet/editor/lib/ext/ShortcutPlugin"), require("@blocklet/editor/lib/ext/SafeAreaPlugin"), require("@lexical/text"), require("@blocklet/editor/lib/main/nodes/ImageNode"), require("@blocklet/editor/lib/ext/VideoPlugin/VideoNode")) : typeof define === "function" && define.amd ? define(["exports", "@blocklet/labels", "react/jsx-runtime", "@mui/material/styles", "@arcblock/ux/lib/Theme", "react", "@mui/material", "lodash/isNil", "@blocklet/editor/lib/config", "react-lazy-with-preload", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/material/Box", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@arcblock/did-connect/lib/Avatar", "@mui/material/AvatarGroup", "@mui/material/colors", "@mui/material/useMediaQuery", "@arcblock/ux/lib/DID", "@mui/material/Tooltip", "react-router-dom", "@arcblock/react-hooks", "@arcblock/ux/lib/RelativeTime", "@mui/material/Chip", "@mui/material/Stack", "lodash/groupBy", "lodash/flatMap", "lodash/uniqBy", "lodash/trim", "@mui/material/Avatar", "@mui/icons-material/BrokenImage", "@iconify/react", "@arcblock/ux/lib/Empty", "@arcblock/did-connect/lib/Session", "semver-compare", "@arcblock/bridge", "@mui/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "react-dom", "ufo", "dayjs", "dayjs/plugin/relativeTime", "url-join", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "@blocklet/editor", "@mui/material/Fab", "lodash/debounce", "@blocklet/editor/lib/main/hooks/useIsFocused", "@blocklet/editor/lib/ext/BusyPlugin", "@mui/material/TextField", "@mui/icons-material/Add", "@mui/icons-material/ArrowBackIos", "@mui/icons-material/ShortText", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@emotion/css", "@blocklet/editor/lib/ext/OnContentChangePlugin", "@blocklet/editor/lib/ext/ShortcutPlugin", "@blocklet/editor/lib/ext/SafeAreaPlugin", "@lexical/text", "@blocklet/editor/lib/main/nodes/ImageNode", "@blocklet/editor/lib/ext/VideoPlugin/VideoNode"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.DiscussKitComponents = {}, global.labels, global.jsxRuntime, global.styles, global.Theme, global.react, global.material, global.isNil, global.config, global.reactLazyWithPreload, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.Box, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.reactHooks, global.UxRelativeTime, global.Chip, global.Stack, global.groupBy, global.flatMap, global.uniqBy, global.trim, global.Avatar$1, global.BrokenImageIcon, global.react$1, global.Empty$3, global.Session, global.cmp, global.bridge, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.ReactDOM, global.ufo, global.dayjs, global.relativeTime, global.joinUrl, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.editor$1, global.Fab, global.debounce, global.useIsFocused, global.BusyPlugin, global.TextField, global.AddIcon, global.ArrowBackIosIcon, global.ShortTextIcon, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.css, global.OnContentChangePlugin, global.ShortcutPlugin$1, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
|
|
3
|
-
})(this, function(exports2, labels, jsxRuntime, styles, Theme, react, material, isNil, config, reactLazyWithPreload, LexicalComposerContext, lexical$1, ahooks, Box, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, reactHooks, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$3, Session, cmp, bridge, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, Dialog, orderBy, Typography, Skeleton, ReactDOM, ufo, dayjs, relativeTime, joinUrl, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, editor$1, Fab, debounce, useIsFocused, BusyPlugin, TextField, AddIcon, ArrowBackIosIcon, ShortTextIcon, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin$1, SafeAreaPlugin, text, ImageNode, VideoNode) {
|
|
2
|
+
typeof exports === "object" && typeof module !== "undefined" ? factory(exports, require("@blocklet/labels"), require("react/jsx-runtime"), require("@mui/material/styles"), require("@arcblock/ux/lib/Theme"), require("react"), require("@mui/material"), require("lodash/isNil"), require("@blocklet/editor/lib/config"), require("react-lazy-with-preload"), require("@lexical/react/LexicalComposerContext"), require("lexical"), require("ahooks"), require("@mui/material/Box"), require("@mui/lab/LoadingButton"), require("@mui/icons-material"), require("@arcblock/ux/lib/Locale/context"), require("@mui/material/Alert"), require("lodash/isBoolean"), require("@mui/material/Button"), require("@arcblock/did-connect/lib/Avatar"), require("@mui/material/AvatarGroup"), require("@mui/material/colors"), require("@mui/material/useMediaQuery"), require("@arcblock/ux/lib/DID"), require("@mui/material/Tooltip"), require("react-router-dom"), require("@arcblock/react-hooks"), require("@arcblock/ux/lib/RelativeTime"), require("@mui/material/Chip"), require("@mui/material/Stack"), require("lodash/groupBy"), require("lodash/flatMap"), require("lodash/uniqBy"), require("lodash/trim"), require("@mui/material/Avatar"), require("@mui/icons-material/BrokenImage"), require("@iconify/react"), require("@arcblock/ux/lib/Empty"), require("@arcblock/did-connect/lib/Session"), require("semver-compare"), require("@arcblock/bridge"), require("@mui/icons-material/NotificationsActiveOutlined"), require("@blocklet/editor/lib/ext/CheckboxPlugin"), require("@arcblock/did-connect/lib/Address"), require("@mui/material/MenuItem"), require("clsx"), require("@mui/material/IconButton"), require("@mui/material/Menu"), require("@blocklet/editor/lib/ext/EditorHolderPlugin"), require("@arcblock/ux/lib/Dialog"), require("lodash/orderBy"), require("@mui/material/Typography"), require("@mui/material/Skeleton"), require("react-dom"), require("ufo"), require("dayjs"), require("dayjs/plugin/relativeTime"), require("url-join"), require("mitt"), require("@mui/material/CircularProgress"), require("react-helmet"), require("react-flip-toolkit"), require("@mui/material/colors/grey"), require("@blocklet/editor"), require("@mui/material/Fab"), require("lodash/debounce"), require("@blocklet/editor/lib/main/hooks/useIsFocused"), require("@blocklet/editor/lib/ext/BusyPlugin"), require("@mui/material/TextField"), require("@mui/icons-material/Add"), require("@mui/icons-material/ArrowBackIos"), require("@mui/icons-material/ShortText"), require("axios"), require("@arcblock/ux/lib/Toast"), require("@mui/material/Pagination"), require("unstated-next"), require("js-cookie"), require("@arcblock/ws"), require("@emotion/css"), require("@blocklet/editor/lib/ext/OnContentChangePlugin"), require("@blocklet/editor/lib/ext/ShortcutPlugin"), require("@blocklet/editor/lib/ext/SafeAreaPlugin"), require("@lexical/text"), require("@blocklet/editor/lib/main/nodes/ImageNode"), require("@blocklet/editor/lib/ext/VideoPlugin/VideoNode")) : typeof define === "function" && define.amd ? define(["exports", "@blocklet/labels", "react/jsx-runtime", "@mui/material/styles", "@arcblock/ux/lib/Theme", "react", "@mui/material", "lodash/isNil", "@blocklet/editor/lib/config", "react-lazy-with-preload", "@lexical/react/LexicalComposerContext", "lexical", "ahooks", "@mui/material/Box", "@mui/lab/LoadingButton", "@mui/icons-material", "@arcblock/ux/lib/Locale/context", "@mui/material/Alert", "lodash/isBoolean", "@mui/material/Button", "@arcblock/did-connect/lib/Avatar", "@mui/material/AvatarGroup", "@mui/material/colors", "@mui/material/useMediaQuery", "@arcblock/ux/lib/DID", "@mui/material/Tooltip", "react-router-dom", "@arcblock/react-hooks", "@arcblock/ux/lib/RelativeTime", "@mui/material/Chip", "@mui/material/Stack", "lodash/groupBy", "lodash/flatMap", "lodash/uniqBy", "lodash/trim", "@mui/material/Avatar", "@mui/icons-material/BrokenImage", "@iconify/react", "@arcblock/ux/lib/Empty", "@arcblock/did-connect/lib/Session", "semver-compare", "@arcblock/bridge", "@mui/icons-material/NotificationsActiveOutlined", "@blocklet/editor/lib/ext/CheckboxPlugin", "@arcblock/did-connect/lib/Address", "@mui/material/MenuItem", "clsx", "@mui/material/IconButton", "@mui/material/Menu", "@blocklet/editor/lib/ext/EditorHolderPlugin", "@arcblock/ux/lib/Dialog", "lodash/orderBy", "@mui/material/Typography", "@mui/material/Skeleton", "react-dom", "ufo", "dayjs", "dayjs/plugin/relativeTime", "url-join", "mitt", "@mui/material/CircularProgress", "react-helmet", "react-flip-toolkit", "@mui/material/colors/grey", "@blocklet/editor", "@mui/material/Fab", "lodash/debounce", "@blocklet/editor/lib/main/hooks/useIsFocused", "@blocklet/editor/lib/ext/BusyPlugin", "@mui/material/TextField", "@mui/icons-material/Add", "@mui/icons-material/ArrowBackIos", "@mui/icons-material/ShortText", "axios", "@arcblock/ux/lib/Toast", "@mui/material/Pagination", "unstated-next", "js-cookie", "@arcblock/ws", "@emotion/css", "@blocklet/editor/lib/ext/OnContentChangePlugin", "@blocklet/editor/lib/ext/ShortcutPlugin", "@blocklet/editor/lib/ext/SafeAreaPlugin", "@lexical/text", "@blocklet/editor/lib/main/nodes/ImageNode", "@blocklet/editor/lib/ext/VideoPlugin/VideoNode"], factory) : (global = typeof globalThis !== "undefined" ? globalThis : global || self, factory(global.DiscussKitComponents = {}, global.labels, global.jsxRuntime, global.styles, global.Theme, global.react, global.material, global.isNil, global.config, global.reactLazyWithPreload, global.LexicalComposerContext, global.lexical$1, global.ahooks, global.Box, global.LoadingButton, global.iconsMaterial, global.context, global.Alert, global.isBoolean, global.Button, global.DidAvatar, global.AvatarGroup, global.colors, global.useMediaQuery, global.DID, global.Tooltip, global.reactRouterDom, global.reactHooks, global.UxRelativeTime, global.Chip, global.Stack, global.groupBy, global.flatMap, global.uniqBy, global.trim, global.Avatar$1, global.BrokenImageIcon, global.react$1, global.Empty$3, global.Session, global.cmp, global.bridge, global.NotificationsActiveOutlinedIcon, global.CheckboxPlugin, global.DIDAddress, global.MuiMenuItem, global.clsx, global.IconButton$1, global.MuiMenu, global.EditorHolderPlugin, global.Dialog, global.orderBy, global.Typography, global.Skeleton, global.ReactDOM, global.ufo, global.dayjs, global.relativeTime, global.joinUrl, global.mitt, global.CircularProgress, global.reactHelmet, global.reactFlipToolkit, global.grey, global.editor$1, global.Fab, global.debounce, global.useIsFocused, global.BusyPlugin, global.TextField, global.AddIcon, global.ArrowBackIosIcon, global.ShortTextIcon, global.axios, global.Toast, global.MuiPagination, global.unstatedNext, global.Cookie, global.ws, global.css, global.OnContentChangePlugin, global.ShortcutPlugin$1, global.SafeAreaPlugin, global.text, global.ImageNode, global.VideoNode));
|
|
3
|
+
})(this, function(exports2, labels, jsxRuntime, styles, Theme, react, material, isNil, config, reactLazyWithPreload, LexicalComposerContext, lexical$1, ahooks, Box, LoadingButton, iconsMaterial, context, Alert, isBoolean, Button, DidAvatar, AvatarGroup, colors, useMediaQuery, DID, Tooltip, reactRouterDom, reactHooks, UxRelativeTime, Chip, Stack, groupBy, flatMap, uniqBy, trim, Avatar$1, BrokenImageIcon, react$1, Empty$3, Session, cmp, bridge, NotificationsActiveOutlinedIcon, CheckboxPlugin, DIDAddress, MuiMenuItem, clsx, IconButton$1, MuiMenu, EditorHolderPlugin, Dialog, orderBy, Typography, Skeleton, ReactDOM, ufo, dayjs, relativeTime, joinUrl, mitt, CircularProgress, reactHelmet, reactFlipToolkit, grey, editor$1, Fab, debounce, useIsFocused, BusyPlugin, TextField, AddIcon, ArrowBackIosIcon, ShortTextIcon, axios, Toast, MuiPagination, unstatedNext, Cookie, ws, css, OnContentChangePlugin, ShortcutPlugin$1, SafeAreaPlugin, text, ImageNode, VideoNode) {
|
|
4
4
|
"use strict";var __defProp = Object.defineProperty;
|
|
5
5
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
6
6
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
@@ -1491,6 +1491,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1491
1491
|
autoCollapse,
|
|
1492
1492
|
enableHeadingsIdPlugin,
|
|
1493
1493
|
onReady,
|
|
1494
|
+
children,
|
|
1494
1495
|
...rest
|
|
1495
1496
|
}) {
|
|
1496
1497
|
if (editing && onSubmit) {
|
|
@@ -1515,7 +1516,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1515
1516
|
children: [
|
|
1516
1517
|
/* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
|
|
1517
1518
|
/* @__PURE__ */ jsxRuntime.jsx(VideoPathFixerPlugin, {}),
|
|
1518
|
-
/* @__PURE__ */ jsxRuntime.jsx(CheckboxPlugin, { send: onSubmit })
|
|
1519
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckboxPlugin, { send: onSubmit }),
|
|
1520
|
+
children
|
|
1519
1521
|
]
|
|
1520
1522
|
}
|
|
1521
1523
|
) });
|
|
@@ -1529,7 +1531,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1529
1531
|
onReady,
|
|
1530
1532
|
children: [
|
|
1531
1533
|
/* @__PURE__ */ jsxRuntime.jsx(ImagePathFixerPlugin, {}),
|
|
1532
|
-
/* @__PURE__ */ jsxRuntime.jsx(CheckboxPlugin, { send: onSubmit })
|
|
1534
|
+
/* @__PURE__ */ jsxRuntime.jsx(CheckboxPlugin, { send: onSubmit }),
|
|
1535
|
+
children
|
|
1533
1536
|
]
|
|
1534
1537
|
}
|
|
1535
1538
|
) }) });
|
|
@@ -1629,6 +1632,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1629
1632
|
autoCollapse,
|
|
1630
1633
|
showProfileCard,
|
|
1631
1634
|
resolveAuthorInfoAppend = () => void 0,
|
|
1635
|
+
editorPlugins,
|
|
1632
1636
|
...rest
|
|
1633
1637
|
}) {
|
|
1634
1638
|
var _a2;
|
|
@@ -1734,7 +1738,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
1734
1738
|
editing,
|
|
1735
1739
|
onExitEditing: () => setEditing(false),
|
|
1736
1740
|
onSubmit: (content) => onContentUpdate(post, content),
|
|
1737
|
-
autoCollapse
|
|
1741
|
+
autoCollapse,
|
|
1742
|
+
children: editorPlugins
|
|
1738
1743
|
},
|
|
1739
1744
|
editing ? "comment-content" : post.synced || 0
|
|
1740
1745
|
) }),
|
|
@@ -2294,6 +2299,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2294
2299
|
onLoadMoreReplies,
|
|
2295
2300
|
renderDonation,
|
|
2296
2301
|
renderActions,
|
|
2302
|
+
renderEditorPlugins,
|
|
2297
2303
|
...rest
|
|
2298
2304
|
}) {
|
|
2299
2305
|
const { session } = useSessionContext();
|
|
@@ -2392,7 +2398,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2392
2398
|
interactive: rest.interactive,
|
|
2393
2399
|
resolveAuthorInfoAppend: rest.resolveAuthorInfoAppend,
|
|
2394
2400
|
renderDonation,
|
|
2395
|
-
renderActions
|
|
2401
|
+
renderActions,
|
|
2402
|
+
renderEditorPlugins
|
|
2396
2403
|
},
|
|
2397
2404
|
item.id
|
|
2398
2405
|
);
|
|
@@ -2420,16 +2427,17 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2420
2427
|
}
|
|
2421
2428
|
return null;
|
|
2422
2429
|
};
|
|
2423
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
2430
|
+
return /* @__PURE__ */ jsxRuntime.jsx(EditorHolderPlugin.EditorHolderProvider, { children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2424
2431
|
PostComponent,
|
|
2425
2432
|
{
|
|
2426
2433
|
...rest,
|
|
2427
2434
|
onContentUpdate,
|
|
2428
2435
|
customMenu,
|
|
2429
2436
|
render,
|
|
2430
|
-
renderExtraContent
|
|
2437
|
+
renderExtraContent,
|
|
2438
|
+
editorPlugins: renderEditorPlugins == null ? void 0 : renderEditorPlugins(rest.post)
|
|
2431
2439
|
}
|
|
2432
|
-
);
|
|
2440
|
+
) });
|
|
2433
2441
|
}
|
|
2434
2442
|
const KEY_LS_ORDER = "comment-list-order";
|
|
2435
2443
|
const getInitialState = (overrides) => ({
|
|
@@ -2512,7 +2520,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2512
2520
|
containerRef,
|
|
2513
2521
|
renderComments,
|
|
2514
2522
|
renderDonation,
|
|
2515
|
-
renderActions
|
|
2523
|
+
renderActions,
|
|
2524
|
+
renderEditorPlugins
|
|
2516
2525
|
}) {
|
|
2517
2526
|
var _a2;
|
|
2518
2527
|
const [state, setState] = ahooks.useSetState(getInitialState(order ? { order } : {}));
|
|
@@ -2715,7 +2724,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2715
2724
|
findById,
|
|
2716
2725
|
renderComments,
|
|
2717
2726
|
renderDonation,
|
|
2718
|
-
renderActions
|
|
2727
|
+
renderActions,
|
|
2728
|
+
renderEditorPlugins
|
|
2719
2729
|
}),
|
|
2720
2730
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2721
2731
|
[target, state]
|
|
@@ -2823,7 +2833,8 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2823
2833
|
api,
|
|
2824
2834
|
renderComments,
|
|
2825
2835
|
renderDonation,
|
|
2826
|
-
renderActions
|
|
2836
|
+
renderActions,
|
|
2837
|
+
renderEditorPlugins
|
|
2827
2838
|
} = useCommentsContext();
|
|
2828
2839
|
if (highlighted) {
|
|
2829
2840
|
return /* @__PURE__ */ jsxRuntime.jsx(SegmentalList, { ...props });
|
|
@@ -2844,6 +2855,7 @@ var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "sy
|
|
|
2844
2855
|
interactive,
|
|
2845
2856
|
renderDonation,
|
|
2846
2857
|
renderActions,
|
|
2858
|
+
renderEditorPlugins,
|
|
2847
2859
|
...restProps
|
|
2848
2860
|
},
|
|
2849
2861
|
comment.id
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.41",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -31,6 +31,7 @@
|
|
|
31
31
|
"ahooks": "^3.8.1",
|
|
32
32
|
"axios": "^0.27.2",
|
|
33
33
|
"dayjs": "^1.11.13",
|
|
34
|
+
"franc-min": "^6.2.0",
|
|
34
35
|
"js-cookie": "^3.0.5",
|
|
35
36
|
"lexical": "0.13.1",
|
|
36
37
|
"lottie-react": "^2.4.0",
|
|
@@ -43,8 +44,8 @@
|
|
|
43
44
|
"ufo": "^1.5.4",
|
|
44
45
|
"unstated-next": "^1.1.0",
|
|
45
46
|
"url-join": "^4.0.1",
|
|
46
|
-
"@blocklet/editor": "^2.1.
|
|
47
|
-
"@blocklet/labels": "^2.1.
|
|
47
|
+
"@blocklet/editor": "^2.1.41",
|
|
48
|
+
"@blocklet/labels": "^2.1.41"
|
|
48
49
|
},
|
|
49
50
|
"peerDependencies": {
|
|
50
51
|
"@arcblock/did-connect": "^2.10.36",
|