@peasant-labs/fairtrade 0.0.36 → 0.0.37
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/lib/commons.js +7 -18
- package/dist/lib/components.css +1 -1
- package/dist/lib/tokens.css +1 -0
- package/dist/lib/tokens.json +4 -0
- package/dist/lib/types/AppSidebar.d.ts +16 -8
- package/dist/lib/types/CliOnboard.d.ts +7 -1
- package/dist/lib/types/Publish.d.ts +20 -3
- package/dist/lib/types/Settings.d.ts +4 -1
- package/dist/lib/{ui-CfdUlwCE.js → ui-DoMWMsXK.js} +2069 -2016
- package/dist/lib/ui.js +1 -1
- package/package.json +1 -1
package/dist/lib/tokens.css
CHANGED
package/dist/lib/tokens.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The shared app sidebar, in one order for every app: the brand mark with a collapse handle on the
|
|
3
3
|
* column's edge, the caller's nav groups, search, the switcher to the other apps, then the footer
|
|
4
|
-
* (the theme toggle
|
|
4
|
+
* row (the account on the left, the theme toggle on the right). A sticky resizable column on desktop
|
|
5
5
|
* that collapses to an icon rail; a top bar plus an opaque drawer below 768px.
|
|
6
6
|
* @param {AppSidebarProps} props
|
|
7
7
|
*/
|
|
@@ -24,8 +24,10 @@ export function AppPage({ children, as: Tag, className, ...rest }: AppPageProps)
|
|
|
24
24
|
* @property {string} id 'online' | 'local' | 'docs', or another app id (shown with a generic icon).
|
|
25
25
|
* @property {string} label the switcher label.
|
|
26
26
|
* @property {string} [href] where the app lives. An app without an href is omitted, unless it has a tag.
|
|
27
|
-
* @property {string} [tag] a short note after the label
|
|
28
|
-
*
|
|
27
|
+
* @property {string} [tag] a short note after the label. With no href the entry is shown as text, not a link.
|
|
28
|
+
* @property {boolean} [soon] a place that does not exist yet: shown as text, aria-disabled, with a 'soon' note
|
|
29
|
+
* and no hover or press. The switcher always ends with community as soon unless
|
|
30
|
+
* `apps` names a community entry of its own.
|
|
29
31
|
* @property {string} [target] default '_blank': another app opens in a new tab.
|
|
30
32
|
* @property {string} [rel] default 'noopener noreferrer' when the target is '_blank'.
|
|
31
33
|
*/
|
|
@@ -64,7 +66,7 @@ export function AppPage({ children, as: Tag, className, ...rest }: AppPageProps)
|
|
|
64
66
|
*/
|
|
65
67
|
/**
|
|
66
68
|
* @typedef {Object} AppSidebarProps
|
|
67
|
-
* @property {'online'|'local'|'docs'|string} app which app renders the sidebar; its own switcher entry is left out.
|
|
69
|
+
* @property {'online'|'local'|'docs'|string} app which app renders the sidebar; its own switcher entry is left out, and online and local never show.
|
|
68
70
|
* @property {AppSidebarApp[]} [apps] the app switcher entries (default APP_SIDEBAR_APPS, no hrefs).
|
|
69
71
|
* @property {AppSidebarGroup[]} groups
|
|
70
72
|
* @property {string} [currentId] the id of the current item (aria-current="page").
|
|
@@ -98,7 +100,8 @@ export function AppPage({ children, as: Tag, className, ...rest }: AppPageProps)
|
|
|
98
100
|
* @property {import('react').ElementType} [as] the element, default 'div'.
|
|
99
101
|
* @property {string} [className]
|
|
100
102
|
*/
|
|
101
|
-
/** The app switcher's default entries, in order
|
|
103
|
+
/** The app switcher's default entries, in order: the docs (community as soon follows by itself).
|
|
104
|
+
* Online and local are never in a switcher, in any app. Consumers map their hrefs in.
|
|
102
105
|
* @type {ReadonlyArray<Readonly<AppSidebarApp>>} */
|
|
103
106
|
export const APP_SIDEBAR_APPS: ReadonlyArray<Readonly<AppSidebarApp>>;
|
|
104
107
|
export type AppSidebarApp = {
|
|
@@ -115,10 +118,15 @@ export type AppSidebarApp = {
|
|
|
115
118
|
*/
|
|
116
119
|
href?: string;
|
|
117
120
|
/**
|
|
118
|
-
* a short note after the label
|
|
119
|
-
* text (a place that does not exist yet), not a link.
|
|
121
|
+
* a short note after the label. With no href the entry is shown as text, not a link.
|
|
120
122
|
*/
|
|
121
123
|
tag?: string;
|
|
124
|
+
/**
|
|
125
|
+
* a place that does not exist yet: shown as text, aria-disabled, with a 'soon' note
|
|
126
|
+
* and no hover or press. The switcher always ends with community as soon unless
|
|
127
|
+
* `apps` names a community entry of its own.
|
|
128
|
+
*/
|
|
129
|
+
soon?: boolean;
|
|
122
130
|
/**
|
|
123
131
|
* default '_blank': another app opens in a new tab.
|
|
124
132
|
*/
|
|
@@ -203,7 +211,7 @@ export type AppSidebarAccount = {
|
|
|
203
211
|
};
|
|
204
212
|
export type AppSidebarProps = {
|
|
205
213
|
/**
|
|
206
|
-
* which app renders the sidebar; its own switcher entry is left out.
|
|
214
|
+
* which app renders the sidebar; its own switcher entry is left out, and online and local never show.
|
|
207
215
|
*/
|
|
208
216
|
app: "online" | "local" | "docs" | string;
|
|
209
217
|
/**
|
|
@@ -5,11 +5,17 @@
|
|
|
5
5
|
* @param {object} props
|
|
6
6
|
* @param {string} props.command - the literal shell command (case preserved — never lowercased).
|
|
7
7
|
* @param {string} [props.label] - an accessible name for the copy button; defaults to the command.
|
|
8
|
+
* @param {boolean} [props.wrap=false] - wrap a long command at spaces (and break a long URL anywhere)
|
|
9
|
+
* instead of scrolling it sideways. Copying is unaffected: the command is copied whole.
|
|
10
|
+
* @param {boolean} [props.compact=false] - an icon-only copy button (its name stays "copy <command>"),
|
|
11
|
+
* for a narrow column.
|
|
8
12
|
* @param {string} [props.className] - extra classes appended to the root.
|
|
9
13
|
*/
|
|
10
|
-
export function CommandBlock({ command, label, className, ...rest }: {
|
|
14
|
+
export function CommandBlock({ command, label, wrap, compact, className, ...rest }: {
|
|
11
15
|
command: string;
|
|
12
16
|
label?: string;
|
|
17
|
+
wrap?: boolean;
|
|
18
|
+
compact?: boolean;
|
|
13
19
|
className?: string;
|
|
14
20
|
}): import("react").JSX.Element;
|
|
15
21
|
/**
|
|
@@ -108,16 +108,19 @@ 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?: 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
|
|
111
|
+
* @param {{ matches?: import('./Redaction.jsx').RedactionMatch[], matchCount?: number, total?: number, failure?: string, failureDetail?: string, failureAction?: { label: string, onSelect: () => void, busy?: boolean } }} [props.scan] - the host's scan result. `failure` is one plain line; `failureAction` is a button in the failure box (the one action that fixes it); `failureDetail`, the actionable detail (what, why, where, the fix), shows as pre-wrapped mono text behind a "details" disclosure in the failure box. `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]
|
|
115
|
+
* @param {{ stage: string, note?: string, progress?: { done: number, total: number } }} [props.checking] - while state is
|
|
116
|
+
* 'checking': the step being done (replaces "checking for sensitive content"), a quiet note on why publish waits
|
|
117
|
+
* when a step runs long, and a determinate count ("120 of 468"). All of it sits in the status region.
|
|
115
118
|
* @param {{ summary: string }} [props.changes] - update mode: what changed since the last publish.
|
|
116
119
|
* @param {AccessItem[]} [props.access] - who can read it after this publish.
|
|
117
120
|
* @param {(id: string) => void} [props.onRemove]
|
|
118
121
|
* @param {(id: string) => void} [props.onRestore]
|
|
119
122
|
* @param {object} [props.picker] - CollectivePicker props (suggestions, onAdd, query, onQueryChange).
|
|
120
|
-
* @param {{ checked: boolean, onChange: (checked: boolean) => void, hint?: string }} [props.autoPublish] - hint
|
|
123
|
+
* @param {{ checked: boolean, onChange: (checked: boolean) => void, hint?: string }} [props.autoPublish] - hint is the unchecked line, shown only when given; checked consent is always component-owned.
|
|
121
124
|
* @param {string} [props.accessSummary] - update mode: the access change in words ("adds ML Reading Group, removes nothing").
|
|
122
125
|
* @param {string} [props.primaryLabel] - replaces the derived primary label.
|
|
123
126
|
* @param {() => void} [props.onPublish]
|
|
@@ -128,7 +131,7 @@ export function CollectivePicker({ suggestions, onAdd, query: queryProp, onQuery
|
|
|
128
131
|
* @param {() => void} [props.onRetry] - stopped-state actual publication retry; requires a valid review and audience. Mutually exclusive with onRecover.
|
|
129
132
|
* @param {{ url: string, collectives: string[], pending?: string[], pullRequest?: { number: number, branch: string, href?: string } }} [props.done]
|
|
130
133
|
*/
|
|
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, }: {
|
|
134
|
+
export function PublishDialog({ open, onClose, title, mode, state, scan, onRescan, checking, changes, access, onRemove, onRestore, picker, autoPublish, accessSummary, primaryLabel, onPublish, onConnect, joinHref, stoppedAt, onRecover, onRetry, done, }: {
|
|
132
135
|
open: boolean;
|
|
133
136
|
onClose: () => void;
|
|
134
137
|
title: string;
|
|
@@ -139,8 +142,22 @@ export function PublishDialog({ open, onClose, title, mode, state, scan, onResca
|
|
|
139
142
|
matchCount?: number;
|
|
140
143
|
total?: number;
|
|
141
144
|
failure?: string;
|
|
145
|
+
failureDetail?: string;
|
|
146
|
+
failureAction?: {
|
|
147
|
+
label: string;
|
|
148
|
+
onSelect: () => void;
|
|
149
|
+
busy?: boolean;
|
|
150
|
+
};
|
|
142
151
|
};
|
|
143
152
|
onRescan?: () => void;
|
|
153
|
+
checking?: {
|
|
154
|
+
stage: string;
|
|
155
|
+
note?: string;
|
|
156
|
+
progress?: {
|
|
157
|
+
done: number;
|
|
158
|
+
total: number;
|
|
159
|
+
};
|
|
160
|
+
};
|
|
144
161
|
changes?: {
|
|
145
162
|
summary: string;
|
|
146
163
|
};
|
|
@@ -17,9 +17,11 @@ export function SettingStatus({ children }: {
|
|
|
17
17
|
* @param {(next: boolean|string) => Promise<void>|void} props.onCommit - the one write; reject to fail.
|
|
18
18
|
* @param {string} [props.tag] - a note on the row, shown on a Chip ("not in peasant config").
|
|
19
19
|
* @param {boolean} [props.disabled]
|
|
20
|
+
* @param {boolean} [props.stack] - put the value under the label (at its left edge) instead of beside
|
|
21
|
+
* it. Defaults to on for a text value longer than one short line (a description).
|
|
20
22
|
* @param {string} [props.className]
|
|
21
23
|
*/
|
|
22
|
-
export function SettingRow({ label, help, control, value, options, onCommit, tag, disabled, className, ...rest }: {
|
|
24
|
+
export function SettingRow({ label, help, control, value, options, onCommit, tag, disabled, stack, className, ...rest }: {
|
|
23
25
|
label: import("react").ReactNode;
|
|
24
26
|
help?: import("react").ReactNode;
|
|
25
27
|
control: "switch" | "select" | "checkbox" | "text";
|
|
@@ -32,6 +34,7 @@ export function SettingRow({ label, help, control, value, options, onCommit, tag
|
|
|
32
34
|
onCommit: (next: boolean | string) => Promise<void> | void;
|
|
33
35
|
tag?: string;
|
|
34
36
|
disabled?: boolean;
|
|
37
|
+
stack?: boolean;
|
|
35
38
|
className?: string;
|
|
36
39
|
}): import("react").JSX.Element;
|
|
37
40
|
/**
|