@applicaster/quick-brick-core 12.0.0-alpha.3977160850 → 12.0.0-alpha.4433422595
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 +1 -3
- package/App/AssetCache/__tests__/assetCache.test.ts +1 -1
- package/App/AssetCache/index.ts +9 -2
- package/App/DeepLinking/URLSchemeHandler/__tests__/URLSchemeHandler.test.tsx +3 -1
- package/App/NavigationProvider/NavigationProvider.tsx +7 -6
- package/App/RouteManager/__tests__/__snapshots__/routeManager.test.js.snap +15 -8
- package/App/RouteManager/__tests__/routeManager.test.js +18 -7
- package/App/RouteManager/index.tsx +3 -2
- package/package.json +8 -8
|
@@ -91,9 +91,7 @@ const getActionInitialStateSetters = (key) => {
|
|
|
91
91
|
const now = performance.now();
|
|
92
92
|
|
|
93
93
|
logger.info({
|
|
94
|
-
message: `Invocation Started - action plugin ${key}, pluginId: ${
|
|
95
|
-
subscription.pluginId
|
|
96
|
-
}`,
|
|
94
|
+
message: `Invocation Started - action plugin ${key}, pluginId: ${subscription.pluginId}`,
|
|
97
95
|
});
|
|
98
96
|
|
|
99
97
|
const promiseFunc = subscription[key];
|
package/App/AssetCache/index.ts
CHANGED
|
@@ -143,7 +143,12 @@ export async function cacheAssets({
|
|
|
143
143
|
|
|
144
144
|
newCacheState.forEach(({ file, url }) => (urlFileMap[url] = file));
|
|
145
145
|
|
|
146
|
-
const updatedLayout = remapAssetPath(
|
|
146
|
+
const updatedLayout = remapAssetPath(
|
|
147
|
+
layoutAssets,
|
|
148
|
+
layout,
|
|
149
|
+
urlFileMap,
|
|
150
|
+
"layoutAssets"
|
|
151
|
+
);
|
|
147
152
|
|
|
148
153
|
const updatedPluginConfigurations = remapAssetPath(
|
|
149
154
|
pluginAssets,
|
|
@@ -169,6 +174,8 @@ export async function cacheAssets({
|
|
|
169
174
|
|
|
170
175
|
return { layout, pluginConfigurations, cellStyles };
|
|
171
176
|
} finally {
|
|
172
|
-
log_verbose(
|
|
177
|
+
log_verbose(
|
|
178
|
+
`cacheAssets: caching assets took ${performance.now() - time} ms`
|
|
179
|
+
);
|
|
173
180
|
}
|
|
174
181
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { render, waitFor
|
|
2
|
+
import { cleanup, render, waitFor } from "@testing-library/react-native";
|
|
3
3
|
|
|
4
4
|
const theme = {
|
|
5
5
|
screen_margin_top: 0,
|
|
@@ -8,6 +8,8 @@ const theme = {
|
|
|
8
8
|
|
|
9
9
|
const plugins = [];
|
|
10
10
|
|
|
11
|
+
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation");
|
|
12
|
+
|
|
11
13
|
jest.mock("@applicaster/zapp-react-native-utils/theme", () => ({
|
|
12
14
|
useTheme: jest.fn(() => theme),
|
|
13
15
|
}));
|
|
@@ -167,7 +167,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
167
167
|
[rivers, homeRiver]
|
|
168
168
|
);
|
|
169
169
|
|
|
170
|
-
const getStack = () => [...
|
|
170
|
+
const getStack = () => [...state?.stack?.mainStack];
|
|
171
171
|
|
|
172
172
|
const openVideoModal = (
|
|
173
173
|
item: ZappEntry,
|
|
@@ -665,15 +665,15 @@ export function NavigationProvider({ children }: Props) {
|
|
|
665
665
|
|
|
666
666
|
// It will only work for the regular stack and pathname, It won't work for modals
|
|
667
667
|
// TODO: integrate video/hook and regular modal into stack.
|
|
668
|
-
const getStackForPathname =
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
const stack =
|
|
668
|
+
const getStackForPathname = (
|
|
669
|
+
pathname: string
|
|
670
|
+
): NavigationScreenState | undefined => {
|
|
671
|
+
const stack = [...state?.stack?.mainStack];
|
|
672
672
|
|
|
673
673
|
const currentStack = stack.find(({ route }) => route === pathname);
|
|
674
674
|
|
|
675
675
|
return currentStack;
|
|
676
|
-
}
|
|
676
|
+
};
|
|
677
677
|
|
|
678
678
|
const navigator: QuickBrickAppNavigator = React.useMemo(
|
|
679
679
|
() => ({
|
|
@@ -717,6 +717,7 @@ export function NavigationProvider({ children }: Props) {
|
|
|
717
717
|
replaceTop,
|
|
718
718
|
getStack,
|
|
719
719
|
getStackForPathname,
|
|
720
|
+
mainStack: state.stack.mainStack,
|
|
720
721
|
}),
|
|
721
722
|
[rivers, plugins, JSON.stringify(state), appLaunched, startUpHooks]
|
|
722
723
|
);
|
|
@@ -1,13 +1,20 @@
|
|
|
1
1
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
2
|
|
|
3
3
|
exports[`<RouteManager /> renders correctly 1`] = `
|
|
4
|
-
<
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
<RNCSafeAreaProvider
|
|
5
|
+
onInsetsChange={[Function]}
|
|
6
|
+
style={
|
|
7
|
+
Array [
|
|
8
|
+
Object {
|
|
9
|
+
"flex": 1,
|
|
10
|
+
},
|
|
11
|
+
undefined,
|
|
12
|
+
]
|
|
9
13
|
}
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
14
|
+
>
|
|
15
|
+
<View
|
|
16
|
+
comp="river"
|
|
17
|
+
testID="river"
|
|
18
|
+
/>
|
|
19
|
+
</RNCSafeAreaProvider>
|
|
13
20
|
`;
|
|
@@ -1,31 +1,42 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { shallow } from "enzyme";
|
|
3
|
-
import { shallowToJson } from "enzyme-to-json";
|
|
4
2
|
|
|
5
|
-
|
|
3
|
+
const {
|
|
4
|
+
ScreenResolver,
|
|
5
|
+
} = require("@applicaster/zapp-react-native-ui-components/Components/ScreenResolver");
|
|
6
|
+
|
|
7
|
+
import { renderWithProviders } from "@applicaster/zapp-react-native-utils/testUtils";
|
|
6
8
|
|
|
7
9
|
jest.mock("@applicaster/zapp-react-native-utils/reactHooks/navigation", () => ({
|
|
8
10
|
useNavigation: jest.fn(() => ({
|
|
9
11
|
screenId: { id: "A1234" },
|
|
10
12
|
currentRoute: "/river/A1234",
|
|
11
13
|
screenData: { id: "A1234" },
|
|
14
|
+
videoModalState: { mode: "WINDOWED" },
|
|
15
|
+
})),
|
|
16
|
+
useRoute: jest.fn(() => ({
|
|
17
|
+
pathname: "/river/A1234",
|
|
18
|
+
screenData: { id: "A1234-screenData" },
|
|
12
19
|
})),
|
|
13
20
|
}));
|
|
14
21
|
|
|
15
22
|
const { RouteManager } = require("../");
|
|
16
23
|
|
|
17
24
|
describe("<RouteManager />", () => {
|
|
18
|
-
|
|
25
|
+
let wrapper;
|
|
26
|
+
|
|
27
|
+
beforeEach(() => {
|
|
28
|
+
wrapper = renderWithProviders(<RouteManager />);
|
|
29
|
+
});
|
|
19
30
|
|
|
20
31
|
it("renders correctly", () => {
|
|
21
|
-
expect(
|
|
32
|
+
expect(wrapper.toJSON()).toMatchSnapshot();
|
|
22
33
|
});
|
|
23
34
|
|
|
24
35
|
it("passes the correct props to ScreenResolver", () => {
|
|
25
|
-
expect(wrapper.
|
|
36
|
+
expect(wrapper.UNSAFE_getByType(ScreenResolver).props).toEqual({
|
|
26
37
|
screenType: "river",
|
|
27
38
|
screenId: "A1234",
|
|
28
|
-
screenData: { id: "A1234" },
|
|
39
|
+
screenData: { id: "A1234-screenData" },
|
|
29
40
|
});
|
|
30
41
|
});
|
|
31
42
|
});
|
|
@@ -4,7 +4,7 @@ import * as R from "ramda";
|
|
|
4
4
|
import { getPathAttributes } from "@applicaster/zapp-react-native-utils/navigationUtils";
|
|
5
5
|
import { ScreenResolver } from "@applicaster/zapp-react-native-ui-components/Components/ScreenResolver";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useRoute } from "@applicaster/zapp-react-native-utils/reactHooks/navigation";
|
|
8
8
|
|
|
9
9
|
type Props = any;
|
|
10
10
|
|
|
@@ -14,7 +14,8 @@ type Props = any;
|
|
|
14
14
|
* @param {Props}: see props above
|
|
15
15
|
*/
|
|
16
16
|
export const RouteManager = React.memo(function RouteManager(props: Props) {
|
|
17
|
-
const {
|
|
17
|
+
const { pathname, screenData } = useRoute();
|
|
18
|
+
|
|
18
19
|
const pathAttributes = getPathAttributes({ pathname });
|
|
19
20
|
|
|
20
21
|
if (!pathAttributes.length) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/quick-brick-core",
|
|
3
|
-
"version": "12.0.0-alpha.
|
|
3
|
+
"version": "12.0.0-alpha.4433422595",
|
|
4
4
|
"description": "Core package for Applicaster's Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -30,13 +30,13 @@
|
|
|
30
30
|
},
|
|
31
31
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@applicaster/applicaster-types": "12.0.0-alpha.
|
|
34
|
-
"@applicaster/quick-brick-core-plugins": "12.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-pipes-v2-client": "12.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.
|
|
38
|
-
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.
|
|
39
|
-
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.
|
|
33
|
+
"@applicaster/applicaster-types": "12.0.0-alpha.4433422595",
|
|
34
|
+
"@applicaster/quick-brick-core-plugins": "12.0.0-alpha.4433422595",
|
|
35
|
+
"@applicaster/zapp-pipes-v2-client": "12.0.0-alpha.4433422595",
|
|
36
|
+
"@applicaster/zapp-react-native-bridge": "12.0.0-alpha.4433422595",
|
|
37
|
+
"@applicaster/zapp-react-native-redux": "12.0.0-alpha.4433422595",
|
|
38
|
+
"@applicaster/zapp-react-native-ui-components": "12.0.0-alpha.4433422595",
|
|
39
|
+
"@applicaster/zapp-react-native-utils": "12.0.0-alpha.4433422595",
|
|
40
40
|
"atob": "^2.1.2",
|
|
41
41
|
"axios": "^0.28.0",
|
|
42
42
|
"btoa": "^1.2.1",
|