@applicaster/zapp-react-native-ui-components 14.0.0-alpha.1054425138 → 14.0.0-alpha.2847632144
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/AudioPlayer/Artwork.tsx +17 -12
- package/Components/AudioPlayer/AudioPlayer.tsx +2 -0
- package/Components/AudioPlayer/AudioPlayerLayout.tsx +3 -2
- package/Components/AudioPlayer/__tests__/__snapshots__/artWork.test.js.snap +9 -4
- package/Components/MasterCell/utils/behaviorProvider.ts +10 -65
- package/Components/MasterCell/utils/index.ts +3 -13
- package/Components/PlayerContainer/PlayerContainer.tsx +20 -37
- package/Decorators/RiverFeedLoader/index.tsx +2 -8
- package/Decorators/RiverFeedLoader/utils/index.ts +2 -7
- package/Decorators/ZappPipesDataConnector/index.tsx +2 -21
- package/package.json +5 -5
|
@@ -1,5 +1,16 @@
|
|
|
1
1
|
import React from "react";
|
|
2
|
-
import { View, Image } from "react-native";
|
|
2
|
+
import { View, Image, StyleSheet } from "react-native";
|
|
3
|
+
import { toNumberWithDefaultZero } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
4
|
+
|
|
5
|
+
const styles = StyleSheet.create({
|
|
6
|
+
container: {
|
|
7
|
+
marginHorizontal: 24,
|
|
8
|
+
},
|
|
9
|
+
image: {
|
|
10
|
+
width: 400,
|
|
11
|
+
height: 400,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
3
14
|
|
|
4
15
|
type Props = {
|
|
5
16
|
srcImage: string;
|
|
@@ -9,25 +20,19 @@ type Props = {
|
|
|
9
20
|
backgroundColor: string;
|
|
10
21
|
backgroundImage: string;
|
|
11
22
|
isRTL: boolean;
|
|
23
|
+
artworkBorderRadius: Option<number>;
|
|
12
24
|
};
|
|
13
25
|
};
|
|
14
26
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
const imageStyles = {
|
|
20
|
-
width: 400,
|
|
21
|
-
height: 400,
|
|
22
|
-
};
|
|
27
|
+
export function Artwork({ srcImage, config }: Props) {
|
|
28
|
+
const borderRadius = toNumberWithDefaultZero(config.artworkBorderRadius);
|
|
23
29
|
|
|
24
|
-
export function Artwork({ srcImage }: Props) {
|
|
25
30
|
return (
|
|
26
|
-
<View style={
|
|
31
|
+
<View style={styles.container}>
|
|
27
32
|
<Image
|
|
28
33
|
fadeDuration={0}
|
|
29
34
|
source={{ uri: srcImage }}
|
|
30
|
-
style={
|
|
35
|
+
style={[styles.image, { borderRadius }]}
|
|
31
36
|
resizeMode="cover"
|
|
32
37
|
/>
|
|
33
38
|
</View>
|
|
@@ -72,6 +72,7 @@ export function AudioPlayer(props: Props) {
|
|
|
72
72
|
const artworkAspectRatio = getProp("audio_player_artwork_aspect_ratio");
|
|
73
73
|
const channelIcon = getProp("audio_player_channel_icon");
|
|
74
74
|
const rtlFlag = getProp("audio_player_rtl");
|
|
75
|
+
const artworkBorderRadius = getProp("audio_player_artwork_border_radius");
|
|
75
76
|
|
|
76
77
|
const audioPlayerBackgroundImageDefaultColor = getProp(
|
|
77
78
|
"audio_player_background_image_default_color"
|
|
@@ -154,6 +155,7 @@ export function AudioPlayer(props: Props) {
|
|
|
154
155
|
artworkAspectRatio,
|
|
155
156
|
channelIcon,
|
|
156
157
|
audioPlayerBackgroundImageDefaultColor,
|
|
158
|
+
artworkBorderRadius,
|
|
157
159
|
};
|
|
158
160
|
}, [getProp]);
|
|
159
161
|
|
|
@@ -14,6 +14,7 @@ type Props = {
|
|
|
14
14
|
backgroundColor: string;
|
|
15
15
|
backgroundImage: string;
|
|
16
16
|
isRTL: boolean;
|
|
17
|
+
artworkBorderRadius: Option<number>;
|
|
17
18
|
};
|
|
18
19
|
children: React.ReactNode;
|
|
19
20
|
style: ViewStyle;
|
|
@@ -97,8 +98,8 @@ export function AudioPlayerLayout({ artwork, config, children, style }: Props) {
|
|
|
97
98
|
|
|
98
99
|
const backgroundImgStyles = platformSelect({
|
|
99
100
|
tvos: {
|
|
100
|
-
width:
|
|
101
|
-
height:
|
|
101
|
+
width: "100%",
|
|
102
|
+
height: "100%",
|
|
102
103
|
alignItems: "center",
|
|
103
104
|
justifyContent: "center",
|
|
104
105
|
},
|
|
@@ -7,48 +7,22 @@ import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerM
|
|
|
7
7
|
import { BehaviorSubject } from "rxjs";
|
|
8
8
|
import { masterCellLogger } from "../logger";
|
|
9
9
|
import get from "lodash/get";
|
|
10
|
-
import { ScreenMultiSelectProvider } from "@applicaster/zapp-react-native-bridge/ZappStorage/ScreenStateMultiSelectProvider";
|
|
11
|
-
import { ScreenSingleValueProvider } from "@applicaster/zapp-react-native-bridge/ZappStorage/ScreenSingleValueProvider";
|
|
12
|
-
import { useRoute } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
13
10
|
|
|
14
|
-
const parseContextKey = (
|
|
15
|
-
key
|
|
16
|
-
context: string = "ctx"
|
|
17
|
-
): string | null => {
|
|
18
|
-
if (!key?.startsWith(`@{${context}/`)) return null;
|
|
11
|
+
const parseContextKey = (key: string): string | null => {
|
|
12
|
+
if (!key?.startsWith("@{ctx/")) return null;
|
|
19
13
|
|
|
20
|
-
return key.substring(
|
|
14
|
+
return key.substring("@{ctx/".length, key.length - 1);
|
|
21
15
|
};
|
|
22
16
|
|
|
23
17
|
const getDataSourceProvider = (
|
|
24
|
-
behavior: Behavior
|
|
25
|
-
screenRoute: string
|
|
18
|
+
behavior: Behavior
|
|
26
19
|
): BehaviorSubject<string[] | string> | null => {
|
|
27
20
|
if (!behavior) return null;
|
|
28
21
|
|
|
29
22
|
const selection = String(behavior.current_selection);
|
|
30
|
-
const screenKey = parseContextKey(selection, "screen");
|
|
31
|
-
|
|
32
|
-
if (screenKey) {
|
|
33
|
-
if (behavior.select_mode === "multi") {
|
|
34
|
-
return ScreenMultiSelectProvider.getProvider(
|
|
35
|
-
screenKey,
|
|
36
|
-
screenRoute
|
|
37
|
-
).getObservable();
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
if (behavior.select_mode === "single") {
|
|
41
|
-
return ScreenSingleValueProvider.getProvider(
|
|
42
|
-
screenKey,
|
|
43
|
-
screenRoute
|
|
44
|
-
).getObservable();
|
|
45
|
-
}
|
|
46
|
-
}
|
|
47
|
-
|
|
48
23
|
const contextKey = parseContextKey(selection);
|
|
49
24
|
|
|
50
25
|
if (contextKey) {
|
|
51
|
-
// TODO: Add storage scope to behavior
|
|
52
26
|
if (behavior.select_mode === "multi") {
|
|
53
27
|
return StorageMultiSelectProvider.getProvider(contextKey).getObservable();
|
|
54
28
|
}
|
|
@@ -67,7 +41,6 @@ const getDataSourceProvider = (
|
|
|
67
41
|
|
|
68
42
|
export const useBehaviorUpdate = (behavior: Behavior) => {
|
|
69
43
|
const [lastUpdate, setLastUpdate] = React.useState<number | null>(null);
|
|
70
|
-
const screenRoute = useRoute()?.pathname || "";
|
|
71
44
|
const player = usePlayer();
|
|
72
45
|
|
|
73
46
|
const triggerUpdate = () => setLastUpdate(Date.now());
|
|
@@ -75,7 +48,7 @@ export const useBehaviorUpdate = (behavior: Behavior) => {
|
|
|
75
48
|
useEffect(() => {
|
|
76
49
|
if (!behavior) return;
|
|
77
50
|
|
|
78
|
-
const dataSource = getDataSourceProvider(behavior
|
|
51
|
+
const dataSource = getDataSourceProvider(behavior);
|
|
79
52
|
|
|
80
53
|
if (dataSource) {
|
|
81
54
|
const subscription = dataSource.subscribe(triggerUpdate);
|
|
@@ -99,15 +72,10 @@ export const useBehaviorUpdate = (behavior: Behavior) => {
|
|
|
99
72
|
|
|
100
73
|
// We cant use async in this function (its inside render),
|
|
101
74
|
// so we rely on useBehaviorUpdate to update current value and trigger re-render
|
|
102
|
-
export const isCellSelected = (
|
|
103
|
-
item,
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
}: {
|
|
107
|
-
item: ZappEntry;
|
|
108
|
-
screenRoute: string;
|
|
109
|
-
behavior?: Behavior;
|
|
110
|
-
}): boolean => {
|
|
75
|
+
export const isCellSelected = (
|
|
76
|
+
item: ZappEntry,
|
|
77
|
+
behavior?: Behavior
|
|
78
|
+
): boolean => {
|
|
111
79
|
if (!behavior) return false;
|
|
112
80
|
|
|
113
81
|
const id = behavior.selector ? get(item, behavior.selector) : item.id;
|
|
@@ -131,30 +99,7 @@ export const isCellSelected = ({
|
|
|
131
99
|
}
|
|
132
100
|
|
|
133
101
|
const selection = String(behavior.current_selection);
|
|
134
|
-
|
|
135
|
-
const screenKey = parseContextKey(selection, "screen");
|
|
136
|
-
|
|
137
|
-
if (screenKey) {
|
|
138
|
-
if (behavior.select_mode === "single") {
|
|
139
|
-
const selectedItem = ScreenSingleValueProvider.getProvider(
|
|
140
|
-
screenKey,
|
|
141
|
-
screenRoute
|
|
142
|
-
).getValue();
|
|
143
|
-
|
|
144
|
-
return selectedItem === String(id);
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (behavior.select_mode === "multi") {
|
|
148
|
-
const selectedItems = ScreenMultiSelectProvider.getProvider(
|
|
149
|
-
screenKey,
|
|
150
|
-
screenRoute
|
|
151
|
-
).getSelectedItems();
|
|
152
|
-
|
|
153
|
-
return selectedItems?.includes(String(id));
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
|
|
157
|
-
const contextKey = parseContextKey(selection, "ctx");
|
|
102
|
+
const contextKey = parseContextKey(selection);
|
|
158
103
|
|
|
159
104
|
if (contextKey) {
|
|
160
105
|
if (behavior.select_mode === "single") {
|
|
@@ -8,7 +8,6 @@ import { masterCellLogger } from "../logger";
|
|
|
8
8
|
import { getCellState } from "../../Cell/utils";
|
|
9
9
|
import { getColorFromData } from "@applicaster/zapp-react-native-utils/cellUtils";
|
|
10
10
|
import { isCellSelected, useBehaviorUpdate } from "./behaviorProvider";
|
|
11
|
-
import { useRoute } from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
12
11
|
|
|
13
12
|
const hasElementSpecificViewType = (viewType) => (element) => {
|
|
14
13
|
if (R.isNil(element)) {
|
|
@@ -191,16 +190,8 @@ export const getFocusedButtonId = (focusable) => {
|
|
|
191
190
|
});
|
|
192
191
|
};
|
|
193
192
|
|
|
194
|
-
export const isSelected = ({
|
|
195
|
-
item,
|
|
196
|
-
screenRoute,
|
|
197
|
-
behavior,
|
|
198
|
-
}: {
|
|
199
|
-
item: ZappEntry;
|
|
200
|
-
screenRoute: string;
|
|
201
|
-
behavior?: Behavior;
|
|
202
|
-
}) => {
|
|
203
|
-
return isCellSelected({ item, screenRoute, behavior });
|
|
193
|
+
export const isSelected = (item: ZappEntry, behavior?: Behavior) => {
|
|
194
|
+
return isCellSelected(item, behavior);
|
|
204
195
|
};
|
|
205
196
|
|
|
206
197
|
export const useCellState = ({
|
|
@@ -213,10 +204,9 @@ export const useCellState = ({
|
|
|
213
204
|
focused: boolean;
|
|
214
205
|
}): CellState => {
|
|
215
206
|
const lastUpdate = useBehaviorUpdate(behavior);
|
|
216
|
-
const router = useRoute();
|
|
217
207
|
|
|
218
208
|
const _isSelected = useMemo(
|
|
219
|
-
() => isSelected(
|
|
209
|
+
() => isSelected(item, behavior),
|
|
220
210
|
[behavior, item, lastUpdate]
|
|
221
211
|
);
|
|
222
212
|
|
|
@@ -6,12 +6,15 @@ import * as R from "ramda";
|
|
|
6
6
|
import uuid from "uuid/v4";
|
|
7
7
|
import { playerManager } from "@applicaster/zapp-react-native-utils/appUtils/playerManager";
|
|
8
8
|
import {
|
|
9
|
-
isApplePlatform,
|
|
10
9
|
isTV,
|
|
11
10
|
platformSelect,
|
|
12
11
|
isAndroidTVPlatform,
|
|
12
|
+
isTvOSPlatform,
|
|
13
13
|
} from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
14
|
-
import {
|
|
14
|
+
import {
|
|
15
|
+
isAudioItem,
|
|
16
|
+
isInlineTV as isInlineTVUtil,
|
|
17
|
+
} from "@applicaster/zapp-react-native-utils/playerUtils";
|
|
15
18
|
|
|
16
19
|
import { TVEventHandlerComponent } from "@applicaster/zapp-react-native-tvos-ui-components/Components/TVEventHandlerComponent";
|
|
17
20
|
import { usePrevious } from "@applicaster/zapp-react-native-utils/reactHooks/utils";
|
|
@@ -22,7 +25,7 @@ import {
|
|
|
22
25
|
} from "@applicaster/zapp-react-native-utils/reactHooks";
|
|
23
26
|
|
|
24
27
|
import { PlayerStateContext } from "../../Contexts/PlayerStateContext";
|
|
25
|
-
|
|
28
|
+
|
|
26
29
|
import {
|
|
27
30
|
QUICK_BRICK_EVENTS,
|
|
28
31
|
QuickBrickEvent,
|
|
@@ -97,6 +100,11 @@ const focusableBottomContainerId = "player-container-bottom";
|
|
|
97
100
|
|
|
98
101
|
const isAndroidTV = isAndroidTVPlatform();
|
|
99
102
|
|
|
103
|
+
const isTvOS = isTvOSPlatform();
|
|
104
|
+
|
|
105
|
+
// height for container with additional content below player
|
|
106
|
+
const INLINE_CONTAINER_CONTENT_HEIGHT = 400;
|
|
107
|
+
|
|
100
108
|
const withBorderHack = () => {
|
|
101
109
|
if (isAndroidTV) {
|
|
102
110
|
/* @HACK: see GH#7269 */
|
|
@@ -126,7 +134,7 @@ const webStyles = {
|
|
|
126
134
|
flex: "initial",
|
|
127
135
|
},
|
|
128
136
|
inlineRiver: {
|
|
129
|
-
height:
|
|
137
|
+
height: INLINE_CONTAINER_CONTENT_HEIGHT,
|
|
130
138
|
},
|
|
131
139
|
};
|
|
132
140
|
|
|
@@ -144,7 +152,7 @@ const nativeStyles = {
|
|
|
144
152
|
flex: 1,
|
|
145
153
|
},
|
|
146
154
|
inlineRiver: {
|
|
147
|
-
height:
|
|
155
|
+
height: INLINE_CONTAINER_CONTENT_HEIGHT,
|
|
148
156
|
},
|
|
149
157
|
};
|
|
150
158
|
|
|
@@ -164,12 +172,11 @@ const renderApplePlayer = ({
|
|
|
164
172
|
videoStyle,
|
|
165
173
|
playNextData,
|
|
166
174
|
}) => {
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
if (!isAppleTV() || !player) {
|
|
175
|
+
if (!isTvOS || !player) {
|
|
170
176
|
return null;
|
|
171
177
|
}
|
|
172
178
|
|
|
179
|
+
// render audio_player for tvos
|
|
173
180
|
if (isAudioContent) {
|
|
174
181
|
return (
|
|
175
182
|
<AudioPlayer
|
|
@@ -183,6 +190,8 @@ const renderApplePlayer = ({
|
|
|
183
190
|
return null;
|
|
184
191
|
}
|
|
185
192
|
|
|
193
|
+
const { title, summary } = item || {};
|
|
194
|
+
|
|
186
195
|
return (
|
|
187
196
|
<ProgramInfo
|
|
188
197
|
title={title}
|
|
@@ -193,21 +202,6 @@ const renderApplePlayer = ({
|
|
|
193
202
|
);
|
|
194
203
|
};
|
|
195
204
|
|
|
196
|
-
const renderRestPlayers = ({ item, showAudioPlayer, pluginConfiguration }) => {
|
|
197
|
-
if (isApplePlatform()) {
|
|
198
|
-
return null;
|
|
199
|
-
}
|
|
200
|
-
|
|
201
|
-
return (
|
|
202
|
-
showAudioPlayer && (
|
|
203
|
-
<AudioPlayer
|
|
204
|
-
audio_item={item}
|
|
205
|
-
plugin_configuration={pluginConfiguration}
|
|
206
|
-
/>
|
|
207
|
-
)
|
|
208
|
-
);
|
|
209
|
-
};
|
|
210
|
-
|
|
211
205
|
const PlayerContainerComponent = (props: Props) => {
|
|
212
206
|
const {
|
|
213
207
|
Player,
|
|
@@ -337,7 +331,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
337
331
|
|
|
338
332
|
setState({ error: errorObj });
|
|
339
333
|
|
|
340
|
-
if (!
|
|
334
|
+
if (!isTvOS) {
|
|
341
335
|
setTimeout(() => {
|
|
342
336
|
close();
|
|
343
337
|
}, 800);
|
|
@@ -568,10 +562,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
568
562
|
|
|
569
563
|
const uri = item?.content ? item.content?.src : null;
|
|
570
564
|
|
|
571
|
-
const isInlineTV =
|
|
572
|
-
screenData?.ui_components &&
|
|
573
|
-
screenData?.ui_components?.length > 0 &&
|
|
574
|
-
isTV();
|
|
565
|
+
const isInlineTV = isInlineTVUtil(screenData);
|
|
575
566
|
|
|
576
567
|
const inline =
|
|
577
568
|
[VideoModalMode.MAXIMIZED, VideoModalMode.MINIMIZED].includes(mode) ||
|
|
@@ -626,12 +617,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
626
617
|
playNextData,
|
|
627
618
|
};
|
|
628
619
|
|
|
629
|
-
const restPlayerProps = {
|
|
630
|
-
item,
|
|
631
|
-
showAudioPlayer: isAudioContent,
|
|
632
|
-
pluginConfiguration,
|
|
633
|
-
};
|
|
634
|
-
|
|
635
620
|
return (
|
|
636
621
|
<PlayerStateContext.Provider value={value}>
|
|
637
622
|
<PlayerContainerContextProvider
|
|
@@ -707,8 +692,6 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
707
692
|
</Player>
|
|
708
693
|
</PlayerFocusableWrapperView>
|
|
709
694
|
|
|
710
|
-
{renderRestPlayers(restPlayerProps)}
|
|
711
|
-
|
|
712
695
|
{state.error ? <ErrorDisplay error={state.error} /> : null}
|
|
713
696
|
</View>
|
|
714
697
|
{/* Components container */}
|
|
@@ -732,7 +715,7 @@ const PlayerContainerComponent = (props: Props) => {
|
|
|
732
715
|
screenId={screenData.id}
|
|
733
716
|
key={item.id}
|
|
734
717
|
groupId={FocusableGroupMainContainerId}
|
|
735
|
-
cellTapAction={
|
|
718
|
+
cellTapAction={onCellTap}
|
|
736
719
|
extraAnchorPointYOffset={-600}
|
|
737
720
|
isScreenWrappedInContainer={true}
|
|
738
721
|
containerHeight={styles.inlineRiver.height}
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
loadDatasources,
|
|
14
14
|
usePipesContexts,
|
|
15
15
|
} from "./utils";
|
|
16
|
-
import { useScreenResolvers } from "../ZappPipesDataConnector";
|
|
17
16
|
|
|
18
17
|
type RiverProps = {
|
|
19
18
|
dispatch: DispatchProp;
|
|
@@ -26,7 +25,7 @@ export function WithRiverFeedLoader(Component: ZappComponent) {
|
|
|
26
25
|
return function WrappedWithRiverFeedLoader(props: RiverProps) {
|
|
27
26
|
const { river } = props;
|
|
28
27
|
const { screenData, pathname } = useRoute();
|
|
29
|
-
|
|
28
|
+
|
|
30
29
|
const pipesContexts = usePipesContexts(river.id, pathname);
|
|
31
30
|
|
|
32
31
|
const componentsToLoad = ignoreComponentsWithClearCacheFlag(
|
|
@@ -50,12 +49,7 @@ export function WithRiverFeedLoader(Component: ZappComponent) {
|
|
|
50
49
|
item?.filter((item2) => item2 !== undefined)
|
|
51
50
|
);
|
|
52
51
|
|
|
53
|
-
loadDatasources(
|
|
54
|
-
nonEmptyDataSources,
|
|
55
|
-
river?.id,
|
|
56
|
-
props.dispatch,
|
|
57
|
-
resolvers
|
|
58
|
-
);
|
|
52
|
+
loadDatasources(nonEmptyDataSources, river?.id, props.dispatch);
|
|
59
53
|
}, []);
|
|
60
54
|
|
|
61
55
|
return <Component {...props} />;
|
|
@@ -12,16 +12,11 @@ export { getDatasourceUrl } from "./getDatasourceUrl";
|
|
|
12
12
|
|
|
13
13
|
export const DATASOURCE_CHUNKS = 10;
|
|
14
14
|
|
|
15
|
-
export async function loadDatasources(
|
|
16
|
-
urls: string[][],
|
|
17
|
-
riverId,
|
|
18
|
-
dispatch,
|
|
19
|
-
resolvers
|
|
20
|
-
) {
|
|
15
|
+
export async function loadDatasources(urls: string[][], riverId, dispatch) {
|
|
21
16
|
return reducePromises<string, void>(
|
|
22
17
|
mapPromises<string, void>((url) => {
|
|
23
18
|
if (url) {
|
|
24
|
-
return dispatch(loadPipesData(url, { riverId
|
|
19
|
+
return dispatch(loadPipesData(url, { riverId }));
|
|
25
20
|
}
|
|
26
21
|
}),
|
|
27
22
|
undefined,
|
|
@@ -19,11 +19,7 @@ import { ZappPipesSearchContext } from "@applicaster/zapp-react-native-ui-compon
|
|
|
19
19
|
import { useScreenContext } from "@applicaster/zapp-react-native-utils/reactHooks/screen/useScreenContext";
|
|
20
20
|
|
|
21
21
|
import { isVerticalListOrGrid } from "./utils";
|
|
22
|
-
import {
|
|
23
|
-
subscribeForUrlContextKeyChanges,
|
|
24
|
-
subscribeForUrlScreenKeyChanges,
|
|
25
|
-
} from "@applicaster/zapp-pipes-v2-client";
|
|
26
|
-
import { ScreenStateResolver } from "@applicaster/zapp-react-native-utils/appUtils/contextKeysManager/contextResolver";
|
|
22
|
+
import { subscribeForUrlContextKeyChanges } from "@applicaster/zapp-pipes-v2-client";
|
|
27
23
|
|
|
28
24
|
type Props = {
|
|
29
25
|
component: ZappUIComponent;
|
|
@@ -204,15 +200,11 @@ const useGetStaticFeed = (getter, component, index) => {
|
|
|
204
200
|
return { url, loading, data, error };
|
|
205
201
|
};
|
|
206
202
|
|
|
207
|
-
export const useScreenResolvers = (screenRoute: string) => {
|
|
208
|
-
return { screen: new ScreenStateResolver(screenRoute) };
|
|
209
|
-
};
|
|
210
|
-
|
|
211
203
|
export function zappPipesDataConnector(
|
|
212
204
|
Component: React.FC<any> | React.ComponentClass<any>
|
|
213
205
|
) {
|
|
214
206
|
return function WrappedWithZappPipesData(props: Props) {
|
|
215
|
-
const { screenData
|
|
207
|
+
const { screenData } = useRoute();
|
|
216
208
|
const { plugins } = usePickFromState(["plugins"]);
|
|
217
209
|
|
|
218
210
|
const screenContextData = useScreenContext();
|
|
@@ -294,17 +286,6 @@ export function zappPipesDataConnector(
|
|
|
294
286
|
componentIndex
|
|
295
287
|
);
|
|
296
288
|
|
|
297
|
-
useEffect(() => {
|
|
298
|
-
if (!(dataSourceUrl?.includes("pipesv2://") && reloadData)) {
|
|
299
|
-
return subscribeForUrlScreenKeyChanges(
|
|
300
|
-
dataSourceUrl,
|
|
301
|
-
pathname,
|
|
302
|
-
{},
|
|
303
|
-
reloadData
|
|
304
|
-
);
|
|
305
|
-
}
|
|
306
|
-
}, [dataSourceUrl, reloadData]);
|
|
307
|
-
|
|
308
289
|
useEffect(() => {
|
|
309
290
|
if (dataSourceUrl?.includes("pipesv2://") && reloadData) {
|
|
310
291
|
const addListener = getListenerFromPlugin(dataSourceUrl, plugins);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.2847632144",
|
|
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",
|
|
@@ -31,10 +31,10 @@
|
|
|
31
31
|
"redux-mock-store": "^1.5.3"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"@applicaster/applicaster-types": "14.0.0-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "14.0.0-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "14.0.0-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.
|
|
34
|
+
"@applicaster/applicaster-types": "14.0.0-alpha.2847632144",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "14.0.0-alpha.2847632144",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "14.0.0-alpha.2847632144",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "14.0.0-alpha.2847632144",
|
|
38
38
|
"promise": "^8.3.0",
|
|
39
39
|
"url": "^0.11.0",
|
|
40
40
|
"uuid": "^3.3.2"
|