hive-react-kit 1.12.14 → 1.12.16

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.
@@ -31,6 +31,43 @@ export declare function getUserVoteWeight(votes: ActiveVote[] | null | undefined
31
31
  * content — curation isn't offered for posts/snaps/comments from other
32
32
  * apps. */
33
33
  export declare function isHiveSuiteContent(jsonMetadata: unknown): boolean;
34
+ export interface CurationEligibilityInput {
35
+ /** Is the logged-in user a curator at all? */
36
+ isCurator?: boolean | null;
37
+ /** Did the consumer actually wire up an `onCurationRequest` handler? */
38
+ hasCurationHandler: boolean;
39
+ currentUser?: string | null;
40
+ author: string;
41
+ votes?: ActiveVote[] | null;
42
+ jsonMetadata: unknown;
43
+ }
44
+ /**
45
+ * Whether the curation-request toggle/button should be offered at all, for
46
+ * this piece of content, to this logged-in user. This is the ONE place
47
+ * these checks live — every render site (blog list, post detail, profile
48
+ * tabs, snaps feed, inline comments) calls this instead of repeating the
49
+ * chain inline, so disabling a check means editing one function, not
50
+ * hunting through five call sites.
51
+ *
52
+ * Checked in order, numbered so an individual gate can be commented out:
53
+ * 1. Caller is a curator
54
+ * 2. A curation-request handler was actually wired up by the consumer
55
+ * 3. Caller isn't the curation bot itself (voting on its own request is a no-op)
56
+ * 4. Caller isn't the content's author (curators recommend OTHERS' content —
57
+ * recommending your own isn't curation, it's self-promotion; Hive still
58
+ * lets you vote for yourself in the same dialog, only the *request* is gated)
59
+ * 5. The curation bot hasn't already voted on this content
60
+ * 6. The content was actually published via the HiveSuite app
61
+ *
62
+ * Two more checks happen later, inside `<VoteSlider/>` itself, once the
63
+ * dialog is actually open — they need an async fetch so can't be computed
64
+ * synchronously here:
65
+ * 7. Author's KE ratio isn't over the configured max (MAX_AUTHOR_KE)
66
+ * 8. Content hasn't already been submitted for curation by another curator
67
+ * (`onFetchCurationStatus`)
68
+ * See VoteSlider.tsx.
69
+ */
70
+ export declare function isCurationEligible({ isCurator, hasCurationHandler, currentUser, author, votes, jsonMetadata, }: CurationEligibilityInput): boolean;
34
71
  /** True when the post has received at least one downvote / flag.
35
72
  * Prefer `stats.flag_weight` when available — Hive's canonical
36
73
  * signal — and fall back to scanning `active_votes` for negative
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hive-react-kit",
3
3
  "private": false,
4
- "version": "1.12.14",
4
+ "version": "1.12.16",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs.js",
7
7
  "module": "./dist/index.esm.js",