@applicaster/zapp-react-native-utils 14.0.0-alpha.9119252693 → 14.0.0-alpha.9256258513
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
|
|
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": "14.0.0-alpha.
|
|
3
|
+
"version": "14.0.0-alpha.9256258513",
|
|
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": "14.0.0-alpha.
|
|
30
|
+
"@applicaster/applicaster-types": "14.0.0-alpha.9256258513",
|
|
31
31
|
"buffer": "^5.2.1",
|
|
32
32
|
"camelize": "^1.0.0",
|
|
33
33
|
"dayjs": "^1.11.10",
|
|
@@ -1,5 +1,11 @@
|
|
|
1
1
|
import { NativeModules, Platform } from "react-native";
|
|
2
2
|
|
|
3
|
+
export const isAndroidTablet = () => {
|
|
4
|
+
const { initialProps } = NativeModules.QuickBrickCommunicationModule;
|
|
5
|
+
|
|
6
|
+
return initialProps?.is_tablet;
|
|
7
|
+
};
|
|
8
|
+
|
|
3
9
|
/**
|
|
4
10
|
* Determines wether the given device is a tablet based on dimensions, orientation, and platform
|
|
5
11
|
* @param {Object} dimensions - Dimensions object passed to the function
|
|
@@ -13,9 +19,7 @@ export const isTablet = (
|
|
|
13
19
|
if (Platform?.OS === "ios") {
|
|
14
20
|
return Platform?.isPad;
|
|
15
21
|
} else if (Platform?.OS === "android") {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return initialProps?.is_tablet;
|
|
22
|
+
return isAndroidTablet();
|
|
19
23
|
}
|
|
20
24
|
|
|
21
25
|
const { width } = dimensions || {};
|
|
@@ -14,7 +14,7 @@ import { HOOKS_EVENTS } from "../../appUtils/HooksManager/constants";
|
|
|
14
14
|
import { getRiverFromRoute, getTargetRoute } from "../../navigationUtils";
|
|
15
15
|
import { useConnectionInfo } from "../connection";
|
|
16
16
|
|
|
17
|
-
import { isTV } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
17
|
+
import { isTV, isWeb } from "@applicaster/zapp-react-native-utils/reactUtils";
|
|
18
18
|
import { useNavbarState } from "../screen";
|
|
19
19
|
|
|
20
20
|
export { useNavigation } from "./useNavigation";
|
|
@@ -127,10 +127,14 @@ export function isNavBarVisible(
|
|
|
127
127
|
|
|
128
128
|
export const useBackHandler = (cb: () => boolean) => {
|
|
129
129
|
useEffect(() => {
|
|
130
|
-
|
|
130
|
+
if (!isWeb()) {
|
|
131
|
+
BackHandler.addEventListener("hardwareBackPress", cb);
|
|
132
|
+
}
|
|
131
133
|
|
|
132
134
|
return () => {
|
|
133
|
-
|
|
135
|
+
if (!isWeb()) {
|
|
136
|
+
BackHandler.removeEventListener("hardwareBackPress", cb);
|
|
137
|
+
}
|
|
134
138
|
};
|
|
135
139
|
}, [cb]);
|
|
136
140
|
};
|