@trackunit/react-core-contexts 0.4.491 → 0.4.492
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
CHANGED
|
@@ -355,6 +355,14 @@ const FilterBarProviderIrisApp = ({ children }) => {
|
|
|
355
355
|
return jsxRuntime.jsx(reactCoreHooks.FilterBarProvider, { value: FilterBarContext, children: children });
|
|
356
356
|
};
|
|
357
357
|
|
|
358
|
+
/**
|
|
359
|
+
* This is a provider for the Modal Dialog Context.
|
|
360
|
+
*/
|
|
361
|
+
const ModalDialogContextProviderIrisApp = ({ children }) => {
|
|
362
|
+
const value = React__namespace.useMemo(() => ({ openModal: irisAppRuntimeCore.ModalDialogRuntime.openModal, closeModal: irisAppRuntimeCore.ModalDialogRuntime.closeModal }), []);
|
|
363
|
+
return jsxRuntime.jsx(reactCoreHooks.ModalDialogContextProvider, { value: value, children: children });
|
|
364
|
+
};
|
|
365
|
+
|
|
358
366
|
/**
|
|
359
367
|
* This is a provider for the NavigationContext.
|
|
360
368
|
*/
|
|
@@ -492,7 +500,7 @@ const TrackunitProviders = ({ translations, children }) => {
|
|
|
492
500
|
i18nLibraryTranslation.registerTranslations(translations); // Register the apps translations if passed.
|
|
493
501
|
}
|
|
494
502
|
i18nLibraryTranslation.initializeTranslationsForApp(); // Initialize all registered translations
|
|
495
|
-
return (jsxRuntime.jsx(EnvironmentProviderIrisApp, { 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(ConfirmationDialogProviderIrisApp, { children: jsxRuntime.jsx(FilterBarProviderIrisApp, { children: jsxRuntime.jsx(React__namespace.Suspense, { fallback: jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
503
|
+
return (jsxRuntime.jsx(EnvironmentProviderIrisApp, { 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(React__namespace.Suspense, { fallback: jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
496
504
|
};
|
|
497
505
|
|
|
498
506
|
exports.ManagerApolloProvider = ManagerApolloProvider;
|
package/index.esm.js
CHANGED
|
@@ -3,14 +3,14 @@ import { ApolloProvider, ApolloClient, InMemoryCache, from, split } from '@apoll
|
|
|
3
3
|
import { setContext } from '@apollo/client/link/context';
|
|
4
4
|
import { onError } from '@apollo/client/link/error';
|
|
5
5
|
import * as Sentry from '@sentry/browser';
|
|
6
|
-
import { useEnvironment, useToken, AnalyticsContextProvider, AssetSortingProvider, ConfirmationDialogProvider, EnvironmentContextProvider, FilterBarProvider, NavigationContextProvider, OemBrandingContextProvider, ToastProvider, TokenProvider, CurrentUserProvider, CurrentUserPreferenceProvider, UserSubscriptionProvider } from '@trackunit/react-core-hooks';
|
|
6
|
+
import { useEnvironment, useToken, AnalyticsContextProvider, AssetSortingProvider, ConfirmationDialogProvider, EnvironmentContextProvider, FilterBarProvider, ModalDialogContextProvider, NavigationContextProvider, OemBrandingContextProvider, ToastProvider, TokenProvider, CurrentUserProvider, CurrentUserPreferenceProvider, UserSubscriptionProvider } from '@trackunit/react-core-hooks';
|
|
7
7
|
import { createUploadLink } from 'apollo-upload-client';
|
|
8
8
|
import * as React from 'react';
|
|
9
9
|
import { useRef, useMemo, useEffect, useState } from 'react';
|
|
10
10
|
import '@js-temporal/polyfill';
|
|
11
11
|
import { registerTranslations, initializeTranslationsForApp } from '@trackunit/i18n-library-translation';
|
|
12
12
|
import { Spinner } from '@trackunit/react-components';
|
|
13
|
-
import { AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, ConfirmationDialogRuntime, EnvironmentRuntime, FilterBarRuntime, NavigationRuntime, OemBrandingContextRuntime, ToastRuntime, TokenRuntime, CurrentUserRuntime, CurrentUserPreferenceRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
13
|
+
import { AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, ConfirmationDialogRuntime, EnvironmentRuntime, FilterBarRuntime, ModalDialogRuntime, NavigationRuntime, OemBrandingContextRuntime, ToastRuntime, TokenRuntime, CurrentUserRuntime, CurrentUserPreferenceRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
14
14
|
|
|
15
15
|
/******************************************************************************
|
|
16
16
|
Copyright (c) Microsoft Corporation.
|
|
@@ -331,6 +331,14 @@ const FilterBarProviderIrisApp = ({ children }) => {
|
|
|
331
331
|
return jsx(FilterBarProvider, { value: FilterBarContext, children: children });
|
|
332
332
|
};
|
|
333
333
|
|
|
334
|
+
/**
|
|
335
|
+
* This is a provider for the Modal Dialog Context.
|
|
336
|
+
*/
|
|
337
|
+
const ModalDialogContextProviderIrisApp = ({ children }) => {
|
|
338
|
+
const value = React.useMemo(() => ({ openModal: ModalDialogRuntime.openModal, closeModal: ModalDialogRuntime.closeModal }), []);
|
|
339
|
+
return jsx(ModalDialogContextProvider, { value: value, children: children });
|
|
340
|
+
};
|
|
341
|
+
|
|
334
342
|
/**
|
|
335
343
|
* This is a provider for the NavigationContext.
|
|
336
344
|
*/
|
|
@@ -468,7 +476,7 @@ const TrackunitProviders = ({ translations, children }) => {
|
|
|
468
476
|
registerTranslations(translations); // Register the apps translations if passed.
|
|
469
477
|
}
|
|
470
478
|
initializeTranslationsForApp(); // Initialize all registered translations
|
|
471
|
-
return (jsx(EnvironmentProviderIrisApp, { 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(ConfirmationDialogProviderIrisApp, { children: jsx(FilterBarProviderIrisApp, { children: jsx(React.Suspense, { fallback: jsx(Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
479
|
+
return (jsx(EnvironmentProviderIrisApp, { 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(React.Suspense, { fallback: jsx(Spinner, { centering: "centered", dataTestId: "trackunit-providers" }), children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
472
480
|
};
|
|
473
481
|
|
|
474
482
|
export { ManagerApolloProvider, ToastProviderIrisApp, TrackunitProviders };
|
package/package.json
CHANGED