@skyvexsoftware/stratos-sdk 0.15.3 → 0.16.2
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/hooks/useTrackingSession.d.ts +6 -0
- package/dist/hooks/useTrackingSession.js +11 -0
- package/dist/shared-types/flight-manager.d.ts +7 -0
- package/dist/shims/react.d.ts +3 -0
- package/dist/shims/react.js +3 -0
- package/dist/ui/alert-dialog.d.ts +2 -2
- package/dist/ui/badge.d.ts +1 -1
- package/dist/ui/card.d.ts +7 -7
- package/dist/ui/combobox.d.ts +2 -1
- package/dist/ui/dialog.d.ts +2 -2
- package/dist/ui/input.d.ts +1 -1
- package/dist/ui/label.d.ts +1 -1
- package/dist/ui/textarea.d.ts +1 -1
- package/package.json +1 -1
|
@@ -25,6 +25,8 @@ type UseTrackingSessionReturn = {
|
|
|
25
25
|
* recovery dialog.
|
|
26
26
|
*/
|
|
27
27
|
reconnecting: boolean;
|
|
28
|
+
/** Reason tracking is suspended; null when not suspended. */
|
|
29
|
+
suspendReason: string | null;
|
|
28
30
|
currentFlight: CurrentFlight | null;
|
|
29
31
|
pendingRecovery: RecoverableFlight | null;
|
|
30
32
|
elapsedTime: number;
|
|
@@ -38,6 +40,10 @@ type UseTrackingSessionReturn = {
|
|
|
38
40
|
success: boolean;
|
|
39
41
|
error?: string;
|
|
40
42
|
}>;
|
|
43
|
+
/** Pilot-reported online network for the current flight ("offline" when none selected). */
|
|
44
|
+
network: string;
|
|
45
|
+
/** Set the pilot-reported online network. Resolves false when no flight is in progress. */
|
|
46
|
+
setNetwork: (network: string) => Promise<boolean>;
|
|
41
47
|
recoverFlight: () => Promise<boolean>;
|
|
42
48
|
dismissRecovery: () => Promise<boolean>;
|
|
43
49
|
isLoading: boolean;
|
|
@@ -56,6 +56,7 @@ export function useTrackingSession() {
|
|
|
56
56
|
pendingRecovery: payload.pendingRecovery,
|
|
57
57
|
simDisconnected: payload.simDisconnected,
|
|
58
58
|
reconnecting: payload.reconnecting,
|
|
59
|
+
suspendReason: payload.suspendReason ?? null,
|
|
59
60
|
});
|
|
60
61
|
};
|
|
61
62
|
// Refetch on socket connect — catches flights started before the UI loaded
|
|
@@ -73,6 +74,7 @@ export function useTrackingSession() {
|
|
|
73
74
|
const pendingRecovery = stateData?.pendingRecovery ?? null;
|
|
74
75
|
const simDisconnected = stateData?.simDisconnected ?? false;
|
|
75
76
|
const reconnecting = stateData?.reconnecting ?? false;
|
|
77
|
+
const suspendReason = stateData?.suspendReason ?? null;
|
|
76
78
|
const startFlight = useCallback(async (plan, options) => {
|
|
77
79
|
const result = await api("/start", "POST", { flightPlan: plan, options });
|
|
78
80
|
return result.data;
|
|
@@ -89,6 +91,12 @@ export function useTrackingSession() {
|
|
|
89
91
|
const result = await api("/end", "POST", { status });
|
|
90
92
|
return { success: result.success, error: result.error };
|
|
91
93
|
}, []);
|
|
94
|
+
const setNetwork = useCallback(async (network) => {
|
|
95
|
+
const result = await api("/network", "POST", {
|
|
96
|
+
network,
|
|
97
|
+
});
|
|
98
|
+
return result.success;
|
|
99
|
+
}, []);
|
|
92
100
|
const recoverFlight = useCallback(async () => {
|
|
93
101
|
const result = await api("/recover", "POST");
|
|
94
102
|
if (result.success) {
|
|
@@ -149,6 +157,7 @@ export function useTrackingSession() {
|
|
|
149
157
|
isPaused: flight?.status === "paused",
|
|
150
158
|
simDisconnected,
|
|
151
159
|
reconnecting,
|
|
160
|
+
suspendReason,
|
|
152
161
|
currentFlight: flight,
|
|
153
162
|
pendingRecovery,
|
|
154
163
|
elapsedTime,
|
|
@@ -157,6 +166,8 @@ export function useTrackingSession() {
|
|
|
157
166
|
pauseFlight,
|
|
158
167
|
resumeFlight,
|
|
159
168
|
endFlight,
|
|
169
|
+
network: flight?.network ?? "offline",
|
|
170
|
+
setNetwork,
|
|
160
171
|
recoverFlight,
|
|
161
172
|
dismissRecovery,
|
|
162
173
|
isLoading,
|
|
@@ -64,6 +64,11 @@ export type CurrentFlight = {
|
|
|
64
64
|
updatesSent: number;
|
|
65
65
|
updateIntervalMs: number;
|
|
66
66
|
comments: FlightComment[];
|
|
67
|
+
/**
|
|
68
|
+
* Pilot-reported online network for this flight (e.g. "vatsim").
|
|
69
|
+
* "offline" by default; resets on every flight start.
|
|
70
|
+
*/
|
|
71
|
+
network: string;
|
|
67
72
|
lastError: string | null;
|
|
68
73
|
};
|
|
69
74
|
/** Comment attached to an active flight */
|
|
@@ -127,6 +132,8 @@ export type FlightManagerPayload = {
|
|
|
127
132
|
* never resume silently without the pilot seeing it.
|
|
128
133
|
*/
|
|
129
134
|
reconnecting: boolean;
|
|
135
|
+
/** Why tracking is suspended (continuity gate asserted a discontinuity), or null. Present whenever `simDisconnected` is true. */
|
|
136
|
+
suspendReason?: string | null;
|
|
130
137
|
timestamp: number;
|
|
131
138
|
};
|
|
132
139
|
/** Result returned from startFlight */
|
package/dist/shims/react.d.ts
CHANGED
|
@@ -3,7 +3,9 @@ export default _default;
|
|
|
3
3
|
export declare const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE: any;
|
|
4
4
|
export declare const __COMPILER_RUNTIME: any;
|
|
5
5
|
export declare const act: any;
|
|
6
|
+
export declare const Activity: any;
|
|
6
7
|
export declare const cache: any;
|
|
8
|
+
export declare const cacheSignal: any;
|
|
7
9
|
export declare const captureOwnerStack: any;
|
|
8
10
|
export declare const Children: any;
|
|
9
11
|
export declare const cloneElement: any;
|
|
@@ -29,6 +31,7 @@ export declare const useContext: any;
|
|
|
29
31
|
export declare const useDebugValue: any;
|
|
30
32
|
export declare const useDeferredValue: any;
|
|
31
33
|
export declare const useEffect: any;
|
|
34
|
+
export declare const useEffectEvent: any;
|
|
32
35
|
export declare const useId: any;
|
|
33
36
|
export declare const useImperativeHandle: any;
|
|
34
37
|
export declare const useInsertionEffect: any;
|
package/dist/shims/react.js
CHANGED
|
@@ -10,7 +10,9 @@ export default __m.default ?? __m;
|
|
|
10
10
|
export const __CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE = __m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;
|
|
11
11
|
export const __COMPILER_RUNTIME = __m.__COMPILER_RUNTIME;
|
|
12
12
|
export const act = __m.act;
|
|
13
|
+
export const Activity = __m.Activity;
|
|
13
14
|
export const cache = __m.cache;
|
|
15
|
+
export const cacheSignal = __m.cacheSignal;
|
|
14
16
|
export const captureOwnerStack = __m.captureOwnerStack;
|
|
15
17
|
export const Children = __m.Children;
|
|
16
18
|
export const cloneElement = __m.cloneElement;
|
|
@@ -36,6 +38,7 @@ export const useContext = __m.useContext;
|
|
|
36
38
|
export const useDebugValue = __m.useDebugValue;
|
|
37
39
|
export const useDeferredValue = __m.useDeferredValue;
|
|
38
40
|
export const useEffect = __m.useEffect;
|
|
41
|
+
export const useEffectEvent = __m.useEffectEvent;
|
|
39
42
|
export const useId = __m.useId;
|
|
40
43
|
export const useImperativeHandle = __m.useImperativeHandle;
|
|
41
44
|
export const useInsertionEffect = __m.useInsertionEffect;
|
|
@@ -6,11 +6,11 @@ declare const AlertDialogPortal: React.FC<AlertDialogPrimitive.AlertDialogPortal
|
|
|
6
6
|
declare const AlertDialogOverlay: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
7
7
|
declare const AlertDialogContent: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const AlertDialogHeader: {
|
|
9
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>):
|
|
9
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
10
10
|
displayName: string;
|
|
11
11
|
};
|
|
12
12
|
declare const AlertDialogFooter: {
|
|
13
|
-
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>):
|
|
13
|
+
({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
14
14
|
displayName: string;
|
|
15
15
|
};
|
|
16
16
|
declare const AlertDialogTitle: React.ForwardRefExoticComponent<Omit<AlertDialogPrimitive.AlertDialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
package/dist/ui/badge.d.ts
CHANGED
|
@@ -6,6 +6,6 @@ declare const badgeVariants: (props?: ({
|
|
|
6
6
|
} & import("class-variance-authority/types").ClassProp) | undefined) => string;
|
|
7
7
|
/** Props for the `Badge` component, extending native div attributes with CVA variants. */
|
|
8
8
|
export type BadgeProps = React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof badgeVariants>;
|
|
9
|
-
declare function Badge({ className, variant, ...props }: BadgeProps):
|
|
9
|
+
declare function Badge({ className, variant, ...props }: BadgeProps): React.JSX.Element;
|
|
10
10
|
export { Badge, badgeVariants };
|
|
11
11
|
//# sourceMappingURL=badge.d.ts.map
|
package/dist/ui/card.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare function Card({ className, ...props }: React.ComponentProps<"div">):
|
|
3
|
-
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">):
|
|
4
|
-
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">):
|
|
5
|
-
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">):
|
|
6
|
-
declare function CardAction({ className, ...props }: React.ComponentProps<"div">):
|
|
7
|
-
declare function CardContent({ className, ...props }: React.ComponentProps<"div">):
|
|
8
|
-
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">):
|
|
2
|
+
declare function Card({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
3
|
+
declare function CardHeader({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
4
|
+
declare function CardTitle({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
5
|
+
declare function CardDescription({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
6
|
+
declare function CardAction({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
7
|
+
declare function CardContent({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
8
|
+
declare function CardFooter({ className, ...props }: React.ComponentProps<"div">): React.JSX.Element;
|
|
9
9
|
export { Card, CardHeader, CardFooter, CardTitle, CardAction, CardDescription, CardContent, };
|
|
10
10
|
//# sourceMappingURL=card.d.ts.map
|
package/dist/ui/combobox.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
/** @page UI Component Props */
|
|
2
|
+
import * as React from "react";
|
|
2
3
|
/** A single selectable option in the `Combobox` list. */
|
|
3
4
|
export type ComboboxOption = {
|
|
4
5
|
value: string;
|
|
@@ -30,5 +31,5 @@ export type ComboboxProps = {
|
|
|
30
31
|
* selected option with a check. Pass `loading` while options are being
|
|
31
32
|
* fetched to keep the trigger usable without a flickering empty state.
|
|
32
33
|
*/
|
|
33
|
-
export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, loading, loadingText, disabled, triggerClassName, contentClassName, align, onOpenChange, }: ComboboxProps):
|
|
34
|
+
export declare function Combobox({ options, value, onValueChange, placeholder, searchPlaceholder, emptyText, loading, loadingText, disabled, triggerClassName, contentClassName, align, onOpenChange, }: ComboboxProps): React.JSX.Element;
|
|
34
35
|
//# sourceMappingURL=combobox.d.ts.map
|
package/dist/ui/dialog.d.ts
CHANGED
|
@@ -6,8 +6,8 @@ declare const DialogPortal: React.FC<DialogPrimitive.DialogPortalProps>;
|
|
|
6
6
|
declare const DialogClose: React.ForwardRefExoticComponent<DialogPrimitive.DialogCloseProps & React.RefAttributes<HTMLButtonElement>>;
|
|
7
7
|
declare const DialogOverlay: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogOverlayProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
8
8
|
declare const DialogContent: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogContentProps & React.RefAttributes<HTMLDivElement>, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
9
|
-
declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>):
|
|
10
|
-
declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>):
|
|
9
|
+
declare function DialogHeader({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
10
|
+
declare function DialogFooter({ className, ...props }: React.HTMLAttributes<HTMLDivElement>): React.JSX.Element;
|
|
11
11
|
declare const DialogTitle: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogTitleProps & React.RefAttributes<HTMLHeadingElement>, "ref"> & React.RefAttributes<HTMLHeadingElement>>;
|
|
12
12
|
declare const DialogDescription: React.ForwardRefExoticComponent<Omit<DialogPrimitive.DialogDescriptionProps & React.RefAttributes<HTMLParagraphElement>, "ref"> & React.RefAttributes<HTMLParagraphElement>>;
|
|
13
13
|
export { Dialog, DialogPortal, DialogOverlay, DialogClose, DialogTrigger, DialogContent, DialogHeader, DialogFooter, DialogTitle, DialogDescription, };
|
package/dist/ui/input.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare function Input({ className, type, ...props }: React.ComponentProps<"input">):
|
|
2
|
+
declare function Input({ className, type, ...props }: React.ComponentProps<"input">): React.JSX.Element;
|
|
3
3
|
export { Input };
|
|
4
4
|
//# sourceMappingURL=input.d.ts.map
|
package/dist/ui/label.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
2
|
import * as LabelPrimitive from "@radix-ui/react-label";
|
|
3
|
-
declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>):
|
|
3
|
+
declare function Label({ className, ...props }: React.ComponentProps<typeof LabelPrimitive.Root>): React.JSX.Element;
|
|
4
4
|
export { Label };
|
|
5
5
|
//# sourceMappingURL=label.d.ts.map
|
package/dist/ui/textarea.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import * as React from "react";
|
|
2
|
-
declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">):
|
|
2
|
+
declare function Textarea({ className, ...props }: React.ComponentProps<"textarea">): React.JSX.Element;
|
|
3
3
|
export { Textarea };
|
|
4
4
|
//# sourceMappingURL=textarea.d.ts.map
|