react-native-customizable-image-crop-picker 1.0.10 → 1.1.0

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.
Files changed (80) hide show
  1. package/README.md +62 -22
  2. package/android/build/.transforms/a34a6297c7e9b65c987429ecd018e9a9/transformed/classes/classes_dex/classes.dex +0 -0
  3. package/android/build/intermediates/compile_library_classes_jar/debug/bundleLibCompileToJarDebug/classes.jar +0 -0
  4. package/android/build/intermediates/incremental/debug/packageDebugResources/compile-file-map.properties +1 -1
  5. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rncustomizableimagecroppicker/NativeImageCropperActivity$AspectPreset.class +0 -0
  6. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rncustomizableimagecroppicker/NativeImageCropperActivity$Companion.class +0 -0
  7. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rncustomizableimagecroppicker/NativeImageCropperActivity.class +0 -0
  8. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rncustomizableimagecroppicker/NativeImageCropperModule$Companion.class +0 -0
  9. package/android/build/intermediates/runtime_library_classes_dir/debug/bundleLibRuntimeToDirDebug/com/rncustomizableimagecroppicker/NativeImageCropperModule.class +0 -0
  10. package/android/build/intermediates/runtime_library_classes_jar/debug/bundleLibRuntimeToJarDebug/classes.jar +0 -0
  11. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab +0 -0
  12. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/inputs/source-to-output.tab.values.at +0 -0
  13. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab +0 -0
  14. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream +0 -0
  15. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.keystream.len +0 -0
  16. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.len +0 -0
  17. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab.values.at +0 -0
  18. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-attributes.tab_i +0 -0
  19. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab +0 -0
  20. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream +0 -0
  21. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.keystream.len +0 -0
  22. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.len +0 -0
  23. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab.values.at +0 -0
  24. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/class-fq-name-to-source.tab_i +0 -0
  25. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab +0 -0
  26. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/constants.tab.values.at +0 -0
  27. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab +0 -0
  28. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream +0 -0
  29. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.keystream.len +0 -0
  30. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.len +0 -0
  31. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab.values.at +0 -0
  32. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/internal-name-to-source.tab_i +0 -0
  33. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab +0 -0
  34. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream +0 -0
  35. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.keystream.len +0 -0
  36. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.len +0 -0
  37. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values +0 -0
  38. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.at +0 -0
  39. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab.values.s +1 -1
  40. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/proto.tab_i +0 -0
  41. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab +0 -0
  42. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/source-to-classes.tab.values.at +0 -0
  43. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab +0 -0
  44. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/subtypes.tab.values.at +0 -0
  45. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab +0 -0
  46. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/jvm/kotlin/supertypes.tab.values.at +0 -0
  47. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/counters.tab +1 -1
  48. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab +0 -0
  49. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/file-to-id.tab.values.at +0 -0
  50. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab +0 -0
  51. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream +0 -0
  52. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.keystream.len +0 -0
  53. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.len +0 -0
  54. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab.values.at +0 -0
  55. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/id-to-file.tab_i +0 -0
  56. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab +0 -0
  57. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream +0 -0
  58. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.keystream.len +0 -0
  59. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.len +0 -0
  60. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values +0 -0
  61. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.at +0 -0
  62. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab.values.s +1 -1
  63. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i +0 -0
  64. package/android/build/kotlin/compileDebugKotlin/cacheable/caches-jvm/lookups/lookups.tab_i.len +0 -0
  65. package/android/build/kotlin/compileDebugKotlin/cacheable/last-build.bin +0 -0
  66. package/android/build/kotlin/compileDebugKotlin/classpath-snapshot/shrunk-classpath-snapshot.bin +0 -0
  67. package/android/build/kotlin/compileDebugKotlin/local-state/build-history.bin +0 -0
  68. package/android/build/tmp/kotlin-classes/debug/com/rncustomizableimagecroppicker/NativeImageCropperActivity$AspectPreset.class +0 -0
  69. package/android/build/tmp/kotlin-classes/debug/com/rncustomizableimagecroppicker/NativeImageCropperActivity$Companion.class +0 -0
  70. package/android/build/tmp/kotlin-classes/debug/com/rncustomizableimagecroppicker/NativeImageCropperActivity.class +0 -0
  71. package/android/build/tmp/kotlin-classes/debug/com/rncustomizableimagecroppicker/NativeImageCropperModule$Companion.class +0 -0
  72. package/android/build/tmp/kotlin-classes/debug/com/rncustomizableimagecroppicker/NativeImageCropperModule.class +0 -0
  73. package/android/src/main/java/com/rncustomizableimagecroppicker/NativeImageCropperActivity.kt +188 -14
  74. package/android/src/main/java/com/rncustomizableimagecroppicker/NativeImageCropperModule.kt +24 -12
  75. package/ios/NativeImageCropperModule.m +6 -1
  76. package/ios/NativeImageCropperModule.swift +156 -50
  77. package/package.json +115 -115
  78. package/src/api.ts +7 -6
  79. package/src/native/mapOptions.ts +14 -3
  80. package/src/types.ts +6 -4
package/README.md CHANGED
@@ -34,22 +34,15 @@ This library is developed and maintained by **Amit Kumar**.
34
34
  ## Features
35
35
 
36
36
  - Camera + gallery
37
- - Cropping with configurable aspect ratio (`cropWidth` / `cropHeight` or `aspectRatio`)
37
+ - Cropping with configurable aspect ratio (`cropWidth` / `cropHeight`)
38
38
  - Circular crop (`circularCrop`)
39
39
  - Crop overlays: dimmed layer + grid (`dimmedLayerColor`, `cropGridEnabled`)
40
- - Native crop controls (rotate/reset + aspect ratio picker) via `showNativeCropControls`
40
+ - Native crop controls/toolbar via `showNativeCropControls`
41
41
  - Output compression controls (`compressQuality`, `compressFormat`)
42
42
  - Optional base64 output (`includeBase64`)
43
43
  - Native full-screen crop UI customization from JS (header/footer/buttons/icons/layout)
44
44
  - Icons: remote (http/https) + local (`file://` / Android `content://`) + base64 + bundled assets (`require(...)`)
45
- - Events: `onCropStart`, `onCropEnd`, `onProgress` (Android base64 progress)
46
-
47
- ## Roadmap / future features
48
-
49
- - **Multiple selection**: `multiple`, `maxFiles`
50
- - **Flip support** (to complement rotation)
51
- - **More aspect ratio presets** (configurable preset list)
52
- - **Richer errors + permission UX** (more granular error codes and clearer guidance)
45
+ - Events: `onCropStart`, `onCropEnd`, `onProgress` (base64/encoding progress on Android + iOS)
53
46
 
54
47
  ## Demo
55
48
 
@@ -75,7 +68,7 @@ This library is developed and maintained by **Amit Kumar**.
75
68
  ## Installation
76
69
 
77
70
  ```bash
78
- npm install react-native-customizable-image-crop-picker
71
+ npm install react-native-customizable-image-crop-picker --save
79
72
  ```
80
73
 
81
74
  or
@@ -87,9 +80,19 @@ yarn add react-native-customizable-image-crop-picker
87
80
  ### iOS
88
81
 
89
82
  ```bash
90
- cd ios && pod install && cd ..
83
+ cd ios
84
+ pod install
85
+ cd ..
91
86
  ```
92
87
 
88
+ #### Permissions (Info.plist)
89
+
90
+ Add:
91
+
92
+ - `NSCameraUsageDescription`
93
+ - `NSPhotoLibraryUsageDescription`
94
+ - `NSPhotoLibraryAddUsageDescription`
95
+
93
96
  #### If CocoaPods fails: TOCropViewController modular headers
94
97
 
95
98
  If `pod install` fails with a Swift modular headers error (TOCropViewController), add this to your **app** `ios/Podfile` (inside your app target):
@@ -140,8 +143,14 @@ If you use **remote icons** (`http/https`) for buttons:
140
143
  ## Quick start
141
144
 
142
145
  ```js
143
- import { openImageCropPicker } from 'react-native-customizable-image-crop-picker';
146
+ import {
147
+ openImageCropPicker,
148
+ } from 'react-native-customizable-image-crop-picker';
149
+ ```
150
+
151
+ ### Select from gallery
144
152
 
153
+ ```js
145
154
  const result = await openImageCropPicker({
146
155
  source: 'gallery',
147
156
  cropWidth: 1,
@@ -151,7 +160,7 @@ const result = await openImageCropPicker({
151
160
  console.log(result.path);
152
161
  ```
153
162
 
154
- ### Camera
163
+ ### Select from camera
155
164
 
156
165
  ```js
157
166
  const result = await openImageCropPicker({
@@ -163,20 +172,33 @@ const result = await openImageCropPicker({
163
172
 
164
173
  ### Callbacks / progress (base64)
165
174
 
175
+ `onProgress` emits **0..1** while doing the slow work of generating `base64` (only when `includeBase64: true`).
176
+
166
177
  ```js
167
178
  const result = await openImageCropPicker({
168
179
  source: 'gallery',
169
180
  includeBase64: true,
170
181
  onCropStart: () => console.log('crop started'),
171
- onProgress: (p) => console.log('progress', p), // Android: real base64 progress
182
+ onProgress: (p) => console.log('progress', p), // 0..1 (Android: real streaming encode, iOS: best-effort)
172
183
  onCropEnd: (res, err) => console.log('crop end', { res, err }),
173
184
  });
174
185
  ```
175
186
 
176
187
  ### Examples (recommended)
177
188
 
178
- - [Basic Example](https://github.com/amitkumarcoding/imagecroppicker/blob/main/App.js)
179
- - [Full Example](https://github.com/amitkumarcoding/imagecroppicker/blob/main/packages/react-native-customizable-image-crop-picker/example/App.js)
189
+ - [Example](https://github.com/amitkumarcoding/imagecroppicker/blob/main/packages/react-native-customizable-image-crop-picker/example/App.js)
190
+
191
+
192
+ ## Optional: JS UI chrome (`ImageCropPickerModal`)
193
+
194
+ This package also exports a **fully customizable React Native modal** (`ImageCropPickerModal`) that you can use as your own UI layer (custom header/footer/buttons). It’s independent from the native crop flow.
195
+
196
+ ### Usage
197
+
198
+ ```js
199
+ import React, { useState } from 'react';
200
+ import { View, Button } from 'react-native';
201
+ import { ImageCropPickerModal } from 'react-native-customizable-image-crop-picker/example/App.js)
180
202
 
181
203
  ## Icons (including SVG on Android)
182
204
 
@@ -216,7 +238,6 @@ Defaults shown below are the current native defaults.
216
238
  | aspectRatio | `{ width: number; height: number }` | No | - | Alternative to `cropWidth/cropHeight` |
217
239
  | freeStyleCropEnabled | boolean | No | `false` | If `true`, user can resize the crop box (free-style) |
218
240
  | circularCrop | boolean | No | `false` | Circular crop (iOS/Android) |
219
- | rotationEnabled | boolean | No | `false` | Enables rotation controls when `showNativeCropControls: true` |
220
241
  | cropGridEnabled | boolean | No | `false` | Show crop grid (iOS/Android) |
221
242
  | cropOverlayColor | string | No | - | Alias for `dimmedLayerColor` |
222
243
  | cropFrameColor | string | No | - | Android: crop frame color |
@@ -298,7 +319,7 @@ await openImageCropPicker({
298
319
  | statusBarColor | string | No | `#FFFFFF` (light), `#000000` (dark) | Status bar color |
299
320
  | statusBarStyle | `'dark' \| 'light'` | No | - | Android only: status bar icon/text color |
300
321
  | dimmedLayerColor | string | No | `#B3000000` (light), `#E0000000` (dark) | Dimmed overlay around crop box |
301
- | showNativeCropControls | boolean | No | `false` | Show native crop controls (rotation/aspect ratio toolbar) |
322
+ | showNativeCropControls | boolean | No | `false` | Show native crop controls/toolbar |
302
323
 
303
324
  #### `showNativeCropControls` + `controlsPlacement`
304
325
 
@@ -307,7 +328,7 @@ When `showNativeCropControls: true`, the native crop toolbar is visible.
307
328
  - To avoid the footer covering the native toolbar, `showNativeCropControls` works **only with** `controlsPlacement: 'top'`.
308
329
  - If you pass `controlsPlacement: 'bottom'`, the library will **auto-force it to `'top'`**.
309
330
 
310
- ### Platform-specific props / behavior
331
+ ## Platform-specific props / behavior
311
332
 
312
333
  - **Android only**
313
334
  - **`drawUnderStatusBar`**: edge-to-edge header under the status bar.
@@ -332,7 +353,26 @@ These are read from React Native styles and mapped into native values (subset on
332
353
  | headerStyle | `{ containerStyle?, titleStyle? }` | No | - | Supports `containerStyle.backgroundColor`, `titleStyle.color/fontSize/fontFamily` |
333
354
  | footerStyle | `{ containerStyle?, cancelButtonStyle?, uploadButtonStyle?, cancelTextStyle?, uploadTextStyle? }` | No | - | Supports background/border/textColor/fontSize/fontFamily/borderRadius subset |
334
355
 
335
- ## Response object
356
+ ### JS-only props (ignored by `openImageCropPicker()`)
357
+
358
+ These exist in exported types to support the `ImageCropPickerModal` component. They are currently **not used** by the native `openImageCropPicker()` flow (or its alias `open()`).
359
+
360
+ | Prop | Type | Required | Default | Description |
361
+ | --- | --- | --- | --- | --- |
362
+ | showHeader | boolean | No | - | `ImageCropPickerModal` only |
363
+ | headerAlignment | `'left' \| 'center' \| 'right'` | No | - | `ImageCropPickerModal` only |
364
+ | leftIcon | `React.ReactNode` | No | - | `ImageCropPickerModal` only |
365
+ | rightIcon | `React.ReactNode` | No | - | `ImageCropPickerModal` only |
366
+ | showLeftIcon | boolean | No | - | `ImageCropPickerModal` only |
367
+ | showRightIcon | boolean | No | - | `ImageCropPickerModal` only |
368
+ | showFooter | boolean | No | - | `ImageCropPickerModal` only |
369
+ | cancelIcon | `React.ReactNode` | No | - | `ImageCropPickerModal` only |
370
+ | uploadIcon | `React.ReactNode` | No | - | `ImageCropPickerModal` only |
371
+ | overlayStyle | `CropperOverlayStyle` | No | - | `ImageCropPickerModal` only |
372
+ | backgroundColor | string | No | - | `ImageCropPickerModal` only |
373
+ | safeAreaEnabled | boolean | No | - | `ImageCropPickerModal` only |
374
+
375
+ ## Response Object
336
376
 
337
377
  | Property | Type | Description |
338
378
  | --- | --- | --- |
@@ -363,7 +403,7 @@ The library throws `CropPickerError` with a `code`:
363
403
  - Multiple selection options exist in types but **native multiple picking is not implemented yet**.
364
404
  - iOS grid/frame color customization is limited (rectangle grid uses the native overlay; circular grid uses a custom overlay).
365
405
 
366
- ## Peer dependencies
406
+ ## Peer Dependencies
367
407
 
368
408
  | Package | Version |
369
409
  | --- | --- |
@@ -1,2 +1,2 @@
1
- #Fri Feb 20 12:30:37 IST 2026
1
+ #Sun Feb 22 18:15:36 IST 2026
2
2
  com.rncustomizableimagecroppicker.react-native-customizable-image-crop-picker-main-6\:/xml/nativeimagepicker_file_paths.xml=/Users/amit.kumar/Documents/imageCropPicker/node_modules/react-native-customizable-image-crop-picker/android/build/intermediates/packaged_res/debug/packageDebugResources/xml/nativeimagepicker_file_paths.xml
@@ -1 +1 @@
1
- a�l�h�n�m�p�u�m�n�s
1
+ o�
@@ -1 +1 @@
1
- VP��{�~�o�i�U�X�v�w�l
1
+ Ne˓