@teamnhz/rn-ui-toolkit 1.4.4 → 1.4.6

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.
@@ -1,12 +1,12 @@
1
1
  import React from "react";
2
+ import { KeyboardAwareScrollView } from "react-native-keyboard-aware-scroll-view";
2
3
  import { ScrollViewProps } from "react-native";
3
4
  import type { KeyboardAwareProps } from "react-native-keyboard-aware-scroll-view";
4
- type KeyboardScrollProps = KeyboardAwareProps & ScrollViewProps;
5
5
  /**
6
6
  * FULLY EXTENDED COMPONENT
7
7
  * - Supports ALL props of KeyboardAwareScrollView
8
8
  * - No conflict props
9
9
  * - Clean + reusable wrapper
10
10
  */
11
- declare const KeyboardScroll: ({ children, ...restProps }: KeyboardScrollProps) => React.JSX.Element;
11
+ declare const KeyboardScroll: React.ForwardRefExoticComponent<KeyboardAwareProps & ScrollViewProps & React.RefAttributes<KeyboardAwareScrollView>>;
12
12
  export default KeyboardScroll;
@@ -1,4 +1,4 @@
1
- import React from "react";
1
+ import React, { forwardRef } from "react";
2
2
  import { KeyboardAwareScrollView, } from "react-native-keyboard-aware-scroll-view";
3
3
  /**
4
4
  * FULLY EXTENDED COMPONENT
@@ -6,7 +6,7 @@ import { KeyboardAwareScrollView, } from "react-native-keyboard-aware-scroll-vie
6
6
  * - No conflict props
7
7
  * - Clean + reusable wrapper
8
8
  */
9
- const KeyboardScroll = ({ children, ...restProps }) => {
10
- return (React.createElement(KeyboardAwareScrollView, { showsVerticalScrollIndicator: false, keyboardShouldPersistTaps: "handled", bounces: false, ...restProps }, children));
11
- };
9
+ const KeyboardScroll = forwardRef(({ children, ...restProps }, ref) => {
10
+ return (React.createElement(KeyboardAwareScrollView, { ref: ref, showsVerticalScrollIndicator: false, keyboardShouldPersistTaps: "handled", bounces: false, ...restProps }, children));
11
+ });
12
12
  export default KeyboardScroll;
@@ -13,6 +13,8 @@ export declare const cameraPermissions: (callback: (status: boolean) => void) =>
13
13
  export declare const checkMicroPhonePermission: () => Promise<boolean>;
14
14
  /**
15
15
  * 🖼️ GALLERY / STORAGE PERMISSION
16
+ * Android 13+ (API 33): No longer requires READ_MEDIA_IMAGES for photo picker
17
+ * Uses the new Photo Picker which doesn't need runtime permissions
16
18
  */
17
19
  export declare const galleryPermissions: (callback: (status: boolean) => void) => Promise<void>;
18
20
  /**
@@ -18,9 +18,8 @@ export const requestDocumentPermission = async () => {
18
18
  return granted === PermissionsAndroid.RESULTS.GRANTED;
19
19
  }
20
20
  else {
21
- // ✅ Android 13+ (API 33): use READ_MEDIA_* permissions
22
- const result = await request(PERMISSIONS.ANDROID.READ_MEDIA_IMAGES);
23
- return result === RESULTS.GRANTED;
21
+ // ✅ Android 13+ (API 33): No permission needed for document picker
22
+ return true;
24
23
  }
25
24
  }
26
25
  else if (Platform.OS === 'ios') {
@@ -89,6 +88,8 @@ export const checkMicroPhonePermission = async () => {
89
88
  };
90
89
  /**
91
90
  * 🖼️ GALLERY / STORAGE PERMISSION
91
+ * Android 13+ (API 33): No longer requires READ_MEDIA_IMAGES for photo picker
92
+ * Uses the new Photo Picker which doesn't need runtime permissions
92
93
  */
93
94
  export const galleryPermissions = async (callback) => {
94
95
  try {
@@ -103,15 +104,12 @@ export const galleryPermissions = async (callback) => {
103
104
  else {
104
105
  const androidVersion = Platform.Version;
105
106
  if (androidVersion >= 33) {
106
- const imagePermission = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.READ_MEDIA_IMAGES);
107
- const videoPermission = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.READ_MEDIA_VIDEO);
108
- const granted = imagePermission === PermissionsAndroid.RESULTS.GRANTED ||
109
- videoPermission === PermissionsAndroid.RESULTS.GRANTED;
110
- if (!granted)
111
- settingAlert("Storage permission is required to select images");
112
- callback(granted);
107
+ // Android 13+ (API 33): Photo Picker doesn't require permissions
108
+ // Just return true to allow the picker to be used
109
+ callback(true);
113
110
  }
114
111
  else {
112
+ // Android 12 and below still needs READ_EXTERNAL_STORAGE
115
113
  const storagePermission = await PermissionsAndroid.request(PermissionsAndroid.PERMISSIONS.READ_EXTERNAL_STORAGE);
116
114
  const granted = storagePermission === PermissionsAndroid.RESULTS.GRANTED;
117
115
  if (!granted)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@teamnhz/rn-ui-toolkit",
3
- "version": "1.4.4",
3
+ "version": "1.4.6",
4
4
  "main": "dist/index.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "files": [