@skyvexsoftware/stratos-sdk 0.12.0 → 0.13.1
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/helpers/aircraft.d.ts +6 -0
- package/dist/helpers/aircraft.js +3 -3
- package/dist/helpers/units.d.ts +9 -0
- package/dist/helpers/units.js +5 -0
- package/dist/hooks/context.d.ts +1 -1
- package/dist/hooks/useFlightEvents.d.ts +1 -1
- package/dist/hooks/useLandingAnalysis.d.ts +1 -1
- package/dist/index.d.ts +9 -3
- package/dist/index.js +2 -1
- package/dist/shared-types/additional-fields.d.ts +5 -0
- package/dist/shared-types/additional-fields.js +5 -0
- package/dist/shared-types/flight-events.d.ts +55 -0
- package/dist/shared-types/flight-events.js +15 -0
- package/dist/shared-types/flight-manager.d.ts +12 -0
- package/dist/shared-types/flight-manager.js +7 -0
- package/dist/shared-types/index.d.ts +6 -2
- package/dist/shared-types/index.js +2 -1
- package/dist/shared-types/landing.d.ts +149 -0
- package/dist/shared-types/landing.js +5 -0
- package/dist/shared-types/plugin-dialogs.d.ts +56 -0
- package/dist/shared-types/plugin-dialogs.js +6 -0
- package/dist/shared-types/simulator.d.ts +2 -194
- package/dist/shared-types/simulator.js +2 -13
- package/dist/shared-types/socket-events.d.ts +9 -0
- package/dist/shared-types/socket-events.js +6 -28
- package/dist/shared-types/theme.d.ts +6 -1
- package/dist/shared-types/theme.js +5 -0
- package/dist/types/context-ui.d.ts +101 -0
- package/dist/types/context-ui.js +5 -0
- package/dist/types/context.d.ts +100 -173
- package/dist/types/context.js +4 -3
- package/dist/types/index.d.ts +2 -1
- package/dist/types/manifest.d.ts +5 -3
- package/dist/types/manifest.js +3 -1
- package/dist/types/module.d.ts +4 -2
- package/dist/types/module.js +3 -1
- package/dist/types/settings.d.ts +81 -0
- package/dist/types/settings.js +6 -0
- package/dist/ui/badge.d.ts +2 -0
- package/dist/ui/button.d.ts +6 -0
- package/dist/ui/button.js +5 -0
- package/dist/ui/combobox.d.ts +3 -0
- package/dist/ui/combobox.js +1 -0
- package/package.json +1 -1
package/dist/types/context.d.ts
CHANGED
|
@@ -1,86 +1,15 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @page Background Context
|
|
3
|
+
* The context object the shell passes to a plugin's background module — ctx — and its accessors.
|
|
3
4
|
*
|
|
4
|
-
* Defines the context objects the shell provides to plugins
|
|
5
|
-
*
|
|
5
|
+
* Defines the context objects the shell provides to background plugins
|
|
6
|
+
* (main process). For the renderer-facing surface see context-ui.ts.
|
|
6
7
|
*/
|
|
7
8
|
import type { AxiosInstance } from "axios";
|
|
8
|
-
import type {
|
|
9
|
+
import type { FlightPhasePayload, FlightPhaseSnapshot, SimDataSnapshot } from "../shared-types/simulator";
|
|
10
|
+
import type { EventCategory, FlightLogEvent } from "../shared-types/flight-events";
|
|
11
|
+
import type { FlightLandingPayload, LandingAnalysisSnapshot } from "../shared-types/landing";
|
|
9
12
|
import type { FlightManagerPayload, FlightPlan } from "../shared-types/flight-manager";
|
|
10
|
-
/** All supported setting control types */
|
|
11
|
-
export type PluginSettingType = "boolean" | "text" | "longtext" | "number" | "range" | "list" | "radio" | "date" | "json";
|
|
12
|
-
/** Option entry for list and radio settings */
|
|
13
|
-
export type PluginSettingOption = {
|
|
14
|
-
value: string;
|
|
15
|
-
label: string;
|
|
16
|
-
};
|
|
17
|
-
/** Base fields shared by all setting definitions */
|
|
18
|
-
type PluginSettingBase = {
|
|
19
|
-
key: string;
|
|
20
|
-
name: string;
|
|
21
|
-
description?: string;
|
|
22
|
-
scope: "user" | "airline";
|
|
23
|
-
};
|
|
24
|
-
/** Boolean setting — rendered as a Switch */
|
|
25
|
-
export type BooleanSettingDef = PluginSettingBase & {
|
|
26
|
-
type: "boolean";
|
|
27
|
-
default?: boolean;
|
|
28
|
-
};
|
|
29
|
-
/** Text setting — rendered as an Input */
|
|
30
|
-
export type TextSettingDef = PluginSettingBase & {
|
|
31
|
-
type: "text";
|
|
32
|
-
default?: string;
|
|
33
|
-
pattern?: string;
|
|
34
|
-
placeholder?: string;
|
|
35
|
-
};
|
|
36
|
-
/** Long text setting — rendered as a Textarea */
|
|
37
|
-
export type LongtextSettingDef = PluginSettingBase & {
|
|
38
|
-
type: "longtext";
|
|
39
|
-
default?: string;
|
|
40
|
-
placeholder?: string;
|
|
41
|
-
};
|
|
42
|
-
/** Number setting — rendered as a Number Input */
|
|
43
|
-
export type NumberSettingDef = PluginSettingBase & {
|
|
44
|
-
type: "number";
|
|
45
|
-
default?: number;
|
|
46
|
-
min?: number;
|
|
47
|
-
max?: number;
|
|
48
|
-
step?: number;
|
|
49
|
-
};
|
|
50
|
-
/** Range setting — rendered as a Slider + value label */
|
|
51
|
-
export type RangeSettingDef = PluginSettingBase & {
|
|
52
|
-
type: "range";
|
|
53
|
-
default?: number;
|
|
54
|
-
min: number;
|
|
55
|
-
max: number;
|
|
56
|
-
step?: number;
|
|
57
|
-
};
|
|
58
|
-
/** List setting — rendered as a Select dropdown */
|
|
59
|
-
export type ListSettingDef = PluginSettingBase & {
|
|
60
|
-
type: "list";
|
|
61
|
-
default?: string;
|
|
62
|
-
options: PluginSettingOption[];
|
|
63
|
-
};
|
|
64
|
-
/** Radio setting — rendered as a Radio group */
|
|
65
|
-
export type RadioSettingDef = PluginSettingBase & {
|
|
66
|
-
type: "radio";
|
|
67
|
-
default?: string;
|
|
68
|
-
options: PluginSettingOption[];
|
|
69
|
-
};
|
|
70
|
-
/** Date setting — rendered as a Date input */
|
|
71
|
-
export type DateSettingDef = PluginSettingBase & {
|
|
72
|
-
type: "date";
|
|
73
|
-
default?: string;
|
|
74
|
-
};
|
|
75
|
-
/** JSON setting — rendered as a monospace Textarea */
|
|
76
|
-
export type JsonSettingDef = PluginSettingBase & {
|
|
77
|
-
type: "json";
|
|
78
|
-
default?: string;
|
|
79
|
-
};
|
|
80
|
-
/** Discriminated union of all setting definitions */
|
|
81
|
-
export type PluginSettingDefinition = BooleanSettingDef | TextSettingDef | LongtextSettingDef | NumberSettingDef | RangeSettingDef | ListSettingDef | RadioSettingDef | DateSettingDef | JsonSettingDef;
|
|
82
|
-
/** Array of available settings declared by a plugin */
|
|
83
|
-
export type PluginAvailableSettings = PluginSettingDefinition[];
|
|
84
13
|
/** Scoped logger provided to background plugins (prefixed with plugin ID) */
|
|
85
14
|
export type PluginLogger = {
|
|
86
15
|
info(category: string, message: string, ...args: unknown[]): void;
|
|
@@ -272,6 +201,95 @@ export type PluginToastInput = {
|
|
|
272
201
|
};
|
|
273
202
|
/** Fixed shell-bundled sound catalogue. No plugin-supplied audio. */
|
|
274
203
|
export type PluginAlertSound = "alert" | "warning" | "error" | "success" | "chime";
|
|
204
|
+
/** Input for `ctx.dialog.alert`. */
|
|
205
|
+
export type PluginDialogAlertInput = {
|
|
206
|
+
title: string;
|
|
207
|
+
message: string;
|
|
208
|
+
/** Acknowledge-button label. Default "OK". */
|
|
209
|
+
okLabel?: string;
|
|
210
|
+
/** Optional auto-cancel; on expiry the call resolves (void). */
|
|
211
|
+
timeoutMs?: number;
|
|
212
|
+
};
|
|
213
|
+
/** Input for `ctx.dialog.confirm`. */
|
|
214
|
+
export type PluginDialogConfirmInput = {
|
|
215
|
+
title: string;
|
|
216
|
+
message: string;
|
|
217
|
+
/** Confirm-button label. Default "Confirm". */
|
|
218
|
+
confirmLabel?: string;
|
|
219
|
+
/** Cancel-button label. Default "Cancel". */
|
|
220
|
+
cancelLabel?: string;
|
|
221
|
+
/** Optional auto-cancel; on expiry the call resolves false. */
|
|
222
|
+
timeoutMs?: number;
|
|
223
|
+
};
|
|
224
|
+
/** Input for `ctx.prompt.text`. */
|
|
225
|
+
export type PluginPromptTextInput = {
|
|
226
|
+
title: string;
|
|
227
|
+
/** Field label, e.g. "What gate are you departing from?". */
|
|
228
|
+
label: string;
|
|
229
|
+
/** Optional helper/body text shown above the field. */
|
|
230
|
+
message?: string;
|
|
231
|
+
placeholder?: string;
|
|
232
|
+
defaultValue?: string;
|
|
233
|
+
/** When true, Submit is disabled until the field is non-empty. */
|
|
234
|
+
required?: boolean;
|
|
235
|
+
maxLength?: number;
|
|
236
|
+
submitLabel?: string;
|
|
237
|
+
cancelLabel?: string;
|
|
238
|
+
timeoutMs?: number;
|
|
239
|
+
};
|
|
240
|
+
/** Input for `ctx.prompt.number`. */
|
|
241
|
+
export type PluginPromptNumberInput = {
|
|
242
|
+
title: string;
|
|
243
|
+
label: string;
|
|
244
|
+
message?: string;
|
|
245
|
+
placeholder?: string;
|
|
246
|
+
defaultValue?: number;
|
|
247
|
+
required?: boolean;
|
|
248
|
+
min?: number;
|
|
249
|
+
max?: number;
|
|
250
|
+
step?: number;
|
|
251
|
+
submitLabel?: string;
|
|
252
|
+
cancelLabel?: string;
|
|
253
|
+
timeoutMs?: number;
|
|
254
|
+
};
|
|
255
|
+
/** Input for `ctx.prompt.select`. */
|
|
256
|
+
export type PluginPromptSelectInput = {
|
|
257
|
+
title: string;
|
|
258
|
+
label: string;
|
|
259
|
+
message?: string;
|
|
260
|
+
options: {
|
|
261
|
+
value: string;
|
|
262
|
+
label: string;
|
|
263
|
+
}[];
|
|
264
|
+
/** Pre-selected option value. */
|
|
265
|
+
defaultValue?: string;
|
|
266
|
+
required?: boolean;
|
|
267
|
+
submitLabel?: string;
|
|
268
|
+
cancelLabel?: string;
|
|
269
|
+
timeoutMs?: number;
|
|
270
|
+
};
|
|
271
|
+
/**
|
|
272
|
+
* Message-centric dialogs. The pilot reads a message and clicks a button.
|
|
273
|
+
* Backs `ctx.dialog`.
|
|
274
|
+
*/
|
|
275
|
+
export type PluginDialogApi = {
|
|
276
|
+
/** Show a blocking message with a single acknowledge button. */
|
|
277
|
+
alert(input: PluginDialogAlertInput): Promise<void>;
|
|
278
|
+
/** Ask a yes/no question. Resolves false on cancel/dismiss/timeout. */
|
|
279
|
+
confirm(input: PluginDialogConfirmInput): Promise<boolean>;
|
|
280
|
+
};
|
|
281
|
+
/**
|
|
282
|
+
* Input-centric prompts. The pilot provides a value. Backs `ctx.prompt`.
|
|
283
|
+
* All resolve null on cancel/dismiss/timeout.
|
|
284
|
+
*/
|
|
285
|
+
export type PluginPromptApi = {
|
|
286
|
+
/** Ask for free text. */
|
|
287
|
+
text(input: PluginPromptTextInput): Promise<string | null>;
|
|
288
|
+
/** Ask for a number. A non-numeric/blank submit resolves null. */
|
|
289
|
+
number(input: PluginPromptNumberInput): Promise<number | null>;
|
|
290
|
+
/** Ask the pilot to pick one of the supplied options. Returns the value. */
|
|
291
|
+
select(input: PluginPromptSelectInput): Promise<string | null>;
|
|
292
|
+
};
|
|
275
293
|
/**
|
|
276
294
|
* Context passed to a plugin's background onStart() function.
|
|
277
295
|
* Provides scoped access to shell infrastructure.
|
|
@@ -298,100 +316,9 @@ export type PluginContext = {
|
|
|
298
316
|
flight: PluginFlightAccessor;
|
|
299
317
|
/** Toast + sound surface. */
|
|
300
318
|
notify: PluginNotifier;
|
|
319
|
+
/** Blocking, awaited message dialogs (alert/confirm). */
|
|
320
|
+
dialog: PluginDialogApi;
|
|
321
|
+
/** Blocking, awaited input prompts (text/number/select). */
|
|
322
|
+
prompt: PluginPromptApi;
|
|
301
323
|
};
|
|
302
|
-
/** Pilot user profile provided by the shell's auth system */
|
|
303
|
-
export type PluginPilotUser = {
|
|
304
|
-
dbID: number;
|
|
305
|
-
pilotID: string;
|
|
306
|
-
firstName: string;
|
|
307
|
-
lastName: string;
|
|
308
|
-
email: string;
|
|
309
|
-
rank: string;
|
|
310
|
-
rankLevel: number;
|
|
311
|
-
rankImage: string;
|
|
312
|
-
avatar: string;
|
|
313
|
-
};
|
|
314
|
-
/** Navigation helper for plugin UI components */
|
|
315
|
-
export type PluginNavigationHelper = {
|
|
316
|
-
/** Navigate to a route within this plugin */
|
|
317
|
-
navigateTo(path: string): void;
|
|
318
|
-
/** Navigate to a route in another plugin */
|
|
319
|
-
navigateToPlugin(pluginId: string, path: string): void;
|
|
320
|
-
/** Navigate to a shell route */
|
|
321
|
-
navigateToShell(path: string): void;
|
|
322
|
-
/** Get the current route path */
|
|
323
|
-
getCurrentPath(): string;
|
|
324
|
-
};
|
|
325
|
-
/** Toast/notification API for plugin UI */
|
|
326
|
-
export type PluginToastAPI = {
|
|
327
|
-
success(message: string): void;
|
|
328
|
-
error(message: string): void;
|
|
329
|
-
info(message: string): void;
|
|
330
|
-
warning(message: string): void;
|
|
331
|
-
};
|
|
332
|
-
/**
|
|
333
|
-
* UI context available to plugin renderer components via React context.
|
|
334
|
-
* Provides shared hooks and utilities from the shell.
|
|
335
|
-
*/
|
|
336
|
-
export type PluginUIContext = {
|
|
337
|
-
/**
|
|
338
|
-
* Shared axios instance for the bound airline's API, with auto-refresh on
|
|
339
|
-
* 401. Provided by the shell so all plugin UIs and the shell itself share
|
|
340
|
-
* one in-flight refresh promise — concurrent 401s coalesce to a single
|
|
341
|
-
* `POST /api/auth/va/refresh`. Reach this through `useVaApi()`.
|
|
342
|
-
*/
|
|
343
|
-
vaApi: AxiosInstance;
|
|
344
|
-
/** The plugin's unique ID */
|
|
345
|
-
pluginId: string;
|
|
346
|
-
/** Auth state from the shell */
|
|
347
|
-
auth: {
|
|
348
|
-
isAuthenticated: boolean;
|
|
349
|
-
token: string | null;
|
|
350
|
-
user: PluginPilotUser | null;
|
|
351
|
-
};
|
|
352
|
-
/** Current airline info (from Stratos API). Bundled with the VA bearer
|
|
353
|
-
* so plugins can call the airline backend directly. */
|
|
354
|
-
airline?: {
|
|
355
|
-
id: string;
|
|
356
|
-
name: string;
|
|
357
|
-
icao: string;
|
|
358
|
-
logo_light: string;
|
|
359
|
-
logo_dark: string;
|
|
360
|
-
/** Origin of the VA's API (no trailing slash). */
|
|
361
|
-
base_url: string;
|
|
362
|
-
/** Bearer for this airline's API. Null if the VA session has expired. */
|
|
363
|
-
token: string | null;
|
|
364
|
-
} | null;
|
|
365
|
-
/** Config access hooks */
|
|
366
|
-
config: {
|
|
367
|
-
get<T>(key: string): T | undefined;
|
|
368
|
-
get<T>(key: string, defaultValue: T): T;
|
|
369
|
-
};
|
|
370
|
-
/**
|
|
371
|
-
* Real-time bridge between this plugin's background and UI modules.
|
|
372
|
-
*
|
|
373
|
-
* - `on(event, handler)` subscribes to broadcasts the background made via
|
|
374
|
-
* `ctx.ipc.send(event, payload)`. The shell scopes the channel to the
|
|
375
|
-
* current plugin id automatically — pass the leaf event name on both
|
|
376
|
-
* ends. Plugin A's UI cannot receive plugin B's broadcasts.
|
|
377
|
-
* - `off(event, handler)` removes a previously registered handler.
|
|
378
|
-
* - `emit` is intentionally not implemented. Send UI→background traffic
|
|
379
|
-
* through HTTP routes registered via `ctx.server.registerRouter`.
|
|
380
|
-
* - `connected` is always `true` in the renderer; the underlying Electron
|
|
381
|
-
* IPC pipe has no connection lifecycle.
|
|
382
|
-
*/
|
|
383
|
-
socket: {
|
|
384
|
-
connected: boolean;
|
|
385
|
-
emit(event: string, data: unknown): void;
|
|
386
|
-
on(event: string, handler: (data: unknown) => void): void;
|
|
387
|
-
off(event: string, handler: (data: unknown) => void): void;
|
|
388
|
-
};
|
|
389
|
-
/** Navigation utilities */
|
|
390
|
-
navigation: PluginNavigationHelper;
|
|
391
|
-
/** Toast/notification API */
|
|
392
|
-
toast: PluginToastAPI;
|
|
393
|
-
/** Scoped logger for renderer-side logging */
|
|
394
|
-
logger: PluginLogger;
|
|
395
|
-
};
|
|
396
|
-
export {};
|
|
397
324
|
//# sourceMappingURL=context.d.ts.map
|
package/dist/types/context.js
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* @page Background Context
|
|
3
|
+
* The context object the shell passes to a plugin's background module — ctx — and its accessors.
|
|
3
4
|
*
|
|
4
|
-
* Defines the context objects the shell provides to plugins
|
|
5
|
-
*
|
|
5
|
+
* Defines the context objects the shell provides to background plugins
|
|
6
|
+
* (main process). For the renderer-facing surface see context-ui.ts.
|
|
6
7
|
*/
|
|
7
8
|
export {};
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export type { PluginAuthor, PluginManifest } from "./manifest";
|
|
2
|
-
export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger,
|
|
2
|
+
export type { PluginAirline, PluginAirlineAccessor, PluginAuthAccessor, PluginConfigStore, PluginContext, PluginDatabaseAccessor, PluginIPCRegistrar, PluginLogger, PluginServerRegistrar, PluginFlightAccessor, PluginFlightLogWriter, PluginFlightLogInput, PluginFlightLogPatch, PluginStartGuard, PluginStartContext, PluginStartDecision, PluginNotifier, PluginToastInput, PluginAlertSound, } from "./context";
|
|
3
|
+
export type { PluginNavigationHelper, PluginToastAPI, PluginUIContext, } from "./context-ui";
|
|
3
4
|
export type { PluginBackgroundModule, PluginRouteComponent, PluginUIModule, } from "./module";
|
|
4
5
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/types/manifest.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Plugin
|
|
2
|
+
* Plugin manifest schema — the contents of every plugin's plugin.json.
|
|
3
3
|
*
|
|
4
4
|
* Defines the structure of a plugin's plugin.json file.
|
|
5
5
|
* Every plugin must include a valid plugin.json at its root.
|
|
@@ -7,13 +7,15 @@
|
|
|
7
7
|
* Background and UI modules are discovered by convention:
|
|
8
8
|
* - background/index.js — background service entry point
|
|
9
9
|
* - ui/index.js — renderer UI entry point
|
|
10
|
+
*
|
|
11
|
+
* @page Manifest
|
|
10
12
|
*/
|
|
11
|
-
import type { PluginSettingDefinition } from "./
|
|
13
|
+
import type { PluginSettingDefinition } from "./settings";
|
|
12
14
|
/** Plugin author information */
|
|
13
15
|
export type PluginAuthor = {
|
|
14
16
|
/** Unique developer slug (e.g. "skyvex-software") */
|
|
15
17
|
id: string;
|
|
16
|
-
/** Display name (e.g. "
|
|
18
|
+
/** Display name (e.g. "Skyvex Software") */
|
|
17
19
|
name: string;
|
|
18
20
|
/** Contact email address (optional) */
|
|
19
21
|
contact?: string;
|
package/dist/types/manifest.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Plugin
|
|
2
|
+
* Plugin manifest schema — the contents of every plugin's plugin.json.
|
|
3
3
|
*
|
|
4
4
|
* Defines the structure of a plugin's plugin.json file.
|
|
5
5
|
* Every plugin must include a valid plugin.json at its root.
|
|
@@ -7,5 +7,7 @@
|
|
|
7
7
|
* Background and UI modules are discovered by convention:
|
|
8
8
|
* - background/index.js — background service entry point
|
|
9
9
|
* - ui/index.js — renderer UI entry point
|
|
10
|
+
*
|
|
11
|
+
* @page Manifest
|
|
10
12
|
*/
|
|
11
13
|
export {};
|
package/dist/types/module.d.ts
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
|
-
*
|
|
2
|
+
* The background and UI module shapes a plugin's entry points must satisfy.
|
|
3
3
|
*
|
|
4
4
|
* Defines the export shapes for plugin background and UI modules.
|
|
5
|
+
*
|
|
6
|
+
* @page Modules
|
|
5
7
|
*/
|
|
6
8
|
import type { ComponentType, LazyExoticComponent } from "react";
|
|
7
9
|
import type { PluginContext } from "./context";
|
|
@@ -10,7 +12,7 @@ import type { PluginContext } from "./context";
|
|
|
10
12
|
* Each plugin's background entry module must export these functions.
|
|
11
13
|
*/
|
|
12
14
|
export type PluginBackgroundModule = {
|
|
13
|
-
/** Called during shell startup after auth is
|
|
15
|
+
/** Called during shell startup after auth is initialised */
|
|
14
16
|
onStart(ctx: PluginContext): Promise<void>;
|
|
15
17
|
/** Called during shell shutdown for graceful teardown */
|
|
16
18
|
onStop(ctx: PluginContext): Promise<void>;
|
package/dist/types/module.js
CHANGED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @page Settings
|
|
3
|
+
*
|
|
4
|
+
* Typed plugin setting definitions — the controls a plugin declares in its manifest's availableSettings.
|
|
5
|
+
*/
|
|
6
|
+
/** All supported setting control types */
|
|
7
|
+
export type PluginSettingType = "boolean" | "text" | "longtext" | "number" | "range" | "list" | "radio" | "date" | "json";
|
|
8
|
+
/** Option entry for list and radio settings */
|
|
9
|
+
export type PluginSettingOption = {
|
|
10
|
+
value: string;
|
|
11
|
+
label: string;
|
|
12
|
+
};
|
|
13
|
+
/** Base fields shared by all setting definitions */
|
|
14
|
+
type PluginSettingBase = {
|
|
15
|
+
key: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
scope: "user" | "airline";
|
|
19
|
+
};
|
|
20
|
+
/** Boolean setting — rendered as a Switch */
|
|
21
|
+
export type BooleanSettingDef = PluginSettingBase & {
|
|
22
|
+
type: "boolean";
|
|
23
|
+
default?: boolean;
|
|
24
|
+
};
|
|
25
|
+
/** Text setting — rendered as an Input */
|
|
26
|
+
export type TextSettingDef = PluginSettingBase & {
|
|
27
|
+
type: "text";
|
|
28
|
+
default?: string;
|
|
29
|
+
pattern?: string;
|
|
30
|
+
placeholder?: string;
|
|
31
|
+
};
|
|
32
|
+
/** Long text setting — rendered as a Textarea */
|
|
33
|
+
export type LongtextSettingDef = PluginSettingBase & {
|
|
34
|
+
type: "longtext";
|
|
35
|
+
default?: string;
|
|
36
|
+
placeholder?: string;
|
|
37
|
+
};
|
|
38
|
+
/** Number setting — rendered as a Number Input */
|
|
39
|
+
export type NumberSettingDef = PluginSettingBase & {
|
|
40
|
+
type: "number";
|
|
41
|
+
default?: number;
|
|
42
|
+
min?: number;
|
|
43
|
+
max?: number;
|
|
44
|
+
step?: number;
|
|
45
|
+
};
|
|
46
|
+
/** Range setting — rendered as a Slider + value label */
|
|
47
|
+
export type RangeSettingDef = PluginSettingBase & {
|
|
48
|
+
type: "range";
|
|
49
|
+
default?: number;
|
|
50
|
+
min: number;
|
|
51
|
+
max: number;
|
|
52
|
+
step?: number;
|
|
53
|
+
};
|
|
54
|
+
/** List setting — rendered as a Select dropdown */
|
|
55
|
+
export type ListSettingDef = PluginSettingBase & {
|
|
56
|
+
type: "list";
|
|
57
|
+
default?: string;
|
|
58
|
+
options: PluginSettingOption[];
|
|
59
|
+
};
|
|
60
|
+
/** Radio setting — rendered as a Radio group */
|
|
61
|
+
export type RadioSettingDef = PluginSettingBase & {
|
|
62
|
+
type: "radio";
|
|
63
|
+
default?: string;
|
|
64
|
+
options: PluginSettingOption[];
|
|
65
|
+
};
|
|
66
|
+
/** Date setting — rendered as a Date input */
|
|
67
|
+
export type DateSettingDef = PluginSettingBase & {
|
|
68
|
+
type: "date";
|
|
69
|
+
default?: string;
|
|
70
|
+
};
|
|
71
|
+
/** JSON setting — rendered as a monospace Textarea */
|
|
72
|
+
export type JsonSettingDef = PluginSettingBase & {
|
|
73
|
+
type: "json";
|
|
74
|
+
default?: string;
|
|
75
|
+
};
|
|
76
|
+
/** Discriminated union of all setting definitions */
|
|
77
|
+
export type PluginSettingDefinition = BooleanSettingDef | TextSettingDef | LongtextSettingDef | NumberSettingDef | RangeSettingDef | ListSettingDef | RadioSettingDef | DateSettingDef | JsonSettingDef;
|
|
78
|
+
/** Array of available settings declared by a plugin */
|
|
79
|
+
export type PluginAvailableSettings = PluginSettingDefinition[];
|
|
80
|
+
export {};
|
|
81
|
+
//# sourceMappingURL=settings.d.ts.map
|
package/dist/ui/badge.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
+
/** @page UI Component Props */
|
|
1
2
|
import * as React from "react";
|
|
2
3
|
import { type VariantProps } from "class-variance-authority";
|
|
3
4
|
declare const badgeVariants: (props?: ({
|
|
4
5
|
variant?: "default" | "destructive" | "outline" | "secondary" | null | undefined;
|
|
5
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
|
+
/** Props for the `Badge` component, extending native div attributes with CVA variants. */
|
|
6
8
|
export type BadgeProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof badgeVariants>;
|
|
7
9
|
declare function Badge({ className, variant, ...props }: BadgeProps): import("react/jsx-runtime").JSX.Element;
|
|
8
10
|
export { Badge, badgeVariants };
|
package/dist/ui/button.d.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @page UI Component Props
|
|
3
|
+
*
|
|
4
|
+
* Prop types for the shared SDK UI primitives.
|
|
5
|
+
*/
|
|
1
6
|
import * as React from "react";
|
|
2
7
|
import { type VariantProps } from "class-variance-authority";
|
|
3
8
|
declare const buttonVariants: (props?: ({
|
|
4
9
|
variant?: "link" | "default" | "destructive" | "outline" | "secondary" | "ghost" | "pill-pause" | "pill-resume" | "pill-end" | "pill-submit" | null | undefined;
|
|
5
10
|
size?: "default" | "sm" | "lg" | "icon" | "pill" | null | undefined;
|
|
6
11
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
12
|
+
/** Props for the `Button` component, extending native button attributes with CVA variants. */
|
|
7
13
|
export type ButtonProps = React.ButtonHTMLAttributes<HTMLButtonElement> & VariantProps<typeof buttonVariants> & {
|
|
8
14
|
asChild?: boolean;
|
|
9
15
|
};
|
package/dist/ui/button.js
CHANGED
|
@@ -1,4 +1,9 @@
|
|
|
1
1
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
/**
|
|
3
|
+
* @page UI Component Props
|
|
4
|
+
*
|
|
5
|
+
* Prop types for the shared SDK UI primitives.
|
|
6
|
+
*/
|
|
2
7
|
import * as React from "react";
|
|
3
8
|
import { Slot } from "@radix-ui/react-slot";
|
|
4
9
|
import { cva } from "class-variance-authority";
|
package/dist/ui/combobox.d.ts
CHANGED
|
@@ -1,7 +1,10 @@
|
|
|
1
|
+
/** @page UI Component Props */
|
|
2
|
+
/** A single selectable option in the `Combobox` list. */
|
|
1
3
|
export type ComboboxOption = {
|
|
2
4
|
value: string;
|
|
3
5
|
label: string;
|
|
4
6
|
};
|
|
7
|
+
/** Props for the searchable single-select `Combobox` component. */
|
|
5
8
|
export type ComboboxProps = {
|
|
6
9
|
options: ComboboxOption[];
|
|
7
10
|
value?: string;
|
package/dist/ui/combobox.js
CHANGED