@trackunit/react-core-contexts 0.4.341 → 0.4.343
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
|
@@ -330,26 +330,6 @@ const FilterBarProviderIrisApp = ({ children }) => {
|
|
|
330
330
|
return jsxRuntime.jsx(reactCoreHooks.FilterBarProvider, { value: FilterBarContext, children: children });
|
|
331
331
|
};
|
|
332
332
|
|
|
333
|
-
/**
|
|
334
|
-
* This is a provider for the GlobalSelectionContext.
|
|
335
|
-
*/
|
|
336
|
-
const GlobalSelectionProviderIrisApp = ({ children }) => {
|
|
337
|
-
const [GlobalSelectionContext, setGlobalSelectionContext] = React.useState(null);
|
|
338
|
-
React.useEffect(() => {
|
|
339
|
-
irisAppRuntimeCore.GlobalSelectionRuntime.getGlobalSelection()
|
|
340
|
-
.catch(() => null)
|
|
341
|
-
.then(setGlobalSelectionContext);
|
|
342
|
-
}, []);
|
|
343
|
-
const methods = React.useMemo(() => ({
|
|
344
|
-
onGlobalSelectionChanged: setGlobalSelectionContext,
|
|
345
|
-
}), [setGlobalSelectionContext]);
|
|
346
|
-
useSubscribeToHostChanges(methods);
|
|
347
|
-
if (!GlobalSelectionContext) {
|
|
348
|
-
return null;
|
|
349
|
-
}
|
|
350
|
-
return jsxRuntime.jsx(reactCoreHooks.GlobalSelectionProvider, { value: GlobalSelectionContext, children: children });
|
|
351
|
-
};
|
|
352
|
-
|
|
353
333
|
/**
|
|
354
334
|
* This is a provider for the NavigationContext.
|
|
355
335
|
*/
|
|
@@ -500,7 +480,7 @@ const TrackunitProviders = ({ translations, children }) => {
|
|
|
500
480
|
i18nLibraryTranslation.registerTranslations(translations); // Register the apps translations if passed.
|
|
501
481
|
}
|
|
502
482
|
i18nLibraryTranslation.initializeTranslationsForApp(); // Initialize all registered translations
|
|
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(
|
|
483
|
+
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(FilterBarProviderIrisApp, { children: jsxRuntime.jsx(React__namespace.Suspense, { fallback: jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered" }), children: jsxRuntime.jsx(TrackunitRouterIrisApp, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
504
484
|
};
|
|
505
485
|
|
|
506
486
|
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, useCurrentUser, useToken, AnalyticsContextProvider, AssetSortingProvider, EnvironmentContextProvider, FilterBarProvider,
|
|
6
|
+
import { useEnvironment, useCurrentUser, useToken, AnalyticsContextProvider, AssetSortingProvider, EnvironmentContextProvider, FilterBarProvider, NavigationContextProvider, OemBrandingContextProvider, ToastProvider, TokenProvider, useURLSynchronization, 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 { 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, EnvironmentRuntime, FilterBarRuntime,
|
|
13
|
+
import { AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, EnvironmentRuntime, FilterBarRuntime, NavigationRuntime, OemBrandingContextRuntime, ToastRuntime, TokenRuntime, CurrentUserRuntime, CurrentUserPreferenceRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
14
14
|
import { BrowserRouter } from 'react-router-dom';
|
|
15
15
|
|
|
16
16
|
/******************************************************************************
|
|
@@ -306,26 +306,6 @@ const FilterBarProviderIrisApp = ({ children }) => {
|
|
|
306
306
|
return jsx(FilterBarProvider, { value: FilterBarContext, children: children });
|
|
307
307
|
};
|
|
308
308
|
|
|
309
|
-
/**
|
|
310
|
-
* This is a provider for the GlobalSelectionContext.
|
|
311
|
-
*/
|
|
312
|
-
const GlobalSelectionProviderIrisApp = ({ children }) => {
|
|
313
|
-
const [GlobalSelectionContext, setGlobalSelectionContext] = useState(null);
|
|
314
|
-
useEffect(() => {
|
|
315
|
-
GlobalSelectionRuntime.getGlobalSelection()
|
|
316
|
-
.catch(() => null)
|
|
317
|
-
.then(setGlobalSelectionContext);
|
|
318
|
-
}, []);
|
|
319
|
-
const methods = useMemo(() => ({
|
|
320
|
-
onGlobalSelectionChanged: setGlobalSelectionContext,
|
|
321
|
-
}), [setGlobalSelectionContext]);
|
|
322
|
-
useSubscribeToHostChanges(methods);
|
|
323
|
-
if (!GlobalSelectionContext) {
|
|
324
|
-
return null;
|
|
325
|
-
}
|
|
326
|
-
return jsx(GlobalSelectionProvider, { value: GlobalSelectionContext, children: children });
|
|
327
|
-
};
|
|
328
|
-
|
|
329
309
|
/**
|
|
330
310
|
* This is a provider for the NavigationContext.
|
|
331
311
|
*/
|
|
@@ -476,7 +456,7 @@ const TrackunitProviders = ({ translations, children }) => {
|
|
|
476
456
|
registerTranslations(translations); // Register the apps translations if passed.
|
|
477
457
|
}
|
|
478
458
|
initializeTranslationsForApp(); // Initialize all registered translations
|
|
479
|
-
return (jsx(EnvironmentProviderIrisApp, { children: jsx(TokenProviderIrisApp, { children: jsx(CurrentUserPreferenceProviderIrisApp, { children: jsx(CurrentUserProviderIrisApp, { children: jsx(UserSubscriptionProviderIrisApp, { children: jsx(AnalyticsProviderIrisApp, { children: jsx(
|
|
459
|
+
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(FilterBarProviderIrisApp, { children: jsx(React.Suspense, { fallback: jsx(Spinner, { centering: "centered" }), children: jsx(TrackunitRouterIrisApp, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
480
460
|
};
|
|
481
461
|
|
|
482
462
|
export { ManagerApolloProvider, ToastProviderIrisApp, TrackunitProviders };
|
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/// <reference types="react" />
|
|
2
|
-
interface IProps {
|
|
3
|
-
children: React.ReactNode;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* This is a provider for the GlobalSelectionContext.
|
|
7
|
-
*/
|
|
8
|
-
export declare const GlobalSelectionProviderIrisApp: ({ children }: IProps) => JSX.Element | null;
|
|
9
|
-
export {};
|