@blocklet/discuss-kit-ux 2.0.81 → 2.0.83
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 -2
- package/dist/{editor-C_9ooELE.mjs → editor-C--h9pxj.mjs} +1 -1
- package/dist/{index-usvR3B2J.mjs → index-DL2IN0gQ.mjs} +11 -7
- package/dist/index.es.js +1 -1
- package/dist/index.umd.js +10 -6
- package/package.json +4 -4
|
@@ -21,6 +21,7 @@ interface CommentsProviderProps {
|
|
|
21
21
|
containerRef: React.RefObject<HTMLDivElement>;
|
|
22
22
|
renderComments?: CommentsRender;
|
|
23
23
|
renderDonation?: (post: Post) => React.ReactNode;
|
|
24
|
+
renderActions?: (post: Post) => React.ReactNode;
|
|
24
25
|
}
|
|
25
26
|
interface State {
|
|
26
27
|
comments: Post[];
|
|
@@ -59,8 +60,9 @@ interface CommentsContextValue {
|
|
|
59
60
|
findById: (id: string) => Post | undefined;
|
|
60
61
|
renderComments?: CommentsRender;
|
|
61
62
|
renderDonation?: (post: Post) => React.ReactNode;
|
|
63
|
+
renderActions?: (post: Post) => React.ReactNode;
|
|
62
64
|
}
|
|
63
65
|
export declare const CommentsContext: React.Context<CommentsContextValue>;
|
|
64
66
|
export declare const useCommentsContext: () => CommentsContextValue;
|
|
65
|
-
export declare function CommentsProvider({ target, api, flatView, children, order, autoLoadComments, autoCollapse, allowCopyLink, showProfileCard, interactive, containerRef, renderComments, renderDonation, }: CommentsProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
67
|
+
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;
|
|
66
68
|
export {};
|
|
@@ -8,6 +8,6 @@ export interface CommentProps {
|
|
|
8
8
|
onReply: CommentAPI['reply'];
|
|
9
9
|
onLoadMoreReplies: (rootId: string) => void;
|
|
10
10
|
renderDonation?: (post: Post) => React.ReactNode;
|
|
11
|
-
|
|
11
|
+
renderActions?: (post: Post) => React.ReactNode;
|
|
12
12
|
}
|
|
13
|
-
export default function Comment({ onDelete, onRate, onUnrate, onReply, onContentUpdate, onLoadMoreReplies, renderDonation,
|
|
13
|
+
export default function Comment({ onDelete, onRate, onUnrate, onReply, onContentUpdate, onLoadMoreReplies, renderDonation, renderActions, ...rest }: PostProps & CommentProps): import("react/jsx-runtime").JSX.Element;
|
|
@@ -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-DL2IN0gQ.mjs";
|
|
8
8
|
const BlockletEditor = lazy(() => import("@blocklet/editor"));
|
|
9
9
|
const Root = styled(Box)`
|
|
10
10
|
.be-editable,
|
|
@@ -2318,7 +2318,7 @@ function Comment({
|
|
|
2318
2318
|
onContentUpdate,
|
|
2319
2319
|
onLoadMoreReplies,
|
|
2320
2320
|
renderDonation,
|
|
2321
|
-
|
|
2321
|
+
renderActions,
|
|
2322
2322
|
...rest
|
|
2323
2323
|
}) {
|
|
2324
2324
|
const { session } = useSessionContext();
|
|
@@ -2384,7 +2384,7 @@ function Comment({
|
|
|
2384
2384
|
] })
|
|
2385
2385
|
}
|
|
2386
2386
|
),
|
|
2387
|
-
|
|
2387
|
+
renderActions == null ? void 0 : renderActions(post)
|
|
2388
2388
|
] }),
|
|
2389
2389
|
inputVisible && /* @__PURE__ */ jsx(Box$1, { my: 2, children: /* @__PURE__ */ jsx(
|
|
2390
2390
|
CommentInput,
|
|
@@ -2417,7 +2417,7 @@ function Comment({
|
|
|
2417
2417
|
interactive: rest.interactive,
|
|
2418
2418
|
authorInfoAppend: rest.authorInfoAppend,
|
|
2419
2419
|
renderDonation,
|
|
2420
|
-
|
|
2420
|
+
renderActions
|
|
2421
2421
|
},
|
|
2422
2422
|
item.id
|
|
2423
2423
|
);
|
|
@@ -2532,7 +2532,8 @@ function CommentsProvider({
|
|
|
2532
2532
|
interactive,
|
|
2533
2533
|
containerRef,
|
|
2534
2534
|
renderComments,
|
|
2535
|
-
renderDonation
|
|
2535
|
+
renderDonation,
|
|
2536
|
+
renderActions
|
|
2536
2537
|
}) {
|
|
2537
2538
|
var _a2;
|
|
2538
2539
|
const [state, setState] = useSetState(getInitialState(order ? { order } : {}));
|
|
@@ -2734,7 +2735,8 @@ function CommentsProvider({
|
|
|
2734
2735
|
loadMoreReplies,
|
|
2735
2736
|
findById,
|
|
2736
2737
|
renderComments,
|
|
2737
|
-
renderDonation
|
|
2738
|
+
renderDonation,
|
|
2739
|
+
renderActions
|
|
2738
2740
|
}),
|
|
2739
2741
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2740
2742
|
[target, state]
|
|
@@ -2841,7 +2843,8 @@ function CommentList(props) {
|
|
|
2841
2843
|
loadMoreReplies,
|
|
2842
2844
|
api,
|
|
2843
2845
|
renderComments,
|
|
2844
|
-
renderDonation
|
|
2846
|
+
renderDonation,
|
|
2847
|
+
renderActions
|
|
2845
2848
|
} = useCommentsContext();
|
|
2846
2849
|
if (highlighted) {
|
|
2847
2850
|
return /* @__PURE__ */ jsx(SegmentalList, { ...props });
|
|
@@ -2861,6 +2864,7 @@ function CommentList(props) {
|
|
|
2861
2864
|
showProfileCard,
|
|
2862
2865
|
interactive,
|
|
2863
2866
|
renderDonation,
|
|
2867
|
+
renderActions,
|
|
2864
2868
|
...restProps
|
|
2865
2869
|
},
|
|
2866
2870
|
comment.id
|
|
@@ -4751,7 +4755,7 @@ function Back({ url, fallbackUrl, iconOnly, sx, ...rest }) {
|
|
|
4751
4755
|
}
|
|
4752
4756
|
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" }) });
|
|
4753
4757
|
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" }) });
|
|
4754
|
-
const Editor = lazy(() => import("./editor-
|
|
4758
|
+
const Editor = lazy(() => import("./editor-C--h9pxj.mjs"));
|
|
4755
4759
|
function LazyEditor(props) {
|
|
4756
4760
|
const fallback2 = /* @__PURE__ */ jsxs(Box, { sx: { px: 3 }, children: [
|
|
4757
4761
|
/* @__PURE__ */ jsx(Skeleton, {}),
|
package/dist/index.es.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export * from "@blocklet/labels";
|
|
2
|
-
import { T, n, W, A, m, ad, B, F, K, J, L, ap, Y, X, $, Z, _, a1, w, C, x, y, E, a5, a6, ah, a8, O, Q, ac, D, ag, af, H, G, b, k, ae, M, P, ao, v, q, R, S, a9, aq, o, a2, a4, ai, al, ak, am, ar, N, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-
|
|
2
|
+
import { T, n, W, A, m, ad, B, F, K, J, L, ap, Y, X, $, Z, _, a1, w, C, x, y, E, a5, a6, ah, a8, O, Q, ac, D, ag, af, H, G, b, k, ae, M, P, ao, v, q, R, S, a9, aq, o, a2, a4, ai, al, ak, am, ar, N, as, l, f, p, r, j, t, h, aa, U, c, a0, z, a7, ab, u, an, d, at, a3, aj, e } from "./index-DL2IN0gQ.mjs";
|
|
3
3
|
import "react/jsx-runtime";
|
|
4
4
|
import "react";
|
|
5
5
|
import "@mui/material/Box";
|
package/dist/index.umd.js
CHANGED
|
@@ -2244,7 +2244,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2244
2244
|
onContentUpdate,
|
|
2245
2245
|
onLoadMoreReplies,
|
|
2246
2246
|
renderDonation,
|
|
2247
|
-
|
|
2247
|
+
renderActions,
|
|
2248
2248
|
...rest
|
|
2249
2249
|
}) {
|
|
2250
2250
|
const { session } = useSessionContext();
|
|
@@ -2310,7 +2310,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2310
2310
|
] })
|
|
2311
2311
|
}
|
|
2312
2312
|
),
|
|
2313
|
-
|
|
2313
|
+
renderActions == null ? void 0 : renderActions(post)
|
|
2314
2314
|
] }),
|
|
2315
2315
|
inputVisible && /* @__PURE__ */ jsxRuntime.jsx(Box, { my: 2, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
2316
2316
|
CommentInput,
|
|
@@ -2343,7 +2343,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2343
2343
|
interactive: rest.interactive,
|
|
2344
2344
|
authorInfoAppend: rest.authorInfoAppend,
|
|
2345
2345
|
renderDonation,
|
|
2346
|
-
|
|
2346
|
+
renderActions
|
|
2347
2347
|
},
|
|
2348
2348
|
item.id
|
|
2349
2349
|
);
|
|
@@ -2458,7 +2458,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2458
2458
|
interactive,
|
|
2459
2459
|
containerRef,
|
|
2460
2460
|
renderComments,
|
|
2461
|
-
renderDonation
|
|
2461
|
+
renderDonation,
|
|
2462
|
+
renderActions
|
|
2462
2463
|
}) {
|
|
2463
2464
|
var _a2;
|
|
2464
2465
|
const [state, setState] = ahooks.useSetState(getInitialState(order ? { order } : {}));
|
|
@@ -2660,7 +2661,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2660
2661
|
loadMoreReplies,
|
|
2661
2662
|
findById,
|
|
2662
2663
|
renderComments,
|
|
2663
|
-
renderDonation
|
|
2664
|
+
renderDonation,
|
|
2665
|
+
renderActions
|
|
2664
2666
|
}),
|
|
2665
2667
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
2666
2668
|
[target, state]
|
|
@@ -2767,7 +2769,8 @@ var __publicField = (obj, key, value) => {
|
|
|
2767
2769
|
loadMoreReplies,
|
|
2768
2770
|
api,
|
|
2769
2771
|
renderComments,
|
|
2770
|
-
renderDonation
|
|
2772
|
+
renderDonation,
|
|
2773
|
+
renderActions
|
|
2771
2774
|
} = useCommentsContext();
|
|
2772
2775
|
if (highlighted) {
|
|
2773
2776
|
return /* @__PURE__ */ jsxRuntime.jsx(SegmentalList, { ...props });
|
|
@@ -2787,6 +2790,7 @@ var __publicField = (obj, key, value) => {
|
|
|
2787
2790
|
showProfileCard,
|
|
2788
2791
|
interactive,
|
|
2789
2792
|
renderDonation,
|
|
2793
|
+
renderActions,
|
|
2790
2794
|
...restProps
|
|
2791
2795
|
},
|
|
2792
2796
|
comment.id
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@blocklet/discuss-kit-ux",
|
|
3
|
-
"version": "2.0.
|
|
3
|
+
"version": "2.0.83",
|
|
4
4
|
"files": [
|
|
5
5
|
"dist"
|
|
6
6
|
],
|
|
@@ -31,8 +31,8 @@
|
|
|
31
31
|
"@arcblock/bridge": "^2.10.6",
|
|
32
32
|
"@arcblock/react-hooks": "^2.10.6",
|
|
33
33
|
"@arcblock/ws": "^1.18.126",
|
|
34
|
-
"@blocklet/editor": "2.0.
|
|
35
|
-
"@blocklet/labels": "2.0.
|
|
34
|
+
"@blocklet/editor": "2.0.83",
|
|
35
|
+
"@blocklet/labels": "2.0.83",
|
|
36
36
|
"@blocklet/uploader": "^0.1.19",
|
|
37
37
|
"@emotion/css": "^11.10.5",
|
|
38
38
|
"@emotion/react": "^11.10.5",
|
|
@@ -100,5 +100,5 @@
|
|
|
100
100
|
"resolutions": {
|
|
101
101
|
"react": "^18.2.0"
|
|
102
102
|
},
|
|
103
|
-
"gitHead": "
|
|
103
|
+
"gitHead": "ffe6740390580b8e886bb350a92c30c0b86fa62a"
|
|
104
104
|
}
|