hive-react-kit 0.8.7 → 0.8.8
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/dist/build.css +32 -0
- package/dist/components/comments/AddCommentInput.d.ts +26 -2
- package/dist/components/inlineComments/InlineCommentItem.d.ts +5 -1
- package/dist/components/inlineComments/InlineCommentSection.d.ts +5 -1
- package/dist/index.cjs.js +97 -97
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +6268 -5910
- package/dist/utils/commentOptions.d.ts +35 -0
- package/dist/utils/hiveLinks.d.ts +33 -0
- package/package.json +1 -1
package/dist/build.css
CHANGED
|
@@ -792,6 +792,9 @@
|
|
|
792
792
|
.w-2 {
|
|
793
793
|
width: calc(var(--spacing) * 2);
|
|
794
794
|
}
|
|
795
|
+
.w-2\.5 {
|
|
796
|
+
width: calc(var(--spacing) * 2.5);
|
|
797
|
+
}
|
|
795
798
|
.w-2\/3 {
|
|
796
799
|
width: calc(2 / 3 * 100%);
|
|
797
800
|
}
|
|
@@ -876,6 +879,9 @@
|
|
|
876
879
|
.w-64 {
|
|
877
880
|
width: calc(var(--spacing) * 64);
|
|
878
881
|
}
|
|
882
|
+
.w-72 {
|
|
883
|
+
width: calc(var(--spacing) * 72);
|
|
884
|
+
}
|
|
879
885
|
.w-\[280px\] {
|
|
880
886
|
width: 280px;
|
|
881
887
|
}
|
|
@@ -909,6 +915,9 @@
|
|
|
909
915
|
.max-w-\[280px\] {
|
|
910
916
|
max-width: 280px;
|
|
911
917
|
}
|
|
918
|
+
.max-w-\[calc\(100vw-1rem\)\] {
|
|
919
|
+
max-width: calc(100vw - 1rem);
|
|
920
|
+
}
|
|
912
921
|
.max-w-full {
|
|
913
922
|
max-width: 100%;
|
|
914
923
|
}
|
|
@@ -1571,6 +1580,12 @@
|
|
|
1571
1580
|
background-color: color-mix(in oklab, var(--color-gray-700) 60%, transparent);
|
|
1572
1581
|
}
|
|
1573
1582
|
}
|
|
1583
|
+
.bg-gray-700\/70 {
|
|
1584
|
+
background-color: color-mix(in srgb, oklch(37.3% 0.034 259.733) 70%, transparent);
|
|
1585
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1586
|
+
background-color: color-mix(in oklab, var(--color-gray-700) 70%, transparent);
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1574
1589
|
.bg-gray-800 {
|
|
1575
1590
|
background-color: var(--color-gray-800);
|
|
1576
1591
|
}
|
|
@@ -1893,6 +1908,9 @@
|
|
|
1893
1908
|
.p-8 {
|
|
1894
1909
|
padding: calc(var(--spacing) * 8);
|
|
1895
1910
|
}
|
|
1911
|
+
.px-0\.5 {
|
|
1912
|
+
padding-inline: calc(var(--spacing) * 0.5);
|
|
1913
|
+
}
|
|
1896
1914
|
.px-1 {
|
|
1897
1915
|
padding-inline: calc(var(--spacing) * 1);
|
|
1898
1916
|
}
|
|
@@ -2472,6 +2490,10 @@
|
|
|
2472
2490
|
--tw-ease: var(--ease-out);
|
|
2473
2491
|
transition-timing-function: var(--ease-out);
|
|
2474
2492
|
}
|
|
2493
|
+
.outline-none {
|
|
2494
|
+
--tw-outline-style: none;
|
|
2495
|
+
outline-style: none;
|
|
2496
|
+
}
|
|
2475
2497
|
.group-hover\:pointer-events-auto {
|
|
2476
2498
|
&:is(:where(.group):hover *) {
|
|
2477
2499
|
@media (hover: hover) {
|
|
@@ -2630,6 +2652,16 @@
|
|
|
2630
2652
|
}
|
|
2631
2653
|
}
|
|
2632
2654
|
}
|
|
2655
|
+
.hover\:bg-blue-600\/40 {
|
|
2656
|
+
&:hover {
|
|
2657
|
+
@media (hover: hover) {
|
|
2658
|
+
background-color: color-mix(in srgb, oklch(54.6% 0.245 262.881) 40%, transparent);
|
|
2659
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
2660
|
+
background-color: color-mix(in oklab, var(--color-blue-600) 40%, transparent);
|
|
2661
|
+
}
|
|
2662
|
+
}
|
|
2663
|
+
}
|
|
2664
|
+
}
|
|
2633
2665
|
.hover\:bg-blue-700 {
|
|
2634
2666
|
&:hover {
|
|
2635
2667
|
@media (hover: hover) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type RewardOption } from '../../utils/commentOptions';
|
|
2
3
|
import { type PostingSignMessageFn } from '../../services/hiveImageUpload';
|
|
3
4
|
export interface PostComposerProps {
|
|
4
5
|
onSubmit: (body: string) => void | boolean | Promise<void | boolean>;
|
|
@@ -37,6 +38,29 @@ export interface PostComposerProps {
|
|
|
37
38
|
hidePoll?: boolean;
|
|
38
39
|
/** Called when a poll is attached/updated. Receives PollData or null when removed */
|
|
39
40
|
onPollChange?: (poll: import('../composer/PollCreator').PollData | null) => void;
|
|
41
|
+
/**
|
|
42
|
+
* Locked default tags. Shown in the tag manager with a lock icon and
|
|
43
|
+
* cannot be edited or removed. Forwarded on every `onTagsChange` call as
|
|
44
|
+
* the leading entries in the merged list. Capped at 10 total.
|
|
45
|
+
*/
|
|
46
|
+
defaultTags?: string[];
|
|
47
|
+
/** Max total tags including defaults (default 10). */
|
|
48
|
+
maxTags?: number;
|
|
49
|
+
/** Called whenever the user-added tags change. Receives the full merged list (defaults first). */
|
|
50
|
+
onTagsChange?: (tags: string[]) => void;
|
|
51
|
+
/** Hide the tag manager toolbar button. */
|
|
52
|
+
hideTags?: boolean;
|
|
53
|
+
/**
|
|
54
|
+
* Reward routing selection (default `'default'` = 50% HBD / 50% HP).
|
|
55
|
+
* Controlled or uncontrolled — if omitted, the composer manages its own state.
|
|
56
|
+
*/
|
|
57
|
+
reward?: RewardOption;
|
|
58
|
+
/** Initial reward option when uncontrolled (default `'default'`). */
|
|
59
|
+
defaultReward?: RewardOption;
|
|
60
|
+
/** Called when the reward routing changes. Pair with `buildCommentOptions(...)` at broadcast time. */
|
|
61
|
+
onRewardChange?: (reward: RewardOption) => void;
|
|
62
|
+
/** Hide the reward routing toolbar button. */
|
|
63
|
+
hideReward?: boolean;
|
|
40
64
|
/** Show cancel button (default true) */
|
|
41
65
|
showCancel?: boolean;
|
|
42
66
|
/** Submit button label (default "Post") */
|
|
@@ -74,8 +98,8 @@ export interface PostComposerProps {
|
|
|
74
98
|
}
|
|
75
99
|
/** @deprecated Use PostComposerProps instead */
|
|
76
100
|
export type AddCommentInputProps = PostComposerProps;
|
|
77
|
-
declare const PostComposer: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, onSignMessage, signingUsername, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, hideCode, hideMention, hideTemplate, hidePreview, hidePoll, onPollChange, showCancel, submitLabel, title, defaultPreviewOn, value, onChange, disabled, hideSubmitArea, submitRef, hideUserHeader, bgColor, borderColor, disableAutoFocus, walletApprovalLabel, awaitingWalletApproval, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
101
|
+
declare const PostComposer: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, onSignMessage, signingUsername, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, hideCode, hideMention, hideTemplate, hidePreview, hidePoll, onPollChange, defaultTags, maxTags, onTagsChange, hideTags, reward, defaultReward, onRewardChange, hideReward, showCancel, submitLabel, title, defaultPreviewOn, value, onChange, disabled, hideSubmitArea, submitRef, hideUserHeader, bgColor, borderColor, disableAutoFocus, walletApprovalLabel, awaitingWalletApproval, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
78
102
|
/** @deprecated Use PostComposer instead */
|
|
79
|
-
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, onSignMessage, signingUsername, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, hideCode, hideMention, hideTemplate, hidePreview, hidePoll, onPollChange, showCancel, submitLabel, title, defaultPreviewOn, value, onChange, disabled, hideSubmitArea, submitRef, hideUserHeader, bgColor, borderColor, disableAutoFocus, walletApprovalLabel, awaitingWalletApproval, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
103
|
+
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, onSignMessage, signingUsername, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, hideCode, hideMention, hideTemplate, hidePreview, hidePoll, onPollChange, defaultTags, maxTags, onTagsChange, hideTags, reward, defaultReward, onRewardChange, hideReward, showCancel, submitLabel, title, defaultPreviewOn, value, onChange, disabled, hideSubmitArea, submitRef, hideUserHeader, bgColor, borderColor, disableAutoFocus, walletApprovalLabel, awaitingWalletApproval, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
80
104
|
export { PostComposer };
|
|
81
105
|
export default AddCommentInput;
|
|
@@ -22,6 +22,10 @@ interface InlineCommentItemProps {
|
|
|
22
22
|
onShareComment?: (author: string, permlink: string) => void;
|
|
23
23
|
onTipComment?: (author: string, permlink: string) => void;
|
|
24
24
|
onReportComment?: (author: string, permlink: string) => void;
|
|
25
|
+
/** Called when an intra-body link points at a Hive post (peakd/hive.blog/ecency/inleo). */
|
|
26
|
+
onNavigateToPost?: (author: string, permlink: string) => void;
|
|
27
|
+
/** Called when an intra-body link points at a Hive user profile. */
|
|
28
|
+
onUserClick?: (username: string) => void;
|
|
25
29
|
}
|
|
26
|
-
export default function InlineCommentItem({ comment, allComments, onReply, onCancelReply, onCommentSubmit, activeReplyKey, currentUser, token, depth, onVotedRefresh, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, hiveIconUrl, onShareComment, onTipComment, onReportComment, }: InlineCommentItemProps): import("react/jsx-runtime").JSX.Element;
|
|
30
|
+
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, }: InlineCommentItemProps): import("react/jsx-runtime").JSX.Element;
|
|
27
31
|
export {};
|
|
@@ -21,6 +21,10 @@ interface InlineCommentSectionProps {
|
|
|
21
21
|
onShareComment?: (author: string, permlink: string) => void;
|
|
22
22
|
onTipComment?: (author: string, permlink: string) => void;
|
|
23
23
|
onReportComment?: (author: string, permlink: string) => void;
|
|
24
|
+
/** Intercept intra-body Hive post links in comment bodies. */
|
|
25
|
+
onNavigateToPost?: (author: string, permlink: string) => void;
|
|
26
|
+
/** Intercept intra-body Hive profile links in comment bodies. */
|
|
27
|
+
onUserClick?: (username: string) => void;
|
|
24
28
|
}
|
|
25
|
-
export default function InlineCommentSection({ author, permlink, currentUser, token, onSubmitComment, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, onShareComment, onTipComment, onReportComment, }: InlineCommentSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
+
export default function InlineCommentSection({ author, permlink, currentUser, token, onSubmitComment, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, reportedAuthors, reportedPosts, hiveIconUrl, onShareComment, onTipComment, onReportComment, onNavigateToPost, onUserClick, }: InlineCommentSectionProps): import("react/jsx-runtime").JSX.Element;
|
|
26
30
|
export {};
|