hive-react-kit 0.0.6 → 0.0.14

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.
Files changed (43) hide show
  1. package/README.md +20 -0
  2. package/dist/components/ActivityHistory.d.ts +7 -0
  3. package/dist/components/ActivityList.d.ts +15 -0
  4. package/dist/components/FollowersList.d.ts +8 -0
  5. package/dist/components/FollowingList.d.ts +8 -0
  6. package/dist/components/ListOfWitnesses.d.ts +4 -0
  7. package/dist/components/PostFeedList.d.ts +17 -0
  8. package/dist/components/ProposalsList.d.ts +4 -0
  9. package/dist/components/TransactionHistory.d.ts +6 -0
  10. package/dist/components/UpvoteListModal.d.ts +11 -0
  11. package/dist/components/VoteSlider.d.ts +7 -0
  12. package/dist/components/WitnessFilters.d.ts +8 -0
  13. package/dist/components/comments/AddCommentInput.d.ts +10 -0
  14. package/dist/components/comments/CommentSearchBar.d.ts +8 -0
  15. package/dist/components/comments/CommentTile.d.ts +16 -0
  16. package/dist/components/comments/CommentsModal.d.ts +13 -0
  17. package/dist/components/comments/ReplyModal.d.ts +9 -0
  18. package/dist/components/community/CommunityDetails.d.ts +13 -0
  19. package/dist/components/index.d.ts +5 -0
  20. package/dist/index.d.ts +8 -0
  21. package/dist/index.es.js +22802 -2178
  22. package/dist/index.umd.js +1039 -28
  23. package/dist/services/activityListService.d.ts +79 -0
  24. package/dist/services/activityService.d.ts +104 -0
  25. package/dist/services/apiService.d.ts +2 -0
  26. package/dist/services/communityService.d.ts +5 -1
  27. package/dist/services/proposalService.d.ts +9 -0
  28. package/dist/services/transactionService.d.ts +69 -0
  29. package/dist/services/userService.d.ts +6 -1
  30. package/dist/services/witnessService.d.ts +61 -0
  31. package/dist/store/index.d.ts +2 -0
  32. package/dist/store/witnessStore.d.ts +31 -0
  33. package/dist/types/activity.d.ts +108 -0
  34. package/dist/types/activityList.d.ts +46 -0
  35. package/dist/types/comment.d.ts +7 -1
  36. package/dist/types/community.d.ts +79 -0
  37. package/dist/types/index.d.ts +3 -0
  38. package/dist/types/post.d.ts +53 -0
  39. package/dist/types/proposal.d.ts +35 -0
  40. package/dist/types/transaction.d.ts +90 -0
  41. package/dist/types/user.d.ts +91 -0
  42. package/dist/types/witness.d.ts +57 -0
  43. package/package.json +14 -6
package/README.md CHANGED
@@ -80,6 +80,26 @@ import type { Video, Comment, Wallet as WalletType } from 'hive-react-kit/types'
80
80
  - **UserFollowers** - User followers list
81
81
  - **UserFollowing** - User following list
82
82
 
83
+ ### Feed Components
84
+
85
+ - **PostFeedList** - Display a list of posts with sorting, filtering, and interaction capabilities
86
+
87
+ #### PostFeedList Props
88
+
89
+ | Prop | Type | Default | Description |
90
+ |------|------|---------|-------------|
91
+ | `sort` | `PostSort` | `'trending'` | Sort order for posts. Options: `'trending'`, `'hot'`, `'created'` |
92
+ | `tag` | `string` | `''` | Filter posts by tag |
93
+ | `observer` | `string` | `'hive.blog'` | Observer account for filtering |
94
+ | `limit` | `number` | `20` | Number of posts to load per request |
95
+ | `onAuthorClick` | `(author: string, avatar: string) => void` | - | Callback when author is clicked |
96
+ | `onPostClick` | `(post: Post) => void` | - | Callback when post is clicked |
97
+ | `onCommunityClick` | `(communityTitle: string) => void` | - | Callback when community is clicked |
98
+ | `onPayoutClick` | `(payout: number) => void` | - | Callback when payout is clicked |
99
+ | `onUpvoteClick` | `(post: Post) => void` | - | Callback when upvote button is clicked |
100
+ | `onCommentClick` | `(post: Post) => void` | - | Callback when comment button is clicked |
101
+ | `onReblogClick` | `(post: Post) => void` | - | Callback when reblog button is clicked |
102
+
83
103
  ## Setup
84
104
 
85
105
  Make sure to install the required peer dependencies:
@@ -0,0 +1,7 @@
1
+ import React from "react";
2
+ interface ActivityHistoryProps {
3
+ username: string;
4
+ className?: string;
5
+ }
6
+ declare const ActivityHistory: React.FC<ActivityHistoryProps>;
7
+ export default ActivityHistory;
@@ -0,0 +1,15 @@
1
+ import React from "react";
2
+ import { ActivityListItem, DirectionFilter, GeneralFilter, RewardFilter } from "@/types/activityList";
3
+ interface ActivityListProps {
4
+ username: string;
5
+ directionFilter?: DirectionFilter;
6
+ generalFilter?: GeneralFilter;
7
+ rewardFilter?: RewardFilter;
8
+ searchTerm?: string;
9
+ limit?: number;
10
+ className?: string;
11
+ onClickPermlink?: (author: string, permlink: string) => void;
12
+ onSelectActivity?: (activity: ActivityListItem) => void;
13
+ }
14
+ declare const ActivityList: React.FC<ActivityListProps>;
15
+ export default ActivityList;
@@ -0,0 +1,8 @@
1
+ interface FollowersListProps {
2
+ username: string;
3
+ onClickAuthor?: (username: string) => void;
4
+ onClickAddRemoveFromLists?: (username: string) => void;
5
+ onClickFollow?: (username: string) => void;
6
+ }
7
+ declare const FollowersList: ({ username, onClickAuthor, onClickAddRemoveFromLists, onClickFollow, }: FollowersListProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default FollowersList;
@@ -0,0 +1,8 @@
1
+ interface FollowingListProps {
2
+ username: string;
3
+ onClickAuthor?: (username: string) => void;
4
+ onClickAddRemoveFromLists?: (username: string) => void;
5
+ onClickUnfollow?: (username: string) => void;
6
+ }
7
+ declare const FollowingList: ({ username, onClickAuthor, onClickAddRemoveFromLists, onClickUnfollow, }: FollowingListProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default FollowingList;
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ListOfWitnessesProps } from '../types/witness';
3
+ declare const ListOfWitnesses: React.FC<ListOfWitnessesProps>;
4
+ export default ListOfWitnesses;
@@ -0,0 +1,17 @@
1
+ import { Post, PostSort } from '@/types/post';
2
+ interface PostFeedListProps {
3
+ sort?: PostSort;
4
+ tag?: string;
5
+ observer?: string;
6
+ limit?: number;
7
+ showSortDropdown?: boolean;
8
+ onAuthorClick?: (author: string, avatar: string) => void;
9
+ onPostClick?: (post: Post) => void;
10
+ onCommunityClick?: (communityTitle: string) => void;
11
+ onPayoutClick?: (payout: number) => void;
12
+ onUpvoteClick?: (post: Post) => void;
13
+ onCommentClick?: (post: Post) => void;
14
+ onReblogClick?: (post: Post) => void;
15
+ }
16
+ export default function PostFeedList({ sort, tag, observer, limit, showSortDropdown, onAuthorClick, onPostClick, onCommunityClick, onPayoutClick, onUpvoteClick, onCommentClick, onReblogClick, }: PostFeedListProps): import("react/jsx-runtime").JSX.Element;
17
+ export {};
@@ -0,0 +1,4 @@
1
+ import React from 'react';
2
+ import { ProposalsListProps } from '../types/proposal';
3
+ declare const ProposalsList: React.FC<ProposalsListProps>;
4
+ export default ProposalsList;
@@ -0,0 +1,6 @@
1
+ interface TransactionHistoryProps {
2
+ account: string;
3
+ className?: string;
4
+ }
5
+ declare function TransactionHistory({ account, className }: TransactionHistoryProps): import("react/jsx-runtime").JSX.Element;
6
+ export default TransactionHistory;
@@ -0,0 +1,11 @@
1
+ interface UpvoteListModalProps {
2
+ author: string;
3
+ permlink: string;
4
+ onClose: () => void;
5
+ currentUser?: string;
6
+ token?: string;
7
+ onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
8
+ }
9
+ export declare function formatTimeAgo(date: string | Date): string;
10
+ declare const UpvoteListModal: ({ author, permlink, onClose, currentUser, token, onClickUpvoteButton }: UpvoteListModalProps) => import("react/jsx-runtime").JSX.Element;
11
+ export default UpvoteListModal;
@@ -0,0 +1,7 @@
1
+ export declare function VoteSlider({ author, permlink, defaultValue, onUpvote, onCancel, }: {
2
+ author: string;
3
+ permlink: string;
4
+ defaultValue?: number;
5
+ onUpvote: (percent: number) => Promise<void> | void;
6
+ onCancel: () => void;
7
+ }): import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ import { WitnessFilters } from '../types/witness';
3
+ interface WitnessFiltersProps {
4
+ filters: WitnessFilters;
5
+ onFiltersChange: (filters: WitnessFilters) => void;
6
+ }
7
+ declare const WitnessFiltersComponent: React.FC<WitnessFiltersProps>;
8
+ export default WitnessFiltersComponent;
@@ -0,0 +1,10 @@
1
+ interface AddCommentInputProps {
2
+ onSubmit: (body: string) => void;
3
+ onCancel: () => void;
4
+ currentUser?: string;
5
+ placeholder?: string;
6
+ parentAuthor?: string;
7
+ parentPermlink?: string;
8
+ }
9
+ declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink }: AddCommentInputProps) => import("react/jsx-runtime").JSX.Element;
10
+ export default AddCommentInput;
@@ -0,0 +1,8 @@
1
+ interface CommentSearchBarProps {
2
+ isVisible: boolean;
3
+ searchQuery: string;
4
+ onSearchChange: (query: string) => void;
5
+ onClose: () => void;
6
+ }
7
+ declare const CommentSearchBar: ({ isVisible, searchQuery, onSearchChange, onClose }: CommentSearchBarProps) => import("react/jsx-runtime").JSX.Element;
8
+ export default CommentSearchBar;
@@ -0,0 +1,16 @@
1
+ import { Discussion } from '@/types/comment';
2
+ interface CommentTileProps {
3
+ comment: Discussion;
4
+ allComments: Discussion[];
5
+ onReply: (author: string, permlink: string) => void;
6
+ currentUser?: string;
7
+ token?: string;
8
+ searchQuery?: string;
9
+ depth?: number;
10
+ onVotedRefresh?: () => void;
11
+ onClickCommentUpvote?: (comment: Discussion) => void;
12
+ onClickCommentReply?: (comment: Discussion) => void;
13
+ onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
14
+ }
15
+ declare const CommentTile: ({ comment, allComments, onReply, currentUser, token, searchQuery, depth, onVotedRefresh, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton, }: CommentTileProps) => import("react/jsx-runtime").JSX.Element;
16
+ export default CommentTile;
@@ -0,0 +1,13 @@
1
+ import { Discussion } from '@/types/comment';
2
+ interface CommentsModalProps {
3
+ author: string;
4
+ permlink: string;
5
+ onClose: () => void;
6
+ currentUser?: string;
7
+ token?: string;
8
+ onClickCommentUpvote?: (comment: Discussion) => void;
9
+ onClickCommentReply?: (comment: Discussion) => void;
10
+ onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
11
+ }
12
+ declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default CommentsModal;
@@ -0,0 +1,9 @@
1
+ interface ReplyModalProps {
2
+ parentAuthor: string;
3
+ parentPermlink: string;
4
+ onClose: () => void;
5
+ onCommentSubmitted: (parentAuthor: string, parentPermlink: string, body: string) => Promise<void>;
6
+ currentUser?: string;
7
+ }
8
+ declare const ReplyModal: ({ parentAuthor, parentPermlink, onClose, onCommentSubmitted, currentUser }: ReplyModalProps) => import("react/jsx-runtime").JSX.Element;
9
+ export default ReplyModal;
@@ -0,0 +1,13 @@
1
+ import { Post } from "../../types/post";
2
+ interface CommunityDetailsProps {
3
+ communityId: string;
4
+ onAuthorClick?: (author: string, avatar: string) => void;
5
+ onPostClick?: (post: Post) => void;
6
+ onCommunityClick?: (communityTitle: string) => void;
7
+ onPayoutClick?: (payout: number) => void;
8
+ onUpvoteClick?: (post: Post) => void;
9
+ onCommentClick?: (post: Post) => void;
10
+ onReblogClick?: (post: Post) => void;
11
+ }
12
+ declare const CommunityDetails: ({ communityId, onAuthorClick, onPostClick, onCommunityClick, onPayoutClick, onUpvoteClick, onCommentClick, onReblogClick, }: CommunityDetailsProps) => import("react/jsx-runtime").JSX.Element;
13
+ export default CommunityDetails;
@@ -3,6 +3,11 @@ export { default as VideoDetail } from './VideoDetail';
3
3
  export { default as VideoFeed } from './VideoFeed';
4
4
  export { default as VideoInfo } from './VideoInfo';
5
5
  export { default as Wallet } from './Wallet';
6
+ export { default as PostFeedList } from './PostFeedList';
7
+ export { default as ProposalsList } from './ProposalsList';
8
+ export { default as FollowersList } from './FollowersList';
9
+ export { default as FollowingList } from './FollowingList';
10
+ export { default as ActivityList } from './ActivityList';
6
11
  export { default as FavouriteWidget } from './common/FavouriteWidget';
7
12
  export { default as CommunitiesList } from './community/CommunitiesList';
8
13
  export { default as CommunityAbout } from './community/CommunityAbout';
package/dist/index.d.ts CHANGED
@@ -3,6 +3,12 @@ export { default as VideoDetail } from './components/VideoDetail';
3
3
  export { default as VideoFeed } from './components/VideoFeed';
4
4
  export { default as VideoInfo } from './components/VideoInfo';
5
5
  export { default as Wallet } from './components/Wallet';
6
+ export { default as PostFeedList } from './components/PostFeedList';
7
+ export { default as ProposalsList } from './components/ProposalsList';
8
+ export { default as FollowersList } from './components/FollowersList';
9
+ export { default as FollowingList } from './components/FollowingList';
10
+ export { default as ActivityList } from './components/ActivityList';
11
+ export { default as ListOfWitnesses } from './components/ListOfWitnesses';
6
12
  export { default as FavouriteWidget } from './components/common/FavouriteWidget';
7
13
  export { default as CommunitiesList } from './components/community/CommunitiesList';
8
14
  export { default as CommunityAbout } from './components/community/CommunityAbout';
@@ -25,5 +31,7 @@ export * from './types/graphql';
25
31
  export * from './types/trending';
26
32
  export * from './types/video';
27
33
  export * from './types/wallet';
34
+ export * from './types/witness';
28
35
  export * from './services/apiService';
36
+ export * from './services/witnessService';
29
37
  export * from './store/walletStore';