hive-react-kit 0.4.9 → 0.5.1
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/README.md +121 -0
- package/dist/build.css +694 -54
- package/dist/components/actionButtons/PostActionButton.d.ts +17 -2
- package/dist/components/comments/AddCommentInput.d.ts +17 -2
- package/dist/components/comments/CommentsModal.d.ts +7 -1
- package/dist/components/comments/ReplyModal.d.ts +4 -1
- package/dist/components/composer/AudioUploader.d.ts +12 -0
- package/dist/components/composer/EmojiPicker.d.ts +8 -0
- package/dist/components/composer/GiphyPicker.d.ts +10 -0
- package/dist/components/composer/ImageUploader.d.ts +10 -0
- package/dist/components/composer/VideoUploader.d.ts +14 -0
- package/dist/components/composer/index.d.ts +10 -0
- package/dist/components/user/UserDetailProfile.d.ts +41 -0
- package/dist/index.cjs.js +115 -112
- package/dist/index.d.ts +11 -2
- package/dist/index.esm.js +13557 -10958
- package/dist/pages/UserDetailProfilePage.d.ts +2 -0
- package/dist/services/userService.d.ts +70 -6
- package/dist/types/poll.d.ts +64 -0
- package/dist/types/reward.d.ts +22 -0
- package/package.json +2 -1
|
@@ -1,10 +1,19 @@
|
|
|
1
|
+
import { ActiveVote } from "@/types/video";
|
|
1
2
|
export interface PostActionButtonProps {
|
|
2
3
|
author: string;
|
|
3
4
|
permlink: string;
|
|
4
5
|
/** Current logged-in username; null or '' means not logged in */
|
|
5
6
|
currentUser?: string | null;
|
|
6
|
-
/** Optional: Hive value to display (string
|
|
7
|
+
/** Optional: Hive value to display (numeric string, e.g. "8.500") */
|
|
7
8
|
hiveValue?: string;
|
|
9
|
+
/** Optional: URL to a Hive logo icon shown next to the payout value */
|
|
10
|
+
hiveIconUrl?: string;
|
|
11
|
+
/** Optional: Tooltip text shown on hover over the payout value (e.g. payout breakdown) */
|
|
12
|
+
payoutTooltip?: string;
|
|
13
|
+
/** Optional: Pre-loaded active votes array from the Post object. Skips the API call when provided. */
|
|
14
|
+
initialVotes?: ActiveVote[];
|
|
15
|
+
/** Optional: Pre-loaded comments count from the Post object (item.children). Skips the API call when provided. */
|
|
16
|
+
initialCommentsCount?: number;
|
|
8
17
|
/** Called when user confirms vote with percent (1–100). Frontend handles signing/broadcast. */
|
|
9
18
|
onUpvote?: (percent: number) => void | Promise<void>;
|
|
10
19
|
/** Called when user submits a comment. Frontend handles signing/broadcast. */
|
|
@@ -21,6 +30,12 @@ export interface PostActionButtonProps {
|
|
|
21
30
|
onReport?: () => void;
|
|
22
31
|
/** Called when user confirms comment upvote with (author, permlink, percent). Frontend handles signing. Voted comments show icon in blue. */
|
|
23
32
|
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
33
|
+
/** Ecency image hosting token — enables image upload in comment composer */
|
|
34
|
+
ecencyToken?: string;
|
|
35
|
+
/** 3Speak API key — enables audio/video upload in comment composer */
|
|
36
|
+
threeSpeakApiKey?: string;
|
|
37
|
+
/** GIPHY API key — enables GIF search in comment composer */
|
|
38
|
+
giphyApiKey?: string;
|
|
24
39
|
}
|
|
25
|
-
export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, onUpvote, onSubmitComment, onComments, onReblog, onShare, onTip, onReport, onClickCommentUpvote, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
40
|
+
export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, hiveIconUrl, payoutTooltip, initialVotes, initialCommentsCount, onUpvote, onSubmitComment, onComments, onReblog, onShare, onTip, onReport, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
26
41
|
export default PostActionButton;
|
|
@@ -1,10 +1,25 @@
|
|
|
1
|
-
interface AddCommentInputProps {
|
|
1
|
+
export interface AddCommentInputProps {
|
|
2
2
|
onSubmit: (body: string) => void;
|
|
3
3
|
onCancel: () => void;
|
|
4
4
|
currentUser?: string;
|
|
5
5
|
placeholder?: string;
|
|
6
6
|
parentAuthor?: string;
|
|
7
7
|
parentPermlink?: string;
|
|
8
|
+
/** Ecency image hosting token — enables image and video thumbnail upload */
|
|
9
|
+
ecencyToken?: string;
|
|
10
|
+
/** 3Speak API key — enables audio and video upload. Falls back to demo key if not provided. */
|
|
11
|
+
threeSpeakApiKey?: string;
|
|
12
|
+
/** GIPHY API key — enables GIF search */
|
|
13
|
+
giphyApiKey?: string;
|
|
14
|
+
/** Hide individual toolbar features */
|
|
15
|
+
hideBold?: boolean;
|
|
16
|
+
hideItalic?: boolean;
|
|
17
|
+
hideLink?: boolean;
|
|
18
|
+
hideImage?: boolean;
|
|
19
|
+
hideAudio?: boolean;
|
|
20
|
+
hideVideo?: boolean;
|
|
21
|
+
hideEmoji?: boolean;
|
|
22
|
+
hideGif?: boolean;
|
|
8
23
|
}
|
|
9
|
-
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink }: AddCommentInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, threeSpeakApiKey, giphyApiKey, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, }: AddCommentInputProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
25
|
export default AddCommentInput;
|
|
@@ -11,6 +11,12 @@ interface CommentsModalProps {
|
|
|
11
11
|
onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
|
|
12
12
|
/** When provided, used instead of apiService.handleComment (e.g. for aioha wallet) */
|
|
13
13
|
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => Promise<void>;
|
|
14
|
+
/** Ecency image hosting token — enables image upload in comment composer */
|
|
15
|
+
ecencyToken?: string;
|
|
16
|
+
/** 3Speak API key — enables audio/video upload in comment composer */
|
|
17
|
+
threeSpeakApiKey?: string;
|
|
18
|
+
/** GIPHY API key — enables GIF search in comment composer */
|
|
19
|
+
giphyApiKey?: string;
|
|
14
20
|
}
|
|
15
|
-
declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton, onSubmitComment }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
21
|
+
declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton, onSubmitComment, ecencyToken, threeSpeakApiKey, giphyApiKey }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
16
22
|
export default CommentsModal;
|
|
@@ -4,6 +4,9 @@ interface ReplyModalProps {
|
|
|
4
4
|
onClose: () => void;
|
|
5
5
|
onCommentSubmitted: (parentAuthor: string, parentPermlink: string, body: string) => Promise<void>;
|
|
6
6
|
currentUser?: string;
|
|
7
|
+
ecencyToken?: string;
|
|
8
|
+
threeSpeakApiKey?: string;
|
|
9
|
+
giphyApiKey?: string;
|
|
7
10
|
}
|
|
8
|
-
declare const ReplyModal: ({ parentAuthor, parentPermlink, onClose, onCommentSubmitted, currentUser }: ReplyModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
declare const ReplyModal: ({ parentAuthor, parentPermlink, onClose, onCommentSubmitted, currentUser, ecencyToken, threeSpeakApiKey, giphyApiKey, }: ReplyModalProps) => import("react/jsx-runtime").JSX.Element;
|
|
9
12
|
export default ReplyModal;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface AudioUploaderProps {
|
|
3
|
+
/** Called with the audio embed URL and duration in seconds */
|
|
4
|
+
onAudioUploaded: (audioUrl: string, durationSeconds: number) => void;
|
|
5
|
+
/** Hive username for the upload */
|
|
6
|
+
username?: string;
|
|
7
|
+
/** 3Speak API key. Falls back to demo key if not provided. */
|
|
8
|
+
threeSpeakApiKey?: string;
|
|
9
|
+
disabled?: boolean;
|
|
10
|
+
}
|
|
11
|
+
declare const AudioUploader: React.FC<AudioUploaderProps>;
|
|
12
|
+
export default AudioUploader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface GiphyPickerProps {
|
|
3
|
+
isOpen: boolean;
|
|
4
|
+
onClose: () => void;
|
|
5
|
+
onSelectGif: (gifUrl: string) => void;
|
|
6
|
+
/** GIPHY API key. Required for search functionality. */
|
|
7
|
+
giphyApiKey?: string;
|
|
8
|
+
}
|
|
9
|
+
declare const GiphyPicker: React.FC<GiphyPickerProps>;
|
|
10
|
+
export default GiphyPicker;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface ImageUploaderProps {
|
|
3
|
+
/** Called with the uploaded image URL */
|
|
4
|
+
onImageUploaded: (imageUrl: string) => void;
|
|
5
|
+
/** Ecency image hosting token for upload authentication */
|
|
6
|
+
ecencyToken?: string;
|
|
7
|
+
disabled?: boolean;
|
|
8
|
+
}
|
|
9
|
+
declare const ImageUploader: React.FC<ImageUploaderProps>;
|
|
10
|
+
export default ImageUploader;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import React from 'react';
|
|
2
|
+
export interface VideoUploaderProps {
|
|
3
|
+
/** Called with embed URL, upload URL, aspect ratio, and optional local file for preview */
|
|
4
|
+
onVideoUploaded: (videoEmbedUrl: string, uploadUrl: string, aspectRatio: string, localPreviewFile?: File) => void;
|
|
5
|
+
/** Hive username for the upload */
|
|
6
|
+
username?: string;
|
|
7
|
+
/** Ecency image hosting token for thumbnail upload */
|
|
8
|
+
ecencyToken?: string;
|
|
9
|
+
/** 3Speak API key. Falls back to demo key if not provided. */
|
|
10
|
+
threeSpeakApiKey?: string;
|
|
11
|
+
disabled?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare const VideoUploader: React.FC<VideoUploaderProps>;
|
|
14
|
+
export default VideoUploader;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export { default as ImageUploader } from './ImageUploader';
|
|
2
|
+
export type { ImageUploaderProps } from './ImageUploader';
|
|
3
|
+
export { default as AudioUploader } from './AudioUploader';
|
|
4
|
+
export type { AudioUploaderProps } from './AudioUploader';
|
|
5
|
+
export { default as VideoUploader } from './VideoUploader';
|
|
6
|
+
export type { VideoUploaderProps } from './VideoUploader';
|
|
7
|
+
export { default as GiphyPicker } from './GiphyPicker';
|
|
8
|
+
export type { GiphyPickerProps } from './GiphyPicker';
|
|
9
|
+
export { default as EmojiPicker } from './EmojiPicker';
|
|
10
|
+
export type { EmojiPickerProps } from './EmojiPicker';
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
export interface UserDetailProfileProps {
|
|
3
|
+
username: string;
|
|
4
|
+
currentUsername?: string;
|
|
5
|
+
onBack?: () => void;
|
|
6
|
+
showBackButton?: boolean;
|
|
7
|
+
/**
|
|
8
|
+
* Controls which tabs are shown and their order.
|
|
9
|
+
* Only tabs listed here will be visible, in the order provided.
|
|
10
|
+
* The first tab becomes the default active tab.
|
|
11
|
+
* If omitted, all tabs are shown in default order.
|
|
12
|
+
* Example: `["followers", "following", "blogs", "wallet"]` — only these 4 tabs, in this order.
|
|
13
|
+
*/
|
|
14
|
+
tabShown?: TabType[];
|
|
15
|
+
/** Ecency image hosting token — enables image and video thumbnail upload in comment composer */
|
|
16
|
+
ecencyToken?: string;
|
|
17
|
+
/** 3Speak API key — enables audio and video upload in comment composer */
|
|
18
|
+
threeSpeakApiKey?: string;
|
|
19
|
+
/** GIPHY API key — enables GIF search in comment composer */
|
|
20
|
+
giphyApiKey?: string;
|
|
21
|
+
onFollow?: (username: string) => void | Promise<void>;
|
|
22
|
+
onUnfollow?: (username: string) => void | Promise<void>;
|
|
23
|
+
onIgnoreAuthor?: (username: string) => void | Promise<void>;
|
|
24
|
+
onReportUser?: (username: string, reason: string) => void | Promise<void>;
|
|
25
|
+
onUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
26
|
+
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => void | Promise<void>;
|
|
27
|
+
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
28
|
+
onReblog?: (author: string, permlink: string) => void;
|
|
29
|
+
onTip?: (author: string, permlink: string) => void;
|
|
30
|
+
onReportPost?: (author: string, permlink: string) => void;
|
|
31
|
+
onUserClick?: (username: string) => void;
|
|
32
|
+
onPostClick?: (author: string, permlink: string, title: string) => void;
|
|
33
|
+
onSnapClick?: (author: string, permlink: string) => void;
|
|
34
|
+
onPollClick?: (author: string, permlink: string, question: string) => void;
|
|
35
|
+
onActivityPermlink?: (author: string, permlink: string) => void;
|
|
36
|
+
onActivitySelect?: (activity: any) => void;
|
|
37
|
+
onShare?: (username: string) => void;
|
|
38
|
+
}
|
|
39
|
+
type TabType = "blogs" | "posts" | "snaps" | "polls" | "comments" | "replies" | "activities" | "authorRewards" | "curationRewards" | "followers" | "following" | "wallet";
|
|
40
|
+
declare const UserDetailProfile: React.FC<UserDetailProfileProps>;
|
|
41
|
+
export default UserDetailProfile;
|