hive-react-kit 0.8.4 → 0.8.6
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 +3 -0
- package/dist/components/comments/AddCommentInput.d.ts +11 -2
- package/dist/components/composer/ImageUploader.d.ts +9 -0
- package/dist/components/composer/VideoUploader.d.ts +3 -0
- package/dist/hooks/index.d.ts +1 -0
- package/dist/hooks/useHiveImageSign.d.ts +21 -0
- package/dist/index.cjs.js +121 -121
- package/dist/index.d.ts +2 -0
- package/dist/index.esm.js +10379 -10170
- package/dist/services/hiveImageUpload.d.ts +22 -0
- package/package.json +1 -1
package/dist/build.css
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type PostingSignMessageFn } from '../../services/hiveImageUpload';
|
|
2
3
|
export interface PostComposerProps {
|
|
3
4
|
onSubmit: (body: string) => void | boolean | Promise<void | boolean>;
|
|
4
5
|
onCancel?: () => void;
|
|
@@ -8,6 +9,10 @@ export interface PostComposerProps {
|
|
|
8
9
|
parentPermlink?: string;
|
|
9
10
|
/** Ecency image hosting token — enables image/video thumbnail upload and paste/drag upload */
|
|
10
11
|
ecencyToken?: string;
|
|
12
|
+
/** Optional signer used when Ecency image uploads fail. Signs a posting-key message for images.hive.blog. */
|
|
13
|
+
onSignMessage?: PostingSignMessageFn;
|
|
14
|
+
/** Hive username used for the signed images.hive.blog fallback upload. */
|
|
15
|
+
signingUsername?: string;
|
|
11
16
|
/** 3Speak API key — enables audio and video upload */
|
|
12
17
|
threeSpeakApiKey?: string;
|
|
13
18
|
/** GIPHY API key — enables GIF search */
|
|
@@ -62,11 +67,15 @@ export interface PostComposerProps {
|
|
|
62
67
|
borderColor?: string;
|
|
63
68
|
/** Disable auto-focus on mount (default false). Use when the composer is always visible and shouldn't steal scroll. */
|
|
64
69
|
disableAutoFocus?: boolean;
|
|
70
|
+
/** Text shown in blinking amber while waiting for wallet approval during the hive image fallback. */
|
|
71
|
+
walletApprovalLabel?: string;
|
|
72
|
+
/** When true, force the blinking wallet-approval banner on (e.g. during a post/reply broadcast). */
|
|
73
|
+
awaitingWalletApproval?: boolean;
|
|
65
74
|
}
|
|
66
75
|
/** @deprecated Use PostComposerProps instead */
|
|
67
76
|
export type AddCommentInputProps = PostComposerProps;
|
|
68
|
-
declare const PostComposer: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, 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, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
69
78
|
/** @deprecated Use PostComposer instead */
|
|
70
|
-
declare const AddCommentInput: ({ onSubmit, onCancel, currentUser, placeholder, parentAuthor, parentPermlink, ecencyToken, 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, }: PostComposerProps) => import("react/jsx-runtime").JSX.Element;
|
|
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;
|
|
71
80
|
export { PostComposer };
|
|
72
81
|
export default AddCommentInput;
|
|
@@ -1,9 +1,18 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
+
import { type PostingSignMessageFn } from "../../services/hiveImageUpload";
|
|
2
3
|
export interface ImageUploaderProps {
|
|
3
4
|
/** Called with the uploaded image URL */
|
|
4
5
|
onImageUploaded: (imageUrl: string) => void;
|
|
5
6
|
/** Ecency image hosting token for upload authentication */
|
|
6
7
|
ecencyToken?: string;
|
|
8
|
+
/** Optional signer used when the Ecency upload fails. Signs a posting-key message. */
|
|
9
|
+
onSignMessage?: PostingSignMessageFn;
|
|
10
|
+
/** Hive username used for the signed images.hive.blog fallback upload. */
|
|
11
|
+
signingUsername?: string;
|
|
12
|
+
/** Fires true while the caller's wallet signer is running (wallet approval window). */
|
|
13
|
+
onSigningStateChange?: (isSigning: boolean) => void;
|
|
14
|
+
/** Text shown in blinking amber while waiting for wallet approval during the hive image fallback. */
|
|
15
|
+
walletApprovalLabel?: string;
|
|
7
16
|
disabled?: boolean;
|
|
8
17
|
}
|
|
9
18
|
declare const ImageUploader: React.FC<ImageUploaderProps>;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
+
import { type PostingSignMessageFn } from '../../services/hiveImageUpload';
|
|
2
3
|
export interface VideoUploaderProps {
|
|
3
4
|
/** Called with embed URL, upload URL, aspect ratio, and optional local file for preview */
|
|
4
5
|
onVideoUploaded: (videoEmbedUrl: string, uploadUrl: string, aspectRatio: string, localPreviewFile?: File) => void;
|
|
@@ -6,6 +7,8 @@ export interface VideoUploaderProps {
|
|
|
6
7
|
username?: string;
|
|
7
8
|
/** Ecency image hosting token for thumbnail upload */
|
|
8
9
|
ecencyToken?: string;
|
|
10
|
+
/** Optional signer used when the Ecency thumbnail upload fails. */
|
|
11
|
+
onSignMessage?: PostingSignMessageFn;
|
|
9
12
|
/** 3Speak API key. Falls back to demo key if not provided. */
|
|
10
13
|
threeSpeakApiKey?: string;
|
|
11
14
|
disabled?: boolean;
|
package/dist/hooks/index.d.ts
CHANGED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { PostingSignMessageFn } from '../services/hiveImageUpload';
|
|
2
|
+
export interface HiveImageSignUser {
|
|
3
|
+
provider?: string | null;
|
|
4
|
+
privatePostingKey?: string;
|
|
5
|
+
}
|
|
6
|
+
export interface HiveImageSignSignerResult {
|
|
7
|
+
success: boolean;
|
|
8
|
+
result?: string;
|
|
9
|
+
error?: string;
|
|
10
|
+
errorCode?: number | string;
|
|
11
|
+
}
|
|
12
|
+
export interface HiveImageSignSigner {
|
|
13
|
+
signMessage: (message: string, keyType: any) => Promise<HiveImageSignSignerResult>;
|
|
14
|
+
}
|
|
15
|
+
export interface UseHiveImageSignOptions {
|
|
16
|
+
signer?: HiveImageSignSigner | null;
|
|
17
|
+
user?: HiveImageSignUser | null;
|
|
18
|
+
/** Providers whose signMessage preserves the Buffer-JSON shape. Override to include more. */
|
|
19
|
+
walletSupportedProviders?: Set<string>;
|
|
20
|
+
}
|
|
21
|
+
export declare function useHiveImageSign(options?: UseHiveImageSignOptions): PostingSignMessageFn;
|