@equinor/mad-core 0.0.2 → 0.0.4
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 +28 -0
- package/dist/{chunk-JPVO5SH5.js → chunk-35THIGVH.js} +10 -1
- package/dist/chunk-3LDWV3SJ.js +41 -0
- package/dist/chunk-4VKFRNU7.js +10 -0
- package/dist/{chunk-QU6EUUQS.js → chunk-5QALP2TZ.js} +5 -5
- package/dist/chunk-635YONGY.js +0 -0
- package/dist/chunk-7SJM4NDH.js +12 -0
- package/dist/chunk-AK7PA4BE.js +0 -0
- package/dist/{chunk-ICIPJG6P.js → chunk-CXOQFGMM.js} +21 -5
- package/dist/chunk-DOHQX5XC.js +50 -0
- package/dist/chunk-E36MLVBD.js +19 -0
- package/dist/chunk-EQYL7INQ.js +22 -0
- package/dist/chunk-FUGJZRIR.js +36 -0
- package/dist/chunk-GCBWBANV.js +10 -0
- package/dist/chunk-GUKC6UGZ.js +0 -0
- package/dist/{chunk-SDIKBCFE.js → chunk-HOPDSUAE.js} +1 -1
- package/dist/chunk-KXAIAYE4.js +44 -0
- package/dist/chunk-PEFOX6JA.js +70 -0
- package/dist/{chunk-JRIQBUIT.js → chunk-TLJLKQRN.js} +36 -14
- package/dist/chunk-UVQ3Z5PG.js +0 -0
- package/dist/chunk-VBEIVB4R.js +10 -0
- package/dist/components/createCoreStackNavigator.d.ts +6 -6
- package/dist/components/createCoreStackNavigator.js +17 -12
- package/dist/components/index.d.ts +1 -0
- package/dist/components/index.js +30 -13
- package/dist/components/screens/AboutScreen.d.ts +2 -0
- package/dist/components/screens/AboutScreen.js +7 -0
- package/dist/components/screens/CreateIncidentScreen.d.ts +2 -0
- package/dist/components/screens/CreateIncidentScreen.js +7 -0
- package/dist/components/screens/LoginScreen.js +6 -5
- package/dist/components/screens/release-notes/ChangeLog.d.ts +2 -3
- package/dist/components/screens/release-notes/ChangeLog.js +1 -1
- package/dist/components/screens/release-notes/ReleaseNotesScreen.d.ts +2 -0
- package/dist/components/screens/release-notes/ReleaseNotesScreen.js +7 -0
- package/dist/components/screens/release-notes/WhatsNewScreen.js +9 -7
- package/dist/components/screens/settings/Section.d.ts +3 -0
- package/dist/components/screens/settings/Section.js +13 -0
- package/dist/components/screens/settings/SettingsScreen.d.ts +15 -0
- package/dist/components/screens/settings/SettingsScreen.js +20 -0
- package/dist/components/screens/settings/index.d.ts +2 -0
- package/dist/components/screens/settings/index.js +22 -0
- package/dist/components/screens/settings/renderCell.d.ts +5 -0
- package/dist/components/screens/settings/renderCell.js +7 -0
- package/dist/components/screens/settings/types.d.ts +22 -0
- package/dist/components/screens/settings/types.js +1 -0
- package/dist/components/screens/settings/useSignOut.d.ts +1 -0
- package/dist/components/screens/settings/useSignOut.js +10 -0
- package/dist/hooks/index.d.ts +2 -0
- package/dist/hooks/index.js +14 -0
- package/dist/hooks/useAccountOrDemoAccount.d.ts +7 -0
- package/dist/hooks/useAccountOrDemoAccount.js +9 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +38 -15
- package/dist/store/language/index.js +2 -1
- package/dist/store/language/language.js +2 -1
- package/dist/store/mad-config/hooks.d.ts +5 -1
- package/dist/store/mad-config/hooks.js +6 -3
- package/dist/store/mad-config/index.js +6 -3
- package/dist/store/release-notes/index.js +1 -0
- package/dist/types.d.ts +13 -0
- package/dist/utils/createMadCoreNavigator.js +16 -11
- package/dist/utils/getFinalSettingsConfig.d.ts +3 -0
- package/dist/utils/getFinalSettingsConfig.js +7 -0
- package/dist/utils/getPremadeSettings.d.ts +7 -0
- package/dist/utils/getPremadeSettings.js +7 -0
- package/package.json +4 -4
- package/dist/chunk-3DI7YERU.js +0 -80
- /package/dist/{chunk-HAB34YS7.js → chunk-5GBNULIT.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @equinor/mad-core
|
|
2
2
|
|
|
3
|
+
## 0.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- a22023e: Settings screen implemented
|
|
8
|
+
- 4c301e1: Implemented WhatsNewScreen into core package, created ChangeLog component
|
|
9
|
+
- Updated dependencies [c8d9131]
|
|
10
|
+
- Updated dependencies [a22023e]
|
|
11
|
+
- Updated dependencies [a57a362]
|
|
12
|
+
- Updated dependencies [a22023e]
|
|
13
|
+
- Updated dependencies [65d6d69]
|
|
14
|
+
- Updated dependencies [a0999d4]
|
|
15
|
+
- Updated dependencies [4c301e1]
|
|
16
|
+
- Updated dependencies [bda6748]
|
|
17
|
+
- Updated dependencies [08eeb85]
|
|
18
|
+
- @equinor/mad-components@0.8.1
|
|
19
|
+
- @equinor/mad-navigation@0.1.17
|
|
20
|
+
- @equinor/mad-auth@0.0.14
|
|
21
|
+
|
|
22
|
+
## 0.0.3
|
|
23
|
+
|
|
24
|
+
### Patch Changes
|
|
25
|
+
|
|
26
|
+
- Updated dependencies [fb69a74]
|
|
27
|
+
- @equinor/mad-components@0.8.0
|
|
28
|
+
- @equinor/mad-auth@0.0.13
|
|
29
|
+
- @equinor/mad-navigation@0.1.16
|
|
30
|
+
|
|
3
31
|
## 0.0.2
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useMadConfig
|
|
3
3
|
} from "./chunk-ZSTTHIEF.js";
|
|
4
|
+
import {
|
|
5
|
+
getPremadeSettings
|
|
6
|
+
} from "./chunk-3LDWV3SJ.js";
|
|
4
7
|
|
|
5
8
|
// src/store/mad-config/hooks.ts
|
|
6
9
|
var useAuthConfig = () => {
|
|
@@ -23,11 +26,17 @@ var useServicePortalName = () => {
|
|
|
23
26
|
const config = useMadConfig();
|
|
24
27
|
return config.servicePortalName;
|
|
25
28
|
};
|
|
29
|
+
var useSettingsScreenPremadeConfig = () => {
|
|
30
|
+
const config = useMadConfig();
|
|
31
|
+
const premadeSettings = getPremadeSettings(config);
|
|
32
|
+
return premadeSettings;
|
|
33
|
+
};
|
|
26
34
|
|
|
27
35
|
export {
|
|
28
36
|
useAuthConfig,
|
|
29
37
|
useLoginScreenConfig,
|
|
30
38
|
useAppVersion,
|
|
31
39
|
useEnvironment,
|
|
32
|
-
useServicePortalName
|
|
40
|
+
useServicePortalName,
|
|
41
|
+
useSettingsScreenPremadeConfig
|
|
33
42
|
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
// src/utils/getPremadeSettings.ts
|
|
2
|
+
var releaseNotes = {
|
|
3
|
+
name: "navigation",
|
|
4
|
+
iconName: "format-list-bulleted",
|
|
5
|
+
title: "Release notes",
|
|
6
|
+
onPress: (navigation) => navigation.navigate("ReleaseNotes")
|
|
7
|
+
};
|
|
8
|
+
var about = {
|
|
9
|
+
name: "navigation",
|
|
10
|
+
iconName: "information-outline",
|
|
11
|
+
title: "About",
|
|
12
|
+
onPress: (navigation) => navigation.navigate("About")
|
|
13
|
+
};
|
|
14
|
+
var serviceNow = {
|
|
15
|
+
name: "navigation",
|
|
16
|
+
iconName: "chat-alert-outline",
|
|
17
|
+
title: "Feedback",
|
|
18
|
+
onPress: (navigation) => navigation.navigate("Feedback")
|
|
19
|
+
};
|
|
20
|
+
var language = {
|
|
21
|
+
name: "navigation",
|
|
22
|
+
iconName: "chat-processing-outline",
|
|
23
|
+
title: "Language",
|
|
24
|
+
onPress: (navigation) => navigation.navigate("NotFound")
|
|
25
|
+
};
|
|
26
|
+
var getPremadeSettings = (config) => {
|
|
27
|
+
const premadeCommonNavigationItems = [releaseNotes];
|
|
28
|
+
if (config.about)
|
|
29
|
+
premadeCommonNavigationItems.push(about);
|
|
30
|
+
if (config.serviceNow)
|
|
31
|
+
premadeCommonNavigationItems.push(serviceNow);
|
|
32
|
+
const premadeLanguageSection = config.language.supportedLanguages.length >= 2 ? { items: [language] } : void 0;
|
|
33
|
+
const premadeCommonNavigationSection = {
|
|
34
|
+
items: premadeCommonNavigationItems
|
|
35
|
+
};
|
|
36
|
+
return { language: premadeLanguageSection, common: premadeCommonNavigationSection };
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
export {
|
|
40
|
+
getPremadeSettings
|
|
41
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/components/screens/release-notes/ReleaseNotesScreen.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Typography } from "@equinor/mad-components";
|
|
4
|
+
var ReleaseNotesScreen = () => {
|
|
5
|
+
return /* @__PURE__ */ React.createElement(Typography, null, "Not implemented yet");
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
ReleaseNotesScreen
|
|
10
|
+
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
useReleaseNotesVersion
|
|
3
3
|
} from "./chunk-5BVQKJQB.js";
|
|
4
|
+
import {
|
|
5
|
+
useAppVersion,
|
|
6
|
+
useAuthConfig,
|
|
7
|
+
useLoginScreenConfig
|
|
8
|
+
} from "./chunk-35THIGVH.js";
|
|
4
9
|
import {
|
|
5
10
|
getNavigationRouteForLoginScreen
|
|
6
11
|
} from "./chunk-AGAXO3NW.js";
|
|
7
12
|
import {
|
|
8
13
|
enableDemoMode
|
|
9
14
|
} from "./chunk-UZ6YMQV2.js";
|
|
10
|
-
import {
|
|
11
|
-
useAppVersion,
|
|
12
|
-
useAuthConfig,
|
|
13
|
-
useLoginScreenConfig
|
|
14
|
-
} from "./chunk-JPVO5SH5.js";
|
|
15
15
|
import {
|
|
16
16
|
useCoreStackNavigation
|
|
17
17
|
} from "./chunk-K2H37TUR.js";
|
|
File without changes
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
// src/utils/getFinalSettingsConfig.ts
|
|
2
|
+
var getFinalSettingsConfig = (config, premade, clean) => {
|
|
3
|
+
if (clean)
|
|
4
|
+
return config;
|
|
5
|
+
if (premade.language)
|
|
6
|
+
return [premade.language, ...config, premade.common];
|
|
7
|
+
return [...config, premade.common];
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
getFinalSettingsConfig
|
|
12
|
+
};
|
|
File without changes
|
|
@@ -1,9 +1,18 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ReleaseNotesScreen
|
|
3
|
+
} from "./chunk-4VKFRNU7.js";
|
|
1
4
|
import {
|
|
2
5
|
WhatsNewScreen
|
|
3
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-TLJLKQRN.js";
|
|
7
|
+
import {
|
|
8
|
+
AboutScreen
|
|
9
|
+
} from "./chunk-VBEIVB4R.js";
|
|
10
|
+
import {
|
|
11
|
+
CreateIncidentScreen
|
|
12
|
+
} from "./chunk-GCBWBANV.js";
|
|
4
13
|
import {
|
|
5
14
|
LoginScreen
|
|
6
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5QALP2TZ.js";
|
|
7
16
|
import {
|
|
8
17
|
AnnouncementsProvider
|
|
9
18
|
} from "./chunk-FQWPBBPB.js";
|
|
@@ -16,7 +25,7 @@ import {
|
|
|
16
25
|
import React from "react";
|
|
17
26
|
import { EnvironmentProvider } from "@equinor/mad-navigation";
|
|
18
27
|
var createMadCoreNavigator = (Stack, config) => {
|
|
19
|
-
|
|
28
|
+
function MadCoreNavigator(props) {
|
|
20
29
|
return /* @__PURE__ */ React.createElement(EnvironmentProvider, { environment: config.environment }, /* @__PURE__ */ React.createElement(AnnouncementsProvider, null, /* @__PURE__ */ React.createElement(Stack.Navigator, __spreadProps(__spreadValues({}, props), { initialRouteName: "Login" }), /* @__PURE__ */ React.createElement(
|
|
21
30
|
Stack.Screen,
|
|
22
31
|
{
|
|
@@ -24,8 +33,15 @@ var createMadCoreNavigator = (Stack, config) => {
|
|
|
24
33
|
component: LoginScreen,
|
|
25
34
|
options: { headerShown: false, environmentBannerShown: true }
|
|
26
35
|
}
|
|
27
|
-
), /* @__PURE__ */ React.createElement(Stack.Screen, { name: "
|
|
28
|
-
|
|
36
|
+
), /* @__PURE__ */ React.createElement(Stack.Screen, { name: "ReleaseNotes", component: ReleaseNotesScreen }), /* @__PURE__ */ React.createElement(
|
|
37
|
+
Stack.Screen,
|
|
38
|
+
{
|
|
39
|
+
name: "WhatsNew",
|
|
40
|
+
component: WhatsNewScreen,
|
|
41
|
+
options: { headerTitle: "What's New" }
|
|
42
|
+
}
|
|
43
|
+
), config.about && /* @__PURE__ */ React.createElement(Stack.Screen, { name: "About", component: AboutScreen }), config.serviceNow && /* @__PURE__ */ React.createElement(Stack.Screen, { name: "Feedback", component: CreateIncidentScreen }), props.children)));
|
|
44
|
+
}
|
|
29
45
|
return MadCoreNavigator;
|
|
30
46
|
};
|
|
31
47
|
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/components/screens/settings/renderCell.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Cell, Icon } from "@equinor/mad-components";
|
|
4
|
+
import { View } from "react-native";
|
|
5
|
+
var renderCell = (item, navigation) => {
|
|
6
|
+
switch (item.name) {
|
|
7
|
+
case "navigation":
|
|
8
|
+
return /* @__PURE__ */ React.createElement(
|
|
9
|
+
Cell.Navigation,
|
|
10
|
+
{
|
|
11
|
+
key: item.title,
|
|
12
|
+
title: item.title,
|
|
13
|
+
iconName: item.iconName,
|
|
14
|
+
onPress: () => item.onPress(navigation)
|
|
15
|
+
}
|
|
16
|
+
);
|
|
17
|
+
case "custom":
|
|
18
|
+
return /* @__PURE__ */ React.createElement(Cell, { key: item.title, onPress: () => null }, /* @__PURE__ */ React.createElement(View, { style: { justifyContent: "center" } }, /* @__PURE__ */ React.createElement(Icon, { name: item.iconName })));
|
|
19
|
+
case "button":
|
|
20
|
+
return /* @__PURE__ */ React.createElement(
|
|
21
|
+
Cell.Button,
|
|
22
|
+
{
|
|
23
|
+
key: item.title,
|
|
24
|
+
title: item.title,
|
|
25
|
+
iconName: item.iconName,
|
|
26
|
+
color: item.color,
|
|
27
|
+
onPress: item.onPress
|
|
28
|
+
}
|
|
29
|
+
);
|
|
30
|
+
case "switch":
|
|
31
|
+
return /* @__PURE__ */ React.createElement(
|
|
32
|
+
Cell.Switch,
|
|
33
|
+
{
|
|
34
|
+
key: item.title,
|
|
35
|
+
title: item.title,
|
|
36
|
+
iconName: item.iconName,
|
|
37
|
+
isActive: item.isActive,
|
|
38
|
+
onChange: item.onChange,
|
|
39
|
+
switchSize: item.switchSize,
|
|
40
|
+
disabled: item.disabled,
|
|
41
|
+
description: item.description,
|
|
42
|
+
color: item.color
|
|
43
|
+
}
|
|
44
|
+
);
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
export {
|
|
49
|
+
renderCell
|
|
50
|
+
};
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderCell
|
|
3
|
+
} from "./chunk-DOHQX5XC.js";
|
|
4
|
+
import {
|
|
5
|
+
useCoreStackNavigation
|
|
6
|
+
} from "./chunk-K2H37TUR.js";
|
|
7
|
+
|
|
8
|
+
// src/components/screens/settings/Section.tsx
|
|
9
|
+
import React from "react";
|
|
10
|
+
import { Cell, Spacer } from "@equinor/mad-components";
|
|
11
|
+
import { View } from "react-native";
|
|
12
|
+
var SettingsSection = ({ title, items }) => {
|
|
13
|
+
const navigation = useCoreStackNavigation();
|
|
14
|
+
return /* @__PURE__ */ React.createElement(View, null, /* @__PURE__ */ React.createElement(Cell.Group, { title }, items.map((item) => renderCell(item, navigation))), /* @__PURE__ */ React.createElement(Spacer, { amount: "small" }));
|
|
15
|
+
};
|
|
16
|
+
|
|
17
|
+
export {
|
|
18
|
+
SettingsSection
|
|
19
|
+
};
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDemoMode
|
|
3
|
+
} from "./chunk-UZ6YMQV2.js";
|
|
4
|
+
|
|
5
|
+
// src/hooks/useAccountOrDemoAccount.ts
|
|
6
|
+
import { useAccount } from "@equinor/mad-auth";
|
|
7
|
+
var MAD_DEMO_USER = {
|
|
8
|
+
name: "Demo user",
|
|
9
|
+
username: "demo.user@example.com",
|
|
10
|
+
identifier: "-1"
|
|
11
|
+
};
|
|
12
|
+
var useAccountOrDemoAccount = () => {
|
|
13
|
+
const demoMode = useDemoMode();
|
|
14
|
+
const account = useAccount();
|
|
15
|
+
if (demoMode.isEnabled)
|
|
16
|
+
return MAD_DEMO_USER;
|
|
17
|
+
return account;
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export {
|
|
21
|
+
useAccountOrDemoAccount
|
|
22
|
+
};
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
useDemoMode
|
|
3
|
+
} from "./chunk-UZ6YMQV2.js";
|
|
4
|
+
import {
|
|
5
|
+
useCoreStackNavigation
|
|
6
|
+
} from "./chunk-K2H37TUR.js";
|
|
7
|
+
import {
|
|
8
|
+
__async
|
|
9
|
+
} from "./chunk-UTXWRAEE.js";
|
|
10
|
+
|
|
11
|
+
// src/components/screens/settings/useSignOut.ts
|
|
12
|
+
import { useCallback } from "react";
|
|
13
|
+
import { signOut } from "@equinor/mad-auth";
|
|
14
|
+
import { alert } from "@equinor/mad-components";
|
|
15
|
+
var useSignOut = () => {
|
|
16
|
+
const navigation = useCoreStackNavigation();
|
|
17
|
+
const demoMode = useDemoMode();
|
|
18
|
+
const signOutFn = useCallback(() => __async(void 0, null, function* () {
|
|
19
|
+
try {
|
|
20
|
+
const result = yield signOut();
|
|
21
|
+
if (!demoMode.isEnabled && !result)
|
|
22
|
+
throw new Error("Unable to sign out");
|
|
23
|
+
navigation.navigate("Login");
|
|
24
|
+
} catch (_) {
|
|
25
|
+
alert("Error", "Unable to sign out", [
|
|
26
|
+
{ text: "Try again", isPreferred: true, onPress: signOutFn },
|
|
27
|
+
{ text: "Cancel", onPress: () => void 0 }
|
|
28
|
+
]);
|
|
29
|
+
}
|
|
30
|
+
}), [navigation, demoMode]);
|
|
31
|
+
return signOutFn;
|
|
32
|
+
};
|
|
33
|
+
|
|
34
|
+
export {
|
|
35
|
+
useSignOut
|
|
36
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
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
|
+
};
|
|
File without changes
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SettingsSection
|
|
3
|
+
} from "./chunk-E36MLVBD.js";
|
|
4
|
+
import {
|
|
5
|
+
useSignOut
|
|
6
|
+
} from "./chunk-FUGJZRIR.js";
|
|
7
|
+
import {
|
|
8
|
+
getFinalSettingsConfig
|
|
9
|
+
} from "./chunk-7SJM4NDH.js";
|
|
10
|
+
import {
|
|
11
|
+
useSettingsScreenPremadeConfig
|
|
12
|
+
} from "./chunk-35THIGVH.js";
|
|
13
|
+
import {
|
|
14
|
+
useAccountOrDemoAccount
|
|
15
|
+
} from "./chunk-EQYL7INQ.js";
|
|
16
|
+
import {
|
|
17
|
+
__spreadValues
|
|
18
|
+
} from "./chunk-UTXWRAEE.js";
|
|
19
|
+
|
|
20
|
+
// src/components/screens/settings/SettingsScreen.tsx
|
|
21
|
+
import React from "react";
|
|
22
|
+
import { Button, Spacer, Typography } from "@equinor/mad-components";
|
|
23
|
+
import { View, ScrollView } from "react-native";
|
|
24
|
+
var SettingsScreen = ({ config = [], clean = false }) => {
|
|
25
|
+
const signOut = useSignOut();
|
|
26
|
+
const premadeConfig = useSettingsScreenPremadeConfig();
|
|
27
|
+
const account = useAccountOrDemoAccount();
|
|
28
|
+
const finalSettingsConfig = getFinalSettingsConfig(config, premadeConfig, clean);
|
|
29
|
+
return /* @__PURE__ */ React.createElement(ScrollView, { contentInsetAdjustmentBehavior: "automatic" }, /* @__PURE__ */ React.createElement(Spacer, null), finalSettingsConfig.map((section, index) => /* @__PURE__ */ React.createElement(SettingsSection, __spreadValues({ key: index }, section))), /* @__PURE__ */ React.createElement(View, { style: { padding: 30 } }, /* @__PURE__ */ React.createElement(Typography, { bold: true }, "Logged in as"), /* @__PURE__ */ React.createElement(Typography, null, account == null ? void 0 : account.username)), /* @__PURE__ */ React.createElement(View, { style: { flexDirection: "row-reverse" } }, /* @__PURE__ */ React.createElement(
|
|
30
|
+
Button,
|
|
31
|
+
{
|
|
32
|
+
title: "Log out",
|
|
33
|
+
onPress: signOut,
|
|
34
|
+
style: {
|
|
35
|
+
marginHorizontal: 30,
|
|
36
|
+
width: 100
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
)));
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
export {
|
|
43
|
+
SettingsScreen
|
|
44
|
+
};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import {
|
|
2
|
+
getShortDate
|
|
3
|
+
} from "./chunk-OCWASWDK.js";
|
|
4
|
+
import {
|
|
5
|
+
__spreadProps,
|
|
6
|
+
__spreadValues
|
|
7
|
+
} from "./chunk-UTXWRAEE.js";
|
|
8
|
+
|
|
9
|
+
// src/components/screens/release-notes/ChangeLog.tsx
|
|
10
|
+
import React, { useState } from "react";
|
|
11
|
+
import { ScrollView, View } from "react-native";
|
|
12
|
+
import RenderHtml, { defaultSystemFonts } from "react-native-render-html";
|
|
13
|
+
import * as showdown from "showdown";
|
|
14
|
+
import { Typography, Cell, EDSStyleSheet, useStyles } from "@equinor/mad-components";
|
|
15
|
+
var converter = new showdown.Converter();
|
|
16
|
+
var systemFonts = [...defaultSystemFonts, "Equinor-Regular"];
|
|
17
|
+
var ChangeLog = ({ release }) => {
|
|
18
|
+
const styles = useStyles(changeLogStyles);
|
|
19
|
+
const [width, setWidth] = useState(0);
|
|
20
|
+
const html = { html: converter.makeHtml(release.releaseNote) };
|
|
21
|
+
const date = new Date(release.releaseDate);
|
|
22
|
+
const shortDate = getShortDate(date);
|
|
23
|
+
return /* @__PURE__ */ React.createElement(ScrollView, null, /* @__PURE__ */ React.createElement(Cell, { style: styles.container }, /* @__PURE__ */ React.createElement(Typography, { style: styles.versionHeader }, release.version), /* @__PURE__ */ React.createElement(Typography, { style: styles.subtitleHeader }, shortDate), /* @__PURE__ */ React.createElement(
|
|
24
|
+
View,
|
|
25
|
+
{
|
|
26
|
+
onLayout: (event) => {
|
|
27
|
+
const { width: width2 } = event.nativeEvent.layout;
|
|
28
|
+
setWidth(width2);
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
/* @__PURE__ */ React.createElement(
|
|
32
|
+
RenderHtml,
|
|
33
|
+
{
|
|
34
|
+
contentWidth: width,
|
|
35
|
+
source: html,
|
|
36
|
+
systemFonts,
|
|
37
|
+
tagsStyles: {
|
|
38
|
+
ul: styles.list,
|
|
39
|
+
// @ts-expect-error Type Mismatch between react-native TextStyle and react-native-render-html
|
|
40
|
+
li: styles.listItems
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
)
|
|
44
|
+
)));
|
|
45
|
+
};
|
|
46
|
+
var changeLogStyles = EDSStyleSheet.create((theme) => ({
|
|
47
|
+
container: {
|
|
48
|
+
justifyContent: "center"
|
|
49
|
+
},
|
|
50
|
+
versionHeader: theme.typography.basic.h1,
|
|
51
|
+
subtitleHeader: __spreadProps(__spreadValues({}, theme.typography.basic.h4), {
|
|
52
|
+
marginVertical: theme.spacing.container.paddingVertical
|
|
53
|
+
}),
|
|
54
|
+
list: {
|
|
55
|
+
display: "flex",
|
|
56
|
+
listStyleType: "square",
|
|
57
|
+
alignItems: "flex-start",
|
|
58
|
+
paddingLeft: theme.spacing.container.paddingHorizontal,
|
|
59
|
+
marginVertical: theme.spacing.textField.paddingVertical,
|
|
60
|
+
color: theme.colors.text.primary
|
|
61
|
+
},
|
|
62
|
+
listItems: __spreadProps(__spreadValues({}, theme.typography.paragraph.body_short), {
|
|
63
|
+
marginHorizontal: theme.spacing.textField.paddingHorizontal,
|
|
64
|
+
paddingBottom: theme.spacing.textField.paddingVertical
|
|
65
|
+
})
|
|
66
|
+
}));
|
|
67
|
+
|
|
68
|
+
export {
|
|
69
|
+
ChangeLog
|
|
70
|
+
};
|
|
@@ -3,18 +3,18 @@ import {
|
|
|
3
3
|
} from "./chunk-FIFUL4JE.js";
|
|
4
4
|
import {
|
|
5
5
|
ChangeLog
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-PEFOX6JA.js";
|
|
7
7
|
import {
|
|
8
8
|
useReleaseNotesVersion
|
|
9
9
|
} from "./chunk-5BVQKJQB.js";
|
|
10
|
-
import {
|
|
11
|
-
useDemoMode
|
|
12
|
-
} from "./chunk-UZ6YMQV2.js";
|
|
13
10
|
import {
|
|
14
11
|
useAppVersion,
|
|
15
12
|
useEnvironment,
|
|
16
13
|
useServicePortalName
|
|
17
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-35THIGVH.js";
|
|
15
|
+
import {
|
|
16
|
+
useDemoMode
|
|
17
|
+
} from "./chunk-UZ6YMQV2.js";
|
|
18
18
|
import {
|
|
19
19
|
useCoreStackNavigation
|
|
20
20
|
} from "./chunk-K2H37TUR.js";
|
|
@@ -38,7 +38,7 @@ __export(whats_new_exports, {
|
|
|
38
38
|
var app = "App name";
|
|
39
39
|
var version = "1.1.0";
|
|
40
40
|
var modified = "2022-12-09T07:04:55+0000";
|
|
41
|
-
var releaseNote = "-
|
|
41
|
+
var releaseNote = "- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n- This is a list\n- This is the second part of the list\n- Something\n - something else\n";
|
|
42
42
|
var releaseDate = "2022-12-09T07:04:55+0000";
|
|
43
43
|
var whats_new_default = {
|
|
44
44
|
app,
|
|
@@ -49,8 +49,10 @@ var whats_new_default = {
|
|
|
49
49
|
};
|
|
50
50
|
|
|
51
51
|
// src/components/screens/release-notes/WhatsNewScreen.tsx
|
|
52
|
-
import { CircularProgress } from "@equinor/mad-components";
|
|
52
|
+
import { Button, CircularProgress, EDSStyleSheet, useStyles } from "@equinor/mad-components";
|
|
53
|
+
import { View } from "react-native";
|
|
53
54
|
var WhatsNewScreen = () => {
|
|
55
|
+
const styles = useStyles(whatsNewStyles);
|
|
54
56
|
const environment = useEnvironment();
|
|
55
57
|
const releaseNotesVersion = useReleaseNotesVersion();
|
|
56
58
|
const servicePortalName = useServicePortalName();
|
|
@@ -76,19 +78,39 @@ var WhatsNewScreen = () => {
|
|
|
76
78
|
navigate();
|
|
77
79
|
}
|
|
78
80
|
if (!release) {
|
|
79
|
-
return /* @__PURE__ */ React.createElement(CircularProgress, null);
|
|
81
|
+
return /* @__PURE__ */ React.createElement(View, { style: styles.spinnerContainer }, /* @__PURE__ */ React.createElement(CircularProgress, null));
|
|
80
82
|
}
|
|
81
|
-
return /* @__PURE__ */ React.createElement(
|
|
82
|
-
|
|
83
|
+
return /* @__PURE__ */ React.createElement(View, { style: styles.container }, /* @__PURE__ */ React.createElement(ChangeLog, { release }), /* @__PURE__ */ React.createElement(View, { style: styles.footer }, /* @__PURE__ */ React.createElement(
|
|
84
|
+
Button,
|
|
83
85
|
{
|
|
84
|
-
|
|
85
|
-
|
|
86
|
+
title: "OK",
|
|
87
|
+
onPress: () => {
|
|
86
88
|
releaseNotesVersion.setLastDisplayedReleaseNotesVersion(appVersion);
|
|
87
89
|
navigate();
|
|
88
|
-
}
|
|
90
|
+
},
|
|
91
|
+
style: { width: 81 }
|
|
89
92
|
}
|
|
90
|
-
);
|
|
93
|
+
)));
|
|
91
94
|
};
|
|
95
|
+
var whatsNewStyles = EDSStyleSheet.create((theme) => ({
|
|
96
|
+
spinnerContainer: {
|
|
97
|
+
display: "flex",
|
|
98
|
+
height: "100%",
|
|
99
|
+
justifyContent: "center",
|
|
100
|
+
alignItems: "center"
|
|
101
|
+
},
|
|
102
|
+
container: {
|
|
103
|
+
display: "flex",
|
|
104
|
+
paddingTop: theme.geometry.dimension.cell.minHeight,
|
|
105
|
+
height: "100%",
|
|
106
|
+
justifyContent: "space-between"
|
|
107
|
+
},
|
|
108
|
+
footer: {
|
|
109
|
+
alignItems: "flex-end",
|
|
110
|
+
marginHorizontal: theme.spacing.container.paddingHorizontal,
|
|
111
|
+
marginVertical: theme.spacing.container.paddingVertical
|
|
112
|
+
}
|
|
113
|
+
}));
|
|
92
114
|
|
|
93
115
|
export {
|
|
94
116
|
WhatsNewScreen
|
|
File without changes
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
// src/components/screens/AboutScreen.tsx
|
|
2
|
+
import React from "react";
|
|
3
|
+
import { Typography } from "@equinor/mad-components";
|
|
4
|
+
var AboutScreen = () => {
|
|
5
|
+
return /* @__PURE__ */ React.createElement(Typography, null, "Not implemented yet");
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export {
|
|
9
|
+
AboutScreen
|
|
10
|
+
};
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { CoreStackParamListBase, MadConfig } from "../types";
|
|
3
3
|
export declare const createCoreStackNavigator: (config: MadConfig) => {
|
|
4
4
|
Navigator: (props: Omit<Omit<import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
5
|
-
id?: string;
|
|
5
|
+
id?: string | undefined;
|
|
6
6
|
children: import("react").ReactNode;
|
|
7
7
|
screenListeners?: Partial<{
|
|
8
8
|
transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
|
|
@@ -21,13 +21,13 @@ export declare const createCoreStackNavigator: (config: MadConfig) => {
|
|
|
21
21
|
blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
|
|
22
22
|
state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
|
|
23
23
|
beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
|
|
24
|
-
}>);
|
|
24
|
+
}>) | undefined;
|
|
25
25
|
screenOptions?: import("@equinor/mad-navigation").MadNativeStackNavigationOptions | ((props: {
|
|
26
26
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
27
27
|
navigation: any;
|
|
28
|
-
}) => import("@equinor/mad-navigation").MadNativeStackNavigationOptions);
|
|
28
|
+
}) => import("@equinor/mad-navigation").MadNativeStackNavigationOptions) | undefined;
|
|
29
29
|
} & import("@react-navigation/routers").StackRouterOptions, "children" | "id" | "initialRouteName" | "screenListeners" | "screenOptions"> & import("@react-navigation/routers").DefaultRouterOptions<string> & {
|
|
30
|
-
id?: string;
|
|
30
|
+
id?: string | undefined;
|
|
31
31
|
children: import("react").ReactNode;
|
|
32
32
|
screenListeners?: Partial<{
|
|
33
33
|
transitionStart: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "transitionStart">;
|
|
@@ -46,11 +46,11 @@ export declare const createCoreStackNavigator: (config: MadConfig) => {
|
|
|
46
46
|
blur: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "blur">;
|
|
47
47
|
state: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "state">;
|
|
48
48
|
beforeRemove: import("@react-navigation/core").EventListenerCallback<import("@react-navigation/native-stack").NativeStackNavigationEventMap, "beforeRemove">;
|
|
49
|
-
}>);
|
|
49
|
+
}>) | undefined;
|
|
50
50
|
screenOptions?: import("@equinor/mad-navigation").MadNativeStackNavigationOptions | ((props: {
|
|
51
51
|
route: import("@react-navigation/core").RouteProp<import("@react-navigation/routers").ParamListBase, string>;
|
|
52
52
|
navigation: any;
|
|
53
|
-
}) => import("@equinor/mad-navigation").MadNativeStackNavigationOptions);
|
|
53
|
+
}) => import("@equinor/mad-navigation").MadNativeStackNavigationOptions) | undefined;
|
|
54
54
|
}, "initialRouteName">) => import("react").JSX.Element;
|
|
55
55
|
Group: import("react").ComponentType<import("@react-navigation/core").RouteGroupConfig<CoreStackParamListBase, import("@equinor/mad-navigation").MadNativeStackNavigationOptions>>;
|
|
56
56
|
Screen: <RouteName extends keyof CoreStackParamListBase>(_: import("@react-navigation/core").RouteConfig<CoreStackParamListBase, RouteName, import("@react-navigation/routers").StackNavigationState<import("@react-navigation/routers").ParamListBase>, import("@equinor/mad-navigation").MadNativeStackNavigationOptions, import("@react-navigation/native-stack").NativeStackNavigationEventMap>) => null;
|
|
@@ -1,23 +1,28 @@
|
|
|
1
1
|
import {
|
|
2
2
|
createCoreStackNavigator
|
|
3
|
-
} from "../chunk-
|
|
4
|
-
import "../chunk-
|
|
5
|
-
import "../chunk-
|
|
3
|
+
} from "../chunk-HOPDSUAE.js";
|
|
4
|
+
import "../chunk-CXOQFGMM.js";
|
|
5
|
+
import "../chunk-4VKFRNU7.js";
|
|
6
|
+
import "../chunk-TLJLKQRN.js";
|
|
6
7
|
import "../chunk-FIFUL4JE.js";
|
|
7
|
-
import "../chunk-
|
|
8
|
-
import "../chunk-
|
|
9
|
-
import "../chunk-
|
|
10
|
-
import "../chunk-
|
|
8
|
+
import "../chunk-UVQ3Z5PG.js";
|
|
9
|
+
import "../chunk-PEFOX6JA.js";
|
|
10
|
+
import "../chunk-VBEIVB4R.js";
|
|
11
|
+
import "../chunk-GCBWBANV.js";
|
|
12
|
+
import "../chunk-5QALP2TZ.js";
|
|
11
13
|
import "../chunk-5BVQKJQB.js";
|
|
12
|
-
import "../chunk-AGAXO3NW.js";
|
|
13
|
-
import "../chunk-CCVKLLIO.js";
|
|
14
|
-
import "../chunk-UZ6YMQV2.js";
|
|
15
14
|
import "../chunk-USETLDR7.js";
|
|
16
|
-
import "../chunk-
|
|
15
|
+
import "../chunk-35THIGVH.js";
|
|
17
16
|
import "../chunk-ZSTTHIEF.js";
|
|
17
|
+
import "../chunk-2OMVVDBU.js";
|
|
18
|
+
import "../chunk-OCWASWDK.js";
|
|
19
|
+
import "../chunk-AGAXO3NW.js";
|
|
20
|
+
import "../chunk-3LDWV3SJ.js";
|
|
21
|
+
import "../chunk-RFYZGBU4.js";
|
|
18
22
|
import "../chunk-FQWPBBPB.js";
|
|
23
|
+
import "../chunk-CCVKLLIO.js";
|
|
24
|
+
import "../chunk-UZ6YMQV2.js";
|
|
19
25
|
import "../chunk-K2H37TUR.js";
|
|
20
|
-
import "../chunk-2OMVVDBU.js";
|
|
21
26
|
import "../chunk-UTXWRAEE.js";
|
|
22
27
|
export {
|
|
23
28
|
createCoreStackNavigator
|