hive-react-kit 0.9.0 → 0.9.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.
@@ -28,6 +28,25 @@ export interface HiveDetailPostProps {
28
28
  * Typically wired to a user setting.
29
29
  */
30
30
  defaultReward?: import('../utils/commentOptions').RewardOption;
31
+ /**
32
+ * Override the Hive content renderer's link-generating functions so the
33
+ * rendered `<a>` URLs route into your app instead of an external Hive
34
+ * frontend. The in-body click interceptor already recognises peakd /
35
+ * hive.blog / ecency / inleo URLs plus `#/@user` and `/@user` hash/
36
+ * root-relative hrefs, so any of those formats will be routed internally
37
+ * via `onUserClick` / `onNavigateToPost`. Applies to both the post body
38
+ * and inline comment bodies.
39
+ */
40
+ renderOptions?: {
41
+ /** Replace user-mention URL (e.g. `(u) => '#/@' + u`). */
42
+ userLinkUrlFn?: (username: string) => string;
43
+ /** Replace hashtag URL (e.g. `(t) => '#/tag/' + t`). */
44
+ tagLinkUrlFn?: (tag: string) => string;
45
+ /** Replace the renderer's base URL used when `convertHiveUrls` is on. */
46
+ postBaseUrl?: string;
47
+ /** Replace the IPFS gateway prefix used for ipfs:// embeds. */
48
+ ipfsGateway?: string;
49
+ };
31
50
  onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
32
51
  onReblog?: () => void;
33
52
  onShare?: () => void;
@@ -69,5 +88,5 @@ export interface HiveDetailPostProps {
69
88
  /** Called when user clicks "View parent post" — navigate to the parent post. */
70
89
  onNavigateToPost?: (author: string, permlink: string) => void;
71
90
  }
72
- export declare function HiveDetailPost({ author, permlink, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onShare, onTip, onReport, onShareComment, onTipComment, onReportComment, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, backgroundColor, onBack, onUserClick, onNavigateToPost, onVotePoll, showVoteButton, processBody, defaultReward, }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
91
+ export declare function HiveDetailPost({ author, permlink, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onShare, onTip, onReport, onShareComment, onTipComment, onReportComment, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, backgroundColor, onBack, onUserClick, onNavigateToPost, onVotePoll, showVoteButton, processBody, defaultReward, renderOptions, }: HiveDetailPostProps): import("react/jsx-runtime").JSX.Element;
73
92
  export default HiveDetailPost;
@@ -29,6 +29,13 @@ interface InlineCommentItemProps {
29
29
  onUserClick?: (username: string) => void;
30
30
  /** Default reward routing seeded into every reply composer. */
31
31
  defaultReward?: RewardOption;
32
+ /** Renderer URL overrides applied to the comment body. */
33
+ renderOptions?: {
34
+ userLinkUrlFn?: (username: string) => string;
35
+ tagLinkUrlFn?: (tag: string) => string;
36
+ postBaseUrl?: string;
37
+ ipfsGateway?: string;
38
+ };
32
39
  }
33
- export default function InlineCommentItem({ comment, allComments, onReply, onCancelReply, onCommentSubmit, activeReplyKey, currentUser, token, depth, onVotedRefresh, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hiveIconUrl, onShareComment, onTipComment, onReportComment, onNavigateToPost, onUserClick, defaultReward, }: InlineCommentItemProps): import("react/jsx-runtime").JSX.Element;
40
+ export default function InlineCommentItem({ comment, allComments, onReply, onCancelReply, onCommentSubmit, activeReplyKey, currentUser, token, depth, onVotedRefresh, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hiveIconUrl, onShareComment, onTipComment, onReportComment, onNavigateToPost, onUserClick, defaultReward, renderOptions, }: InlineCommentItemProps): import("react/jsx-runtime").JSX.Element;
34
41
  export {};
@@ -15,6 +15,13 @@ interface InlineCommentSectionProps {
15
15
  parentTags?: string[];
16
16
  /** Default reward routing seeded into every reply composer in this section. */
17
17
  defaultReward?: RewardOption;
18
+ /** Renderer URL overrides applied to every comment body in this section. */
19
+ renderOptions?: {
20
+ userLinkUrlFn?: (username: string) => string;
21
+ tagLinkUrlFn?: (tag: string) => string;
22
+ postBaseUrl?: string;
23
+ ipfsGateway?: string;
24
+ };
18
25
  ecencyToken?: string;
19
26
  threeSpeakApiKey?: string;
20
27
  giphyApiKey?: string;
@@ -36,5 +43,5 @@ interface InlineCommentSectionProps {
36
43
  /** Intercept intra-body Hive profile links in comment bodies. */
37
44
  onUserClick?: (username: string) => void;
38
45
  }
39
- export default function InlineCommentSection({ author, permlink, currentUser, token, onSubmitComment, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, onShareComment, onTipComment, onReportComment, onNavigateToPost, onUserClick, showVoteButton, alreadyVoted, parentTags, defaultReward, }: InlineCommentSectionProps): import("react/jsx-runtime").JSX.Element;
46
+ export default function InlineCommentSection({ author, permlink, currentUser, token, onSubmitComment, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, onShareComment, onTipComment, onReportComment, onNavigateToPost, onUserClick, showVoteButton, alreadyVoted, parentTags, defaultReward, renderOptions, }: InlineCommentSectionProps): import("react/jsx-runtime").JSX.Element;
40
47
  export {};