@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.
Files changed (77) hide show
  1. package/CHANGELOG.md +18 -0
  2. package/README.md +33 -0
  3. package/dist/{chunk-UD3DA4FR.js → chunk-3WTKRZ37.js} +1 -1
  4. package/dist/{chunk-5J3FTNVE.js → chunk-4DM2ONVH.js} +9 -9
  5. package/dist/{chunk-GOYAFKM3.js → chunk-57NV3AWS.js} +1 -1
  6. package/dist/{chunk-LSA52JU5.js → chunk-5MPPKD5X.js} +4 -4
  7. package/dist/{chunk-CEFUB5I4.js → chunk-6MIUWCTG.js} +2 -2
  8. package/dist/{chunk-KBEPONRV.js → chunk-7E5VE2A2.js} +7 -5
  9. package/dist/{chunk-TOCPQ2JB.js → chunk-7FMPZFRS.js} +1 -1
  10. package/dist/{chunk-R4TBMU5D.js → chunk-AAPOT2F3.js} +1 -1
  11. package/dist/{chunk-2CVBYJXN.js → chunk-CCRYPD4B.js} +1 -1
  12. package/dist/{chunk-ZTNMWI3H.js → chunk-ECVSJUOE.js} +5 -5
  13. package/dist/{chunk-5TJVZFPL.js → chunk-ESL24TPV.js} +4 -4
  14. package/dist/{chunk-W3LMT7N4.js → chunk-FW4GVJC7.js} +5 -1
  15. package/dist/{chunk-VYI4KBQO.js → chunk-KIMBCQQM.js} +2 -2
  16. package/dist/{chunk-BVFOO2RO.js → chunk-KQI7B7LY.js} +2 -2
  17. package/dist/{chunk-RMME4MJU.js → chunk-NLNSDAD7.js} +1 -1
  18. package/dist/{chunk-EQYL7INQ.js → chunk-NZJ2OJKA.js} +7 -2
  19. package/dist/{chunk-U6GW6ZHM.js → chunk-O3MDFTFC.js} +29 -27
  20. package/dist/{chunk-Y4F6JPUK.js → chunk-PB7RCM3P.js} +2 -2
  21. package/dist/{chunk-7NTWLQ7J.js → chunk-PJR6OKX6.js} +1 -1
  22. package/dist/{chunk-N2HQZLB2.js → chunk-SOHMDEWI.js} +1 -1
  23. package/dist/{chunk-N4EOPAYE.js → chunk-TISU6GUX.js} +1 -1
  24. package/dist/{chunk-6WQG7OGA.js → chunk-V5WZIP2H.js} +1 -1
  25. package/dist/{chunk-LTQGTI3K.js → chunk-VQT4HKQP.js} +1 -1
  26. package/dist/{chunk-ZADB3VIP.js → chunk-W6GVPMN4.js} +4 -4
  27. package/dist/{chunk-U3K3DQC5.js → chunk-XDGQBDUQ.js} +5 -2
  28. package/dist/{chunk-MSOJFY3S.js → chunk-Y2UHRJ7H.js} +1 -1
  29. package/dist/{chunk-OXXEF5WL.js → chunk-Y42WKXNP.js} +1 -1
  30. package/dist/{chunk-AXEUL63W.js → chunk-Z6PI6VJV.js} +4 -4
  31. package/dist/components/EnvironmentBanner.js +2 -2
  32. package/dist/components/EnvironmentProvider.js +2 -2
  33. package/dist/components/NavigationContainer.d.ts +14 -2
  34. package/dist/components/NavigationContainer.js +1 -1
  35. package/dist/components/createCoreStackNavigator.d.ts +24 -24
  36. package/dist/components/createCoreStackNavigator.js +25 -25
  37. package/dist/components/index.js +28 -28
  38. package/dist/components/navigation/MadCoreSubHeader.js +6 -6
  39. package/dist/components/navigation/index.js +7 -7
  40. package/dist/components/navigation/navigation-creators.d.ts +12 -12
  41. package/dist/components/navigation/navigation-creators.js +7 -7
  42. package/dist/components/screens/AboutScreen.js +2 -2
  43. package/dist/components/screens/LoginScreen.js +3 -3
  44. package/dist/components/screens/create-incident/CreateIncidentScreen.js +4 -3
  45. package/dist/components/screens/language/SelectLanguageScreen.js +5 -5
  46. package/dist/components/screens/language/components/SelectLanguageCellGroup.js +2 -2
  47. package/dist/components/screens/release-notes/ReleaseNotesScreen.js +6 -5
  48. package/dist/components/screens/release-notes/WhatsNewScreen.js +5 -5
  49. package/dist/components/screens/release-notes/fetchReleaseNotes.js +9 -1
  50. package/dist/components/screens/settings/Section.js +7 -1
  51. package/dist/components/screens/settings/SettingsScreen.js +6 -5
  52. package/dist/components/screens/settings/index.js +6 -5
  53. package/dist/components/screens/settings/useSignOut.js +6 -1
  54. package/dist/components/service-message/ServiceMessageBanner.js +4 -4
  55. package/dist/components/service-message/ServiceMessageProvider.js +3 -3
  56. package/dist/components/service-message/hooks/useFetchServiceMessage.js +2 -2
  57. package/dist/hooks/UseReleaseNotes.js +4 -3
  58. package/dist/hooks/index.js +7 -1
  59. package/dist/hooks/useAccountOrDemoAccount.js +7 -1
  60. package/dist/hooks/useNavigateFromLanguageSelectScreen.js +2 -2
  61. package/dist/hooks/useNavigateFromLoginScreen.js +2 -2
  62. package/dist/hooks/useNavigateFromWhatsNewScreen.js +2 -2
  63. package/dist/hooks/useScreenTitleFromDictionary.js +2 -2
  64. package/dist/index.d.ts +22 -1
  65. package/dist/index.js +48 -37
  66. package/dist/language/useDictionary.js +1 -1
  67. package/dist/store/index.js +1 -1
  68. package/dist/store/language/index.js +1 -1
  69. package/dist/store/language/language.js +1 -1
  70. package/dist/store/mad-config/hooks.js +1 -1
  71. package/dist/store/mad-config/index.js +1 -1
  72. package/dist/store/mad-config/mad-config.js +1 -1
  73. package/dist/types.d.ts +6 -0
  74. package/dist/utils/createEnvironmentProxy.js +1 -1
  75. package/dist/utils/createMadCoreNavigator.js +19 -19
  76. package/dist/utils/initiateAuthenticationClient.js +2 -2
  77. 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`
@@ -5,7 +5,7 @@ import {
5
5
  useAbout,
6
6
  useAppVersion,
7
7
  useEnvironment
8
- } from "./chunk-ZTNMWI3H.js";
8
+ } from "./chunk-ECVSJUOE.js";
9
9
 
10
10
  // src/components/screens/AboutScreen.tsx
11
11
  import React from "react";
@@ -1,33 +1,33 @@
1
1
  import {
2
2
  ReleaseNotesScreen
3
- } from "./chunk-CEFUB5I4.js";
3
+ } from "./chunk-6MIUWCTG.js";
4
4
  import {
5
5
  WhatsNewScreen
6
- } from "./chunk-LSA52JU5.js";
6
+ } from "./chunk-5MPPKD5X.js";
7
7
  import {
8
8
  CreateIncidentScreen
9
- } from "./chunk-BVFOO2RO.js";
9
+ } from "./chunk-KQI7B7LY.js";
10
10
  import {
11
11
  SelectLanguageScreen
12
- } from "./chunk-ZADB3VIP.js";
12
+ } from "./chunk-W6GVPMN4.js";
13
13
  import {
14
14
  AboutScreen
15
- } from "./chunk-UD3DA4FR.js";
15
+ } from "./chunk-3WTKRZ37.js";
16
16
  import {
17
17
  LoginScreen
18
- } from "./chunk-U6GW6ZHM.js";
18
+ } from "./chunk-O3MDFTFC.js";
19
19
  import {
20
20
  ServiceMessageProvider
21
- } from "./chunk-LTQGTI3K.js";
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-2CVBYJXN.js";
27
+ } from "./chunk-CCRYPD4B.js";
28
28
  import {
29
29
  useMadConfig
30
- } from "./chunk-ZTNMWI3H.js";
30
+ } from "./chunk-ECVSJUOE.js";
31
31
  import {
32
32
  CoreRoutes
33
33
  } from "./chunk-UKAZW3CQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  getConfig
3
- } from "./chunk-ZTNMWI3H.js";
3
+ } from "./chunk-ECVSJUOE.js";
4
4
  import {
5
5
  getRedirectUriFromAuthConfig
6
6
  } from "./chunk-MODG2KVN.js";
@@ -9,24 +9,24 @@ import {
9
9
  } from "./chunk-GHWLQBHQ.js";
10
10
  import {
11
11
  fetchReleaseNotes
12
- } from "./chunk-KBEPONRV.js";
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-R4TBMU5D.js";
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-N2HQZLB2.js";
24
+ } from "./chunk-SOHMDEWI.js";
25
25
  import {
26
26
  useAppVersion,
27
27
  useEnvironment,
28
28
  useServicePortalName
29
- } from "./chunk-ZTNMWI3H.js";
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-VYI4KBQO.js";
9
+ } from "./chunk-KIMBCQQM.js";
10
10
  import {
11
11
  useScreenTitleFromDictionary
12
- } from "./chunk-N2HQZLB2.js";
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
- const result = yield fetchResponse.json();
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}/`, {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  MadCoreSubHeader
3
- } from "./chunk-Y4F6JPUK.js";
3
+ } from "./chunk-PB7RCM3P.js";
4
4
 
5
5
  // src/components/navigation/navigation-creators.ts
6
6
  import {
@@ -8,7 +8,7 @@ import {
8
8
  useLanguage,
9
9
  useMadConfig,
10
10
  useNavigateToMainRoute
11
- } from "./chunk-ZTNMWI3H.js";
11
+ } from "./chunk-ECVSJUOE.js";
12
12
 
13
13
  // src/hooks/useNavigateFromWhatsNewScreen.ts
14
14
  var useNavigateFromWhatsNewScreen = () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useEnvironment
3
- } from "./chunk-ZTNMWI3H.js";
3
+ } from "./chunk-ECVSJUOE.js";
4
4
 
5
5
  // src/components/EnvironmentProvider.tsx
6
6
  import { EnvironmentProvider as ProvideEnvironment } from "@equinor/mad-components";
@@ -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-TOCPQ2JB.js";
3
+ } from "./chunk-7FMPZFRS.js";
4
4
  import {
5
5
  initiateAuthenticationClient
6
- } from "./chunk-GOYAFKM3.js";
6
+ } from "./chunk-57NV3AWS.js";
7
7
  import {
8
8
  createMadCoreNavigator
9
- } from "./chunk-5J3FTNVE.js";
9
+ } from "./chunk-4DM2ONVH.js";
10
10
  import {
11
11
  setConfig
12
- } from "./chunk-ZTNMWI3H.js";
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 NavigationContainer = (props) => /* @__PURE__ */ React.createElement(
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-KBEPONRV.js";
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-ZTNMWI3H.js";
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-EQYL7INQ.js";
9
+ } from "./chunk-NZJ2OJKA.js";
10
10
  import {
11
11
  useEnvironment,
12
12
  useServiceNow
13
- } from "./chunk-ZTNMWI3H.js";
13
+ } from "./chunk-ECVSJUOE.js";
14
14
 
15
15
  // src/components/screens/create-incident/CreateIncidentScreen.tsx
16
16
  import React, { useState } from "react";
@@ -9,7 +9,7 @@ import {
9
9
  } from "./chunk-SHKOH7MA.js";
10
10
  import {
11
11
  useServiceMessageState
12
- } from "./chunk-LTQGTI3K.js";
12
+ } from "./chunk-VQT4HKQP.js";
13
13
  import {
14
14
  __spreadProps,
15
15
  __spreadValues
@@ -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 account = useAccount();
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-MSOJFY3S.js";
3
+ } from "./chunk-Y2UHRJ7H.js";
4
4
  import {
5
+ getConfig,
5
6
  useAuthConfig,
6
7
  useDictionary,
7
8
  useLoginScreenConfig
8
- } from "./chunk-ZTNMWI3H.js";
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 { LoginButton } from "@equinor/mad-auth";
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-RMME4MJU.js";
3
+ } from "./chunk-NLNSDAD7.js";
4
4
  import {
5
5
  EnvironmentBanner
6
- } from "./chunk-6WQG7OGA.js";
6
+ } from "./chunk-V5WZIP2H.js";
7
7
 
8
8
  // src/components/navigation/MadCoreSubHeader.tsx
9
9
  import React from "react";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-RFYZGBU4.js";
4
4
  import {
5
5
  getConfig
6
- } from "./chunk-ZTNMWI3H.js";
6
+ } from "./chunk-ECVSJUOE.js";
7
7
 
8
8
  // src/components/service-message/hooks/useFetchServiceMessage.ts
9
9
  import { useEffect, useRef, useState } from "react";
@@ -3,7 +3,7 @@ import {
3
3
  } from "./chunk-BIMOM43W.js";
4
4
  import {
5
5
  useDictionary
6
- } from "./chunk-ZTNMWI3H.js";
6
+ } from "./chunk-ECVSJUOE.js";
7
7
 
8
8
  // src/hooks/useScreenTitleFromDictionary.ts
9
9
  import { useLayoutEffect } from "react";
@@ -7,7 +7,7 @@ import {
7
7
  } from "./chunk-BIMOM43W.js";
8
8
  import {
9
9
  useNavigateToMainRoute
10
- } from "./chunk-ZTNMWI3H.js";
10
+ } from "./chunk-ECVSJUOE.js";
11
11
  import {
12
12
  CoreRoutes
13
13
  } from "./chunk-UKAZW3CQ.js";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useEnvironment
3
- } from "./chunk-ZTNMWI3H.js";
3
+ } from "./chunk-ECVSJUOE.js";
4
4
 
5
5
  // src/components/EnvironmentBanner.tsx
6
6
  import React from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useFetchServiceMessage
3
- } from "./chunk-7NTWLQ7J.js";
3
+ } from "./chunk-PJR6OKX6.js";
4
4
 
5
5
  // src/components/service-message/ServiceMessageProvider.tsx
6
6
  import React, { useContext } from "react";
@@ -1,16 +1,16 @@
1
1
  import {
2
2
  SelectLanguageCellGroup
3
- } from "./chunk-OXXEF5WL.js";
3
+ } from "./chunk-Y42WKXNP.js";
4
4
  import {
5
5
  useNavigateFromLanguageSelectScreen
6
- } from "./chunk-N4EOPAYE.js";
6
+ } from "./chunk-TISU6GUX.js";
7
7
  import {
8
8
  useScreenTitleFromDictionary
9
- } from "./chunk-N2HQZLB2.js";
9
+ } from "./chunk-SOHMDEWI.js";
10
10
  import {
11
11
  useDictionary,
12
12
  useLanguage
13
- } from "./chunk-ZTNMWI3H.js";
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();
@@ -17,7 +17,7 @@ import {
17
17
  useLanguage,
18
18
  useMadConfig,
19
19
  useNavigateToMainRoute
20
- } from "./chunk-ZTNMWI3H.js";
20
+ } from "./chunk-ECVSJUOE.js";
21
21
 
22
22
  // src/hooks/useNavigateFromLoginScreen.ts
23
23
  var useNavigateFromLoginScreen = () => {
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useLanguage
3
- } from "./chunk-ZTNMWI3H.js";
3
+ } from "./chunk-ECVSJUOE.js";
4
4
 
5
5
  // src/components/screens/language/components/SelectLanguageCellGroup.tsx
6
6
  import React from "react";
@@ -1,6 +1,6 @@
1
1
  import {
2
2
  useSignOut
3
- } from "./chunk-U3K3DQC5.js";
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-EQYL7INQ.js";
12
+ } from "./chunk-NZJ2OJKA.js";
13
13
  import {
14
14
  useScreenTitleFromDictionary
15
- } from "./chunk-N2HQZLB2.js";
15
+ } from "./chunk-SOHMDEWI.js";
16
16
  import {
17
17
  useDictionary,
18
18
  useSettingsScreenPremadeConfig
19
- } from "./chunk-ZTNMWI3H.js";
19
+ } from "./chunk-ECVSJUOE.js";
20
20
  import {
21
21
  __spreadValues
22
22
  } from "./chunk-WEAGW6MQ.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EnvironmentBanner
3
- } from "../chunk-6WQG7OGA.js";
4
- import "../chunk-ZTNMWI3H.js";
3
+ } from "../chunk-V5WZIP2H.js";
4
+ import "../chunk-ECVSJUOE.js";
5
5
  import "../chunk-E6ZYHW72.js";
6
6
  import "../chunk-UKAZW3CQ.js";
7
7
  import "../chunk-MODG2KVN.js";
@@ -1,7 +1,7 @@
1
1
  import {
2
2
  EnvironmentProvider
3
- } from "../chunk-2CVBYJXN.js";
4
- import "../chunk-ZTNMWI3H.js";
3
+ } from "../chunk-CCRYPD4B.js";
4
+ import "../chunk-ECVSJUOE.js";
5
5
  import "../chunk-E6ZYHW72.js";
6
6
  import "../chunk-UKAZW3CQ.js";
7
7
  import "../chunk-MODG2KVN.js";
@@ -1,3 +1,15 @@
1
1
  import React from "react";
2
- import { NavigationContainerProps } from "@equinor/mad-navigation";
3
- export declare const NavigationContainer: <T extends object>(props: NavigationContainerProps<T>) => React.JSX.Element;
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>>;