@applicaster/zapp-react-native-ui-components 13.0.9-alpha.1121932485 → 13.0.9-alpha.1792119437
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/Cell/Cell.tsx
CHANGED
|
@@ -8,7 +8,7 @@ import { getItemType } from "@applicaster/zapp-react-native-utils/navigationUtil
|
|
|
8
8
|
import { SCREEN_TYPES } from "@applicaster/zapp-react-native-utils/navigationUtils/itemTypes";
|
|
9
9
|
import { sendSelectCellEvent } from "@applicaster/zapp-react-native-utils/analyticsUtils";
|
|
10
10
|
import { noop } from "@applicaster/zapp-react-native-utils/functionUtils";
|
|
11
|
-
import {
|
|
11
|
+
import { CellFocusedStateContextProvider } from "@applicaster/zapp-react-native-ui-components/Contexts/CellFocusedStateContext";
|
|
12
12
|
|
|
13
13
|
import { CellWithFocusable } from "./CellWithFocusable";
|
|
14
14
|
import { BaseFocusable } from "../BaseFocusable";
|
|
@@ -256,7 +256,7 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
256
256
|
|
|
257
257
|
if (this.state.hasFocusableInside) {
|
|
258
258
|
return (
|
|
259
|
-
<
|
|
259
|
+
<CellFocusedStateContextProvider cellFocused={this.state.cellFocused}>
|
|
260
260
|
<CellWithFocusable
|
|
261
261
|
CellRenderer={CellRenderer}
|
|
262
262
|
item={item}
|
|
@@ -270,12 +270,12 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
270
270
|
skipFocusManagerRegistration={skipFocusManagerRegistration}
|
|
271
271
|
behavior={behavior}
|
|
272
272
|
/>
|
|
273
|
-
</
|
|
273
|
+
</CellFocusedStateContextProvider>
|
|
274
274
|
);
|
|
275
275
|
}
|
|
276
276
|
|
|
277
277
|
return (
|
|
278
|
-
<
|
|
278
|
+
<CellFocusedStateContextProvider cellFocused={this.state.cellFocused}>
|
|
279
279
|
<View
|
|
280
280
|
testID={`${component?.id}-${id}`}
|
|
281
281
|
accessible={false}
|
|
@@ -316,7 +316,7 @@ export class CellComponent extends React.Component<Props, State> {
|
|
|
316
316
|
}}
|
|
317
317
|
</Focusable>
|
|
318
318
|
</View>
|
|
319
|
-
</
|
|
319
|
+
</CellFocusedStateContextProvider>
|
|
320
320
|
);
|
|
321
321
|
}
|
|
322
322
|
}
|
|
@@ -11,7 +11,7 @@ import { withScaledLineHeight } from "./utils";
|
|
|
11
11
|
import { toNumber } from "@applicaster/zapp-react-native-utils/numberUtils";
|
|
12
12
|
import { MeasurementPortalContext } from "../../../MeasurmentsPortal";
|
|
13
13
|
import { isNilOrEmpty } from "@applicaster/zapp-react-native-utils/reactUtils/helpers";
|
|
14
|
-
import {
|
|
14
|
+
import { CellFocusedStateContext } from "@applicaster/zapp-react-native-ui-components/Contexts/CellFocusedStateContext";
|
|
15
15
|
import { useAccessibilityManager } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager/hooks";
|
|
16
16
|
|
|
17
17
|
type Props = {
|
|
@@ -37,7 +37,7 @@ const _Text = ({
|
|
|
37
37
|
}: Props) => {
|
|
38
38
|
const _label = useTextLabel({ label, entry });
|
|
39
39
|
const isMeasurement = React.useContext(MeasurementPortalContext);
|
|
40
|
-
const cellFocused = React.useContext(
|
|
40
|
+
const cellFocused = React.useContext(CellFocusedStateContext);
|
|
41
41
|
|
|
42
42
|
const accessibilityManager = useAccessibilityManager({});
|
|
43
43
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import React, { ReactNode } from "react";
|
|
2
|
+
|
|
3
|
+
export const CellFocusedStateContext = React.createContext<boolean>(false);
|
|
4
|
+
|
|
5
|
+
export const CellFocusedStateContextProvider = ({
|
|
6
|
+
cellFocused,
|
|
7
|
+
children,
|
|
8
|
+
}: {
|
|
9
|
+
cellFocused: boolean;
|
|
10
|
+
children: ReactNode;
|
|
11
|
+
}) => {
|
|
12
|
+
return (
|
|
13
|
+
<CellFocusedStateContext.Provider value={cellFocused}>
|
|
14
|
+
{children}
|
|
15
|
+
</CellFocusedStateContext.Provider>
|
|
16
|
+
);
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export function withCellFocusedStateContext(
|
|
20
|
+
Component: React.ComponentType<any>
|
|
21
|
+
) {
|
|
22
|
+
return function WithCellFocusedStateContextWrapper(props) {
|
|
23
|
+
const cellFocusedState = React.useContext(CellFocusedStateContext);
|
|
24
|
+
|
|
25
|
+
return <Component {...props} cellFocusedState={cellFocusedState} />;
|
|
26
|
+
};
|
|
27
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@applicaster/zapp-react-native-ui-components",
|
|
3
|
-
"version": "13.0.9-alpha.
|
|
3
|
+
"version": "13.0.9-alpha.1792119437",
|
|
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": "13.0.9-alpha.
|
|
35
|
-
"@applicaster/zapp-react-native-bridge": "13.0.9-alpha.
|
|
36
|
-
"@applicaster/zapp-react-native-redux": "13.0.9-alpha.
|
|
37
|
-
"@applicaster/zapp-react-native-utils": "13.0.9-alpha.
|
|
34
|
+
"@applicaster/applicaster-types": "13.0.9-alpha.1792119437",
|
|
35
|
+
"@applicaster/zapp-react-native-bridge": "13.0.9-alpha.1792119437",
|
|
36
|
+
"@applicaster/zapp-react-native-redux": "13.0.9-alpha.1792119437",
|
|
37
|
+
"@applicaster/zapp-react-native-utils": "13.0.9-alpha.1792119437",
|
|
38
38
|
"promise": "^8.3.0",
|
|
39
39
|
"react-router-native": "^5.1.2",
|
|
40
40
|
"url": "^0.11.0",
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
import React, { ReactNode } from "react";
|
|
2
|
-
|
|
3
|
-
export const CellStateContext = React.createContext<boolean>(false);
|
|
4
|
-
|
|
5
|
-
export const CellStateContextProvider = ({
|
|
6
|
-
cellFocused,
|
|
7
|
-
children,
|
|
8
|
-
}: {
|
|
9
|
-
cellFocused: boolean;
|
|
10
|
-
children: ReactNode;
|
|
11
|
-
}) => {
|
|
12
|
-
return (
|
|
13
|
-
<CellStateContext.Provider value={cellFocused}>
|
|
14
|
-
{children}
|
|
15
|
-
</CellStateContext.Provider>
|
|
16
|
-
);
|
|
17
|
-
};
|
|
18
|
-
|
|
19
|
-
export function withCellStateContext(Component: React.ComponentType<any>) {
|
|
20
|
-
return function WithCellStateContextWrapper(props) {
|
|
21
|
-
const cellStateContext = React.useContext(CellStateContext);
|
|
22
|
-
|
|
23
|
-
return <Component {...props} cellStateContext={cellStateContext} />;
|
|
24
|
-
};
|
|
25
|
-
}
|