@applicaster/zapp-react-native-ui-components 12.0.25-rc.0 → 12.0.26-alpha.1009510827

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.
@@ -14,10 +14,7 @@ import { BaseFocusable } from "../BaseFocusable";
14
14
  import { AccessibilityManager } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager";
15
15
 
16
16
  type Props = {
17
- item: {
18
- id: string;
19
- title: string;
20
- };
17
+ item: ZappEntry;
21
18
  index: number;
22
19
  shouldScrollHorizontally: (arg1: [any]) => boolean | null | undefined;
23
20
  shouldScrollVertically: (...args: any) => boolean | null | undefined;
@@ -83,7 +80,9 @@ const touchableStyles = {
83
80
  } as const;
84
81
 
85
82
  export class CellComponent extends React.Component<Props, State> {
86
- constructor(props) {
83
+ accessibilityManager: AccessibilityManager;
84
+
85
+ constructor(props: Props) {
87
86
  super(props);
88
87
  this.onPress = this.onPress.bind(this);
89
88
  this.onFocus = this.onFocus.bind(this);
@@ -94,11 +93,15 @@ export class CellComponent extends React.Component<Props, State> {
94
93
  this.scrollToIndex = this.scrollToIndex.bind(this);
95
94
 
96
95
  this.state = {
97
- hasFocusableInside: props.CellRenderer.hasFocusableInside?.(props.item),
96
+ hasFocusableInside: props.CellRenderer.hasFocusableInside?.(
97
+ props.item as Record<string, any>
98
+ ),
98
99
  };
100
+
101
+ this.accessibilityManager = AccessibilityManager.getInstance();
99
102
  }
100
103
 
101
- setScreenLayout(componentAnchorPointY, screenLayout) {
104
+ setScreenLayout(componentAnchorPointY: number, screenLayout: any) {
102
105
  if (componentAnchorPointY && screenLayout) {
103
106
  const updateLayout =
104
107
  componentAnchorPointY !== screenLayout?.componentAnchorPointY;
@@ -200,7 +203,7 @@ export class CellComponent extends React.Component<Props, State> {
200
203
  if (prevProps.item !== this.props.item) {
201
204
  this.setState({
202
205
  hasFocusableInside: this.props.CellRenderer.hasFocusableInside?.(
203
- this.props.item
206
+ this.props.item as Record<string, any>
204
207
  ),
205
208
  });
206
209
  }
@@ -270,20 +273,21 @@ export class CellComponent extends React.Component<Props, State> {
270
273
  style={baseCellStyles}
271
274
  isFocusable={isFocusable}
272
275
  skipFocusManagerRegistration={skipFocusManagerRegistration}
276
+ {...this.accessibilityManager.getButtonAccessibilityProps(
277
+ item?.extensions?.accessibility?.label || item?.title
278
+ )}
273
279
  >
274
280
  {(focused, event) => {
275
281
  const isFocused = this.isCellFocused(focused);
276
282
 
277
283
  if (isFocused) {
278
- const accessibilityManager = AccessibilityManager.getInstance();
279
-
280
284
  const accessibilityTitle =
281
285
  item?.extensions?.accessibility?.label || item?.title || "";
282
286
 
283
287
  const accessibilityHint =
284
288
  item?.extensions?.accessibility?.hint || "";
285
289
 
286
- accessibilityManager.readText({
290
+ this.accessibilityManager.readText({
287
291
  text: `${accessibilityTitle} ${accessibilityHint}`,
288
292
  });
289
293
  }
@@ -121,7 +121,7 @@ class Focusable extends BaseFocusable<Props> {
121
121
  }
122
122
 
123
123
  render() {
124
- const { children, style } = this.props;
124
+ const { children, style, ...otherProps } = this.props;
125
125
  const { focused } = this.state;
126
126
 
127
127
  const id = this.getId();
@@ -139,6 +139,7 @@ class Focusable extends BaseFocusable<Props> {
139
139
  data-testid={focusableId}
140
140
  focused-teststate={focused ? "focused" : "default"}
141
141
  style={style}
142
+ {...otherProps}
142
143
  >
143
144
  {children(focused, { mouse: this.mouse })}
144
145
  </div>
@@ -4,6 +4,7 @@ import { Appearance, Platform, StyleSheet, TextInput } from "react-native";
4
4
  import { isFunction } from "@applicaster/zapp-react-native-utils/functionUtils";
5
5
  import { isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
6
6
  import { useIsRTL } from "@applicaster/zapp-react-native-utils/localizationUtils";
7
+ import { useAccessibilityManager } from "@applicaster/zapp-react-native-utils/appUtils/accessibilityManager/hooks";
7
8
 
8
9
  type Props = Partial<{
9
10
  style: any;
@@ -42,6 +43,8 @@ function TextInputTV(props: Props, ref) {
42
43
  const [colorScheme, setColorScheme] = useState(getInitialColorScheme());
43
44
  const isRTL = useIsRTL();
44
45
 
46
+ const accessibilityManager = useAccessibilityManager({});
47
+
45
48
  const onColorChange = useCallback(
46
49
  ({ colorScheme: color }) => {
47
50
  if (color !== colorScheme) {
@@ -153,6 +156,13 @@ function TextInputTV(props: Props, ref) {
153
156
  ])
154
157
  )(props);
155
158
 
159
+ const getAccessibilityProps = () => {
160
+ return {
161
+ accessibilityProps:
162
+ accessibilityManager.getInputAccessibilityProps("Search"),
163
+ };
164
+ };
165
+
156
166
  const inputProps = {
157
167
  ...getProps(),
158
168
  ...getStyle(),
@@ -161,6 +171,7 @@ function TextInputTV(props: Props, ref) {
161
171
  ...getSecureTextEntry(),
162
172
  ...getOnEndEditing(),
163
173
  ...getOnPress(),
174
+ ...getAccessibilityProps(),
164
175
  };
165
176
 
166
177
  if (
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-ui-components",
3
- "version": "12.0.25-rc.0",
3
+ "version": "12.0.26-alpha.1009510827",
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",
@@ -34,10 +34,10 @@
34
34
  "redux-mock-store": "^1.5.3"
35
35
  },
36
36
  "dependencies": {
37
- "@applicaster/applicaster-types": "12.0.25-rc.0",
38
- "@applicaster/zapp-react-native-bridge": "12.0.25-rc.0",
39
- "@applicaster/zapp-react-native-redux": "12.0.25-rc.0",
40
- "@applicaster/zapp-react-native-utils": "12.0.25-rc.0",
37
+ "@applicaster/applicaster-types": "12.0.26-alpha.1009510827",
38
+ "@applicaster/zapp-react-native-bridge": "12.0.26-alpha.1009510827",
39
+ "@applicaster/zapp-react-native-redux": "12.0.26-alpha.1009510827",
40
+ "@applicaster/zapp-react-native-utils": "12.0.26-alpha.1009510827",
41
41
  "promise": "^8.3.0",
42
42
  "react-router-native": "^5.1.2",
43
43
  "url": "^0.11.0",