@notis_ai/cli 0.2.27 → 0.2.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.
- package/README.md +2 -2
- package/config/notis_app_design_rules.json +5 -123
- package/dist/agent-hooks/notis-agent-hook.mjs +2 -2
- package/dist/base-skills/notis-spaces/.notis-base-skill.json +1 -1
- package/dist/base-skills/notis-spaces/SKILL.md +13 -19
- package/dist/base-skills/notis-spaces/references/design.md +11 -45
- package/dist/base-skills/notis-spaces/references/sdk.md +86 -67
- package/dist/base-skills/notis-spaces/references/views.md +12 -1
- package/dist/sdk/src/components/NotisCommentBoundary.tsx +43 -16
- package/dist/sdk/src/components/NotisSelectionBoundary.tsx +26 -1
- package/dist/sdk/src/components/SelectionActionBar.tsx +262 -0
- package/dist/sdk/src/hooks/useCollectionInteractions.ts +5 -2
- package/dist/sdk/src/space.ts +4 -0
- package/dist/sdk/src/ui/icons.tsx +11 -2
- package/dist/sdk/src/words/actions.ts +9 -1
- package/dist/sdk/src/words/keymap.ts +3 -0
- package/dist/space-harness/host.js +172 -134
- package/dist/space-sdk/dist/{chunk-BWHAORT4.js → chunk-BFGB6XXC.js} +2 -2
- package/dist/space-sdk/dist/index.js +2 -2
- package/dist/space-sdk/dist/ui.js +14 -11
- package/dist/space-sdk/src/components/NotisSelectionBoundary.d.ts +7 -0
- package/dist/space-sdk/src/space.ts +4 -0
- package/dist/space-sdk/src/tailwind-candidates.d.ts +117 -13
- package/dist/space-sdk/src/ui/blocks/DataTable.d.ts +86 -0
- package/dist/space-sdk/src/ui/blocks/InfoTip.d.ts +25 -0
- package/dist/space-sdk/src/ui/blocks/Meter.d.ts +39 -0
- package/dist/space-sdk/src/ui/blocks/blocks.d.ts +1 -1
- package/dist/space-sdk/src/ui/blocks/index.d.ts +6 -0
- package/dist/space-sdk/src/ui/charts/Chart.d.ts +15 -2
- package/dist/space-sdk/src/ui/charts/StatRow.d.ts +4 -3
- package/dist/space-sdk/src/ui/charts/chartData.d.ts +6 -0
- package/dist/space-sdk/src/ui/icons.d.ts +1 -1
- package/dist/space-sdk/src/ui/index.d.ts +2 -2
- package/dist/space-sdk/src/ui/list/Row.d.ts +10 -3
- package/dist/space-sdk/src/ui/period/dateFormat.d.ts +14 -0
- package/dist/space-sdk/src/words/actions.ts +9 -1
- package/dist/space-sdk/src/words/keymap.ts +3 -0
- package/dist/view-renderer/dist/host.js +243 -205
- package/package.json +3 -3
- package/src/command-specs/computer.js +3 -3
- package/template/components/ui/button.tsx +1 -1
- package/template/components/ui/native-select.tsx +1 -1
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* DataTable: a read-only table for a dashboard `Section kind="data"` (machines, threads, jobs), styled like the
|
|
3
|
+
* ChartTable: 40px rows with a hairline above each, a sticky 36px muted header, the edge cells 24px in. Cells never
|
|
4
|
+
* wrap: they truncate. One primary column takes the room left, never under its `minWidth` (default 120 px); the others
|
|
5
|
+
* fit their content or a fixed width, and a column can hide under a container width so a phone never scrolls
|
|
6
|
+
* sideways. When the columns kept still do not fit, the last ones hide on their own, so the primary text is never
|
|
7
|
+
* crushed. A real table, so view Markdown reads it.
|
|
8
|
+
*/
|
|
9
|
+
import React, { type ReactNode } from 'react';
|
|
10
|
+
import { type Words } from '../../words/types';
|
|
11
|
+
type Text = Words | string;
|
|
12
|
+
export interface DataTableColumn<R> {
|
|
13
|
+
/** Stable key of the column. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** The header text. */
|
|
16
|
+
label: Text;
|
|
17
|
+
/** The cell of one row. Text truncates with an ellipsis; it never wraps. */
|
|
18
|
+
cell: (row: R) => ReactNode;
|
|
19
|
+
/** Default 'start'. Use 'end' for numbers. */
|
|
20
|
+
align?: 'start' | 'end';
|
|
21
|
+
/** A fixed width in px (padding included); the cell truncates inside it. */
|
|
22
|
+
width?: number;
|
|
23
|
+
/** Muted 12px monospace (ids, paths, versions); truncates. */
|
|
24
|
+
mono?: boolean;
|
|
25
|
+
/**
|
|
26
|
+
* Takes the room the other columns leave and truncates. Exactly one column should be primary; when none is, the
|
|
27
|
+
* first column is, and when several are, the first of them. It holds the row's press target and never hides. With
|
|
28
|
+
* `onRowPress` its cell sits inside the row's button, so keep it to text and icons: no link, button or InfoTip.
|
|
29
|
+
*/
|
|
30
|
+
primary?: boolean;
|
|
31
|
+
/** The column hides while the table is narrower than this many px (its own container width). */
|
|
32
|
+
hideBelow?: number;
|
|
33
|
+
/** On the primary column: the narrowest it gets, in px (padding excluded). Default 120. */
|
|
34
|
+
minWidth?: number;
|
|
35
|
+
}
|
|
36
|
+
export interface DataTableGroup<R> {
|
|
37
|
+
key: string;
|
|
38
|
+
label: Text;
|
|
39
|
+
rows: readonly R[];
|
|
40
|
+
}
|
|
41
|
+
export interface DataTableProps<R> {
|
|
42
|
+
columns: readonly DataTableColumn<R>[];
|
|
43
|
+
/** The rows, when the table has no groups. */
|
|
44
|
+
rows?: readonly R[];
|
|
45
|
+
/** Rows under muted group headings (label and count), in this order. A group with no rows is left out. Wins over `rows`. */
|
|
46
|
+
groups?: readonly DataTableGroup<R>[];
|
|
47
|
+
rowKey: (row: R) => string;
|
|
48
|
+
/** Makes rows pressable: a button in the primary cell covers the row and takes Tab focus. */
|
|
49
|
+
onRowPress?: (row: R) => void;
|
|
50
|
+
/** The accessible name of a row's press target. Default the primary cell's text. */
|
|
51
|
+
rowLabel?: (row: R) => string;
|
|
52
|
+
/** The table's accessible name (the Section title, usually). */
|
|
53
|
+
label?: Text;
|
|
54
|
+
/** Shown in place of the rows when there are none. Default an EmptyState. */
|
|
55
|
+
empty?: ReactNode;
|
|
56
|
+
className?: string;
|
|
57
|
+
}
|
|
58
|
+
/** Columns hidden because they did not fit, with the first and last columns still shown (they take the edge insets). */
|
|
59
|
+
interface AutoFit {
|
|
60
|
+
hidden: number[];
|
|
61
|
+
first: number;
|
|
62
|
+
last: number;
|
|
63
|
+
}
|
|
64
|
+
/**
|
|
65
|
+
* What to hide so `overflow` px fit again, last first and never the primary, and the edge columns left: `widths` are
|
|
66
|
+
* the drawn widths, 0 for a column a `hideBelow` rule already hides. A column that becomes the new edge takes the
|
|
67
|
+
* 24px inset, so the freed room covers that growth too, except for a column of fixed `width` (`fixed[index]`), which
|
|
68
|
+
* holds its padding inside that width. Exported for tests.
|
|
69
|
+
*/
|
|
70
|
+
export declare function autoFit(overflow: number, widths: readonly number[], primaryIndex: number, fixed?: readonly boolean[]): AutoFit;
|
|
71
|
+
/**
|
|
72
|
+
* The container rules of the columns that hide: under each width the hiding columns go, the first and last columns
|
|
73
|
+
* still shown take the 24px edge inset, and the primary column (`primaryIndex`) takes its edge min-width when it is one
|
|
74
|
+
* of them. A column only ever hides as the table narrows, so each band's rules add to the wider bands' ones. Exported
|
|
75
|
+
* for tests.
|
|
76
|
+
*/
|
|
77
|
+
export declare function dataTableHideCss(tableId: string, limits: readonly (number | undefined)[], primaryIndex?: number): string;
|
|
78
|
+
/**
|
|
79
|
+
* A read-only table: 40px rows, a sticky 36px header, cells that truncate, optional group headings with their
|
|
80
|
+
* counts and pressable rows. Columns with `hideBelow` hide under that container width.
|
|
81
|
+
*/
|
|
82
|
+
export declare function DataTable<R>({ columns, rows, groups, rowKey, onRowPress, rowLabel, label, empty, className }: DataTableProps<R>): React.JSX.Element;
|
|
83
|
+
export declare namespace DataTable {
|
|
84
|
+
var displayName: string;
|
|
85
|
+
}
|
|
86
|
+
export {};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* InfoTip: a small info button beside a label that opens a short explanation on press (and on tap, where a tooltip
|
|
3
|
+
* never shows). How a figure is counted, what a state means or which threshold applies goes here, not as prose on
|
|
4
|
+
* the page. Put it in a StatRow figure's `about`, a Meter's label line or next to a Section item heading.
|
|
5
|
+
*/
|
|
6
|
+
import React from 'react';
|
|
7
|
+
import { type Words } from '../../words/types';
|
|
8
|
+
export declare const INFOTIP_WORDS: Readonly<{
|
|
9
|
+
more: {
|
|
10
|
+
en: string;
|
|
11
|
+
fr: string;
|
|
12
|
+
};
|
|
13
|
+
fallback: {
|
|
14
|
+
en: string;
|
|
15
|
+
fr: string;
|
|
16
|
+
};
|
|
17
|
+
}>;
|
|
18
|
+
export interface InfoTipProps {
|
|
19
|
+
/** The explanation: one or two short sentences. */
|
|
20
|
+
children: React.ReactNode;
|
|
21
|
+
/** What it explains ("Dev stacks"): names the button "About Dev stacks". */
|
|
22
|
+
label?: Words | string;
|
|
23
|
+
className?: string;
|
|
24
|
+
}
|
|
25
|
+
export declare function InfoTip({ children, label, className }: InfoTipProps): React.JSX.Element;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Meter: how full something is (memory, disk, seats, a quota), as a label and its figure over a thin track. Flat:
|
|
3
|
+
* no border, no coloured text. The fill is neutral until it reaches the optional limit, then the whole fill turns
|
|
4
|
+
* destructive (state as a full fill, never by text colour).
|
|
5
|
+
*/
|
|
6
|
+
import type { ReactNode } from 'react';
|
|
7
|
+
import { type Words } from '../../words/types';
|
|
8
|
+
type Text = Words | string;
|
|
9
|
+
export interface MeterProps {
|
|
10
|
+
/** What is measured ("Memory"); also the meter's accessible name. */
|
|
11
|
+
label: Text;
|
|
12
|
+
/** How much is used, in the same unit as `max`. */
|
|
13
|
+
value: number;
|
|
14
|
+
/** The capacity. The fill is `value / max`, held between empty and full. */
|
|
15
|
+
max: number;
|
|
16
|
+
/** The figure on the right. Default "8.2 / 36" in the toolkit locale. Text (or words) is also read as the meter's value. */
|
|
17
|
+
valueText?: ReactNode | Words;
|
|
18
|
+
/**
|
|
19
|
+
* A threshold in the unit of `max`: a thin tick on the track (none when the limit is past `max`); at or over it the
|
|
20
|
+
* fill turns destructive. Only for a threshold the data has (a memory reserve, a quota): a full meter is not a
|
|
21
|
+
* problem by itself, so never set `limit` to `max`; when full means someone waits, say that in the page's
|
|
22
|
+
* "Needs action" section instead.
|
|
23
|
+
*/
|
|
24
|
+
limit?: number;
|
|
25
|
+
/** What the limit is ("Alert at 30 GiB"), shown muted under the track on the right. */
|
|
26
|
+
limitLabel?: Text;
|
|
27
|
+
/** A muted line under the track on the left ("4 apps running"). */
|
|
28
|
+
hint?: Text;
|
|
29
|
+
className?: string;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A label and its figure ("Memory 8.2 / 36") over a 6px rounded track with a neutral fill. With `limit`, a tick
|
|
33
|
+
* marks it and the fill turns destructive once the value reaches it (`data-over`). role="meter", named by the label.
|
|
34
|
+
*/
|
|
35
|
+
export declare function Meter({ label, value, max, valueText, limit, limitLabel, hint, className }: MeterProps): import("react").JSX.Element;
|
|
36
|
+
export declare namespace Meter {
|
|
37
|
+
var displayName: string;
|
|
38
|
+
}
|
|
39
|
+
export {};
|
|
@@ -189,7 +189,7 @@ export interface NoticeProps {
|
|
|
189
189
|
children?: ReactNode | Words;
|
|
190
190
|
/** Shows a Try again button. */
|
|
191
191
|
onRetry?: () => void;
|
|
192
|
-
/** Other buttons on the right. */
|
|
192
|
+
/** Other buttons, on the right; on a narrow notice they wrap onto their own line under the text, with Try again. */
|
|
193
193
|
action?: ReactNode;
|
|
194
194
|
/**
|
|
195
195
|
* The message cannot wait: a screen reader breaks off what it is saying to read it (role="alert"). Keep it for a
|
|
@@ -2,3 +2,9 @@ export { BLOCK_WORDS, Badge, Button, EmptyState, Metric, NativeSelect, Notice, P
|
|
|
2
2
|
export type { BadgeProps, ButtonProps, ButtonSize, ButtonVariant, EmptyStateProps, MetricProps, NativeSelectOption, NativeSelectProps, NoticeProps, PaginationProps, SectionKind, SectionProps, SegmentedControlProps, SegmentedOption, SwitchProps, ToggleGroupProps, } from './blocks';
|
|
3
3
|
export { TABROW_WORDS, TABS_WORDS, TabRow, Tabs, stepTab, tabIds, tabPanelProps } from './Tabs';
|
|
4
4
|
export type { TabItem, TabRowItem, TabRowProps, TabsProps } from './Tabs';
|
|
5
|
+
export { Meter } from './Meter';
|
|
6
|
+
export type { MeterProps } from './Meter';
|
|
7
|
+
export { DataTable } from './DataTable';
|
|
8
|
+
export type { DataTableColumn, DataTableGroup, DataTableProps } from './DataTable';
|
|
9
|
+
export { INFOTIP_WORDS, InfoTip } from './InfoTip';
|
|
10
|
+
export type { InfoTipProps } from './InfoTip';
|
|
@@ -180,8 +180,21 @@ export interface ChartProps {
|
|
|
180
180
|
horizontal?: boolean;
|
|
181
181
|
/** Value text in tooltips and the data table. Default whole numbers (one decimal under 10). */
|
|
182
182
|
format?: (value: number, locale: Locale) => string;
|
|
183
|
-
/**
|
|
183
|
+
/**
|
|
184
|
+
* The short value after each horizontal bar (or stack), such as "1.2k" beside an exact tooltip, and on the value
|
|
185
|
+
* axis. Default `format`.
|
|
186
|
+
*/
|
|
184
187
|
labelFormat?: (value: number, locale: Locale) => string;
|
|
188
|
+
/**
|
|
189
|
+
* A fixed value scale `[min, max]`, such as `[0, 100]` for percentages, instead of one that fits the data. Values
|
|
190
|
+
* outside it are clipped. Vertical charts only.
|
|
191
|
+
*/
|
|
192
|
+
domain?: readonly [number, number];
|
|
193
|
+
/**
|
|
194
|
+
* Draws the value axis on the left (its labels through `labelFormat`), for a chart whose scale matters, such as a
|
|
195
|
+
* percentage with `domain={[0, 100]}`. Default hidden: the tooltip and the data table carry exact values.
|
|
196
|
+
*/
|
|
197
|
+
valueAxis?: boolean;
|
|
185
198
|
/**
|
|
186
199
|
* The last point is still filling (the range ends today): its bar is drawn full colour, the others lighter until
|
|
187
200
|
* hovered (deck period-r6). Default: true when the last row's `to` is today.
|
|
@@ -195,7 +208,7 @@ export declare function seriesColor(series: ChartSeries, index: number): string;
|
|
|
195
208
|
/** The hidden table of a chart: one row per point, the point name then each series value. */
|
|
196
209
|
export declare function chartTableRows(data: readonly object[], series: readonly ChartSeries[], compare: ChartSeries | null, nameOf: (row: object) => string, format: (value: number) => string): Array<Array<string | null>>;
|
|
197
210
|
/** A period chart (bars, a line or an area) with an optional dashed comparison; 140px bars or a 200px plot by default. */
|
|
198
|
-
export declare function Chart({ kind, data, series: seriesProp, compare: compareProp, xKey: xKeyProp, labelKey, nameKey: nameKeyProp, title, height: heightProp, stacked, horizontal: horizontalProp, format: formatProp, labelFormat: labelFormatProp, live: liveProp, locale: localeProp, className, }: ChartProps): React.JSX.Element;
|
|
211
|
+
export declare function Chart({ kind, data, series: seriesProp, compare: compareProp, xKey: xKeyProp, labelKey, nameKey: nameKeyProp, title, height: heightProp, stacked, horizontal: horizontalProp, format: formatProp, labelFormat: labelFormatProp, domain: domainProp, valueAxis: valueAxisProp, live: liveProp, locale: localeProp, className, }: ChartProps): React.JSX.Element;
|
|
199
212
|
export declare namespace Chart {
|
|
200
213
|
var displayName: string;
|
|
201
214
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* StatRow (toolkit spec 2.11, deck chart page alt b, PG2): the key figures above a chart, as a full-width strip
|
|
3
|
-
*
|
|
2
|
+
* StatRow (toolkit spec 2.11, deck chart page alt b, PG2): the key figures above a chart, as a full-width strip whose
|
|
3
|
+
* cells share the row equally: one to six on one line when there is room (no cell under 160px), two per line when the
|
|
4
|
+
* strip is 640px or narrower, an odd last one spanning the row (the toolkit.css stat row rules). Each cell, 24px in and 16px tall padding, shows its
|
|
4
5
|
* label, the value with its change, and the previous value with what it is compared to. No card, gap or rule between
|
|
5
6
|
* cells; a strip right after a bar Section takes a hairline above and below (the toolkit's blocks rules).
|
|
6
7
|
*/
|
|
@@ -52,7 +53,7 @@ export declare function vsTail(compare: CompareId, locale: Locale): string;
|
|
|
52
53
|
export declare function metricView(metric: StatMetric, compare: CompareId, locale: Locale): MetricView;
|
|
53
54
|
/** True when a slot holds something to draw. */
|
|
54
55
|
export declare function hasSlot(node: React.ReactNode): boolean;
|
|
55
|
-
/** The key figures strip:
|
|
56
|
+
/** The key figures strip: equal cells, one to six on a line (two at 640px or narrower), full width, no frame. */
|
|
56
57
|
export declare function StatRow({ metrics, compare, locale: localeProp, className }: StatRowProps): React.JSX.Element;
|
|
57
58
|
export declare namespace StatRow {
|
|
58
59
|
var displayName: string;
|
|
@@ -70,6 +70,12 @@ export declare function showAxisLabel(index: number, count: number, spacing?: nu
|
|
|
70
70
|
export declare function edgeAnchor(x: number, left: number, right: number): 'start' | 'middle' | 'end';
|
|
71
71
|
/** Top of the value axis: 10% above the highest value (this period or the comparison), never below 1. */
|
|
72
72
|
export declare function chartMax(values: ReadonlyArray<number | null | undefined>): number;
|
|
73
|
+
/**
|
|
74
|
+
* The top of a value axis drawn in quarters, raised from `max` so every quarter is a round number (110 gives 120:
|
|
75
|
+
* 30, 60, 90, 120), never 27.5. With `integers` (counts) each quarter is a whole number too: 1.1 gives 4, never 1.2.
|
|
76
|
+
* Exported for tests.
|
|
77
|
+
*/
|
|
78
|
+
export declare function niceQuarterMax(max: number, integers?: boolean): number;
|
|
73
79
|
/** True when the period ends today, so its last bin is still filling (drawn full colour). */
|
|
74
80
|
export declare function endsToday(range: DateRange, now?: Date): boolean;
|
|
75
81
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
*/
|
|
5
5
|
import React, { type ReactNode } from 'react';
|
|
6
6
|
export declare function hasIcon(name: string): boolean;
|
|
7
|
-
/** A built-in icon by name; an unknown name renders nothing. Decorative: the control carries the label. */
|
|
7
|
+
/** A built-in icon by name; an unknown name renders nothing and warns once. Decorative: the control carries the label. */
|
|
8
8
|
export declare function Icon({ name, className }: {
|
|
9
9
|
name: string;
|
|
10
10
|
className?: string;
|
|
@@ -21,8 +21,8 @@ export { Icon, hasIcon, renderIcon } from './icons';
|
|
|
21
21
|
export { adoptToolkitStyles, getToolkitStyleSheet, getToolkitStyleText, registerToolkitStyles } from './styles';
|
|
22
22
|
export { COMPARES, DEFAULT_COMPARE, DEFAULT_PRESET, PRESETS, compareRange, customPeriod, dayCount, formatPeriodParam, fromIsoDay, isCompareId, isPresetId, normalizePeriod, parsePeriodParam, periodRanges, presetRange, samePeriod, toIsoDay, } from './period/periods';
|
|
23
23
|
export type { CompareId, DateRange as PeriodRange, Period, PresetId } from './period/periods';
|
|
24
|
-
export { dayNumberLabel, formatDateRange, formatDayHeading, formatDelta, formatLongDay, formatMonthYear, formatNumber, formatShortDay, formatValue, intlLocale, weekdayNames, } from './period/dateFormat';
|
|
25
|
-
export type { Delta, DeltaTone } from './period/dateFormat';
|
|
24
|
+
export { dayNumberLabel, formatDateRange, formatDayHeading, formatDelta, formatDuration, formatLongDay, formatMonthYear, formatNumber, formatShortDay, formatValue, intlLocale, weekdayNames, } from './period/dateFormat';
|
|
25
|
+
export type { Delta, DeltaTone, FormatDurationOptions } from './period/dateFormat';
|
|
26
26
|
export { CALENDAR_WORDS, CHART_WORDS, COMPARE_WORDS, PERIOD_WORDS, PRESET_WORDS, TIMELINE_WORDS, VS_WORDS, } from './period/dateWords';
|
|
27
27
|
export { usePeriod } from './period/usePeriod';
|
|
28
28
|
export type { UsePeriodOptions, UsePeriodResult } from './period/usePeriod';
|
|
@@ -42,8 +42,8 @@ export interface RowProps {
|
|
|
42
42
|
/** One clamped line (13/18). */
|
|
43
43
|
snippet?: ReactNode;
|
|
44
44
|
/**
|
|
45
|
-
* Words on the meta line, as text joined by ", "
|
|
46
|
-
*
|
|
45
|
+
* Words on the meta line, as text joined by ", ". A warning or danger label (Overdue, Failed) comes first as a small
|
|
46
|
+
* tinted pill: state is never shown by text colour alone.
|
|
47
47
|
*/
|
|
48
48
|
labels?: readonly RowLabel[];
|
|
49
49
|
/** Links as chips between the title and the trail; they shrink, then clip, before the title does. */
|
|
@@ -73,6 +73,13 @@ export interface RowProps {
|
|
|
73
73
|
wrap?: 1 | 2;
|
|
74
74
|
/** Only on a Row drawn on its own; inside a list the list's row element carries the classes. */
|
|
75
75
|
className?: string;
|
|
76
|
+
/**
|
|
77
|
+
* Only on a Row drawn on its own (a short "Needs action" list): the whole row opens something. Inside a list the
|
|
78
|
+
* list owns the press.
|
|
79
|
+
*/
|
|
80
|
+
onPress?: () => void;
|
|
81
|
+
/** The pressable row's accessible name. Default the title when it is text. */
|
|
82
|
+
pressLabel?: string;
|
|
76
83
|
}
|
|
77
84
|
/**
|
|
78
85
|
* Work moves backlog to done (`review`: the work is ready and a person checks it next); `up` and `down` are a service or
|
|
@@ -146,4 +153,4 @@ export declare function Check(): import("react").JSX.Element;
|
|
|
146
153
|
/** The dash of a partly checked select-all. */
|
|
147
154
|
export declare function Dash(): import("react").JSX.Element;
|
|
148
155
|
/** One list row: lead icon, a title over a meta line, then the trail (trailing, time, avatar, More). */
|
|
149
|
-
export declare function Row({ icon, title, meta, snippet, labels, tags, owner, time, dateOnly, now, trailing, more, state, wrap, className, }: RowProps): import("react").JSX.Element;
|
|
156
|
+
export declare function Row({ icon, title, meta, snippet, labels, tags, owner, time, dateOnly, now, trailing, more, state, wrap, className, onPress, pressLabel, }: RowProps): import("react").JSX.Element;
|
|
@@ -48,3 +48,17 @@ export interface Delta {
|
|
|
48
48
|
* `higherIsBetter: false` turns a rise red (costs, errors).
|
|
49
49
|
*/
|
|
50
50
|
export declare function formatDelta(current: number, previous: number | null | undefined, locale: Locale, higherIsBetter?: boolean): Delta | null;
|
|
51
|
+
export interface FormatDurationOptions {
|
|
52
|
+
/** How many units at most, biggest first: 1, 2 (default) or 3. */
|
|
53
|
+
units?: 1 | 2 | 3;
|
|
54
|
+
/** The smallest unit shown. Default 'second'; 'minute' rounds to the minute (see formatDuration). */
|
|
55
|
+
smallest?: 'second' | 'minute';
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* A length of time in its biggest units: "4 d 5 h", "1 h 31 min", "7 min", "45 s" / "4 j 5 h", "1 h 31 min". A
|
|
59
|
+
* no-break space joins each number to its unit; numbers use the locale's grouping ("1,234 d"). The last unit shown
|
|
60
|
+
* is rounded to the nearest, and a unit that rounds to zero is left out ("2 h", not "2 h 0 min"). A negative,
|
|
61
|
+
* NaN or infinite value reads "-". With `smallest: 'minute'`, zero reads "0 min" and anything above zero that rounds
|
|
62
|
+
* to under a minute reads "< 1 min" (never "0 min" for time that did pass); with seconds, zero reads "0 s".
|
|
63
|
+
*/
|
|
64
|
+
export declare function formatDuration(ms: number, locale: Locale | string, opts?: FormatDurationOptions): string;
|
|
@@ -67,7 +67,15 @@ export class ActionError extends Error {
|
|
|
67
67
|
/** The reason an ActionError carries, else null. A Space bundles its own copy of the words, so this reads the shape. */
|
|
68
68
|
export function actionErrorReason(error: unknown): Words | string | null {
|
|
69
69
|
if (!error || typeof error !== 'object') return null;
|
|
70
|
-
const { name, code, reason } = error as { name?: unknown; code?: unknown; reason?: unknown };
|
|
70
|
+
const { name, code, reason, status } = error as { name?: unknown; code?: unknown; reason?: unknown; status?: unknown };
|
|
71
|
+
// A confirmed host refusal can explain how to unblock the action. These words are
|
|
72
|
+
// ours: never display an arbitrary Space/server error's message as a toast reason.
|
|
73
|
+
if (name === 'SpaceActionError' && code === 'document_has_spaces' && status === 'refused') {
|
|
74
|
+
return {
|
|
75
|
+
en: 'This document is used by a Space. Move or trash its linked Spaces first.',
|
|
76
|
+
fr: 'Ce document est utilisé par un Space. Déplace ou mets à la corbeille ses Spaces liés d’abord.',
|
|
77
|
+
};
|
|
78
|
+
}
|
|
71
79
|
if (name !== 'ActionError' || code !== 'notis_action_error') return null;
|
|
72
80
|
return typeof reason === 'string' || isWords(reason) ? reason : null;
|
|
73
81
|
}
|
|
@@ -52,6 +52,9 @@ export const DEFAULT_KEYMAP = Object.freeze({
|
|
|
52
52
|
'host.search': entry('host.search', ['/'], 'app', 'Search', 'Rechercher', { host: true }),
|
|
53
53
|
'host.newChat': entry('host.newChat', ['c'], 'app', 'New conversation', 'Nouvelle conversation', { host: true }),
|
|
54
54
|
'host.call': entry('host.call', ['shift+c'], 'app', 'Open voice call', 'Ouvrir l’appel vocal', { host: true }),
|
|
55
|
+
// Cites the selected text in chat, like the Cite button on the selection (truth PRT-089).
|
|
56
|
+
'host.cite': entry('host.cite', ['mod+shift+c'], 'app', 'Cite selected text in chat', 'Citer le texte sélectionné dans le chat',
|
|
57
|
+
{ host: true }),
|
|
55
58
|
'host.toggleSidebar': entry('host.toggleSidebar', ['mod+s'], 'app', 'Toggle sidebar',
|
|
56
59
|
'Afficher ou masquer la barre latérale', { host: true }),
|
|
57
60
|
'host.voiceMessage': entry('host.voiceMessage', ['mod+d'], 'app', 'Voice message', 'Message vocal', { host: true }),
|