@trackunit/react-core-hooks 1.7.83 → 1.7.84
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/index.cjs.js +35 -35
- package/index.esm.js +35 -35
- package/package.json +3 -3
- package/src/analytics/AnalyticsProvider.d.ts +5 -5
- package/src/assetSorting/AssetSortingProvider.d.ts +4 -4
- package/src/confirmationDialog/ConfirmationDialogProvider.d.ts +4 -4
- package/src/environment/EnvironmentContextProvider.d.ts +4 -4
- package/src/index.d.ts +1 -1
- package/src/modalDialog/ModalDialogProvider.d.ts +3 -3
- package/src/navigation/NavigationContextProvider.d.ts +6 -6
- package/src/{irisOemApp/IrisOemAppContextProvider.d.ts → oemBranding/OemBrandingContextProvider.d.ts} +3 -3
- package/src/user/CurrentUserPreferenceProvider.d.ts +5 -5
package/index.cjs.js
CHANGED
|
@@ -23,7 +23,7 @@ const AnalyticsContextProvider = AnalyticsContext.Provider; // easy import
|
|
|
23
23
|
*
|
|
24
24
|
* // log event when appropriate
|
|
25
25
|
* logEvent("Login", { loginPage: "New Manager" });
|
|
26
|
-
* @see {
|
|
26
|
+
* @see { AnalyticsRuntimeApiSync}
|
|
27
27
|
*/
|
|
28
28
|
const useAnalytics = (events) => {
|
|
29
29
|
const context = react.useContext(AnalyticsContext);
|
|
@@ -88,7 +88,7 @@ const AssetSortingProvider = AssetSortingContext.Provider;
|
|
|
88
88
|
* headerInitialSort={initialSort}
|
|
89
89
|
* />
|
|
90
90
|
* );
|
|
91
|
-
* @see {
|
|
91
|
+
* @see { AssetSortingState}
|
|
92
92
|
*/
|
|
93
93
|
const useAssetSorting = () => {
|
|
94
94
|
const context = react.useContext(AssetSortingContext);
|
|
@@ -229,7 +229,7 @@ const EnvironmentContextProvider = (props) => {
|
|
|
229
229
|
* import { useEnvironment } from "@trackunit/react-core-hooks";
|
|
230
230
|
* const { googleMapsApiKey } = useEnvironment();
|
|
231
231
|
* // use api key for something...
|
|
232
|
-
* @see (@link
|
|
232
|
+
* @see (@link EnvironmentState)
|
|
233
233
|
*/
|
|
234
234
|
const useEnvironment = () => {
|
|
235
235
|
const context = react.useContext(EnvironmentContext);
|
|
@@ -487,32 +487,6 @@ const useIrisAppImage = () => {
|
|
|
487
487
|
};
|
|
488
488
|
};
|
|
489
489
|
|
|
490
|
-
const OEMBrandingService = react.createContext(null);
|
|
491
|
-
/**
|
|
492
|
-
* This is a hook to use the OemBrandingContext.
|
|
493
|
-
*
|
|
494
|
-
* @requires OemBrandingContextProvider
|
|
495
|
-
* @example
|
|
496
|
-
* import { useOemBrandingContext } from "@trackunit/react-core-hooks";
|
|
497
|
-
* const { getOemBranding, getImageByBrand } = useOemBrandingContext();
|
|
498
|
-
* // use oem branding
|
|
499
|
-
* const branding = getOemBranding("some brand")
|
|
500
|
-
* @see { OemBrandingContext}
|
|
501
|
-
*/
|
|
502
|
-
const useOemBrandingContext = () => {
|
|
503
|
-
const context = react.useContext(OEMBrandingService);
|
|
504
|
-
if (!context) {
|
|
505
|
-
throw new Error("useOemBranding must be used within an OemBrandingContextProvider");
|
|
506
|
-
}
|
|
507
|
-
return context;
|
|
508
|
-
};
|
|
509
|
-
/**
|
|
510
|
-
* This is a provider for the OemBrandingContext.
|
|
511
|
-
*/
|
|
512
|
-
const OemBrandingContextProvider = (props) => {
|
|
513
|
-
return jsxRuntime.jsx(OEMBrandingService.Provider, { ...props });
|
|
514
|
-
};
|
|
515
|
-
|
|
516
490
|
/**
|
|
517
491
|
* The usePrevious hook is a useful tool for tracking the previous value of a variable in a functional component. This can be particularly handy in scenarios where it is necessary to compare the current value with the previous one, such as triggering actions or rendering based on changes.
|
|
518
492
|
*
|
|
@@ -710,7 +684,7 @@ const NavigationContextProvider = (props) => {
|
|
|
710
684
|
* @requires NavigationContext
|
|
711
685
|
* @example
|
|
712
686
|
* import { useNavigateInHost } from "@trackunit/react-core-hooks";
|
|
713
|
-
* @see (@link
|
|
687
|
+
* @see (@link NavigationRuntimeApi)
|
|
714
688
|
*/
|
|
715
689
|
const useNavigateInHost = () => {
|
|
716
690
|
const context = react.useContext(NavigationContext);
|
|
@@ -727,12 +701,12 @@ const useNavigateInHost = () => {
|
|
|
727
701
|
* @example
|
|
728
702
|
* import { useHasAccessTo } from "@trackunit/react-core-hooks";
|
|
729
703
|
* useHasAccessTo({ assetId: assetInfo?.assetId, page: "movement" })
|
|
730
|
-
* @see (@link
|
|
704
|
+
* @see (@link NavigationRuntimeApi)
|
|
731
705
|
* @see (@link HasAccessToOptions)
|
|
732
706
|
* @see (@link HasAccessToOptions.assetId)
|
|
733
707
|
* @see (@link HasAccessToOptions.page)
|
|
734
708
|
* @see (@link HasAccessToOptions.siteId)
|
|
735
|
-
* @see (@link
|
|
709
|
+
* @see (@link NavigationRuntimeApi)
|
|
736
710
|
*/
|
|
737
711
|
const useHasAccessTo = (options) => {
|
|
738
712
|
const context = react.useContext(NavigationContext);
|
|
@@ -752,6 +726,32 @@ const useHasAccessTo = (options) => {
|
|
|
752
726
|
return { hasAccess };
|
|
753
727
|
};
|
|
754
728
|
|
|
729
|
+
const OEMBrandingService = react.createContext(null);
|
|
730
|
+
/**
|
|
731
|
+
* This is a hook to use the OemBrandingContext.
|
|
732
|
+
*
|
|
733
|
+
* @requires OemBrandingContextProvider
|
|
734
|
+
* @example
|
|
735
|
+
* import { useOemBrandingContext } from "@trackunit/react-core-hooks";
|
|
736
|
+
* const { getOemBranding, getImageByBrand } = useOemBrandingContext();
|
|
737
|
+
* // use oem branding
|
|
738
|
+
* const branding = getOemBranding("some brand")
|
|
739
|
+
* @see { OemBrandingContext}
|
|
740
|
+
*/
|
|
741
|
+
const useOemBrandingContext = () => {
|
|
742
|
+
const context = react.useContext(OEMBrandingService);
|
|
743
|
+
if (!context) {
|
|
744
|
+
throw new Error("useOemBranding must be used within an OemBrandingContextProvider");
|
|
745
|
+
}
|
|
746
|
+
return context;
|
|
747
|
+
};
|
|
748
|
+
/**
|
|
749
|
+
* This is a provider for the OemBrandingContext.
|
|
750
|
+
*/
|
|
751
|
+
const OemBrandingContextProvider = (props) => {
|
|
752
|
+
return jsxRuntime.jsx(OEMBrandingService.Provider, { ...props });
|
|
753
|
+
};
|
|
754
|
+
|
|
755
755
|
/**
|
|
756
756
|
* A hook to expose asset runtime for React components
|
|
757
757
|
*
|
|
@@ -1083,7 +1083,7 @@ const CurrentUserPreferenceProvider = (props) => {
|
|
|
1083
1083
|
*
|
|
1084
1084
|
* language: Gets the language setting of the current user.
|
|
1085
1085
|
* setLanguage: Sets the language setting of the current user.
|
|
1086
|
-
* @see {
|
|
1086
|
+
* @see { CurrentUserPreferenceState}
|
|
1087
1087
|
*/
|
|
1088
1088
|
const useCurrentUserLanguage = () => {
|
|
1089
1089
|
const context = react.useContext(CurrentUserPreferenceContext);
|
|
@@ -1111,7 +1111,7 @@ const useCurrentUserLanguage = () => {
|
|
|
1111
1111
|
*
|
|
1112
1112
|
* timeZonePreference: Determines if the user has a timezone preference of "CUSTOM_TIME_ZONE" | "LOCAL_TIME_ZONE" | "MACHINE_TIME_ZONE"
|
|
1113
1113
|
* setTimeZonePreference: Sets the timezone preference of the current user.
|
|
1114
|
-
* @see {
|
|
1114
|
+
* @see { CurrentUserPreferenceState}
|
|
1115
1115
|
*/
|
|
1116
1116
|
const useCurrentUserTimeZonePreference = () => {
|
|
1117
1117
|
const context = react.useContext(CurrentUserPreferenceContext);
|
|
@@ -1135,7 +1135,7 @@ const useCurrentUserTimeZonePreference = () => {
|
|
|
1135
1135
|
*
|
|
1136
1136
|
* systemOfMeasurement: Gets the system of measurement setting of the current user. "SI" | "US_CUSTOMARY"
|
|
1137
1137
|
* setSystemOfMeasurement: Sets the system of measurement setting of the current user.
|
|
1138
|
-
* @see {
|
|
1138
|
+
* @see { CurrentUserPreferenceState}
|
|
1139
1139
|
*/
|
|
1140
1140
|
const useCurrentUserSystemOfMeasurement = () => {
|
|
1141
1141
|
const context = react.useContext(CurrentUserPreferenceContext);
|
package/index.esm.js
CHANGED
|
@@ -21,7 +21,7 @@ const AnalyticsContextProvider = AnalyticsContext.Provider; // easy import
|
|
|
21
21
|
*
|
|
22
22
|
* // log event when appropriate
|
|
23
23
|
* logEvent("Login", { loginPage: "New Manager" });
|
|
24
|
-
* @see {
|
|
24
|
+
* @see { AnalyticsRuntimeApiSync}
|
|
25
25
|
*/
|
|
26
26
|
const useAnalytics = (events) => {
|
|
27
27
|
const context = useContext(AnalyticsContext);
|
|
@@ -86,7 +86,7 @@ const AssetSortingProvider = AssetSortingContext.Provider;
|
|
|
86
86
|
* headerInitialSort={initialSort}
|
|
87
87
|
* />
|
|
88
88
|
* );
|
|
89
|
-
* @see {
|
|
89
|
+
* @see { AssetSortingState}
|
|
90
90
|
*/
|
|
91
91
|
const useAssetSorting = () => {
|
|
92
92
|
const context = useContext(AssetSortingContext);
|
|
@@ -227,7 +227,7 @@ const EnvironmentContextProvider = (props) => {
|
|
|
227
227
|
* import { useEnvironment } from "@trackunit/react-core-hooks";
|
|
228
228
|
* const { googleMapsApiKey } = useEnvironment();
|
|
229
229
|
* // use api key for something...
|
|
230
|
-
* @see (@link
|
|
230
|
+
* @see (@link EnvironmentState)
|
|
231
231
|
*/
|
|
232
232
|
const useEnvironment = () => {
|
|
233
233
|
const context = useContext(EnvironmentContext);
|
|
@@ -485,32 +485,6 @@ const useIrisAppImage = () => {
|
|
|
485
485
|
};
|
|
486
486
|
};
|
|
487
487
|
|
|
488
|
-
const OEMBrandingService = createContext(null);
|
|
489
|
-
/**
|
|
490
|
-
* This is a hook to use the OemBrandingContext.
|
|
491
|
-
*
|
|
492
|
-
* @requires OemBrandingContextProvider
|
|
493
|
-
* @example
|
|
494
|
-
* import { useOemBrandingContext } from "@trackunit/react-core-hooks";
|
|
495
|
-
* const { getOemBranding, getImageByBrand } = useOemBrandingContext();
|
|
496
|
-
* // use oem branding
|
|
497
|
-
* const branding = getOemBranding("some brand")
|
|
498
|
-
* @see { OemBrandingContext}
|
|
499
|
-
*/
|
|
500
|
-
const useOemBrandingContext = () => {
|
|
501
|
-
const context = useContext(OEMBrandingService);
|
|
502
|
-
if (!context) {
|
|
503
|
-
throw new Error("useOemBranding must be used within an OemBrandingContextProvider");
|
|
504
|
-
}
|
|
505
|
-
return context;
|
|
506
|
-
};
|
|
507
|
-
/**
|
|
508
|
-
* This is a provider for the OemBrandingContext.
|
|
509
|
-
*/
|
|
510
|
-
const OemBrandingContextProvider = (props) => {
|
|
511
|
-
return jsx(OEMBrandingService.Provider, { ...props });
|
|
512
|
-
};
|
|
513
|
-
|
|
514
488
|
/**
|
|
515
489
|
* The usePrevious hook is a useful tool for tracking the previous value of a variable in a functional component. This can be particularly handy in scenarios where it is necessary to compare the current value with the previous one, such as triggering actions or rendering based on changes.
|
|
516
490
|
*
|
|
@@ -708,7 +682,7 @@ const NavigationContextProvider = (props) => {
|
|
|
708
682
|
* @requires NavigationContext
|
|
709
683
|
* @example
|
|
710
684
|
* import { useNavigateInHost } from "@trackunit/react-core-hooks";
|
|
711
|
-
* @see (@link
|
|
685
|
+
* @see (@link NavigationRuntimeApi)
|
|
712
686
|
*/
|
|
713
687
|
const useNavigateInHost = () => {
|
|
714
688
|
const context = useContext(NavigationContext);
|
|
@@ -725,12 +699,12 @@ const useNavigateInHost = () => {
|
|
|
725
699
|
* @example
|
|
726
700
|
* import { useHasAccessTo } from "@trackunit/react-core-hooks";
|
|
727
701
|
* useHasAccessTo({ assetId: assetInfo?.assetId, page: "movement" })
|
|
728
|
-
* @see (@link
|
|
702
|
+
* @see (@link NavigationRuntimeApi)
|
|
729
703
|
* @see (@link HasAccessToOptions)
|
|
730
704
|
* @see (@link HasAccessToOptions.assetId)
|
|
731
705
|
* @see (@link HasAccessToOptions.page)
|
|
732
706
|
* @see (@link HasAccessToOptions.siteId)
|
|
733
|
-
* @see (@link
|
|
707
|
+
* @see (@link NavigationRuntimeApi)
|
|
734
708
|
*/
|
|
735
709
|
const useHasAccessTo = (options) => {
|
|
736
710
|
const context = useContext(NavigationContext);
|
|
@@ -750,6 +724,32 @@ const useHasAccessTo = (options) => {
|
|
|
750
724
|
return { hasAccess };
|
|
751
725
|
};
|
|
752
726
|
|
|
727
|
+
const OEMBrandingService = createContext(null);
|
|
728
|
+
/**
|
|
729
|
+
* This is a hook to use the OemBrandingContext.
|
|
730
|
+
*
|
|
731
|
+
* @requires OemBrandingContextProvider
|
|
732
|
+
* @example
|
|
733
|
+
* import { useOemBrandingContext } from "@trackunit/react-core-hooks";
|
|
734
|
+
* const { getOemBranding, getImageByBrand } = useOemBrandingContext();
|
|
735
|
+
* // use oem branding
|
|
736
|
+
* const branding = getOemBranding("some brand")
|
|
737
|
+
* @see { OemBrandingContext}
|
|
738
|
+
*/
|
|
739
|
+
const useOemBrandingContext = () => {
|
|
740
|
+
const context = useContext(OEMBrandingService);
|
|
741
|
+
if (!context) {
|
|
742
|
+
throw new Error("useOemBranding must be used within an OemBrandingContextProvider");
|
|
743
|
+
}
|
|
744
|
+
return context;
|
|
745
|
+
};
|
|
746
|
+
/**
|
|
747
|
+
* This is a provider for the OemBrandingContext.
|
|
748
|
+
*/
|
|
749
|
+
const OemBrandingContextProvider = (props) => {
|
|
750
|
+
return jsx(OEMBrandingService.Provider, { ...props });
|
|
751
|
+
};
|
|
752
|
+
|
|
753
753
|
/**
|
|
754
754
|
* A hook to expose asset runtime for React components
|
|
755
755
|
*
|
|
@@ -1081,7 +1081,7 @@ const CurrentUserPreferenceProvider = (props) => {
|
|
|
1081
1081
|
*
|
|
1082
1082
|
* language: Gets the language setting of the current user.
|
|
1083
1083
|
* setLanguage: Sets the language setting of the current user.
|
|
1084
|
-
* @see {
|
|
1084
|
+
* @see { CurrentUserPreferenceState}
|
|
1085
1085
|
*/
|
|
1086
1086
|
const useCurrentUserLanguage = () => {
|
|
1087
1087
|
const context = useContext(CurrentUserPreferenceContext);
|
|
@@ -1109,7 +1109,7 @@ const useCurrentUserLanguage = () => {
|
|
|
1109
1109
|
*
|
|
1110
1110
|
* timeZonePreference: Determines if the user has a timezone preference of "CUSTOM_TIME_ZONE" | "LOCAL_TIME_ZONE" | "MACHINE_TIME_ZONE"
|
|
1111
1111
|
* setTimeZonePreference: Sets the timezone preference of the current user.
|
|
1112
|
-
* @see {
|
|
1112
|
+
* @see { CurrentUserPreferenceState}
|
|
1113
1113
|
*/
|
|
1114
1114
|
const useCurrentUserTimeZonePreference = () => {
|
|
1115
1115
|
const context = useContext(CurrentUserPreferenceContext);
|
|
@@ -1133,7 +1133,7 @@ const useCurrentUserTimeZonePreference = () => {
|
|
|
1133
1133
|
*
|
|
1134
1134
|
* systemOfMeasurement: Gets the system of measurement setting of the current user. "SI" | "US_CUSTOMARY"
|
|
1135
1135
|
* setSystemOfMeasurement: Sets the system of measurement setting of the current user.
|
|
1136
|
-
* @see {
|
|
1136
|
+
* @see { CurrentUserPreferenceState}
|
|
1137
1137
|
*/
|
|
1138
1138
|
const useCurrentUserSystemOfMeasurement = () => {
|
|
1139
1139
|
const context = useContext(CurrentUserPreferenceContext);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-hooks",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.84",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"dependencies": {
|
|
10
10
|
"react": "19.0.0",
|
|
11
11
|
"zod": "^3.23.8",
|
|
12
|
-
"@trackunit/iris-app-runtime-core": "1.8.
|
|
12
|
+
"@trackunit/iris-app-runtime-core": "1.8.80",
|
|
13
13
|
"@trackunit/shared-utils": "1.9.73",
|
|
14
14
|
"fflate": "^0.8.2",
|
|
15
15
|
"es-toolkit": "^1.39.10",
|
|
16
|
-
"@trackunit/iris-app-runtime-core-api": "1.7.
|
|
16
|
+
"@trackunit/iris-app-runtime-core-api": "1.7.80"
|
|
17
17
|
},
|
|
18
18
|
"module": "./index.esm.js",
|
|
19
19
|
"main": "./index.cjs.js",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
export declare const AnalyticsContext: import("react").Context<
|
|
3
|
-
export declare const AnalyticsContextProvider: import("react").Provider<
|
|
1
|
+
import { AnalyticsRuntimeApiSync, EventDictionary } from "@trackunit/iris-app-runtime-core-api";
|
|
2
|
+
export declare const AnalyticsContext: import("react").Context<AnalyticsRuntimeApiSync<Record<string, never>> | null>;
|
|
3
|
+
export declare const AnalyticsContextProvider: import("react").Provider<AnalyticsRuntimeApiSync<Record<string, never>> | null>;
|
|
4
4
|
/**
|
|
5
5
|
* Hook to get the analytics context.
|
|
6
6
|
*
|
|
@@ -15,6 +15,6 @@ export declare const AnalyticsContextProvider: import("react").Provider<IAnalyti
|
|
|
15
15
|
*
|
|
16
16
|
* // log event when appropriate
|
|
17
17
|
* logEvent("Login", { loginPage: "New Manager" });
|
|
18
|
-
* @see {
|
|
18
|
+
* @see { AnalyticsRuntimeApiSync}
|
|
19
19
|
*/
|
|
20
|
-
export declare const useAnalytics: <TEvents extends EventDictionary = never>(events: TEvents) =>
|
|
20
|
+
export declare const useAnalytics: <TEvents extends EventDictionary = never>(events: TEvents) => AnalyticsRuntimeApiSync<TEvents>;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { AssetSortingState } from "@trackunit/iris-app-runtime-core-api";
|
|
2
2
|
/**
|
|
3
3
|
* This is a provider for the AssetSortingContext.
|
|
4
4
|
*/
|
|
5
|
-
export declare const AssetSortingProvider: import("react").Provider<
|
|
5
|
+
export declare const AssetSortingProvider: import("react").Provider<AssetSortingState | null>;
|
|
6
6
|
/**
|
|
7
7
|
* This is a hook to use the AssetSortingContext.
|
|
8
8
|
*
|
|
@@ -29,6 +29,6 @@ export declare const AssetSortingProvider: import("react").Provider<AssetSorting
|
|
|
29
29
|
* headerInitialSort={initialSort}
|
|
30
30
|
* />
|
|
31
31
|
* );
|
|
32
|
-
* @see {
|
|
32
|
+
* @see { AssetSortingState}
|
|
33
33
|
*/
|
|
34
|
-
export declare const useAssetSorting: () =>
|
|
34
|
+
export declare const useAssetSorting: () => AssetSortingState;
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ConfirmationDialogRuntimeApi } from "@trackunit/iris-app-runtime-core-api";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
export interface ConfirmationDialogContextProviderProps {
|
|
4
|
-
value:
|
|
4
|
+
value: ConfirmationDialogRuntimeApi;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
8
8
|
* This is a provider for the ConfirmationDialogContext.
|
|
9
9
|
*/
|
|
10
|
-
export declare const ConfirmationDialogProvider: (props: ConfirmationDialogContextProviderProps) =>
|
|
10
|
+
export declare const ConfirmationDialogProvider: (props: ConfirmationDialogContextProviderProps) => ReactNode;
|
|
11
11
|
/**
|
|
12
12
|
* This is a hook to use the ConfirmationDialogContext.
|
|
13
13
|
*/
|
|
14
|
-
export declare const useConfirmationDialog: () =>
|
|
14
|
+
export declare const useConfirmationDialog: () => ConfirmationDialogRuntimeApi;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { EnvironmentState } from "@trackunit/iris-app-runtime-core-api";
|
|
2
2
|
interface EnvironmentContextProviderProps {
|
|
3
|
-
value:
|
|
3
|
+
value: EnvironmentState;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
@@ -15,7 +15,7 @@ export declare const EnvironmentContextProvider: (props: EnvironmentContextProvi
|
|
|
15
15
|
* import { useEnvironment } from "@trackunit/react-core-hooks";
|
|
16
16
|
* const { googleMapsApiKey } = useEnvironment();
|
|
17
17
|
* // use api key for something...
|
|
18
|
-
* @see (@link
|
|
18
|
+
* @see (@link EnvironmentState)
|
|
19
19
|
*/
|
|
20
|
-
export declare const useEnvironment: () =>
|
|
20
|
+
export declare const useEnvironment: () => EnvironmentState;
|
|
21
21
|
export {};
|
package/src/index.d.ts
CHANGED
|
@@ -9,11 +9,11 @@ export * from "./fetchAssetBlobUrl";
|
|
|
9
9
|
export * from "./filter-bar/FilterBarProvider";
|
|
10
10
|
export * from "./images/useImageUploader";
|
|
11
11
|
export * from "./images/useIrisAppImage";
|
|
12
|
-
export * from "./irisOemApp/IrisOemAppContextProvider";
|
|
13
12
|
export * from "./localStorage/useLocalStorage";
|
|
14
13
|
export * from "./localStorage/useLocalStorageReducer";
|
|
15
14
|
export * from "./modalDialog/ModalDialogProvider";
|
|
16
15
|
export * from "./navigation/NavigationContextProvider";
|
|
16
|
+
export * from "./oemBranding/OemBrandingContextProvider";
|
|
17
17
|
export * from "./runtimes/useAssetRuntime";
|
|
18
18
|
export * from "./runtimes/useCustomerRuntime";
|
|
19
19
|
export * from "./runtimes/useEventRuntime";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModalDialogRuntimeApi } from "@trackunit/iris-app-runtime-core-api";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
export interface ModalDialogProviderProps {
|
|
4
|
-
value:
|
|
4
|
+
value: ModalDialogRuntimeApi;
|
|
5
5
|
children: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -11,4 +11,4 @@ export declare const ModalDialogContextProvider: (props: ModalDialogProviderProp
|
|
|
11
11
|
/**
|
|
12
12
|
* This is a hook to use the useModalDialogContext.
|
|
13
13
|
*/
|
|
14
|
-
export declare const useModalDialogContext: () =>
|
|
14
|
+
export declare const useModalDialogContext: () => ModalDialogRuntimeApi;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { HasAccessToOptions,
|
|
1
|
+
import { HasAccessToOptions, NavigationRuntimeApi } from "@trackunit/iris-app-runtime-core-api";
|
|
2
2
|
interface NavigationContextProviderProps {
|
|
3
|
-
value:
|
|
3
|
+
value: NavigationRuntimeApi;
|
|
4
4
|
children?: React.ReactNode;
|
|
5
5
|
}
|
|
6
6
|
/**
|
|
@@ -13,9 +13,9 @@ export declare const NavigationContextProvider: (props: NavigationContextProvide
|
|
|
13
13
|
* @requires NavigationContext
|
|
14
14
|
* @example
|
|
15
15
|
* import { useNavigateInHost } from "@trackunit/react-core-hooks";
|
|
16
|
-
* @see (@link
|
|
16
|
+
* @see (@link NavigationRuntimeApi)
|
|
17
17
|
*/
|
|
18
|
-
export declare const useNavigateInHost: () =>
|
|
18
|
+
export declare const useNavigateInHost: () => NavigationRuntimeApi;
|
|
19
19
|
/**
|
|
20
20
|
* This is a hook to use the hasAccessTo in host.
|
|
21
21
|
* You can use this to ensure the page you link to is available for the user to see.
|
|
@@ -24,12 +24,12 @@ export declare const useNavigateInHost: () => INavigationContext;
|
|
|
24
24
|
* @example
|
|
25
25
|
* import { useHasAccessTo } from "@trackunit/react-core-hooks";
|
|
26
26
|
* useHasAccessTo({ assetId: assetInfo?.assetId, page: "movement" })
|
|
27
|
-
* @see (@link
|
|
27
|
+
* @see (@link NavigationRuntimeApi)
|
|
28
28
|
* @see (@link HasAccessToOptions)
|
|
29
29
|
* @see (@link HasAccessToOptions.assetId)
|
|
30
30
|
* @see (@link HasAccessToOptions.page)
|
|
31
31
|
* @see (@link HasAccessToOptions.siteId)
|
|
32
|
-
* @see (@link
|
|
32
|
+
* @see (@link NavigationRuntimeApi)
|
|
33
33
|
*/
|
|
34
34
|
export declare const useHasAccessTo: (options: HasAccessToOptions) => {
|
|
35
35
|
hasAccess: boolean | undefined;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OemBrandingRuntimeApi } from "@trackunit/iris-app-runtime-core-api";
|
|
2
2
|
/**
|
|
3
3
|
* This is a hook to use the OemBrandingContext.
|
|
4
4
|
*
|
|
@@ -10,9 +10,9 @@ import { OemBrandingContext } from "@trackunit/iris-app-runtime-core-api";
|
|
|
10
10
|
* const branding = getOemBranding("some brand")
|
|
11
11
|
* @see { OemBrandingContext}
|
|
12
12
|
*/
|
|
13
|
-
export declare const useOemBrandingContext: () =>
|
|
13
|
+
export declare const useOemBrandingContext: () => OemBrandingRuntimeApi;
|
|
14
14
|
interface OemBrandingContextProviderProps {
|
|
15
|
-
value:
|
|
15
|
+
value: OemBrandingRuntimeApi;
|
|
16
16
|
children?: React.ReactNode;
|
|
17
17
|
}
|
|
18
18
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CurrentUserPreferenceState } from "@trackunit/iris-app-runtime-core-api";
|
|
2
2
|
import { ReactNode } from "react";
|
|
3
3
|
interface Props {
|
|
4
|
-
value:
|
|
4
|
+
value: CurrentUserPreferenceState;
|
|
5
5
|
children?: ReactNode;
|
|
6
6
|
}
|
|
7
7
|
/**
|
|
@@ -18,7 +18,7 @@ export declare const CurrentUserPreferenceProvider: (props: Props) => import("re
|
|
|
18
18
|
*
|
|
19
19
|
* language: Gets the language setting of the current user.
|
|
20
20
|
* setLanguage: Sets the language setting of the current user.
|
|
21
|
-
* @see {
|
|
21
|
+
* @see { CurrentUserPreferenceState}
|
|
22
22
|
*/
|
|
23
23
|
export declare const useCurrentUserLanguage: () => {
|
|
24
24
|
language: string | undefined;
|
|
@@ -34,7 +34,7 @@ export declare const useCurrentUserLanguage: () => {
|
|
|
34
34
|
*
|
|
35
35
|
* timeZonePreference: Determines if the user has a timezone preference of "CUSTOM_TIME_ZONE" | "LOCAL_TIME_ZONE" | "MACHINE_TIME_ZONE"
|
|
36
36
|
* setTimeZonePreference: Sets the timezone preference of the current user.
|
|
37
|
-
* @see {
|
|
37
|
+
* @see { CurrentUserPreferenceState}
|
|
38
38
|
*/
|
|
39
39
|
export declare const useCurrentUserTimeZonePreference: () => {
|
|
40
40
|
timeZonePreference: import("@trackunit/iris-app-runtime-core-api").TimeZonePreferenceType | undefined;
|
|
@@ -50,7 +50,7 @@ export declare const useCurrentUserTimeZonePreference: () => {
|
|
|
50
50
|
*
|
|
51
51
|
* systemOfMeasurement: Gets the system of measurement setting of the current user. "SI" | "US_CUSTOMARY"
|
|
52
52
|
* setSystemOfMeasurement: Sets the system of measurement setting of the current user.
|
|
53
|
-
* @see {
|
|
53
|
+
* @see { CurrentUserPreferenceState}
|
|
54
54
|
*/
|
|
55
55
|
export declare const useCurrentUserSystemOfMeasurement: () => {
|
|
56
56
|
systemOfMeasurement: import("@trackunit/iris-app-runtime-core-api").SystemOfMeasurementType | null;
|