@deveye/types 0.21.6 → 0.21.8

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@deveye/types",
3
- "version": "0.21.6",
3
+ "version": "0.21.8",
4
4
  "description": "Shared contracts (types + zod schemas) for DevEye apps",
5
5
  "main": "src/index.ts",
6
6
  "types": "src/index.ts",
@@ -61,11 +61,11 @@ export interface FeatureDescriptor {
61
61
  * servent. Exigée dès que `notifies` est vrai. `perItem: false` quand rien
62
62
  * ne part jamais au nom d'un élément : ses réglages n'ont alors pas
63
63
  * d'onglet Notifications qui ne recevrait rien, et la route se coche à
64
- * l'échelle de la fonctionnalité. `feature` quand la fonctionnalité prévient
65
- * AUSSI en son nom propre, à côté de ses éléments : ce qui part par cette
66
- * route, dit en une phrase au-dessus des cases de son onglet.
64
+ * l'échelle de la fonctionnalité. Un avis qui concerne plusieurs éléments
65
+ * à la fois suit leurs canaux, chacun une fois (`notify.send(alert,
66
+ * { itemIds })`) : il n'a pas de route à lui.
67
67
  */
68
- notifications?: { hint: string; perItem?: boolean; feature?: string };
68
+ notifications?: { hint: string; perItem?: boolean };
69
69
  /**
70
70
  * Un de ses éléments peut-il être rendu visible depuis un autre espace ?
71
71
  * Décidé par le chiffrement : un élément partagé reste chiffré sous la clé
@@ -207,9 +207,7 @@ export const FEATURE_REGISTRY: readonly (FeatureDescriptor & { id: WorkspaceFeat
207
207
  icon: 'rocket',
208
208
  notifies: true,
209
209
  notifications: {
210
- hint: 'Envoyées à l’atterrissage d’un déploiement, échec comme succès, y compris ceux lancés ailleurs : depuis Dokploy, une CI ou un push git.',
211
- feature:
212
- 'Quand le lien avec l’instance d’un accès se perd, puis revient : un seul avis pour toutes les cibles qu’il dessert.'
210
+ hint: 'Envoyées à l’atterrissage d’un déploiement, échec comme succès, y compris ceux lancés ailleurs : depuis Dokploy, une CI ou un push git. Et quand le lien avec l’instance d’un accès se perd, puis revient : un seul avis, vers les canaux de toutes les cibles qu’il dessert.'
213
211
  },
214
212
  hasItems: true,
215
213
  itemNoun: 'cible',
@@ -394,18 +392,12 @@ export function maybeFeatureDescriptor(id: FeatureId): FeatureDescriptor | undef
394
392
  /** L'intitulé seul : le besoin de très loin le plus courant. */
395
393
  /**
396
394
  * Does this feature send notifications in its own name, by the route with no
397
- * item (`item_id = 0`)? True without items, when nothing goes out per item
398
- * (`notifications.perItem: false`) and when it speaks for itself next to its
399
- * items (`notifications.feature`). The shell shows that route's checkboxes,
395
+ * item (`item_id = 0`)? True without items, and when nothing goes out per item
396
+ * (`notifications.perItem: false`). The shell shows that route's checkboxes,
400
397
  * and the server accepts its selection, on exactly this rule.
401
398
  */
402
399
  export function featureNotifiesItself(descriptor: FeatureDescriptor): boolean {
403
- const notifications = descriptor.notifications;
404
- return (
405
- !descriptor.hasItems ||
406
- notifications?.perItem === false ||
407
- notifications?.feature !== undefined
408
- );
400
+ return !descriptor.hasItems || descriptor.notifications?.perItem === false;
409
401
  }
410
402
 
411
403
  export function featureLabel(id: FeatureId): string {
@@ -16,8 +16,7 @@ declare module 'deveye-sdk-client' {
16
16
  DragEvent,
17
17
  InputHTMLAttributes,
18
18
  ReactNode,
19
- RefObject,
20
- SelectHTMLAttributes
19
+ RefObject
21
20
  } from 'react';
22
21
  import type { z, ZodType } from 'zod';
23
22
  import type {
@@ -53,7 +52,55 @@ declare module 'deveye-sdk-client' {
53
52
  export const TextInput: ComponentType<
54
53
  InputHTMLAttributes<HTMLInputElement> & { enableShowHideButton?: boolean; error?: string }
55
54
  >;
56
- export const SelectInput: ComponentType<SelectHTMLAttributes<HTMLSelectElement>>;
55
+ export interface CopyButtonProps {
56
+ value: string;
57
+ /** What gets copied, for the tooltip and screen readers ("Copier la clé"). */
58
+ label?: string;
59
+ className?: string;
60
+ }
61
+ /** Copies `value` to the clipboard and confirms through its icon for two seconds; a refused clipboard stays silent. */
62
+ export const CopyButton: ComponentType<CopyButtonProps>;
63
+ export interface LoadingVeilProps {
64
+ /** Read by screen readers, and shown under the spinner when given. */
65
+ label?: string;
66
+ /** `top` for a long scrolling area: the spinner stays in view. */
67
+ align?: 'center' | 'top';
68
+ /** Appears after a quarter of a second: a brief read never flickers. */
69
+ delayed?: boolean;
70
+ className?: string;
71
+ }
72
+ /**
73
+ * The veil of a re-read: a layer over an area, the previous content legible
74
+ * underneath, taking no click and no scroll. Mount it as a SIBLING of the
75
+ * scrolling area inside a `position: relative` parent (inside an
76
+ * `overflow: auto` it would scroll away). Dim what it covers with
77
+ * `filter: opacity()`, never `opacity`.
78
+ */
79
+ export const LoadingVeil: ComponentType<LoadingVeilProps>;
80
+ export interface LogOutputProps {
81
+ /** The raw log, ANSI sequences included: the component cleans it. */
82
+ text: string;
83
+ /** A read in progress: the veil, over whatever is already shown. */
84
+ busy?: boolean;
85
+ /** Search, count and copy above the lines. Default `true`. */
86
+ toolbar?: boolean;
87
+ /** What reads when the log is empty. */
88
+ emptyText?: string;
89
+ /** Stays at the bottom when text arrives and the reader was there. Default `true`. */
90
+ follow?: boolean;
91
+ /** Caps the body's height outside a flex column (a block inside a sheet). */
92
+ maxHeight?: number;
93
+ className?: string;
94
+ 'aria-label'?: string;
95
+ }
96
+ /**
97
+ * A readable raw log: the output of a provider or a tool, cleaned of ANSI
98
+ * codes and coloured by what each line says (step, error, warning,
99
+ * success), timestamps and durations set back. The toolbar filters lines
100
+ * and copies what is shown. Inside a flex column (a `Dialog tall`) it
101
+ * takes the remaining room.
102
+ */
103
+ export const LogOutput: ComponentType<LogOutputProps>;
57
104
  export const Checkbox: ComponentType<{
58
105
  checked: boolean;
59
106
  /** Receives the state AFTER the click — no event to unwrap. */
@@ -109,11 +156,18 @@ declare module 'deveye-sdk-client' {
109
156
  group?: string;
110
157
  disabled?: boolean;
111
158
  }
159
+ /** A chip under the search field that keeps only the options passing `test`. */
160
+ export interface SearchSelectFilter<T extends string = string> {
161
+ value: string;
162
+ label: string;
163
+ test: (option: SearchSelectOption<T>) => boolean;
164
+ /** Chips sharing a key exclude each other: activating one releases the others. */
165
+ exclusive?: string;
166
+ }
112
167
  /**
113
- * A dropdown one can search in (accent- and case-insensitive, group names
114
- * included), for a list too long to scan or sorted into groups:
115
- * currencies, units, countries. Under ten ungrouped choices or so,
116
- * `SelectInput` stays simpler. Safe inside a Dialog: the panel is portaled.
168
+ * The app's dropdown. The search field (accent- and case-insensitive, group
169
+ * names included) only appears from eight choices on, or on request; filter
170
+ * chips can narrow the list. Safe inside a Dialog: the panel is portaled.
117
171
  */
118
172
  export function SearchSelect<T extends string>(props: {
119
173
  value: T;
@@ -124,6 +178,14 @@ declare module 'deveye-sdk-client' {
124
178
  placeholder?: string;
125
179
  searchPlaceholder?: string;
126
180
  emptyText?: string;
181
+ /** The search field: `'auto'` (default) shows it from eight choices on. */
182
+ searchable?: boolean | 'auto';
183
+ /** Chips under the search, AND-combined, reset when the panel closes. */
184
+ filters?: readonly SearchSelectFilter<T>[];
185
+ /** The trigger's id, for a label's `htmlFor`. */
186
+ id?: string;
187
+ /** The field the opening Dialog focuses first (`data-autofocus`). */
188
+ autoFocus?: boolean;
127
189
  disabled?: boolean;
128
190
  className?: string;
129
191
  }): ReactNode;
@@ -222,15 +284,29 @@ declare module 'deveye-sdk-client' {
222
284
  open: boolean;
223
285
  onClose: () => void;
224
286
  title?: string;
287
+ /** A small line above the title: where this dialog sits. */
288
+ kicker?: ReactNode;
225
289
  description?: ReactNode;
226
290
  children?: ReactNode;
227
291
  footer?: ReactNode;
228
292
  /** Extra action in the top-right corner, left of the close button. */
229
293
  headerAction?: ReactNode;
230
294
  width?: number;
295
+ /** When false, overlay click and Escape no longer close the dialog. Default true. */
296
+ dismissible?: boolean;
231
297
  onSubmit?: () => void;
298
+ /** Move focus to the first field on open. Default true. */
299
+ autoFocus?: boolean;
300
+ /** Unsaved changes: closing first asks; requires `onSave`. */
301
+ dirty?: boolean;
302
+ onSave?: () => void;
303
+ /** A viewport-tall flex column: title and footer pinned, the body scrolls. */
304
+ tall?: boolean;
305
+ /** The height follows the content up to the viewport, then the body scrolls. */
232
306
  fill?: boolean;
233
307
  holdSecrecy?: boolean;
308
+ /** Without the close button (a progress dialog). Default true. */
309
+ closeButton?: boolean;
234
310
  }>;
235
311
  /** The "Annuler" button of a Dialog footer: closes through the guarded close. */
236
312
  export const DialogCancelButton: ComponentType<
package/src/sdk/server.ts CHANGED
@@ -251,8 +251,7 @@ export interface DevEyeFacade {
251
251
  * (`postLive`) already concluded on, so a channel never hears the
252
252
  * same news twice. `itemIds`: the channels routed to ANY of these
253
253
  * items, each channel once: for news that concerns several items at
254
- * a time (the instance they share went down) when the feature's own
255
- * route (`hasRoute()` with no item) has nothing checked.
254
+ * a time (the instance they share went down), told once.
256
255
  */
257
256
  send(
258
257
  alert: SdkAlert,