hive-react-kit 0.6.4 → 0.6.5
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 +67 -0
- package/dist/components/HiveDetailPost.d.ts +10 -1
- package/dist/components/actionButtons/PostActionButton.d.ts +3 -1
- package/dist/components/comments/AddCommentInput.d.ts +4 -2
- package/dist/components/inlineComments/InlineCommentItem.d.ts +23 -0
- package/dist/components/inlineComments/InlineCommentSection.d.ts +22 -0
- package/dist/index.cjs.js +128 -128
- package/dist/index.esm.js +11507 -10942
- package/dist/services/apiService.d.ts +1 -1
- package/package.json +1 -1
package/dist/build.css
CHANGED
|
@@ -550,6 +550,9 @@
|
|
|
550
550
|
.ml-2 {
|
|
551
551
|
margin-left: calc(var(--spacing) * 2);
|
|
552
552
|
}
|
|
553
|
+
.ml-3 {
|
|
554
|
+
margin-left: calc(var(--spacing) * 3);
|
|
555
|
+
}
|
|
553
556
|
.ml-4 {
|
|
554
557
|
margin-left: calc(var(--spacing) * 4);
|
|
555
558
|
}
|
|
@@ -559,6 +562,9 @@
|
|
|
559
562
|
.ml-8 {
|
|
560
563
|
margin-left: calc(var(--spacing) * 8);
|
|
561
564
|
}
|
|
565
|
+
.ml-9 {
|
|
566
|
+
margin-left: calc(var(--spacing) * 9);
|
|
567
|
+
}
|
|
562
568
|
.ml-auto {
|
|
563
569
|
margin-left: auto;
|
|
564
570
|
}
|
|
@@ -853,6 +859,9 @@
|
|
|
853
859
|
.max-w-7xl {
|
|
854
860
|
max-width: var(--container-7xl);
|
|
855
861
|
}
|
|
862
|
+
.max-w-\[250px\] {
|
|
863
|
+
max-width: 250px;
|
|
864
|
+
}
|
|
856
865
|
.max-w-\[280px\] {
|
|
857
866
|
max-width: 280px;
|
|
858
867
|
}
|
|
@@ -1009,6 +1018,9 @@
|
|
|
1009
1018
|
.gap-2 {
|
|
1010
1019
|
gap: calc(var(--spacing) * 2);
|
|
1011
1020
|
}
|
|
1021
|
+
.gap-2\.5 {
|
|
1022
|
+
gap: calc(var(--spacing) * 2.5);
|
|
1023
|
+
}
|
|
1012
1024
|
.gap-3 {
|
|
1013
1025
|
gap: calc(var(--spacing) * 3);
|
|
1014
1026
|
}
|
|
@@ -1120,6 +1132,14 @@
|
|
|
1120
1132
|
border-color: var(--color-gray-700);
|
|
1121
1133
|
}
|
|
1122
1134
|
}
|
|
1135
|
+
.divide-gray-800\/50 {
|
|
1136
|
+
:where(& > :not(:last-child)) {
|
|
1137
|
+
border-color: color-mix(in srgb, oklch(27.8% 0.033 256.848) 50%, transparent);
|
|
1138
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1139
|
+
border-color: color-mix(in oklab, var(--color-gray-800) 50%, transparent);
|
|
1140
|
+
}
|
|
1141
|
+
}
|
|
1142
|
+
}
|
|
1123
1143
|
.truncate {
|
|
1124
1144
|
overflow: hidden;
|
|
1125
1145
|
text-overflow: ellipsis;
|
|
@@ -1270,6 +1290,12 @@
|
|
|
1270
1290
|
border-color: color-mix(in oklab, var(--color-green-600) 60%, transparent);
|
|
1271
1291
|
}
|
|
1272
1292
|
}
|
|
1293
|
+
.border-green-800\/40 {
|
|
1294
|
+
border-color: color-mix(in srgb, oklch(44.8% 0.119 151.328) 40%, transparent);
|
|
1295
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1296
|
+
border-color: color-mix(in oklab, var(--color-green-800) 40%, transparent);
|
|
1297
|
+
}
|
|
1298
|
+
}
|
|
1273
1299
|
.border-red-200 {
|
|
1274
1300
|
border-color: var(--color-red-200);
|
|
1275
1301
|
}
|
|
@@ -1534,6 +1560,12 @@
|
|
|
1534
1560
|
background-color: color-mix(in oklab, var(--color-green-600) 20%, transparent);
|
|
1535
1561
|
}
|
|
1536
1562
|
}
|
|
1563
|
+
.bg-green-900\/10 {
|
|
1564
|
+
background-color: color-mix(in srgb, oklch(39.3% 0.095 152.535) 10%, transparent);
|
|
1565
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1566
|
+
background-color: color-mix(in oklab, var(--color-green-900) 10%, transparent);
|
|
1567
|
+
}
|
|
1568
|
+
}
|
|
1537
1569
|
.bg-green-900\/50 {
|
|
1538
1570
|
background-color: color-mix(in srgb, oklch(39.3% 0.095 152.535) 50%, transparent);
|
|
1539
1571
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -2075,6 +2107,9 @@
|
|
|
2075
2107
|
.text-green-600 {
|
|
2076
2108
|
color: var(--color-green-600);
|
|
2077
2109
|
}
|
|
2110
|
+
.text-green-700 {
|
|
2111
|
+
color: var(--color-green-700);
|
|
2112
|
+
}
|
|
2078
2113
|
.text-green-800 {
|
|
2079
2114
|
color: var(--color-green-800);
|
|
2080
2115
|
}
|
|
@@ -2506,6 +2541,16 @@
|
|
|
2506
2541
|
}
|
|
2507
2542
|
}
|
|
2508
2543
|
}
|
|
2544
|
+
.hover\:bg-gray-700\/60 {
|
|
2545
|
+
&:hover {
|
|
2546
|
+
@media (hover: hover) {
|
|
2547
|
+
background-color: color-mix(in srgb, oklch(37.3% 0.034 259.733) 60%, transparent);
|
|
2548
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2549
|
+
background-color: color-mix(in oklab, var(--color-gray-700) 60%, transparent);
|
|
2550
|
+
}
|
|
2551
|
+
}
|
|
2552
|
+
}
|
|
2553
|
+
}
|
|
2509
2554
|
.hover\:bg-gray-800 {
|
|
2510
2555
|
&:hover {
|
|
2511
2556
|
@media (hover: hover) {
|
|
@@ -2715,6 +2760,13 @@
|
|
|
2715
2760
|
}
|
|
2716
2761
|
}
|
|
2717
2762
|
}
|
|
2763
|
+
.hover\:opacity-90 {
|
|
2764
|
+
&:hover {
|
|
2765
|
+
@media (hover: hover) {
|
|
2766
|
+
opacity: 90%;
|
|
2767
|
+
}
|
|
2768
|
+
}
|
|
2769
|
+
}
|
|
2718
2770
|
.hover\:opacity-100 {
|
|
2719
2771
|
&:hover {
|
|
2720
2772
|
@media (hover: hover) {
|
|
@@ -3065,6 +3117,11 @@
|
|
|
3065
3117
|
line-height: var(--tw-leading, var(--text-xs--line-height));
|
|
3066
3118
|
}
|
|
3067
3119
|
}
|
|
3120
|
+
.md\:ml-6 {
|
|
3121
|
+
@media (width >= 48rem) {
|
|
3122
|
+
margin-left: calc(var(--spacing) * 6);
|
|
3123
|
+
}
|
|
3124
|
+
}
|
|
3068
3125
|
.md\:ml-7 {
|
|
3069
3126
|
@media (width >= 48rem) {
|
|
3070
3127
|
margin-left: calc(var(--spacing) * 7);
|
|
@@ -3211,6 +3268,11 @@
|
|
|
3211
3268
|
padding: calc(var(--spacing) * 8);
|
|
3212
3269
|
}
|
|
3213
3270
|
}
|
|
3271
|
+
.md\:px-3 {
|
|
3272
|
+
@media (width >= 48rem) {
|
|
3273
|
+
padding-inline: calc(var(--spacing) * 3);
|
|
3274
|
+
}
|
|
3275
|
+
}
|
|
3214
3276
|
.md\:px-6 {
|
|
3215
3277
|
@media (width >= 48rem) {
|
|
3216
3278
|
padding-inline: calc(var(--spacing) * 6);
|
|
@@ -3221,6 +3283,11 @@
|
|
|
3221
3283
|
padding-block: calc(var(--spacing) * 6);
|
|
3222
3284
|
}
|
|
3223
3285
|
}
|
|
3286
|
+
.md\:pl-4 {
|
|
3287
|
+
@media (width >= 48rem) {
|
|
3288
|
+
padding-left: calc(var(--spacing) * 4);
|
|
3289
|
+
}
|
|
3290
|
+
}
|
|
3224
3291
|
.md\:pl-6 {
|
|
3225
3292
|
@media (width >= 48rem) {
|
|
3226
3293
|
padding-left: calc(var(--spacing) * 6);
|
|
@@ -21,12 +21,21 @@ export interface HiveDetailPostProps {
|
|
|
21
21
|
giphyApiKey?: string;
|
|
22
22
|
templateToken?: string;
|
|
23
23
|
templateApiBaseUrl?: string;
|
|
24
|
+
/** Array of usernames whose comments should be hidden from the current user's view. */
|
|
25
|
+
reportedAuthors?: string[];
|
|
26
|
+
/** Array of {author, permlink} posts/comments to hide from the current user's view. */
|
|
27
|
+
reportedPosts?: {
|
|
28
|
+
author: string;
|
|
29
|
+
permlink: string;
|
|
30
|
+
}[];
|
|
24
31
|
/** URL to a Hive logo icon shown next to the payout value. Defaults to "/images/hive_logo.png". */
|
|
25
32
|
hiveIconUrl?: string;
|
|
26
33
|
/** Background color for the component. Pass a single color string for a solid background, or an array of colors for a gradient (e.g. `["#0f172a", "#1e293b"]` or `["#1a1a2e", "#16213e", "#0f3460"]`). Defaults to gray-900. */
|
|
27
34
|
backgroundColor?: string | string[];
|
|
28
35
|
onBack?: () => void;
|
|
29
36
|
onUserClick?: (username: string) => void;
|
|
37
|
+
/** Called when user clicks "View parent post" — navigate to the parent post. */
|
|
38
|
+
onNavigateToPost?: (author: string, permlink: string) => void;
|
|
30
39
|
}
|
|
31
|
-
export declare function HiveDetailPost({ author, permlink, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onShare, onTip, onReport, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hiveIconUrl, backgroundColor, onBack, onUserClick, onVotePoll, }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function HiveDetailPost({ author, permlink, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onShare, onTip, onReport, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, backgroundColor, onBack, onUserClick, onNavigateToPost, onVotePoll, }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
|
|
32
41
|
export default HiveDetailPost;
|
|
@@ -40,6 +40,8 @@ export interface PostActionButtonProps {
|
|
|
40
40
|
templateToken?: string;
|
|
41
41
|
/** Custom template API endpoint */
|
|
42
42
|
templateApiBaseUrl?: string;
|
|
43
|
+
/** When true, clicking the comment icon calls onComments instead of opening the CommentsModal popup */
|
|
44
|
+
disableCommentsModal?: boolean;
|
|
43
45
|
}
|
|
44
|
-
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, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
46
|
+
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;
|
|
45
47
|
export default PostActionButton;
|
|
@@ -60,11 +60,13 @@ export interface PostComposerProps {
|
|
|
60
60
|
bgColor?: string;
|
|
61
61
|
/** Custom border color for the composer container (e.g. "#3a424a", "transparent") */
|
|
62
62
|
borderColor?: string;
|
|
63
|
+
/** Disable auto-focus on mount (default false). Use when the composer is always visible and shouldn't steal scroll. */
|
|
64
|
+
disableAutoFocus?: boolean;
|
|
63
65
|
}
|
|
64
66
|
/** @deprecated Use PostComposerProps instead */
|
|
65
67
|
export type AddCommentInputProps = PostComposerProps;
|
|
66
|
-
declare const PostComposer: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, 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, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
68
|
+
declare const PostComposer: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, 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, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
67
69
|
/** @deprecated Use PostComposer instead */
|
|
68
|
-
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, 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, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
70
|
+
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, 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, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
69
71
|
export { PostComposer };
|
|
70
72
|
export default AddCommentInput;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { Discussion } from '@/types/comment';
|
|
2
|
+
interface InlineCommentItemProps {
|
|
3
|
+
comment: Discussion;
|
|
4
|
+
allComments: Discussion[];
|
|
5
|
+
onReply: (author: string, permlink: string) => void;
|
|
6
|
+
onCancelReply: () => void;
|
|
7
|
+
onCommentSubmit: (parentAuthor: string, parentPermlink: string, body: string) => Promise<void>;
|
|
8
|
+
/** "author/permlink" key of the comment currently being replied to (null = none) */
|
|
9
|
+
activeReplyKey: string | null;
|
|
10
|
+
currentUser?: string;
|
|
11
|
+
token?: string;
|
|
12
|
+
depth?: number;
|
|
13
|
+
onVotedRefresh?: () => void;
|
|
14
|
+
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
15
|
+
/** Composer props passed through */
|
|
16
|
+
ecencyToken?: string;
|
|
17
|
+
threeSpeakApiKey?: string;
|
|
18
|
+
giphyApiKey?: string;
|
|
19
|
+
templateToken?: string;
|
|
20
|
+
templateApiBaseUrl?: string;
|
|
21
|
+
}
|
|
22
|
+
export default function InlineCommentItem({ comment, allComments, onReply, onCancelReply, onCommentSubmit, activeReplyKey, currentUser, token, depth, onVotedRefresh, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, }: InlineCommentItemProps): import("react/jsx-runtime").JSX.Element;
|
|
23
|
+
export {};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
interface InlineCommentSectionProps {
|
|
2
|
+
author: string;
|
|
3
|
+
permlink: string;
|
|
4
|
+
currentUser?: string;
|
|
5
|
+
token?: string;
|
|
6
|
+
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => void | Promise<void>;
|
|
7
|
+
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
8
|
+
ecencyToken?: string;
|
|
9
|
+
threeSpeakApiKey?: string;
|
|
10
|
+
giphyApiKey?: string;
|
|
11
|
+
templateToken?: string;
|
|
12
|
+
templateApiBaseUrl?: string;
|
|
13
|
+
/** Usernames whose comments should be hidden for the current logged-in user. */
|
|
14
|
+
reportedAuthors?: string[];
|
|
15
|
+
/** Specific posts/comments to hide for the current logged-in user. */
|
|
16
|
+
reportedPosts?: {
|
|
17
|
+
author: string;
|
|
18
|
+
permlink: string;
|
|
19
|
+
}[];
|
|
20
|
+
}
|
|
21
|
+
export default function InlineCommentSection({ author, permlink, currentUser, token, onSubmitComment, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, }: InlineCommentSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
22
|
+
export {};
|