@equinor/mad-core 0.6.1 → 0.7.0
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/CHANGELOG.md +18 -0
- package/README.md +33 -0
- package/dist/{chunk-UD3DA4FR.js → chunk-3WTKRZ37.js} +1 -1
- package/dist/{chunk-5J3FTNVE.js → chunk-4DM2ONVH.js} +9 -9
- package/dist/{chunk-GOYAFKM3.js → chunk-57NV3AWS.js} +1 -1
- package/dist/{chunk-LSA52JU5.js → chunk-5MPPKD5X.js} +4 -4
- package/dist/{chunk-CEFUB5I4.js → chunk-6MIUWCTG.js} +2 -2
- package/dist/{chunk-KBEPONRV.js → chunk-7E5VE2A2.js} +7 -5
- package/dist/{chunk-TOCPQ2JB.js → chunk-7FMPZFRS.js} +1 -1
- package/dist/{chunk-R4TBMU5D.js → chunk-AAPOT2F3.js} +1 -1
- package/dist/{chunk-2CVBYJXN.js → chunk-CCRYPD4B.js} +1 -1
- package/dist/{chunk-ZTNMWI3H.js → chunk-ECVSJUOE.js} +5 -5
- package/dist/{chunk-5TJVZFPL.js → chunk-ESL24TPV.js} +4 -4
- package/dist/{chunk-W3LMT7N4.js → chunk-FW4GVJC7.js} +5 -1
- package/dist/{chunk-VYI4KBQO.js → chunk-KIMBCQQM.js} +2 -2
- package/dist/{chunk-BVFOO2RO.js → chunk-KQI7B7LY.js} +2 -2
- package/dist/{chunk-RMME4MJU.js → chunk-NLNSDAD7.js} +1 -1
- package/dist/{chunk-EQYL7INQ.js → chunk-NZJ2OJKA.js} +7 -2
- package/dist/{chunk-U6GW6ZHM.js → chunk-O3MDFTFC.js} +29 -27
- package/dist/{chunk-Y4F6JPUK.js → chunk-PB7RCM3P.js} +2 -2
- package/dist/{chunk-7NTWLQ7J.js → chunk-PJR6OKX6.js} +1 -1
- package/dist/{chunk-N2HQZLB2.js → chunk-SOHMDEWI.js} +1 -1
- package/dist/{chunk-N4EOPAYE.js → chunk-TISU6GUX.js} +1 -1
- package/dist/{chunk-6WQG7OGA.js → chunk-V5WZIP2H.js} +1 -1
- package/dist/{chunk-LTQGTI3K.js → chunk-VQT4HKQP.js} +1 -1
- package/dist/{chunk-ZADB3VIP.js → chunk-W6GVPMN4.js} +4 -4
- package/dist/{chunk-U3K3DQC5.js → chunk-XDGQBDUQ.js} +5 -2
- package/dist/{chunk-MSOJFY3S.js → chunk-Y2UHRJ7H.js} +1 -1
- package/dist/{chunk-OXXEF5WL.js → chunk-Y42WKXNP.js} +1 -1
- package/dist/{chunk-AXEUL63W.js → chunk-Z6PI6VJV.js} +4 -4
- package/dist/components/EnvironmentBanner.js +2 -2
- package/dist/components/EnvironmentProvider.js +2 -2
- package/dist/components/NavigationContainer.d.ts +14 -2
- package/dist/components/NavigationContainer.js +1 -1
- package/dist/components/createCoreStackNavigator.d.ts +24 -24
- package/dist/components/createCoreStackNavigator.js +25 -25
- package/dist/components/index.js +28 -28
- package/dist/components/navigation/MadCoreSubHeader.js +6 -6
- package/dist/components/navigation/index.js +7 -7
- package/dist/components/navigation/navigation-creators.d.ts +12 -12
- package/dist/components/navigation/navigation-creators.js +7 -7
- package/dist/components/screens/AboutScreen.js +2 -2
- package/dist/components/screens/LoginScreen.js +3 -3
- package/dist/components/screens/create-incident/CreateIncidentScreen.js +4 -3
- package/dist/components/screens/language/SelectLanguageScreen.js +5 -5
- package/dist/components/screens/language/components/SelectLanguageCellGroup.js +2 -2
- package/dist/components/screens/release-notes/ReleaseNotesScreen.js +6 -5
- package/dist/components/screens/release-notes/WhatsNewScreen.js +5 -5
- package/dist/components/screens/release-notes/fetchReleaseNotes.js +9 -1
- package/dist/components/screens/settings/Section.js +7 -1
- package/dist/components/screens/settings/SettingsScreen.js +6 -5
- package/dist/components/screens/settings/index.js +6 -5
- package/dist/components/screens/settings/useSignOut.js +6 -1
- package/dist/components/service-message/ServiceMessageBanner.js +4 -4
- package/dist/components/service-message/ServiceMessageProvider.js +3 -3
- package/dist/components/service-message/hooks/useFetchServiceMessage.js +2 -2
- package/dist/hooks/UseReleaseNotes.js +4 -3
- package/dist/hooks/index.js +7 -1
- package/dist/hooks/useAccountOrDemoAccount.js +7 -1
- package/dist/hooks/useNavigateFromLanguageSelectScreen.js +2 -2
- package/dist/hooks/useNavigateFromLoginScreen.js +2 -2
- package/dist/hooks/useNavigateFromWhatsNewScreen.js +2 -2
- package/dist/hooks/useScreenTitleFromDictionary.js +2 -2
- package/dist/index.d.ts +22 -1
- package/dist/index.js +48 -37
- package/dist/language/useDictionary.js +1 -1
- package/dist/store/index.js +1 -1
- package/dist/store/language/index.js +1 -1
- package/dist/store/language/language.js +1 -1
- package/dist/store/mad-config/hooks.js +1 -1
- package/dist/store/mad-config/index.js +1 -1
- package/dist/store/mad-config/mad-config.js +1 -1
- package/dist/types.d.ts +6 -0
- package/dist/utils/createEnvironmentProxy.js +1 -1
- package/dist/utils/createMadCoreNavigator.js +19 -19
- package/dist/utils/initiateAuthenticationClient.js +2 -2
- package/package.json +4 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,23 @@
|
|
|
1
1
|
# @equinor/mad-core
|
|
2
2
|
|
|
3
|
+
## 0.7.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 14d79cb: Implemented Expo-Auth-Session as authentication alternative from mad-auth
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- 1fe26dc: Added msal-browser client implementation
|
|
12
|
+
- abb6d1a: Fixed issue with exporting mad-auth package
|
|
13
|
+
- c2404af: `NavigationContainer`: ref can now be attached and forwarded to the underlying
|
|
14
|
+
`NavigationContainer` from `react-navigation`
|
|
15
|
+
- Updated dependencies [1fe26dc]
|
|
16
|
+
- Updated dependencies [14d79cb]
|
|
17
|
+
- Updated dependencies [c2404af]
|
|
18
|
+
- @equinor/mad-auth@0.2.0
|
|
19
|
+
- @equinor/mad-navigation@0.3.1
|
|
20
|
+
|
|
3
21
|
## 0.6.1
|
|
4
22
|
|
|
5
23
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -455,3 +455,36 @@ instead. If you want to replace components, you should look for equivalent compo
|
|
|
455
455
|
application insights related items like `track`, `metricStatus`, `metricKeys`,
|
|
456
456
|
`addTelemetryInitializer`, etc in `@equinor/mad-core`. If anything is missing, and you think it
|
|
457
457
|
should be there, create an issue!
|
|
458
|
+
|
|
459
|
+
#### Step 10: using experimental features (optional)
|
|
460
|
+
|
|
461
|
+
Some functionalities that are implemented but not mature enough for widespread use will be made
|
|
462
|
+
available as an experimental option for developers to test out.
|
|
463
|
+
|
|
464
|
+
Currently the only experimental feature is switching from react-native-msal to expo-auth-session for
|
|
465
|
+
authentication handling.
|
|
466
|
+
|
|
467
|
+
To use this experimental feature, you have to install `expo-auth-session` and `expo-crypto` in your
|
|
468
|
+
project.
|
|
469
|
+
|
|
470
|
+
```
|
|
471
|
+
npm i expo-auth-session expo-crypto
|
|
472
|
+
```
|
|
473
|
+
|
|
474
|
+
```
|
|
475
|
+
yarn add expo-auth-session expo-crypto
|
|
476
|
+
```
|
|
477
|
+
|
|
478
|
+
Next, add this to your `mad.config.ts` file:
|
|
479
|
+
|
|
480
|
+
```ts
|
|
481
|
+
experimental: {
|
|
482
|
+
useExpoAuthSession: true;
|
|
483
|
+
}
|
|
484
|
+
```
|
|
485
|
+
|
|
486
|
+
The `mad-core` package should handle most of the authentication logic for you. If there are certain
|
|
487
|
+
usages in your app that use any ``mad-auth`` functions directly, you can import these functions directly
|
|
488
|
+
as normal, as long as you have the `useExpoAuthSession` flag in your `mad.config.ts` file. If you
|
|
489
|
+
want to learn more about this feature please check out the `README.md` in
|
|
490
|
+
`mad-auth/Expo-AuthSession`
|
|
@@ -1,33 +1,33 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ReleaseNotesScreen
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-6MIUWCTG.js";
|
|
4
4
|
import {
|
|
5
5
|
WhatsNewScreen
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-5MPPKD5X.js";
|
|
7
7
|
import {
|
|
8
8
|
CreateIncidentScreen
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KQI7B7LY.js";
|
|
10
10
|
import {
|
|
11
11
|
SelectLanguageScreen
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-W6GVPMN4.js";
|
|
13
13
|
import {
|
|
14
14
|
AboutScreen
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-3WTKRZ37.js";
|
|
16
16
|
import {
|
|
17
17
|
LoginScreen
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-O3MDFTFC.js";
|
|
19
19
|
import {
|
|
20
20
|
ServiceMessageProvider
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-VQT4HKQP.js";
|
|
22
22
|
import {
|
|
23
23
|
getDefaultScreenOptionsForLoginScreen
|
|
24
24
|
} from "./chunk-RGJ4RWVB.js";
|
|
25
25
|
import {
|
|
26
26
|
EnvironmentProvider
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-CCRYPD4B.js";
|
|
28
28
|
import {
|
|
29
29
|
useMadConfig
|
|
30
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-ECVSJUOE.js";
|
|
31
31
|
import {
|
|
32
32
|
CoreRoutes
|
|
33
33
|
} from "./chunk-UKAZW3CQ.js";
|
|
@@ -9,24 +9,24 @@ import {
|
|
|
9
9
|
} from "./chunk-GHWLQBHQ.js";
|
|
10
10
|
import {
|
|
11
11
|
fetchReleaseNotes
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-7E5VE2A2.js";
|
|
13
13
|
import {
|
|
14
14
|
useReleaseNotesVersion
|
|
15
15
|
} from "./chunk-5BVQKJQB.js";
|
|
16
16
|
import {
|
|
17
17
|
useNavigateFromWhatsNewScreen
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-AAPOT2F3.js";
|
|
19
19
|
import {
|
|
20
20
|
useDemoMode
|
|
21
21
|
} from "./chunk-UZ6YMQV2.js";
|
|
22
22
|
import {
|
|
23
23
|
useScreenTitleFromDictionary
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-SOHMDEWI.js";
|
|
25
25
|
import {
|
|
26
26
|
useAppVersion,
|
|
27
27
|
useEnvironment,
|
|
28
28
|
useServicePortalName
|
|
29
|
-
} from "./chunk-
|
|
29
|
+
} from "./chunk-ECVSJUOE.js";
|
|
30
30
|
import {
|
|
31
31
|
__spreadProps,
|
|
32
32
|
__spreadValues
|
|
@@ -6,10 +6,10 @@ import {
|
|
|
6
6
|
} from "./chunk-OCWASWDK.js";
|
|
7
7
|
import {
|
|
8
8
|
useReleaseNotes
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KIMBCQQM.js";
|
|
10
10
|
import {
|
|
11
11
|
useScreenTitleFromDictionary
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-SOHMDEWI.js";
|
|
13
13
|
|
|
14
14
|
// src/components/screens/release-notes/ReleaseNotesScreen.tsx
|
|
15
15
|
import React from "react";
|
|
@@ -2,16 +2,19 @@ import {
|
|
|
2
2
|
getMadCommonBaseUrl,
|
|
3
3
|
getMadCommonScopes
|
|
4
4
|
} from "./chunk-RFYZGBU4.js";
|
|
5
|
+
import {
|
|
6
|
+
getConfig
|
|
7
|
+
} from "./chunk-ECVSJUOE.js";
|
|
5
8
|
import {
|
|
6
9
|
__async
|
|
7
10
|
} from "./chunk-WEAGW6MQ.js";
|
|
8
11
|
|
|
9
12
|
// src/components/screens/release-notes/fetchReleaseNotes.ts
|
|
10
|
-
import { authenticateSilently } from "@equinor/mad-auth";
|
|
13
|
+
import { authenticateSilently, ExpoAuthSession } from "@equinor/mad-auth";
|
|
11
14
|
var fetchReleaseNotes = (env, servicePortalName, appVersion) => __async(void 0, null, function* () {
|
|
12
15
|
const scopes = getMadCommonScopes(env);
|
|
13
16
|
const baseUrl = getMadCommonBaseUrl(env);
|
|
14
|
-
const authenticationResponse = yield authenticateSilently(scopes);
|
|
17
|
+
const authenticationResponse = getConfig().experimental.useExpoAuthSession ? yield ExpoAuthSession.authenticateSilently(scopes) : yield authenticateSilently(scopes);
|
|
15
18
|
if (!authenticationResponse)
|
|
16
19
|
throw new Error("Unable to authenticate silently");
|
|
17
20
|
const fetchResponse = yield fetch(`${baseUrl}/ReleaseNote/${servicePortalName}/${appVersion}`, {
|
|
@@ -20,13 +23,12 @@ var fetchReleaseNotes = (env, servicePortalName, appVersion) => __async(void 0,
|
|
|
20
23
|
Authorization: `Bearer ${authenticationResponse.accessToken}`
|
|
21
24
|
})
|
|
22
25
|
});
|
|
23
|
-
|
|
24
|
-
return result;
|
|
26
|
+
return yield fetchResponse.json();
|
|
25
27
|
});
|
|
26
28
|
var fetchAllReleaseNotes = (env, servicePortalName) => __async(void 0, null, function* () {
|
|
27
29
|
const scopes = getMadCommonScopes(env);
|
|
28
30
|
const baseUrl = getMadCommonBaseUrl(env);
|
|
29
|
-
const authenticationResponse = yield authenticateSilently(scopes);
|
|
31
|
+
const authenticationResponse = getConfig().experimental.useExpoAuthSession ? yield ExpoAuthSession.authenticateSilently(scopes) : yield authenticateSilently(scopes);
|
|
30
32
|
if (!authenticationResponse)
|
|
31
33
|
throw new Error("Unable to authenticate silently");
|
|
32
34
|
const fetchResponse = yield fetch(`${baseUrl}/ReleaseNote/${servicePortalName}/`, {
|
|
@@ -438,10 +438,6 @@ export {
|
|
|
438
438
|
getPureConfig,
|
|
439
439
|
setConfig,
|
|
440
440
|
setEnvironment,
|
|
441
|
-
useLanguage,
|
|
442
|
-
getLanguage,
|
|
443
|
-
setSelectedLanguage,
|
|
444
|
-
getIsLanguageSelected,
|
|
445
441
|
useDictionary,
|
|
446
442
|
useAuthConfig,
|
|
447
443
|
useLoginScreenConfig,
|
|
@@ -451,5 +447,9 @@ export {
|
|
|
451
447
|
useAbout,
|
|
452
448
|
useServiceNow,
|
|
453
449
|
useNavigateToMainRoute,
|
|
454
|
-
useSettingsScreenPremadeConfig
|
|
450
|
+
useSettingsScreenPremadeConfig,
|
|
451
|
+
useLanguage,
|
|
452
|
+
getLanguage,
|
|
453
|
+
setSelectedLanguage,
|
|
454
|
+
getIsLanguageSelected
|
|
455
455
|
};
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createNativeStackNavigator
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-7FMPZFRS.js";
|
|
4
4
|
import {
|
|
5
5
|
initiateAuthenticationClient
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-57NV3AWS.js";
|
|
7
7
|
import {
|
|
8
8
|
createMadCoreNavigator
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4DM2ONVH.js";
|
|
10
10
|
import {
|
|
11
11
|
setConfig
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-ECVSJUOE.js";
|
|
13
13
|
import {
|
|
14
14
|
__spreadProps,
|
|
15
15
|
__spreadValues
|
|
@@ -9,9 +9,10 @@ import {
|
|
|
9
9
|
NavigationContainer as MadNavigationContainer
|
|
10
10
|
} from "@equinor/mad-navigation";
|
|
11
11
|
import { trackNavigation } from "@equinor/mad-insights";
|
|
12
|
-
var
|
|
12
|
+
var NavigationContainerInner = (props, ref) => /* @__PURE__ */ React.createElement(
|
|
13
13
|
MadNavigationContainer,
|
|
14
14
|
__spreadProps(__spreadValues({}, props), {
|
|
15
|
+
ref,
|
|
15
16
|
onRouteChange: (current, prevRoute) => {
|
|
16
17
|
var _a;
|
|
17
18
|
trackNavigation(current);
|
|
@@ -19,6 +20,9 @@ var NavigationContainer = (props) => /* @__PURE__ */ React.createElement(
|
|
|
19
20
|
}
|
|
20
21
|
})
|
|
21
22
|
);
|
|
23
|
+
var NavigationContainer = React.forwardRef(
|
|
24
|
+
NavigationContainerInner
|
|
25
|
+
);
|
|
22
26
|
|
|
23
27
|
export {
|
|
24
28
|
NavigationContainer
|
|
@@ -3,14 +3,14 @@ import {
|
|
|
3
3
|
} from "./chunk-GHWLQBHQ.js";
|
|
4
4
|
import {
|
|
5
5
|
fetchAllReleaseNotes
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-7E5VE2A2.js";
|
|
7
7
|
import {
|
|
8
8
|
useDemoMode
|
|
9
9
|
} from "./chunk-UZ6YMQV2.js";
|
|
10
10
|
import {
|
|
11
11
|
useEnvironment,
|
|
12
12
|
useServicePortalName
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ECVSJUOE.js";
|
|
14
14
|
|
|
15
15
|
// src/hooks/UseReleaseNotes.tsx
|
|
16
16
|
import { useEffect, useMemo, useState } from "react";
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
} from "./chunk-CAOQCE6W.js";
|
|
7
7
|
import {
|
|
8
8
|
useAccountOrDemoAccount
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NZJ2OJKA.js";
|
|
10
10
|
import {
|
|
11
11
|
useEnvironment,
|
|
12
12
|
useServiceNow
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ECVSJUOE.js";
|
|
14
14
|
|
|
15
15
|
// src/components/screens/create-incident/CreateIncidentScreen.tsx
|
|
16
16
|
import React, { useState } from "react";
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useDemoMode
|
|
3
3
|
} from "./chunk-UZ6YMQV2.js";
|
|
4
|
+
import {
|
|
5
|
+
getConfig
|
|
6
|
+
} from "./chunk-ECVSJUOE.js";
|
|
4
7
|
|
|
5
8
|
// src/hooks/useAccountOrDemoAccount.ts
|
|
6
|
-
import { useAccount } from "@equinor/mad-auth";
|
|
9
|
+
import { ExpoAuthSession, useAccount } from "@equinor/mad-auth";
|
|
7
10
|
var MAD_DEMO_USER = {
|
|
8
11
|
name: "Demo user",
|
|
9
12
|
username: "demo.user@example.com",
|
|
@@ -11,7 +14,9 @@ var MAD_DEMO_USER = {
|
|
|
11
14
|
};
|
|
12
15
|
var useAccountOrDemoAccount = () => {
|
|
13
16
|
const demoMode = useDemoMode();
|
|
14
|
-
const
|
|
17
|
+
const msalAccount = useAccount();
|
|
18
|
+
const expoAccount = ExpoAuthSession.useAccount();
|
|
19
|
+
const account = getConfig().experimental.useExpoAuthSession ? expoAccount : msalAccount;
|
|
15
20
|
if (demoMode.isEnabled)
|
|
16
21
|
return MAD_DEMO_USER;
|
|
17
22
|
return account;
|
|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useNavigateFromLoginScreen
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y2UHRJ7H.js";
|
|
4
4
|
import {
|
|
5
|
+
getConfig,
|
|
5
6
|
useAuthConfig,
|
|
6
7
|
useDictionary,
|
|
7
8
|
useLoginScreenConfig
|
|
8
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-ECVSJUOE.js";
|
|
9
10
|
import {
|
|
10
11
|
__spreadProps,
|
|
11
12
|
__spreadValues
|
|
@@ -15,7 +16,10 @@ import {
|
|
|
15
16
|
import { Button, EDSProvider, EDSStyleSheet, useStyles } from "@equinor/mad-components";
|
|
16
17
|
import React, { useState } from "react";
|
|
17
18
|
import { Image, Platform, Pressable, View } from "react-native";
|
|
18
|
-
import {
|
|
19
|
+
import {
|
|
20
|
+
ExpoAuthSession,
|
|
21
|
+
LoginButton
|
|
22
|
+
} from "@equinor/mad-auth";
|
|
19
23
|
import { metricKeys, metricStatus, setUsername, track } from "@equinor/mad-insights";
|
|
20
24
|
var LoginScreen = ({
|
|
21
25
|
onAuthenticationSuccessful,
|
|
@@ -30,6 +34,27 @@ var LoginScreen = ({
|
|
|
30
34
|
const [demoPressCount, setDemoPressCount] = useState(0);
|
|
31
35
|
const shouldDisplayDemoButton = demoPressCount >= 5;
|
|
32
36
|
const resizeMode = Platform.OS === "web" ? "contain" : "cover";
|
|
37
|
+
const loginButtonProps = __spreadProps(__spreadValues({}, authConfig), {
|
|
38
|
+
onAuthenticationSuccessful: (result, type) => {
|
|
39
|
+
setUsername(result.account.username, result.account.identifier);
|
|
40
|
+
if (type === "AUTOMATIC") {
|
|
41
|
+
void track(metricKeys.AUTHENTICATION_AUTOMATIC);
|
|
42
|
+
} else {
|
|
43
|
+
void track(metricKeys.AUTHENTICATION, metricStatus.SUCCESS);
|
|
44
|
+
}
|
|
45
|
+
onAuthenticationSuccessful == null ? void 0 : onAuthenticationSuccessful(result, type);
|
|
46
|
+
navigate({ demoMode: false });
|
|
47
|
+
},
|
|
48
|
+
onAuthenticationFailed: (error) => {
|
|
49
|
+
void track(metricKeys.AUTHENTICATION, metricStatus.FAILED, void 0, {
|
|
50
|
+
error
|
|
51
|
+
});
|
|
52
|
+
onAuthenticationFailed == null ? void 0 : onAuthenticationFailed(error);
|
|
53
|
+
},
|
|
54
|
+
title: dictionary.login.logIn,
|
|
55
|
+
enableAutomaticAuthentication: true,
|
|
56
|
+
scopes: (_a = authConfig.scopes) != null ? _a : []
|
|
57
|
+
});
|
|
33
58
|
return /* @__PURE__ */ React.createElement(EDSProvider, { colorScheme: "light", density: "tablet" }, /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(Image, { source: splash, resizeMode, style: styles.fill }), /* @__PURE__ */ React.createElement(View, { style: styles.secretHitboxContainer }, /* @__PURE__ */ React.createElement(
|
|
34
59
|
Pressable,
|
|
35
60
|
{
|
|
@@ -37,30 +62,7 @@ var LoginScreen = ({
|
|
|
37
62
|
style: styles.fill,
|
|
38
63
|
onPress: () => setDemoPressCount((count) => count + 1)
|
|
39
64
|
}
|
|
40
|
-
)), /* @__PURE__ */ React.createElement(View, { style: styles.buttonContainer }, /* @__PURE__ */ React.createElement(
|
|
41
|
-
LoginButton,
|
|
42
|
-
__spreadProps(__spreadValues({}, authConfig), {
|
|
43
|
-
onAuthenticationSuccessful: (result, type) => {
|
|
44
|
-
setUsername(result.account.username, result.account.identifier);
|
|
45
|
-
if (type === "AUTOMATIC") {
|
|
46
|
-
void track(metricKeys.AUTHENTICATION_AUTOMATIC);
|
|
47
|
-
} else {
|
|
48
|
-
void track(metricKeys.AUTHENTICATION, metricStatus.SUCCESS);
|
|
49
|
-
}
|
|
50
|
-
onAuthenticationSuccessful == null ? void 0 : onAuthenticationSuccessful(result, type);
|
|
51
|
-
navigate({ demoMode: false });
|
|
52
|
-
},
|
|
53
|
-
onAuthenticationFailed: (error) => {
|
|
54
|
-
void track(metricKeys.AUTHENTICATION, metricStatus.FAILED, void 0, {
|
|
55
|
-
error
|
|
56
|
-
});
|
|
57
|
-
onAuthenticationFailed == null ? void 0 : onAuthenticationFailed(error);
|
|
58
|
-
},
|
|
59
|
-
title: dictionary.login.logIn,
|
|
60
|
-
enableAutomaticAuthentication: true,
|
|
61
|
-
scopes: (_a = authConfig.scopes) != null ? _a : []
|
|
62
|
-
})
|
|
63
|
-
), shouldDisplayDemoButton && /* @__PURE__ */ React.createElement(
|
|
65
|
+
)), /* @__PURE__ */ React.createElement(View, { style: styles.buttonContainer }, getConfig().experimental.useExpoAuthSession ? /* @__PURE__ */ React.createElement(ExpoAuthSession.LoginButton, __spreadValues({}, loginButtonProps)) : /* @__PURE__ */ React.createElement(LoginButton, __spreadValues({}, loginButtonProps)), shouldDisplayDemoButton && /* @__PURE__ */ React.createElement(
|
|
64
66
|
Button,
|
|
65
67
|
{
|
|
66
68
|
testID: "demo-button",
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ServiceMessageBanner
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-NLNSDAD7.js";
|
|
4
4
|
import {
|
|
5
5
|
EnvironmentBanner
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-V5WZIP2H.js";
|
|
7
7
|
|
|
8
8
|
// src/components/navigation/MadCoreSubHeader.tsx
|
|
9
9
|
import React from "react";
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
SelectLanguageCellGroup
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-Y42WKXNP.js";
|
|
4
4
|
import {
|
|
5
5
|
useNavigateFromLanguageSelectScreen
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TISU6GUX.js";
|
|
7
7
|
import {
|
|
8
8
|
useScreenTitleFromDictionary
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-SOHMDEWI.js";
|
|
10
10
|
import {
|
|
11
11
|
useDictionary,
|
|
12
12
|
useLanguage
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-ECVSJUOE.js";
|
|
14
14
|
|
|
15
15
|
// src/components/screens/language/SelectLanguageScreen.tsx
|
|
16
16
|
import React, { useState } from "react";
|
|
@@ -4,6 +4,9 @@ import {
|
|
|
4
4
|
import {
|
|
5
5
|
useCoreStackNavigation
|
|
6
6
|
} from "./chunk-BIMOM43W.js";
|
|
7
|
+
import {
|
|
8
|
+
getConfig
|
|
9
|
+
} from "./chunk-ECVSJUOE.js";
|
|
7
10
|
import {
|
|
8
11
|
CoreRoutes
|
|
9
12
|
} from "./chunk-UKAZW3CQ.js";
|
|
@@ -13,14 +16,14 @@ import {
|
|
|
13
16
|
|
|
14
17
|
// src/components/screens/settings/useSignOut.ts
|
|
15
18
|
import { useCallback } from "react";
|
|
16
|
-
import { signOut } from "@equinor/mad-auth";
|
|
19
|
+
import { ExpoAuthSession, signOut } from "@equinor/mad-auth";
|
|
17
20
|
import { alert } from "@equinor/mad-components";
|
|
18
21
|
var useSignOut = () => {
|
|
19
22
|
const navigation = useCoreStackNavigation();
|
|
20
23
|
const demoMode = useDemoMode();
|
|
21
24
|
const signOutFn = useCallback(() => __async(void 0, null, function* () {
|
|
22
25
|
try {
|
|
23
|
-
const result = yield signOut();
|
|
26
|
+
const result = getConfig() ? ExpoAuthSession.signOut() : yield signOut();
|
|
24
27
|
if (!demoMode.isEnabled && !result)
|
|
25
28
|
throw new Error("Unable to sign out");
|
|
26
29
|
demoMode.disableDemoMode();
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useSignOut
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-XDGQBDUQ.js";
|
|
4
4
|
import {
|
|
5
5
|
SettingsSection
|
|
6
6
|
} from "./chunk-YKLMUKP4.js";
|
|
@@ -9,14 +9,14 @@ import {
|
|
|
9
9
|
} from "./chunk-7SJM4NDH.js";
|
|
10
10
|
import {
|
|
11
11
|
useAccountOrDemoAccount
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-NZJ2OJKA.js";
|
|
13
13
|
import {
|
|
14
14
|
useScreenTitleFromDictionary
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-SOHMDEWI.js";
|
|
16
16
|
import {
|
|
17
17
|
useDictionary,
|
|
18
18
|
useSettingsScreenPremadeConfig
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-ECVSJUOE.js";
|
|
20
20
|
import {
|
|
21
21
|
__spreadValues
|
|
22
22
|
} from "./chunk-WEAGW6MQ.js";
|
|
@@ -1,3 +1,15 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import {
|
|
3
|
-
export declare const NavigationContainer: <T extends object>(props: NavigationContainerProps
|
|
2
|
+
import { NavigationContainerRef } from "@react-navigation/native";
|
|
3
|
+
export declare const NavigationContainer: <T extends object>(props: import("@react-navigation/native").NavigationContainerProps & {
|
|
4
|
+
theme?: import("@react-navigation/native").Theme | undefined;
|
|
5
|
+
linking?: import("@react-navigation/native").LinkingOptions<T> | undefined;
|
|
6
|
+
fallback?: React.ReactNode;
|
|
7
|
+
documentTitle?: import("@react-navigation/native").DocumentTitleOptions | undefined;
|
|
8
|
+
onReady?: (() => void) | undefined;
|
|
9
|
+
} & {
|
|
10
|
+
ref?: React.Ref<NavigationContainerRef<T>> | undefined;
|
|
11
|
+
} & {
|
|
12
|
+
onRouteChange?: ((currentRoute: string, prevRoute: string | undefined) => void) | undefined;
|
|
13
|
+
} & {
|
|
14
|
+
ref?: React.ForwardedRef<NavigationContainerRef<T>> | undefined;
|
|
15
|
+
}) => React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|