diff --git a/.changeset/fluffy-mails-try.md b/.changeset/fluffy-mails-try.md new file mode 100644 index 0000000..453bc09 --- /dev/null +++ b/.changeset/fluffy-mails-try.md @@ -0,0 +1,5 @@ +--- +"@sasza/react-panzoom": minor +--- + +element disabledMove prop diff --git a/package.json b/package.json index bb8047b..1bad8b6 100644 --- a/package.json +++ b/package.json @@ -75,6 +75,6 @@ "react": ">=16.14.0" }, "dependencies": { - "panzoom-core": "1.6.0" + "panzoom-core": "1.7.0" } } diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 995dd3b..e40feb7 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -6,8 +6,8 @@ settings: dependencies: panzoom-core: - specifier: 1.6.0 - version: 1.6.0 + specifier: 1.7.0 + version: 1.7.0 devDependencies: '@changesets/cli': @@ -4940,8 +4940,8 @@ packages: engines: {node: '>=6'} dev: true - /panzoom-core@1.6.0: - resolution: {integrity: sha512-vfx374/6u9wRXZVzCRrC1FP7YEDovvQJAoAaW9glC9u6NbCu/YPzmTgvnMRvRRP6ZT8kgADW+V9dPF+CDr4eIA==} + /panzoom-core@1.7.0: + resolution: {integrity: sha512-02KSxFpYeSPoTFQkovy+3oErsHbiUKMWZ6WlxG+DqZ2f+a8GQ/0f9uFp1WLLrHqnULcrYE8jZ/fwoTFr2Rw35A==} dev: false /parent-module@1.0.1: diff --git a/src/Element.tsx b/src/Element.tsx index dd135a6..7dfce09 100644 --- a/src/Element.tsx +++ b/src/Element.tsx @@ -8,6 +8,7 @@ const Element: React.FC = ({ children, className, disabled, + disabledMove, draggableSelector, family, followers, @@ -34,6 +35,7 @@ const Element: React.FC = ({ className: className || 'react-panzoom-element', id, disabled, + disabledMove, draggableSelector, family, followers, @@ -64,6 +66,7 @@ const Element: React.FC = ({ elementRef.current.setOptions(options); }, [ disabled, + disabledMove, draggableSelector, family, initialized, diff --git a/types/types.ts b/types/types.ts index 817dd4c..e1bacfe 100644 --- a/types/types.ts +++ b/types/types.ts @@ -86,7 +86,7 @@ export type PanZoomOptions = { zoomInitial?: number; zoomMax?: number; zoomMin?: number; - zoomPosition?: ZoomPosition; + zoomPosition?: ZoomPosition | null; zoomSpeed?: number; } & Size @@ -164,6 +164,7 @@ type ElementOnContextMenu = ( export type ElementOptions = { className?: string; disabled?: boolean; + disabledMove?: boolean; draggableSelector?: string; family?: string; followers?: Array;