hive-react-kit 0.10.5 → 0.10.7
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 -3
- package/dist/components/community/CommunityDetail.d.ts +16 -1
- package/dist/components/community/CommunitySnapsTab.d.ts +56 -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/index.cjs.js +186 -186
- package/dist/index.esm.js +18725 -18247
- package/dist/services/communityService.d.ts +33 -0
- package/package.json +1 -1
package/dist/build.css
CHANGED
|
@@ -709,9 +709,6 @@
|
|
|
709
709
|
.table {
|
|
710
710
|
display: table;
|
|
711
711
|
}
|
|
712
|
-
.aspect-\[4\/3\] {
|
|
713
|
-
aspect-ratio: 4/3;
|
|
714
|
-
}
|
|
715
712
|
.aspect-video {
|
|
716
713
|
aspect-ratio: var(--aspect-video);
|
|
717
714
|
}
|
|
@@ -796,6 +793,9 @@
|
|
|
796
793
|
.h-\[90vh\] {
|
|
797
794
|
height: 90vh;
|
|
798
795
|
}
|
|
796
|
+
.h-\[280px\] {
|
|
797
|
+
height: 280px;
|
|
798
|
+
}
|
|
799
799
|
.h-\[400px\] {
|
|
800
800
|
height: 400px;
|
|
801
801
|
}
|
|
@@ -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
|
}
|
|
@@ -856,6 +859,9 @@
|
|
|
856
859
|
.max-h-\[calc\(90vh-80px\)\] {
|
|
857
860
|
max-height: calc(90vh - 80px);
|
|
858
861
|
}
|
|
862
|
+
.max-h-full {
|
|
863
|
+
max-height: 100%;
|
|
864
|
+
}
|
|
859
865
|
.max-h-screen {
|
|
860
866
|
max-height: 100vh;
|
|
861
867
|
}
|
|
@@ -1474,6 +1480,12 @@
|
|
|
1474
1480
|
border-color: color-mix(in oklab, var(--color-amber-500) 30%, transparent);
|
|
1475
1481
|
}
|
|
1476
1482
|
}
|
|
1483
|
+
.border-amber-500\/40 {
|
|
1484
|
+
border-color: color-mix(in srgb, oklch(76.9% 0.188 70.08) 40%, transparent);
|
|
1485
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
1486
|
+
border-color: color-mix(in oklab, var(--color-amber-500) 40%, transparent);
|
|
1487
|
+
}
|
|
1488
|
+
}
|
|
1477
1489
|
.border-amber-700\/40 {
|
|
1478
1490
|
border-color: color-mix(in srgb, oklch(55.5% 0.163 48.998) 40%, transparent);
|
|
1479
1491
|
@supports (color: color-mix(in lab, red, red)) {
|
|
@@ -3127,6 +3139,16 @@
|
|
|
3127
3139
|
}
|
|
3128
3140
|
}
|
|
3129
3141
|
}
|
|
3142
|
+
.hover\:bg-amber-500\/15 {
|
|
3143
|
+
&:hover {
|
|
3144
|
+
@media (hover: hover) {
|
|
3145
|
+
background-color: color-mix(in srgb, oklch(76.9% 0.188 70.08) 15%, transparent);
|
|
3146
|
+
@supports (color: color-mix(in lab, red, red)) {
|
|
3147
|
+
background-color: color-mix(in oklab, var(--color-amber-500) 15%, transparent);
|
|
3148
|
+
}
|
|
3149
|
+
}
|
|
3150
|
+
}
|
|
3151
|
+
}
|
|
3130
3152
|
.hover\:bg-black {
|
|
3131
3153
|
&:hover {
|
|
3132
3154
|
@media (hover: hover) {
|
|
@@ -3431,6 +3453,13 @@
|
|
|
3431
3453
|
}
|
|
3432
3454
|
}
|
|
3433
3455
|
}
|
|
3456
|
+
.hover\:text-gray-200 {
|
|
3457
|
+
&:hover {
|
|
3458
|
+
@media (hover: hover) {
|
|
3459
|
+
color: var(--color-gray-200);
|
|
3460
|
+
}
|
|
3461
|
+
}
|
|
3462
|
+
}
|
|
3434
3463
|
.hover\:text-gray-300 {
|
|
3435
3464
|
&:hover {
|
|
3436
3465
|
@media (hover: hover) {
|
|
@@ -29,8 +29,23 @@ export interface CommunityDetailProps {
|
|
|
29
29
|
* flag) into a single 3-dot kebab menu inside the embedded
|
|
30
30
|
* `<BlogPostList/>`. */
|
|
31
31
|
actionsAsMenu?: boolean;
|
|
32
|
+
/** @deprecated The Snaps tab now uses the kit's built-in
|
|
33
|
+
* CommunitySnapsTab (multi-container SnapsFeedView). This prop is
|
|
34
|
+
* retained for backward compatibility but no longer consumed. */
|
|
35
|
+
loadCommunitySnaps?: (communityId: string, cursor?: {
|
|
36
|
+
author: string;
|
|
37
|
+
permlink: string;
|
|
38
|
+
}) => Promise<import('@/types/post').Post[]>;
|
|
39
|
+
/** Authors the user has reported / muted — forwarded into the snaps
|
|
40
|
+
* tab so their snaps drop out of the per-card list. */
|
|
41
|
+
reportedAuthors?: string[];
|
|
42
|
+
/** Reported posts (author + permlink pairs) — same purpose. */
|
|
43
|
+
reportedPosts?: {
|
|
44
|
+
author: string;
|
|
45
|
+
permlink: string;
|
|
46
|
+
}[];
|
|
32
47
|
onShare?: () => void;
|
|
33
48
|
onRss?: () => void;
|
|
34
49
|
}
|
|
35
|
-
declare const CommunityDetail: ({ communityId, currentUser, onBack, onUserClick, onPostClick, onCommentClick, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onTip, onSharePost, onReportPost, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, defaultVotePercent, voteWeightStep, allowLandscapeVideos, defaultReward, actionsAsMenu, onShare, onRss, }: CommunityDetailProps) => import("react/jsx-runtime").JSX.Element;
|
|
50
|
+
declare const CommunityDetail: ({ communityId, currentUser, onBack, onUserClick, onPostClick, onCommentClick, onUpvote, onSubmitComment, onClickCommentUpvote, onReblog, onTip, onSharePost, onReportPost, ecencyToken, threeSpeakApiKey, giphyApiKey, templateToken, templateApiBaseUrl, defaultVotePercent, voteWeightStep, allowLandscapeVideos, defaultReward, actionsAsMenu, onShare, onRss, loadCommunitySnaps: _loadCommunitySnaps, reportedAuthors, reportedPosts, }: CommunityDetailProps) => import("react/jsx-runtime").JSX.Element;
|
|
36
51
|
export default CommunityDetail;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* CommunitySnapsTab — Snaps tab body for the community-detail page.
|
|
3
|
+
*
|
|
4
|
+
* Mirrors `ProfileSnapsTab` so a community renders the same 1-col-mobile
|
|
5
|
+
* / 4-col-desktop snaps layout as the unified Snaps page. Each of the
|
|
6
|
+
* four container types (peak.snaps · ecency.waves · leothreads ·
|
|
7
|
+
* liketu.moments) gets its own slot, fetched in parallel from
|
|
8
|
+
* `communityService.getCommunitySnaps` and filtered to the current
|
|
9
|
+
* community.
|
|
10
|
+
*
|
|
11
|
+
* The kit's CommunityDetail used to render the snaps tab as a flat
|
|
12
|
+
* `<BlogPostList/>` driven by ranked-posts; this swaps in the rich
|
|
13
|
+
* snaps UI (swipeable image carousels, inline composer, per-feed
|
|
14
|
+
* pagination) so community snaps look and behave exactly like the
|
|
15
|
+
* profile-level snaps tab.
|
|
16
|
+
*/
|
|
17
|
+
import { type ReactNode } from 'react';
|
|
18
|
+
import type { Post } from '@/types/post';
|
|
19
|
+
import type { RewardOption } from '../../utils/commentOptions';
|
|
20
|
+
export interface CommunitySnapsTabProps {
|
|
21
|
+
communityId: string;
|
|
22
|
+
currentUser?: string;
|
|
23
|
+
reportedPosts?: {
|
|
24
|
+
author: string;
|
|
25
|
+
permlink: string;
|
|
26
|
+
}[];
|
|
27
|
+
reportedAuthors?: string[];
|
|
28
|
+
onUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
29
|
+
onSubmitComment?: (parentAuthor: string, parentPermlink: string, body: string) => void | Promise<void>;
|
|
30
|
+
onClickCommentUpvote?: (author: string, permlink: string, percent: number) => void | Promise<void>;
|
|
31
|
+
onReblog?: (author: string, permlink: string) => void;
|
|
32
|
+
onTip?: (author: string, permlink: string) => void;
|
|
33
|
+
onSharePost?: (author: string, permlink: string) => void;
|
|
34
|
+
onCommentClick?: (author: string, permlink: string) => void;
|
|
35
|
+
onClickCommentIcon?: (author: string, permlink: string) => void;
|
|
36
|
+
onClickCommentCount?: (author: string, permlink: string) => void;
|
|
37
|
+
onReportPost?: (author: string, permlink: string) => void;
|
|
38
|
+
onUserClick?: (username: string) => void;
|
|
39
|
+
onPostClick?: (author: string, permlink: string, title?: string) => void;
|
|
40
|
+
ecencyToken?: string;
|
|
41
|
+
threeSpeakApiKey?: string;
|
|
42
|
+
giphyApiKey?: string;
|
|
43
|
+
templateToken?: string;
|
|
44
|
+
templateApiBaseUrl?: string;
|
|
45
|
+
defaultVotePercent?: number;
|
|
46
|
+
voteWeightStep?: number;
|
|
47
|
+
allowLandscapeVideos?: boolean;
|
|
48
|
+
defaultReward?: RewardOption;
|
|
49
|
+
/** Per-card right-side header action menu slot. */
|
|
50
|
+
renderHeaderActions?: (post: Post) => ReactNode;
|
|
51
|
+
/** Collapse the per-card secondary actions (reblog · share · tip ·
|
|
52
|
+
* flag) into a single 3-dot kebab. Forwarded into <SnapsFeedView/>. */
|
|
53
|
+
actionsAsMenu?: boolean;
|
|
54
|
+
}
|
|
55
|
+
declare const CommunitySnapsTab: React.FC<CommunitySnapsTabProps>;
|
|
56
|
+
export default CommunitySnapsTab;
|
|
@@ -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;
|