@wordpress/image-cropper 1.3.1-next.v.202602091733.0 → 1.4.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.
- package/CHANGELOG.md +2 -0
- package/package.json +5 -5
- package/src/stories/index.story.tsx +4 -2
package/CHANGELOG.md
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wordpress/image-cropper",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"description": "A basic image cropper component.",
|
|
5
5
|
"author": "The WordPress Contributors",
|
|
6
6
|
"license": "GPL-2.0-or-later",
|
|
@@ -44,9 +44,9 @@
|
|
|
44
44
|
"types": "build-types",
|
|
45
45
|
"sideEffects": false,
|
|
46
46
|
"dependencies": {
|
|
47
|
-
"@wordpress/components": "^32.2.
|
|
48
|
-
"@wordpress/element": "^6.
|
|
49
|
-
"@wordpress/i18n": "^6.
|
|
47
|
+
"@wordpress/components": "^32.2.0",
|
|
48
|
+
"@wordpress/element": "^6.40.0",
|
|
49
|
+
"@wordpress/i18n": "^6.13.0",
|
|
50
50
|
"clsx": "^2.1.1",
|
|
51
51
|
"dequal": "^2.0.3",
|
|
52
52
|
"react-easy-crop": "^5.4.2"
|
|
@@ -58,5 +58,5 @@
|
|
|
58
58
|
"publishConfig": {
|
|
59
59
|
"access": "public"
|
|
60
60
|
},
|
|
61
|
-
"gitHead": "
|
|
61
|
+
"gitHead": "376124aa10dbc2cc0c81c964ec00b99fcfee5382"
|
|
62
62
|
}
|
|
@@ -55,7 +55,7 @@ const WithControlsComponent = ( args: ImageCropperProps ) => {
|
|
|
55
55
|
|
|
56
56
|
const WithControlsContent = ( args: ImageCropperProps ) => {
|
|
57
57
|
const { cropperState, setCropperState } = useImageCropper();
|
|
58
|
-
const containerRef = useRef< HTMLDivElement
|
|
58
|
+
const containerRef = useRef< HTMLDivElement >( null );
|
|
59
59
|
const { containerStyle, handleOnload } = useHandleOnload( containerRef );
|
|
60
60
|
const handleRotateLeft = useCallback( () => {
|
|
61
61
|
setCropperState( { rotation: cropperState.rotation - 90 } );
|
|
@@ -238,7 +238,9 @@ export const WithControls = {
|
|
|
238
238
|
* @param containerRef - The ref to the container element.
|
|
239
239
|
* @return The container style and the handleOnload function.
|
|
240
240
|
*/
|
|
241
|
-
function useHandleOnload(
|
|
241
|
+
function useHandleOnload(
|
|
242
|
+
containerRef: React.RefObject< HTMLDivElement | null >
|
|
243
|
+
) {
|
|
242
244
|
const [ containerStyle, setContainerStyle ] = useState< {
|
|
243
245
|
minHeight?: string;
|
|
244
246
|
minWidth?: string;
|