tsp-form 0.7.21 → 0.7.22
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.
|
@@ -2,12 +2,16 @@ import '../styles/image-cropper.css';
|
|
|
2
2
|
export interface ImageCropperRef {
|
|
3
3
|
/** Current zoom level */
|
|
4
4
|
zoom: number;
|
|
5
|
-
/** Minimum zoom (auto-computed so image covers viewport) */
|
|
5
|
+
/** Minimum zoom (auto-computed so image covers viewport, accounting for current rotation) */
|
|
6
6
|
minZoom: number;
|
|
7
7
|
/** Maximum zoom */
|
|
8
8
|
maxZoom: number;
|
|
9
9
|
/** Set zoom level (clamped to min/max, re-centers) */
|
|
10
10
|
setZoom: (zoom: number) => void;
|
|
11
|
+
/** Current rotation in degrees */
|
|
12
|
+
rotation: number;
|
|
13
|
+
/** Set rotation in degrees (clamped to min/max). Auto-bumps zoom if needed to keep coverage. */
|
|
14
|
+
setRotation: (deg: number) => void;
|
|
11
15
|
/** Render the visible crop area to a Blob + File, returned via the callback */
|
|
12
16
|
crop: (callback: (blob: Blob, file: File) => void) => void;
|
|
13
17
|
}
|
|
@@ -23,8 +27,21 @@ export interface ImageCropperProps {
|
|
|
23
27
|
viewportWidth?: number;
|
|
24
28
|
viewportHeight?: number;
|
|
25
29
|
wheelZoom?: boolean;
|
|
26
|
-
/**
|
|
27
|
-
|
|
30
|
+
/**
|
|
31
|
+
* Exponent applied to zoom steps so they feel uniform across the zoom range.
|
|
32
|
+
* Wheel and pinch deltas advance the *curve position* (0..1) by a fixed amount, then map back to zoom.
|
|
33
|
+
* 1 = linear; >1 = finer control at low zoom, faster at high zoom. Default 2.2.
|
|
34
|
+
*/
|
|
35
|
+
zoomCurve?: number;
|
|
36
|
+
/** Enable rotation: 2-finger touch rotates, Ctrl+wheel rotates, imperative setRotation works. Default false. */
|
|
37
|
+
rotation?: boolean;
|
|
38
|
+
/** Min/max rotation in degrees. Defaults -180 to 180. */
|
|
39
|
+
minRotation?: number;
|
|
40
|
+
maxRotation?: number;
|
|
41
|
+
/** Called whenever zoom changes (from gestures or setZoom). Receives current zoom, plus the active min/max bounds. */
|
|
42
|
+
onZoomChange?: (zoom: number, minZoom: number, maxZoom: number) => void;
|
|
43
|
+
/** Called whenever rotation changes (degrees). */
|
|
44
|
+
onRotationChange?: (deg: number) => void;
|
|
28
45
|
}
|
|
29
46
|
export declare const ImageCropper: import("react").ForwardRefExoticComponent<ImageCropperProps & import("react").RefAttributes<ImageCropperRef>>;
|
|
30
47
|
//# sourceMappingURL=ImageCropper.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ImageCropper.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCropper.tsx"],"names":[],"mappings":"AAEA,OAAO,6BAA6B,CAAC;AAErC,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,
|
|
1
|
+
{"version":3,"file":"ImageCropper.d.ts","sourceRoot":"","sources":["../../../src/components/ImageCropper.tsx"],"names":[],"mappings":"AAEA,OAAO,6BAA6B,CAAC;AAErC,MAAM,WAAW,eAAe;IAC9B,yBAAyB;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,6FAA6F;IAC7F,OAAO,EAAE,MAAM,CAAC;IAChB,mBAAmB;IACnB,OAAO,EAAE,MAAM,CAAC;IAChB,sDAAsD;IACtD,OAAO,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;IAChC,kCAAkC;IAClC,QAAQ,EAAE,MAAM,CAAC;IACjB,gGAAgG;IAChG,WAAW,EAAE,CAAC,GAAG,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,+EAA+E;IAC/E,IAAI,EAAE,CAAC,QAAQ,EAAE,CAAC,IAAI,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,KAAK,IAAI,KAAK,IAAI,CAAC;CAC5D;AAED,MAAM,WAAW,iBAAiB;IAChC,GAAG,EAAE,MAAM,GAAG,IAA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