@applicaster/zapp-react-native-ui-components 15.0.0-rc.3 → 15.0.0-rc.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/Components/GeneralContentScreen/utils/useCurationAPI.ts +9 -11
- package/Components/ScreenResolver/index.tsx +8 -2
- package/Components/ZappFrameworkComponents/BarView/BarView.tsx +4 -6
- package/Components/ZappFrameworkComponents/BarView/__tests__/BarView.test.tsx +2 -2
- package/Decorators/RiverFeedLoader/utils/getDatasourceUrl.ts +6 -10
- package/package.json +5 -5
|
@@ -142,17 +142,15 @@ export const useCurationAPI = (
|
|
|
142
142
|
const url = path(SOURCE_PATH, component);
|
|
143
143
|
const mapping = path(MAPPING_PATH, component);
|
|
144
144
|
|
|
145
|
-
map[component.id] =
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
})
|
|
155
|
-
: url;
|
|
145
|
+
map[component.id] = getInflatedDataSourceUrl({
|
|
146
|
+
source: url,
|
|
147
|
+
contexts: {
|
|
148
|
+
entry: entryContext,
|
|
149
|
+
screen: screenContext,
|
|
150
|
+
search: getSearchContext(searchContext, mapping),
|
|
151
|
+
},
|
|
152
|
+
mapping,
|
|
153
|
+
});
|
|
156
154
|
});
|
|
157
155
|
|
|
158
156
|
return map;
|
|
@@ -16,6 +16,7 @@ import { useNavigation } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
|
16
16
|
import { useScreenAnalytics } from "@applicaster/zapp-react-native-utils/analyticsUtils/helpers/hooks";
|
|
17
17
|
|
|
18
18
|
import { useCallbackActions } from "@applicaster/zapp-react-native-utils/zappFrameworkUtils/HookCallback/useCallbackActions";
|
|
19
|
+
import { ScreenResultCallback } from "@applicaster/zapp-react-native-utils/zappFrameworkUtils/HookCallback/callbackNavigationAction";
|
|
19
20
|
|
|
20
21
|
const logger = componentsLogger.addSubsystem("ScreenResolver");
|
|
21
22
|
|
|
@@ -26,6 +27,7 @@ type Props = {
|
|
|
26
27
|
feedId?: string;
|
|
27
28
|
feedTitle?: string;
|
|
28
29
|
focused?: boolean;
|
|
30
|
+
resultCallback?: ScreenResultCallback;
|
|
29
31
|
parentFocus?: {
|
|
30
32
|
nextFocusDown?: React.Ref<any>;
|
|
31
33
|
nextFocusRight?: React.Ref<any>;
|
|
@@ -61,13 +63,17 @@ export function ScreenResolverComponent(props: Props) {
|
|
|
61
63
|
|
|
62
64
|
React.useEffect(() => {
|
|
63
65
|
setScreenContext(rivers[screenId]);
|
|
64
|
-
}, [screenId]);
|
|
66
|
+
}, [rivers, screenId, setScreenContext]);
|
|
65
67
|
|
|
66
|
-
const
|
|
68
|
+
const parentCallback = props.resultCallback;
|
|
69
|
+
|
|
70
|
+
const screenAction = useCallbackActions(
|
|
67
71
|
hookPlugin || screenData,
|
|
68
72
|
screenData.callback
|
|
69
73
|
);
|
|
70
74
|
|
|
75
|
+
const callbackAction = parentCallback || screenAction;
|
|
76
|
+
|
|
71
77
|
const ScreenPlugin =
|
|
72
78
|
findPluginByType(screenType, plugins, { skipWarning: true }) ||
|
|
73
79
|
findPluginByIdentifier(screenType, plugins) ||
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { StyleSheet } from "react-native";
|
|
3
|
-
import { SafeAreaView } from "react-native-safe-area-context";
|
|
2
|
+
import { StyleSheet, View } from "react-native";
|
|
4
3
|
|
|
5
4
|
import { useIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
|
|
6
5
|
import CloseButton from "./Buttons/CloseButton";
|
|
@@ -45,15 +44,14 @@ const BarView = ({ screenStyles, barState = defaultState }: Props) => {
|
|
|
45
44
|
);
|
|
46
45
|
|
|
47
46
|
return (
|
|
48
|
-
<
|
|
49
|
-
edges={["top", "left", "right"]}
|
|
47
|
+
<View
|
|
50
48
|
style={[style.view, isRTL ? style.rtlStyle : {}]}
|
|
51
|
-
testID="BarView-
|
|
49
|
+
testID="BarView-Container"
|
|
52
50
|
>
|
|
53
51
|
{backButton}
|
|
54
52
|
<BarTitle title={barState.title} screenStyles={screenStyles} />
|
|
55
53
|
{closeButton}
|
|
56
|
-
</
|
|
54
|
+
</View>
|
|
57
55
|
);
|
|
58
56
|
};
|
|
59
57
|
|
|
@@ -46,7 +46,7 @@ describe("BarView", () => {
|
|
|
46
46
|
<BarView screenStyles={screenStyles} barState={barState} />
|
|
47
47
|
);
|
|
48
48
|
|
|
49
|
-
expect(getByTestId("BarView-
|
|
49
|
+
expect(getByTestId("BarView-Container").props.style).toContainEqual({
|
|
50
50
|
transform: [{ scaleX: -1 }],
|
|
51
51
|
});
|
|
52
52
|
});
|
|
@@ -58,7 +58,7 @@ describe("BarView", () => {
|
|
|
58
58
|
<BarView screenStyles={screenStyles} barState={barState} />
|
|
59
59
|
);
|
|
60
60
|
|
|
61
|
-
expect(getByTestId("BarView-
|
|
61
|
+
expect(getByTestId("BarView-Container").props.style).not.toContainEqual({
|
|
62
62
|
transform: [{ scaleX: -1 }],
|
|
63
63
|
});
|
|
64
64
|
});
|
|
@@ -24,16 +24,12 @@ export const getDatasourceUrl: (
|
|
|
24
24
|
) => {
|
|
25
25
|
const { source, mapping } = R.propOr({}, ["data"], component);
|
|
26
26
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
};
|
|
27
|
+
const contexts = {
|
|
28
|
+
entry: entryContext,
|
|
29
|
+
screen: screenContext || screenData,
|
|
30
|
+
search: getSearchContext(searchContext, mapping),
|
|
31
|
+
};
|
|
33
32
|
|
|
34
|
-
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return source;
|
|
33
|
+
return getInflatedDataSourceUrl({ source, mapping, contexts });
|
|
38
34
|
}
|
|
39
35
|
);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "15.0.0-rc.
|
|
3
|
+
"version": "15.0.0-rc.4",
|
|
4
4
|
"description": "Applicaster Zapp React Native ui components for the Quick Brick App",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"homepage": "https://github.com/applicaster/quickbrick#readme",
|
|
30
30
|
"dependencies": {
|
|
31
|
-
"@applicaster/applicaster-types": "15.0.0-rc.
|
|
32
|
-
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.
|
|
33
|
-
"@applicaster/zapp-react-native-redux": "15.0.0-rc.
|
|
34
|
-
"@applicaster/zapp-react-native-utils": "15.0.0-rc.
|
|
31
|
+
"@applicaster/applicaster-types": "15.0.0-rc.4",
|
|
32
|
+
"@applicaster/zapp-react-native-bridge": "15.0.0-rc.4",
|
|
33
|
+
"@applicaster/zapp-react-native-redux": "15.0.0-rc.4",
|
|
34
|
+
"@applicaster/zapp-react-native-utils": "15.0.0-rc.4",
|
|
35
35
|
"promise": "^8.3.0",
|
|
36
36
|
"url": "^0.11.0",
|
|
37
37
|
"uuid": "^3.3.2"
|