@applicaster/quick-brick-core 15.0.0-rc.5 → 15.0.0-rc.50
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/App/ActionSetters/index.ts +5 -4
- package/App/ActionsProvider/ActionsProvider.tsx +6 -1
- package/App/DeepLinking/URLSchemeHandler/SchemeHandlerHooks/__tests__/useOpenSchemeHandler.test.tsx +12 -27
- package/App/DeepLinking/URLSchemeHandler/SchemeHandlerHooks/__tests__/useUrlSchemeHandler.test.tsx +196 -103
- package/App/DeepLinking/URLSchemeHandler/SchemeHandlerHooks/useOpenSchemeHandler/index.ts +4 -7
- package/App/DeepLinking/URLSchemeHandler/SchemeHandlerHooks/useUrlSchemeHandler.ts +42 -30
- package/App/DeepLinking/URLSchemeHandler/URLSchemeHandler.tsx +4 -1
- package/App/DeepLinking/URLSchemeHandler/__tests__/URLSchemeHandler.test.tsx +20 -13
- package/App/DeepLinking/URLSchemeListener/index.tsx +3 -4
- package/App/ModalProvider/ModalBottomSheet/ModalBottomSheetFrame.tsx +6 -1
- package/App/NavigationProvider/Loader.tsx +3 -4
- package/App/NavigationProvider/NavigationProvider.tsx +21 -35
- package/App/NavigationProvider/ScreenHooks/usePluginScreenHooks.ts +2 -2
- package/App/NavigationProvider/__tests__/navigationProvider.test.tsx +141 -152
- package/App/NavigationProvider/navigator/selectors.ts +21 -5
- package/App/NetworkStatusProvider/NetworkStatusProvider.tsx +2 -2
- package/App/components/ZappAppWrapper.web.ts +2 -2
- package/App/remoteContextReloader/getRemoteContextData/getNativeRemoteContextData.ts +1 -1
- package/App/remoteContextReloader/helpers.ts +3 -3
- package/package.json +8 -8
- package/App/DeepLinking/URLSchemeHandler/__tests__/__snapshots__/URLSchemeHandler.test.tsx.snap +0 -24
|
@@ -2,6 +2,7 @@ import * as R from "ramda";
|
|
|
2
2
|
import { createSelector } from "@reduxjs/toolkit";
|
|
3
3
|
|
|
4
4
|
import { getPathAttributes } from "@applicaster/zapp-react-native-utils/navigationUtils";
|
|
5
|
+
import { selectPluginConfigurations } from "@applicaster/zapp-react-native-redux";
|
|
5
6
|
|
|
6
7
|
const riverSelector = R.prop("rivers");
|
|
7
8
|
const pathnameSelector = R.prop("pathname");
|
|
@@ -56,11 +57,26 @@ export const previousStackEntriesSelector = createSelector(
|
|
|
56
57
|
)
|
|
57
58
|
);
|
|
58
59
|
|
|
59
|
-
export const lastEntrySelector = createSelector
|
|
60
|
-
unknown,
|
|
61
|
-
unknown,
|
|
62
|
-
NavigationScreenState
|
|
63
|
-
>(
|
|
60
|
+
export const lastEntrySelector = createSelector(
|
|
64
61
|
navigationStackSelector,
|
|
65
62
|
R.compose(R.last, R.when(R.has("mainStack"), R.prop("mainStack")))
|
|
63
|
+
) as (state: any) => any; // TODO: tighten type to NavigationScreenState
|
|
64
|
+
|
|
65
|
+
// Selector extracting identifiers of plugins requiring startup execution
|
|
66
|
+
export const startUpHookPluginIdentifiersSelector = createSelector(
|
|
67
|
+
selectPluginConfigurations,
|
|
68
|
+
(pluginConfigurations) => {
|
|
69
|
+
if (!pluginConfigurations) return [];
|
|
70
|
+
|
|
71
|
+
return Object.values(pluginConfigurations)
|
|
72
|
+
.filter(
|
|
73
|
+
(item) =>
|
|
74
|
+
item.plugin?.api &&
|
|
75
|
+
"require_startup_execution" in item.plugin.api &&
|
|
76
|
+
item.plugin.api.require_startup_execution === true &&
|
|
77
|
+
item.plugin.react_native === true &&
|
|
78
|
+
item.plugin.preload === true
|
|
79
|
+
)
|
|
80
|
+
.map((item: any) => item.plugin.identifier);
|
|
81
|
+
}
|
|
66
82
|
);
|
|
@@ -3,7 +3,7 @@ import { Platform } from "react-native";
|
|
|
3
3
|
import NetInfo, { NetInfoState } from "@react-native-community/netinfo";
|
|
4
4
|
|
|
5
5
|
import { NetworkStatusContext } from "@applicaster/zapp-react-native-ui-components/Contexts/NetworkStatusContext";
|
|
6
|
-
import {
|
|
6
|
+
import { usePlugins } from "@applicaster/zapp-react-native-redux";
|
|
7
7
|
import {
|
|
8
8
|
callAllWith,
|
|
9
9
|
getNetworkHooks,
|
|
@@ -29,7 +29,7 @@ export const NetworkStatusProvider = ({
|
|
|
29
29
|
}: {
|
|
30
30
|
children: React.ReactNode;
|
|
31
31
|
}) => {
|
|
32
|
-
const
|
|
32
|
+
const plugins = usePlugins();
|
|
33
33
|
const [deviceStatus, setDeviceStatus] = React.useState(null);
|
|
34
34
|
const currentNetInfo = NetInfo.useNetInfo();
|
|
35
35
|
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Fragment } from "react";
|
|
2
2
|
|
|
3
|
-
export const ZappAppWrapper =
|
|
3
|
+
export const ZappAppWrapper = Fragment;
|
|
@@ -74,7 +74,7 @@ export async function getNativeRemoteContextData(
|
|
|
74
74
|
);
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
const apiVersion = layout?.layout?.
|
|
77
|
+
const apiVersion = layout?.layout?.api_version; // Taken from remote configuration
|
|
78
78
|
|
|
79
79
|
dispatch(AppData.actions.merge({ layoutVersion: apiVersion || "v1" }));
|
|
80
80
|
|
|
@@ -113,15 +113,15 @@ export async function prepareRuntimeConfigurationUrls(
|
|
|
113
113
|
}
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
export async function getPromiseForType(
|
|
116
|
+
export async function getPromiseForType<T = FileResponse>(
|
|
117
117
|
key: string
|
|
118
|
-
): Promise<
|
|
118
|
+
): Promise<T | never> {
|
|
119
119
|
try {
|
|
120
120
|
const response = await AppLoaderBridge?.getFile(key, null);
|
|
121
121
|
|
|
122
122
|
return {
|
|
123
123
|
[key]: JSON.parse(response),
|
|
124
|
-
};
|
|
124
|
+
} as T;
|
|
125
125
|
} catch (e) {
|
|
126
126
|
throw new Error("cannot retrieve configuration data for " + key);
|
|
127
127
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-core",
|
|
3
|
-
"version": "15.0.0-rc.
|
|
3
|
+
"version": "15.0.0-rc.50",
|
|
4
4
|
"description": "Core package for Applicaster's Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,13 +28,13 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "15.0.0-rc.
|
|
32
|
-
"@applicaster/quick-brick-core-plugins": "15.0.0-rc.
|
|
33
|
-
"@applicaster/zapp-pipes-v2-client": "15.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.
|
|
35
|
-
"@applicaster/zapp-react-native-redux": "15.0.0-rc.
|
|
36
|
-
"@applicaster/zapp-react-native-ui-components": "15.0.0-rc.
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "15.0.0-rc.
|
|
31
|
+
"@applicaster/applicaster-types": "15.0.0-rc.50",
|
|
32
|
+
"@applicaster/quick-brick-core-plugins": "15.0.0-rc.50",
|
|
33
|
+
"@applicaster/zapp-pipes-v2-client": "15.0.0-rc.50",
|
|
34
|
+
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.50",
|
|
35
|
+
"@applicaster/zapp-react-native-redux": "15.0.0-rc.50",
|
|
36
|
+
"@applicaster/zapp-react-native-ui-components": "15.0.0-rc.50",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "15.0.0-rc.50",
|
|
38
38
|
"atob": "^2.1.2",
|
|
39
39
|
"axios": "^0.28.0",
|
|
40
40
|
"btoa": "^1.2.1",
|
package/App/DeepLinking/URLSchemeHandler/__tests__/__snapshots__/URLSchemeHandler.test.tsx.snap
DELETED
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
-
|
|
3
|
-
exports[`URLSchemeHandler renders correctly and invokes the hook 1`] = `
|
|
4
|
-
<View
|
|
5
|
-
style={
|
|
6
|
-
[
|
|
7
|
-
{
|
|
8
|
-
"alignItems": "center",
|
|
9
|
-
"flex": 1,
|
|
10
|
-
"justifyContent": "center",
|
|
11
|
-
},
|
|
12
|
-
{
|
|
13
|
-
"backgroundColor": "white",
|
|
14
|
-
"height": 1334,
|
|
15
|
-
"width": 750,
|
|
16
|
-
},
|
|
17
|
-
]
|
|
18
|
-
}
|
|
19
|
-
>
|
|
20
|
-
<ActivityIndicator
|
|
21
|
-
size="large"
|
|
22
|
-
/>
|
|
23
|
-
</View>
|
|
24
|
-
`;
|