@applicaster/zapp-react-native-utils 13.0.2 → 13.0.3

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.
@@ -143,12 +143,15 @@ export class AccessibilityManager {
143
143
 
144
144
  if (!buttonConfig) {
145
145
  return {
146
+ accessible: true,
146
147
  accessibilityLabel: buttonName,
147
148
  accessibilityHint: `Press button to perform action on ${buttonName}`,
148
149
  "aria-label": buttonName,
149
150
  "aria-description": `Press button to perform action on ${buttonName}`,
150
151
  accessibilityRole: "button" as AccessibilityRole,
151
152
  "aria-role": "button",
153
+ role: "button",
154
+ tabindex: 0,
152
155
  };
153
156
  }
154
157
 
@@ -162,23 +165,29 @@ export class AccessibilityManager {
162
165
  `Press button to perform action on ${buttonName}`;
163
166
 
164
167
  return {
168
+ accessible: true,
165
169
  accessibilityLabel: label,
166
170
  accessibilityHint: hint,
167
171
  "aria-label": label,
168
172
  "aria-description": hint,
169
173
  accessibilityRole: "button" as AccessibilityRole,
170
174
  "aria-role": "button",
175
+ role: "button",
176
+ tabindex: 0,
171
177
  };
172
178
  }
173
179
 
174
180
  public getInputAccessibilityProps(inputName: string): AccessibilityProps {
175
181
  return {
182
+ accessible: true,
176
183
  accessibilityLabel: inputName,
177
184
  accessibilityHint: `Enter text into ${inputName}`,
178
185
  "aria-label": inputName,
179
186
  "aria-description": `Enter text into ${inputName}`,
180
187
  accessibilityRole: "textbox" as AccessibilityRole,
181
188
  "aria-role": "textbox",
189
+ role: "textbox",
190
+ tabindex: 0,
182
191
  };
183
192
  }
184
193
 
@@ -5,6 +5,9 @@ import { playerManager } from "./index";
5
5
  import { useValidatePlayerConfig } from "../../playerUtils/useValidatePlayerConfig";
6
6
  import { PlayerRole } from "./conts";
7
7
  import { isAppleTV } from "@applicaster/zapp-react-native-ui-components/Helpers/Platform";
8
+ import { TVSeekController } from "../../reactHooks/player/TVSeekControlller/TVSeekController";
9
+ import { KeyInputHandler } from "../keyInputHandler/KeyInputHandler";
10
+ import { isTV } from "../../reactUtils";
8
11
 
9
12
  // TODO: Rename to ControllerType
10
13
  export const usePlayerControllerSetup = ({
@@ -76,5 +79,18 @@ export const usePlayerControllerSetup = ({
76
79
  };
77
80
  }, [playerId, playerController]);
78
81
 
82
+ useEffect(() => {
83
+ if (!isTV()) {
84
+ return;
85
+ }
86
+
87
+ if (playerController) {
88
+ const seekController = new TVSeekController(playerController);
89
+ playerController.seekController = seekController;
90
+
91
+ return KeyInputHandler.getInstance().addListener(seekController);
92
+ }
93
+ }, [playerController]);
94
+
79
95
  return playerController;
80
96
  };
package/index.d.ts CHANGED
@@ -139,10 +139,13 @@ declare type AccessibilityState = {
139
139
  };
140
140
 
141
141
  declare type AccessibilityProps = {
142
+ accessible?: boolean;
142
143
  accessibilityLabel?: string;
143
144
  accessibilityHint?: string;
144
145
  "aria-label"?: string;
145
146
  "aria-description"?: string;
146
147
  accessibilityRole?: string;
147
148
  "aria-role"?: string;
149
+ role?: string;
150
+ tabindex?: number;
148
151
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@applicaster/zapp-react-native-utils",
3
- "version": "13.0.2",
3
+ "version": "13.0.3",
4
4
  "description": "Applicaster Zapp React Native utilities package",
5
5
  "main": "index.js",
6
6
  "types": "index.d.ts",
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/applicaster/quickbrick#readme",
29
29
  "dependencies": {
30
- "@applicaster/applicaster-types": "13.0.2",
30
+ "@applicaster/applicaster-types": "13.0.3",
31
31
  "buffer": "^5.2.1",
32
32
  "camelize": "^1.0.0",
33
33
  "dayjs": "^1.11.10",
@@ -6,7 +6,10 @@ import { NativeModules, Platform } from "react-native";
6
6
  * @param {String} orientation - Orientation enum passed to the function
7
7
  * @returns {Boolean} isTablet - returns whether the given device is a tablet
8
8
  */
9
- export const isTablet = (dimensions, orientation) => {
9
+ export const isTablet = (
10
+ dimensions?: { width: number; height: number },
11
+ orientation?: string
12
+ ) => {
10
13
  if (Platform?.OS === "ios") {
11
14
  return Platform?.isPad;
12
15
  } else if (Platform?.OS === "android") {
@@ -15,7 +18,7 @@ export const isTablet = (dimensions, orientation) => {
15
18
  return initialProps?.is_tablet;
16
19
  }
17
20
 
18
- const { width } = dimensions;
21
+ const { width } = dimensions || {};
19
22
 
20
23
  if (width < 600) return false;
21
24
  if (width >= 600 && width < 840) return orientation === "portrait";