@zoompinch/react 0.0.4 → 0.0.5
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/README.md +34 -0
- package/dist/zoompinch-react.es.js +248 -236
- package/dist/zoompinch-react.umd.js +4 -4
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -62,6 +62,10 @@ function App() {
|
|
|
62
62
|
maxScale={4}
|
|
63
63
|
clampBounds={false}
|
|
64
64
|
rotation={true}
|
|
65
|
+
zoomSpeed={1}
|
|
66
|
+
translateSpeed={1}
|
|
67
|
+
zoomSpeedAppleTrackpad={1}
|
|
68
|
+
translateSpeedAppleTrackpad={1}
|
|
65
69
|
mouse={true}
|
|
66
70
|
wheel={true}
|
|
67
71
|
touch={true}
|
|
@@ -131,6 +135,36 @@ export default App;
|
|
|
131
135
|
|
|
132
136
|
**Note:** `minScale`, `maxScale`, `rotation`, and `clampBounds` only apply during user interaction. Programmatic changes via ref methods are unrestricted.
|
|
133
137
|
|
|
138
|
+
### Speed Multipliers
|
|
139
|
+
|
|
140
|
+
#### The Problem
|
|
141
|
+
Pan and zoom interactions behave differently across input devices:
|
|
142
|
+
- **Apple Trackpads**: Provide smooth, precise scroll values with natural momentum
|
|
143
|
+
- **Mouse Wheels**: Send large, discrete jumps (typically ±100 or ±120 per scroll tick)
|
|
144
|
+
|
|
145
|
+
Without normalization, this causes:
|
|
146
|
+
- Uncomfortably large zoom jumps when using mouse wheels
|
|
147
|
+
- Panning that's either too slow (trackpad-optimized) or too fast (mouse-optimized)
|
|
148
|
+
- Inconsistent user experience across Windows, Mac, and Linux
|
|
149
|
+
|
|
150
|
+
#### The Solution
|
|
151
|
+
The library automatically detects the input device type and applies different speed multipliers:
|
|
152
|
+
- **Trackpad gestures** use base values for smooth, 1:1 response
|
|
153
|
+
- **Mouse wheel actions** use amplified values for comfortable discrete steps
|
|
154
|
+
|
|
155
|
+
You can fine-tune these multipliers for your specific use case using the speed props.
|
|
156
|
+
|
|
157
|
+
| Prop | Type | Default | Description |
|
|
158
|
+
|------|------|---------|-------------|
|
|
159
|
+
| `translateSpeed` | `number` | `1` | Pan speed multiplier for mouse wheels |
|
|
160
|
+
| `zoomSpeed` | `number` | `1` | Zoom speed multiplier for mouse wheels |
|
|
161
|
+
| `translateSpeedAppleTrackpad` | `number` | `1` | Pan speed multiplier for trackpads |
|
|
162
|
+
| `zoomSpeedAppleTrackpad` | `number` | `1` | Zoom speed multiplier for trackpads |
|
|
163
|
+
|
|
164
|
+
|
|
165
|
+
**Note:** `min-scale`, `max-scale`, `rotation`, and `clamp-bounds` only apply during user interaction. Programmatic changes via ref methods are unrestricted.
|
|
166
|
+
|
|
167
|
+
|
|
134
168
|
### Events
|
|
135
169
|
|
|
136
170
|
| Event | Payload | Description |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import te, { forwardRef as ne, useRef as
|
|
2
|
-
import { Zoompinch as
|
|
3
|
-
var
|
|
1
|
+
import te, { forwardRef as ne, useRef as G, useState as ae, useImperativeHandle as ue, useEffect as f } from "react";
|
|
2
|
+
import { Zoompinch as oe } from "@zoompinch/core";
|
|
3
|
+
var U = { exports: {} }, W = {};
|
|
4
4
|
/**
|
|
5
5
|
* @license React
|
|
6
6
|
* react-jsx-runtime.production.js
|
|
@@ -11,28 +11,28 @@ var I = { exports: {} }, M = {};
|
|
|
11
11
|
* LICENSE file in the root directory of this source tree.
|
|
12
12
|
*/
|
|
13
13
|
var Q;
|
|
14
|
-
function
|
|
15
|
-
if (Q) return
|
|
14
|
+
function ce() {
|
|
15
|
+
if (Q) return W;
|
|
16
16
|
Q = 1;
|
|
17
|
-
var
|
|
18
|
-
function
|
|
19
|
-
var
|
|
20
|
-
if (
|
|
21
|
-
|
|
22
|
-
for (var
|
|
23
|
-
|
|
24
|
-
} else
|
|
25
|
-
return s =
|
|
26
|
-
$$typeof:
|
|
27
|
-
type:
|
|
28
|
-
key:
|
|
17
|
+
var u = Symbol.for("react.transitional.element"), R = Symbol.for("react.fragment");
|
|
18
|
+
function h(p, s, i) {
|
|
19
|
+
var v = null;
|
|
20
|
+
if (i !== void 0 && (v = "" + i), s.key !== void 0 && (v = "" + s.key), "key" in s) {
|
|
21
|
+
i = {};
|
|
22
|
+
for (var w in s)
|
|
23
|
+
w !== "key" && (i[w] = s[w]);
|
|
24
|
+
} else i = s;
|
|
25
|
+
return s = i.ref, {
|
|
26
|
+
$$typeof: u,
|
|
27
|
+
type: p,
|
|
28
|
+
key: v,
|
|
29
29
|
ref: s !== void 0 ? s : null,
|
|
30
|
-
props:
|
|
30
|
+
props: i
|
|
31
31
|
};
|
|
32
32
|
}
|
|
33
|
-
return
|
|
33
|
+
return W.Fragment = R, W.jsx = h, W.jsxs = h, W;
|
|
34
34
|
}
|
|
35
|
-
var
|
|
35
|
+
var $ = {};
|
|
36
36
|
/**
|
|
37
37
|
* @license React
|
|
38
38
|
* react-jsx-runtime.development.js
|
|
@@ -43,125 +43,125 @@ var W = {};
|
|
|
43
43
|
* LICENSE file in the root directory of this source tree.
|
|
44
44
|
*/
|
|
45
45
|
var K;
|
|
46
|
-
function
|
|
46
|
+
function se() {
|
|
47
47
|
return K || (K = 1, process.env.NODE_ENV !== "production" && (function() {
|
|
48
|
-
function
|
|
48
|
+
function u(e) {
|
|
49
49
|
if (e == null) return null;
|
|
50
50
|
if (typeof e == "function")
|
|
51
|
-
return e.$$typeof ===
|
|
51
|
+
return e.$$typeof === l ? null : e.displayName || e.name || null;
|
|
52
52
|
if (typeof e == "string") return e;
|
|
53
53
|
switch (e) {
|
|
54
|
-
case
|
|
54
|
+
case A:
|
|
55
55
|
return "Fragment";
|
|
56
|
-
case
|
|
56
|
+
case F:
|
|
57
57
|
return "Profiler";
|
|
58
|
-
case
|
|
58
|
+
case X:
|
|
59
59
|
return "StrictMode";
|
|
60
|
-
case
|
|
60
|
+
case J:
|
|
61
61
|
return "Suspense";
|
|
62
|
-
case
|
|
62
|
+
case V:
|
|
63
63
|
return "SuspenseList";
|
|
64
|
-
case
|
|
64
|
+
case r:
|
|
65
65
|
return "Activity";
|
|
66
66
|
}
|
|
67
67
|
if (typeof e == "object")
|
|
68
68
|
switch (typeof e.tag == "number" && console.error(
|
|
69
69
|
"Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."
|
|
70
70
|
), e.$$typeof) {
|
|
71
|
-
case
|
|
71
|
+
case j:
|
|
72
72
|
return "Portal";
|
|
73
|
-
case
|
|
73
|
+
case H:
|
|
74
74
|
return e.displayName || "Context";
|
|
75
|
-
case
|
|
75
|
+
case z:
|
|
76
76
|
return (e._context.displayName || "Context") + ".Consumer";
|
|
77
|
+
case q:
|
|
78
|
+
var n = e.render;
|
|
79
|
+
return e = e.displayName, e || (e = n.displayName || n.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
|
+
case Z:
|
|
81
|
+
return n = e.displayName || null, n !== null ? n : u(e.type) || "Memo";
|
|
77
82
|
case _:
|
|
78
|
-
|
|
79
|
-
return e = e.displayName, e || (e = r.displayName || r.name || "", e = e !== "" ? "ForwardRef(" + e + ")" : "ForwardRef"), e;
|
|
80
|
-
case v:
|
|
81
|
-
return r = e.displayName || null, r !== null ? r : a(e.type) || "Memo";
|
|
82
|
-
case A:
|
|
83
|
-
r = e._payload, e = e._init;
|
|
83
|
+
n = e._payload, e = e._init;
|
|
84
84
|
try {
|
|
85
|
-
return
|
|
85
|
+
return u(e(n));
|
|
86
86
|
} catch {
|
|
87
87
|
}
|
|
88
88
|
}
|
|
89
89
|
return null;
|
|
90
90
|
}
|
|
91
|
-
function
|
|
91
|
+
function R(e) {
|
|
92
92
|
return "" + e;
|
|
93
93
|
}
|
|
94
|
-
function
|
|
94
|
+
function h(e) {
|
|
95
95
|
try {
|
|
96
|
-
|
|
97
|
-
var
|
|
96
|
+
R(e);
|
|
97
|
+
var n = !1;
|
|
98
98
|
} catch {
|
|
99
|
-
|
|
99
|
+
n = !0;
|
|
100
100
|
}
|
|
101
|
-
if (
|
|
102
|
-
|
|
103
|
-
var
|
|
104
|
-
return
|
|
105
|
-
|
|
101
|
+
if (n) {
|
|
102
|
+
n = console;
|
|
103
|
+
var o = n.error, c = typeof Symbol == "function" && Symbol.toStringTag && e[Symbol.toStringTag] || e.constructor.name || "Object";
|
|
104
|
+
return o.call(
|
|
105
|
+
n,
|
|
106
106
|
"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",
|
|
107
|
-
|
|
108
|
-
),
|
|
107
|
+
c
|
|
108
|
+
), R(e);
|
|
109
109
|
}
|
|
110
110
|
}
|
|
111
|
-
function
|
|
112
|
-
if (e ===
|
|
113
|
-
if (typeof e == "object" && e !== null && e.$$typeof ===
|
|
111
|
+
function p(e) {
|
|
112
|
+
if (e === A) return "<>";
|
|
113
|
+
if (typeof e == "object" && e !== null && e.$$typeof === _)
|
|
114
114
|
return "<...>";
|
|
115
115
|
try {
|
|
116
|
-
var
|
|
117
|
-
return
|
|
116
|
+
var n = u(e);
|
|
117
|
+
return n ? "<" + n + ">" : "<...>";
|
|
118
118
|
} catch {
|
|
119
119
|
return "<...>";
|
|
120
120
|
}
|
|
121
121
|
}
|
|
122
122
|
function s() {
|
|
123
|
-
var e =
|
|
123
|
+
var e = d.A;
|
|
124
124
|
return e === null ? null : e.getOwner();
|
|
125
125
|
}
|
|
126
|
-
function
|
|
126
|
+
function i() {
|
|
127
127
|
return Error("react-stack-top-frame");
|
|
128
128
|
}
|
|
129
|
-
function
|
|
130
|
-
if (
|
|
131
|
-
var
|
|
132
|
-
if (
|
|
129
|
+
function v(e) {
|
|
130
|
+
if (I.call(e, "key")) {
|
|
131
|
+
var n = Object.getOwnPropertyDescriptor(e, "key").get;
|
|
132
|
+
if (n && n.isReactWarning) return !1;
|
|
133
133
|
}
|
|
134
134
|
return e.key !== void 0;
|
|
135
135
|
}
|
|
136
|
-
function
|
|
137
|
-
function
|
|
138
|
-
|
|
136
|
+
function w(e, n) {
|
|
137
|
+
function o() {
|
|
138
|
+
N || (N = !0, console.error(
|
|
139
139
|
"%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",
|
|
140
|
-
|
|
140
|
+
n
|
|
141
141
|
));
|
|
142
142
|
}
|
|
143
|
-
|
|
144
|
-
get:
|
|
143
|
+
o.isReactWarning = !0, Object.defineProperty(e, "key", {
|
|
144
|
+
get: o,
|
|
145
145
|
configurable: !0
|
|
146
146
|
});
|
|
147
147
|
}
|
|
148
|
-
function
|
|
149
|
-
var e =
|
|
150
|
-
return
|
|
148
|
+
function y() {
|
|
149
|
+
var e = u(this.type);
|
|
150
|
+
return C[e] || (C[e] = !0, console.error(
|
|
151
151
|
"Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release."
|
|
152
152
|
)), e = this.props.ref, e !== void 0 ? e : null;
|
|
153
153
|
}
|
|
154
|
-
function
|
|
155
|
-
var
|
|
154
|
+
function k(e, n, o, c, P, t) {
|
|
155
|
+
var a = o.ref;
|
|
156
156
|
return e = {
|
|
157
|
-
$$typeof:
|
|
157
|
+
$$typeof: D,
|
|
158
158
|
type: e,
|
|
159
|
-
key:
|
|
160
|
-
props:
|
|
161
|
-
_owner:
|
|
162
|
-
}, (
|
|
159
|
+
key: n,
|
|
160
|
+
props: o,
|
|
161
|
+
_owner: c
|
|
162
|
+
}, (a !== void 0 ? a : null) !== null ? Object.defineProperty(e, "ref", {
|
|
163
163
|
enumerable: !1,
|
|
164
|
-
get:
|
|
164
|
+
get: y
|
|
165
165
|
}) : Object.defineProperty(e, "ref", { enumerable: !1, value: null }), e._store = {}, Object.defineProperty(e._store, "validated", {
|
|
166
166
|
configurable: !1,
|
|
167
167
|
enumerable: !1,
|
|
@@ -176,228 +176,240 @@ function ce() {
|
|
|
176
176
|
configurable: !1,
|
|
177
177
|
enumerable: !1,
|
|
178
178
|
writable: !0,
|
|
179
|
-
value:
|
|
179
|
+
value: P
|
|
180
180
|
}), Object.defineProperty(e, "_debugTask", {
|
|
181
181
|
configurable: !1,
|
|
182
182
|
enumerable: !1,
|
|
183
183
|
writable: !0,
|
|
184
|
-
value:
|
|
184
|
+
value: t
|
|
185
185
|
}), Object.freeze && (Object.freeze(e.props), Object.freeze(e)), e;
|
|
186
186
|
}
|
|
187
|
-
function
|
|
188
|
-
var
|
|
189
|
-
if (
|
|
190
|
-
if (
|
|
191
|
-
if (
|
|
192
|
-
for (
|
|
193
|
-
|
|
194
|
-
Object.freeze && Object.freeze(
|
|
187
|
+
function b(e, n, o, c, P, t) {
|
|
188
|
+
var a = n.children;
|
|
189
|
+
if (a !== void 0)
|
|
190
|
+
if (c)
|
|
191
|
+
if (L(a)) {
|
|
192
|
+
for (c = 0; c < a.length; c++)
|
|
193
|
+
T(a[c]);
|
|
194
|
+
Object.freeze && Object.freeze(a);
|
|
195
195
|
} else
|
|
196
196
|
console.error(
|
|
197
197
|
"React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead."
|
|
198
198
|
);
|
|
199
|
-
else
|
|
200
|
-
if (
|
|
201
|
-
|
|
202
|
-
var
|
|
199
|
+
else T(a);
|
|
200
|
+
if (I.call(n, "key")) {
|
|
201
|
+
a = u(e);
|
|
202
|
+
var E = Object.keys(n).filter(function(re) {
|
|
203
203
|
return re !== "key";
|
|
204
204
|
});
|
|
205
|
-
|
|
205
|
+
c = 0 < E.length ? "{key: someKey, " + E.join(": ..., ") + ": ...}" : "{key: someKey}", M[a + c] || (E = 0 < E.length ? "{" + E.join(": ..., ") + ": ...}" : "{}", console.error(
|
|
206
206
|
`A props object containing a "key" prop is being spread into JSX:
|
|
207
207
|
let props = %s;
|
|
208
208
|
<%s {...props} />
|
|
209
209
|
React keys must be passed directly to JSX without using spread:
|
|
210
210
|
let props = %s;
|
|
211
211
|
<%s key={someKey} {...props} />`,
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
),
|
|
212
|
+
c,
|
|
213
|
+
a,
|
|
214
|
+
E,
|
|
215
|
+
a
|
|
216
|
+
), M[a + c] = !0);
|
|
217
217
|
}
|
|
218
|
-
if (
|
|
219
|
-
|
|
220
|
-
for (var
|
|
221
|
-
|
|
222
|
-
} else
|
|
223
|
-
return
|
|
224
|
-
|
|
218
|
+
if (a = null, o !== void 0 && (h(o), a = "" + o), v(n) && (h(n.key), a = "" + n.key), "key" in n) {
|
|
219
|
+
o = {};
|
|
220
|
+
for (var x in n)
|
|
221
|
+
x !== "key" && (o[x] = n[x]);
|
|
222
|
+
} else o = n;
|
|
223
|
+
return a && w(
|
|
224
|
+
o,
|
|
225
225
|
typeof e == "function" ? e.displayName || e.name || "Unknown" : e
|
|
226
|
-
),
|
|
226
|
+
), k(
|
|
227
227
|
e,
|
|
228
|
-
|
|
229
|
-
|
|
228
|
+
a,
|
|
229
|
+
o,
|
|
230
230
|
s(),
|
|
231
|
-
|
|
232
|
-
|
|
231
|
+
P,
|
|
232
|
+
t
|
|
233
233
|
);
|
|
234
234
|
}
|
|
235
|
-
function
|
|
236
|
-
|
|
235
|
+
function T(e) {
|
|
236
|
+
g(e) ? e._store && (e._store.validated = 1) : typeof e == "object" && e !== null && e.$$typeof === _ && (e._payload.status === "fulfilled" ? g(e._payload.value) && e._payload.value._store && (e._payload.value._store.validated = 1) : e._store && (e._store.validated = 1));
|
|
237
237
|
}
|
|
238
|
-
function
|
|
239
|
-
return typeof e == "object" && e !== null && e.$$typeof ===
|
|
238
|
+
function g(e) {
|
|
239
|
+
return typeof e == "object" && e !== null && e.$$typeof === D;
|
|
240
240
|
}
|
|
241
|
-
var
|
|
241
|
+
var m = te, D = Symbol.for("react.transitional.element"), j = Symbol.for("react.portal"), A = Symbol.for("react.fragment"), X = Symbol.for("react.strict_mode"), F = Symbol.for("react.profiler"), z = Symbol.for("react.consumer"), H = Symbol.for("react.context"), q = Symbol.for("react.forward_ref"), J = Symbol.for("react.suspense"), V = Symbol.for("react.suspense_list"), Z = Symbol.for("react.memo"), _ = Symbol.for("react.lazy"), r = Symbol.for("react.activity"), l = Symbol.for("react.client.reference"), d = m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE, I = Object.prototype.hasOwnProperty, L = Array.isArray, O = console.createTask ? console.createTask : function() {
|
|
242
242
|
return null;
|
|
243
243
|
};
|
|
244
|
-
|
|
244
|
+
m = {
|
|
245
245
|
react_stack_bottom_frame: function(e) {
|
|
246
246
|
return e();
|
|
247
247
|
}
|
|
248
248
|
};
|
|
249
|
-
var
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
)(),
|
|
253
|
-
|
|
254
|
-
var
|
|
255
|
-
return
|
|
249
|
+
var N, C = {}, Y = m.react_stack_bottom_frame.bind(
|
|
250
|
+
m,
|
|
251
|
+
i
|
|
252
|
+
)(), S = O(p(i)), M = {};
|
|
253
|
+
$.Fragment = A, $.jsx = function(e, n, o) {
|
|
254
|
+
var c = 1e4 > d.recentlyCreatedOwnerStacks++;
|
|
255
|
+
return b(
|
|
256
256
|
e,
|
|
257
|
-
r,
|
|
258
257
|
n,
|
|
258
|
+
o,
|
|
259
259
|
!1,
|
|
260
|
-
|
|
261
|
-
|
|
260
|
+
c ? Error("react-stack-top-frame") : Y,
|
|
261
|
+
c ? O(p(e)) : S
|
|
262
262
|
);
|
|
263
|
-
},
|
|
264
|
-
var
|
|
265
|
-
return
|
|
263
|
+
}, $.jsxs = function(e, n, o) {
|
|
264
|
+
var c = 1e4 > d.recentlyCreatedOwnerStacks++;
|
|
265
|
+
return b(
|
|
266
266
|
e,
|
|
267
|
-
r,
|
|
268
267
|
n,
|
|
268
|
+
o,
|
|
269
269
|
!0,
|
|
270
|
-
|
|
271
|
-
|
|
270
|
+
c ? Error("react-stack-top-frame") : Y,
|
|
271
|
+
c ? O(p(e)) : S
|
|
272
272
|
);
|
|
273
273
|
};
|
|
274
|
-
})()),
|
|
274
|
+
})()), $;
|
|
275
275
|
}
|
|
276
276
|
var ee;
|
|
277
277
|
function ie() {
|
|
278
|
-
return ee || (ee = 1, process.env.NODE_ENV === "production" ?
|
|
278
|
+
return ee || (ee = 1, process.env.NODE_ENV === "production" ? U.exports = ce() : U.exports = se()), U.exports;
|
|
279
279
|
}
|
|
280
280
|
var B = ie();
|
|
281
281
|
const le = ne(({
|
|
282
|
-
transform:
|
|
283
|
-
offset:
|
|
284
|
-
minScale:
|
|
285
|
-
maxScale:
|
|
282
|
+
transform: u = { translateX: 0, translateY: 0, scale: 1, rotate: 0 },
|
|
283
|
+
offset: R = { left: 0, top: 0, right: 0, bottom: 0 },
|
|
284
|
+
minScale: h = 0.5,
|
|
285
|
+
maxScale: p = 10,
|
|
286
286
|
clampBounds: s = !1,
|
|
287
|
-
rotation:
|
|
288
|
-
mouse:
|
|
289
|
-
wheel:
|
|
290
|
-
touch:
|
|
291
|
-
gesture:
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
287
|
+
rotation: i = !0,
|
|
288
|
+
mouse: v = !0,
|
|
289
|
+
wheel: w = !0,
|
|
290
|
+
touch: y = !0,
|
|
291
|
+
gesture: k = !0,
|
|
292
|
+
zoomSpeed: b,
|
|
293
|
+
translateSpeed: T,
|
|
294
|
+
zoomSpeedAppleTrackpad: g,
|
|
295
|
+
translateSpeedAppleTrackpad: m,
|
|
296
|
+
children: D,
|
|
297
|
+
matrix: j,
|
|
298
|
+
style: A,
|
|
299
|
+
onTransformChange: X,
|
|
300
|
+
onInit: F,
|
|
301
|
+
onClick: z,
|
|
302
|
+
onMouseDown: H,
|
|
303
|
+
onTouchStart: q,
|
|
304
|
+
onMouseup: J,
|
|
305
|
+
onTouchend: V
|
|
306
|
+
}, Z) => {
|
|
307
|
+
const _ = G(null), r = G(null), l = G(!1), [d, I] = ae({
|
|
308
|
+
composePoint: (t, a) => [0, 0],
|
|
305
309
|
canvasWidth: 0,
|
|
306
310
|
canvasHeight: 0
|
|
307
|
-
}),
|
|
308
|
-
|
|
309
|
-
applyTransform: (
|
|
310
|
-
|
|
311
|
+
}), L = G((t, a) => r.current ? r.current.normalizeClientCoords(t, a) : [0, 0]);
|
|
312
|
+
ue(Z, () => ({
|
|
313
|
+
applyTransform: (t, a, E, x) => {
|
|
314
|
+
r.current && (x !== void 0 && (r.current.rotate = x), r.current.applyTransform(t, a, E));
|
|
311
315
|
},
|
|
312
|
-
composePoint: (
|
|
313
|
-
normalizeClientCoords: (
|
|
314
|
-
rotateCanvas: (
|
|
315
|
-
|
|
316
|
+
composePoint: (t, a) => d.composePoint ? d.composePoint(t, a) : [0, 0],
|
|
317
|
+
normalizeClientCoords: (t, a) => L.current ? L.current(t, a) : [0, 0],
|
|
318
|
+
rotateCanvas: (t, a, E) => {
|
|
319
|
+
r.current && r.current.rotateCanvas(t, a, E);
|
|
316
320
|
},
|
|
317
|
-
zoompinchEngine:
|
|
318
|
-
canvasWidth:
|
|
319
|
-
canvasHeight:
|
|
321
|
+
zoompinchEngine: r.current,
|
|
322
|
+
canvasWidth: d.canvasWidth,
|
|
323
|
+
canvasHeight: d.canvasHeight
|
|
320
324
|
}));
|
|
321
|
-
function
|
|
322
|
-
var
|
|
323
|
-
|
|
324
|
-
composePoint:
|
|
325
|
-
canvasWidth: ((
|
|
326
|
-
canvasHeight: ((
|
|
325
|
+
function O() {
|
|
326
|
+
var t, a;
|
|
327
|
+
r.current && I({
|
|
328
|
+
composePoint: r.current.composePoint.bind(r.current),
|
|
329
|
+
canvasWidth: ((t = r.current.canvasBounds) == null ? void 0 : t.width) ?? 0,
|
|
330
|
+
canvasHeight: ((a = r.current.canvasBounds) == null ? void 0 : a.height) ?? 0
|
|
327
331
|
});
|
|
328
332
|
}
|
|
329
|
-
|
|
330
|
-
!_.current ||
|
|
331
|
-
if (!
|
|
332
|
-
const
|
|
333
|
-
translateX:
|
|
334
|
-
translateY:
|
|
335
|
-
scale:
|
|
336
|
-
rotate:
|
|
333
|
+
f(() => {
|
|
334
|
+
!_.current || r.current || (r.current = new oe(_.current, R, u.translateX, u.translateY, u.scale, u.rotate, h, p, s, i), b !== void 0 && (r.current.zoomSpeed = b), T !== void 0 && (r.current.translateSpeed = T), g !== void 0 && (r.current.zoomSpeedAppleTrackpad = g), m !== void 0 && (r.current.translateSpeedAppleTrackpad = m), r.current.addEventListener("update", () => {
|
|
335
|
+
if (!r.current) return;
|
|
336
|
+
const t = {
|
|
337
|
+
translateX: r.current.translateX,
|
|
338
|
+
translateY: r.current.translateY,
|
|
339
|
+
scale: r.current.scale,
|
|
340
|
+
rotate: r.current.rotate
|
|
337
341
|
};
|
|
338
|
-
|
|
339
|
-
}),
|
|
340
|
-
|
|
342
|
+
X && (t.translateX !== u.translateX || t.translateY !== u.translateY || t.scale !== u.scale || t.rotate !== u.rotate) && X(t), O();
|
|
343
|
+
}), r.current.addEventListener("load", () => {
|
|
344
|
+
r.current && (l.current = !0, F && F(), O());
|
|
341
345
|
}));
|
|
342
|
-
}, []),
|
|
343
|
-
!
|
|
344
|
-
}, [
|
|
345
|
-
!
|
|
346
|
-
}, [
|
|
347
|
-
!
|
|
348
|
-
}, [
|
|
349
|
-
!
|
|
350
|
-
}, [
|
|
351
|
-
!
|
|
352
|
-
}, [s]),
|
|
353
|
-
!
|
|
354
|
-
}, [
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
!
|
|
365
|
-
},
|
|
366
|
-
!
|
|
367
|
-
},
|
|
368
|
-
!
|
|
369
|
-
},
|
|
370
|
-
!
|
|
371
|
-
},
|
|
372
|
-
!
|
|
373
|
-
}, e = (
|
|
374
|
-
!
|
|
346
|
+
}, []), f(() => {
|
|
347
|
+
!r.current || !l.current || (r.current.translateX !== u.translateX || r.current.translateY !== u.translateY || r.current.scale !== u.scale || r.current.rotate !== u.rotate) && (r.current.translateX = u.translateX, r.current.translateY = u.translateY, r.current.scale = u.scale, r.current.rotate = u.rotate, r.current.update());
|
|
348
|
+
}, [u]), f(() => {
|
|
349
|
+
!r.current || !l.current || (r.current.offset = R, r.current.update());
|
|
350
|
+
}, [R]), f(() => {
|
|
351
|
+
!r.current || !l.current || (r.current.minScale = h, r.current.update());
|
|
352
|
+
}, [h]), f(() => {
|
|
353
|
+
!r.current || !l.current || (r.current.maxScale = p, r.current.update());
|
|
354
|
+
}, [p]), f(() => {
|
|
355
|
+
!r.current || !l.current || (r.current.clampBounds = s, r.current.setTranslateFromUserGesture(r.current.translateX, r.current.translateY), r.current.update());
|
|
356
|
+
}, [s]), f(() => {
|
|
357
|
+
!r.current || !l.current || (r.current.rotation = i, r.current.update());
|
|
358
|
+
}, [i]), f(() => {
|
|
359
|
+
!r.current || !l.current || b !== void 0 && (r.current.zoomSpeed = b);
|
|
360
|
+
}, [b]), f(() => {
|
|
361
|
+
!r.current || !l.current || T !== void 0 && (r.current.translateSpeed = T);
|
|
362
|
+
}, [T]), f(() => {
|
|
363
|
+
!r.current || !l.current || g !== void 0 && (r.current.zoomSpeedAppleTrackpad = g);
|
|
364
|
+
}, [g]), f(() => {
|
|
365
|
+
!r.current || !l.current || m !== void 0 && (r.current.translateSpeedAppleTrackpad = m);
|
|
366
|
+
}, [m]);
|
|
367
|
+
const N = (t) => {
|
|
368
|
+
!r.current || !w || (t.preventDefault(), r.current.handleWheel(t));
|
|
369
|
+
}, C = (t) => {
|
|
370
|
+
!r.current || !k || r.current.handleGesturestart(t);
|
|
371
|
+
}, Y = (t) => {
|
|
372
|
+
!r.current || !k || r.current.handleGesturechange(t);
|
|
373
|
+
}, S = (t) => {
|
|
374
|
+
!r.current || !k || r.current.handleGestureend(t);
|
|
375
|
+
}, M = (t) => {
|
|
376
|
+
!r.current || !v || r.current.handleMousedown(t);
|
|
377
|
+
}, e = (t) => {
|
|
378
|
+
!r.current || !v || r.current.handleMousemove(t);
|
|
379
|
+
}, n = (t) => {
|
|
380
|
+
!r.current || !v || r.current.handleMouseup(t);
|
|
381
|
+
}, o = (t) => {
|
|
382
|
+
!r.current || !y || r.current.handleTouchstart(t);
|
|
383
|
+
}, c = (t) => {
|
|
384
|
+
!r.current || !y || r.current.handleTouchmove(t);
|
|
385
|
+
}, P = (t) => {
|
|
386
|
+
!r.current || !y || r.current.handleTouchend(t);
|
|
375
387
|
};
|
|
376
|
-
return
|
|
388
|
+
return f(() => {
|
|
377
389
|
if (!_.current) return;
|
|
378
|
-
const
|
|
379
|
-
return window.addEventListener("gesturechange",
|
|
380
|
-
window.removeEventListener("gesturechange",
|
|
390
|
+
const t = _.current;
|
|
391
|
+
return window.addEventListener("gesturechange", Y), window.addEventListener("gestureend", S), window.addEventListener("mousemove", e), window.addEventListener("mouseup", n), window.addEventListener("touchmove", c), window.addEventListener("touchend", P), t.addEventListener("wheel", N, { passive: !1 }), t.addEventListener("gesturestart", C, { passive: !1 }), t.addEventListener("mousedown", M, { passive: !1 }), t.addEventListener("touchstart", o, { passive: !1 }), () => {
|
|
392
|
+
window.removeEventListener("gesturechange", Y), window.removeEventListener("gestureend", S), window.removeEventListener("mousemove", e), window.removeEventListener("mouseup", n), window.removeEventListener("touchmove", c), window.removeEventListener("touchend", P), t.removeEventListener("wheel", N), t.removeEventListener("gesturestart", C), t.removeEventListener("mousedown", M), t.removeEventListener("touchstart", o);
|
|
381
393
|
};
|
|
382
|
-
}, [
|
|
394
|
+
}, [v, y, k, w]), /* @__PURE__ */ B.jsxs(
|
|
383
395
|
"div",
|
|
384
396
|
{
|
|
385
397
|
ref: _,
|
|
386
398
|
className: "zoompinch",
|
|
387
|
-
style:
|
|
388
|
-
onClick:
|
|
389
|
-
onMouseDown:
|
|
390
|
-
onTouchStart:
|
|
391
|
-
onMouseUp:
|
|
392
|
-
onTouchEnd:
|
|
399
|
+
style: A,
|
|
400
|
+
onClick: z,
|
|
401
|
+
onMouseDown: H,
|
|
402
|
+
onTouchStart: q,
|
|
403
|
+
onMouseUp: J,
|
|
404
|
+
onTouchEnd: V,
|
|
393
405
|
children: [
|
|
394
|
-
/* @__PURE__ */ B.jsx("div", { className: "canvas", children:
|
|
395
|
-
/* @__PURE__ */ B.jsx("div", { className: "matrix", children: typeof
|
|
396
|
-
composePoint:
|
|
397
|
-
normalizeClientCoords:
|
|
398
|
-
canvasWidth:
|
|
399
|
-
canvasHeight:
|
|
400
|
-
}) :
|
|
406
|
+
/* @__PURE__ */ B.jsx("div", { className: "canvas", children: D }),
|
|
407
|
+
/* @__PURE__ */ B.jsx("div", { className: "matrix", children: typeof j == "function" ? j({
|
|
408
|
+
composePoint: d.composePoint,
|
|
409
|
+
normalizeClientCoords: L.current,
|
|
410
|
+
canvasWidth: d.canvasWidth,
|
|
411
|
+
canvasHeight: d.canvasHeight
|
|
412
|
+
}) : j })
|
|
401
413
|
]
|
|
402
414
|
}
|
|
403
415
|
);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
(function(
|
|
1
|
+
(function(_,c){typeof exports=="object"&&typeof module<"u"?c(exports,require("react"),require("@zoompinch/core")):typeof define=="function"&&define.amd?define(["exports","react","@zoompinch/core"],c):(_=typeof globalThis<"u"?globalThis:_||self,c(_.ZoompinchReact={},_.React,_.ZoompinchCore))})(this,(function(_,c,te){"use strict";var F={exports:{}},A={};/**
|
|
2
2
|
* @license React
|
|
3
3
|
* react-jsx-runtime.production.js
|
|
4
4
|
*
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
*
|
|
7
7
|
* This source code is licensed under the MIT license found in the
|
|
8
8
|
* LICENSE file in the root directory of this source tree.
|
|
9
|
-
*/var q;function ne(){if(q)return
|
|
9
|
+
*/var q;function ne(){if(q)return A;q=1;var o=Symbol.for("react.transitional.element"),w=Symbol.for("react.fragment");function h(p,i,l){var v=null;if(l!==void 0&&(v=""+l),i.key!==void 0&&(v=""+i.key),"key"in i){l={};for(var T in i)T!=="key"&&(l[T]=i[T])}else l=i;return i=l.ref,{$$typeof:o,type:p,key:v,ref:i!==void 0?i:null,props:l}}return A.Fragment=w,A.jsx=h,A.jsxs=h,A}var C={};/**
|
|
10
10
|
* @license React
|
|
11
11
|
* react-jsx-runtime.development.js
|
|
12
12
|
*
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
*
|
|
15
15
|
* This source code is licensed under the MIT license found in the
|
|
16
16
|
* LICENSE file in the root directory of this source tree.
|
|
17
|
-
*/var $;function ae(){return $||($=1,process.env.NODE_ENV!=="production"&&(function(){function
|
|
17
|
+
*/var $;function ae(){return $||($=1,process.env.NODE_ENV!=="production"&&(function(){function o(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===f?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case N:return"Fragment";case G:return"Profiler";case z:return"StrictMode";case B:return"Suspense";case Q:return"SuspenseList";case r:return"Activity"}if(typeof e=="object")switch(typeof e.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),e.$$typeof){case L:return"Portal";case V:return e.displayName||"Context";case J:return(e._context.displayName||"Context")+".Consumer";case Z:var n=e.render;return e=e.displayName,e||(e=n.displayName||n.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return n=e.displayName||null,n!==null?n:o(e.type)||"Memo";case R:n=e._payload,e=e._init;try{return o(e(n))}catch{}}return null}function w(e){return""+e}function h(e){try{w(e);var n=!1}catch{n=!0}if(n){n=console;var u=n.error,s=typeof Symbol=="function"&&Symbol.toStringTag&&e[Symbol.toStringTag]||e.constructor.name||"Object";return u.call(n,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",s),w(e)}}function p(e){if(e===N)return"<>";if(typeof e=="object"&&e!==null&&e.$$typeof===R)return"<...>";try{var n=o(e);return n?"<"+n+">":"<...>"}catch{return"<...>"}}function i(){var e=d.A;return e===null?null:e.getOwner()}function l(){return Error("react-stack-top-frame")}function v(e){if(U.call(e,"key")){var n=Object.getOwnPropertyDescriptor(e,"key").get;if(n&&n.isReactWarning)return!1}return e.key!==void 0}function T(e,n){function u(){Y||(Y=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",n))}u.isReactWarning=!0,Object.defineProperty(e,"key",{get:u,configurable:!0})}function O(){var e=o(this.type);return M[e]||(M[e]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),e=this.props.ref,e!==void 0?e:null}function k(e,n,u,s,P,t){var a=u.ref;return e={$$typeof:I,type:e,key:n,props:u,_owner:s},(a!==void 0?a:null)!==null?Object.defineProperty(e,"ref",{enumerable:!1,get:O}):Object.defineProperty(e,"ref",{enumerable:!1,value:null}),e._store={},Object.defineProperty(e._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(e,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(e,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:P}),Object.defineProperty(e,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:t}),Object.freeze&&(Object.freeze(e.props),Object.freeze(e)),e}function b(e,n,u,s,P,t){var a=n.children;if(a!==void 0)if(s)if(S(a)){for(s=0;s<a.length;s++)g(a[s]);Object.freeze&&Object.freeze(a)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else g(a);if(U.call(n,"key")){a=o(e);var E=Object.keys(n).filter(function(ue){return ue!=="key"});s=0<E.length?"{key: someKey, "+E.join(": ..., ")+": ...}":"{key: someKey}",X[a+s]||(E=0<E.length?"{"+E.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
|
|
18
18
|
let props = %s;
|
|
19
19
|
<%s {...props} />
|
|
20
20
|
React keys must be passed directly to JSX without using spread:
|
|
21
21
|
let props = %s;
|
|
22
|
-
<%s key={someKey} {...props} />`,
|
|
22
|
+
<%s key={someKey} {...props} />`,s,a,E,a),X[a+s]=!0)}if(a=null,u!==void 0&&(h(u),a=""+u),v(n)&&(h(n.key),a=""+n.key),"key"in n){u={};for(var j in n)j!=="key"&&(u[j]=n[j])}else u=n;return a&&T(u,typeof e=="function"?e.displayName||e.name||"Unknown":e),k(e,a,u,i(),P,t)}function g(e){y(e)?e._store&&(e._store.validated=1):typeof e=="object"&&e!==null&&e.$$typeof===R&&(e._payload.status==="fulfilled"?y(e._payload.value)&&e._payload.value._store&&(e._payload.value._store.validated=1):e._store&&(e._store.validated=1))}function y(e){return typeof e=="object"&&e!==null&&e.$$typeof===I}var m=c,I=Symbol.for("react.transitional.element"),L=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),z=Symbol.for("react.strict_mode"),G=Symbol.for("react.profiler"),J=Symbol.for("react.consumer"),V=Symbol.for("react.context"),Z=Symbol.for("react.forward_ref"),B=Symbol.for("react.suspense"),Q=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),r=Symbol.for("react.activity"),f=Symbol.for("react.client.reference"),d=m.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,U=Object.prototype.hasOwnProperty,S=Array.isArray,x=console.createTask?console.createTask:function(){return null};m={react_stack_bottom_frame:function(e){return e()}};var Y,M={},W=m.react_stack_bottom_frame.bind(m,l)(),D=x(p(l)),X={};C.Fragment=N,C.jsx=function(e,n,u){var s=1e4>d.recentlyCreatedOwnerStacks++;return b(e,n,u,!1,s?Error("react-stack-top-frame"):W,s?x(p(e)):D)},C.jsxs=function(e,n,u){var s=1e4>d.recentlyCreatedOwnerStacks++;return b(e,n,u,!0,s?Error("react-stack-top-frame"):W,s?x(p(e)):D)}})()),C}var ee;function oe(){return ee||(ee=1,process.env.NODE_ENV==="production"?F.exports=ne():F.exports=ae()),F.exports}var H=oe();const re=c.forwardRef(({transform:o={translateX:0,translateY:0,scale:1,rotate:0},offset:w={left:0,top:0,right:0,bottom:0},minScale:h=.5,maxScale:p=10,clampBounds:i=!1,rotation:l=!0,mouse:v=!0,wheel:T=!0,touch:O=!0,gesture:k=!0,zoomSpeed:b,translateSpeed:g,zoomSpeedAppleTrackpad:y,translateSpeedAppleTrackpad:m,children:I,matrix:L,style:N,onTransformChange:z,onInit:G,onClick:J,onMouseDown:V,onTouchStart:Z,onMouseup:B,onTouchend:Q},K)=>{const R=c.useRef(null),r=c.useRef(null),f=c.useRef(!1),[d,U]=c.useState({composePoint:(t,a)=>[0,0],canvasWidth:0,canvasHeight:0}),S=c.useRef((t,a)=>r.current?r.current.normalizeClientCoords(t,a):[0,0]);c.useImperativeHandle(K,()=>({applyTransform:(t,a,E,j)=>{r.current&&(j!==void 0&&(r.current.rotate=j),r.current.applyTransform(t,a,E))},composePoint:(t,a)=>d.composePoint?d.composePoint(t,a):[0,0],normalizeClientCoords:(t,a)=>S.current?S.current(t,a):[0,0],rotateCanvas:(t,a,E)=>{r.current&&r.current.rotateCanvas(t,a,E)},zoompinchEngine:r.current,canvasWidth:d.canvasWidth,canvasHeight:d.canvasHeight}));function x(){var t,a;r.current&&U({composePoint:r.current.composePoint.bind(r.current),canvasWidth:((t=r.current.canvasBounds)==null?void 0:t.width)??0,canvasHeight:((a=r.current.canvasBounds)==null?void 0:a.height)??0})}c.useEffect(()=>{!R.current||r.current||(r.current=new te.Zoompinch(R.current,w,o.translateX,o.translateY,o.scale,o.rotate,h,p,i,l),b!==void 0&&(r.current.zoomSpeed=b),g!==void 0&&(r.current.translateSpeed=g),y!==void 0&&(r.current.zoomSpeedAppleTrackpad=y),m!==void 0&&(r.current.translateSpeedAppleTrackpad=m),r.current.addEventListener("update",()=>{if(!r.current)return;const t={translateX:r.current.translateX,translateY:r.current.translateY,scale:r.current.scale,rotate:r.current.rotate};z&&(t.translateX!==o.translateX||t.translateY!==o.translateY||t.scale!==o.scale||t.rotate!==o.rotate)&&z(t),x()}),r.current.addEventListener("load",()=>{r.current&&(f.current=!0,G&&G(),x())}))},[]),c.useEffect(()=>{!r.current||!f.current||(r.current.translateX!==o.translateX||r.current.translateY!==o.translateY||r.current.scale!==o.scale||r.current.rotate!==o.rotate)&&(r.current.translateX=o.translateX,r.current.translateY=o.translateY,r.current.scale=o.scale,r.current.rotate=o.rotate,r.current.update())},[o]),c.useEffect(()=>{!r.current||!f.current||(r.current.offset=w,r.current.update())},[w]),c.useEffect(()=>{!r.current||!f.current||(r.current.minScale=h,r.current.update())},[h]),c.useEffect(()=>{!r.current||!f.current||(r.current.maxScale=p,r.current.update())},[p]),c.useEffect(()=>{!r.current||!f.current||(r.current.clampBounds=i,r.current.setTranslateFromUserGesture(r.current.translateX,r.current.translateY),r.current.update())},[i]),c.useEffect(()=>{!r.current||!f.current||(r.current.rotation=l,r.current.update())},[l]),c.useEffect(()=>{!r.current||!f.current||b!==void 0&&(r.current.zoomSpeed=b)},[b]),c.useEffect(()=>{!r.current||!f.current||g!==void 0&&(r.current.translateSpeed=g)},[g]),c.useEffect(()=>{!r.current||!f.current||y!==void 0&&(r.current.zoomSpeedAppleTrackpad=y)},[y]),c.useEffect(()=>{!r.current||!f.current||m!==void 0&&(r.current.translateSpeedAppleTrackpad=m)},[m]);const Y=t=>{!r.current||!T||(t.preventDefault(),r.current.handleWheel(t))},M=t=>{!r.current||!k||r.current.handleGesturestart(t)},W=t=>{!r.current||!k||r.current.handleGesturechange(t)},D=t=>{!r.current||!k||r.current.handleGestureend(t)},X=t=>{!r.current||!v||r.current.handleMousedown(t)},e=t=>{!r.current||!v||r.current.handleMousemove(t)},n=t=>{!r.current||!v||r.current.handleMouseup(t)},u=t=>{!r.current||!O||r.current.handleTouchstart(t)},s=t=>{!r.current||!O||r.current.handleTouchmove(t)},P=t=>{!r.current||!O||r.current.handleTouchend(t)};return c.useEffect(()=>{if(!R.current)return;const t=R.current;return window.addEventListener("gesturechange",W),window.addEventListener("gestureend",D),window.addEventListener("mousemove",e),window.addEventListener("mouseup",n),window.addEventListener("touchmove",s),window.addEventListener("touchend",P),t.addEventListener("wheel",Y,{passive:!1}),t.addEventListener("gesturestart",M,{passive:!1}),t.addEventListener("mousedown",X,{passive:!1}),t.addEventListener("touchstart",u,{passive:!1}),()=>{window.removeEventListener("gesturechange",W),window.removeEventListener("gestureend",D),window.removeEventListener("mousemove",e),window.removeEventListener("mouseup",n),window.removeEventListener("touchmove",s),window.removeEventListener("touchend",P),t.removeEventListener("wheel",Y),t.removeEventListener("gesturestart",M),t.removeEventListener("mousedown",X),t.removeEventListener("touchstart",u)}},[v,O,k,T]),H.jsxs("div",{ref:R,className:"zoompinch",style:N,onClick:J,onMouseDown:V,onTouchStart:Z,onMouseUp:B,onTouchEnd:Q,children:[H.jsx("div",{className:"canvas",children:I}),H.jsx("div",{className:"matrix",children:typeof L=="function"?L({composePoint:d.composePoint,normalizeClientCoords:S.current,canvasWidth:d.canvasWidth,canvasHeight:d.canvasHeight}):L})]})});re.displayName="Zoompinch",_.Zoompinch=re,Object.defineProperty(_,Symbol.toStringTag,{value:"Module"})}));
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zoompinch/react",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.5",
|
|
4
4
|
"description": "React components for Zoompinch",
|
|
5
5
|
"main": "./dist/zoompinch-react.umd.js",
|
|
6
6
|
"module": "./dist/zoompinch-react.es.js",
|
|
@@ -57,6 +57,6 @@
|
|
|
57
57
|
"vite": "^6.4.1"
|
|
58
58
|
},
|
|
59
59
|
"dependencies": {
|
|
60
|
-
"@zoompinch/core": "^0.0.
|
|
60
|
+
"@zoompinch/core": "^0.0.28"
|
|
61
61
|
}
|
|
62
62
|
}
|