hive-react-kit 1.7.1 → 1.7.3

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.
@@ -51,6 +51,15 @@ export interface BlogPostListProps {
51
51
  * this handler. The kit does no ownership check; the consumer
52
52
  * decides whether to pass the prop. */
53
53
  onDeletePost?: (author: string, permlink: string) => void;
54
+ /** Community admin/mod — when true, each card's kebab gets Pin / Unpin
55
+ * entries (Unpin when the post is already pinned). The consumer gates
56
+ * this by the current user's role and handles the broadcast. */
57
+ canPin?: boolean;
58
+ onPinPost?: (author: string, permlink: string) => void;
59
+ onUnpinPost?: (author: string, permlink: string) => void;
60
+ /** Broadcasts a poll vote (custom_json id=`polls`). When provided, poll
61
+ * posts in the feed render an inline <PollVoteWidget/>. */
62
+ onVotePoll?: (author: string, permlink: string, choiceNums: number[]) => void | boolean | Promise<void | boolean>;
54
63
  onUserClick?: (username: string) => void;
55
64
  onPostClick?: (author: string, permlink: string, title?: string) => void;
56
65
  getPostUrl?: (author: string, permlink: string) => string;
@@ -19,6 +19,11 @@ export interface MoreActionsMenuProps {
19
19
  * Consumer decides whether to add or remove based on `isBookmarked`. */
20
20
  onToggleBookmark?: () => void;
21
21
  isBookmarked?: boolean;
22
+ /** Show the Pin item (community admins/mods). Caller gates visibility
23
+ * by role; the kit just renders the entry. */
24
+ onPin?: () => void;
25
+ /** Show the Unpin item (community admins/mods, when already pinned). */
26
+ onUnpin?: () => void;
22
27
  /** Show the Delete item (rendered last, in red, gated by the caller
23
28
  * to the author themselves — the kit does no ownership check). */
24
29
  onDelete?: () => void;
@@ -28,5 +33,5 @@ export interface MoreActionsMenuProps {
28
33
  /** aria-label for the trigger. */
29
34
  ariaLabel?: string;
30
35
  }
31
- export declare function MoreActionsMenu({ onEdit, onReblog, onReSnap, onShare, onTip, onReport, onToggleBookmark, isBookmarked, onDelete, buttonClassName, ariaLabel, }: MoreActionsMenuProps): import("react/jsx-runtime").JSX.Element;
36
+ export declare function MoreActionsMenu({ onEdit, onReblog, onReSnap, onShare, onTip, onReport, onToggleBookmark, isBookmarked, onPin, onUnpin, onDelete, buttonClassName, ariaLabel, }: MoreActionsMenuProps): import("react/jsx-runtime").JSX.Element;
32
37
  export default MoreActionsMenu;
@@ -92,6 +92,11 @@ export interface PostActionButtonProps {
92
92
  * iff this handler is provided. Lives inside the kebab popover
93
93
  * (always — not as a standalone inline action), styled in red. */
94
94
  onDelete?: () => void;
95
+ /** Community admin/mod — pin this post to the top of the community. The
96
+ * caller gates these by role; the kit just renders the menu entries. */
97
+ onPin?: () => void;
98
+ /** Community admin/mod — unpin this post (shown when already pinned). */
99
+ onUnpin?: () => void;
95
100
  /** Called when user confirms comment upvote with (author, permlink, percent). Frontend handles signing. Voted comments show icon in blue. */
96
101
  onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
97
102
  /** Tapping a voter inside the upvote-list dialog calls this with the
@@ -145,5 +150,5 @@ export interface PostActionButtonProps {
145
150
  * polls, community detail) where there isn't room for four icons. */
146
151
  actionsAsMenu?: boolean;
147
152
  }
148
- export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, hiveIconUrl, payoutTooltip, payoutDetails, initialVotes, initialVoteCount, initialCommentsCount, onUpvote, onSubmitComment, onComments, onEdit, onReblog, onReSnap, onShare, onTip, onReport, onToggleBookmark, isBookmarked, onDelete, onClickCommentUpvote, onUserClick, getUserUrl, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, disableCommentsModal, onClickCommentIcon, onClickCommentCount, hasCommented, myReplyKey, showVoteButton, parentTags, defaultReward, defaultBeneficiaries, beneficiaryFavorites, defaultVotePercent, voteWeightStep, allowLandscapeVideos, actionsAsMenu, awaitingWalletApproval, postCreatedAt, size, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
153
+ export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, hiveIconUrl, payoutTooltip, payoutDetails, initialVotes, initialVoteCount, initialCommentsCount, onUpvote, onSubmitComment, onComments, onEdit, onReblog, onReSnap, onShare, onTip, onReport, onToggleBookmark, isBookmarked, onDelete, onPin, onUnpin, onClickCommentUpvote, onUserClick, getUserUrl, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, disableCommentsModal, onClickCommentIcon, onClickCommentCount, hasCommented, myReplyKey, showVoteButton, parentTags, defaultReward, defaultBeneficiaries, beneficiaryFavorites, defaultVotePercent, voteWeightStep, allowLandscapeVideos, actionsAsMenu, awaitingWalletApproval, postCreatedAt, size, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
149
154
  export default PostActionButton;
@@ -37,6 +37,14 @@ export interface CommunityDetailProps {
37
37
  /** Author-only — forwarded into the embedded <BlogPostList/> so the
38
38
  * card kebab gets a red Delete entry when `currentUser === author`. */
39
39
  onDeletePost?: (author: string, permlink: string) => void;
40
+ /** Community admin/mod — surfaces Pin / Unpin entries on each post's
41
+ * kebab. The consumer gates `canPin` by role and broadcasts. */
42
+ canPin?: boolean;
43
+ onPinPost?: (author: string, permlink: string) => void;
44
+ onUnpinPost?: (author: string, permlink: string) => void;
45
+ /** Broadcasts a poll vote — forwarded to the feed's <BlogPostList/> so
46
+ * poll posts can be voted on inline. */
47
+ onVotePoll?: (author: string, permlink: string, choiceNums: number[]) => void | boolean | Promise<void | boolean>;
40
48
  ecencyToken?: string;
41
49
  threeSpeakApiKey?: string;
42
50
  giphyApiKey?: string;
@@ -85,6 +93,14 @@ export interface CommunityDetailProps {
85
93
  /** Show a spinner on the button — set this true while a broadcast is
86
94
  * in flight on the host. */
87
95
  subscribePending?: boolean;
96
+ /** When true (current user is owner/admin), the header swaps the
97
+ * Subscribe button for an "Actions" dropdown (Unsubscribe + Roles &
98
+ * Titles). The host gates this by role. */
99
+ canManage?: boolean;
100
+ /** Opens the host's Roles & Titles management UI. */
101
+ onManageRoles?: () => void;
102
+ /** Opens the host's Community Settings UI. */
103
+ onOpenSettings?: () => void;
88
104
  /** Controlled top-level tab. Pass alongside `onActiveTabChange` to
89
105
  * drive the tab from the URL or any other external store. When
90
106
  * omitted, the component manages tab state internally (default
@@ -102,5 +118,5 @@ export interface CommunityDetailProps {
102
118
  * the view starts at the top, matching forward navigation. */
103
119
  shouldRestoreScroll?: boolean;
104
120
  }
105
- declare const CommunityDetail: ({ communityId, currentUser, onBack, onUserClick, onPostClick, getPostUrl, getUserUrl, getTagUrl, getCommunityUrl, onCommentClick, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onTip, onSharePost, onReportPost, onToggleBookmark, isPostBookmarked, onToggleCommunityBookmark, isCommunityBookmarked, onDeletePost, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, defaultVotePercent, voteWeightStep, allowLandscapeVideos, awaitingWalletApproval, defaultReward, actionsAsMenu, onShare, onRss, isSubscribed: controlledIsSubscribed, onToggleSubscribe, subscribePending, loadCommunitySnaps: _loadCommunitySnaps, reportedAuthors, reportedPosts, activeTab: controlledActiveTab, onActiveTabChange, postSort: controlledPostSort, onPostSortChange, shouldRestoreScroll, }: CommunityDetailProps) => import("react/jsx-runtime").JSX.Element;
121
+ declare const CommunityDetail: ({ communityId, currentUser, onBack, onUserClick, onPostClick, getPostUrl, getUserUrl, getTagUrl, getCommunityUrl, onCommentClick, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onTip, onSharePost, onReportPost, onToggleBookmark, isPostBookmarked, onToggleCommunityBookmark, isCommunityBookmarked, onDeletePost, canPin, onPinPost, onUnpinPost, onVotePoll, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, defaultVotePercent, voteWeightStep, allowLandscapeVideos, awaitingWalletApproval, defaultReward, actionsAsMenu, onShare, onRss, isSubscribed: controlledIsSubscribed, onToggleSubscribe, subscribePending, canManage, onManageRoles, onOpenSettings, loadCommunitySnaps: _loadCommunitySnaps, reportedAuthors, reportedPosts, activeTab: controlledActiveTab, onActiveTabChange, postSort: controlledPostSort, onPostSortChange, shouldRestoreScroll, }: CommunityDetailProps) => import("react/jsx-runtime").JSX.Element;
106
122
  export default CommunityDetail;