Skip to content

Commit

Permalink
Merge pull request #141 from sasza2/develop
Browse files Browse the repository at this point in the history
feat: onStartResizing element callback
  • Loading branch information
sasza2 authored Jan 11, 2024
2 parents ef78901 + fa0462a commit 50b9791
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@sasza/react-panzoom",
"version": "1.11.4",
"version": "1.12.0",
"description": "React component for pan and zoom with possibility to moving, resizing and selecting elements inside",
"main": "dist/main.umd.cjs",
"module": "./dist/main.js",
Expand Down
3 changes: 3 additions & 0 deletions src/Element.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ const Element: React.FC<ElementProps> = ({
onClick,
onContextMenu,
onMouseUp,
onStartResizing,
resizable,
resizedMaxWidth,
resizedMinWidth,
Expand All @@ -41,6 +42,7 @@ const Element: React.FC<ElementProps> = ({
onClick,
onContextMenu,
onMouseUp,
onStartResizing,
resizable,
resizedMaxWidth,
resizedMinWidth,
Expand Down Expand Up @@ -72,6 +74,7 @@ const Element: React.FC<ElementProps> = ({
onClick,
onContextMenu,
onMouseUp,
onStartResizing,
resizable,
resizedMaxWidth,
resizedMinWidth,
Expand Down
7 changes: 7 additions & 0 deletions types/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,12 @@ export type Element = {
position: Position;
};

type ElementOnStartResizing = (
props: {
id: ElementId;
}
) => unknown;

type ElementOnAfterResize = (
props: {
id: ElementId;
Expand Down Expand Up @@ -161,6 +167,7 @@ export type ElementOptions = {
onClick?: ElementOnClick;
onContextMenu?: ElementOnContextMenu;
onMouseUp?: ElementOnMouseUp;
onStartResizing?: ElementOnStartResizing;
resizable?: boolean;
resizedMaxWidth?: number;
resizedMinWidth?: number;
Expand Down

0 comments on commit 50b9791

Please sign in to comment.