@trackunit/react-core-contexts 0.4.139 → 0.4.141
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 +26 -1
- package/index.js +28 -3
- package/package.json +5 -5
- package/src/irisOemManifest/OemBrandingProvider.d.ts +9 -0
package/index.cjs
CHANGED
|
@@ -289,6 +289,31 @@ const TileGlobalSelectionProvider = ({ children }) => {
|
|
|
289
289
|
return jsxRuntime.jsx(reactCoreHooks.GlobalSelectionProvider, Object.assign({ value: GlobalSelectionContext }, { children: children }));
|
|
290
290
|
};
|
|
291
291
|
|
|
292
|
+
/**
|
|
293
|
+
* This is a provider for the IOemBrandingContext.
|
|
294
|
+
*/
|
|
295
|
+
const OemBrandingContextProvider = ({ children }) => {
|
|
296
|
+
const [oemBrandingContext, setOemBrandingContext] = React__namespace.useState(null);
|
|
297
|
+
React__namespace.useEffect(() => {
|
|
298
|
+
const updateContext = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
299
|
+
try {
|
|
300
|
+
setOemBrandingContext(yield irisAppRuntimeCore.OemBrandingContextRuntime.getOemBrandingContextRuntime());
|
|
301
|
+
}
|
|
302
|
+
catch (error) {
|
|
303
|
+
setOemBrandingContext(null);
|
|
304
|
+
// eslint-disable-next-line no-console
|
|
305
|
+
console.error("Could not load Iris App Oem!");
|
|
306
|
+
return;
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
updateContext();
|
|
310
|
+
}, []);
|
|
311
|
+
if (!oemBrandingContext) {
|
|
312
|
+
return null;
|
|
313
|
+
}
|
|
314
|
+
return jsxRuntime.jsx(reactCoreHooks.OemBrandingContextProvider, Object.assign({ value: oemBrandingContext }, { children: children }));
|
|
315
|
+
};
|
|
316
|
+
|
|
292
317
|
/**
|
|
293
318
|
* This is a provider for the TokenContext.
|
|
294
319
|
*/
|
|
@@ -350,7 +375,7 @@ const UserSubscriptionProvider = ({ children }) => {
|
|
|
350
375
|
/**
|
|
351
376
|
* This is a provider for the TrackunitDataProviders.
|
|
352
377
|
*/
|
|
353
|
-
const TrackunitDataProviders = ({ children }) => (jsxRuntime.jsx(TileEnvironmentProvider, { children: jsxRuntime.jsx(TileTokenProvider, { children: jsxRuntime.jsx(TileCurrentUserProvider, { children: jsxRuntime.jsx(UserSubscriptionProvider, { children: jsxRuntime.jsx(AnalyticsProvider, { children: jsxRuntime.jsx(TileGlobalSelectionProvider, { children: jsxRuntime.jsx(TileAssetSortingProvider, { children: jsxRuntime.jsx(ManagerApolloProvider, Object.assign({ isIrisApp: true }, { children: children })) }) }) }) }) }) }) }));
|
|
378
|
+
const TrackunitDataProviders = ({ children }) => (jsxRuntime.jsx(TileEnvironmentProvider, { children: jsxRuntime.jsx(TileTokenProvider, { children: jsxRuntime.jsx(TileCurrentUserProvider, { children: jsxRuntime.jsx(UserSubscriptionProvider, { children: jsxRuntime.jsx(AnalyticsProvider, { children: jsxRuntime.jsx(TileGlobalSelectionProvider, { children: jsxRuntime.jsx(OemBrandingContextProvider, { children: jsxRuntime.jsx(TileAssetSortingProvider, { children: jsxRuntime.jsx(ManagerApolloProvider, Object.assign({ isIrisApp: true }, { children: children })) }) }) }) }) }) }) }) }));
|
|
354
379
|
|
|
355
380
|
const HostNavigator = ({ children }) => {
|
|
356
381
|
reactCoreHooks.useURLSynchronization();
|
package/index.js
CHANGED
|
@@ -3,11 +3,11 @@ import { ApolloClient, InMemoryCache, from, split, ApolloProvider } 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, ToastProvider, AnalyticsContextProvider, AssetSortingProvider, EnvironmentContextProvider, GlobalSelectionProvider, TokenProvider, CurrentUserProvider, UserSubscriptionProvider as UserSubscriptionProvider$1, useURLSynchronization } from '@trackunit/react-core-hooks';
|
|
6
|
+
import { useEnvironment, useToken, ToastProvider, AnalyticsContextProvider, AssetSortingProvider, EnvironmentContextProvider, GlobalSelectionProvider, OemBrandingContextProvider as OemBrandingContextProvider$1, TokenProvider, CurrentUserProvider, UserSubscriptionProvider as UserSubscriptionProvider$1, useURLSynchronization } 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
|
-
import { ToastRuntime, AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, EnvironmentRuntime, GlobalSelectionRuntime, TokenRuntime, CurrentUserRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
10
|
+
import { ToastRuntime, AnalyticsContextRuntime, setupHostConnector, AssetSortingRuntime, EnvironmentRuntime, GlobalSelectionRuntime, OemBrandingContextRuntime, TokenRuntime, CurrentUserRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
11
11
|
import '@js-temporal/polyfill';
|
|
12
12
|
import { registerTranslations, initializeTranslationsForApp } from '@trackunit/i18n-library-translation';
|
|
13
13
|
import { Spinner } from '@trackunit/react-components';
|
|
@@ -265,6 +265,31 @@ const TileGlobalSelectionProvider = ({ children }) => {
|
|
|
265
265
|
return jsx(GlobalSelectionProvider, Object.assign({ value: GlobalSelectionContext }, { children: children }));
|
|
266
266
|
};
|
|
267
267
|
|
|
268
|
+
/**
|
|
269
|
+
* This is a provider for the IOemBrandingContext.
|
|
270
|
+
*/
|
|
271
|
+
const OemBrandingContextProvider = ({ children }) => {
|
|
272
|
+
const [oemBrandingContext, setOemBrandingContext] = React.useState(null);
|
|
273
|
+
React.useEffect(() => {
|
|
274
|
+
const updateContext = () => __awaiter(void 0, void 0, void 0, function* () {
|
|
275
|
+
try {
|
|
276
|
+
setOemBrandingContext(yield OemBrandingContextRuntime.getOemBrandingContextRuntime());
|
|
277
|
+
}
|
|
278
|
+
catch (error) {
|
|
279
|
+
setOemBrandingContext(null);
|
|
280
|
+
// eslint-disable-next-line no-console
|
|
281
|
+
console.error("Could not load Iris App Oem!");
|
|
282
|
+
return;
|
|
283
|
+
}
|
|
284
|
+
});
|
|
285
|
+
updateContext();
|
|
286
|
+
}, []);
|
|
287
|
+
if (!oemBrandingContext) {
|
|
288
|
+
return null;
|
|
289
|
+
}
|
|
290
|
+
return jsx(OemBrandingContextProvider$1, Object.assign({ value: oemBrandingContext }, { children: children }));
|
|
291
|
+
};
|
|
292
|
+
|
|
268
293
|
/**
|
|
269
294
|
* This is a provider for the TokenContext.
|
|
270
295
|
*/
|
|
@@ -326,7 +351,7 @@ const UserSubscriptionProvider = ({ children }) => {
|
|
|
326
351
|
/**
|
|
327
352
|
* This is a provider for the TrackunitDataProviders.
|
|
328
353
|
*/
|
|
329
|
-
const TrackunitDataProviders = ({ children }) => (jsx(TileEnvironmentProvider, { children: jsx(TileTokenProvider, { children: jsx(TileCurrentUserProvider, { children: jsx(UserSubscriptionProvider, { children: jsx(AnalyticsProvider, { children: jsx(TileGlobalSelectionProvider, { children: jsx(TileAssetSortingProvider, { children: jsx(ManagerApolloProvider, Object.assign({ isIrisApp: true }, { children: children })) }) }) }) }) }) }) }));
|
|
354
|
+
const TrackunitDataProviders = ({ children }) => (jsx(TileEnvironmentProvider, { children: jsx(TileTokenProvider, { children: jsx(TileCurrentUserProvider, { children: jsx(UserSubscriptionProvider, { children: jsx(AnalyticsProvider, { children: jsx(TileGlobalSelectionProvider, { children: jsx(OemBrandingContextProvider, { children: jsx(TileAssetSortingProvider, { children: jsx(ManagerApolloProvider, Object.assign({ isIrisApp: true }, { children: children })) }) }) }) }) }) }) }) }));
|
|
330
355
|
|
|
331
356
|
const HostNavigator = ({ children }) => {
|
|
332
357
|
useURLSynchronization();
|
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.141",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
6
6
|
"dependencies": {
|
|
@@ -9,11 +9,11 @@
|
|
|
9
9
|
"@js-temporal/polyfill": "0.4.3",
|
|
10
10
|
"@sentry/browser": "7.50.0",
|
|
11
11
|
"@trackunit/i18n-library-translation": "0.0.46",
|
|
12
|
-
"@trackunit/iris-app-runtime-core": "0.3.
|
|
12
|
+
"@trackunit/iris-app-runtime-core": "0.3.41",
|
|
13
13
|
"@trackunit/react-components": "0.1.90",
|
|
14
|
-
"@trackunit/react-core-contexts-api": "0.2.
|
|
15
|
-
"@trackunit/react-core-contexts-test": "0.1.
|
|
16
|
-
"@trackunit/react-core-hooks": "0.2.
|
|
14
|
+
"@trackunit/react-core-contexts-api": "0.2.32",
|
|
15
|
+
"@trackunit/react-core-contexts-test": "0.1.59",
|
|
16
|
+
"@trackunit/react-core-hooks": "0.2.54",
|
|
17
17
|
"apollo-upload-client": "17.0.0",
|
|
18
18
|
"react": "18.2.0",
|
|
19
19
|
"react-router-dom": "6.4.5"
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
interface IProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* This is a provider for the IOemBrandingContext.
|
|
7
|
+
*/
|
|
8
|
+
declare const OemBrandingContextProvider: ({ children }: IProps) => JSX.Element | null;
|
|
9
|
+
export default OemBrandingContextProvider;
|