@trackunit/react-core-contexts 1.9.73 → 1.9.75
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 +17 -2
- package/index.esm.js +20 -5
- package/package.json +8 -8
- package/src/exportData/ExportDataProviderIrisApp.d.ts +5 -0
package/index.cjs.js
CHANGED
|
@@ -235,7 +235,7 @@ const ManagerApolloProvider = ({ children }) => {
|
|
|
235
235
|
* This is a provider for the ToastContext.
|
|
236
236
|
*/
|
|
237
237
|
const ToastProviderIrisApp = ({ children }) => {
|
|
238
|
-
const value = react.useMemo(() => ({ addToast: irisAppRuntimeCore.ToastRuntime.addToast }), []);
|
|
238
|
+
const value = react.useMemo(() => ({ addToast: irisAppRuntimeCore.ToastRuntime.addToast, removeToast: irisAppRuntimeCore.ToastRuntime.removeToast }), []);
|
|
239
239
|
return jsxRuntime.jsx(reactCoreHooks.ToastProvider, { value: value, children: children });
|
|
240
240
|
};
|
|
241
241
|
|
|
@@ -349,6 +349,21 @@ const ErrorHandlingProviderIrisApp = ({ children, errorHandler }) => {
|
|
|
349
349
|
return (jsxRuntime.jsx(reactCoreHooks.ErrorHandlingContextProvider, { value: errorHandler || defaultContextValue, children: children }));
|
|
350
350
|
};
|
|
351
351
|
|
|
352
|
+
/**
|
|
353
|
+
* This is a provider for the EnvironmentContext.
|
|
354
|
+
*/
|
|
355
|
+
const ExportDataProviderIrisApp = ({ children }) => {
|
|
356
|
+
const exportData = react.useCallback((props) => {
|
|
357
|
+
return irisAppRuntimeCore.ExportDataRuntime.exportData(props);
|
|
358
|
+
}, []);
|
|
359
|
+
const value = react.useMemo(() => {
|
|
360
|
+
return {
|
|
361
|
+
exportData,
|
|
362
|
+
};
|
|
363
|
+
}, [exportData]);
|
|
364
|
+
return jsxRuntime.jsx(reactCoreHooks.ExportDataContext, { value: value, children: children });
|
|
365
|
+
};
|
|
366
|
+
|
|
352
367
|
/**
|
|
353
368
|
* This is a provider for the FilterBarContext.
|
|
354
369
|
*/
|
|
@@ -620,7 +635,7 @@ const TrackunitProviders = ({ translations, children, errorHandler }) => {
|
|
|
620
635
|
i18nLibraryTranslation.registerTranslations(translations); // Register the apps translations if passed.
|
|
621
636
|
}
|
|
622
637
|
i18nLibraryTranslation.initializeTranslationsForApp(); // Initialize all registered translations
|
|
623
|
-
return (jsxRuntime.jsx(EnvironmentProviderIrisApp, { children: jsxRuntime.jsx(ErrorHandlingProviderIrisApp, { errorHandler: errorHandler, children: jsxRuntime.jsx(ThemeCssProviderIrisApp, { children: jsxRuntime.jsx(TokenProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserPreferenceProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserProviderIrisApp, { children: jsxRuntime.jsx(UserSubscriptionProviderIrisApp, { children: jsxRuntime.jsx(AnalyticsProviderIrisApp, { children: jsxRuntime.jsx(OemBrandingContextProviderIrisApp, { children: jsxRuntime.jsx(AssetSortingProviderIrisApp, { children: jsxRuntime.jsx(ManagerApolloProvider, { children: jsxRuntime.jsx(NavigationProviderIrisApp, { children: jsxRuntime.jsx(ToastProviderIrisApp, { children: jsxRuntime.jsx(ModalDialogContextProviderIrisApp, { children: jsxRuntime.jsx(ConfirmationDialogProviderIrisApp, { children: jsxRuntime.jsx(FilterBarProviderIrisApp, { children: jsxRuntime.jsx(TimeRangeProviderIrisApp, { children: jsxRuntime.jsx(WidgetConfigProviderIrisApp, { children: jsxRuntime.jsx(react.Suspense, { fallback: jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
638
|
+
return (jsxRuntime.jsx(EnvironmentProviderIrisApp, { children: jsxRuntime.jsx(ErrorHandlingProviderIrisApp, { errorHandler: errorHandler, children: jsxRuntime.jsx(ThemeCssProviderIrisApp, { children: jsxRuntime.jsx(TokenProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserPreferenceProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserProviderIrisApp, { children: jsxRuntime.jsx(UserSubscriptionProviderIrisApp, { children: jsxRuntime.jsx(AnalyticsProviderIrisApp, { children: jsxRuntime.jsx(OemBrandingContextProviderIrisApp, { children: jsxRuntime.jsx(AssetSortingProviderIrisApp, { children: jsxRuntime.jsx(ManagerApolloProvider, { children: jsxRuntime.jsx(NavigationProviderIrisApp, { children: jsxRuntime.jsx(ToastProviderIrisApp, { children: jsxRuntime.jsx(ModalDialogContextProviderIrisApp, { children: jsxRuntime.jsx(ConfirmationDialogProviderIrisApp, { children: jsxRuntime.jsx(FilterBarProviderIrisApp, { children: jsxRuntime.jsx(ExportDataProviderIrisApp, { children: jsxRuntime.jsx(TimeRangeProviderIrisApp, { children: jsxRuntime.jsx(WidgetConfigProviderIrisApp, { children: jsxRuntime.jsx(react.Suspense, { fallback: jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
624
639
|
};
|
|
625
640
|
|
|
626
641
|
exports.ManagerApolloProvider = ManagerApolloProvider;
|
package/index.esm.js
CHANGED
|
@@ -4,11 +4,11 @@ import { setContext } from '@apollo/client/link/context';
|
|
|
4
4
|
import { onError } from '@apollo/client/link/error';
|
|
5
5
|
import { removeTypenameFromVariables } from '@apollo/client/link/remove-typename';
|
|
6
6
|
import { getMainDefinition, Observable } from '@apollo/client/utilities';
|
|
7
|
-
import { useEnvironment, useToken, useErrorHandler, ToastProvider, AnalyticsContextProvider, AssetSortingProvider, ConfirmationDialogProvider, EnvironmentContextProvider, ErrorHandlingContextProvider, FilterBarProvider, ModalDialogContextProvider, NavigationContextProvider, OemBrandingContextProvider, TimeRangeProvider, TokenProvider, CurrentUserProvider, CurrentUserPreferenceProvider, UserSubscriptionProvider, WidgetConfigProvider } from '@trackunit/react-core-hooks';
|
|
7
|
+
import { useEnvironment, useToken, useErrorHandler, ToastProvider, AnalyticsContextProvider, AssetSortingProvider, ConfirmationDialogProvider, EnvironmentContextProvider, ErrorHandlingContextProvider, ExportDataContext, FilterBarProvider, ModalDialogContextProvider, NavigationContextProvider, OemBrandingContextProvider, TimeRangeProvider, TokenProvider, CurrentUserProvider, CurrentUserPreferenceProvider, UserSubscriptionProvider, WidgetConfigProvider } from '@trackunit/react-core-hooks';
|
|
8
8
|
import { print } from 'graphql';
|
|
9
9
|
import { createClient } from 'graphql-sse';
|
|
10
|
-
import { useState, useMemo, useEffect, Suspense } from 'react';
|
|
11
|
-
import { ToastRuntime, AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, ConfirmationDialogRuntime, EnvironmentRuntime, AssetsFilterBarRuntime, CustomersFilterBarRuntime, SitesFilterBarRuntime, ModalDialogRuntime, NavigationRuntime, OemBrandingContextRuntime, ThemeCssRuntime, TimeRangeRuntime, TokenRuntime, CurrentUserRuntime, CurrentUserPreferenceRuntime, UserSubscriptionRuntime, WidgetConfigRuntime } from '@trackunit/iris-app-runtime-core';
|
|
10
|
+
import { useState, useMemo, useEffect, useCallback, Suspense } from 'react';
|
|
11
|
+
import { ToastRuntime, AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, ConfirmationDialogRuntime, EnvironmentRuntime, ExportDataRuntime, AssetsFilterBarRuntime, CustomersFilterBarRuntime, SitesFilterBarRuntime, ModalDialogRuntime, NavigationRuntime, OemBrandingContextRuntime, ThemeCssRuntime, TimeRangeRuntime, TokenRuntime, CurrentUserRuntime, CurrentUserPreferenceRuntime, UserSubscriptionRuntime, WidgetConfigRuntime } from '@trackunit/iris-app-runtime-core';
|
|
12
12
|
import '@js-temporal/polyfill';
|
|
13
13
|
import { registerTranslations, initializeTranslationsForApp } from '@trackunit/i18n-library-translation';
|
|
14
14
|
import { Spinner } from '@trackunit/react-components';
|
|
@@ -233,7 +233,7 @@ const ManagerApolloProvider = ({ children }) => {
|
|
|
233
233
|
* This is a provider for the ToastContext.
|
|
234
234
|
*/
|
|
235
235
|
const ToastProviderIrisApp = ({ children }) => {
|
|
236
|
-
const value = useMemo(() => ({ addToast: ToastRuntime.addToast }), []);
|
|
236
|
+
const value = useMemo(() => ({ addToast: ToastRuntime.addToast, removeToast: ToastRuntime.removeToast }), []);
|
|
237
237
|
return jsx(ToastProvider, { value: value, children: children });
|
|
238
238
|
};
|
|
239
239
|
|
|
@@ -347,6 +347,21 @@ const ErrorHandlingProviderIrisApp = ({ children, errorHandler }) => {
|
|
|
347
347
|
return (jsx(ErrorHandlingContextProvider, { value: errorHandler || defaultContextValue, children: children }));
|
|
348
348
|
};
|
|
349
349
|
|
|
350
|
+
/**
|
|
351
|
+
* This is a provider for the EnvironmentContext.
|
|
352
|
+
*/
|
|
353
|
+
const ExportDataProviderIrisApp = ({ children }) => {
|
|
354
|
+
const exportData = useCallback((props) => {
|
|
355
|
+
return ExportDataRuntime.exportData(props);
|
|
356
|
+
}, []);
|
|
357
|
+
const value = useMemo(() => {
|
|
358
|
+
return {
|
|
359
|
+
exportData,
|
|
360
|
+
};
|
|
361
|
+
}, [exportData]);
|
|
362
|
+
return jsx(ExportDataContext, { value: value, children: children });
|
|
363
|
+
};
|
|
364
|
+
|
|
350
365
|
/**
|
|
351
366
|
* This is a provider for the FilterBarContext.
|
|
352
367
|
*/
|
|
@@ -618,7 +633,7 @@ const TrackunitProviders = ({ translations, children, errorHandler }) => {
|
|
|
618
633
|
registerTranslations(translations); // Register the apps translations if passed.
|
|
619
634
|
}
|
|
620
635
|
initializeTranslationsForApp(); // Initialize all registered translations
|
|
621
|
-
return (jsx(EnvironmentProviderIrisApp, { children: jsx(ErrorHandlingProviderIrisApp, { errorHandler: errorHandler, children: jsx(ThemeCssProviderIrisApp, { children: jsx(TokenProviderIrisApp, { children: jsx(CurrentUserPreferenceProviderIrisApp, { children: jsx(CurrentUserProviderIrisApp, { children: jsx(UserSubscriptionProviderIrisApp, { children: jsx(AnalyticsProviderIrisApp, { children: jsx(OemBrandingContextProviderIrisApp, { children: jsx(AssetSortingProviderIrisApp, { children: jsx(ManagerApolloProvider, { children: jsx(NavigationProviderIrisApp, { children: jsx(ToastProviderIrisApp, { children: jsx(ModalDialogContextProviderIrisApp, { children: jsx(ConfirmationDialogProviderIrisApp, { children: jsx(FilterBarProviderIrisApp, { children: jsx(TimeRangeProviderIrisApp, { children: jsx(WidgetConfigProviderIrisApp, { children: jsx(Suspense, { fallback: jsx(Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
636
|
+
return (jsx(EnvironmentProviderIrisApp, { children: jsx(ErrorHandlingProviderIrisApp, { errorHandler: errorHandler, children: jsx(ThemeCssProviderIrisApp, { children: jsx(TokenProviderIrisApp, { children: jsx(CurrentUserPreferenceProviderIrisApp, { children: jsx(CurrentUserProviderIrisApp, { children: jsx(UserSubscriptionProviderIrisApp, { children: jsx(AnalyticsProviderIrisApp, { children: jsx(OemBrandingContextProviderIrisApp, { children: jsx(AssetSortingProviderIrisApp, { children: jsx(ManagerApolloProvider, { children: jsx(NavigationProviderIrisApp, { children: jsx(ToastProviderIrisApp, { children: jsx(ModalDialogContextProviderIrisApp, { children: jsx(ConfirmationDialogProviderIrisApp, { children: jsx(FilterBarProviderIrisApp, { children: jsx(ExportDataProviderIrisApp, { children: jsx(TimeRangeProviderIrisApp, { children: jsx(WidgetConfigProviderIrisApp, { children: jsx(Suspense, { fallback: jsx(Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
622
637
|
};
|
|
623
638
|
|
|
624
639
|
export { ManagerApolloProvider, ToastProviderIrisApp, TrackunitProviders };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-contexts",
|
|
3
|
-
"version": "1.9.
|
|
3
|
+
"version": "1.9.75",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -10,15 +10,15 @@
|
|
|
10
10
|
"@apollo/client": "3.13.8",
|
|
11
11
|
"react": "19.0.0",
|
|
12
12
|
"jest-fetch-mock": "^3.0.3",
|
|
13
|
-
"@trackunit/iris-app-api": "1.7.
|
|
14
|
-
"@trackunit/react-core-contexts-api": "1.8.
|
|
15
|
-
"@trackunit/react-core-hooks": "1.7.
|
|
16
|
-
"@trackunit/i18n-library-translation": "1.7.
|
|
17
|
-
"@trackunit/react-components": "1.10.
|
|
18
|
-
"@trackunit/iris-app-runtime-core": "1.8.
|
|
13
|
+
"@trackunit/iris-app-api": "1.7.49",
|
|
14
|
+
"@trackunit/react-core-contexts-api": "1.8.52",
|
|
15
|
+
"@trackunit/react-core-hooks": "1.7.56",
|
|
16
|
+
"@trackunit/i18n-library-translation": "1.7.59",
|
|
17
|
+
"@trackunit/react-components": "1.10.13",
|
|
18
|
+
"@trackunit/iris-app-runtime-core": "1.8.52",
|
|
19
19
|
"graphql": "^16.10.0",
|
|
20
20
|
"graphql-sse": "^2.5.4",
|
|
21
|
-
"@trackunit/react-test-setup": "1.4.
|
|
21
|
+
"@trackunit/react-test-setup": "1.4.47",
|
|
22
22
|
"@js-temporal/polyfill": "^0.5.1"
|
|
23
23
|
},
|
|
24
24
|
"module": "./index.esm.js",
|