@applicaster/zapp-react-native-ui-components 13.0.0-rc.74 → 13.0.0-rc.76
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.
|
@@ -23,7 +23,7 @@ export function FocusableCell(props: Props) {
|
|
|
23
23
|
behavior,
|
|
24
24
|
} = props;
|
|
25
25
|
|
|
26
|
-
const state = useCellState({
|
|
26
|
+
const state = useCellState({ item, behavior, focused });
|
|
27
27
|
|
|
28
28
|
React.useEffect(() => {
|
|
29
29
|
if (focused && scrollTo && !isAndroid) {
|
|
@@ -6,6 +6,7 @@ import React, { useEffect } from "react";
|
|
|
6
6
|
import { usePlayer } from "@applicaster/zapp-react-native-utils/appUtils/playerManager/usePlayer";
|
|
7
7
|
import { BehaviorSubject } from "rxjs";
|
|
8
8
|
import { masterCellLogger } from "../logger";
|
|
9
|
+
import get from "lodash/get";
|
|
9
10
|
|
|
10
11
|
const parseContextKey = (key: string): string | null => {
|
|
11
12
|
if (!key?.startsWith("@{ctx/")) return null;
|
|
@@ -72,11 +73,13 @@ export const useBehaviorUpdate = (behavior: Behavior) => {
|
|
|
72
73
|
// We cant use async in this function (its inside render),
|
|
73
74
|
// so we rely on useBehaviorUpdate to update current value and trigger re-render
|
|
74
75
|
export const isCellSelected = (
|
|
75
|
-
|
|
76
|
+
item: ZappEntry,
|
|
76
77
|
behavior?: Behavior
|
|
77
78
|
): boolean => {
|
|
78
79
|
if (!behavior) return false;
|
|
79
80
|
|
|
81
|
+
const id = behavior.selector ? get(item, behavior.selector) : item.id;
|
|
82
|
+
|
|
80
83
|
if (behavior.selection_source === "now_playing") {
|
|
81
84
|
const player = playerManager.getActivePlayer();
|
|
82
85
|
|
|
@@ -190,24 +190,24 @@ export const getFocusedButtonId = (focusable) => {
|
|
|
190
190
|
});
|
|
191
191
|
};
|
|
192
192
|
|
|
193
|
-
export const isSelected = (
|
|
194
|
-
return isCellSelected(
|
|
193
|
+
export const isSelected = (item: ZappEntry, behavior?: Behavior) => {
|
|
194
|
+
return isCellSelected(item, behavior);
|
|
195
195
|
};
|
|
196
196
|
|
|
197
197
|
export const useCellState = ({
|
|
198
|
-
|
|
198
|
+
item,
|
|
199
199
|
behavior,
|
|
200
200
|
focused,
|
|
201
201
|
}: {
|
|
202
|
-
|
|
202
|
+
item: ZappEntry;
|
|
203
203
|
behavior: Behavior;
|
|
204
204
|
focused: boolean;
|
|
205
205
|
}): CellState => {
|
|
206
206
|
const lastUpdate = useBehaviorUpdate(behavior);
|
|
207
207
|
|
|
208
208
|
const _isSelected = useMemo(
|
|
209
|
-
() => isSelected(
|
|
210
|
-
[behavior,
|
|
209
|
+
() => isSelected(item, behavior),
|
|
210
|
+
[behavior, item, lastUpdate]
|
|
211
211
|
);
|
|
212
212
|
|
|
213
213
|
return getCellState({ focused, selected: _isSelected });
|
|
@@ -230,7 +230,8 @@ export function zappPipesDataConnector(
|
|
|
230
230
|
const entryContext =
|
|
231
231
|
(shouldUseNestedContext && screenContextData?.nested?.entry
|
|
232
232
|
? screenContextData?.nested?.entry
|
|
233
|
-
: screenContextData?.entry) ||
|
|
233
|
+
: (screenContextData?.entry?.payload ?? screenContextData?.entry)) ||
|
|
234
|
+
{};
|
|
234
235
|
|
|
235
236
|
const screenContext =
|
|
236
237
|
(shouldUseNestedContext && screenContextData?.nested?.screen
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "13.0.0-rc.
|
|
3
|
+
"version": "13.0.0-rc.76",
|
|
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",
|
|
@@ -32,10 +32,10 @@
|
|
|
32
32
|
"redux-mock-store": "^1.5.3"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@applicaster/applicaster-types": "13.0.0-rc.
|
|
36
|
-
"@applicaster/zapp-react-native-bridge": "13.0.0-rc.
|
|
37
|
-
"@applicaster/zapp-react-native-redux": "13.0.0-rc.
|
|
38
|
-
"@applicaster/zapp-react-native-utils": "13.0.0-rc.
|
|
35
|
+
"@applicaster/applicaster-types": "13.0.0-rc.76",
|
|
36
|
+
"@applicaster/zapp-react-native-bridge": "13.0.0-rc.76",
|
|
37
|
+
"@applicaster/zapp-react-native-redux": "13.0.0-rc.76",
|
|
38
|
+
"@applicaster/zapp-react-native-utils": "13.0.0-rc.76",
|
|
39
39
|
"promise": "^8.3.0",
|
|
40
40
|
"react-router-native": "^5.1.2",
|
|
41
41
|
"url": "^0.11.0",
|