hive-react-kit 1.6.1 → 1.6.2

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.
@@ -53,6 +53,9 @@ export interface BlogPostListProps {
53
53
  onDeletePost?: (author: string, permlink: string) => void;
54
54
  onUserClick?: (username: string) => void;
55
55
  onPostClick?: (author: string, permlink: string, title?: string) => void;
56
+ getPostUrl?: (author: string, permlink: string) => string;
57
+ getUserUrl?: (username: string) => string;
58
+ getCommunityUrl?: (community: string) => string;
56
59
  ecencyToken?: string;
57
60
  threeSpeakApiKey?: string;
58
61
  giphyApiKey?: string;
@@ -159,6 +159,8 @@ export interface HiveDetailPostProps {
159
159
  * Receives the community ID (`hive-xxxxxx`) so the consumer can route
160
160
  * to its community-detail page. */
161
161
  onCommunityClick?: (communityId: string) => void;
162
+ getUserUrl?: (username: string) => string;
163
+ getCommunityUrl?: (communityId: string) => string;
162
164
  /** True when the post is bookmarked by the current user. Controls
163
165
  * the visual state of the header's Bookmark item (filled vs.
164
166
  * outline). The kit doesn't fetch this — pass it from the
@@ -198,5 +200,5 @@ export interface HiveDetailPostProps {
198
200
  * page will then re-render with the new language. */
199
201
  onSelectLanguage?: (code: string) => void;
200
202
  }
201
- export declare function HiveDetailPost({ author, permlink, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onShare, onTip, onReport, onEdit, onShareComment, onTipComment, onReportComment, onToggleCommentBookmark, isCommentBookmarked, onEditComment, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, backgroundColor, onBack, onUserClick, onCommunityClick, onNavigateToPost, isBookmarked, onToggleBookmark, onHeaderShare, onHeaderReport, language, onSelectLanguage, onVotePoll, showVoteButton, processBody, defaultReward, defaultBeneficiaries, beneficiaryFavorites, defaultVotePercent, voteWeightStep, allowLandscapeVideos, renderOptions, awaitingWalletApproval, }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
203
+ export declare function HiveDetailPost({ author, permlink, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onShare, onTip, onReport, onEdit, onShareComment, onTipComment, onReportComment, onToggleCommentBookmark, isCommentBookmarked, onEditComment, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, backgroundColor, onBack, onUserClick, onCommunityClick, getUserUrl, getCommunityUrl, onNavigateToPost, isBookmarked, onToggleBookmark, onHeaderShare, onHeaderReport, language, onSelectLanguage, onVotePoll, showVoteButton, processBody, defaultReward, defaultBeneficiaries, beneficiaryFavorites, defaultVotePercent, voteWeightStep, allowLandscapeVideos, renderOptions, awaitingWalletApproval, }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
202
204
  export default HiveDetailPost;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * HiveLink — router-agnostic "link or button" primitive for the kit.
3
+ *
4
+ * The kit can't depend on react-router (consumers wire their own
5
+ * navigation via `onPostClick` / `onUserClick` callbacks). But a bare
6
+ * <button onClick={navigate}> gives the browser no link semantics, so
7
+ * users can't Cmd/Ctrl/middle-click or right-click → "Open in new tab".
8
+ *
9
+ * HiveLink bridges the gap: when the consumer supplies an `href` (built
10
+ * from a URL-builder prop like `getPostUrl`), we render a real <a> so
11
+ * all the native link affordances work. A plain left click is still
12
+ * intercepted and routed through `onActivate` for SPA navigation;
13
+ * modified / middle clicks fall through to the browser. When no `href`
14
+ * is provided we fall back to a <button>, preserving the old behaviour
15
+ * for consumers that haven't wired URL builders yet.
16
+ */
17
+ import type { ReactNode, CSSProperties } from 'react';
18
+ interface HiveLinkProps {
19
+ /** Destination URL. When omitted, renders a <button> (no link
20
+ * semantics) so existing callback-only consumers keep working. */
21
+ href?: string;
22
+ /** SPA navigation handler — fired on a plain left click. */
23
+ onActivate?: () => void;
24
+ className?: string;
25
+ style?: CSSProperties;
26
+ title?: string;
27
+ 'aria-label'?: string;
28
+ /** Stop the event from bubbling to an ancestor click handler
29
+ * (e.g. a clickable card body). Defaults to true since most kit
30
+ * links sit inside larger clickable surfaces. */
31
+ stopPropagation?: boolean;
32
+ children: ReactNode;
33
+ }
34
+ export declare function HiveLink({ href, onActivate, className, style, title, stopPropagation, children, ...rest }: HiveLinkProps): import("react/jsx-runtime").JSX.Element;
35
+ export {};
@@ -1,5 +1,9 @@
1
1
  interface CommunitiesListProps {
2
2
  onSelectCommunity: (communityId: string) => void;
3
+ /** When provided, each community row renders as a real <a href> so
4
+ * the browser offers "open in new tab" / Cmd-click. A plain left
5
+ * click is still intercepted and routed through `onSelectCommunity`. */
6
+ getCommunityUrl?: (communityId: string) => string;
3
7
  /** Visual variant. Default `"dark"` — uses kit tokens. */
4
8
  theme?: "light" | "dark";
5
9
  /** When `true`, the component restores its last cached state (the
@@ -9,5 +13,5 @@ interface CommunitiesListProps {
9
13
  * same scroll offset. When omitted/false, the list starts fresh. */
10
14
  shouldRestoreScroll?: boolean;
11
15
  }
12
- declare const CommunitiesList: ({ onSelectCommunity, theme, shouldRestoreScroll, }: CommunitiesListProps) => import("react/jsx-runtime").JSX.Element;
16
+ declare const CommunitiesList: ({ onSelectCommunity, getCommunityUrl, theme, shouldRestoreScroll, }: CommunitiesListProps) => import("react/jsx-runtime").JSX.Element;
13
17
  export default CommunitiesList;
@@ -10,6 +10,10 @@ export interface CommunityDetailProps {
10
10
  onUserClick?: (username: string) => void;
11
11
  onPostClick?: (author: string, permlink: string, title?: string) => void;
12
12
  onCommentClick?: (author: string, permlink: string) => void;
13
+ getPostUrl?: (author: string, permlink: string) => string;
14
+ getUserUrl?: (username: string) => string;
15
+ getTagUrl?: (tag: string) => string;
16
+ getCommunityUrl?: (community: string) => string;
13
17
  onUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
14
18
  onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => void | Promise<void>;
15
19
  onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
@@ -98,5 +102,5 @@ export interface CommunityDetailProps {
98
102
  * the view starts at the top, matching forward navigation. */
99
103
  shouldRestoreScroll?: boolean;
100
104
  }
101
- declare const CommunityDetail: ({ communityId, currentUser, onBack, onUserClick, onPostClick, 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;
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;
102
106
  export default CommunityDetail;
@@ -41,6 +41,10 @@ export interface CommunitySnapsTabProps {
41
41
  onDeletePost?: (author: string, permlink: string) => void;
42
42
  onUserClick?: (username: string) => void;
43
43
  onPostClick?: (author: string, permlink: string, title?: string) => void;
44
+ getPostUrl?: (author: string, permlink: string) => string;
45
+ getUserUrl?: (username: string) => string;
46
+ getTagUrl?: (tag: string) => string;
47
+ getCommunityUrl?: (community: string) => string;
44
48
  ecencyToken?: string;
45
49
  threeSpeakApiKey?: string;
46
50
  giphyApiKey?: string;
@@ -79,6 +79,10 @@ export interface SnapsFeedCardProps {
79
79
  onUserClick?: (username: string) => void;
80
80
  onPostClick?: (author: string, permlink: string, title?: string) => void;
81
81
  onTagClick?: (tag: string) => void;
82
+ getPostUrl?: (author: string, permlink: string) => string;
83
+ getUserUrl?: (username: string) => string;
84
+ getTagUrl?: (tag: string) => string;
85
+ getCommunityUrl?: (community: string) => string;
82
86
  ecencyToken?: string;
83
87
  threeSpeakApiKey?: string;
84
88
  giphyApiKey?: string;
@@ -89,6 +89,10 @@ export interface SnapsFeedViewProps {
89
89
  onVotePoll?: (author: string, permlink: string, choiceNums: number[]) => void | boolean | Promise<void | boolean>;
90
90
  onUserClick?: (username: string) => void;
91
91
  onPostClick?: (author: string, permlink: string, title?: string) => void;
92
+ getPostUrl?: (author: string, permlink: string) => string;
93
+ getUserUrl?: (username: string) => string;
94
+ getTagUrl?: (tag: string) => string;
95
+ getCommunityUrl?: (community: string) => string;
92
96
  ecencyToken?: string;
93
97
  threeSpeakApiKey?: string;
94
98
  giphyApiKey?: string;
@@ -122,5 +126,5 @@ export interface SnapsFeedViewProps {
122
126
  * headers stay visible via `sticky top-0`. Mobile is unaffected. */
123
127
  pageScroll?: boolean;
124
128
  }
125
- export declare function SnapsFeedView({ feeds, labels, avatars, defaultPrimary, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onReSnap, onTip, onSharePost, onCommentClick, onClickCommentIcon, onClickCommentCount, onReportPost, onToggleBookmark, isPostBookmarked, onDeletePost, onEditSnap, onVotePoll, onUserClick, onPostClick, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, defaultVotePercent, voteWeightStep, allowLandscapeVideos, awaitingWalletApproval, defaultReward, toolbar, footer, renderHeaderActions, actionsAsMenu, pageScroll, }: SnapsFeedViewProps): import("react/jsx-runtime").JSX.Element;
129
+ export declare function SnapsFeedView({ feeds, labels, avatars, defaultPrimary, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onReSnap, onTip, onSharePost, onCommentClick, onClickCommentIcon, onClickCommentCount, onReportPost, onToggleBookmark, isPostBookmarked, onDeletePost, onEditSnap, onVotePoll, onUserClick, onPostClick, getPostUrl, getUserUrl, getTagUrl, getCommunityUrl, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, defaultVotePercent, voteWeightStep, allowLandscapeVideos, awaitingWalletApproval, defaultReward, toolbar, footer, renderHeaderActions, actionsAsMenu, pageScroll, }: SnapsFeedViewProps): import("react/jsx-runtime").JSX.Element;
126
130
  export default SnapsFeedView;
@@ -49,6 +49,10 @@ export interface ProfileSnapsTabProps {
49
49
  onVotePoll?: (author: string, permlink: string, choiceNums: number[]) => void | boolean | Promise<void | boolean>;
50
50
  onUserClick?: (username: string) => void;
51
51
  onPostClick?: (author: string, permlink: string, title?: string) => void;
52
+ getPostUrl?: (author: string, permlink: string) => string;
53
+ getUserUrl?: (username: string) => string;
54
+ getTagUrl?: (tag: string) => string;
55
+ getCommunityUrl?: (community: string) => string;
52
56
  ecencyToken?: string;
53
57
  threeSpeakApiKey?: string;
54
58
  giphyApiKey?: string;
@@ -156,6 +156,10 @@ export interface UserDetailProfileProps {
156
156
  onSnapClick?: (author: string, permlink: string) => void;
157
157
  onPollClick?: (author: string, permlink: string, question: string) => void;
158
158
  onActivityPermlink?: (author: string, permlink: string) => void;
159
+ getPostUrl?: (author: string, permlink: string) => string;
160
+ getUserUrl?: (username: string) => string;
161
+ getTagUrl?: (tag: string) => string;
162
+ getCommunityUrl?: (community: string) => string;
159
163
  onActivitySelect?: (activity: any) => void;
160
164
  onShare?: (username: string) => void;
161
165
  onSharePost?: (author: string, permlink: string) => void;