@trackunit/react-core-contexts 0.4.248 → 0.4.250
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 +27 -1
- package/index.esm.js +29 -3
- package/package.json +7 -7
- package/src/filterBar/FilterBarProviderIrisApp.d.ts +9 -0
package/index.cjs.js
CHANGED
|
@@ -30841,6 +30841,32 @@ const EnvironmentProviderIrisApp = ({ children }) => {
|
|
|
30841
30841
|
return jsxRuntime.jsx(reactCoreHooks.EnvironmentContextProvider, { value: environment, children: children });
|
|
30842
30842
|
};
|
|
30843
30843
|
|
|
30844
|
+
/**
|
|
30845
|
+
* This is a provider for the FilterBarContext.
|
|
30846
|
+
*/
|
|
30847
|
+
const FilterBarProviderIrisApp = ({ children }) => {
|
|
30848
|
+
const [FilterBarContext, setFilterBarContext] = React.useState();
|
|
30849
|
+
React.useEffect(() => {
|
|
30850
|
+
irisAppRuntimeCore.FilterBarRuntime.getFilterBarValues()
|
|
30851
|
+
.catch(() => null)
|
|
30852
|
+
.then(filterBarValues => {
|
|
30853
|
+
if (filterBarValues !== null && filterBarValues !== undefined) {
|
|
30854
|
+
setFilterBarContext({ filterBarValues });
|
|
30855
|
+
}
|
|
30856
|
+
});
|
|
30857
|
+
}, []);
|
|
30858
|
+
const methods = React.useMemo(() => ({
|
|
30859
|
+
onFilterBarValuesChanged: (filterBarValues) => {
|
|
30860
|
+
setFilterBarContext({ filterBarValues });
|
|
30861
|
+
},
|
|
30862
|
+
}), [setFilterBarContext]);
|
|
30863
|
+
useSubscribeToHostChanges(methods);
|
|
30864
|
+
if (!FilterBarContext) {
|
|
30865
|
+
return null;
|
|
30866
|
+
}
|
|
30867
|
+
return jsxRuntime.jsx(reactCoreHooks.FilterBarProvider, { value: FilterBarContext, children: children });
|
|
30868
|
+
};
|
|
30869
|
+
|
|
30844
30870
|
/**
|
|
30845
30871
|
* This is a provider for the GlobalSelectionContext.
|
|
30846
30872
|
*/
|
|
@@ -30965,7 +30991,7 @@ const TrackunitProviders = ({ translations, children }) => {
|
|
|
30965
30991
|
i18nLibraryTranslation.registerTranslations(translations); // Register the apps translations if passed.
|
|
30966
30992
|
}
|
|
30967
30993
|
i18nLibraryTranslation.initializeTranslationsForApp(); // Initialize all registered translations
|
|
30968
|
-
return (jsxRuntime.jsx(EnvironmentProviderIrisApp, { children: jsxRuntime.jsx(TokenProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserProviderIrisApp, { children: jsxRuntime.jsx(UserSubscriptionProviderIrisApp, { children: jsxRuntime.jsx(AnalyticsProviderIrisApp, { children: jsxRuntime.jsx(GlobalSelectionProviderIrisApp, { children: jsxRuntime.jsx(OemBrandingContextProviderIrisApp, { children: jsxRuntime.jsx(AssetSortingProviderIrisApp, { children: jsxRuntime.jsx(ManagerApolloProvider, { isIrisApp: true, children: jsxRuntime.jsx(ToastProviderIrisApp, { children: jsxRuntime.jsx(React__namespace.Suspense, { fallback: jsxRuntime.jsx(reactComponents.Spinner, { centering: "centered" }), children: jsxRuntime.jsx(TrackunitRouterIrisApp, { children: children }) }) }) }) }) }) }) }) }) }) }) }));
|
|
30994
|
+
return (jsxRuntime.jsx(EnvironmentProviderIrisApp, { children: jsxRuntime.jsx(TokenProviderIrisApp, { children: jsxRuntime.jsx(CurrentUserProviderIrisApp, { children: jsxRuntime.jsx(UserSubscriptionProviderIrisApp, { children: jsxRuntime.jsx(AnalyticsProviderIrisApp, { children: jsxRuntime.jsx(GlobalSelectionProviderIrisApp, { children: jsxRuntime.jsx(OemBrandingContextProviderIrisApp, { children: jsxRuntime.jsx(AssetSortingProviderIrisApp, { children: jsxRuntime.jsx(ManagerApolloProvider, { isIrisApp: true, 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 }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
30969
30995
|
};
|
|
30970
30996
|
|
|
30971
30997
|
exports.ManagerApolloProvider = ManagerApolloProvider;
|
package/index.esm.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsx, Fragment } from 'react/jsx-runtime';
|
|
2
2
|
import { Source, visit as visit$1, BREAK, Kind, print, isSelectionNode, parse } from 'graphql';
|
|
3
|
-
import { useEnvironment, useCurrentUser, useToken, ToastProvider, AnalyticsContextProvider, AssetSortingProvider, EnvironmentContextProvider, GlobalSelectionProvider, OemBrandingContextProvider, TokenProvider, useURLSynchronization, CurrentUserProvider, UserSubscriptionProvider } from '@trackunit/react-core-hooks';
|
|
3
|
+
import { useEnvironment, useCurrentUser, useToken, ToastProvider, AnalyticsContextProvider, AssetSortingProvider, EnvironmentContextProvider, FilterBarProvider, GlobalSelectionProvider, OemBrandingContextProvider, TokenProvider, useURLSynchronization, CurrentUserProvider, UserSubscriptionProvider } from '@trackunit/react-core-hooks';
|
|
4
4
|
import * as React from 'react';
|
|
5
5
|
import { useMemo, useEffect, useState } from 'react';
|
|
6
|
-
import { ToastRuntime, AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, EnvironmentRuntime, GlobalSelectionRuntime, OemBrandingContextRuntime, TokenRuntime, CurrentUserRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
6
|
+
import { ToastRuntime, AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, EnvironmentRuntime, FilterBarRuntime, GlobalSelectionRuntime, OemBrandingContextRuntime, TokenRuntime, CurrentUserRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
7
7
|
import { registerTranslations, initializeTranslationsForApp } from '@trackunit/i18n-library-translation';
|
|
8
8
|
import { Spinner } from '@trackunit/react-components';
|
|
9
9
|
import { BrowserRouter } from 'react-router-dom';
|
|
@@ -30818,6 +30818,32 @@ const EnvironmentProviderIrisApp = ({ children }) => {
|
|
|
30818
30818
|
return jsx(EnvironmentContextProvider, { value: environment, children: children });
|
|
30819
30819
|
};
|
|
30820
30820
|
|
|
30821
|
+
/**
|
|
30822
|
+
* This is a provider for the FilterBarContext.
|
|
30823
|
+
*/
|
|
30824
|
+
const FilterBarProviderIrisApp = ({ children }) => {
|
|
30825
|
+
const [FilterBarContext, setFilterBarContext] = useState();
|
|
30826
|
+
useEffect(() => {
|
|
30827
|
+
FilterBarRuntime.getFilterBarValues()
|
|
30828
|
+
.catch(() => null)
|
|
30829
|
+
.then(filterBarValues => {
|
|
30830
|
+
if (filterBarValues !== null && filterBarValues !== undefined) {
|
|
30831
|
+
setFilterBarContext({ filterBarValues });
|
|
30832
|
+
}
|
|
30833
|
+
});
|
|
30834
|
+
}, []);
|
|
30835
|
+
const methods = useMemo(() => ({
|
|
30836
|
+
onFilterBarValuesChanged: (filterBarValues) => {
|
|
30837
|
+
setFilterBarContext({ filterBarValues });
|
|
30838
|
+
},
|
|
30839
|
+
}), [setFilterBarContext]);
|
|
30840
|
+
useSubscribeToHostChanges(methods);
|
|
30841
|
+
if (!FilterBarContext) {
|
|
30842
|
+
return null;
|
|
30843
|
+
}
|
|
30844
|
+
return jsx(FilterBarProvider, { value: FilterBarContext, children: children });
|
|
30845
|
+
};
|
|
30846
|
+
|
|
30821
30847
|
/**
|
|
30822
30848
|
* This is a provider for the GlobalSelectionContext.
|
|
30823
30849
|
*/
|
|
@@ -30942,7 +30968,7 @@ const TrackunitProviders = ({ translations, children }) => {
|
|
|
30942
30968
|
registerTranslations(translations); // Register the apps translations if passed.
|
|
30943
30969
|
}
|
|
30944
30970
|
initializeTranslationsForApp(); // Initialize all registered translations
|
|
30945
|
-
return (jsx(EnvironmentProviderIrisApp, { children: jsx(TokenProviderIrisApp, { children: jsx(CurrentUserProviderIrisApp, { children: jsx(UserSubscriptionProviderIrisApp, { children: jsx(AnalyticsProviderIrisApp, { children: jsx(GlobalSelectionProviderIrisApp, { children: jsx(OemBrandingContextProviderIrisApp, { children: jsx(AssetSortingProviderIrisApp, { children: jsx(ManagerApolloProvider, { isIrisApp: true, children: jsx(ToastProviderIrisApp, { children: jsx(React.Suspense, { fallback: jsx(Spinner, { centering: "centered" }), children: jsx(TrackunitRouterIrisApp, { children: children }) }) }) }) }) }) }) }) }) }) }) }));
|
|
30971
|
+
return (jsx(EnvironmentProviderIrisApp, { children: jsx(TokenProviderIrisApp, { children: jsx(CurrentUserProviderIrisApp, { children: jsx(UserSubscriptionProviderIrisApp, { children: jsx(AnalyticsProviderIrisApp, { children: jsx(GlobalSelectionProviderIrisApp, { children: jsx(OemBrandingContextProviderIrisApp, { children: jsx(AssetSortingProviderIrisApp, { children: jsx(ManagerApolloProvider, { isIrisApp: true, children: jsx(ToastProviderIrisApp, { children: jsx(FilterBarProviderIrisApp, { children: jsx(React.Suspense, { fallback: jsx(Spinner, { centering: "centered" }), children: jsx(TrackunitRouterIrisApp, { children: children }) }) }) }) }) }) }) }) }) }) }) }) }));
|
|
30946
30972
|
};
|
|
30947
30973
|
|
|
30948
30974
|
export { ManagerApolloProvider, ToastProviderIrisApp, TrackunitProviders };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-contexts",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.250",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"engines": {
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"@apollo/client": "3.7.10",
|
|
12
12
|
"@js-temporal/polyfill": "0.4.3",
|
|
13
13
|
"@sentry/browser": "7.57.0",
|
|
14
|
-
"@trackunit/i18n-library-translation": "0.0.
|
|
15
|
-
"@trackunit/iris-app-runtime-core": "0.3.
|
|
16
|
-
"@trackunit/react-components": "0.1.
|
|
17
|
-
"@trackunit/react-core-contexts-api": "0.2.
|
|
18
|
-
"@trackunit/react-core-contexts-test": "0.1.
|
|
19
|
-
"@trackunit/react-core-hooks": "0.2.
|
|
14
|
+
"@trackunit/i18n-library-translation": "0.0.77",
|
|
15
|
+
"@trackunit/iris-app-runtime-core": "0.3.73",
|
|
16
|
+
"@trackunit/react-components": "0.1.156",
|
|
17
|
+
"@trackunit/react-core-contexts-api": "0.2.56",
|
|
18
|
+
"@trackunit/react-core-contexts-test": "0.1.105",
|
|
19
|
+
"@trackunit/react-core-hooks": "0.2.91",
|
|
20
20
|
"apollo-upload-client": "17.0.0",
|
|
21
21
|
"react": "18.2.0",
|
|
22
22
|
"react-router-dom": "6.11.2"
|