@arbidocs/react 0.4.47 → 0.4.49
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/dist/index.cjs +23 -13
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +23 -13
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.cts
CHANGED
|
@@ -5003,10 +5003,12 @@ interface ImageCropperProps {
|
|
|
5003
5003
|
minZoom?: number;
|
|
5004
5004
|
maxZoom?: number;
|
|
5005
5005
|
className?: string;
|
|
5006
|
+
/** Classes for the image area, e.g. a taller height than the default `h-72`. */
|
|
5007
|
+
cropAreaClassName?: string;
|
|
5006
5008
|
/** The crop rectangle (source pixels) + the active aspect, on every change. */
|
|
5007
5009
|
onCropComplete?: (area: CropArea, aspect: number) => void;
|
|
5008
5010
|
}
|
|
5009
|
-
declare function ImageCropper({ image, aspect, aspectOptions, cropShape, minZoom, maxZoom, className, onCropComplete, }: ImageCropperProps): React$1.JSX.Element;
|
|
5011
|
+
declare function ImageCropper({ image, aspect, aspectOptions, cropShape, minZoom, maxZoom, className, cropAreaClassName, onCropComplete, }: ImageCropperProps): React$1.JSX.Element;
|
|
5010
5012
|
|
|
5011
5013
|
interface ImageCropModalProps {
|
|
5012
5014
|
open: boolean;
|
package/dist/index.d.ts
CHANGED
|
@@ -5003,10 +5003,12 @@ interface ImageCropperProps {
|
|
|
5003
5003
|
minZoom?: number;
|
|
5004
5004
|
maxZoom?: number;
|
|
5005
5005
|
className?: string;
|
|
5006
|
+
/** Classes for the image area, e.g. a taller height than the default `h-72`. */
|
|
5007
|
+
cropAreaClassName?: string;
|
|
5006
5008
|
/** The crop rectangle (source pixels) + the active aspect, on every change. */
|
|
5007
5009
|
onCropComplete?: (area: CropArea, aspect: number) => void;
|
|
5008
5010
|
}
|
|
5009
|
-
declare function ImageCropper({ image, aspect, aspectOptions, cropShape, minZoom, maxZoom, className, onCropComplete, }: ImageCropperProps): React$1.JSX.Element;
|
|
5011
|
+
declare function ImageCropper({ image, aspect, aspectOptions, cropShape, minZoom, maxZoom, className, cropAreaClassName, onCropComplete, }: ImageCropperProps): React$1.JSX.Element;
|
|
5010
5012
|
|
|
5011
5013
|
interface ImageCropModalProps {
|
|
5012
5014
|
open: boolean;
|
package/dist/index.js
CHANGED
|
@@ -4609,6 +4609,7 @@ function ImageCropper({
|
|
|
4609
4609
|
minZoom = 1,
|
|
4610
4610
|
maxZoom = 3,
|
|
4611
4611
|
className,
|
|
4612
|
+
cropAreaClassName,
|
|
4612
4613
|
onCropComplete
|
|
4613
4614
|
}) {
|
|
4614
4615
|
const [crop, setCrop] = useState({ x: 0, y: 0 });
|
|
@@ -4624,21 +4625,30 @@ function ImageCropper({
|
|
|
4624
4625
|
[onCropComplete, activeAspect]
|
|
4625
4626
|
);
|
|
4626
4627
|
return /* @__PURE__ */ jsxs("div", { className: cn("flex flex-col gap-3", className), children: [
|
|
4627
|
-
/* @__PURE__ */ jsx(
|
|
4628
|
-
|
|
4628
|
+
/* @__PURE__ */ jsx(
|
|
4629
|
+
"div",
|
|
4629
4630
|
{
|
|
4630
|
-
|
|
4631
|
-
|
|
4632
|
-
|
|
4633
|
-
|
|
4634
|
-
|
|
4635
|
-
|
|
4636
|
-
|
|
4637
|
-
|
|
4638
|
-
|
|
4639
|
-
|
|
4631
|
+
className: cn(
|
|
4632
|
+
"relative h-72 w-full overflow-hidden rounded-md bg-foreground/95",
|
|
4633
|
+
cropAreaClassName
|
|
4634
|
+
),
|
|
4635
|
+
children: /* @__PURE__ */ jsx(
|
|
4636
|
+
Cropper,
|
|
4637
|
+
{
|
|
4638
|
+
image,
|
|
4639
|
+
crop,
|
|
4640
|
+
zoom,
|
|
4641
|
+
aspect: activeAspect,
|
|
4642
|
+
cropShape,
|
|
4643
|
+
showGrid: cropShape === "rect",
|
|
4644
|
+
onCropChange: setCrop,
|
|
4645
|
+
onZoomChange: setZoom,
|
|
4646
|
+
onCropComplete: handleComplete,
|
|
4647
|
+
objectFit: "contain"
|
|
4648
|
+
}
|
|
4649
|
+
)
|
|
4640
4650
|
}
|
|
4641
|
-
)
|
|
4651
|
+
),
|
|
4642
4652
|
aspectOptions && aspectOptions.length > 1 ? /* @__PURE__ */ jsxs("div", { className: "flex flex-wrap items-center gap-1", "data-testid": "image-cropper-aspects", children: [
|
|
4643
4653
|
/* @__PURE__ */ jsx("span", { className: "mr-1 text-xs font-semibold uppercase tracking-wider text-muted-foreground", children: "Ratio" }),
|
|
4644
4654
|
aspectOptions.map((opt) => {
|