hive-react-kit 0.8.7 → 0.9.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/dist/build.css +47 -1
- package/dist/components/HiveDetailPost.d.ts +21 -2
- package/dist/components/actionButtons/PostActionButton.d.ts +12 -3
- package/dist/components/comments/AddCommentInput.d.ts +43 -2
- package/dist/components/comments/CommentsModal.d.ts +11 -3
- package/dist/components/inlineComments/InlineCommentItem.d.ts +8 -1
- package/dist/components/inlineComments/InlineCommentSection.d.ts +16 -2
- package/dist/index.cjs.js +131 -131
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +14622 -13866
- package/dist/utils/commentOptions.d.ts +35 -0
- package/dist/utils/hiveLinks.d.ts +33 -0
- package/package.json +3 -3
package/dist/build.css
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
/*! tailwindcss v4.2.
|
|
1
|
+
/*! tailwindcss v4.2.4 | MIT License | https://tailwindcss.com */
|
|
2
2
|
@layer properties;
|
|
3
3
|
@layer theme, base, components, utilities;
|
|
4
4
|
@layer theme {
|
|
@@ -792,6 +792,9 @@
|
|
|
792
792
|
.w-2 {
|
|
793
793
|
width: calc(var(--spacing) * 2);
|
|
794
794
|
}
|
|
795
|
+
.w-2\.5 {
|
|
796
|
+
width: calc(var(--spacing) * 2.5);
|
|
797
|
+
}
|
|
795
798
|
.w-2\/3 {
|
|
796
799
|
width: calc(2 / 3 * 100%);
|
|
797
800
|
}
|
|
@@ -1571,6 +1574,12 @@
|
|
|
1571
1574
|
background-color: color-mix(in oklab, var(--color-gray-700) 60%, transparent);
|
|
1572
1575
|
}
|
|
1573
1576
|
}
|
|
1577
|
+
.bg-gray-700\/70 {
|
|
1578
|
+
background-color: color-mix(in srgb, oklch(37.3% 0.034 259.733) 70%, transparent);
|
|
1579
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1580
|
+
background-color: color-mix(in oklab, var(--color-gray-700) 70%, transparent);
|
|
1581
|
+
}
|
|
1582
|
+
}
|
|
1574
1583
|
.bg-gray-800 {
|
|
1575
1584
|
background-color: var(--color-gray-800);
|
|
1576
1585
|
}
|
|
@@ -1893,6 +1902,9 @@
|
|
|
1893
1902
|
.p-8 {
|
|
1894
1903
|
padding: calc(var(--spacing) * 8);
|
|
1895
1904
|
}
|
|
1905
|
+
.px-0\.5 {
|
|
1906
|
+
padding-inline: calc(var(--spacing) * 0.5);
|
|
1907
|
+
}
|
|
1896
1908
|
.px-1 {
|
|
1897
1909
|
padding-inline: calc(var(--spacing) * 1);
|
|
1898
1910
|
}
|
|
@@ -2472,6 +2484,10 @@
|
|
|
2472
2484
|
--tw-ease: var(--ease-out);
|
|
2473
2485
|
transition-timing-function: var(--ease-out);
|
|
2474
2486
|
}
|
|
2487
|
+
.outline-none {
|
|
2488
|
+
--tw-outline-style: none;
|
|
2489
|
+
outline-style: none;
|
|
2490
|
+
}
|
|
2475
2491
|
.group-hover\:pointer-events-auto {
|
|
2476
2492
|
&:is(:where(.group):hover *) {
|
|
2477
2493
|
@media (hover: hover) {
|
|
@@ -2630,6 +2646,16 @@
|
|
|
2630
2646
|
}
|
|
2631
2647
|
}
|
|
2632
2648
|
}
|
|
2649
|
+
.hover\:bg-blue-600\/40 {
|
|
2650
|
+
&:hover {
|
|
2651
|
+
@media (hover: hover) {
|
|
2652
|
+
background-color: color-mix(in srgb, oklch(54.6% 0.245 262.881) 40%, transparent);
|
|
2653
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2654
|
+
background-color: color-mix(in oklab, var(--color-blue-600) 40%, transparent);
|
|
2655
|
+
}
|
|
2656
|
+
}
|
|
2657
|
+
}
|
|
2658
|
+
}
|
|
2633
2659
|
.hover\:bg-blue-700 {
|
|
2634
2660
|
&:hover {
|
|
2635
2661
|
@media (hover: hover) {
|
|
@@ -3875,11 +3901,21 @@
|
|
|
3875
3901
|
background-color: var(--color-blue-600);
|
|
3876
3902
|
}
|
|
3877
3903
|
}
|
|
3904
|
+
.\[\&\:\:-moz-range-thumb\]\:h-4 {
|
|
3905
|
+
&::-moz-range-thumb {
|
|
3906
|
+
height: calc(var(--spacing) * 4);
|
|
3907
|
+
}
|
|
3908
|
+
}
|
|
3878
3909
|
.\[\&\:\:-moz-range-thumb\]\:h-5 {
|
|
3879
3910
|
&::-moz-range-thumb {
|
|
3880
3911
|
height: calc(var(--spacing) * 5);
|
|
3881
3912
|
}
|
|
3882
3913
|
}
|
|
3914
|
+
.\[\&\:\:-moz-range-thumb\]\:w-4 {
|
|
3915
|
+
&::-moz-range-thumb {
|
|
3916
|
+
width: calc(var(--spacing) * 4);
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3883
3919
|
.\[\&\:\:-moz-range-thumb\]\:w-5 {
|
|
3884
3920
|
&::-moz-range-thumb {
|
|
3885
3921
|
width: calc(var(--spacing) * 5);
|
|
@@ -3941,11 +3977,21 @@
|
|
|
3941
3977
|
margin-top: calc(var(--spacing) * -1.5);
|
|
3942
3978
|
}
|
|
3943
3979
|
}
|
|
3980
|
+
.\[\&\:\:-webkit-slider-thumb\]\:h-4 {
|
|
3981
|
+
&::-webkit-slider-thumb {
|
|
3982
|
+
height: calc(var(--spacing) * 4);
|
|
3983
|
+
}
|
|
3984
|
+
}
|
|
3944
3985
|
.\[\&\:\:-webkit-slider-thumb\]\:h-5 {
|
|
3945
3986
|
&::-webkit-slider-thumb {
|
|
3946
3987
|
height: calc(var(--spacing) * 5);
|
|
3947
3988
|
}
|
|
3948
3989
|
}
|
|
3990
|
+
.\[\&\:\:-webkit-slider-thumb\]\:w-4 {
|
|
3991
|
+
&::-webkit-slider-thumb {
|
|
3992
|
+
width: calc(var(--spacing) * 4);
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3949
3995
|
.\[\&\:\:-webkit-slider-thumb\]\:w-5 {
|
|
3950
3996
|
&::-webkit-slider-thumb {
|
|
3951
3997
|
width: calc(var(--spacing) * 5);
|
|
@@ -7,8 +7,27 @@ export interface HiveDetailPostProps {
|
|
|
7
7
|
* Called when the user submits a comment.
|
|
8
8
|
* Return `false` to indicate the operation was cancelled (e.g. keychain request denied)
|
|
9
9
|
* — the composed text will be preserved and no refresh will occur.
|
|
10
|
+
* `voteWeight` is non-null when the composer's upvote-on-publish toggle is enabled
|
|
11
|
+
* (1–100, step 0.25) — consumer should broadcast vote+comment atomically.
|
|
10
12
|
*/
|
|
11
|
-
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => void | boolean | Promise<void | boolean>;
|
|
13
|
+
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string, voteWeight?: number | null) => void | boolean | Promise<void | boolean>;
|
|
14
|
+
/**
|
|
15
|
+
* Show the upvote-on-publish toggle in the post's comment composer. Default false (opt-in).
|
|
16
|
+
* Auto-hidden internally when the current user has already voted the post.
|
|
17
|
+
*/
|
|
18
|
+
showVoteButton?: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Optional pre-render transform for the post body. Lets the consumer strip
|
|
21
|
+
* app-specific footers (e.g. "via Apps from ...") before the markdown
|
|
22
|
+
* renderer runs. Return the (possibly-transformed) body string.
|
|
23
|
+
*/
|
|
24
|
+
processBody?: (body: string, tags: string[]) => string;
|
|
25
|
+
/**
|
|
26
|
+
* Default reward routing pre-selected in every comment composer on this
|
|
27
|
+
* detail page (top-level reply + nested sub-comment replies).
|
|
28
|
+
* Typically wired to a user setting.
|
|
29
|
+
*/
|
|
30
|
+
defaultReward?: import('../utils/commentOptions').RewardOption;
|
|
12
31
|
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
13
32
|
onReblog?: () => void;
|
|
14
33
|
onShare?: () => void;
|
|
@@ -50,5 +69,5 @@ export interface HiveDetailPostProps {
|
|
|
50
69
|
/** Called when user clicks "View parent post" — navigate to the parent post. */
|
|
51
70
|
onNavigateToPost?: (author: string, permlink: string) => void;
|
|
52
71
|
}
|
|
53
|
-
export declare function HiveDetailPost({ author, permlink, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onShare, onTip, onReport, onShareComment, onTipComment, onReportComment, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, backgroundColor, onBack, onUserClick, onNavigateToPost, onVotePoll, }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
|
|
72
|
+
export declare function HiveDetailPost({ author, permlink, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onShare, onTip, onReport, onShareComment, onTipComment, onReportComment, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, backgroundColor, onBack, onUserClick, onNavigateToPost, onVotePoll, showVoteButton, processBody, defaultReward, }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
|
|
54
73
|
export default HiveDetailPost;
|
|
@@ -17,8 +17,17 @@ export interface PostActionButtonProps {
|
|
|
17
17
|
/** Called when user confirms vote with percent (1–100). Frontend handles signing/broadcast. */
|
|
18
18
|
onUpvote?: (percent: number) => void | Promise<void>;
|
|
19
19
|
/** Called when user submits a comment. Frontend handles signing/broadcast.
|
|
20
|
-
* Return `false` to indicate the operation was cancelled — the composer text will be preserved.
|
|
21
|
-
|
|
20
|
+
* Return `false` to indicate the operation was cancelled — the composer text will be preserved.
|
|
21
|
+
* `voteWeight` is non-null when the composer's upvote-on-publish toggle is enabled
|
|
22
|
+
* (1–100, step 0.25) — consumer should broadcast vote+comment atomically. */
|
|
23
|
+
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string, voteWeight?: number | null) => void | boolean | Promise<void | boolean>;
|
|
24
|
+
/** Show the upvote-on-publish toggle in the comment composer.
|
|
25
|
+
* Auto-hidden when the current user has already voted this post. */
|
|
26
|
+
showVoteButton?: boolean;
|
|
27
|
+
/** Locked default tags for the composer (usually the parent post's tags, app tag first). */
|
|
28
|
+
parentTags?: string[];
|
|
29
|
+
/** Default reward routing seeded into the comment composer. */
|
|
30
|
+
defaultReward?: import('../../utils/commentOptions').RewardOption;
|
|
22
31
|
/** Called when comment button is clicked (e.g. open comments). */
|
|
23
32
|
onComments?: () => void;
|
|
24
33
|
/** Called when reblog is clicked (when logged in). */
|
|
@@ -44,5 +53,5 @@ export interface PostActionButtonProps {
|
|
|
44
53
|
/** When true, clicking the comment icon calls onComments instead of opening the CommentsModal popup */
|
|
45
54
|
disableCommentsModal?: boolean;
|
|
46
55
|
}
|
|
47
|
-
export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, hiveIconUrl, payoutTooltip, initialVotes, initialCommentsCount, onUpvote, onSubmitComment, onComments, onReblog, onShare, onTip, onReport, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, disableCommentsModal, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
56
|
+
export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, hiveIconUrl, payoutTooltip, initialVotes, initialCommentsCount, onUpvote, onSubmitComment, onComments, onReblog, onShare, onTip, onReport, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, disableCommentsModal, showVoteButton, parentTags, defaultReward, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
48
57
|
export default PostActionButton;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type RewardOption } from '../../utils/commentOptions';
|
|
2
3
|
import { type PostingSignMessageFn } from '../../services/hiveImageUpload';
|
|
3
4
|
export interface PostComposerProps {
|
|
4
5
|
onSubmit: (body: string) => void | boolean | Promise<void | boolean>;
|
|
@@ -37,6 +38,46 @@ export interface PostComposerProps {
|
|
|
37
38
|
hidePoll?: boolean;
|
|
38
39
|
/** Called when a poll is attached/updated. Receives PollData or null when removed */
|
|
39
40
|
onPollChange?: (poll: import('../composer/PollCreator').PollData | null) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Locked default tags. Shown in the tag manager with a lock icon and
|
|
43
|
+
* cannot be edited or removed. Forwarded on every `onTagsChange` call as
|
|
44
|
+
* the leading entries in the merged list. Capped at 10 total.
|
|
45
|
+
*/
|
|
46
|
+
defaultTags?: string[];
|
|
47
|
+
/** Max total tags including defaults (default 10). */
|
|
48
|
+
maxTags?: number;
|
|
49
|
+
/** Called whenever the user-added tags change. Receives the full merged list (defaults first). */
|
|
50
|
+
onTagsChange?: (tags: string[]) => void;
|
|
51
|
+
/** Hide the tag manager toolbar button. */
|
|
52
|
+
hideTags?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Reward routing selection (default `'default'` = 50% HBD / 50% HP).
|
|
55
|
+
* Controlled or uncontrolled — if omitted, the composer manages its own state.
|
|
56
|
+
*/
|
|
57
|
+
reward?: RewardOption;
|
|
58
|
+
/** Initial reward option when uncontrolled (default `'default'`). */
|
|
59
|
+
defaultReward?: RewardOption;
|
|
60
|
+
/** Called when the reward routing changes. Pair with `buildCommentOptions(...)` at broadcast time. */
|
|
61
|
+
onRewardChange?: (reward: RewardOption) => void;
|
|
62
|
+
/** Hide the reward routing toolbar button. */
|
|
63
|
+
hideReward?: boolean;
|
|
64
|
+
/**
|
|
65
|
+
* Show the "upvote on publish" toggle in the toolbar (default false — opt-in).
|
|
66
|
+
* Set this to `!alreadyVoted` so the button hides once the user has voted on the parent.
|
|
67
|
+
*/
|
|
68
|
+
showVoteButton?: boolean;
|
|
69
|
+
/** Initial toggle state for upvote-on-publish (default false). */
|
|
70
|
+
defaultVoteEnabled?: boolean;
|
|
71
|
+
/** Initial slider percent (1–100, step 0.25, default 100). */
|
|
72
|
+
defaultVotePercent?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Called whenever the upvote-on-publish toggle or percent changes.
|
|
75
|
+
* `enabled=false` => consumer should post a plain comment.
|
|
76
|
+
* `enabled=true` => consumer should broadcast vote+comment together at `percent`.
|
|
77
|
+
*/
|
|
78
|
+
onVoteChange?: (enabled: boolean, percent: number) => void;
|
|
79
|
+
/** Label shown next to the slider (default "Upvote parent on publish"). */
|
|
80
|
+
voteLabel?: string;
|
|
40
81
|
/** Show cancel button (default true) */
|
|
41
82
|
showCancel?: boolean;
|
|
42
83
|
/** Submit button label (default "Post") */
|
|
@@ -74,8 +115,8 @@ export interface PostComposerProps {
|
|
|
74
115
|
}
|
|
75
116
|
/** @deprecated Use PostComposerProps instead */
|
|
76
117
|
export type AddCommentInputProps = PostComposerProps;
|
|
77
|
-
declare const PostComposer: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, onSignMessage, signingUsername, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, hideCode, hideMention, hideTemplate, hidePreview, hidePoll, onPollChange, showCancel, submitLabel, title, defaultPreviewOn, value, onChange, disabled, hideSubmitArea, submitRef, hideUserHeader, bgColor, borderColor, disableAutoFocus, walletApprovalLabel, awaitingWalletApproval, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
118
|
+
declare const PostComposer: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, onSignMessage, signingUsername, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, hideCode, hideMention, hideTemplate, hidePreview, hidePoll, onPollChange, defaultTags, maxTags, onTagsChange, hideTags, reward, defaultReward, onRewardChange, hideReward, showVoteButton, defaultVoteEnabled, defaultVotePercent, onVoteChange, voteLabel, showCancel, submitLabel, title, defaultPreviewOn, value, onChange, disabled, hideSubmitArea, submitRef, hideUserHeader, bgColor, borderColor, disableAutoFocus, walletApprovalLabel, awaitingWalletApproval, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
78
119
|
/** @deprecated Use PostComposer instead */
|
|
79
|
-
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, onSignMessage, signingUsername, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, hideCode, hideMention, hideTemplate, hidePreview, hidePoll, onPollChange, showCancel, submitLabel, title, defaultPreviewOn, value, onChange, disabled, hideSubmitArea, submitRef, hideUserHeader, bgColor, borderColor, disableAutoFocus, walletApprovalLabel, awaitingWalletApproval, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
120
|
+
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, onSignMessage, signingUsername, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, hideCode, hideMention, hideTemplate, hidePreview, hidePoll, onPollChange, defaultTags, maxTags, onTagsChange, hideTags, reward, defaultReward, onRewardChange, hideReward, showVoteButton, defaultVoteEnabled, defaultVotePercent, onVoteChange, voteLabel, showCancel, submitLabel, title, defaultPreviewOn, value, onChange, disabled, hideSubmitArea, submitRef, hideUserHeader, bgColor, borderColor, disableAutoFocus, walletApprovalLabel, awaitingWalletApproval, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
80
121
|
export { PostComposer };
|
|
81
122
|
export default AddCommentInput;
|
|
@@ -10,8 +10,16 @@ interface CommentsModalProps {
|
|
|
10
10
|
onClickCommentReply?: (comment: Discussion) => void;
|
|
11
11
|
onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
|
|
12
12
|
/** When provided, used instead of apiService.handleComment (e.g. for aioha wallet).
|
|
13
|
-
* Return `false` to indicate the operation was cancelled — the composer text will be preserved.
|
|
14
|
-
|
|
13
|
+
* Return `false` to indicate the operation was cancelled — the composer text will be preserved.
|
|
14
|
+
* `voteWeight` is non-null when the composer's upvote-on-publish toggle is enabled
|
|
15
|
+
* (value in 1–100, step 0.25); consumer should broadcast vote+comment atomically. */
|
|
16
|
+
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string, voteWeight?: number | null) => Promise<void | boolean>;
|
|
17
|
+
/** Show the upvote-on-publish toggle in the composer (the parent decides — usually `!alreadyVoted`). */
|
|
18
|
+
showVoteButton?: boolean;
|
|
19
|
+
/** Locked default tags for the top-level composer (typically the parent post's tags, app tag first). */
|
|
20
|
+
parentTags?: string[];
|
|
21
|
+
/** Default reward routing seeded into the composer. */
|
|
22
|
+
defaultReward?: import('../../utils/commentOptions').RewardOption;
|
|
15
23
|
/** Ecency image hosting token — enables image upload in comment composer */
|
|
16
24
|
ecencyToken?: string;
|
|
17
25
|
/** 3Speak API key — enables audio/video upload in comment composer */
|
|
@@ -23,5 +31,5 @@ interface CommentsModalProps {
|
|
|
23
31
|
/** Custom template API endpoint */
|
|
24
32
|
templateApiBaseUrl?: string;
|
|
25
33
|
}
|
|
26
|
-
declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton, onSubmitComment, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
34
|
+
declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton, onSubmitComment, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, showVoteButton, parentTags, defaultReward }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
27
35
|
export default CommentsModal;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { Discussion } from '@/types/comment';
|
|
2
|
+
import type { RewardOption } from '../../utils/commentOptions';
|
|
2
3
|
interface InlineCommentItemProps {
|
|
3
4
|
comment: Discussion;
|
|
4
5
|
allComments: Discussion[];
|
|
@@ -22,6 +23,12 @@ interface InlineCommentItemProps {
|
|
|
22
23
|
onShareComment?: (author: string, permlink: string) => void;
|
|
23
24
|
onTipComment?: (author: string, permlink: string) => void;
|
|
24
25
|
onReportComment?: (author: string, permlink: string) => void;
|
|
26
|
+
/** Called when an intra-body link points at a Hive post (peakd/hive.blog/ecency/inleo). */
|
|
27
|
+
onNavigateToPost?: (author: string, permlink: string) => void;
|
|
28
|
+
/** Called when an intra-body link points at a Hive user profile. */
|
|
29
|
+
onUserClick?: (username: string) => void;
|
|
30
|
+
/** Default reward routing seeded into every reply composer. */
|
|
31
|
+
defaultReward?: RewardOption;
|
|
25
32
|
}
|
|
26
|
-
export default function InlineCommentItem({ comment, allComments, onReply, onCancelReply, onCommentSubmit, activeReplyKey, currentUser, token, depth, onVotedRefresh, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hiveIconUrl, onShareComment, onTipComment, onReportComment, }: InlineCommentItemProps): import("react/jsx-runtime").JSX.Element;
|
|
33
|
+
export default function InlineCommentItem({ comment, allComments, onReply, onCancelReply, onCommentSubmit, activeReplyKey, currentUser, token, depth, onVotedRefresh, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hiveIconUrl, onShareComment, onTipComment, onReportComment, onNavigateToPost, onUserClick, defaultReward, }: InlineCommentItemProps): import("react/jsx-runtime").JSX.Element;
|
|
27
34
|
export {};
|
|
@@ -1,10 +1,20 @@
|
|
|
1
|
+
import type { RewardOption } from '../../utils/commentOptions';
|
|
1
2
|
interface InlineCommentSectionProps {
|
|
2
3
|
author: string;
|
|
3
4
|
permlink: string;
|
|
4
5
|
currentUser?: string;
|
|
5
6
|
token?: string;
|
|
6
|
-
|
|
7
|
+
/** `voteWeight` is non-null when the top-level composer's upvote-on-publish toggle is on (only fires for the post-reply composer). */
|
|
8
|
+
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string, voteWeight?: number | null) => void | boolean | Promise<void | boolean>;
|
|
7
9
|
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
10
|
+
/** Show the upvote-on-publish toggle on the top-level composer. Auto-hidden when `alreadyVoted`. */
|
|
11
|
+
showVoteButton?: boolean;
|
|
12
|
+
/** If true, the current user already upvoted the post — hides the toggle. */
|
|
13
|
+
alreadyVoted?: boolean;
|
|
14
|
+
/** Locked default tags for the top-level composer (parent post's tags, app tag first). */
|
|
15
|
+
parentTags?: string[];
|
|
16
|
+
/** Default reward routing seeded into every reply composer in this section. */
|
|
17
|
+
defaultReward?: RewardOption;
|
|
8
18
|
ecencyToken?: string;
|
|
9
19
|
threeSpeakApiKey?: string;
|
|
10
20
|
giphyApiKey?: string;
|
|
@@ -21,6 +31,10 @@ interface InlineCommentSectionProps {
|
|
|
21
31
|
onShareComment?: (author: string, permlink: string) => void;
|
|
22
32
|
onTipComment?: (author: string, permlink: string) => void;
|
|
23
33
|
onReportComment?: (author: string, permlink: string) => void;
|
|
34
|
+
/** Intercept intra-body Hive post links in comment bodies. */
|
|
35
|
+
onNavigateToPost?: (author: string, permlink: string) => void;
|
|
36
|
+
/** Intercept intra-body Hive profile links in comment bodies. */
|
|
37
|
+
onUserClick?: (username: string) => void;
|
|
24
38
|
}
|
|
25
|
-
export default function InlineCommentSection({ author, permlink, currentUser, token, onSubmitComment, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, onShareComment, onTipComment, onReportComment, }: InlineCommentSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
39
|
+
export default function InlineCommentSection({ author, permlink, currentUser, token, onSubmitComment, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, onShareComment, onTipComment, onReportComment, onNavigateToPost, onUserClick, showVoteButton, alreadyVoted, parentTags, defaultReward, }: InlineCommentSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
26
40
|
export {};
|