react-native-customizable-image-crop-picker 1.1.0 → 1.1.2
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.
- package/README.md +26 -27
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -188,17 +188,37 @@ const result = await openImageCropPicker({
|
|
|
188
188
|
|
|
189
189
|
- [Example](https://github.com/amitkumarcoding/imagecroppicker/blob/main/packages/react-native-customizable-image-crop-picker/example/App.js)
|
|
190
190
|
|
|
191
|
+
## Usage
|
|
191
192
|
|
|
192
|
-
|
|
193
|
+
Import:
|
|
193
194
|
|
|
194
|
-
|
|
195
|
+
```js
|
|
196
|
+
import {
|
|
197
|
+
openImageCropPicker,
|
|
198
|
+
} from 'react-native-customizable-image-crop-picker';
|
|
199
|
+
```
|
|
195
200
|
|
|
196
|
-
###
|
|
201
|
+
### Select from gallery
|
|
197
202
|
|
|
198
203
|
```js
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
204
|
+
const result = await openImageCropPicker({
|
|
205
|
+
source: 'gallery',
|
|
206
|
+
cropWidth: 1,
|
|
207
|
+
cropHeight: 1,
|
|
208
|
+
});
|
|
209
|
+
|
|
210
|
+
console.log(result.path);
|
|
211
|
+
```
|
|
212
|
+
|
|
213
|
+
### Select from camera
|
|
214
|
+
|
|
215
|
+
```js
|
|
216
|
+
const result = await openImageCropPicker({
|
|
217
|
+
source: 'camera',
|
|
218
|
+
cropWidth: 1,
|
|
219
|
+
cropHeight: 1,
|
|
220
|
+
});
|
|
221
|
+
```
|
|
202
222
|
|
|
203
223
|
## Icons (including SVG on Android)
|
|
204
224
|
|
|
@@ -225,8 +245,6 @@ Defaults shown below are the current native defaults.
|
|
|
225
245
|
| Prop | Type | Required | Default | Description |
|
|
226
246
|
| --- | --- | --- | --- | --- |
|
|
227
247
|
| source | `'camera' \| 'gallery'` | Yes | - | Open camera or gallery |
|
|
228
|
-
| multiple | boolean | No | `false` | Pick multiple images (**planned**, not implemented yet) |
|
|
229
|
-
| maxFiles | number | No | - | Max items when `multiple: true` (**planned**) |
|
|
230
248
|
| mediaType | `'photo'` | No | `'photo'` | Media type (photos only) |
|
|
231
249
|
|
|
232
250
|
### Crop options
|
|
@@ -353,25 +371,6 @@ These are read from React Native styles and mapped into native values (subset on
|
|
|
353
371
|
| headerStyle | `{ containerStyle?, titleStyle? }` | No | - | Supports `containerStyle.backgroundColor`, `titleStyle.color/fontSize/fontFamily` |
|
|
354
372
|
| footerStyle | `{ containerStyle?, cancelButtonStyle?, uploadButtonStyle?, cancelTextStyle?, uploadTextStyle? }` | No | - | Supports background/border/textColor/fontSize/fontFamily/borderRadius subset |
|
|
355
373
|
|
|
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
374
|
## Response Object
|
|
376
375
|
|
|
377
376
|
| Property | Type | Description |
|