UNPKG

point-focus

Version:

A React component for zooming and focusing on image points via click, drag, or cursor.

1 lines 59.9 kB
{"version":3,"file":"index.cjs","sources":["../node_modules/style-inject/dist/style-inject.es.js","../src/utils/globalUtils.tsx","../src/utils/movementUtils.tsx","../src/assets/svgCollection.tsx","../src/components/BaseImage.tsx","../src/components/ZoomImage.tsx","../src/utils/animations.tsx","../src/ImageMagnifier.tsx"],"sourcesContent":["function styleInject(css, ref) {\n if ( ref === void 0 ) ref = {};\n var insertAt = ref.insertAt;\n\n if (!css || typeof document === 'undefined') { return; }\n\n var head = document.head || document.getElementsByTagName('head')[0];\n var style = document.createElement('style');\n style.type = 'text/css';\n\n if (insertAt === 'top') {\n if (head.firstChild) {\n head.insertBefore(style, head.firstChild);\n } else {\n head.appendChild(style);\n }\n } else {\n head.appendChild(style);\n }\n\n if (style.styleSheet) {\n style.styleSheet.cssText = css;\n } else {\n style.appendChild(document.createTextNode(css));\n }\n}\n\nexport default styleInject;\n","import React from 'react'\nimport { IImageTypes, ZoomFallbackBoundaryProps, ZoomFallbackBoundaryState } from '../ImageMagnifier.types'\n\nexport type PageCoords = { x: number; y: number }\nexport type OffSetCoords = { left: number; top: number }\nexport type PageDimensions = { width: number; height: number }\n\nexport function isTouchEvent(\n e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent | React.KeyboardEvent | KeyboardEvent\n): e is TouchEvent | React.TouchEvent {\n return 'touches' in e || ('nativeEvent' in e && 'touches' in e.nativeEvent)\n}\n\n// Defaulted values to 0 to make the functions SSR safe\nexport function getPageCoords(\n e: MouseEvent | TouchEvent | React.MouseEvent | React.TouchEvent | React.KeyboardEvent | KeyboardEvent,\n fallbackElement?: HTMLElement | null\n): PageCoords {\n if ('touches' in e && e.touches && e.touches.length > 0) {\n return { x: e.touches[0].pageX, y: e.touches[0].pageY }\n } else if ('pageX' in e && 'pageY' in e) {\n return { x: (e as any).pageX, y: (e as any).pageY } // Could further narrow with type guards\n } else if (fallbackElement) {\n const rect = fallbackElement.getBoundingClientRect()\n return {\n x: rect.left + rect.width / 2,\n y: rect.top + rect.height / 2,\n }\n }\n return { x: 0, y: 0 }\n}\n\nexport const getOffsets = (pageX: number, pageY: number, left: number, top: number): PageCoords => {\n return {\n x: pageX - left,\n y: pageY - top,\n }\n}\n\nexport const getBounds = (container: HTMLDivElement | null): DOMRect | { width: number; height: number; left: number; top: number } => {\n return container ? container.getBoundingClientRect() : { width: 0, height: 0, left: 0, top: 0 }\n}\n\nexport const getRatios = (\n bounds: { width: number; height: number },\n natural: { width: number; height: number },\n zoomScale: number\n): PageCoords => {\n const scaledWidth = natural.width * zoomScale\n const scaledHeight = natural.height * zoomScale\n return {\n x: (scaledWidth - bounds.width) / bounds.width,\n y: (scaledHeight - bounds.height) / bounds.height,\n }\n}\n\nexport function clampToBounds(left: number, top: number, bounds: { minLeft: number; maxLeft: number; minTop: number; maxTop: number }): OffSetCoords {\n return {\n left: Math.max(Math.min(left, bounds.maxLeft), bounds.minLeft),\n top: Math.max(Math.min(top, bounds.maxTop), bounds.minTop),\n }\n}\nexport function calculateDragPosition(pageX: number, pageY: number, offsets: { x: number; y: number }): OffSetCoords {\n return {\n left: pageX - offsets.x,\n top: pageY - offsets.y,\n }\n}\n\nexport const getScaledDimensions = (zoomedImgRef: HTMLImageElement, zoomScale: number): PageDimensions => {\n if (!zoomedImgRef || !zoomedImgRef.naturalWidth || !zoomedImgRef.naturalHeight) {\n return { width: 0, height: 0 }\n }\n return {\n width: zoomedImgRef.naturalWidth * zoomScale,\n height: zoomedImgRef.naturalHeight * zoomScale,\n }\n}\n\nexport const getDefaults = (): IImageTypes => {\n const defaultCoordinates = { x: 0, y: 0 }\n return {\n onLoadCallback: null,\n bounds: { width: 0, height: 0, left: 0, top: 0 },\n offsets: defaultCoordinates,\n ratios: defaultCoordinates,\n scaledDimensions: { width: 0, height: 0 },\n dragStartCoords: defaultCoordinates,\n wasDragging: false,\n velocity: { vx: 0, vy: 0 },\n prevDragCoords: { x: 0, y: 0, time: 0 },\n lastDragCoords: { x: 0, y: 0, time: 0 },\n }\n}\n\nexport class ZoomFallbackBoundary extends React.Component<ZoomFallbackBoundaryProps, ZoomFallbackBoundaryState> {\n constructor(props: ZoomFallbackBoundaryProps) {\n super(props)\n this.state = { hasError: false }\n }\n\n static getDerivedStateFromError() {\n return { hasError: true }\n }\n\n componentDidCatch(error: any, info: any) {\n console.error('ZoomImage runtime error:', error, info)\n }\n\n render() {\n if (this.state.hasError) {\n return this.props.fallback ?? null\n }\n return this.props.children\n }\n}\n","import { IImageTypes } from '../ImageMagnifier.types'\nimport { calculateDragPosition, clampToBounds, getBounds, getOffsets } from './globalUtils'\n\nexport const applyMouseMove = (\n pageX: number,\n pageY: number,\n zoomContextRef: React.MutableRefObject<IImageTypes>,\n setLeft: (val: number) => void,\n setTop: (val: number) => void\n) => {\n const { left, top } = calculateDragPosition(pageX, pageY, zoomContextRef.current.offsets)\n\n const bounds = { minLeft: 0, maxLeft: zoomContextRef.current.bounds.width, minTop: 0, maxTop: zoomContextRef.current.bounds.height }\n const clamped = clampToBounds(left, top, bounds)\n setLeft(clamped.left * -zoomContextRef.current.ratios.x)\n setTop(clamped.top * -zoomContextRef.current.ratios.y)\n}\n\nexport const initializeFollowZoomPosition = (\n pageX: number,\n pageY: number,\n container: HTMLDivElement | null,\n zoomContextRef: React.MutableRefObject<IImageTypes>,\n setLeft: (val: number) => void,\n setTop: (val: number) => void\n) => {\n // SSR check: only run if window and container are available\n if (typeof window === 'undefined' || !container) {\n zoomContextRef.current.bounds = { left: 0, top: 0, width: 0, height: 0 }\n zoomContextRef.current.offsets = { x: 0, y: 0 }\n setLeft(0)\n setTop(0)\n return\n }\n\n const bounds = getBounds(container)\n zoomContextRef.current.bounds = bounds\n\n const offsets = getOffsets(window.pageXOffset, window.pageYOffset, -bounds.left, -bounds.top)\n zoomContextRef.current.offsets = offsets\n\n applyMouseMove(pageX, pageY, zoomContextRef, setLeft, setTop)\n}\n\nexport function applyDragMove(\n x: number,\n y: number,\n zoomContextRef: React.MutableRefObject<IImageTypes>,\n setLeft: (val: number) => void,\n setTop: (val: number) => void\n) {\n\n // This is setting up the animation\n const now = Date.now()\n zoomContextRef.current.prevDragCoords = zoomContextRef.current.lastDragCoords\n zoomContextRef.current.lastDragCoords = { x, y, time: now }\n\n // Calculate new position using the stored offset\n const { left: newLeft, top: newTop } = calculateDragPosition(x, y, zoomContextRef.current.dragStartCoords)\n\n // Clamp to bounds\n const { width, height } = zoomContextRef.current.bounds\n const maxLeft = 0\n const minLeft = width * -zoomContextRef.current.ratios.x\n const maxTop = 0\n const minTop = height * -zoomContextRef.current.ratios.y\n\n const clamped = clampToBounds(newLeft, newTop, { minLeft, maxLeft, minTop, maxTop })\n\n setLeft(clamped.left)\n setTop(clamped.top)\n}\n","export const CloseIcon = ({ className = 'c-zoom-close-button-icon' }: { className?: string }) => (\n <svg xmlns='http://www.w3.org/2000/svg' className={className} viewBox='0 0 24 24' fill='none'>\n <path\n fillRule='evenodd'\n clipRule='evenodd'\n d='M5.29289 5.29289C5.68342 4.90237 6.31658 4.90237 6.70711 5.29289L12 10.5858L17.2929 5.29289C17.6834 4.90237 18.3166 4.90237 18.7071 5.29289C19.0976 5.68342 19.0976 6.31658 18.7071 6.70711L13.4142 12L18.7071 17.2929C19.0976 17.6834 19.0976 18.3166 18.7071 18.7071C18.3166 19.0976 17.6834 19.0976 17.2929 18.7071L12 13.4142L6.70711 18.7071C6.31658 19.0976 5.68342 19.0976 5.29289 18.7071C4.90237 18.3166 4.90237 17.6834 5.29289 17.2929L10.5858 12L5.29289 6.70711C4.90237 6.31658 4.90237 5.68342 5.29289 5.29289Z'\n fill='#000'\n />\n </svg>\n)\n\nexport const FallbackImage = ({ className = 'c-fp-fallback-image' }: { className?: string }) => (\n <svg className={className} viewBox='0 0 2153 1548' fill='none' xmlns='http://www.w3.org/2000/svg'>\n <rect width='100%' height='100%' fill='white' />\n <path\n d='M762 504.5H1392C1425.97 504.5 1453.5 532.034 1453.5 566V982C1453.5 1015.97 1425.97 1043.5 1392 1043.5H762C728.034 1043.5 700.5 1015.97 700.5 982V566C700.5 532.034 728.034 504.5 762 504.5Z'\n fill='#EBEEF0'\n stroke='#8495A2'\n strokeWidth='25'\n />\n <path\n d='M901.252 812.329C880.253 832.829 710.25 1012.23 707.251 1014.33C704.252 1016.43 728.751 1038.83 745.252 1038.83C761.752 1038.83 1381.75 1039.33 1388.25 1038.83C1394.75 1038.33 1443.75 1036.33 1445.75 981.832C1447.75 927.332 1445.75 946.332 1445.75 946.332C1445.75 946.332 1243.75 723.83 1225.75 705.829C1207.75 687.827 1194.25 681.832 1170.25 705.829C1146.25 729.826 1012.47 866.329 1012.47 866.329C1012.47 866.329 976.253 827.329 957.752 808.829C939.252 790.329 922.252 791.829 901.252 812.329Z'\n fill='#CBD4DB'\n />\n <path\n d='M1056.25 912.329L1012.47 866.329M1012.47 866.329C1012.47 866.329 976.253 827.329 957.752 808.829C939.252 790.329 922.252 791.829 901.252 812.329C880.253 832.829 710.25 1012.23 707.251 1014.33C704.252 1016.43 728.751 1038.83 745.252 1038.83C761.752 1038.83 1381.75 1039.33 1388.25 1038.83C1394.75 1038.33 1443.75 1036.33 1445.75 981.832C1447.75 927.332 1445.75 946.332 1445.75 946.332C1445.75 946.332 1243.75 723.83 1225.75 705.829C1207.75 687.827 1194.25 681.832 1170.25 705.829C1146.25 729.826 1012.47 866.329 1012.47 866.329Z'\n stroke='#8595A1'\n strokeWidth='25'\n strokeLinecap='round'\n />\n <circle cx='891.5' cy='689.5' r='60' fill='#CBD4DA' stroke='#8496A2' strokeWidth='25' />\n </svg>\n)\n","import React from 'react'\nimport { IBaseImageTypes } from '../ImageMagnifier.types'\nimport styles from '../styles.module.scss'\nimport { FallbackImage } from '../assets/svgCollection'\n\nconst BaseImage = ({\n src,\n sources,\n baseImageStyle = {},\n isZoomed,\n fadeDuration,\n baseImageClassName,\n alt,\n loadingPlaceholder,\n errorPlaceholder,\n onError,\n disableLoadingFallbacks = false,\n disableErrorFallbacks = false,\n}: IBaseImageTypes) => {\n const imgRef = React.useRef<HTMLImageElement | null>(null)\n const [isLoading, setIsLoading] = React.useState(true)\n const [hasError, setHasError] = React.useState(false)\n\n React.useEffect(() => {\n setIsLoading(true)\n setHasError(false)\n }, [src])\n\n const handleLoad = () => {\n setIsLoading(false)\n }\n\n const handleError = () => {\n setHasError(true)\n setIsLoading(false)\n onError?.()\n }\n\n React.useEffect(() => {\n const img = imgRef.current\n if (img && img.complete && img.naturalWidth > 0) {\n handleLoad()\n }\n }, [src])\n\n const imageStyle = React.useMemo(\n () => ({\n '--fade-duration': `${isZoomed ? fadeDuration : 0}ms`,\n ...baseImageStyle,\n }),\n [isZoomed, fadeDuration, baseImageStyle]\n )\n\n const imageClass = [styles['c-point-focus__img'], baseImageClassName].filter(Boolean).join(' ')\n\n const defaultImg =\n !hasError && src ? (\n <img\n ref={imgRef}\n alt={alt}\n src={src}\n style={imageStyle}\n onLoad={handleLoad}\n onError={handleError}\n className={imageClass}\n data-hidden={isZoomed}\n data-testid='pf-base-image'\n crossOrigin='anonymous'\n />\n ) : null\n\n const wrappedImage =\n sources && sources.length > 0 ? (\n <picture style={{ width: '100%', height: '100%' }}>\n {sources\n .filter(s => s.srcSet)\n .map((source, i) => (\n <source key={i} {...source} />\n ))}\n {defaultImg}\n </picture>\n ) : (\n defaultImg\n )\n\n return (\n <>\n {wrappedImage}\n\n {!disableLoadingFallbacks && isLoading && !hasError && (\n <div className={styles['c-point-focus__placeholder']} style={{ zIndex: 0 }} data-testid='pf-base-loading'>\n {loadingPlaceholder ?? <span className={styles['c-point-focus__loader']} />}\n </div>\n )}\n\n {!disableErrorFallbacks && hasError && (\n <div className={styles['c-point-focus__placeholder']} style={{ zIndex: 0 }} data-testid='pf-base-error'>\n {errorPlaceholder ?? <FallbackImage />}\n </div>\n )}\n </>\n )\n}\n\nexport default BaseImage\n","import React from 'react'\nimport { IZoomImageTypes } from '../ImageMagnifier.types'\nimport styles from '../styles.module.scss'\nimport { CloseIcon, FallbackImage } from '../assets/svgCollection'\n\nconst ZoomImage = React.forwardRef<HTMLImageElement, IZoomImageTypes>(\n (\n {\n src,\n fadeDuration,\n top,\n left,\n isZoomed,\n onLoad,\n onDragStart,\n onDragEnd,\n onClose,\n onFadeOut,\n closeButtonRef,\n onTouchStart,\n onTouchEnd,\n zoomImageClassName,\n closeButtonClassName,\n alt,\n closeButtonAriaLabel,\n zoomImageAriaLabel,\n onKeyDown,\n closeButtonContent,\n onError,\n loadingPlaceholder,\n errorPlaceholder,\n zoomScale,\n disableLoadingFallbacks = false,\n disableErrorFallbacks = false,\n },\n ref\n ) => {\n const [isLoading, setIsLoading] = React.useState(true)\n const [hasError, setHasError] = React.useState(false)\n\n React.useEffect(() => {\n if (!isZoomed) {\n setIsLoading(true)\n setHasError(false)\n }\n }, [isZoomed])\n\n const handleLoad = (e: React.SyntheticEvent<HTMLImageElement>) => {\n setIsLoading(false)\n onLoad?.(e)\n }\n\n const handleError = () => {\n setIsLoading(false)\n setHasError(true)\n onError?.()\n }\n\n const zoomImgClass = [styles['c-point-focus__zoom-img'], zoomImageClassName].filter(Boolean).join(' ')\n\n return (\n <>\n <img\n ref={ref}\n data-testid='pf-zoom-image'\n data-visible={isZoomed}\n className={zoomImgClass}\n style={{\n transform: `translate(${left}px, ${top}px) scale(${zoomScale})`,\n transformOrigin: 'top left',\n transition: `opacity ${fadeDuration}ms linear, visibility ${fadeDuration}ms linear`,\n }}\n src={src}\n onLoad={handleLoad}\n onError={handleError}\n onMouseDown={onDragStart}\n onMouseUp={onDragEnd}\n onTouchStart={onTouchStart}\n onTouchEnd={onTouchEnd}\n onTransitionEnd={onFadeOut}\n draggable={false}\n alt={`${alt} zoomed`}\n aria-label={zoomImageAriaLabel}\n onKeyDown={onKeyDown}\n tabIndex={0}\n />\n\n {!disableErrorFallbacks && hasError && isZoomed && (\n <div className={styles['c-point-focus__placeholder']} data-testid='pf-zoom-error'>\n {errorPlaceholder ?? <FallbackImage />}\n </div>\n )}\n\n {!disableLoadingFallbacks && isLoading && !hasError && isZoomed && (\n <div className={styles['c-point-focus__placeholder']} data-testid='pf-zoom-loading'>\n {loadingPlaceholder ?? <span className={styles['c-point-focus__loader']} />}\n </div>\n )}\n\n {onClose && (\n <button\n type='button'\n ref={closeButtonRef}\n title='Close Zoom'\n data-testid='pf-close-button'\n aria-label={closeButtonAriaLabel ?? 'Zoom out'}\n data-visible={isZoomed}\n data-action-type='close'\n className={closeButtonClassName || styles['c-point-focus__button']}\n style={{\n transition: `opacity ${fadeDuration}ms linear, visibility ${fadeDuration}ms linear`,\n }}\n onClick={() => onClose?.('click')}\n onKeyDown={onKeyDown}>\n {closeButtonContent ?? <CloseIcon />}\n </button>\n )}\n </>\n )\n }\n)\n\nZoomImage.displayName = 'ZoomImage'\nexport default ZoomImage\n","import { InertiaOptions } from '../ImageMagnifier.types'\nimport { clampToBounds } from './globalUtils'\n\nexport function startInertia({\n initialLeft,\n initialTop,\n velocity,\n setLeft,\n setTop,\n bounds,\n friction = 0.95,\n minVelocity = 10,\n onEnd,\n contextRef,\n}: InertiaOptions & { contextRef: React.MutableRefObject<any> }) {\n let left = initialLeft\n let top = initialTop\n let vx = velocity.vx\n let vy = velocity.vy\n\n function step() {\n vx *= friction\n vy *= friction\n\n left += vx * (1 / 60)\n top += vy * (1 / 60)\n\n const clamped = clampToBounds(left, top, bounds)\n setLeft(clamped.left)\n setTop(clamped.top)\n\n if (Math.abs(vx) > minVelocity || Math.abs(vy) > minVelocity) {\n contextRef.current.rafId = requestAnimationFrame(step) // 👈 Store rafId\n } else {\n contextRef.current.rafId = null\n setLeft(clamped.left)\n setTop(clamped.top)\n onEnd?.()\n }\n }\n\n contextRef.current.rafId = requestAnimationFrame(step)\n}\n","import React from 'react'\nimport { getBounds, getDefaults, getOffsets, getPageCoords, getRatios, isTouchEvent, ZoomFallbackBoundary } from './utils/globalUtils'\nimport { applyMouseMove, initializeFollowZoomPosition, applyDragMove } from './utils/movementUtils'\nimport { IImageMagnifierTypes, IImageTypes, IInteractionTYpe, IZoomImageTypes } from './ImageMagnifier.types'\nimport styles from './styles.module.scss'\n\nimport BaseImage from './components/BaseImage'\nimport ZoomImage from './components/ZoomImage'\nimport { startInertia } from './utils/animations'\nimport { FallbackImage } from './assets/svgCollection'\n\nconst ImageMagnifier = ({\n src,\n sources,\n width,\n height,\n zoomSrc,\n zoomScale = 1,\n zoomPreload,\n fadeDuration = 150,\n moveType = 'follow',\n zoomType = 'click',\n baseImageStyle,\n hideCloseButton,\n containerClassName,\n baseImageClassName,\n zoomImageClassName,\n closeButtonClassName,\n onMouseEnter,\n onZoomedMouseMove,\n onMouseLeave,\n onClickImage,\n onZoom,\n onClose,\n afterZoomImgLoaded,\n afterZoomOut,\n onBaseImageError,\n onZoomImageError,\n onDragStart,\n onDragEnd,\n alt,\n containerAriaLabel,\n closeButtonAriaLabel,\n zoomImageAriaLabel,\n tabIndex = 0,\n closeButtonContent,\n overlay,\n disableDrag,\n disableInertia,\n loadingPlaceholder,\n errorPlaceholder,\n clickToZoomOut = false,\n externalZoomState,\n setExternalZoomState,\n disableMobile,\n disableLoadingFallbacks,\n disableErrorFallbacks,\n}: IImageMagnifierTypes) => {\n const containerRef = React.useRef<HTMLDivElement | null>(null)\n const closeButtonRef = React.useRef<HTMLButtonElement | null>(null)\n const zoomedImgRef = React.useRef<HTMLImageElement | null>(null)\n const zoomContextRef = React.useRef<IImageTypes>(getDefaults())\n\n const isControlled = externalZoomState !== undefined\n const [internalZoom, setInternalZoom] = React.useState(false)\n const isZoomed = isControlled ? externalZoomState : internalZoom\n\n const [isActive, setIsActive] = React.useState<boolean | undefined>(zoomPreload)\n const [isDragging, setIsDragging] = React.useState<boolean>(false)\n const [isFading, setIsFading] = React.useState<boolean>(false)\n const [left, setLeft] = React.useState<number>(0)\n const [top, setTop] = React.useState<number>(0)\n\n const safeZoomScale = Math.max(1, Math.min(zoomScale, 5))\n\n const updateZoomState = (val: boolean) => {\n if (isControlled) {\n setExternalZoomState?.(val)\n } else {\n setInternalZoom(val)\n }\n }\n\n const zoomIn = (pageX: number, pageY: number, method: IInteractionTYpe) => {\n updateZoomState(true)\n initializeFollowZoomPosition(pageX, pageY, containerRef.current, zoomContextRef, setLeft, setTop)\n onZoom?.({ at: { x: pageX, y: pageY }, method: method })\n\n setTimeout(() => {\n closeButtonRef.current?.focus()\n }, 0)\n }\n\n const zoomOut = () => {\n if (!zoomPreload) {\n setIsFading(true)\n }\n\n zoomContextRef.current.onLoadCallback = null\n zoomContextRef.current.wasDragging = false\n zoomContextRef.current.dragStartCoords = { x: 0, y: 0 }\n zoomContextRef.current.velocity = null\n zoomContextRef.current.prevDragCoords = null\n zoomContextRef.current.lastDragCoords = null\n\n setLeft(0)\n setTop(0)\n updateZoomState(false)\n }\n\n const handleDragStart = React.useCallback(\n (e: React.MouseEvent | React.TouchEvent) => {\n if (!isZoomed || disableDrag || (disableMobile && isTouchEvent(e))) return\n\n if (zoomContextRef.current.rafId != null) {\n cancelAnimationFrame(zoomContextRef.current.rafId)\n zoomContextRef.current.rafId = null\n }\n\n const { x, y } = getPageCoords(e)\n setIsDragging(true)\n zoomContextRef.current.dragStartCoords = getOffsets(x, y, left, top)\n onDragStart?.({\n start: { x, y },\n source: isTouchEvent(e) ? 'touch' : 'mouse',\n })\n },\n [isZoomed, disableDrag, disableMobile, left, top, onDragStart]\n )\n\n const handleDragMove = React.useCallback(\n (e: MouseEvent | TouchEvent) => {\n if (!isDragging) return\n const { x, y } = getPageCoords(e)\n applyDragMove(x, y, zoomContextRef, setLeft, setTop)\n if ('touches' in e) e.preventDefault?.()\n },\n [isDragging, setLeft, setTop]\n )\n\n const handleDragEnd = React.useCallback(() => {\n setIsDragging(false)\n zoomContextRef.current.dragStartCoords = { x: 0, y: 0 }\n\n // Animation on end\n // Calculate velocity\n const last = zoomContextRef.current.lastDragCoords\n const prev = zoomContextRef.current.prevDragCoords\n\n let vx = 0,\n vy = 0\n if (last && prev) {\n const dt = (last.time - prev.time) / 1000\n if (dt > 0) {\n vx = (last.x - prev.x) / dt\n vy = (last.y - prev.y) / dt\n }\n }\n zoomContextRef.current.velocity = { vx, vy }\n\n // Calculate bounds\n const { width, height } = zoomContextRef.current.bounds\n const maxLeft = 0\n const minLeft = width * -zoomContextRef.current.ratios.x\n const maxTop = 0\n const minTop = height * -zoomContextRef.current.ratios.y\n\n if (!disableInertia) {\n startInertia({\n initialLeft: left,\n initialTop: top,\n velocity: { vx, vy },\n setLeft,\n setTop,\n bounds: { minLeft, maxLeft, minTop, maxTop },\n friction: 0.95,\n minVelocity: 10,\n onEnd: () => {\n // Optionally, snap to bounds or do something else\n },\n contextRef: zoomContextRef,\n })\n }\n onDragEnd?.({\n velocity: { vx, vy },\n final: { x: left, y: top },\n })\n }, [disableInertia, left, top, setLeft, setTop, onDragEnd])\n\n const applyImageLoad = (el: HTMLImageElement) => {\n const naturalDimensions = {\n width: el.naturalWidth,\n height: el.naturalHeight,\n }\n\n const bounds = getBounds(containerRef.current)\n\n zoomedImgRef.current = el\n\n zoomContextRef.current.scaledDimensions = {\n width: naturalDimensions.width * safeZoomScale,\n height: naturalDimensions.height * safeZoomScale,\n }\n\n zoomContextRef.current.bounds = bounds\n zoomContextRef.current.ratios = getRatios(bounds, naturalDimensions, safeZoomScale)\n\n if (zoomContextRef.current.onLoadCallback) {\n zoomContextRef.current.onLoadCallback()\n zoomContextRef.current.onLoadCallback = null\n }\n }\n\n const handleLoad = React.useCallback(\n (e: React.SyntheticEvent<HTMLImageElement>) => {\n applyImageLoad(e.currentTarget)\n afterZoomImgLoaded?.()\n },\n [applyImageLoad, afterZoomImgLoaded]\n )\n\n const handleClose = React.useCallback(\n (method: IInteractionTYpe) => {\n onClose?.({ triggeredBy: method })\n zoomOut()\n },\n [onClose, zoomOut]\n )\n\n const handleClick = React.useCallback(\n (e: React.MouseEvent | React.TouchEvent, method: IInteractionTYpe) => {\n if (disableMobile && isTouchEvent(e)) return\n\n const { x, y } = getPageCoords(e)\n onClickImage?.({ x, y, source: isTouchEvent(e) ? 'touch' : 'mouse' })\n\n if (zoomContextRef.current.wasDragging) {\n zoomContextRef.current.wasDragging = false\n return\n }\n\n if (isZoomed) {\n if (clickToZoomOut) {\n handleClose(method)\n }\n return\n } // is important to keep it to avoid issues when dragging the image with the animation\n\n if (zoomedImgRef.current) {\n applyImageLoad(zoomedImgRef.current)\n zoomIn(x, y, method)\n } else {\n zoomContextRef.current.onLoadCallback = () => zoomIn(x, y, method)\n }\n },\n [disableMobile, isTouchEvent, getPageCoords, onClickImage, isZoomed, clickToZoomOut, handleClose, applyImageLoad, zoomIn]\n )\n\n const handleKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n if ((e.key === 'Enter' || e.key === ' ') && !isZoomed) {\n e.preventDefault()\n const { x, y } = getPageCoords(e, containerRef.current)\n zoomIn(x, y, 'keyboard')\n }\n\n if (e.key === 'Escape' && isZoomed) {\n e.preventDefault()\n handleClose('keyboard')\n }\n },\n [isZoomed, getPageCoords, zoomIn, handleClose]\n )\n\n const handleZoomLayerKeyDown = React.useCallback(\n (e: React.KeyboardEvent) => {\n if (e.key === 'Escape' && isZoomed) {\n e.preventDefault()\n handleClose('keyboard')\n }\n },\n [isZoomed, handleClose]\n )\n\n const throttledZoomedMouseMove = React.useCallback(\n (x: number, y: number, bounds: DOMRect) => {\n zoomContextRef.current.lastMoveEvent = { x, y, bounds }\n if (zoomContextRef.current.rafId == null) {\n zoomContextRef.current.rafId = window.requestAnimationFrame(() => {\n const evt = zoomContextRef.current.lastMoveEvent\n if (evt && onZoomedMouseMove) {\n onZoomedMouseMove(evt)\n }\n zoomContextRef.current.rafId = null\n })\n }\n },\n [onZoomedMouseMove]\n )\n\n const handleMouseEnter = React.useCallback(\n (e: React.MouseEvent | React.TouchEvent) => {\n setIsActive(true)\n setIsFading(false)\n onMouseEnter?.({ source: isTouchEvent(e) ? 'touch' : 'mouse' })\n if (zoomType === 'hover' && !isZoomed && !(disableMobile && isTouchEvent(e))) {\n handleClick(e, 'hover')\n }\n },\n [setIsActive, setIsFading, onMouseEnter, zoomType, isZoomed, disableMobile, handleClick]\n )\n const handleMouseMove = React.useCallback(\n (e: React.MouseEvent | React.TouchEvent) => {\n if (moveType === 'follow' && isZoomed) {\n const { x, y } = getPageCoords(e)\n const bounds = zoomContextRef.current.bounds as DOMRect\n if (!bounds || typeof bounds.left !== 'number') return\n throttledZoomedMouseMove(x, y, zoomContextRef.current.bounds as DOMRect)\n applyMouseMove(x, y, zoomContextRef, setLeft, setTop)\n }\n },\n [moveType, isZoomed, throttledZoomedMouseMove, setLeft, setTop]\n )\n\n const handleMouseLeave = React.useCallback(\n (e: React.MouseEvent | React.TouchEvent) => {\n onMouseLeave?.({ source: isTouchEvent(e) ? 'touch' : 'mouse' })\n handleClose('hover')\n },\n [onMouseLeave, handleClose]\n )\n\n const handleFadeOut = React.useCallback(\n (e?: React.TransitionEvent<HTMLImageElement> | TransitionEvent, noTransition?: boolean) => {\n if (noTransition || (e && 'propertyName' in e && e.propertyName === 'opacity' && containerRef?.current?.contains(e.target as Node))) {\n if (!zoomPreload) {\n zoomedImgRef.current = null\n zoomContextRef.current = getDefaults()\n setIsActive(false)\n }\n setIsFading(false)\n afterZoomOut?.()\n }\n },\n [zoomPreload, setIsActive, setIsFading, afterZoomOut]\n )\n\n React.useEffect(() => {\n zoomContextRef.current = getDefaults()\n return () => {\n if (zoomContextRef.current.rafId != null) {\n cancelAnimationFrame(zoomContextRef.current.rafId)\n zoomContextRef.current.rafId = null\n }\n }\n }, [])\n\n React.useEffect(() => {\n if (isDragging && !disableDrag) {\n window.addEventListener('mousemove', handleDragMove)\n window.addEventListener('mouseup', handleDragEnd)\n window.addEventListener('touchmove', handleDragMove, { passive: false })\n window.addEventListener('touchend', handleDragEnd)\n return () => {\n window.removeEventListener('mousemove', handleDragMove)\n window.removeEventListener('mouseup', handleDragEnd)\n window.removeEventListener('touchmove', handleDragMove)\n window.removeEventListener('touchend', handleDragEnd)\n }\n }\n }, [isDragging])\n\n const zoomImageProps: IZoomImageTypes = {\n src: zoomSrc || src,\n fadeDuration: fadeDuration,\n top,\n left,\n isZoomed,\n onLoad: handleLoad,\n onError: onZoomImageError,\n onDragStart: moveType === 'drag' && !disableDrag ? handleDragStart : undefined,\n onDragEnd: moveType === 'drag' && !disableDrag ? handleDragEnd : undefined,\n onTouchStart: handleDragStart,\n onTouchEnd: handleDragEnd,\n onClose: !hideCloseButton ? handleClose : undefined,\n onFadeOut: isFading ? handleFadeOut : undefined,\n closeButtonRef: closeButtonRef,\n zoomImageClassName: zoomImageClassName,\n closeButtonClassName: closeButtonClassName,\n alt: alt,\n closeButtonAriaLabel: closeButtonAriaLabel,\n zoomImageAriaLabel: zoomImageAriaLabel,\n onKeyDown: handleZoomLayerKeyDown,\n closeButtonContent: closeButtonContent,\n loadingPlaceholder: loadingPlaceholder,\n errorPlaceholder: errorPlaceholder,\n zoomScale: safeZoomScale,\n disableLoadingFallbacks: disableLoadingFallbacks,\n disableErrorFallbacks: disableErrorFallbacks,\n }\n\n const containerClass = [styles['c-point-focus'], containerClassName].filter(Boolean).join(' ')\n\n return (\n <figure\n role='group'\n ref={containerRef}\n tabIndex={tabIndex}\n data-movetype={moveType}\n data-testid='pf-image-magnifier-container'\n aria-label={containerAriaLabel ?? 'Zoomable image'}\n className={containerClass}\n style={{ width: width, height: height }}\n onClick={e => handleClick(e, 'hover')}\n onTouchStart={e => {\n if (disableMobile) {\n e.preventDefault()\n }\n }}\n onKeyDown={handleKeyDown}\n onMouseEnter={handleMouseEnter}\n onMouseMove={isZoomed ? handleMouseMove : undefined}\n onMouseLeave={handleMouseLeave}>\n <BaseImage\n src={src}\n alt={alt}\n sources={sources}\n width={width}\n height={height}\n baseImageStyle={baseImageStyle}\n baseImageClassName={baseImageClassName}\n fadeDuration={fadeDuration}\n isZoomed={isZoomed}\n onError={onBaseImageError}\n loadingPlaceholder={loadingPlaceholder}\n errorPlaceholder={errorPlaceholder}\n disableLoadingFallbacks={disableLoadingFallbacks}\n disableErrorFallbacks={disableErrorFallbacks}\n />\n {isActive && (\n <>\n {overlay && (\n <div className={styles['c-point-focus__overlay']} data-testid='pf-overlay'>\n {overlay}\n </div>\n )}\n <ZoomFallbackBoundary fallback={errorPlaceholder ?? <FallbackImage />}>\n <ZoomImage key={isZoomed && clickToZoomOut ? 'zoomed' : 'unzoomed'} ref={zoomedImgRef} {...zoomImageProps} />\n </ZoomFallbackBoundary>\n </>\n )}\n </figure>\n )\n}\n\nexport default ImageMagnifier\n"],"names":["_jsx","_jsxs","_Fragment"],"mappings":";;;;;AAAA,SAAS,WAAW,CAAC,GAAG,EAAE,GAAG,EAAE;AAC/B,EAAE,KAAK,GAAG,KAAK,KAAK,CAAC,GAAG,GAAG,GAAG,EAAE,CAAC;AACjC,EAAE,IAAI,QAAQ,GAAG,GAAG,CAAC,QAAQ,CAAC;AAC9B;AACA,EAAE,IAAI,CAAC,GAAG,IAAI,OAAO,QAAQ,KAAK,WAAW,EAAE,EAAE,OAAO,EAAE;AAC1D;AACA,EAAE,IAAI,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,QAAQ,CAAC,oBAAoB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC;AACvE,EAAE,IAAI,KAAK,GAAG,QAAQ,CAAC,aAAa,CAAC,OAAO,CAAC,CAAC;AAC9C,EAAE,KAAK,CAAC,IAAI,GAAG,UAAU,CAAC;AAC1B;AACA,EAAE,IAAI,QAAQ,KAAK,KAAK,EAAE;AAC1B,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;AACzB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;AAChD,KAAK,MAAM;AACX,MAAM,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC9B,KAAK;AACL,GAAG,MAAM;AACT,IAAI,IAAI,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC;AAC5B,GAAG;AACH;AACA,EAAE,IAAI,KAAK,CAAC,U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