@rageshpikalmunde/rp-image-editor-react 1.5.13 → 1.6.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.
|
@@ -4,7 +4,8 @@ exports.useRpImageEditor = void 0;
|
|
|
4
4
|
const react_1 = require("react");
|
|
5
5
|
const rp_image_editor_1 = require("@rageshpikalmunde/rp-image-editor");
|
|
6
6
|
/**
|
|
7
|
-
* React hook to open the image editor as a modal overlay
|
|
7
|
+
* React hook to open the image editor as a modal overlay
|
|
8
|
+
* (`openEditor` for one image, `openMultiEditor` for several).
|
|
8
9
|
*
|
|
9
10
|
* Usage:
|
|
10
11
|
* ```tsx
|
|
@@ -26,7 +27,10 @@ function useRpImageEditor() {
|
|
|
26
27
|
const openEditor = (0, react_1.useCallback)(async (image, config) => {
|
|
27
28
|
return (0, rp_image_editor_1.openEditorModal)({ image, config });
|
|
28
29
|
}, []);
|
|
29
|
-
|
|
30
|
+
const openMultiEditor = (0, react_1.useCallback)(async (images, config, startIndex) => {
|
|
31
|
+
return (0, rp_image_editor_1.openMultiEditorModal)({ images, config, startIndex });
|
|
32
|
+
}, []);
|
|
33
|
+
return { openEditor, openMultiEditor };
|
|
30
34
|
}
|
|
31
35
|
exports.useRpImageEditor = useRpImageEditor;
|
|
32
36
|
//# sourceMappingURL=useRpImageEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRpImageEditor.js","sourceRoot":"","sources":["../../src/useRpImageEditor.ts"],"names":[],"mappings":";;;AAAA,iCAAoC;AACpC,
|
|
1
|
+
{"version":3,"file":"useRpImageEditor.js","sourceRoot":"","sources":["../../src/useRpImageEditor.ts"],"names":[],"mappings":";;;AAAA,iCAAoC;AACpC,uEAM2C;AAE3C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,SAAgB,gBAAgB;IAC9B,MAAM,UAAU,GAAG,IAAA,mBAAW,EAC5B,KAAK,EACH,KAA2B,EAC3B,MAAgC,EACA,EAAE;QAClC,OAAO,IAAA,iCAAe,EAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5C,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,eAAe,GAAG,IAAA,mBAAW,EACjC,KAAK,EACH,MAAmC,EACnC,MAAgC,EAChC,UAAmB,EACwB,EAAE;QAC7C,OAAO,IAAA,sCAAoB,EAAC,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC,EACD,EAAE,CACH,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;AACzC,CAAC;AAvBD,4CAuBC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { useCallback } from 'react';
|
|
2
|
-
import { openEditorModal, } from '@rageshpikalmunde/rp-image-editor';
|
|
2
|
+
import { openEditorModal, openMultiEditorModal, } from '@rageshpikalmunde/rp-image-editor';
|
|
3
3
|
/**
|
|
4
|
-
* React hook to open the image editor as a modal overlay
|
|
4
|
+
* React hook to open the image editor as a modal overlay
|
|
5
|
+
* (`openEditor` for one image, `openMultiEditor` for several).
|
|
5
6
|
*
|
|
6
7
|
* Usage:
|
|
7
8
|
* ```tsx
|
|
@@ -23,6 +24,9 @@ export function useRpImageEditor() {
|
|
|
23
24
|
const openEditor = useCallback(async (image, config) => {
|
|
24
25
|
return openEditorModal({ image, config });
|
|
25
26
|
}, []);
|
|
26
|
-
|
|
27
|
+
const openMultiEditor = useCallback(async (images, config, startIndex) => {
|
|
28
|
+
return openMultiEditorModal({ images, config, startIndex });
|
|
29
|
+
}, []);
|
|
30
|
+
return { openEditor, openMultiEditor };
|
|
27
31
|
}
|
|
28
32
|
//# sourceMappingURL=useRpImageEditor.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"useRpImageEditor.js","sourceRoot":"","sources":["../../src/useRpImageEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,
|
|
1
|
+
{"version":3,"file":"useRpImageEditor.js","sourceRoot":"","sources":["../../src/useRpImageEditor.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,OAAO,CAAC;AACpC,OAAO,EAIL,eAAe,EACf,oBAAoB,GACrB,MAAM,mCAAmC,CAAC;AAE3C;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,UAAU,gBAAgB;IAC9B,MAAM,UAAU,GAAG,WAAW,CAC5B,KAAK,EACH,KAA2B,EAC3B,MAAgC,EACA,EAAE;QAClC,OAAO,eAAe,CAAC,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;IAC5C,CAAC,EACD,EAAE,CACH,CAAC;IAEF,MAAM,eAAe,GAAG,WAAW,CACjC,KAAK,EACH,MAAmC,EACnC,MAAgC,EAChC,UAAmB,EACwB,EAAE;QAC7C,OAAO,oBAAoB,CAAC,EAAE,MAAM,EAAE,MAAM,EAAE,UAAU,EAAE,CAAC,CAAC;IAC9D,CAAC,EACD,EAAE,CACH,CAAC;IAEF,OAAO,EAAE,UAAU,EAAE,eAAe,EAAE,CAAC;AACzC,CAAC"}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -5,4 +5,4 @@
|
|
|
5
5
|
export { RpImageEditorComponent } from './RpImageEditor';
|
|
6
6
|
export type { RpImageEditorProps } from './RpImageEditor';
|
|
7
7
|
export { useRpImageEditor } from './useRpImageEditor';
|
|
8
|
-
export type { RpEditorConfig, RpEditorTheme, RpEditorResult, CropAspectRatio, EditorMode, } from '@rageshpikalmunde/rp-image-editor';
|
|
8
|
+
export type { RpEditorConfig, RpEditorTheme, RpEditorResult, RpMultiEditorItemResult, CropAspectRatio, EditorMode, } from '@rageshpikalmunde/rp-image-editor';
|
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { RpEditorConfig, RpEditorResult } from '@rageshpikalmunde/rp-image-editor';
|
|
1
|
+
import { RpEditorConfig, RpEditorResult, RpMultiEditorItemResult } from '@rageshpikalmunde/rp-image-editor';
|
|
2
2
|
/**
|
|
3
|
-
* React hook to open the image editor as a modal overlay
|
|
3
|
+
* React hook to open the image editor as a modal overlay
|
|
4
|
+
* (`openEditor` for one image, `openMultiEditor` for several).
|
|
4
5
|
*
|
|
5
6
|
* Usage:
|
|
6
7
|
* ```tsx
|
|
@@ -20,4 +21,5 @@ import { RpEditorConfig, RpEditorResult } from '@rageshpikalmunde/rp-image-edito
|
|
|
20
21
|
*/
|
|
21
22
|
export declare function useRpImageEditor(): {
|
|
22
23
|
openEditor: (image: File | Blob | string, config?: Partial<RpEditorConfig>) => Promise<RpEditorResult | null>;
|
|
24
|
+
openMultiEditor: (images: Array<File | Blob | string>, config?: Partial<RpEditorConfig>, startIndex?: number) => Promise<RpMultiEditorItemResult[] | null>;
|
|
23
25
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rageshpikalmunde/rp-image-editor-react",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.6.0",
|
|
4
4
|
"description": "React wrapper for rp-image-editor with crop, annotation, filters, and native-resolution export support",
|
|
5
5
|
"main": "dist/cjs/index.js",
|
|
6
6
|
"module": "dist/esm/index.js",
|
|
@@ -44,7 +44,7 @@
|
|
|
44
44
|
"access": "public"
|
|
45
45
|
},
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@rageshpikalmunde/rp-image-editor": "^1.
|
|
47
|
+
"@rageshpikalmunde/rp-image-editor": "^1.6.0"
|
|
48
48
|
},
|
|
49
49
|
"peerDependencies": {
|
|
50
50
|
"react": ">=17.0.0",
|