@equinor/mad-core 0.3.1 → 0.3.3
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 +19 -0
- package/dist/{chunk-A3ND5QVK.js → chunk-2BXHQTFH.js} +1 -1
- package/dist/chunk-5IS2WJYY.js +25 -0
- package/dist/{chunk-7OT26KNA.js → chunk-5XZ4EIWK.js} +5 -5
- package/dist/{chunk-UAKBRWHM.js → chunk-6ZEGA36S.js} +1 -1
- package/dist/{chunk-6UN2PRPB.js → chunk-7IV7JAIC.js} +1 -1
- package/dist/{chunk-ZX726IIW.js → chunk-7PHV3YNH.js} +146 -67
- package/dist/{chunk-PEPYP4GH.js → chunk-ATHPQPDV.js} +2 -2
- package/dist/{chunk-KBY2EXL7.js → chunk-C5H36AGQ.js} +1 -1
- package/dist/chunk-CAOQCE6W.js +31 -0
- package/dist/{chunk-MPPFRLAL.js → chunk-EFVAFRZ4.js} +3 -3
- package/dist/chunk-EPKAICSZ.js +77 -0
- package/dist/{chunk-FOAO6U65.js → chunk-F4CPVOUK.js} +7 -7
- package/dist/{chunk-SGPMP2PN.js → chunk-F4WSVD6D.js} +1 -1
- package/dist/{chunk-2DFV2HBY.js → chunk-GLFZI3WS.js} +1 -1
- package/dist/chunk-GVBIOTF2.js +144 -0
- package/dist/{chunk-FXJGDKLB.js → chunk-ILRFXZQ6.js} +4 -4
- package/dist/{chunk-PX7SPACG.js → chunk-IUZOOXOV.js} +2 -4
- package/dist/{chunk-T6J6HWJK.js → chunk-KGULNU2L.js} +3 -3
- package/dist/{chunk-BBDX2JPC.js → chunk-LFCWKD5B.js} +1 -1
- package/dist/chunk-MCVFE22N.js +15 -0
- package/dist/{chunk-ANFSTFWV.js → chunk-STRJ5XYK.js} +4 -4
- package/dist/{chunk-DCUF7ZWX.js → chunk-VJD2P6SF.js} +1 -2
- package/dist/{chunk-5RW7M3DD.js → chunk-WV6VNU2T.js} +1 -1
- package/dist/{chunk-O2G2ZKO7.js → chunk-YAOO3R3L.js} +4 -4
- package/dist/components/EnvironmentProvider.d.ts +2 -0
- package/dist/components/EnvironmentProvider.js +11 -0
- package/dist/components/createCoreStackNavigator.d.ts +35 -34
- package/dist/components/createCoreStackNavigator.js +30 -27
- package/dist/components/index.js +33 -30
- package/dist/components/navigation/MadCoreSubHeader.js +7 -8
- package/dist/components/navigation/index.js +8 -9
- package/dist/components/navigation/navigation-creators.js +8 -9
- package/dist/components/screens/AboutScreen.js +3 -4
- package/dist/components/screens/LoginScreen.js +5 -6
- package/dist/components/screens/create-incident/CreateIncidentScreen.js +19 -0
- package/dist/components/screens/create-incident/UserInfo.d.ts +7 -0
- package/dist/components/screens/create-incident/UserInfo.js +7 -0
- package/dist/components/screens/create-incident/createIncident.d.ts +16 -0
- package/dist/components/screens/create-incident/createIncident.js +8 -0
- package/dist/components/screens/language/SelectLanguageScreen.js +5 -6
- package/dist/components/screens/language/components/SelectLanguageCellGroup.js +3 -4
- package/dist/components/screens/release-notes/ReleaseNotesScreen.js +6 -7
- package/dist/components/screens/release-notes/WhatsNewScreen.js +8 -9
- package/dist/components/screens/settings/SettingsScreen.js +5 -6
- package/dist/components/screens/settings/index.js +6 -7
- package/dist/components/service-message/ServiceMessageBanner.js +6 -7
- package/dist/components/service-message/ServiceMessageProvider.js +4 -5
- package/dist/components/service-message/hooks/useFetchServiceMessage.js +3 -4
- package/dist/hooks/UseReleaseNotes.js +3 -4
- package/dist/hooks/useScreenTitleFromDictionary.js +3 -4
- package/dist/index.js +41 -33
- package/dist/language/useDictionary.js +2 -3
- package/dist/store/index.d.ts +1 -0
- package/dist/store/index.js +11 -6
- package/dist/store/language/index.js +2 -3
- package/dist/store/language/language.js +2 -3
- package/dist/store/mad-config/hooks.d.ts +4 -4
- package/dist/store/mad-config/hooks.js +4 -3
- package/dist/store/mad-config/index.js +11 -7
- package/dist/store/mad-config/mad-config.d.ts +5 -3
- package/dist/store/mad-config/mad-config.js +8 -1
- package/dist/types.d.ts +24 -17
- package/dist/utils/createEnvironmentProxy.d.ts +9 -0
- package/dist/utils/createEnvironmentProxy.js +10 -0
- package/dist/utils/createMadCoreNavigator.d.ts +3 -3
- package/dist/utils/createMadCoreNavigator.js +25 -22
- package/dist/utils/getNavigationRouteForLoginScreen.js +4 -5
- package/dist/utils/getNavigationRouteForWhatsNewScreen.js +3 -4
- package/dist/utils/getPremadeSettings.d.ts +3 -3
- package/dist/utils/getRedirectUriFromAuthConfig.d.ts +1 -2
- package/dist/utils/getRedirectUriFromAuthConfig.js +1 -1
- package/package.json +9 -7
- package/dist/chunk-6O3V4Z6G.js +0 -56
- package/dist/chunk-GCBWBANV.js +0 -10
- package/dist/chunk-ZSTTHIEF.js +0 -34
- package/dist/components/screens/CreateIncidentScreen.js +0 -7
- /package/dist/{chunk-G5W3HK4A.js → chunk-RVKZULYD.js} +0 -0
- /package/dist/components/screens/{CreateIncidentScreen.d.ts → create-incident/CreateIncidentScreen.d.ts} +0 -0
|
@@ -4,12 +4,12 @@ import {
|
|
|
4
4
|
useAuthConfig,
|
|
5
5
|
useEnvironment,
|
|
6
6
|
useLoginScreenConfig,
|
|
7
|
+
useServiceNow,
|
|
7
8
|
useServicePortalName,
|
|
8
9
|
useSettingsScreenPremadeConfig
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import "../../chunk-ZSTTHIEF.js";
|
|
11
|
-
import "../../chunk-DCUF7ZWX.js";
|
|
10
|
+
} from "../../chunk-7PHV3YNH.js";
|
|
12
11
|
import "../../chunk-P636GRYJ.js";
|
|
12
|
+
import "../../chunk-VJD2P6SF.js";
|
|
13
13
|
import "../../chunk-2OMVVDBU.js";
|
|
14
14
|
import "../../chunk-WEAGW6MQ.js";
|
|
15
15
|
export {
|
|
@@ -18,6 +18,7 @@ export {
|
|
|
18
18
|
useAuthConfig,
|
|
19
19
|
useEnvironment,
|
|
20
20
|
useLoginScreenConfig,
|
|
21
|
+
useServiceNow,
|
|
21
22
|
useServicePortalName,
|
|
22
23
|
useSettingsScreenPremadeConfig
|
|
23
24
|
};
|
|
@@ -1,30 +1,34 @@
|
|
|
1
1
|
import {
|
|
2
|
+
getConfig,
|
|
3
|
+
getPureConfig,
|
|
4
|
+
setConfig,
|
|
5
|
+
setEnvironment,
|
|
2
6
|
useAbout,
|
|
3
7
|
useAppVersion,
|
|
4
8
|
useAuthConfig,
|
|
5
9
|
useEnvironment,
|
|
6
10
|
useLoginScreenConfig,
|
|
11
|
+
useMadConfig,
|
|
12
|
+
useServiceNow,
|
|
7
13
|
useServicePortalName,
|
|
8
14
|
useSettingsScreenPremadeConfig
|
|
9
|
-
} from "../../chunk-
|
|
10
|
-
import {
|
|
11
|
-
getConfig,
|
|
12
|
-
setConfig,
|
|
13
|
-
useMadConfig
|
|
14
|
-
} from "../../chunk-ZSTTHIEF.js";
|
|
15
|
-
import "../../chunk-DCUF7ZWX.js";
|
|
15
|
+
} from "../../chunk-7PHV3YNH.js";
|
|
16
16
|
import "../../chunk-P636GRYJ.js";
|
|
17
|
+
import "../../chunk-VJD2P6SF.js";
|
|
17
18
|
import "../../chunk-2OMVVDBU.js";
|
|
18
19
|
import "../../chunk-WEAGW6MQ.js";
|
|
19
20
|
export {
|
|
20
21
|
getConfig,
|
|
22
|
+
getPureConfig,
|
|
21
23
|
setConfig,
|
|
24
|
+
setEnvironment,
|
|
22
25
|
useAbout,
|
|
23
26
|
useAppVersion,
|
|
24
27
|
useAuthConfig,
|
|
25
28
|
useEnvironment,
|
|
26
29
|
useLoginScreenConfig,
|
|
27
30
|
useMadConfig,
|
|
31
|
+
useServiceNow,
|
|
28
32
|
useServicePortalName,
|
|
29
33
|
useSettingsScreenPremadeConfig
|
|
30
34
|
};
|
|
@@ -1,4 +1,6 @@
|
|
|
1
|
-
import { MadConfig } from "../../types";
|
|
2
|
-
export declare const useMadConfig: () =>
|
|
3
|
-
export declare const getConfig: () =>
|
|
1
|
+
import { Environment, EnvironmentContextualConfig, MadConfig } from "../../types";
|
|
2
|
+
export declare const useMadConfig: () => EnvironmentContextualConfig;
|
|
3
|
+
export declare const getConfig: () => EnvironmentContextualConfig;
|
|
4
|
+
export declare const getPureConfig: () => MadConfig;
|
|
4
5
|
export declare const setConfig: (config: MadConfig) => void;
|
|
6
|
+
export declare const setEnvironment: (env: Environment) => void;
|
|
@@ -1,11 +1,18 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getConfig,
|
|
3
|
+
getPureConfig,
|
|
3
4
|
setConfig,
|
|
5
|
+
setEnvironment,
|
|
4
6
|
useMadConfig
|
|
5
|
-
} from "../../chunk-
|
|
7
|
+
} from "../../chunk-7PHV3YNH.js";
|
|
8
|
+
import "../../chunk-P636GRYJ.js";
|
|
9
|
+
import "../../chunk-VJD2P6SF.js";
|
|
10
|
+
import "../../chunk-2OMVVDBU.js";
|
|
6
11
|
import "../../chunk-WEAGW6MQ.js";
|
|
7
12
|
export {
|
|
8
13
|
getConfig,
|
|
14
|
+
getPureConfig,
|
|
9
15
|
setConfig,
|
|
16
|
+
setEnvironment,
|
|
10
17
|
useMadConfig
|
|
11
18
|
};
|
package/dist/types.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EnvironmentContextProps } from "@equinor/mad-components";
|
|
2
1
|
import { ImageSourcePropType } from "react-native";
|
|
3
2
|
import { Language } from "./store/types";
|
|
4
3
|
import { AppInsightsInitConfig } from "@equinor/mad-insights";
|
|
@@ -6,17 +5,17 @@ export type MadConfig = {
|
|
|
6
5
|
/**
|
|
7
6
|
* Version of the app. Will be displayed in the about screen, and will be used for release notes
|
|
8
7
|
*/
|
|
9
|
-
appVersion: string
|
|
8
|
+
appVersion: EnvironmentValues<string>;
|
|
10
9
|
/**
|
|
11
10
|
* service portal name of the app. Will be used to find the correct resource for service messages and release notes.
|
|
12
11
|
* @see https://web-mad-service-portal-web-prod.radix.equinor.com/
|
|
13
12
|
*/
|
|
14
|
-
servicePortalName: string
|
|
13
|
+
servicePortalName: EnvironmentValues<string>;
|
|
15
14
|
/**
|
|
16
15
|
* Current environment. Will be used for environment banner, as well as getting the correct resource for service messages and release notes
|
|
17
16
|
*/
|
|
18
|
-
|
|
19
|
-
language: {
|
|
17
|
+
currentEnvironment: Environment;
|
|
18
|
+
language: EnvironmentValues<{
|
|
20
19
|
/**
|
|
21
20
|
* Supported languages of the app.
|
|
22
21
|
*/
|
|
@@ -30,8 +29,8 @@ export type MadConfig = {
|
|
|
30
29
|
* Core navigates to a language selection screen by default if needed. Set this to true if you want to override this behaviour
|
|
31
30
|
*/
|
|
32
31
|
skipOnboarding?: boolean;
|
|
33
|
-
}
|
|
34
|
-
authentication: {
|
|
32
|
+
}>;
|
|
33
|
+
authentication: EnvironmentValues<{
|
|
35
34
|
/**
|
|
36
35
|
* Client Id of the application. Used for login.
|
|
37
36
|
* You can find your application's client Id in your application's
|
|
@@ -58,9 +57,9 @@ export type MadConfig = {
|
|
|
58
57
|
* available scopes in your application's App registration in Azure.
|
|
59
58
|
* @see https://portal.azure.com/#view/Microsoft_AAD_RegisteredApps/ApplicationsListBlade
|
|
60
59
|
*/
|
|
61
|
-
scopes
|
|
62
|
-
}
|
|
63
|
-
login: {
|
|
60
|
+
scopes: string[];
|
|
61
|
+
}>;
|
|
62
|
+
login: EnvironmentValues<{
|
|
64
63
|
/**
|
|
65
64
|
* Title of the app. Used in login screen
|
|
66
65
|
*/
|
|
@@ -69,12 +68,12 @@ export type MadConfig = {
|
|
|
69
68
|
* App logo. Used in login screen
|
|
70
69
|
*/
|
|
71
70
|
logo: ImageSourcePropType;
|
|
72
|
-
}
|
|
71
|
+
}>;
|
|
73
72
|
/**
|
|
74
73
|
* App insights config used for initializing application insights service(s)
|
|
75
74
|
*/
|
|
76
|
-
applicationInsights: AppInsightsInitConfig
|
|
77
|
-
about?: {
|
|
75
|
+
applicationInsights: EnvironmentValues<AppInsightsInitConfig>;
|
|
76
|
+
about?: EnvironmentValues<{
|
|
78
77
|
/**
|
|
79
78
|
* Endpoints used by the app
|
|
80
79
|
*/
|
|
@@ -83,10 +82,13 @@ export type MadConfig = {
|
|
|
83
82
|
* Build number of the app.
|
|
84
83
|
*/
|
|
85
84
|
buildNumber: string;
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
85
|
+
}>;
|
|
86
|
+
/**
|
|
87
|
+
* ServiceNow Configuration Item (cmdb_ci) of the app.
|
|
88
|
+
* Will be used to create ServiceNow tickets for the correlating application.
|
|
89
|
+
* @see https://portal.azure.com/#@StatoilSRM.onmicrosoft.com/resource/subscriptions/2ad1b087-ffb8-4cf3-bcc2-8caeebfcd3f3/resourceGroups/mad-test/providers/Microsoft.Storage/storageAccounts/madtest62alhixjcodkm/storagebrowser
|
|
90
|
+
*/
|
|
91
|
+
serviceNow?: EnvironmentValues<string>;
|
|
90
92
|
};
|
|
91
93
|
export type CoreStackParamListBase = {
|
|
92
94
|
Login: undefined;
|
|
@@ -101,3 +103,8 @@ export type CoreStackParamListBase = {
|
|
|
101
103
|
NotFound: undefined;
|
|
102
104
|
};
|
|
103
105
|
export type Environment = "dev" | "test" | "qa" | "prod";
|
|
106
|
+
export type EnvironmentValues<T> = Partial<Record<Environment, T>> | T;
|
|
107
|
+
export type WithoutEnvironmentOptionValues<TToken> = {
|
|
108
|
+
[K in keyof TToken]: TToken[K] extends EnvironmentValues<infer U> ? U : TToken[K];
|
|
109
|
+
};
|
|
110
|
+
export type EnvironmentContextualConfig = WithoutEnvironmentOptionValues<MadConfig>;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Environment, MadConfig } from "../types";
|
|
2
|
+
/**
|
|
3
|
+
* Given the currently selected environment (dev, test, qa, prod),
|
|
4
|
+
* this method creates proxies for the "mad config" so that it resolves to the correct environment values.
|
|
5
|
+
* This handles all configuration possibilities, from 0 to 4 different environments.
|
|
6
|
+
* @param scheme The environment scheme of the application.
|
|
7
|
+
* @returns A proxied config with all values resolved to the provided schemes.
|
|
8
|
+
*/
|
|
9
|
+
export declare function createEnvironmentProxy(scheme: Environment): import("../types").WithoutEnvironmentOptionValues<MadConfig>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import React from "react";
|
|
2
2
|
import { ParamListBase } from "@react-navigation/native";
|
|
3
|
-
import { CoreStackParamListBase
|
|
4
|
-
import { createNativeStackNavigator } from "../components
|
|
3
|
+
import { CoreStackParamListBase } from "../types";
|
|
4
|
+
import { createNativeStackNavigator } from "../components";
|
|
5
5
|
type GeneralFunction = (...args: any) => any;
|
|
6
6
|
type PropsOf<T extends GeneralFunction> = Parameters<T>[0];
|
|
7
7
|
type StackType = ReturnType<typeof createNativeStackNavigator>;
|
|
8
8
|
type NavigatorProps = PropsOf<StackType["Navigator"]>;
|
|
9
|
-
export declare const createMadCoreNavigator: <T extends ParamListBase>(Stack: import("@react-navigation/native").TypedNavigator<T & CoreStackParamListBase, import("@react-navigation/native").StackNavigationState<ParamListBase>, import("@equinor/mad-navigation").MadNativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationEventMap, ({ id, initialRouteName, children, screenListeners, screenOptions, customSubHeader, ...rest }: import("@equinor/mad-navigation").NativeStackNavigatorProps) => React.JSX.Element
|
|
9
|
+
export declare const createMadCoreNavigator: <T extends ParamListBase>(Stack: import("@react-navigation/native").TypedNavigator<T & CoreStackParamListBase, import("@react-navigation/native").StackNavigationState<ParamListBase>, import("@equinor/mad-navigation").MadNativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationEventMap, ({ id, initialRouteName, children, screenListeners, screenOptions, customSubHeader, ...rest }: import("@equinor/mad-navigation").NativeStackNavigatorProps) => React.JSX.Element>) => (props: Omit<NavigatorProps, "initialRouteName">) => React.JSX.Element | null;
|
|
10
10
|
export {};
|
|
@@ -1,37 +1,40 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createMadCoreNavigator
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-UVQ3Z5PG.js";
|
|
3
|
+
} from "../chunk-EPKAICSZ.js";
|
|
4
|
+
import "../chunk-EFVAFRZ4.js";
|
|
5
|
+
import "../chunk-GLFZI3WS.js";
|
|
6
|
+
import "../chunk-STRJ5XYK.js";
|
|
7
|
+
import "../chunk-F4CPVOUK.js";
|
|
9
8
|
import "../chunk-CIMA2GQQ.js";
|
|
10
|
-
import "../chunk-
|
|
11
|
-
import "../chunk-
|
|
12
|
-
import "../chunk-
|
|
13
|
-
import "../chunk-
|
|
14
|
-
import "../chunk-
|
|
9
|
+
import "../chunk-UVQ3Z5PG.js";
|
|
10
|
+
import "../chunk-GVBIOTF2.js";
|
|
11
|
+
import "../chunk-5IS2WJYY.js";
|
|
12
|
+
import "../chunk-CAOQCE6W.js";
|
|
13
|
+
import "../chunk-ATHPQPDV.js";
|
|
15
14
|
import "../chunk-5BVQKJQB.js";
|
|
15
|
+
import "../chunk-7IV7JAIC.js";
|
|
16
|
+
import "../chunk-KGULNU2L.js";
|
|
17
|
+
import "../chunk-F4WSVD6D.js";
|
|
16
18
|
import "../chunk-OCWASWDK.js";
|
|
17
|
-
import "../chunk-
|
|
19
|
+
import "../chunk-WV6VNU2T.js";
|
|
20
|
+
import "../chunk-IUZOOXOV.js";
|
|
18
21
|
import "../chunk-AEGDSD6N.js";
|
|
19
|
-
import "../chunk-
|
|
20
|
-
import "../chunk-GUKC6UGZ.js";
|
|
21
|
-
import "../chunk-EQYL7INQ.js";
|
|
22
|
-
import "../chunk-UAKBRWHM.js";
|
|
23
|
-
import "../chunk-BIMOM43W.js";
|
|
24
|
-
import "../chunk-GSOAYETS.js";
|
|
25
|
-
import "../chunk-A3ND5QVK.js";
|
|
22
|
+
import "../chunk-2BXHQTFH.js";
|
|
26
23
|
import "../chunk-GHWLQBHQ.js";
|
|
27
24
|
import "../chunk-KBEPONRV.js";
|
|
28
25
|
import "../chunk-RFYZGBU4.js";
|
|
26
|
+
import "../chunk-GUKC6UGZ.js";
|
|
27
|
+
import "../chunk-EQYL7INQ.js";
|
|
28
|
+
import "../chunk-6ZEGA36S.js";
|
|
29
|
+
import "../chunk-BIMOM43W.js";
|
|
30
|
+
import "../chunk-RVKZULYD.js";
|
|
29
31
|
import "../chunk-CCVKLLIO.js";
|
|
30
32
|
import "../chunk-UZ6YMQV2.js";
|
|
31
|
-
import "../chunk-
|
|
32
|
-
import "../chunk-
|
|
33
|
-
import "../chunk-
|
|
33
|
+
import "../chunk-GSOAYETS.js";
|
|
34
|
+
import "../chunk-MCVFE22N.js";
|
|
35
|
+
import "../chunk-7PHV3YNH.js";
|
|
34
36
|
import "../chunk-P636GRYJ.js";
|
|
37
|
+
import "../chunk-VJD2P6SF.js";
|
|
35
38
|
import "../chunk-2OMVVDBU.js";
|
|
36
39
|
import "../chunk-WEAGW6MQ.js";
|
|
37
40
|
export {
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
_getNavigationRouteForLoginScreenPure,
|
|
3
3
|
getNavigationRouteForLoginScreen
|
|
4
|
-
} from "../chunk-
|
|
5
|
-
import "../chunk-
|
|
6
|
-
import "../chunk-
|
|
7
|
-
import "../chunk-ZSTTHIEF.js";
|
|
8
|
-
import "../chunk-DCUF7ZWX.js";
|
|
4
|
+
} from "../chunk-WV6VNU2T.js";
|
|
5
|
+
import "../chunk-IUZOOXOV.js";
|
|
6
|
+
import "../chunk-7PHV3YNH.js";
|
|
9
7
|
import "../chunk-P636GRYJ.js";
|
|
8
|
+
import "../chunk-VJD2P6SF.js";
|
|
10
9
|
import "../chunk-2OMVVDBU.js";
|
|
11
10
|
import "../chunk-WEAGW6MQ.js";
|
|
12
11
|
export {
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getNavigationRouteForWhatsNewScreen
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-ZSTTHIEF.js";
|
|
6
|
-
import "../chunk-DCUF7ZWX.js";
|
|
3
|
+
} from "../chunk-IUZOOXOV.js";
|
|
4
|
+
import "../chunk-7PHV3YNH.js";
|
|
7
5
|
import "../chunk-P636GRYJ.js";
|
|
6
|
+
import "../chunk-VJD2P6SF.js";
|
|
8
7
|
import "../chunk-2OMVVDBU.js";
|
|
9
8
|
import "../chunk-WEAGW6MQ.js";
|
|
10
9
|
export {
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { SettingsScreenSectionProps } from "../components
|
|
1
|
+
import { SettingsScreenSectionProps } from "../components";
|
|
2
2
|
import { CoreDictionary } from "../language/types";
|
|
3
|
-
import {
|
|
3
|
+
import { EnvironmentContextualConfig } from "../types";
|
|
4
4
|
export type PremadeSettings = ReturnType<typeof getPremadeSettings>;
|
|
5
|
-
export declare const getPremadeSettings: (config:
|
|
5
|
+
export declare const getPremadeSettings: (config: EnvironmentContextualConfig, dictionary: CoreDictionary) => {
|
|
6
6
|
language: SettingsScreenSectionProps | undefined;
|
|
7
7
|
common: SettingsScreenSectionProps;
|
|
8
8
|
};
|
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
export declare const getRedirectUriFromAuthConfig: (authConfig: MadConfig["authentication"]) => string;
|
|
1
|
+
export declare const getRedirectUriFromAuthConfig: (clientId: string, redirectUri: string, redirectUriWeb?: string) => string;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@equinor/mad-core",
|
|
3
|
-
"version": "0.3.
|
|
3
|
+
"version": "0.3.3",
|
|
4
4
|
"description": "Core library for the Mobile App Delivery team",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"keywords": [
|
|
@@ -22,10 +22,12 @@
|
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"@react-native-async-storage/async-storage": "*",
|
|
24
24
|
"@react-navigation/native": "^6.1.8",
|
|
25
|
-
"
|
|
25
|
+
"expo-device": ">=5.4.0",
|
|
26
|
+
"expo-localization": ">=14.3.0",
|
|
26
27
|
"react": ">=18.0",
|
|
27
28
|
"react-dom": ">=18.0",
|
|
28
29
|
"react-native": ">=0.70",
|
|
30
|
+
"react-native-gesture-handler": "^2.14.0",
|
|
29
31
|
"react-native-msal": "*"
|
|
30
32
|
},
|
|
31
33
|
"dependencies": {
|
|
@@ -33,10 +35,10 @@
|
|
|
33
35
|
"react-native-render-html": "6.3.4",
|
|
34
36
|
"showdown": "2.1.0",
|
|
35
37
|
"zustand": "^4.4.1",
|
|
36
|
-
"@equinor/mad-auth": "0.1.
|
|
37
|
-
"@equinor/mad-components": "0.8.
|
|
38
|
-
"@equinor/mad-insights": "0.1.
|
|
39
|
-
"@equinor/mad-navigation": "0.2.
|
|
38
|
+
"@equinor/mad-auth": "0.1.3",
|
|
39
|
+
"@equinor/mad-components": "0.8.5",
|
|
40
|
+
"@equinor/mad-insights": "0.1.1",
|
|
41
|
+
"@equinor/mad-navigation": "0.2.1"
|
|
40
42
|
},
|
|
41
43
|
"devDependencies": {
|
|
42
44
|
"@babel/core": "^7.21.4",
|
|
@@ -45,7 +47,7 @@
|
|
|
45
47
|
"@testing-library/react-native": "^12.3.0",
|
|
46
48
|
"@types/showdown": "^2.0.0",
|
|
47
49
|
"react-test-renderer": "18.1.0",
|
|
48
|
-
"@equinor/eslint-config-mad": "0.3.
|
|
50
|
+
"@equinor/eslint-config-mad": "0.3.1"
|
|
49
51
|
},
|
|
50
52
|
"files": [
|
|
51
53
|
"CODE_OF_CONDUCT.md",
|
package/dist/chunk-6O3V4Z6G.js
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SelectLanguageScreen
|
|
3
|
-
} from "./chunk-MPPFRLAL.js";
|
|
4
|
-
import {
|
|
5
|
-
ReleaseNotesScreen
|
|
6
|
-
} from "./chunk-ANFSTFWV.js";
|
|
7
|
-
import {
|
|
8
|
-
WhatsNewScreen
|
|
9
|
-
} from "./chunk-FOAO6U65.js";
|
|
10
|
-
import {
|
|
11
|
-
ServiceMessageProvider
|
|
12
|
-
} from "./chunk-6UN2PRPB.js";
|
|
13
|
-
import {
|
|
14
|
-
AboutScreen
|
|
15
|
-
} from "./chunk-SGPMP2PN.js";
|
|
16
|
-
import {
|
|
17
|
-
CreateIncidentScreen
|
|
18
|
-
} from "./chunk-GCBWBANV.js";
|
|
19
|
-
import {
|
|
20
|
-
LoginScreen
|
|
21
|
-
} from "./chunk-PEPYP4GH.js";
|
|
22
|
-
import {
|
|
23
|
-
AnnouncementsProvider
|
|
24
|
-
} from "./chunk-GSOAYETS.js";
|
|
25
|
-
import {
|
|
26
|
-
__spreadProps,
|
|
27
|
-
__spreadValues
|
|
28
|
-
} from "./chunk-WEAGW6MQ.js";
|
|
29
|
-
|
|
30
|
-
// src/utils/createMadCoreNavigator.tsx
|
|
31
|
-
import React from "react";
|
|
32
|
-
import { EnvironmentProvider } from "@equinor/mad-components";
|
|
33
|
-
import { AppInsightsInitializer } from "@equinor/mad-insights";
|
|
34
|
-
var createMadCoreNavigator = (Stack, config) => {
|
|
35
|
-
function MadCoreNavigator(props) {
|
|
36
|
-
return /* @__PURE__ */ React.createElement(AppInsightsInitializer, { config: config.applicationInsights }, /* @__PURE__ */ React.createElement(EnvironmentProvider, { environment: config.environment }, /* @__PURE__ */ React.createElement(ServiceMessageProvider, null, /* @__PURE__ */ React.createElement(AnnouncementsProvider, null, /* @__PURE__ */ React.createElement(Stack.Navigator, __spreadProps(__spreadValues({}, props), { initialRouteName: "Login" }), /* @__PURE__ */ React.createElement(
|
|
37
|
-
Stack.Screen,
|
|
38
|
-
{
|
|
39
|
-
name: "Login",
|
|
40
|
-
component: LoginScreen,
|
|
41
|
-
options: { headerShown: false, customSubHeaderShown: true }
|
|
42
|
-
}
|
|
43
|
-
), /* @__PURE__ */ React.createElement(Stack.Screen, { name: "ReleaseNotes", component: ReleaseNotesScreen }), /* @__PURE__ */ React.createElement(
|
|
44
|
-
Stack.Screen,
|
|
45
|
-
{
|
|
46
|
-
name: "WhatsNew",
|
|
47
|
-
component: WhatsNewScreen
|
|
48
|
-
}
|
|
49
|
-
), config.about && /* @__PURE__ */ React.createElement(Stack.Screen, { name: "About", component: AboutScreen }), config.serviceNow && /* @__PURE__ */ React.createElement(Stack.Screen, { name: "Feedback", component: CreateIncidentScreen }), config.language.supportedLanguages.length > 1 && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(Stack.Screen, { name: "SelectLanguage", component: SelectLanguageScreen }), /* @__PURE__ */ React.createElement(Stack.Screen, { name: "SelectLanguageOnboarding", component: SelectLanguageScreen, options: { headerBackVisible: false } })), props.children)))));
|
|
50
|
-
}
|
|
51
|
-
return MadCoreNavigator;
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export {
|
|
55
|
-
createMadCoreNavigator
|
|
56
|
-
};
|
package/dist/chunk-GCBWBANV.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
// src/components/screens/CreateIncidentScreen.tsx
|
|
2
|
-
import React from "react";
|
|
3
|
-
import { Typography } from "@equinor/mad-components";
|
|
4
|
-
var CreateIncidentScreen = () => {
|
|
5
|
-
return /* @__PURE__ */ React.createElement(Typography, null, "Not implemented yet");
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export {
|
|
9
|
-
CreateIncidentScreen
|
|
10
|
-
};
|
package/dist/chunk-ZSTTHIEF.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
// src/store/mad-config/mad-config.ts
|
|
2
|
-
import { create } from "zustand";
|
|
3
|
-
import { devtools } from "zustand/middleware";
|
|
4
|
-
var useMadConfigStore = create()(
|
|
5
|
-
devtools(
|
|
6
|
-
(set) => ({
|
|
7
|
-
config: null,
|
|
8
|
-
setConfig: (config) => set(() => ({ config }))
|
|
9
|
-
}),
|
|
10
|
-
{ name: "core/config" }
|
|
11
|
-
)
|
|
12
|
-
);
|
|
13
|
-
var MAD_CONFIG_NOT_FOUND_ERROR = "Mad config has not been provided! Make sure you use 'createCoreStackNavigator' to provide your config";
|
|
14
|
-
var useMadConfig = () => {
|
|
15
|
-
const config = useMadConfigStore().config;
|
|
16
|
-
if (!config)
|
|
17
|
-
throw new Error(MAD_CONFIG_NOT_FOUND_ERROR);
|
|
18
|
-
return config;
|
|
19
|
-
};
|
|
20
|
-
var getConfig = () => {
|
|
21
|
-
const config = useMadConfigStore.getState().config;
|
|
22
|
-
if (!config)
|
|
23
|
-
throw new Error(MAD_CONFIG_NOT_FOUND_ERROR);
|
|
24
|
-
return config;
|
|
25
|
-
};
|
|
26
|
-
var setConfig = (config) => {
|
|
27
|
-
useMadConfigStore.getState().setConfig(config);
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export {
|
|
31
|
-
useMadConfig,
|
|
32
|
-
getConfig,
|
|
33
|
-
setConfig
|
|
34
|
-
};
|
|
File without changes
|
|
File without changes
|