@peasant-labs/fairtrade 0.0.12 → 0.0.13

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.
@@ -3,7 +3,11 @@
3
3
  *
4
4
  * @param {object} props
5
5
  * @param {'minimal'|'standard'|'maximum'} [props.level='standard'] - the selected redaction level
6
- * @param {(level: string) => void} [props.onLevel] - called with the next level on select
6
+ * @param {readonly ('minimal'|'standard'|'maximum')[]} [props.availableLevels]
7
+ * - supported levels. choices use canonical order. one choice hides the selector; invalid or
8
+ * empty input throws an actionable TypeError before the review renders.
9
+ * @param {(level: 'minimal'|'standard'|'maximum') => void} [props.onLevel]
10
+ * - called only with an available level on select
7
11
  * @param {Array<{id, category, confidence:number, before?:string, secret?:string, after:string, kept?:boolean}>} [props.matches]
8
12
  * - the flagged matches. `before`/`secret` is the original (one or the other), `after` the
9
13
  * redacted form. `kept` (controlled mode) = the user opted OUT, secret leaves as-is.
@@ -14,9 +18,10 @@
14
18
  * @param {string|boolean} [props.failure] - honest-failure banner text; truthy shows the banner.
15
19
  * @param {string} [props.className]
16
20
  */
17
- export function RedactionReview({ level, onLevel, matches, onToggle, scanned, total, failure, className, ...rest }: {
21
+ export function RedactionReview({ level, availableLevels, onLevel, matches, onToggle, scanned, total, failure, className, ...rest }: {
18
22
  level?: "minimal" | "standard" | "maximum";
19
- onLevel?: (level: string) => void;
23
+ availableLevels?: readonly ("minimal" | "standard" | "maximum")[];
24
+ onLevel?: (level: "minimal" | "standard" | "maximum") => void;
20
25
  matches?: Array<{
21
26
  id: any;
22
27
  category: any;