hive-react-kit 0.8.8 → 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 +21 -7
- package/dist/components/HiveDetailPost.d.ts +21 -2
- package/dist/components/actionButtons/PostActionButton.d.ts +12 -3
- package/dist/components/comments/AddCommentInput.d.ts +19 -2
- package/dist/components/comments/CommentsModal.d.ts +11 -3
- package/dist/components/inlineComments/InlineCommentItem.d.ts +4 -1
- package/dist/components/inlineComments/InlineCommentSection.d.ts +12 -2
- package/dist/index.cjs.js +131 -131
- package/dist/index.esm.js +14491 -14093
- 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 {
|
|
@@ -879,9 +879,6 @@
|
|
|
879
879
|
.w-64 {
|
|
880
880
|
width: calc(var(--spacing) * 64);
|
|
881
881
|
}
|
|
882
|
-
.w-72 {
|
|
883
|
-
width: calc(var(--spacing) * 72);
|
|
884
|
-
}
|
|
885
882
|
.w-\[280px\] {
|
|
886
883
|
width: 280px;
|
|
887
884
|
}
|
|
@@ -915,9 +912,6 @@
|
|
|
915
912
|
.max-w-\[280px\] {
|
|
916
913
|
max-width: 280px;
|
|
917
914
|
}
|
|
918
|
-
.max-w-\[calc\(100vw-1rem\)\] {
|
|
919
|
-
max-width: calc(100vw - 1rem);
|
|
920
|
-
}
|
|
921
915
|
.max-w-full {
|
|
922
916
|
max-width: 100%;
|
|
923
917
|
}
|
|
@@ -3907,11 +3901,21 @@
|
|
|
3907
3901
|
background-color: var(--color-blue-600);
|
|
3908
3902
|
}
|
|
3909
3903
|
}
|
|
3904
|
+
.\[\&\:\:-moz-range-thumb\]\:h-4 {
|
|
3905
|
+
&::-moz-range-thumb {
|
|
3906
|
+
height: calc(var(--spacing) * 4);
|
|
3907
|
+
}
|
|
3908
|
+
}
|
|
3910
3909
|
.\[\&\:\:-moz-range-thumb\]\:h-5 {
|
|
3911
3910
|
&::-moz-range-thumb {
|
|
3912
3911
|
height: calc(var(--spacing) * 5);
|
|
3913
3912
|
}
|
|
3914
3913
|
}
|
|
3914
|
+
.\[\&\:\:-moz-range-thumb\]\:w-4 {
|
|
3915
|
+
&::-moz-range-thumb {
|
|
3916
|
+
width: calc(var(--spacing) * 4);
|
|
3917
|
+
}
|
|
3918
|
+
}
|
|
3915
3919
|
.\[\&\:\:-moz-range-thumb\]\:w-5 {
|
|
3916
3920
|
&::-moz-range-thumb {
|
|
3917
3921
|
width: calc(var(--spacing) * 5);
|
|
@@ -3973,11 +3977,21 @@
|
|
|
3973
3977
|
margin-top: calc(var(--spacing) * -1.5);
|
|
3974
3978
|
}
|
|
3975
3979
|
}
|
|
3980
|
+
.\[\&\:\:-webkit-slider-thumb\]\:h-4 {
|
|
3981
|
+
&::-webkit-slider-thumb {
|
|
3982
|
+
height: calc(var(--spacing) * 4);
|
|
3983
|
+
}
|
|
3984
|
+
}
|
|
3976
3985
|
.\[\&\:\:-webkit-slider-thumb\]\:h-5 {
|
|
3977
3986
|
&::-webkit-slider-thumb {
|
|
3978
3987
|
height: calc(var(--spacing) * 5);
|
|
3979
3988
|
}
|
|
3980
3989
|
}
|
|
3990
|
+
.\[\&\:\:-webkit-slider-thumb\]\:w-4 {
|
|
3991
|
+
&::-webkit-slider-thumb {
|
|
3992
|
+
width: calc(var(--spacing) * 4);
|
|
3993
|
+
}
|
|
3994
|
+
}
|
|
3981
3995
|
.\[\&\:\:-webkit-slider-thumb\]\:w-5 {
|
|
3982
3996
|
&::-webkit-slider-thumb {
|
|
3983
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;
|
|
@@ -61,6 +61,23 @@ export interface PostComposerProps {
|
|
|
61
61
|
onRewardChange?: (reward: RewardOption) => void;
|
|
62
62
|
/** Hide the reward routing toolbar button. */
|
|
63
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;
|
|
64
81
|
/** Show cancel button (default true) */
|
|
65
82
|
showCancel?: boolean;
|
|
66
83
|
/** Submit button label (default "Post") */
|
|
@@ -98,8 +115,8 @@ export interface PostComposerProps {
|
|
|
98
115
|
}
|
|
99
116
|
/** @deprecated Use PostComposerProps instead */
|
|
100
117
|
export type AddCommentInputProps = PostComposerProps;
|
|
101
|
-
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, 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;
|
|
102
119
|
/** @deprecated Use PostComposer instead */
|
|
103
|
-
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, 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;
|
|
104
121
|
export { PostComposer };
|
|
105
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[];
|
|
@@ -26,6 +27,8 @@ interface InlineCommentItemProps {
|
|
|
26
27
|
onNavigateToPost?: (author: string, permlink: string) => void;
|
|
27
28
|
/** Called when an intra-body link points at a Hive user profile. */
|
|
28
29
|
onUserClick?: (username: string) => void;
|
|
30
|
+
/** Default reward routing seeded into every reply composer. */
|
|
31
|
+
defaultReward?: RewardOption;
|
|
29
32
|
}
|
|
30
|
-
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, }: 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;
|
|
31
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;
|
|
@@ -26,5 +36,5 @@ interface InlineCommentSectionProps {
|
|
|
26
36
|
/** Intercept intra-body Hive profile links in comment bodies. */
|
|
27
37
|
onUserClick?: (username: string) => void;
|
|
28
38
|
}
|
|
29
|
-
export default function InlineCommentSection({ author, permlink, currentUser, token, onSubmitComment, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, onShareComment, onTipComment, onReportComment, onNavigateToPost, onUserClick, }: 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;
|
|
30
40
|
export {};
|