@trackunit/react-core-contexts-api 1.8.74 → 1.8.79
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 +3 -6
- package/index.cjs.js +136 -147
- package/index.esm.js +102 -138
- package/package.json +4 -6
- package/src/analytics/AnalyticsContext.d.ts +3 -0
- package/src/assetSorting/AssetSortingContext.d.ts +7 -0
- package/src/confirmationDialog/ConfirmationDialogContext.d.ts +12 -0
- package/src/environment/EnvironmentContext.d.ts +12 -0
- package/src/errorHandling/ErrorHandlingContext.d.ts +3 -0
- package/src/exportData/ExportDataContext.d.ts +3 -0
- package/src/featureFlags/FeatureFlagContext.d.ts +13 -0
- package/src/filterBar/FilterBarContext.d.ts +12 -0
- package/src/index.d.ts +18 -16
- package/src/modalDialog/ModalDialogContext.d.ts +12 -0
- package/src/navigation/NavigationContext.d.ts +12 -0
- package/src/oemBranding/OemBrandingContext.d.ts +12 -0
- package/src/subscription/UserSubscriptionContext.d.ts +12 -0
- package/src/timeRange/TimeRangeContext.d.ts +12 -0
- package/src/toast/ToastContext.d.ts +12 -0
- package/src/token/TokenContext.d.ts +12 -0
- package/src/user/CurrentUserContext.d.ts +12 -0
- package/src/user/CurrentUserPreferenceContext.d.ts +12 -0
- package/src/widgetConfig/WidgetConfigContext.d.ts +12 -0
- package/src/IUserPreferencesContext.d.ts +0 -24
- package/src/analyticsContext.d.ts +0 -79
- package/src/assetSortingContext.d.ts +0 -52
- package/src/confirmationDialogContext.d.ts +0 -32
- package/src/currentUserContext.d.ts +0 -62
- package/src/environmentContext.d.ts +0 -33
- package/src/errorHandlingContext.d.ts +0 -26
- package/src/filterBarContext.d.ts +0 -37
- package/src/modalDialogContext.d.ts +0 -13
- package/src/navigationContext.d.ts +0 -81
- package/src/oemBrandingContext.d.ts +0 -36
- package/src/timeRangeContext.d.ts +0 -34
- package/src/toastContext.d.ts +0 -53
- package/src/tokenContext.d.ts +0 -6
- package/src/userSubscriptionContext.d.ts +0 -51
- package/src/widgetConfigContext.d.ts +0 -61
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Branding information for an asset
|
|
3
|
-
*/
|
|
4
|
-
export interface OemBranding {
|
|
5
|
-
/**
|
|
6
|
-
* Weather or not the logo exist for this brand.
|
|
7
|
-
*/
|
|
8
|
-
logo: boolean;
|
|
9
|
-
/**
|
|
10
|
-
* Weather or not the banner exist for this brand.
|
|
11
|
-
*/
|
|
12
|
-
assetBanner: boolean;
|
|
13
|
-
/**
|
|
14
|
-
* The color to use for this brand if it is set.
|
|
15
|
-
*/
|
|
16
|
-
color?: string;
|
|
17
|
-
/**
|
|
18
|
-
* Weather or not the platformLogo exist for this brand.
|
|
19
|
-
*/
|
|
20
|
-
platformLogo: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The conditions for the OEM branding to be applied
|
|
23
|
-
*/
|
|
24
|
-
conditions?: {
|
|
25
|
-
/**
|
|
26
|
-
* Indicates if the asset is licensed by OEM
|
|
27
|
-
*/
|
|
28
|
-
oemLicensedOnly?: boolean;
|
|
29
|
-
};
|
|
30
|
-
}
|
|
31
|
-
export type OemBrandingImageType = "logo" | "assetBanner" | "platformLogo";
|
|
32
|
-
export interface OemBrandingContext {
|
|
33
|
-
getAllBrandingDetails(): Promise<Record<string, OemBranding>>;
|
|
34
|
-
getOemBranding: (brand: string) => Promise<OemBranding | null>;
|
|
35
|
-
getOemImage: (imageType: OemBrandingImageType, brand: string, model?: string) => Promise<string | null>;
|
|
36
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
export type TimeRange = {
|
|
2
|
-
startMsInEpoch: number;
|
|
3
|
-
endMsInEpoch: number;
|
|
4
|
-
};
|
|
5
|
-
export type TemporalUnit = "day" | "days";
|
|
6
|
-
export type TemporalDirection = "next" | "last";
|
|
7
|
-
export type TemporalPeriod = {
|
|
8
|
-
direction: TemporalDirection;
|
|
9
|
-
count: number;
|
|
10
|
-
unit: TemporalUnit;
|
|
11
|
-
};
|
|
12
|
-
export type SelectedTimeRange = {
|
|
13
|
-
timeRange: TimeRange | null;
|
|
14
|
-
temporalPeriod: TemporalPeriod | null;
|
|
15
|
-
};
|
|
16
|
-
export interface TimeRangeContext {
|
|
17
|
-
/**
|
|
18
|
-
* Gets the current time range.
|
|
19
|
-
* This is the time range that is currently selected.
|
|
20
|
-
* If the user has selected a temporal period, this will be the start and end of the temporal period.
|
|
21
|
-
* If the user has selected a custom time range, this will be the start and end of the custom time range.
|
|
22
|
-
*
|
|
23
|
-
* @returns the current time range
|
|
24
|
-
*/
|
|
25
|
-
timeRange: TimeRange | null;
|
|
26
|
-
/**
|
|
27
|
-
* Gets the current temporal period.
|
|
28
|
-
* This is only if the user has selected a temporal period.
|
|
29
|
-
* If the user has selected a custom time range, this will be null.
|
|
30
|
-
*
|
|
31
|
-
* @returns the current temporal period
|
|
32
|
-
*/
|
|
33
|
-
temporalPeriod: TemporalPeriod | null;
|
|
34
|
-
}
|
package/src/toastContext.d.ts
DELETED
|
@@ -1,53 +0,0 @@
|
|
|
1
|
-
export type ToastColors = "info" | "warning" | "danger" | "success";
|
|
2
|
-
export type ToastAction = {
|
|
3
|
-
label: string;
|
|
4
|
-
onClick?: () => void;
|
|
5
|
-
loading?: boolean;
|
|
6
|
-
};
|
|
7
|
-
export interface Toast {
|
|
8
|
-
id?: string;
|
|
9
|
-
/**
|
|
10
|
-
* Visual intent of the toast.
|
|
11
|
-
*/
|
|
12
|
-
intent: ToastColors;
|
|
13
|
-
/**
|
|
14
|
-
* Toast title.
|
|
15
|
-
*/
|
|
16
|
-
title: string;
|
|
17
|
-
/**
|
|
18
|
-
* Toast description/message.
|
|
19
|
-
*/
|
|
20
|
-
description?: string;
|
|
21
|
-
/**
|
|
22
|
-
* Controls dismissal model of the toast.
|
|
23
|
-
* - "timed": auto-dismiss after duration (default)
|
|
24
|
-
* - "persistent": user must close manually (X button)
|
|
25
|
-
*/
|
|
26
|
-
behavior?: "timed" | "persistent";
|
|
27
|
-
/**
|
|
28
|
-
* Optional single link rendered inside the toast (max 1).
|
|
29
|
-
* - If a link is present and behavior is omitted → treat as "persistent" (guideline)
|
|
30
|
-
* - If behavior is explicitly "timed" AND link is present → default duration is 10000ms
|
|
31
|
-
*/
|
|
32
|
-
link?: {
|
|
33
|
-
label: string;
|
|
34
|
-
onClick: (event: React.MouseEventHandler<HTMLButtonElement>) => void;
|
|
35
|
-
};
|
|
36
|
-
/** @deprecated not shown in UI; kept for backward compatibility */
|
|
37
|
-
primaryAction?: ToastAction;
|
|
38
|
-
/** @deprecated not shown in UI; kept for backward compatibility */
|
|
39
|
-
secondaryAction?: ToastAction;
|
|
40
|
-
/**
|
|
41
|
-
* Auto-dismiss timeout in milliseconds when behavior is "timed".
|
|
42
|
-
* Defaults:
|
|
43
|
-
* - 6000ms for regular timed toasts
|
|
44
|
-
* - 10000ms if a link is present and behavior is explicitly set to "timed"
|
|
45
|
-
*/
|
|
46
|
-
duration?: number;
|
|
47
|
-
isLoading?: boolean;
|
|
48
|
-
}
|
|
49
|
-
export interface IToastContext {
|
|
50
|
-
addToast: (toast: Toast) => Promise<void | "primaryAction" | "secondaryAction">;
|
|
51
|
-
removeToast: (id: string) => Promise<void>;
|
|
52
|
-
setIsManifestError?: React.Dispatch<React.SetStateAction<boolean>>;
|
|
53
|
-
}
|
package/src/tokenContext.d.ts
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
export interface IUserSubscriptionContext {
|
|
2
|
-
/**
|
|
3
|
-
* The users subscription package
|
|
4
|
-
*/
|
|
5
|
-
packageType: UserSubscriptionPackageType;
|
|
6
|
-
/**
|
|
7
|
-
* Extra features enabled for the current user. Will be null if still loading.
|
|
8
|
-
*/
|
|
9
|
-
features: Array<IFeature> | null;
|
|
10
|
-
/**
|
|
11
|
-
* Number of days you can see back in time for this subscription.
|
|
12
|
-
*
|
|
13
|
-
* Returns the number of days
|
|
14
|
-
*/
|
|
15
|
-
numberOfDaysWithAccessToHistoricalData: number;
|
|
16
|
-
/**
|
|
17
|
-
* Number of days you can see back in time for insights for this subscription.
|
|
18
|
-
*
|
|
19
|
-
* Returns the number of days
|
|
20
|
-
*/
|
|
21
|
-
numberOfDaysWithAccessToHistoricalInsights: number;
|
|
22
|
-
/**
|
|
23
|
-
* If the subscription is still loading.
|
|
24
|
-
*/
|
|
25
|
-
loading: boolean;
|
|
26
|
-
}
|
|
27
|
-
export declare const UserSubscriptionPackage: {
|
|
28
|
-
readonly ENTRY_FLEET_OWNER: "Entry (Fleet Owner)";
|
|
29
|
-
readonly EXPLORE_FLEET_OWNER: "Explore (Fleet Owner)";
|
|
30
|
-
readonly EVOLVE_FLEET_OWNER: "Evolve (Fleet Owner)";
|
|
31
|
-
readonly EXPAND_FLEET_OWNER: "Expand (Fleet Owner)";
|
|
32
|
-
readonly EXPLORE_OEM: "Explore (OEM)";
|
|
33
|
-
readonly EVOLVE_OEM: "Evolve (OEM)";
|
|
34
|
-
readonly EXPAND_OEM: "Expand (OEM)";
|
|
35
|
-
readonly COLLECT: "COLLECT";
|
|
36
|
-
readonly INSIGHT: "INSIGHT";
|
|
37
|
-
readonly VIEW: "VIEW";
|
|
38
|
-
readonly NONE: "NONE";
|
|
39
|
-
readonly EXPLORE: "Explore";
|
|
40
|
-
readonly EVOLVE: "Evolve";
|
|
41
|
-
readonly EXPAND: "Expand";
|
|
42
|
-
readonly LINK: "Link";
|
|
43
|
-
readonly LIFT: "Lift";
|
|
44
|
-
readonly LEAP: "Leap";
|
|
45
|
-
readonly CUSTOMER_PORTAL: "Customer Portal";
|
|
46
|
-
};
|
|
47
|
-
export type UserSubscriptionPackageType = keyof typeof UserSubscriptionPackage;
|
|
48
|
-
export interface IFeature {
|
|
49
|
-
id: string;
|
|
50
|
-
name: string;
|
|
51
|
-
}
|
|
@@ -1,61 +0,0 @@
|
|
|
1
|
-
export type LoadingState = {
|
|
2
|
-
hasData: boolean;
|
|
3
|
-
isLoading: boolean;
|
|
4
|
-
};
|
|
5
|
-
export interface WidgetConfigContext {
|
|
6
|
-
/**
|
|
7
|
-
* Gets the title of the widget.
|
|
8
|
-
*
|
|
9
|
-
* @returns the title of the widget
|
|
10
|
-
*/
|
|
11
|
-
getTitle: () => Promise<string>;
|
|
12
|
-
/**
|
|
13
|
-
* Sets the title of the widget.
|
|
14
|
-
*
|
|
15
|
-
* @param title - The title to set.
|
|
16
|
-
*/
|
|
17
|
-
setTitle: (title: string) => Promise<void>;
|
|
18
|
-
/**
|
|
19
|
-
* Gets the data of the widget.
|
|
20
|
-
*
|
|
21
|
-
* @returns the data of the widget
|
|
22
|
-
*/
|
|
23
|
-
getData: () => Promise<Record<string, unknown>>;
|
|
24
|
-
/**
|
|
25
|
-
* Gets the data version of the widget.
|
|
26
|
-
* Dataversion is used to make it easy for you to see what dataVersion is saved in the widget.
|
|
27
|
-
* Use it to upgrade the widget data to a new version when loading the widget.
|
|
28
|
-
*
|
|
29
|
-
* @returns the data version of the widget
|
|
30
|
-
*/
|
|
31
|
-
getDataVersion: () => Promise<number>;
|
|
32
|
-
/**
|
|
33
|
-
* Sets the data of the widget.
|
|
34
|
-
* Dataversion is used to make it easy for you to see what dataVersion is saved in the widget.
|
|
35
|
-
* Use it to upgrade the widget data to a new version when loading the widget.
|
|
36
|
-
*
|
|
37
|
-
* @param data - The data to set.
|
|
38
|
-
* @param dataVersion - The data version to set.
|
|
39
|
-
*/
|
|
40
|
-
setData: (data: Record<string, unknown>, dataVersion: number) => Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* Sets the loading state of the widget.
|
|
43
|
-
*
|
|
44
|
-
* @param loadingState - The loading state to set.
|
|
45
|
-
*/
|
|
46
|
-
setLoadingState: (loadingState: LoadingState) => Promise<void>;
|
|
47
|
-
/**
|
|
48
|
-
* Opens the edit mode of the widget.
|
|
49
|
-
*/
|
|
50
|
-
openEditMode: () => Promise<void>;
|
|
51
|
-
/**
|
|
52
|
-
* Closes the edit mode of the widget.
|
|
53
|
-
*/
|
|
54
|
-
closeEditMode: () => Promise<void>;
|
|
55
|
-
/**
|
|
56
|
-
* The poll interval of the widget.
|
|
57
|
-
*
|
|
58
|
-
* @returns the poll interval of the widget
|
|
59
|
-
*/
|
|
60
|
-
pollInterval?: number;
|
|
61
|
-
}
|