hive-react-kit 0.10.4 → 0.10.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 +26 -0
- package/dist/components/composer/ParentPostComposer.d.ts +6 -0
- package/dist/components/composer/PollCreator.d.ts +33 -0
- package/dist/components/feed/SnapsFeedView.d.ts +8 -1
- package/dist/components/user/UserDetailProfile.d.ts +7 -0
- package/dist/i18n/messages.d.ts +1 -1
- package/dist/index.cjs.js +182 -182
- package/dist/index.esm.js +18188 -17877
- package/dist/services/userService.d.ts +6 -0
- package/package.json +1 -1
package/dist/build.css
CHANGED
|
@@ -826,6 +826,9 @@
|
|
|
826
826
|
.max-h-64 {
|
|
827
827
|
max-height: calc(var(--spacing) * 64);
|
|
828
828
|
}
|
|
829
|
+
.max-h-72 {
|
|
830
|
+
max-height: calc(var(--spacing) * 72);
|
|
831
|
+
}
|
|
829
832
|
.max-h-96 {
|
|
830
833
|
max-height: calc(var(--spacing) * 96);
|
|
831
834
|
}
|
|
@@ -1474,6 +1477,12 @@
|
|
|
1474
1477
|
border-color: color-mix(in oklab, var(--color-amber-500) 30%, transparent);
|
|
1475
1478
|
}
|
|
1476
1479
|
}
|
|
1480
|
+
.border-amber-500\/40 {
|
|
1481
|
+
border-color: color-mix(in srgb, oklch(76.9% 0.188 70.08) 40%, transparent);
|
|
1482
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1483
|
+
border-color: color-mix(in oklab, var(--color-amber-500) 40%, transparent);
|
|
1484
|
+
}
|
|
1485
|
+
}
|
|
1477
1486
|
.border-amber-700\/40 {
|
|
1478
1487
|
border-color: color-mix(in srgb, oklch(55.5% 0.163 48.998) 40%, transparent);
|
|
1479
1488
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -3127,6 +3136,16 @@
|
|
|
3127
3136
|
}
|
|
3128
3137
|
}
|
|
3129
3138
|
}
|
|
3139
|
+
.hover\:bg-amber-500\/15 {
|
|
3140
|
+
&:hover {
|
|
3141
|
+
@media (hover: hover) {
|
|
3142
|
+
background-color: color-mix(in srgb, oklch(76.9% 0.188 70.08) 15%, transparent);
|
|
3143
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3144
|
+
background-color: color-mix(in oklab, var(--color-amber-500) 15%, transparent);
|
|
3145
|
+
}
|
|
3146
|
+
}
|
|
3147
|
+
}
|
|
3148
|
+
}
|
|
3130
3149
|
.hover\:bg-black {
|
|
3131
3150
|
&:hover {
|
|
3132
3151
|
@media (hover: hover) {
|
|
@@ -3431,6 +3450,13 @@
|
|
|
3431
3450
|
}
|
|
3432
3451
|
}
|
|
3433
3452
|
}
|
|
3453
|
+
.hover\:text-gray-200 {
|
|
3454
|
+
&:hover {
|
|
3455
|
+
@media (hover: hover) {
|
|
3456
|
+
color: var(--color-gray-200);
|
|
3457
|
+
}
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3434
3460
|
.hover\:text-gray-300 {
|
|
3435
3461
|
&:hover {
|
|
3436
3462
|
@media (hover: hover) {
|
|
@@ -85,6 +85,12 @@ export interface ParentPostComposerProps {
|
|
|
85
85
|
hideTags?: boolean;
|
|
86
86
|
hideReward?: boolean;
|
|
87
87
|
hideBeneficiaries?: boolean;
|
|
88
|
+
/** Force the publisher to attach a poll. When `true`, Publish stays
|
|
89
|
+
* disabled with a "poll required" hint until `pollData` is set, and an
|
|
90
|
+
* inline warning banner appears above the toolbar. Use this when the
|
|
91
|
+
* composer is dedicated to poll creation (e.g. the Polls screen) so
|
|
92
|
+
* users can't accidentally publish a regular parent post. */
|
|
93
|
+
requirePoll?: boolean;
|
|
88
94
|
/** Allow landscape videos (default true on the parent post composer). */
|
|
89
95
|
allowLandscapeVideos?: boolean;
|
|
90
96
|
/**
|
|
@@ -1,4 +1,31 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Poll attachment editor for ParentPostComposer.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors the feature set of the standalone hPolls "Create Poll" surface so
|
|
5
|
+
* a poll attached from the kit composer is indistinguishable on-chain from
|
|
6
|
+
* one published by hPolls itself: vote-interpretation engines (Number of
|
|
7
|
+
* Votes / HIVE→HP / Splinterlands / Arcade Colony / GLX / Hive-Engine
|
|
8
|
+
* tokens), a short preview description, max-choice slider, voter-change
|
|
9
|
+
* toggle, minimum account age, hide-results-until-voted, and the
|
|
10
|
+
* community-restricted flag.
|
|
11
|
+
*
|
|
12
|
+
* The component returns a `PollData` object whose shape matches what the
|
|
13
|
+
* Hive comment metadata expects (`preferred_interpretation`, `choices`,
|
|
14
|
+
* `end_time`, etc.) so consumers can inline it into `json_metadata`
|
|
15
|
+
* without further mapping.
|
|
16
|
+
*/
|
|
1
17
|
import React from 'react';
|
|
18
|
+
/** Curated list of vote-weight interpretation engines hPolls supports. */
|
|
19
|
+
export declare const POLL_VOTE_INTERPRETATIONS: ReadonlyArray<{
|
|
20
|
+
key: string;
|
|
21
|
+
label: string;
|
|
22
|
+
}>;
|
|
23
|
+
/** Hive-Engine tokens (and stake variants) that hPolls can interpret. The
|
|
24
|
+
* key follows the same `token_he_<slug>` pattern hPolls broadcasts. */
|
|
25
|
+
export declare const POLL_HE_VOTE_INTERPRETATIONS: ReadonlyArray<{
|
|
26
|
+
key: string;
|
|
27
|
+
label: string;
|
|
28
|
+
}>;
|
|
2
29
|
export interface PollData {
|
|
3
30
|
question: string;
|
|
4
31
|
choices: string[];
|
|
@@ -9,6 +36,12 @@ export interface PollData {
|
|
|
9
36
|
account_age: number;
|
|
10
37
|
};
|
|
11
38
|
ui_hide_res_until_voted: boolean;
|
|
39
|
+
/** Short user-facing summary surfaced by some clients above the choices. */
|
|
40
|
+
description?: string;
|
|
41
|
+
/** Engine key used to weight votes (`number_of_votes`, `token_hive_hp`, …). */
|
|
42
|
+
preferred_interpretation?: string;
|
|
43
|
+
/** Restrict voting to community members. Maps to `community_restricted`. */
|
|
44
|
+
community_restricted?: boolean;
|
|
12
45
|
}
|
|
13
46
|
export interface PollCreatorProps {
|
|
14
47
|
isOpen: boolean;
|
|
@@ -79,6 +79,13 @@ export interface SnapsFeedViewProps {
|
|
|
79
79
|
* flag) into a single 3-dot kebab menu. Forwarded to every
|
|
80
80
|
* <SnapsFeedCard/>. */
|
|
81
81
|
actionsAsMenu?: boolean;
|
|
82
|
+
/** When `true`, the desktop 4-column layout grows naturally with its
|
|
83
|
+
* content instead of pinning each column to a fixed-height per-column
|
|
84
|
+
* scroller. Use this when the parent page already provides a single
|
|
85
|
+
* scroll surface (e.g. a wrapping `overflow-y-auto`) so users get one
|
|
86
|
+
* page-level scrollbar instead of four independent ones. Column
|
|
87
|
+
* headers stay visible via `sticky top-0`. Mobile is unaffected. */
|
|
88
|
+
pageScroll?: boolean;
|
|
82
89
|
}
|
|
83
|
-
export declare function SnapsFeedView({ feeds, labels, avatars, defaultPrimary, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onTip, onSharePost, onCommentClick, onClickCommentIcon, onClickCommentCount, onReportPost, onUserClick, onPostClick, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, defaultVotePercent, voteWeightStep, allowLandscapeVideos, defaultReward, toolbar, footer, renderHeaderActions, actionsAsMenu, }: SnapsFeedViewProps): import("react/jsx-runtime").JSX.Element;
|
|
90
|
+
export declare function SnapsFeedView({ feeds, labels, avatars, defaultPrimary, currentUser, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onTip, onSharePost, onCommentClick, onClickCommentIcon, onClickCommentCount, onReportPost, onUserClick, onPostClick, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, defaultVotePercent, voteWeightStep, allowLandscapeVideos, defaultReward, toolbar, footer, renderHeaderActions, actionsAsMenu, pageScroll, }: SnapsFeedViewProps): import("react/jsx-runtime").JSX.Element;
|
|
84
91
|
export default SnapsFeedView;
|
|
@@ -34,6 +34,13 @@ export interface UserDetailProfileProps {
|
|
|
34
34
|
onUnfollow?: (username: string) => void | Promise<void>;
|
|
35
35
|
onIgnoreAuthor?: (username: string) => void | Promise<void>;
|
|
36
36
|
onReportUser?: (username: string, reason: string) => void | Promise<void>;
|
|
37
|
+
/** Mute a user — broadcasts the `follow` custom_json with `what: ["ignore"]`.
|
|
38
|
+
* When wired alongside `onUnmute`, the 3-dot menu shows a Mute / Unmute
|
|
39
|
+
* toggle for non-self profiles. Return `false` to indicate cancellation
|
|
40
|
+
* (keychain denied) — the local state will not flip. */
|
|
41
|
+
onMute?: (username: string) => void | boolean | Promise<void | boolean>;
|
|
42
|
+
/** Unmute — same custom_json with `what: []` (clears the ignore). */
|
|
43
|
+
onUnmute?: (username: string) => void | boolean | Promise<void | boolean>;
|
|
37
44
|
onUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
38
45
|
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => void | Promise<void>;
|
|
39
46
|
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
package/dist/i18n/messages.d.ts
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* Missing keys for a non-English language fall back to the English entry,
|
|
16
16
|
* which is the source of truth for every label.
|
|
17
17
|
*/
|
|
18
|
-
export type KitMessageKey = "tab.blogs" | "tab.posts" | "tab.snaps" | "tab.polls" | "tab.comments" | "tab.replies" | "tab.activities" | "tab.authorRewards" | "tab.curationRewards" | "tab.growth" | "tab.followers" | "tab.following" | "tab.wallet" | "tab.votingPower" | "tab.badges" | "tab.witnessVotes" | "meta.followers" | "meta.following" | "meta.posts" | "action.follow" | "action.unfollow" | "action.ignoreAuthor" | "action.reportUser" | "action.shareProfile" | "action.cancel" | "action.confirmIgnore" | "action.processing" | "modal.ignoreAuthorTitle" | "modal.ignoreAuthorBody" | "empty.noBlogs" | "empty.noPosts" | "empty.noSnaps" | "empty.noPolls" | "empty.noComments" | "empty.noReplies" | "empty.noFollowers" | "empty.notFollowing" | "empty.noBadges" | "empty.noWitnessVotes" | "empty.noPendingAuthor" | "empty.noPendingCuration" | "empty.curationHint" | "empty.votingPowerUnavailable" | "empty.userNotFound" | "status.active" | "status.ended" | "poll.selectAnOption" | "poll.selectUpTo" | "poll.changeYourVote" | "poll.selected" | "poll.submitVote" | "poll.submitVotes" | "poll.changeVote" | "poll.submitting" | "poll.voted" | "poll.voteChangesAllowed" | "poll.voter" | "poll.voters" | "poll.option" | "poll.options" | "poll.endsIn" | "common.translating" | "common.processing" | "common.fullyCharged" | "reward.pendingAuthor" | "reward.pendingCuration" | "reward.posts" | "reward.comments" | "reward.totalHbd" | "reward.totalHp" | "reward.avgEfficiency" | "reward.post" | "reward.comment" | "vp.upvotePower" | "vp.downvotePower" | "vp.resourceCredits";
|
|
18
|
+
export type KitMessageKey = "tab.blogs" | "tab.posts" | "tab.snaps" | "tab.polls" | "tab.comments" | "tab.replies" | "tab.activities" | "tab.authorRewards" | "tab.curationRewards" | "tab.growth" | "tab.followers" | "tab.following" | "tab.wallet" | "tab.votingPower" | "tab.badges" | "tab.witnessVotes" | "meta.followers" | "meta.following" | "meta.posts" | "action.follow" | "action.unfollow" | "action.ignoreAuthor" | "action.mute" | "action.unmute" | "action.reportUser" | "action.shareProfile" | "action.cancel" | "action.confirmIgnore" | "action.processing" | "modal.ignoreAuthorTitle" | "modal.ignoreAuthorBody" | "empty.noBlogs" | "empty.noPosts" | "empty.noSnaps" | "empty.noPolls" | "empty.noComments" | "empty.noReplies" | "empty.noFollowers" | "empty.notFollowing" | "empty.noBadges" | "empty.noWitnessVotes" | "empty.noPendingAuthor" | "empty.noPendingCuration" | "empty.curationHint" | "empty.votingPowerUnavailable" | "empty.userNotFound" | "status.active" | "status.ended" | "poll.selectAnOption" | "poll.selectUpTo" | "poll.changeYourVote" | "poll.selected" | "poll.submitVote" | "poll.submitVotes" | "poll.changeVote" | "poll.submitting" | "poll.voted" | "poll.voteChangesAllowed" | "poll.voter" | "poll.voters" | "poll.option" | "poll.options" | "poll.endsIn" | "common.translating" | "common.processing" | "common.fullyCharged" | "reward.pendingAuthor" | "reward.pendingCuration" | "reward.posts" | "reward.comments" | "reward.totalHbd" | "reward.totalHp" | "reward.avgEfficiency" | "reward.post" | "reward.comment" | "vp.upvotePower" | "vp.downvotePower" | "vp.resourceCredits";
|
|
19
19
|
export type KitMessages = Partial<Record<KitMessageKey, string>>;
|
|
20
20
|
export declare const BUILTIN_MESSAGES: Record<string, Record<string, string>>;
|
|
21
21
|
/**
|