hive-react-kit 1.12.5 → 1.12.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 +10 -8
- package/dist/components/BlogPostList.d.ts +5 -4
- package/dist/components/HiveDetailPost.d.ts +6 -4
- package/dist/components/VoteSlider.d.ts +29 -13
- package/dist/components/actionButtons/PostActionButton.d.ts +4 -3
- package/dist/components/feed/SnapsFeedCard.d.ts +5 -4
- package/dist/components/feed/SnapsFeedView.d.ts +4 -2
- package/dist/components/inlineComments/InlineCommentItem.d.ts +5 -4
- package/dist/components/inlineComments/InlineCommentSection.d.ts +4 -2
- package/dist/components/user/ProfileSnapsTab.d.ts +4 -2
- package/dist/components/user/UserDetailProfile.d.ts +5 -4
- package/dist/index.cjs.js +182 -180
- package/dist/index.d.ts +0 -1
- package/dist/index.esm.js +19210 -19349
- package/dist/utils/postVotes.d.ts +8 -0
- package/package.json +1 -1
- package/dist/components/CurationButton.d.ts +0 -29
|
@@ -11,6 +11,14 @@ export declare function hasCurationVoterVoted(votes?: ActiveVote[] | null): bool
|
|
|
11
11
|
* slider won't reopen for content the user already voted on, curation
|
|
12
12
|
* needs a separate, vote-free entry point for that scenario. */
|
|
13
13
|
export declare function hasUserVoted(votes: ActiveVote[] | null | undefined, username: string | null | undefined): boolean;
|
|
14
|
+
/** The vote weight (0–100) `username` already cast on this content, or 0
|
|
15
|
+
* if they haven't voted. Companion to `hasUserVoted` — the curation
|
|
16
|
+
* request needs the curator's own vote weight reported alongside it,
|
|
17
|
+
* and in the already-voted flow (see `VoteSlider`'s `alreadyVoted` mode)
|
|
18
|
+
* that vote already happened, so it has to be read back from
|
|
19
|
+
* `active_votes` rather than captured live from a slider. Hive's raw
|
|
20
|
+
* `percent` field is basis points (10000 = 100%), hence the /100. */
|
|
21
|
+
export declare function getUserVoteWeight(votes: ActiveVote[] | null | undefined, username: string | null | undefined): number;
|
|
14
22
|
/** True when the content was published via the HiveSuite app. Checks,
|
|
15
23
|
* in order:
|
|
16
24
|
* - `json_metadata.app` names it (e.g. `"hivesuite/1.2.3"`)
|
package/package.json
CHANGED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
type CurationType = 'post' | 'snap' | 'comment';
|
|
2
|
-
interface CurationStatus {
|
|
3
|
-
maxWeight: number;
|
|
4
|
-
alreadySubmitted: boolean;
|
|
5
|
-
}
|
|
6
|
-
interface CurationButtonProps {
|
|
7
|
-
author: string;
|
|
8
|
-
permlink: string;
|
|
9
|
-
type: CurationType;
|
|
10
|
-
onCurationRequest: (author: string, permlink: string, weight: number) => void | Promise<void>;
|
|
11
|
-
/** Looks up the max slider weight for this content type, plus whether
|
|
12
|
-
* it's already been submitted for curation by any curator. Checked
|
|
13
|
-
* fresh every time the modal opens. */
|
|
14
|
-
onFetchCurationStatus?: (author: string, permlink: string, type: CurationType) => Promise<CurationStatus>;
|
|
15
|
-
}
|
|
16
|
-
/**
|
|
17
|
-
* Fallback curation entry point — for curators who already spent their
|
|
18
|
-
* own vote on this content (before the curation feature existed, or
|
|
19
|
-
* simply voted before deciding to curate). The vote slider's "Request
|
|
20
|
-
* curation" toggle can't help there since it never reopens once you've
|
|
21
|
-
* voted, so this is a separate, vote-free trigger.
|
|
22
|
-
*
|
|
23
|
-
* Only ever rendered by the caller when: `isCurator && onCurationRequest
|
|
24
|
-
* && isHiveSuiteContent(...) && !hasCurationVoterVoted(...) &&
|
|
25
|
-
* hasUserVoted(votes, currentUser)` — i.e. exactly the case the merged
|
|
26
|
-
* vote-slider flow can't cover.
|
|
27
|
-
*/
|
|
28
|
-
export declare function CurationButton({ author, permlink, type, onCurationRequest, onFetchCurationStatus }: CurationButtonProps): import("react/jsx-runtime").JSX.Element;
|
|
29
|
-
export {};
|