hive-react-kit 0.5.0 → 0.5.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.
package/README.md CHANGED
@@ -86,11 +86,14 @@ import type { Video, Comment, Wallet as WalletType } from 'hive-react-kit/types'
86
86
  ```tsx
87
87
  import { UserDetailProfile } from 'hive-react-kit';
88
88
 
89
- // All tabs, default order
89
+ // All tabs, default order, with rich comment composer
90
90
  <UserDetailProfile
91
91
  username="sagarkothari88"
92
92
  currentUsername="myaccount"
93
93
  showBackButton
94
+ ecencyToken="your-ecency-token"
95
+ threeSpeakApiKey="your-3speak-api-key"
96
+ giphyApiKey="your-giphy-api-key"
94
97
  onBack={() => navigate(-1)}
95
98
  onFollow={(user) => console.log("Follow:", user)}
96
99
  onUnfollow={(user) => console.log("Unfollow:", user)}
@@ -115,6 +118,9 @@ import { UserDetailProfile } from 'hive-react-kit';
115
118
  | `showBackButton` | `boolean` | `false` | Show back arrow in header |
116
119
  | `onBack` | `() => void` | - | Callback when back button is clicked |
117
120
  | `tabShown` | `TabType[]` | all tabs | Controls which tabs are visible and their order. Only listed tabs are shown. First tab is the default active tab. If omitted, all 12 tabs are shown in default order |
121
+ | `ecencyToken` | `string` | `undefined` | Ecency image hosting token. Enables image upload and video thumbnail upload in the comment composer. When not provided, the image upload button is hidden |
122
+ | `threeSpeakApiKey` | `string` | `undefined` | 3Speak API key. Enables audio recording/upload and video upload in the comment composer. When not provided, audio and video buttons are hidden |
123
+ | `giphyApiKey` | `string` | `undefined` | GIPHY API key. Enables GIF search in the comment composer. When not provided, the GIF button is hidden |
118
124
 
119
125
  **Social Action Callbacks**
120
126
 
package/dist/build.css CHANGED
@@ -590,6 +590,9 @@
590
590
  .h-1 {
591
591
  height: calc(var(--spacing) * 1);
592
592
  }
593
+ .h-1\.5 {
594
+ height: calc(var(--spacing) * 1.5);
595
+ }
593
596
  .h-2 {
594
597
  height: calc(var(--spacing) * 2);
595
598
  }
@@ -641,6 +644,9 @@
641
644
  .h-32 {
642
645
  height: calc(var(--spacing) * 32);
643
646
  }
647
+ .h-36 {
648
+ height: calc(var(--spacing) * 36);
649
+ }
644
650
  .h-48 {
645
651
  height: calc(var(--spacing) * 48);
646
652
  }
@@ -665,6 +671,12 @@
665
671
  .max-h-20 {
666
672
  max-height: calc(var(--spacing) * 20);
667
673
  }
674
+ .max-h-60 {
675
+ max-height: calc(var(--spacing) * 60);
676
+ }
677
+ .max-h-64 {
678
+ max-height: calc(var(--spacing) * 64);
679
+ }
668
680
  .max-h-96 {
669
681
  max-height: calc(var(--spacing) * 96);
670
682
  }
@@ -779,6 +791,9 @@
779
791
  .w-32 {
780
792
  width: calc(var(--spacing) * 32);
781
793
  }
794
+ .w-36 {
795
+ width: calc(var(--spacing) * 36);
796
+ }
782
797
  .w-40 {
783
798
  width: calc(var(--spacing) * 40);
784
799
  }
@@ -905,8 +920,8 @@
905
920
  .resize {
906
921
  resize: both;
907
922
  }
908
- .resize-none {
909
- resize: none;
923
+ .resize-y {
924
+ resize: vertical;
910
925
  }
911
926
  .appearance-none {
912
927
  appearance: none;
@@ -926,6 +941,9 @@
926
941
  .grid-cols-5 {
927
942
  grid-template-columns: repeat(5, minmax(0, 1fr));
928
943
  }
944
+ .grid-cols-8 {
945
+ grid-template-columns: repeat(8, minmax(0, 1fr));
946
+ }
929
947
  .flex-col {
930
948
  flex-direction: column;
931
949
  }
@@ -1119,6 +1137,10 @@
1119
1137
  border-style: var(--tw-border-style);
1120
1138
  border-width: 1px;
1121
1139
  }
1140
+ .border-0 {
1141
+ border-style: var(--tw-border-style);
1142
+ border-width: 0px;
1143
+ }
1122
1144
  .border-2 {
1123
1145
  border-style: var(--tw-border-style);
1124
1146
  border-width: 2px;
@@ -1289,6 +1311,12 @@
1289
1311
  background-color: color-mix(in oklab, var(--color-black) 80%, transparent);
1290
1312
  }
1291
1313
  }
1314
+ .bg-black\/90 {
1315
+ background-color: color-mix(in srgb, #000 90%, transparent);
1316
+ @supports (color: color-mix(in lab, red, red)) {
1317
+ background-color: color-mix(in oklab, var(--color-black) 90%, transparent);
1318
+ }
1319
+ }
1292
1320
  .bg-blue-100 {
1293
1321
  background-color: var(--color-blue-100);
1294
1322
  }
@@ -1436,6 +1464,9 @@
1436
1464
  .bg-red-100 {
1437
1465
  background-color: var(--color-red-100);
1438
1466
  }
1467
+ .bg-red-500 {
1468
+ background-color: var(--color-red-500);
1469
+ }
1439
1470
  .bg-red-500\/10 {
1440
1471
  background-color: color-mix(in srgb, oklch(63.7% 0.237 25.331) 10%, transparent);
1441
1472
  @supports (color: color-mix(in lab, red, red)) {
@@ -1687,6 +1718,9 @@
1687
1718
  .pr-10 {
1688
1719
  padding-right: calc(var(--spacing) * 10);
1689
1720
  }
1721
+ .pb-2 {
1722
+ padding-bottom: calc(var(--spacing) * 2);
1723
+ }
1690
1724
  .pb-3 {
1691
1725
  padding-bottom: calc(var(--spacing) * 3);
1692
1726
  }
@@ -2091,6 +2125,10 @@
2091
2125
  --tw-duration: 300ms;
2092
2126
  transition-duration: 300ms;
2093
2127
  }
2128
+ .duration-1000 {
2129
+ --tw-duration: 1000ms;
2130
+ transition-duration: 1000ms;
2131
+ }
2094
2132
  .ease-in-out {
2095
2133
  --tw-ease: var(--ease-in-out);
2096
2134
  transition-timing-function: var(--ease-in-out);
@@ -2202,6 +2240,16 @@
2202
2240
  }
2203
2241
  }
2204
2242
  }
2243
+ .hover\:border-blue-500\/40 {
2244
+ &:hover {
2245
+ @media (hover: hover) {
2246
+ border-color: color-mix(in srgb, oklch(62.3% 0.214 259.815) 40%, transparent);
2247
+ @supports (color: color-mix(in lab, red, red)) {
2248
+ border-color: color-mix(in oklab, var(--color-blue-500) 40%, transparent);
2249
+ }
2250
+ }
2251
+ }
2252
+ }
2205
2253
  .hover\:border-gray-600 {
2206
2254
  &:hover {
2207
2255
  @media (hover: hover) {
@@ -2306,6 +2354,16 @@
2306
2354
  }
2307
2355
  }
2308
2356
  }
2357
+ .hover\:bg-gray-800\/80 {
2358
+ &:hover {
2359
+ @media (hover: hover) {
2360
+ background-color: color-mix(in srgb, oklch(27.8% 0.033 256.848) 80%, transparent);
2361
+ @supports (color: color-mix(in lab, red, red)) {
2362
+ background-color: color-mix(in oklab, var(--color-gray-800) 80%, transparent);
2363
+ }
2364
+ }
2365
+ }
2366
+ }
2309
2367
  .hover\:bg-green-700 {
2310
2368
  &:hover {
2311
2369
  @media (hover: hover) {
@@ -2453,13 +2511,6 @@
2453
2511
  }
2454
2512
  }
2455
2513
  }
2456
- .hover\:text-gray-800 {
2457
- &:hover {
2458
- @media (hover: hover) {
2459
- color: var(--color-gray-800);
2460
- }
2461
- }
2462
- }
2463
2514
  .hover\:text-gray-900 {
2464
2515
  &:hover {
2465
2516
  @media (hover: hover) {
@@ -2481,6 +2532,13 @@
2481
2532
  }
2482
2533
  }
2483
2534
  }
2535
+ .hover\:text-red-400 {
2536
+ &:hover {
2537
+ @media (hover: hover) {
2538
+ color: var(--color-red-400);
2539
+ }
2540
+ }
2541
+ }
2484
2542
  .hover\:text-red-600 {
2485
2543
  &:hover {
2486
2544
  @media (hover: hover) {
@@ -2525,6 +2583,21 @@
2525
2583
  }
2526
2584
  }
2527
2585
  }
2586
+ .hover\:ring-2 {
2587
+ &:hover {
2588
+ @media (hover: hover) {
2589
+ --tw-ring-shadow: var(--tw-ring-inset,) 0 0 0 calc(2px + var(--tw-ring-offset-width)) var(--tw-ring-color, currentcolor);
2590
+ box-shadow: var(--tw-inset-shadow), var(--tw-inset-ring-shadow), var(--tw-ring-offset-shadow), var(--tw-ring-shadow), var(--tw-shadow);
2591
+ }
2592
+ }
2593
+ }
2594
+ .hover\:ring-blue-500 {
2595
+ &:hover {
2596
+ @media (hover: hover) {
2597
+ --tw-ring-color: var(--color-blue-500);
2598
+ }
2599
+ }
2600
+ }
2528
2601
  .focus\:border-blue-500 {
2529
2602
  &:focus {
2530
2603
  border-color: var(--color-blue-500);
@@ -2555,14 +2628,17 @@
2555
2628
  outline-style: none;
2556
2629
  }
2557
2630
  }
2558
- .disabled\:pointer-events-none {
2559
- &:disabled {
2560
- pointer-events: none;
2631
+ .active\:scale-95 {
2632
+ &:active {
2633
+ --tw-scale-x: 95%;
2634
+ --tw-scale-y: 95%;
2635
+ --tw-scale-z: 95%;
2636
+ scale: var(--tw-scale-x) var(--tw-scale-y);
2561
2637
  }
2562
2638
  }
2563
- .disabled\:transform-none {
2639
+ .disabled\:pointer-events-none {
2564
2640
  &:disabled {
2565
- transform: none;
2641
+ pointer-events: none;
2566
2642
  }
2567
2643
  }
2568
2644
  .disabled\:cursor-not-allowed {
@@ -2575,9 +2651,9 @@
2575
2651
  background-color: var(--color-blue-400);
2576
2652
  }
2577
2653
  }
2578
- .disabled\:bg-gray-300 {
2654
+ .disabled\:bg-gray-700 {
2579
2655
  &:disabled {
2580
- background-color: var(--color-gray-300);
2656
+ background-color: var(--color-gray-700);
2581
2657
  }
2582
2658
  }
2583
2659
  .disabled\:opacity-50 {
@@ -2668,6 +2744,11 @@
2668
2744
  height: calc(var(--spacing) * 32);
2669
2745
  }
2670
2746
  }
2747
+ .sm\:h-44 {
2748
+ @media (width >= 40rem) {
2749
+ height: calc(var(--spacing) * 44);
2750
+ }
2751
+ }
2671
2752
  .sm\:w-4 {
2672
2753
  @media (width >= 40rem) {
2673
2754
  width: calc(var(--spacing) * 4);
@@ -3119,11 +3200,6 @@
3119
3200
  }
3120
3201
  }
3121
3202
  }
3122
- .dark\:bg-gray-600 {
3123
- @media (prefers-color-scheme: dark) {
3124
- background-color: var(--color-gray-600);
3125
- }
3126
- }
3127
3203
  .dark\:bg-gray-700 {
3128
3204
  @media (prefers-color-scheme: dark) {
3129
3205
  background-color: var(--color-gray-700);
@@ -3362,15 +3438,6 @@
3362
3438
  }
3363
3439
  }
3364
3440
  }
3365
- .dark\:hover\:text-gray-200 {
3366
- @media (prefers-color-scheme: dark) {
3367
- &:hover {
3368
- @media (hover: hover) {
3369
- color: var(--color-gray-200);
3370
- }
3371
- }
3372
- }
3373
- }
3374
3441
  .dark\:hover\:text-gray-300 {
3375
3442
  @media (prefers-color-scheme: dark) {
3376
3443
  &:hover {
@@ -3416,13 +3483,6 @@
3416
3483
  }
3417
3484
  }
3418
3485
  }
3419
- .dark\:disabled\:bg-gray-600 {
3420
- @media (prefers-color-scheme: dark) {
3421
- &:disabled {
3422
- background-color: var(--color-gray-600);
3423
- }
3424
- }
3425
- }
3426
3486
  .\[\&\:\:-moz-range-progress\]\:rounded-lg {
3427
3487
  &::-moz-range-progress {
3428
3488
  border-radius: var(--radius-lg);
@@ -30,6 +30,12 @@ export interface PostActionButtonProps {
30
30
  onReport?: () => void;
31
31
  /** Called when user confirms comment upvote with (author, permlink, percent). Frontend handles signing. Voted comments show icon in blue. */
32
32
  onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
33
+ /** Ecency image hosting token — enables image upload in comment composer */
34
+ ecencyToken?: string;
35
+ /** 3Speak API key — enables audio/video upload in comment composer */
36
+ threeSpeakApiKey?: string;
37
+ /** GIPHY API key — enables GIF search in comment composer */
38
+ giphyApiKey?: string;
33
39
  }
34
- export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, hiveIconUrl, payoutTooltip, initialVotes, initialCommentsCount, onUpvote, onSubmitComment, onComments, onReblog, onShare, onTip, onReport, onClickCommentUpvote, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
40
+ export declare function PostActionButton({ author, permlink, currentUser: currentUserProp, hiveValue, hiveIconUrl, payoutTooltip, initialVotes, initialCommentsCount, onUpvote, onSubmitComment, onComments, onReblog, onShare, onTip, onReport, onClickCommentUpvote, ecencyToken, threeSpeakApiKey, giphyApiKey, }: PostActionButtonProps): import("react/jsx-runtime").JSX.Element;
35
41
  export default PostActionButton;
@@ -1,10 +1,25 @@
1
- interface AddCommentInputProps {
1
+ export interface AddCommentInputProps {
2
2
  onSubmit: (body: string) => void;
3
3
  onCancel: () => void;
4
4
  currentUser?: string;
5
5
  placeholder?: string;
6
6
  parentAuthor?: string;
7
7
  parentPermlink?: string;
8
+ /** Ecency image hosting token — enables image and video thumbnail upload */
9
+ ecencyToken?: string;
10
+ /** 3Speak API key — enables audio and video upload. Falls back to demo key if not provided. */
11
+ threeSpeakApiKey?: string;
12
+ /** GIPHY API key — enables GIF search */
13
+ giphyApiKey?: string;
14
+ /** Hide individual toolbar features */
15
+ hideBold?: boolean;
16
+ hideItalic?: boolean;
17
+ hideLink?: boolean;
18
+ hideImage?: boolean;
19
+ hideAudio?: boolean;
20
+ hideVideo?: boolean;
21
+ hideEmoji?: boolean;
22
+ hideGif?: boolean;
8
23
  }
9
- declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink }: AddCommentInputProps) => import("react/jsx-runtime").JSX.Element;
24
+ declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, threeSpeakApiKey, giphyApiKey, hideBold, hideItalic, hideLink, hideImage, hideAudio, hideVideo, hideEmoji, hideGif, }: AddCommentInputProps) => import("react/jsx-runtime").JSX.Element;
10
25
  export default AddCommentInput;
@@ -11,6 +11,12 @@ interface CommentsModalProps {
11
11
  onClickUpvoteButton?: (currentUser?: string, token?: string) => void;
12
12
  /** When provided, used instead of apiService.handleComment (e.g. for aioha wallet) */
13
13
  onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => Promise<void>;
14
+ /** Ecency image hosting token — enables image upload in comment composer */
15
+ ecencyToken?: string;
16
+ /** 3Speak API key — enables audio/video upload in comment composer */
17
+ threeSpeakApiKey?: string;
18
+ /** GIPHY API key — enables GIF search in comment composer */
19
+ giphyApiKey?: string;
14
20
  }
15
- declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton, onSubmitComment }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
21
+ declare const CommentsModal: ({ author, permlink, onClose, currentUser, token, onClickCommentUpvote, onClickCommentReply, onClickUpvoteButton, onSubmitComment, ecencyToken, threeSpeakApiKey, giphyApiKey }: CommentsModalProps) => import("react/jsx-runtime").JSX.Element;
16
22
  export default CommentsModal;
@@ -4,6 +4,9 @@ interface ReplyModalProps {
4
4
  onClose: () => void;
5
5
  onCommentSubmitted: (parentAuthor: string, parentPermlink: string, body: string) => Promise<void>;
6
6
  currentUser?: string;
7
+ ecencyToken?: string;
8
+ threeSpeakApiKey?: string;
9
+ giphyApiKey?: string;
7
10
  }
8
- declare const ReplyModal: ({ parentAuthor, parentPermlink, onClose, onCommentSubmitted, currentUser }: ReplyModalProps) => import("react/jsx-runtime").JSX.Element;
11
+ declare const ReplyModal: ({ parentAuthor, parentPermlink, onClose, onCommentSubmitted, currentUser, ecencyToken, threeSpeakApiKey, giphyApiKey, }: ReplyModalProps) => import("react/jsx-runtime").JSX.Element;
9
12
  export default ReplyModal;
@@ -0,0 +1,12 @@
1
+ import React from 'react';
2
+ export interface AudioUploaderProps {
3
+ /** Called with the audio embed URL and duration in seconds */
4
+ onAudioUploaded: (audioUrl: string, durationSeconds: number) => void;
5
+ /** Hive username for the upload */
6
+ username?: string;
7
+ /** 3Speak API key. Falls back to demo key if not provided. */
8
+ threeSpeakApiKey?: string;
9
+ disabled?: boolean;
10
+ }
11
+ declare const AudioUploader: React.FC<AudioUploaderProps>;
12
+ export default AudioUploader;
@@ -0,0 +1,8 @@
1
+ import React from 'react';
2
+ export interface EmojiPickerProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ onSelectEmoji: (emoji: string) => void;
6
+ }
7
+ declare const EmojiPicker: React.FC<EmojiPickerProps>;
8
+ export default EmojiPicker;
@@ -0,0 +1,10 @@
1
+ import React from 'react';
2
+ export interface GiphyPickerProps {
3
+ isOpen: boolean;
4
+ onClose: () => void;
5
+ onSelectGif: (gifUrl: string) => void;
6
+ /** GIPHY API key. Required for search functionality. */
7
+ giphyApiKey?: string;
8
+ }
9
+ declare const GiphyPicker: React.FC<GiphyPickerProps>;
10
+ export default GiphyPicker;
@@ -0,0 +1,10 @@
1
+ import React from "react";
2
+ export interface ImageUploaderProps {
3
+ /** Called with the uploaded image URL */
4
+ onImageUploaded: (imageUrl: string) => void;
5
+ /** Ecency image hosting token for upload authentication */
6
+ ecencyToken?: string;
7
+ disabled?: boolean;
8
+ }
9
+ declare const ImageUploader: React.FC<ImageUploaderProps>;
10
+ export default ImageUploader;
@@ -0,0 +1,14 @@
1
+ import React from 'react';
2
+ export interface VideoUploaderProps {
3
+ /** Called with embed URL, upload URL, aspect ratio, and optional local file for preview */
4
+ onVideoUploaded: (videoEmbedUrl: string, uploadUrl: string, aspectRatio: string, localPreviewFile?: File) => void;
5
+ /** Hive username for the upload */
6
+ username?: string;
7
+ /** Ecency image hosting token for thumbnail upload */
8
+ ecencyToken?: string;
9
+ /** 3Speak API key. Falls back to demo key if not provided. */
10
+ threeSpeakApiKey?: string;
11
+ disabled?: boolean;
12
+ }
13
+ declare const VideoUploader: React.FC<VideoUploaderProps>;
14
+ export default VideoUploader;
@@ -0,0 +1,10 @@
1
+ export { default as ImageUploader } from './ImageUploader';
2
+ export type { ImageUploaderProps } from './ImageUploader';
3
+ export { default as AudioUploader } from './AudioUploader';
4
+ export type { AudioUploaderProps } from './AudioUploader';
5
+ export { default as VideoUploader } from './VideoUploader';
6
+ export type { VideoUploaderProps } from './VideoUploader';
7
+ export { default as GiphyPicker } from './GiphyPicker';
8
+ export type { GiphyPickerProps } from './GiphyPicker';
9
+ export { default as EmojiPicker } from './EmojiPicker';
10
+ export type { EmojiPickerProps } from './EmojiPicker';
@@ -12,6 +12,12 @@ export interface UserDetailProfileProps {
12
12
  * Example: `["followers", "following", "blogs", "wallet"]` — only these 4 tabs, in this order.
13
13
  */
14
14
  tabShown?: TabType[];
15
+ /** Ecency image hosting token — enables image and video thumbnail upload in comment composer */
16
+ ecencyToken?: string;
17
+ /** 3Speak API key — enables audio and video upload in comment composer */
18
+ threeSpeakApiKey?: string;
19
+ /** GIPHY API key — enables GIF search in comment composer */
20
+ giphyApiKey?: string;
15
21
  onFollow?: (username: string) => void | Promise<void>;
16
22
  onUnfollow?: (username: string) => void | Promise<void>;
17
23
  onIgnoreAuthor?: (username: string) => void | Promise<void>;