@trackunit/react-core-contexts 0.0.19 → 0.0.23
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/README.md +1 -1
- package/index.d.ts +1 -1
- package/index.js +22 -20
- package/package.json +5 -5
- package/toast/ToastProviderApp.d.ts +6 -0
- package/whitelabel/AppWhitelabelProvider.d.ts +0 -6
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@ Inside the provider the following hooks from `react-core-hooks` can be used:
|
|
|
15
15
|
- Obtain an access token from the `useToken` hook.
|
|
16
16
|
|
|
17
17
|
## Trackunit
|
|
18
|
-
This package was developed by Trackunit ApS.
|
|
18
|
+
This package was developed by Trackunit ApS.
|
|
19
19
|
Trackunit is the leading SaaS-based IoT solution for the construction industry, offering an ecosystem of hardware, fleet management software & telematics.
|
|
20
20
|
|
|
21
21
|

|
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -3,12 +3,12 @@ import { ApolloClient, InMemoryCache, from, split as split$1, ApolloProvider } f
|
|
|
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, EnvironmentContextProvider, TokenProvider, CurrentUserProvider, UserSubscriptionProvider as UserSubscriptionProvider$1
|
|
6
|
+
import { useEnvironment, useToken, ToastProvider, EnvironmentContextProvider, TokenProvider, CurrentUserProvider, UserSubscriptionProvider as UserSubscriptionProvider$1 } from '@trackunit/react-core-hooks';
|
|
7
7
|
import { createUploadLink } from 'apollo-upload-client';
|
|
8
|
-
import {
|
|
9
|
-
import { EnvironmentRuntime, TokenRuntime, CurrentUserRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
8
|
+
import { ToastRuntime, EnvironmentRuntime, TokenRuntime, CurrentUserRuntime, UserSubscriptionRuntime } from '@trackunit/iris-app-runtime-core';
|
|
10
9
|
import * as React from 'react';
|
|
11
|
-
import {
|
|
10
|
+
import { useMemo } from 'react';
|
|
11
|
+
import { BrowserRouter } from 'react-router-dom';
|
|
12
12
|
|
|
13
13
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
14
14
|
|
|
@@ -1927,6 +1927,19 @@ const ManagerApolloProvider = ({
|
|
|
1927
1927
|
}));
|
|
1928
1928
|
};
|
|
1929
1929
|
|
|
1930
|
+
const ToastProviderApp = ({
|
|
1931
|
+
children
|
|
1932
|
+
}) => {
|
|
1933
|
+
const value = useMemo(() => ({
|
|
1934
|
+
addToast: ToastRuntime.addToast
|
|
1935
|
+
}), []);
|
|
1936
|
+
return jsx(ToastProvider, Object.assign({
|
|
1937
|
+
value: value
|
|
1938
|
+
}, {
|
|
1939
|
+
children: children
|
|
1940
|
+
}));
|
|
1941
|
+
};
|
|
1942
|
+
|
|
1930
1943
|
var wellKnownSymbol$4 = wellKnownSymbol$c;
|
|
1931
1944
|
var create$1 = objectCreate;
|
|
1932
1945
|
var definePropertyModule = objectDefineProperty;
|
|
@@ -2444,22 +2457,11 @@ const TrackunitDataProviders = ({
|
|
|
2444
2457
|
const TrackunitProviders = ({
|
|
2445
2458
|
children
|
|
2446
2459
|
}) => jsx(TrackunitDataProviders, {
|
|
2447
|
-
children: jsx(
|
|
2448
|
-
children:
|
|
2460
|
+
children: jsx(ToastProviderApp, {
|
|
2461
|
+
children: jsx(BrowserRouter, {
|
|
2462
|
+
children: children
|
|
2463
|
+
})
|
|
2449
2464
|
})
|
|
2450
2465
|
});
|
|
2451
2466
|
|
|
2452
|
-
|
|
2453
|
-
brand: Brand.Trackunit
|
|
2454
|
-
};
|
|
2455
|
-
const AppWhitelabelProvider = ({
|
|
2456
|
-
children
|
|
2457
|
-
}) => {
|
|
2458
|
-
return jsx(WhiteLabelProvider, Object.assign({
|
|
2459
|
-
value: value
|
|
2460
|
-
}, {
|
|
2461
|
-
children: children
|
|
2462
|
-
}));
|
|
2463
|
-
};
|
|
2464
|
-
|
|
2465
|
-
export { AppWhitelabelProvider, ManagerApolloProvider, TrackunitProviders };
|
|
2467
|
+
export { ManagerApolloProvider, ToastProviderApp, TrackunitProviders };
|
package/package.json
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@trackunit/react-core-contexts",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.23",
|
|
4
4
|
"repository": "https://github.com/Trackunit/manager",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"dependencies": {
|
|
7
7
|
"graphql": "^15.8.0",
|
|
8
|
-
"@trackunit/iris-app-runtime-core": "0.0.
|
|
9
|
-
"@trackunit/react-core-contexts-api": "0.0.
|
|
10
|
-
"@trackunit/react-core-hooks": "0.0.
|
|
8
|
+
"@trackunit/iris-app-runtime-core": "0.0.51",
|
|
9
|
+
"@trackunit/react-core-contexts-api": "0.0.47",
|
|
10
|
+
"@trackunit/react-core-hooks": "0.0.50",
|
|
11
11
|
"react": "17.0.1",
|
|
12
|
-
"@trackunit/react-core-contexts-test": "0.0.
|
|
12
|
+
"@trackunit/react-core-contexts-test": "0.0.20",
|
|
13
13
|
"@apollo/client": "3.6.9",
|
|
14
14
|
"@sentry/browser": "^6.19.4",
|
|
15
15
|
"apollo-upload-client": "^14.1.3",
|