diff --git a/README.md b/README.md
index f5bf140d..235af710 100644
--- a/README.md
+++ b/README.md
@@ -75,7 +75,7 @@ With a script tag:
With a script tag from a CDN:
```html
-
+
```
## Usage
@@ -155,7 +155,7 @@ See this [stackoverflow question](https://stackoverflow.com/questions/70428922/p
> **Panzoom**(`elem`, `options`?): `[PanzoomObject](#PanzoomObject)`
-Defined in: [panzoom.ts:59](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/panzoom.ts#L59)
+Defined in: [panzoom.ts:59](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/panzoom.ts#L59)
## Parameters
@@ -179,7 +179,7 @@ Includes `MiscOptions`, `PanOptions`, and `ZoomOptions`
These options can be passed to `Panzoom()`, as well as any pan or zoom function. One exception is `force`, which can only be passed to methods like `pan()` or `zoom()`, but not `Panzoom()` or `setOptions()` as it should not be set globally.
-Defined in: [types.ts:19](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L19)
+Defined in: [types.ts:19](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L19)
## Indexable
@@ -191,7 +191,7 @@ Defined in: [types.ts:19](https://github.com/timmywil/panzoom/blob/211bc595f528e
> `optional` **animate**: `boolean` (Default: **false**)
-Defined in: [types.ts:21](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L21)
+Defined in: [types.ts:21](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L21)
Whether to animate transitions
@@ -201,7 +201,7 @@ Whether to animate transitions
> `optional` **canvas**: `boolean` (Default: **false**)
-Defined in: [types.ts:32](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L32)
+Defined in: [types.ts:32](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L32)
This option treats the Panzoom element's parent
as a canvas. Effectively, Panzoom binds the
@@ -218,7 +218,7 @@ where the `cursor` style is applied (i.e. the parent).
> `optional` **duration**: `number` (Default: **200**)
-Defined in: [types.ts:34](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L34)
+Defined in: [types.ts:34](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L34)
Duration of the transition (ms)
@@ -228,7 +228,7 @@ Duration of the transition (ms)
> `optional` **easing**: `string` (Default: **"ease-in-out"**)
-Defined in: [types.ts:36](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L36)
+Defined in: [types.ts:36](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L36)
CSS Easing used for transitions
@@ -238,7 +238,7 @@ CSS Easing used for transitions
> `optional` **exclude**: `Element`[] (Default: **[]**)
-Defined in: [types.ts:43](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L43)
+Defined in: [types.ts:43](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L43)
Add elements to this array that should be excluded
from Panzoom handling.
@@ -251,7 +251,7 @@ e.g. links and buttons that should not propagate the click event.
> `optional` **excludeClass**: `string` (Default: **"panzoom-exclude"**)
-Defined in: [types.ts:50](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L50)
+Defined in: [types.ts:50](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L50)
Add this class to any element within the Panzoom element
that you want to exclude from Panzoom handling. That
@@ -264,7 +264,7 @@ e.g. links and buttons that should not propagate the click event.
> `optional` **force**: `boolean`
-Defined in: [types.ts:66](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L66)
+Defined in: [types.ts:66](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L66)
`force` should be used sparingly to temporarily
override and ignore options such as disablePan,
@@ -291,7 +291,7 @@ panzoom.zoom(1, { force: true })
}\*\*)
-Defined in: [types.ts:91](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L91)
+Defined in: [types.ts:91](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L91)
On the first pointer event, when panning starts,
the default Panzoom behavior is to call
@@ -332,7 +332,7 @@ Panzoom(elem, {
> `optional` **noBind**: `boolean`
-Defined in: [types.ts:95](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L95)
+Defined in: [types.ts:95](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L95)
Skip binding the default Panzoom event listeners
@@ -342,7 +342,7 @@ Skip binding the default Panzoom event listeners
> `optional` **origin**: `string`
-Defined in: [types.ts:109](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L109)
+Defined in: [types.ts:109](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L109)
**Change this at your own risk.**
The `transform-origin` is the origin from which transforms are applied.
@@ -362,7 +362,7 @@ And again, changing this for SVG in IE doesn't work at all.
> `optional` **overflow**: `string` (Default: **"hidden"**)
-Defined in: [types.ts:111](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L111)
+Defined in: [types.ts:111](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L111)
The overflow CSS value for the parent. Defaults to 'hidden'
@@ -372,7 +372,7 @@ The overflow CSS value for the parent. Defaults to 'hidden'
> `optional` **pinchAndPan**: `boolean` (Default: **false**)
-Defined in: [types.ts:124](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L124)
+Defined in: [types.ts:124](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L124)
Set to true to enable panning during pinch zoom.
Note: this is zooming to a point and panning in the same
@@ -391,7 +391,7 @@ https://github.com/timmywil/panzoom/issues/606
> `optional` **setTransform**: (`elem`, `__namedParameters`, `_options`?) => `void`
-Defined in: [types.ts:128](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L128)
+Defined in: [types.ts:128](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L128)
Set the transform using the proper prefix.
@@ -437,7 +437,7 @@ const panzoom = Panzoom(elem, {
> `optional` **silent**: `boolean`
-Defined in: [types.ts:130](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L130)
+Defined in: [types.ts:130](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L130)
Silence all events
@@ -447,7 +447,7 @@ Silence all events
> `optional` **startScale**: `number` (Default: **1**)
-Defined in: [types.ts:136](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L136)
+Defined in: [types.ts:136](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L136)
Scale used to set the beginning transform
@@ -457,7 +457,7 @@ Scale used to set the beginning transform
> `optional` **startX**: `number` (Default: **0**)
-Defined in: [types.ts:132](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L132)
+Defined in: [types.ts:132](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L132)
X Value used to set the beginning transform
@@ -467,7 +467,7 @@ X Value used to set the beginning transform
> `optional` **startY**: `number` (Default: **0**)
-Defined in: [types.ts:134](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L134)
+Defined in: [types.ts:134](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L134)
Y Value used to set the beginning transform
@@ -477,7 +477,7 @@ Y Value used to set the beginning transform
> `optional` **touchAction**: `string` (Default: **"none"**)
-Defined in: [types.ts:146](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L146)
+Defined in: [types.ts:146](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L146)
This value is used to set touch-action on both the
Panzoom element and its parent.
@@ -489,7 +489,7 @@ cannot work at the same time.
## PanOptions (includes MiscOptions)
-Defined in: [types.ts:151](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L151)
+Defined in: [types.ts:151](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L151)
## Properties
@@ -497,7 +497,7 @@ Defined in: [types.ts:151](https://github.com/timmywil/panzoom/blob/211bc595f528
> `optional` **contain**: `"inside"` \| `"outside"`
-Defined in: [types.ts:165](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L165)
+Defined in: [types.ts:165](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L165)
Contain the panzoom element either
inside or outside the parent.
@@ -517,7 +517,7 @@ empty space around the element will be shown.
> `optional` **cursor**: `string` (Default: **"move"**)
-Defined in: [types.ts:167](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L167)
+Defined in: [types.ts:167](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L167)
The cursor style to set on the panzoom element
@@ -527,7 +527,7 @@ The cursor style to set on the panzoom element
> `optional` **disablePan**: `boolean` (Default: **false**)
-Defined in: [types.ts:173](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L173)
+Defined in: [types.ts:173](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L173)
Disable panning functionality.
Note: disablePan does not affect focal point zooming or the contain option.
@@ -539,7 +539,7 @@ The element will still pan accordingly.
> `optional` **disableXAxis**: `boolean` (Default: **false**)
-Defined in: [types.ts:175](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L175)
+Defined in: [types.ts:175](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L175)
Pan only on the Y axis
@@ -549,7 +549,7 @@ Pan only on the Y axis
> `optional` **disableYAxis**: `boolean` (Default: **false**)
-Defined in: [types.ts:177](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L177)
+Defined in: [types.ts:177](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L177)
Pan only on the X axis
@@ -559,7 +559,7 @@ Pan only on the X axis
> `optional` **panOnlyWhenZoomed**: `boolean` (Default: **false**)
-Defined in: [types.ts:181](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L181)
+Defined in: [types.ts:181](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L181)
Disable panning while the scale is equal to the starting value
@@ -569,7 +569,7 @@ Disable panning while the scale is equal to the starting value
> `optional` **relative**: `boolean` (Default: **false**)
-Defined in: [types.ts:179](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L179)
+Defined in: [types.ts:179](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L179)
When passing x and y values to .pan(), treat the values as relative to their current values
@@ -579,7 +579,7 @@ When passing x and y values to .pan(), treat the values as relative to their cur
> `optional` **roundPixels**: `boolean`
-Defined in: [types.ts:190](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L190)
+Defined in: [types.ts:190](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L190)
Round x and y values to whole numbers.
This can help prevent images and text from looking blurry,
@@ -590,7 +590,7 @@ zooming in when using this option.
## ZoomOptions (includes MiscOptions)
-Defined in: [types.ts:193](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L193)
+Defined in: [types.ts:193](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L193)
## Properties
@@ -598,7 +598,7 @@ Defined in: [types.ts:193](https://github.com/timmywil/panzoom/blob/211bc595f528
> `optional` **disableZoom**: `boolean` (Default: **false**)
-Defined in: [types.ts:195](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L195)
+Defined in: [types.ts:195](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L195)
Disable zooming functionality
@@ -608,7 +608,7 @@ Disable zooming functionality
> `optional` **focal**: `object`
-Defined in: [types.ts:202](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L202)
+Defined in: [types.ts:202](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L202)
Zoom to the given point on the panzoom element.
This point is expected to be relative to
@@ -629,7 +629,7 @@ to the parent dimensions.
> `optional` **maxScale**: `number` (Default: **4**)
-Defined in: [types.ts:206](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L206)
+Defined in: [types.ts:206](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L206)
The maximum scale when zooming
@@ -639,7 +639,7 @@ The maximum scale when zooming
> `optional` **minScale**: `number` (Default: **0.125**)
-Defined in: [types.ts:204](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L204)
+Defined in: [types.ts:204](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L204)
The minimum scale when zooming
@@ -649,7 +649,7 @@ The minimum scale when zooming
> `optional` **step**: `number` (Default: **0.3**)
-Defined in: [types.ts:208](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L208)
+Defined in: [types.ts:208](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L208)
The step affects zoom calculation when zooming with a mouse wheel, when pinch zooming, or when using zoomIn/zoomOut
@@ -657,7 +657,7 @@ The step affects zoom calculation when zooming with a mouse wheel, when pinch zo
These methods are available after initializing Panzoom.
-Defined in: [types.ts:222](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L222)
+Defined in: [types.ts:222](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L222)
## Properties
@@ -665,7 +665,7 @@ Defined in: [types.ts:222](https://github.com/timmywil/panzoom/blob/211bc595f528
> **bind**: () => `void`
-Defined in: [types.ts:235](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L235)
+Defined in: [types.ts:235](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L235)
Bind the default down, move, and up event listeners to the Panzoom element.
This does not normally need to be called.
@@ -688,7 +688,7 @@ panzoom.bind()
> **destroy**: () => `void`
-Defined in: [types.ts:237](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L237)
+Defined in: [types.ts:237](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L237)
Remove all event listeners bound to the the Panzoom element
@@ -702,7 +702,7 @@ Remove all event listeners bound to the the Panzoom element
> **eventNames**: `object`
-Defined in: [types.ts:243](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L243)
+Defined in: [types.ts:243](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L243)
This object exposes the event names used by Panzoom,
depending on the current browser's support for
@@ -726,7 +726,7 @@ Pointer or Touch events.
> **getOptions**: () => `PanzoomOptions`
-Defined in: [types.ts:249](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L249)
+Defined in: [types.ts:249](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L249)
Returns a _copy_ of the current options object
@@ -740,7 +740,7 @@ Returns a _copy_ of the current options object
> **getPan**: () => `object`
-Defined in: [types.ts:245](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L245)
+Defined in: [types.ts:245](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L245)
Get the current x/y translation
@@ -762,7 +762,7 @@ Get the current x/y translation
> **getScale**: () => `number`
-Defined in: [types.ts:247](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L247)
+Defined in: [types.ts:247](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L247)
Get the current scale
@@ -776,7 +776,7 @@ Get the current scale
> **handleDown**: (`event`) => `void`
-Defined in: [types.ts:271](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L271)
+Defined in: [types.ts:271](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L271)
handleDown, handleMove, and handleUp
are the exact event handlers that Panzoom
@@ -814,7 +814,7 @@ document.addEventListener('pointerup', panzoom.handleUp)
> **handleMove**: (`event`) => `void`
-Defined in: [types.ts:272](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L272)
+Defined in: [types.ts:272](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L272)
#### Parameters
@@ -832,7 +832,7 @@ Defined in: [types.ts:272](https://github.com/timmywil/panzoom/blob/211bc595f528
> **handleUp**: (`event`) => `void`
-Defined in: [types.ts:273](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L273)
+Defined in: [types.ts:273](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L273)
#### Parameters
@@ -850,7 +850,7 @@ Defined in: [types.ts:273](https://github.com/timmywil/panzoom/blob/211bc595f528
> **pan**: (`x`, `y`, `panOptions`?) => `[CurrentValues](#CurrentValues)`
-Defined in: [types.ts:284](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L284)
+Defined in: [types.ts:284](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L284)
Pan the Panzoom element to the given x and y coordinates
@@ -885,7 +885,7 @@ panzoom.pan(10, 10, { relative: true })
> **reset**: (`resetOptions`?) => `[CurrentValues](#CurrentValues)`
-Defined in: [types.ts:297](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L297)
+Defined in: [types.ts:297](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L297)
Reset the pan and zoom to startX, startY, and startScale.
Animates by default, ignoring the global option.
@@ -914,7 +914,7 @@ panzoom.reset({ animate: false })
> **resetStyle**: () => `void`
-Defined in: [types.ts:306](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L306)
+Defined in: [types.ts:306](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L306)
Reset the styles set on the Panzoom element
and its parent (such as overflow, cursor, etc.)
@@ -933,7 +933,7 @@ panzoom.resetStyle()
> **setOptions**: (`options`?) => `void`
-Defined in: [types.ts:319](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L319)
+Defined in: [types.ts:319](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L319)
Change any number of options on a Panzoom instance.
Setting some options will have side-effects.
@@ -962,7 +962,7 @@ panzoom.setOptions({ cursor: 'default' })
> **setStyle**: (`name`, `value`) => `void`
-Defined in: [types.ts:321](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L321)
+Defined in: [types.ts:321](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L321)
A convenience method for setting prefixed styles on the Panzoom element
@@ -986,7 +986,7 @@ A convenience method for setting prefixed styles on the Panzoom element
> **zoom**: (`scale`, `zoomOptions`?) => `[CurrentValues](#CurrentValues)`
-Defined in: [types.ts:330](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L330)
+Defined in: [types.ts:330](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L330)
Zoom the Panzoom element to the given scale
@@ -1015,7 +1015,7 @@ panzoom.zoom(2.2, { animate: true })
> **zoomIn**: (`zoomOptions`?) => `[CurrentValues](#CurrentValues)`
-Defined in: [types.ts:341](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L341)
+Defined in: [types.ts:341](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L341)
Zoom in using the predetermined increment set in options.
Animates by default, ignoring the global option.
@@ -1042,7 +1042,7 @@ panzoom.zoomIn({ animate: false })
> **zoomOut**: (`zoomOptions`?) => `[CurrentValues](#CurrentValues)`
-Defined in: [types.ts:352](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L352)
+Defined in: [types.ts:352](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L352)
Zoom out using the predetermined increment set in options.
Animates by default, ignoring the global option.
@@ -1069,7 +1069,7 @@ panzoom.zoomOut({ animate: false })
> **zoomToPoint**: (`scale`, `point`, `zoomOptions`?) => `[CurrentValues](#CurrentValues)`
-Defined in: [types.ts:363](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L363)
+Defined in: [types.ts:363](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L363)
Zoom the Panzoom element to a focal point using
the given pointer/touch/mouse event or constructed point.
@@ -1110,7 +1110,7 @@ panzoom.zoomToPoint(1.2, pointerEvent)
> **zoomWithWheel**: (`event`, `zoomOptions`?) => `[CurrentValues](#CurrentValues)`
-Defined in: [types.ts:396](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L396)
+Defined in: [types.ts:396](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L396)
Zoom the Panzoom element to a focal point using the given WheelEvent
@@ -1155,7 +1155,7 @@ elem.parentElement.addEventListener('wheel', function (event) {
## $1
-Defined in: [types.ts:215](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L215)
+Defined in: [types.ts:215](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L215)
## Properties
@@ -1163,7 +1163,7 @@ Defined in: [types.ts:215](https://github.com/timmywil/panzoom/blob/211bc595f528
> `optional` **isSVG**: `boolean`
-Defined in: [types.ts:219](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L219)
+Defined in: [types.ts:219](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L219)
---
@@ -1171,7 +1171,7 @@ Defined in: [types.ts:219](https://github.com/timmywil/panzoom/blob/211bc595f528
> **scale**: `number`
-Defined in: [types.ts:218](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L218)
+Defined in: [types.ts:218](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L218)
---
@@ -1179,7 +1179,7 @@ Defined in: [types.ts:218](https://github.com/timmywil/panzoom/blob/211bc595f528
> **x**: `number`
-Defined in: [types.ts:216](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L216)
+Defined in: [types.ts:216](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L216)
---
@@ -1187,7 +1187,7 @@ Defined in: [types.ts:216](https://github.com/timmywil/panzoom/blob/211bc595f528
> **y**: `number`
-Defined in: [types.ts:217](https://github.com/timmywil/panzoom/blob/211bc595f528ed19b493a546219fe9bafe4b89a4/src/types.ts#L217)
+Defined in: [types.ts:217](https://github.com/timmywil/panzoom/blob/c05ae3d25396d280b34dc17c7324768425d9c900/src/types.ts#L217)
## Events
diff --git a/dist/panzoom.es.js b/dist/panzoom.es.js
new file mode 100644
index 00000000..76187491
--- /dev/null
+++ b/dist/panzoom.es.js
@@ -0,0 +1,792 @@
+/**
+* Panzoom 4.6.0 for panning and zooming elements using CSS transforms
+* Copyright Timmy Willison and other contributors
+* https://github.com/timmywil/panzoom/blob/main/MIT-License.txt
+*/
+/******************************************************************************
+Copyright (c) Microsoft Corporation.
+
+Permission to use, copy, modify, and/or distribute this software for any
+purpose with or without fee is hereby granted.
+
+THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
+REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
+AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
+INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
+LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
+OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+PERFORMANCE OF THIS SOFTWARE.
+***************************************************************************** */
+/* global Reflect, Promise, SuppressedError, Symbol, Iterator */
+
+
+var __assign = function() {
+ __assign = Object.assign || function __assign(t) {
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
+ s = arguments[i];
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
+ }
+ return t;
+ };
+ return __assign.apply(this, arguments);
+};
+
+typeof SuppressedError === "function" ? SuppressedError : function (error, suppressed, message) {
+ var e = new Error(message);
+ return e.name = "SuppressedError", e.error = error, e.suppressed = suppressed, e;
+};
+
+if (typeof window !== 'undefined') {
+ // Support: IE11 only
+ if (window.NodeList && !NodeList.prototype.forEach) {
+ NodeList.prototype.forEach = Array.prototype.forEach;
+ }
+ // Support: IE11 only
+ // CustomEvent is an object instead of a constructor
+ if (typeof window.CustomEvent !== 'function') {
+ window.CustomEvent = function CustomEvent(event, params) {
+ params = params || { bubbles: false, cancelable: false, detail: null };
+ var evt = document.createEvent('CustomEvent');
+ evt.initCustomEvent(event, params.bubbles, params.cancelable, params.detail);
+ return evt
+ };
+ }
+}
+
+var isIE = typeof document !== 'undefined' && !!document.documentMode;
+/**
+ * Lazy creation of a CSS style declaration
+ */
+var divStyle;
+function createStyle() {
+ if (divStyle) {
+ return divStyle;
+ }
+ return (divStyle = document.createElement('div').style);
+}
+/**
+ * Proper prefixing for cross-browser compatibility
+ */
+var prefixes = ['webkit', 'moz', 'ms'];
+var prefixCache = {};
+function getPrefixedName(name) {
+ if (prefixCache[name]) {
+ return prefixCache[name];
+ }
+ var divStyle = createStyle();
+ if (name in divStyle) {
+ return (prefixCache[name] = name);
+ }
+ var capName = name[0].toUpperCase() + name.slice(1);
+ var i = prefixes.length;
+ while (i--) {
+ var prefixedName = "".concat(prefixes[i]).concat(capName);
+ if (prefixedName in divStyle) {
+ return (prefixCache[name] = prefixedName);
+ }
+ }
+}
+/**
+ * Gets a style value expected to be a number
+ */
+function getCSSNum(name, style) {
+ return parseFloat(style[getPrefixedName(name)]) || 0;
+}
+function getBoxStyle(elem, name, style) {
+ if (style === undefined) { style = window.getComputedStyle(elem); }
+ // Support: FF 68+
+ // Firefox requires specificity for border
+ var suffix = name === 'border' ? 'Width' : '';
+ return {
+ left: getCSSNum("".concat(name, "Left").concat(suffix), style),
+ right: getCSSNum("".concat(name, "Right").concat(suffix), style),
+ top: getCSSNum("".concat(name, "Top").concat(suffix), style),
+ bottom: getCSSNum("".concat(name, "Bottom").concat(suffix), style)
+ };
+}
+/**
+ * Set a style using the properly prefixed name
+ */
+function setStyle(elem, name, value) {
+ elem.style[getPrefixedName(name)] = value;
+}
+/**
+ * Constructs the transition from panzoom options
+ * and takes care of prefixing the transition and transform
+ */
+function setTransition(elem, options) {
+ var transform = getPrefixedName('transform');
+ setStyle(elem, 'transition', "".concat(transform, " ").concat(options.duration, "ms ").concat(options.easing));
+}
+/**
+ * Set the transform using the proper prefix
+ *
+ * Override the transform setter.
+ * This is exposed mostly so the user could
+ * set other parts of a transform
+ * aside from scale and translate.
+ * Default is defined in src/css.ts.
+ *
+ * ```js
+ * // This example always sets a rotation
+ * // when setting the scale and translation
+ * const panzoom = Panzoom(elem, {
+ * setTransform: (elem, { scale, x, y }) => {
+ * panzoom.setStyle('transform', `rotate(0.5turn) scale(${scale}) translate(${x}px, ${y}px)`)
+ * }
+ * })
+ * ```
+ */
+function setTransform(elem, _a, _options) {
+ var x = _a.x, y = _a.y, scale = _a.scale, isSVG = _a.isSVG;
+ setStyle(elem, 'transform', "scale(".concat(scale, ") translate(").concat(x, "px, ").concat(y, "px)"));
+ if (isSVG && isIE) {
+ var matrixValue = window.getComputedStyle(elem).getPropertyValue('transform');
+ elem.setAttribute('transform', matrixValue);
+ }
+}
+/**
+ * Dimensions used in containment and focal point zooming
+ */
+function getDimensions(elem) {
+ var parent = elem.parentNode;
+ var style = window.getComputedStyle(elem);
+ var parentStyle = window.getComputedStyle(parent);
+ var rectElem = elem.getBoundingClientRect();
+ var rectParent = parent.getBoundingClientRect();
+ return {
+ elem: {
+ style: style,
+ width: rectElem.width,
+ height: rectElem.height,
+ top: rectElem.top,
+ bottom: rectElem.bottom,
+ left: rectElem.left,
+ right: rectElem.right,
+ margin: getBoxStyle(elem, 'margin', style),
+ border: getBoxStyle(elem, 'border', style)
+ },
+ parent: {
+ style: parentStyle,
+ width: rectParent.width,
+ height: rectParent.height,
+ top: rectParent.top,
+ bottom: rectParent.bottom,
+ left: rectParent.left,
+ right: rectParent.right,
+ padding: getBoxStyle(parent, 'padding', parentStyle),
+ border: getBoxStyle(parent, 'border', parentStyle)
+ }
+ };
+}
+
+var events = {
+ down: 'mousedown',
+ move: 'mousemove',
+ up: 'mouseup mouseleave'
+};
+if (typeof window !== 'undefined') {
+ if (typeof window.PointerEvent === 'function') {
+ events = {
+ down: 'pointerdown',
+ move: 'pointermove',
+ up: 'pointerup pointerleave pointercancel'
+ };
+ }
+ else if (typeof window.TouchEvent === 'function') {
+ events = {
+ down: 'touchstart',
+ move: 'touchmove',
+ up: 'touchend touchcancel'
+ };
+ }
+}
+function onPointer(event, elem, handler, eventOpts) {
+ events[event].split(' ').forEach(function (name) {
+ elem.addEventListener(name, handler, eventOpts);
+ });
+}
+function destroyPointer(event, elem, handler) {
+ events[event].split(' ').forEach(function (name) {
+ elem.removeEventListener(name, handler);
+ });
+}
+
+/**
+ * Utilites for working with multiple pointer events
+ */
+function findEventIndex(pointers, event) {
+ var i = pointers.length;
+ while (i--) {
+ if (pointers[i].pointerId === event.pointerId) {
+ return i;
+ }
+ }
+ return -1;
+}
+function addPointer(pointers, event) {
+ var i;
+ // Add touches if applicable
+ if (event.touches) {
+ i = 0;
+ for (var _i = 0, _a = event.touches; _i < _a.length; _i++) {
+ var touch = _a[_i];
+ touch.pointerId = i++;
+ addPointer(pointers, touch);
+ }
+ return;
+ }
+ i = findEventIndex(pointers, event);
+ // Update if already present
+ if (i > -1) {
+ pointers.splice(i, 1);
+ }
+ pointers.push(event);
+}
+function removePointer(pointers, event) {
+ // Add touches if applicable
+ if (event.touches) {
+ // Remove all touches
+ while (pointers.length) {
+ pointers.pop();
+ }
+ return;
+ }
+ var i = findEventIndex(pointers, event);
+ if (i > -1) {
+ pointers.splice(i, 1);
+ }
+}
+/**
+ * Calculates a center point between
+ * the given pointer events, for panning
+ * with multiple pointers.
+ */
+function getMiddle(pointers) {
+ // Copy to avoid changing by reference
+ pointers = pointers.slice(0);
+ var event1 = pointers.pop();
+ var event2;
+ while ((event2 = pointers.pop())) {
+ event1 = {
+ clientX: (event2.clientX - event1.clientX) / 2 + event1.clientX,
+ clientY: (event2.clientY - event1.clientY) / 2 + event1.clientY
+ };
+ }
+ return event1;
+}
+/**
+ * Calculates the distance between two points
+ * for pinch zooming.
+ * Limits to the first 2
+ */
+function getDistance(pointers) {
+ if (pointers.length < 2) {
+ return 0;
+ }
+ var event1 = pointers[0];
+ var event2 = pointers[1];
+ return Math.sqrt(Math.pow(Math.abs(event2.clientX - event1.clientX), 2) +
+ Math.pow(Math.abs(event2.clientY - event1.clientY), 2));
+}
+
+/**
+ * Determine if an element is attached to the DOM
+ * Panzoom requires this so events work properly
+ */
+function isAttached(node) {
+ var currentNode = node;
+ while (currentNode && currentNode.parentNode) {
+ if (currentNode.parentNode === document)
+ return true;
+ currentNode =
+ currentNode.parentNode instanceof ShadowRoot
+ ? currentNode.parentNode.host
+ : currentNode.parentNode;
+ }
+ return false;
+}
+
+function getClass(elem) {
+ return (elem.getAttribute('class') || '').trim();
+}
+function hasClass(elem, className) {
+ return elem.nodeType === 1 && " ".concat(getClass(elem), " ").indexOf(" ".concat(className, " ")) > -1;
+}
+function isExcluded(elem, options) {
+ for (var cur = elem; cur != null; cur = cur.parentNode) {
+ if (hasClass(cur, options.excludeClass) || options.exclude.indexOf(cur) > -1) {
+ return true;
+ }
+ }
+ return false;
+}
+
+/**
+ * Determine if an element is SVG by checking the namespace
+ * Exception: the