@peasant-labs/fairtrade 0.0.27 → 0.0.28

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.
@@ -108,7 +108,7 @@ export function CollectivePicker({ suggestions, onAdd, query: queryProp, onQuery
108
108
  * @param {string} props.title - the session title, kept in its case.
109
109
  * @param {'publish'|'update'} [props.mode='publish']
110
110
  * @param {PublishDialogState} props.state - one of PUBLISH_DIALOG_STATES.
111
- * @param {{ matches?: object[], matchCount?: number, total?: number, failure?: string }} [props.scan] - the host's scan result. `matchCount` is the full occurrence count when `matches` contains only examples. Until it carries a
111
+ * @param {{ matches?: import('./Redaction.jsx').RedactionMatch[], matchCount?: number, total?: number, failure?: string }} [props.scan] - the host's scan result. `matchCount` is the full occurrence count when `matches` contains only examples. Until it carries a
112
112
  * `matches` list, the popup says the transcript is not scanned and keeps publish off. A match with `kept: true` leaves un-redacted, and the
113
113
  * popup says so and opens the matches.
114
114
  * @param {() => void} [props.onRescan]
@@ -124,17 +124,18 @@ export function CollectivePicker({ suggestions, onAdd, query: queryProp, onQuery
124
124
  * @param {() => void} [props.onConnect] - `continue with github`.
125
125
  * @param {string} [props.joinHref] - `create or join one on village`.
126
126
  * @param {string} [props.stoppedAt] - the step that failed, in words ("setting who can read it").
127
- * @param {() => void} [props.onRetry]
127
+ * @param {() => void} [props.onRecover] - stopped-state prerequisite read/sign-in recovery only; may run before a scan or audience exists, but never with an explicitly refused review. Mutually exclusive with onRetry. Must not publish.
128
+ * @param {() => void} [props.onRetry] - stopped-state actual publication retry; requires a valid review and audience. Mutually exclusive with onRecover.
128
129
  * @param {{ url: string, collectives: string[], pending?: string[], pullRequest?: { number: number, branch: string, href?: string } }} [props.done]
129
130
  */
130
- export function PublishDialog({ open, onClose, title, mode, state, scan, onRescan, changes, access, onRemove, onRestore, picker, autoPublish, accessSummary, primaryLabel, onPublish, onConnect, joinHref, stoppedAt, onRetry, done, }: {
131
+ export function PublishDialog({ open, onClose, title, mode, state, scan, onRescan, changes, access, onRemove, onRestore, picker, autoPublish, accessSummary, primaryLabel, onPublish, onConnect, joinHref, stoppedAt, onRecover, onRetry, done, }: {
131
132
  open: boolean;
132
133
  onClose: () => void;
133
134
  title: string;
134
135
  mode?: "publish" | "update";
135
136
  state: PublishDialogState;
136
137
  scan?: {
137
- matches?: object[];
138
+ matches?: import("./Redaction.jsx").RedactionMatch[];
138
139
  matchCount?: number;
139
140
  total?: number;
140
141
  failure?: string;
@@ -158,6 +159,7 @@ export function PublishDialog({ open, onClose, title, mode, state, scan, onResca
158
159
  onConnect?: () => void;
159
160
  joinHref?: string;
160
161
  stoppedAt?: string;
162
+ onRecover?: () => void;
161
163
  onRetry?: () => void;
162
164
  done?: {
163
165
  url: string;
@@ -1,3 +1,4 @@
1
+ /** @typedef {{id:string, category: import('@peasant-labs/schema').RedactionCategory, confidence:number, before?:string, secret?:string, after:string, kept?:boolean}} RedactionMatch */
1
2
  /**
2
3
  * RedactionReview — the safe-by-default review surface.
3
4
  *
@@ -8,7 +9,7 @@
8
9
  * empty input throws an actionable TypeError before the review renders.
9
10
  * @param {(level: 'minimal'|'standard'|'maximum') => void} [props.onLevel]
10
11
  * - called only with an available level on select
11
- * @param {Array<{id, category: import('./redaction-categories.js').RedactionCategory, confidence:number, before?:string, secret?:string, after:string, kept?:boolean}>} [props.matches]
12
+ * @param {RedactionMatch[]} [props.matches]
12
13
  * - the flagged matches. `before`/`secret` is the original (one or the other), `after` the
13
14
  * redacted form. `kept` (controlled mode) = the user opted OUT, secret leaves as-is.
14
15
  * @param {(id: string, kept: boolean) => void} [props.onToggle] - called when a match is toggled;
@@ -24,15 +25,7 @@ export function RedactionReview({ level, availableLevels, onLevel, matches, onTo
24
25
  level?: "minimal" | "standard" | "maximum";
25
26
  availableLevels?: readonly ("minimal" | "standard" | "maximum")[];
26
27
  onLevel?: (level: "minimal" | "standard" | "maximum") => void;
27
- matches?: Array<{
28
- id: any;
29
- category: import("./redaction-categories.js").RedactionCategory;
30
- confidence: number;
31
- before?: string;
32
- secret?: string;
33
- after: string;
34
- kept?: boolean;
35
- }>;
28
+ matches?: RedactionMatch[];
36
29
  onToggle?: (id: string, kept: boolean) => void;
37
30
  scanned?: number;
38
31
  total?: number;
@@ -59,3 +52,12 @@ export function WhereDoesThisGo({ destination, sent, private: stays, className,
59
52
  className?: string;
60
53
  }): import("react").JSX.Element;
61
54
  export default RedactionReview;
55
+ export type RedactionMatch = {
56
+ id: string;
57
+ category: import("@peasant-labs/schema").RedactionCategory;
58
+ confidence: number;
59
+ before?: string;
60
+ secret?: string;
61
+ after: string;
62
+ kept?: boolean;
63
+ };
@@ -65,3 +65,4 @@ export { PublishStateLabel, PublishBar, AccessList, CollectivePicker, PublishDia
65
65
  export { SettingRow, SettingGroup, SettingStatus, SETTING_ROW_STATES } from "./Settings.jsx";
66
66
  export { default as VisibilitySegmented, VisibilityEye, ScopeChip, FocusedModeToggle } from "./VisibilityControl.jsx";
67
67
  export { default as InUseShell, GraphAppShell, GraphSectionNav, IN_USE_APPS, LOCAL_APP_SECTIONS, GRAPH_APP_SECTIONS } from "./inuse/InUseShell.jsx";
68
+ export { RedactionCategory, RedactionCategoryLabel, AllRedactionCategories, AllRedactionCategoryLabels, isRedactionCategory, parseRedactionCategory, parseRedactionCategoryLabel, redactionCategoryFromLabel, redactionCategoryLabel } from "@peasant-labs/schema";
@@ -1,17 +1,2 @@
1
- /** @typedef {'secrets'|'pii'|'paths'|'project'} RedactionCategory */
2
- /** @param {unknown} category */
3
- export function redactionCategoryLabel(category: unknown): any;
4
1
  /** @param {unknown} matches */
5
2
  export function hasKnownRedactionCategories(matches: unknown): boolean;
6
- /**
7
- * Audited JS projection of github.com/peasant-labs/redact/category_string.go:
8
- * Category.String maps wire categories to these exact rendered labels.
9
- * Unknown input is never a trusted category or a display-label fallback.
10
- */
11
- export const REDACTION_CATEGORY_LABELS: Readonly<{
12
- secrets: "CREDENTIAL";
13
- pii: "PII";
14
- paths: "PATH";
15
- project: "INTERNAL";
16
- }>;
17
- export type RedactionCategory = "secrets" | "pii" | "paths" | "project";