gesturx 1.8.5 → 1.8.7
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/dist/index.d.ts +6 -4
- package/dist/index.js +132 -129
- package/dist/index.js.map +1 -1
- package/dist/index.umd.cjs +1 -1
- package/dist/index.umd.cjs.map +1 -1
- package/package.json +16 -12
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
var ie = Object.defineProperty;
|
|
2
2
|
var se = (t, n, e) => n in t ? ie(t, n, { enumerable: !0, configurable: !0, writable: !0, value: e }) : t[n] = e;
|
|
3
3
|
var $ = (t, n, e) => se(t, typeof n != "symbol" ? n + "" : n, e);
|
|
4
|
-
import { filter as
|
|
4
|
+
import { filter as h, fromEvent as S, map as c, mergeMap as b, defer as pe, of as T, merge as g, takeWhile as V, scan as L, BehaviorSubject as q, switchMap as v, share as P, distinctUntilChanged as oe, startWith as re, shareReplay as M, combineLatest as j, exhaustMap as H, first as z, timer as J, withLatestFrom as C, takeUntil as I, skip as ae, tap as K, ignoreElements as le, buffer as he, debounceTime as ce, NEVER as $e, defaultIfEmpty as ue } from "rxjs";
|
|
5
5
|
function de(t, n) {
|
|
6
6
|
return Math.sqrt(
|
|
7
7
|
Math.pow(n.x - t.x, 2) + Math.pow(n.y - t.y, 2)
|
|
@@ -20,7 +20,7 @@ function N(t, n) {
|
|
|
20
20
|
function ge(t, n) {
|
|
21
21
|
return N(t, n) * (180 / Math.PI);
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function F(t) {
|
|
24
24
|
const n = t.reduce(
|
|
25
25
|
(i, o) => (i.x += o.x, i.y += o.y, i),
|
|
26
26
|
{ x: 0, y: 0 }
|
|
@@ -33,7 +33,7 @@ function k(t) {
|
|
|
33
33
|
function ye(t, n) {
|
|
34
34
|
if (t.length !== n.length)
|
|
35
35
|
throw new Error("Initial and new points arrays must have the same length.");
|
|
36
|
-
const e =
|
|
36
|
+
const e = F(t), i = F(n);
|
|
37
37
|
let o = 0;
|
|
38
38
|
for (let s = 0; s < t.length; s++) {
|
|
39
39
|
const r = N(
|
|
@@ -52,9 +52,9 @@ function ye(t, n) {
|
|
|
52
52
|
function fe(t) {
|
|
53
53
|
return t != null;
|
|
54
54
|
}
|
|
55
|
-
const me = (t) => t.length > 0, Ae = (t) => t.pipe(
|
|
55
|
+
const me = (t) => t.length > 0, Ae = (t) => t.pipe(h(me));
|
|
56
56
|
function Q(t, n, e) {
|
|
57
|
-
const i =
|
|
57
|
+
const i = F([t]), o = F([n]);
|
|
58
58
|
return Math.abs(o.x - i.x) >= e || Math.abs(o.y - i.y) >= e;
|
|
59
59
|
}
|
|
60
60
|
const De = (t, n, e) => {
|
|
@@ -64,33 +64,33 @@ const De = (t, n, e) => {
|
|
|
64
64
|
velocityY: o
|
|
65
65
|
};
|
|
66
66
|
};
|
|
67
|
-
function
|
|
67
|
+
function U(t) {
|
|
68
68
|
return (n) => n.pipe(
|
|
69
|
-
|
|
69
|
+
h((e) => e.pointerId === t.pointerId)
|
|
70
70
|
);
|
|
71
71
|
}
|
|
72
72
|
const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.type === "pointerup", Pe = ({
|
|
73
73
|
container: t,
|
|
74
74
|
afterEventReceived: n = (e) => e
|
|
75
75
|
}) => S(t, "pointerdown").pipe(
|
|
76
|
-
|
|
76
|
+
c(n)
|
|
77
77
|
), ee = ({
|
|
78
78
|
pointerEvent$: t
|
|
79
79
|
}) => (n) => {
|
|
80
80
|
const e = t.pipe(
|
|
81
|
-
|
|
81
|
+
h((r) => r.type === "pointerup")
|
|
82
82
|
), i = t.pipe(
|
|
83
|
-
|
|
83
|
+
h((r) => r.type === "pointerleave")
|
|
84
84
|
), o = t.pipe(
|
|
85
|
-
|
|
85
|
+
h((r) => r.type === "pointercancel")
|
|
86
86
|
), p = t.pipe(
|
|
87
|
-
|
|
87
|
+
h((r) => r.type === "pointermove")
|
|
88
88
|
), a = S(window, "contextmenu"), s = (r) => ["pointercancel", "pointerleave", "pointerup", "contextmenu"].includes(
|
|
89
89
|
r.type
|
|
90
90
|
);
|
|
91
91
|
return n.pipe(
|
|
92
92
|
b((r) => {
|
|
93
|
-
const l = pe(() =>
|
|
93
|
+
const l = pe(() => T(r));
|
|
94
94
|
return g(
|
|
95
95
|
l,
|
|
96
96
|
g(
|
|
@@ -101,11 +101,11 @@ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.ty
|
|
|
101
101
|
a
|
|
102
102
|
)
|
|
103
103
|
).pipe(
|
|
104
|
-
|
|
104
|
+
U(r),
|
|
105
105
|
V((m) => !s(m), !0)
|
|
106
106
|
);
|
|
107
107
|
}),
|
|
108
|
-
|
|
108
|
+
L((r, l) => {
|
|
109
109
|
if (s(l)) {
|
|
110
110
|
const { [l.pointerId]: u, ...m } = (r == null ? void 0 : r.pointers) ?? {};
|
|
111
111
|
return {
|
|
@@ -121,7 +121,7 @@ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.ty
|
|
|
121
121
|
}
|
|
122
122
|
};
|
|
123
123
|
}, void 0),
|
|
124
|
-
|
|
124
|
+
c(({ event: r, pointers: l }) => ({
|
|
125
125
|
event: r,
|
|
126
126
|
pointers: Object.values(l).filter(fe)
|
|
127
127
|
}))
|
|
@@ -133,11 +133,11 @@ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.ty
|
|
|
133
133
|
deltaY: p
|
|
134
134
|
};
|
|
135
135
|
}, te = (t) => {
|
|
136
|
-
const n = (e) =>
|
|
136
|
+
const n = (e) => F(
|
|
137
137
|
e.latestActivePointers.length ? e.latestActivePointers : [e.event]
|
|
138
138
|
);
|
|
139
139
|
return t.pipe(
|
|
140
|
-
|
|
140
|
+
L((e, i) => {
|
|
141
141
|
var f, E;
|
|
142
142
|
const o = n(i), p = (e == null ? void 0 : e.center) ?? o, a = (e == null ? void 0 : e.deltaX) ?? 0, s = (e == null ? void 0 : e.deltaY) ?? 0, r = ((f = e == null ? void 0 : e.latestActivePointers) == null ? void 0 : f.length) ?? 1, l = ((E = i.latestActivePointers) == null ? void 0 : E.length) ?? 1, u = ["pointerdown", "pointercancel", "pointerleave", "pointerup"].includes(
|
|
143
143
|
i.event.type
|
|
@@ -155,7 +155,7 @@ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.ty
|
|
|
155
155
|
deltaPointersAngle: D
|
|
156
156
|
};
|
|
157
157
|
}, void 0),
|
|
158
|
-
|
|
158
|
+
c((e) => {
|
|
159
159
|
const {
|
|
160
160
|
deltaX: i,
|
|
161
161
|
deltaY: o,
|
|
@@ -181,23 +181,23 @@ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.ty
|
|
|
181
181
|
})
|
|
182
182
|
);
|
|
183
183
|
}, G = (t) => t.pipe(
|
|
184
|
-
|
|
184
|
+
h(
|
|
185
185
|
(n) => !!n.container
|
|
186
186
|
)
|
|
187
|
-
), ne = (t) => t.pipe(
|
|
187
|
+
), ne = (t) => t.pipe(h(Z)), Ee = ({
|
|
188
188
|
container: t,
|
|
189
189
|
afterEventReceived: n = (e) => e
|
|
190
190
|
}) => {
|
|
191
191
|
const e = Pe({ afterEventReceived: n, container: t }), i = S(t, "pointerup").pipe(
|
|
192
|
-
|
|
192
|
+
c(n)
|
|
193
193
|
), o = S(t, "pointermove").pipe(
|
|
194
|
-
|
|
194
|
+
c(n)
|
|
195
195
|
), p = S(t, "pointerleave").pipe(
|
|
196
|
-
|
|
196
|
+
c(n)
|
|
197
197
|
), a = S(
|
|
198
198
|
t,
|
|
199
199
|
"pointercancel"
|
|
200
|
-
).pipe(
|
|
200
|
+
).pipe(c(n));
|
|
201
201
|
return {
|
|
202
202
|
pointerEvents$: g(
|
|
203
203
|
e,
|
|
@@ -213,7 +213,7 @@ const Z = (t) => t.type === "pointerleave" || t.type === "pointercancel" || t.ty
|
|
|
213
213
|
pointerMove$: o
|
|
214
214
|
};
|
|
215
215
|
};
|
|
216
|
-
class
|
|
216
|
+
class O {
|
|
217
217
|
constructor(n, e) {
|
|
218
218
|
$(this, "configSubject", new q({}));
|
|
219
219
|
$(this, "pan$");
|
|
@@ -244,30 +244,30 @@ class F {
|
|
|
244
244
|
),
|
|
245
245
|
P()
|
|
246
246
|
), this.pointerDown$ = this.pointerEvent$.pipe(
|
|
247
|
-
|
|
247
|
+
h((p) => p.type === "pointerdown")
|
|
248
248
|
), this.pointerUp$ = this.pointerEvent$.pipe(
|
|
249
|
-
|
|
249
|
+
h((p) => p.type === "pointerup")
|
|
250
250
|
), this.pointerMove$ = this.pointerEvent$.pipe(
|
|
251
|
-
|
|
251
|
+
h((p) => p.type === "pointermove")
|
|
252
252
|
), this.pointerCancel$ = this.pointerEvent$.pipe(
|
|
253
|
-
|
|
253
|
+
h((p) => p.type === "pointercancel")
|
|
254
254
|
), this.pointerOff$ = this.pointerEvent$.pipe(ne);
|
|
255
255
|
const o = this.config$.pipe(
|
|
256
|
-
|
|
256
|
+
c(({ failWith: p }) => p),
|
|
257
257
|
oe()
|
|
258
258
|
);
|
|
259
259
|
this.failWithActive$ = o.pipe(
|
|
260
260
|
v((p) => {
|
|
261
261
|
const a = p == null ? void 0 : p.map((s) => {
|
|
262
|
-
const r = s.start$.pipe(
|
|
262
|
+
const r = s.start$.pipe(c(() => !0)), l = s.end$.pipe(c(() => !1));
|
|
263
263
|
return g(r, l).pipe(
|
|
264
264
|
re(!1),
|
|
265
265
|
M(1)
|
|
266
266
|
);
|
|
267
267
|
});
|
|
268
|
-
return a != null && a.length ? j(a) : j([
|
|
268
|
+
return a != null && a.length ? j(a) : j([T(!1)]);
|
|
269
269
|
}),
|
|
270
|
-
|
|
270
|
+
c((p) => p.some((a) => a)),
|
|
271
271
|
M(1)
|
|
272
272
|
), this.pan$ = this.configSubject.pipe(
|
|
273
273
|
G,
|
|
@@ -275,30 +275,29 @@ class F {
|
|
|
275
275
|
var y, A, D;
|
|
276
276
|
const a = Math.max(1, ((y = p.panConfig) == null ? void 0 : y.numInputs) ?? 1), s = Math.max(0, ((A = p.panConfig) == null ? void 0 : A.posThreshold) ?? 0), r = Math.max(0, ((D = p.panConfig) == null ? void 0 : D.delay) ?? 0), l = this.pointerDown$.pipe(
|
|
277
277
|
ee({
|
|
278
|
-
pointerEvent$: this.pointerEvent
|
|
279
|
-
trackMove: !0
|
|
278
|
+
pointerEvent$: this.pointerEvent$
|
|
280
279
|
}),
|
|
281
280
|
M(1)
|
|
282
281
|
), u = (f) => f.pipe(
|
|
283
|
-
|
|
282
|
+
h(
|
|
284
283
|
(E) => E.pointers.length >= a
|
|
285
284
|
)
|
|
286
|
-
), m = (f) => f.pipe(
|
|
285
|
+
), m = (f) => f.pipe(h((E) => E.pointers.length < a));
|
|
287
286
|
return l.pipe(
|
|
288
287
|
u,
|
|
289
288
|
H(({ pointers: f }) => {
|
|
290
289
|
const E = l.pipe(
|
|
291
290
|
m,
|
|
292
|
-
|
|
291
|
+
z(),
|
|
293
292
|
P()
|
|
294
|
-
), X = J(r),
|
|
295
|
-
...f.map((d) =>
|
|
293
|
+
), X = J(r), R = g(
|
|
294
|
+
...f.map((d) => T(d)),
|
|
296
295
|
this.pointerDown$
|
|
297
296
|
).pipe(
|
|
298
297
|
b(
|
|
299
|
-
(d) => g(this.pointerMove$,
|
|
300
|
-
|
|
301
|
-
|
|
298
|
+
(d) => g(this.pointerMove$, T(d)).pipe(
|
|
299
|
+
U(d),
|
|
300
|
+
h(
|
|
302
301
|
(x) => Q(
|
|
303
302
|
d,
|
|
304
303
|
x,
|
|
@@ -307,11 +306,11 @@ class F {
|
|
|
307
306
|
)
|
|
308
307
|
)
|
|
309
308
|
),
|
|
310
|
-
|
|
309
|
+
z()
|
|
311
310
|
).pipe(
|
|
312
311
|
v(() => X),
|
|
313
|
-
|
|
314
|
-
|
|
312
|
+
C(l),
|
|
313
|
+
c(([, { event: d, pointers: x }]) => ({
|
|
315
314
|
type: "start",
|
|
316
315
|
event: d,
|
|
317
316
|
latestActivePointers: x
|
|
@@ -320,36 +319,36 @@ class F {
|
|
|
320
319
|
bufferSize: 1,
|
|
321
320
|
refCount: !1
|
|
322
321
|
}),
|
|
323
|
-
|
|
324
|
-
),
|
|
322
|
+
I(E)
|
|
323
|
+
), k = R.pipe(
|
|
325
324
|
b(
|
|
326
325
|
() => l.pipe(
|
|
327
326
|
ae(1),
|
|
328
|
-
|
|
327
|
+
c(({ event: d, pointers: x }) => ({
|
|
329
328
|
type: "move",
|
|
330
329
|
event: d,
|
|
331
330
|
latestActivePointers: x
|
|
332
331
|
}))
|
|
333
332
|
)
|
|
334
333
|
),
|
|
335
|
-
|
|
336
|
-
), w =
|
|
334
|
+
I(E)
|
|
335
|
+
), w = R.pipe(
|
|
337
336
|
b(
|
|
338
337
|
() => E.pipe(
|
|
339
|
-
|
|
338
|
+
c(({ event: d, pointers: x }) => ({
|
|
340
339
|
type: "end",
|
|
341
340
|
event: d,
|
|
342
341
|
latestActivePointers: x
|
|
343
342
|
}))
|
|
344
343
|
)
|
|
345
344
|
)
|
|
346
|
-
),
|
|
345
|
+
), W = g(R, k, w).pipe(
|
|
347
346
|
M(1)
|
|
348
347
|
);
|
|
349
|
-
return
|
|
348
|
+
return W.pipe(
|
|
350
349
|
te,
|
|
351
|
-
|
|
352
|
-
|
|
350
|
+
C(W),
|
|
351
|
+
c(([d, { type: x }]) => ({
|
|
353
352
|
...d,
|
|
354
353
|
type: x
|
|
355
354
|
}))
|
|
@@ -364,14 +363,14 @@ class F {
|
|
|
364
363
|
}),
|
|
365
364
|
P()
|
|
366
365
|
), this.panStart$ = this.pan$.pipe(
|
|
367
|
-
|
|
368
|
-
|
|
366
|
+
h((p) => p.type === "start"),
|
|
367
|
+
c(({ type: p, ...a }) => a)
|
|
369
368
|
), this.panMove$ = this.pan$.pipe(
|
|
370
|
-
|
|
371
|
-
|
|
369
|
+
h((p) => p.type === "move"),
|
|
370
|
+
c(({ type: p, ...a }) => a)
|
|
372
371
|
), this.panEnd$ = this.pan$.pipe(
|
|
373
|
-
|
|
374
|
-
|
|
372
|
+
h((p) => p.type === "end"),
|
|
373
|
+
c(({ type: p, ...a }) => a)
|
|
375
374
|
), this.state$ = i.asObservable(), this.updateInternal(n ?? {}, e);
|
|
376
375
|
}
|
|
377
376
|
updateInternal(n, e) {
|
|
@@ -392,7 +391,7 @@ class F {
|
|
|
392
391
|
this.updateInternal(n, e);
|
|
393
392
|
}
|
|
394
393
|
}
|
|
395
|
-
class Se extends
|
|
394
|
+
class Se extends O {
|
|
396
395
|
constructor(e) {
|
|
397
396
|
var a;
|
|
398
397
|
super(e, {
|
|
@@ -403,22 +402,22 @@ class Se extends F {
|
|
|
403
402
|
$(this, "start$");
|
|
404
403
|
$(this, "end$");
|
|
405
404
|
const i = this.panStart$.pipe(
|
|
406
|
-
|
|
405
|
+
c((s) => ({
|
|
407
406
|
type: "panStart",
|
|
408
407
|
...s
|
|
409
408
|
})),
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
409
|
+
C(this.failWithActive$),
|
|
410
|
+
h(([, s]) => !s),
|
|
411
|
+
c(([s]) => s),
|
|
413
412
|
P()
|
|
414
413
|
), o = this.panEnd$.pipe(
|
|
415
|
-
|
|
414
|
+
c((s) => ({
|
|
416
415
|
type: "panEnd",
|
|
417
416
|
...s
|
|
418
417
|
})),
|
|
419
418
|
P()
|
|
420
419
|
), p = this.panMove$.pipe(
|
|
421
|
-
|
|
420
|
+
c((s) => ({
|
|
422
421
|
type: "panMove",
|
|
423
422
|
...s
|
|
424
423
|
}))
|
|
@@ -426,36 +425,36 @@ class Se extends F {
|
|
|
426
425
|
this.events$ = i.pipe(
|
|
427
426
|
v((s) => {
|
|
428
427
|
let r = s;
|
|
429
|
-
const l =
|
|
430
|
-
|
|
431
|
-
|
|
428
|
+
const l = T(s), u = this.failWithActive$.pipe(
|
|
429
|
+
h((A) => A),
|
|
430
|
+
z()
|
|
432
431
|
), m = g(l, p, o).pipe(
|
|
433
432
|
K((A) => {
|
|
434
433
|
r = A;
|
|
435
434
|
}),
|
|
436
|
-
|
|
435
|
+
I(u)
|
|
437
436
|
), y = u.pipe(
|
|
438
|
-
|
|
437
|
+
c(() => ({
|
|
439
438
|
...r,
|
|
440
439
|
type: "panEnd"
|
|
441
440
|
})),
|
|
442
|
-
|
|
441
|
+
I(o)
|
|
443
442
|
);
|
|
444
443
|
return g(m, y);
|
|
445
444
|
}),
|
|
446
445
|
P()
|
|
447
446
|
), this.start$ = this.events$.pipe(
|
|
448
|
-
|
|
449
|
-
), this.end$ = this.events$.pipe(
|
|
447
|
+
h((s) => s.type === "panStart")
|
|
448
|
+
), this.end$ = this.events$.pipe(h((s) => s.type === "panEnd"));
|
|
450
449
|
}
|
|
451
450
|
update(e) {
|
|
452
451
|
super.update(e, e.options);
|
|
453
452
|
}
|
|
454
453
|
}
|
|
455
454
|
const we = (t) => (n) => n.pipe(
|
|
456
|
-
|
|
455
|
+
h((e) => Math.abs(e.velocityX) >= t || Math.abs(e.velocityY) >= t)
|
|
457
456
|
);
|
|
458
|
-
class be extends
|
|
457
|
+
class be extends O {
|
|
459
458
|
constructor(e) {
|
|
460
459
|
super(e, {
|
|
461
460
|
posThreshold: 0,
|
|
@@ -466,16 +465,21 @@ class be extends F {
|
|
|
466
465
|
v((i) => {
|
|
467
466
|
const { escapeVelocity: o = 0.9 } = i.options ?? {};
|
|
468
467
|
return this.panStart$.pipe(
|
|
469
|
-
|
|
468
|
+
C(this.failWithActive$),
|
|
469
|
+
h(([, p]) => !p),
|
|
470
|
+
v(([p]) => this.panEnd$.pipe(
|
|
470
471
|
we(o),
|
|
471
|
-
|
|
472
|
+
c((a) => ({
|
|
472
473
|
type: "swipe",
|
|
473
474
|
angle: ge(
|
|
474
475
|
p.event,
|
|
475
476
|
a.event
|
|
476
477
|
),
|
|
477
478
|
...a
|
|
478
|
-
}))
|
|
479
|
+
})),
|
|
480
|
+
I(
|
|
481
|
+
this.failWithActive$.pipe(h((a) => a))
|
|
482
|
+
)
|
|
479
483
|
)),
|
|
480
484
|
P()
|
|
481
485
|
);
|
|
@@ -492,8 +496,8 @@ const Me = ({
|
|
|
492
496
|
}) => (e) => e.pipe(
|
|
493
497
|
b(
|
|
494
498
|
(i) => J(t).pipe(
|
|
495
|
-
|
|
496
|
-
n.pipe(ne,
|
|
499
|
+
I(
|
|
500
|
+
n.pipe(ne, U(i))
|
|
497
501
|
)
|
|
498
502
|
)
|
|
499
503
|
)
|
|
@@ -504,15 +508,15 @@ const Me = ({
|
|
|
504
508
|
}) => (i) => i.pipe(
|
|
505
509
|
b(
|
|
506
510
|
(o) => n.pipe(
|
|
507
|
-
|
|
511
|
+
U(o),
|
|
508
512
|
V((p) => !Z(p), !0),
|
|
509
|
-
|
|
513
|
+
h(
|
|
510
514
|
(p) => Q(t, p, e)
|
|
511
515
|
)
|
|
512
516
|
)
|
|
513
517
|
)
|
|
514
518
|
);
|
|
515
|
-
class Ce extends
|
|
519
|
+
class Ce extends O {
|
|
516
520
|
constructor(e) {
|
|
517
521
|
super(e);
|
|
518
522
|
$(this, "events$");
|
|
@@ -521,15 +525,14 @@ class Ce extends F {
|
|
|
521
525
|
var y, A;
|
|
522
526
|
const o = ((y = i.options) == null ? void 0 : y.maxTaps) ?? 1, p = ((A = i.options) == null ? void 0 : A.multiTapThreshold) ?? 100 * (o - 1), { maximumPressTime: a = 150, tolerance: s = 10 } = i.options ?? {}, r = this.pointerDown$.pipe(
|
|
523
527
|
ee({
|
|
524
|
-
pointerEvent$: this.pointerEvent
|
|
525
|
-
trackMove: !0
|
|
528
|
+
pointerEvent$: this.pointerEvent$
|
|
526
529
|
}),
|
|
527
530
|
M(1)
|
|
528
531
|
), l = r.pipe(
|
|
529
|
-
|
|
532
|
+
h(({ pointers: D }) => D.length > 1)
|
|
530
533
|
), u = (D) => D.pipe(
|
|
531
534
|
he(this.pointerUp$.pipe(ce(p))),
|
|
532
|
-
|
|
535
|
+
z()
|
|
533
536
|
);
|
|
534
537
|
return g(
|
|
535
538
|
this.pointerDown$,
|
|
@@ -537,7 +540,7 @@ class Ce extends F {
|
|
|
537
540
|
).pipe(
|
|
538
541
|
H((D) => {
|
|
539
542
|
const f = g(
|
|
540
|
-
|
|
543
|
+
T(D),
|
|
541
544
|
this.pointerDown$
|
|
542
545
|
).pipe(M(1)), E = f.pipe(u), X = f.pipe(
|
|
543
546
|
xe({
|
|
@@ -550,16 +553,16 @@ class Ce extends F {
|
|
|
550
553
|
pointerEvent$: this.pointerEvent$,
|
|
551
554
|
timeout: a
|
|
552
555
|
})
|
|
553
|
-
),
|
|
554
|
-
this.failWithActive$.pipe(
|
|
556
|
+
), R = g(
|
|
557
|
+
this.failWithActive$.pipe(h((w) => w)),
|
|
555
558
|
this.pointerCancel$,
|
|
556
559
|
l,
|
|
557
560
|
X,
|
|
558
561
|
B
|
|
559
|
-
),
|
|
562
|
+
), k = E.pipe(
|
|
560
563
|
Ae,
|
|
561
|
-
|
|
562
|
-
|
|
564
|
+
h((w) => w.length <= o),
|
|
565
|
+
c((w) => ({
|
|
563
566
|
type: "tap",
|
|
564
567
|
taps: w.length,
|
|
565
568
|
latestActivePointers: w,
|
|
@@ -567,15 +570,15 @@ class Ce extends F {
|
|
|
567
570
|
})),
|
|
568
571
|
M(1)
|
|
569
572
|
);
|
|
570
|
-
return
|
|
573
|
+
return k.pipe(
|
|
571
574
|
te,
|
|
572
|
-
|
|
573
|
-
|
|
575
|
+
C(k),
|
|
576
|
+
c(([w, { type: W, taps: d }]) => ({
|
|
574
577
|
...w,
|
|
575
|
-
type:
|
|
578
|
+
type: W,
|
|
576
579
|
taps: d
|
|
577
580
|
})),
|
|
578
|
-
|
|
581
|
+
I(R)
|
|
579
582
|
);
|
|
580
583
|
})
|
|
581
584
|
);
|
|
@@ -587,7 +590,7 @@ class Ce extends F {
|
|
|
587
590
|
super.update(e);
|
|
588
591
|
}
|
|
589
592
|
}
|
|
590
|
-
class Re extends
|
|
593
|
+
class Re extends O {
|
|
591
594
|
constructor(e = {}) {
|
|
592
595
|
super(e, {
|
|
593
596
|
numInputs: 2,
|
|
@@ -598,7 +601,7 @@ class Re extends F {
|
|
|
598
601
|
this.events$ = this.config$.pipe(
|
|
599
602
|
v(() => {
|
|
600
603
|
const i = this.panStart$.pipe(
|
|
601
|
-
|
|
604
|
+
c((s) => ({
|
|
602
605
|
...s,
|
|
603
606
|
type: "rotateStart",
|
|
604
607
|
angle: 0,
|
|
@@ -608,7 +611,7 @@ class Re extends F {
|
|
|
608
611
|
), o = i.pipe(
|
|
609
612
|
v(
|
|
610
613
|
() => this.pan$.pipe(
|
|
611
|
-
|
|
614
|
+
L((s, r) => {
|
|
612
615
|
const l = ((s == null ? void 0 : s.angle) ?? 0) + r.deltaPointersAngle;
|
|
613
616
|
return {
|
|
614
617
|
...s,
|
|
@@ -621,11 +624,11 @@ class Re extends F {
|
|
|
621
624
|
),
|
|
622
625
|
P()
|
|
623
626
|
), p = o.pipe(
|
|
624
|
-
|
|
625
|
-
|
|
627
|
+
h((s) => s.type === "move"),
|
|
628
|
+
c((s) => ({ ...s, type: "rotateMove" }))
|
|
626
629
|
), a = o.pipe(
|
|
627
|
-
|
|
628
|
-
|
|
630
|
+
h((s) => s.type === "end"),
|
|
631
|
+
c((s) => ({ ...s, type: "rotateEnd" }))
|
|
629
632
|
);
|
|
630
633
|
return g(i, p, a);
|
|
631
634
|
}),
|
|
@@ -640,7 +643,7 @@ const Y = ({
|
|
|
640
643
|
type: t,
|
|
641
644
|
initialEvent: n
|
|
642
645
|
}) => (e) => e.pipe(
|
|
643
|
-
|
|
646
|
+
L((i, o) => {
|
|
644
647
|
const a = ((i == null ? void 0 : i.pointers.length) ?? 0) !== o.pointers.length, s = (i == null ? void 0 : i.pointersAverageDistance) ?? o.pointersAverageDistance, r = a ? o.pointersAverageDistance : i && "initialPointersAverageDistance" in i ? i.initialPointersAverageDistance : o.pointersAverageDistance, l = r === 0 ? 1 : o.pointersAverageDistance / r, u = o.pointersAverageDistance - r, m = o.pointersAverageDistance - r, y = a || s === 0 ? 1 : o.pointersAverageDistance / s;
|
|
645
648
|
return {
|
|
646
649
|
...i,
|
|
@@ -653,9 +656,9 @@ const Y = ({
|
|
|
653
656
|
deltaDistanceScale: y
|
|
654
657
|
};
|
|
655
658
|
}, n),
|
|
656
|
-
|
|
659
|
+
c(({ initialPointersAverageDistance: i, ...o }) => o)
|
|
657
660
|
);
|
|
658
|
-
class ze extends
|
|
661
|
+
class ze extends O {
|
|
659
662
|
constructor(e) {
|
|
660
663
|
super(e, {
|
|
661
664
|
...e == null ? void 0 : e.options,
|
|
@@ -667,11 +670,11 @@ class ze extends F {
|
|
|
667
670
|
this.events$ = this.config$.pipe(
|
|
668
671
|
v(() => {
|
|
669
672
|
const i = this.panStart$.pipe(
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
+
C(this.failWithActive$),
|
|
674
|
+
h(([, s]) => !s),
|
|
675
|
+
c(([s]) => s),
|
|
673
676
|
v(
|
|
674
|
-
(s) =>
|
|
677
|
+
(s) => T(s).pipe(
|
|
675
678
|
// we don't want a scan on pinch start
|
|
676
679
|
Y({
|
|
677
680
|
type: "pinchStart",
|
|
@@ -681,8 +684,8 @@ class ze extends F {
|
|
|
681
684
|
),
|
|
682
685
|
M(1)
|
|
683
686
|
), o = this.failWithActive$.pipe(
|
|
684
|
-
|
|
685
|
-
|
|
687
|
+
h((s) => s),
|
|
688
|
+
z()
|
|
686
689
|
), p = i.pipe(
|
|
687
690
|
v((s) => this.pan$.pipe(
|
|
688
691
|
V((r) => r.type !== "end"),
|
|
@@ -691,15 +694,15 @@ class ze extends F {
|
|
|
691
694
|
initialEvent: s
|
|
692
695
|
})
|
|
693
696
|
)),
|
|
694
|
-
|
|
697
|
+
I(o)
|
|
695
698
|
), a = i.pipe(
|
|
696
699
|
v((s) => {
|
|
697
700
|
let r = s;
|
|
698
701
|
return this.pan$.pipe(
|
|
699
|
-
v((l) => l.type === "end" ?
|
|
700
|
-
|
|
702
|
+
v((l) => l.type === "end" ? T(l) : (r = l, $e)),
|
|
703
|
+
I(o),
|
|
701
704
|
ue(null),
|
|
702
|
-
|
|
705
|
+
c(
|
|
703
706
|
(l) => l || r
|
|
704
707
|
),
|
|
705
708
|
Y({
|
|
@@ -714,14 +717,14 @@ class ze extends F {
|
|
|
714
717
|
}),
|
|
715
718
|
P()
|
|
716
719
|
), this.start$ = this.events$.pipe(
|
|
717
|
-
|
|
718
|
-
), this.end$ = this.events$.pipe(
|
|
720
|
+
h((i) => i.type === "pinchStart")
|
|
721
|
+
), this.end$ = this.events$.pipe(h((i) => i.type === "pinchEnd"));
|
|
719
722
|
}
|
|
720
723
|
update(e) {
|
|
721
724
|
super.update(e, e.options);
|
|
722
725
|
}
|
|
723
726
|
}
|
|
724
|
-
class
|
|
727
|
+
class Fe {
|
|
725
728
|
constructor(n) {
|
|
726
729
|
$(this, "events$");
|
|
727
730
|
$(this, "recognizers");
|
|
@@ -731,7 +734,7 @@ class ke {
|
|
|
731
734
|
).pipe(P()), this.state$ = j(
|
|
732
735
|
this.recognizers.map((e) => e.state$)
|
|
733
736
|
).pipe(
|
|
734
|
-
|
|
737
|
+
c(
|
|
735
738
|
(e) => e.reduce((i, o) => ({
|
|
736
739
|
fingers: Math.max(i.fingers, o.fingers)
|
|
737
740
|
}))
|
|
@@ -750,8 +753,8 @@ class ke {
|
|
|
750
753
|
export {
|
|
751
754
|
Se as PanRecognizer,
|
|
752
755
|
ze as PinchRecognizer,
|
|
753
|
-
|
|
754
|
-
|
|
756
|
+
Fe as Recognizable,
|
|
757
|
+
O as Recognizer,
|
|
755
758
|
Re as RotateRecognizer,
|
|
756
759
|
be as SwipeRecognizer,
|
|
757
760
|
Ce as TapRecognizer
|