gesturx 1.2.0 → 1.5.0
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 +1 -1
- package/dist/index.d.ts +16 -1
- package/dist/index.js +215 -197
- 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 +1 -1
package/dist/index.js
CHANGED
|
@@ -1,128 +1,128 @@
|
|
|
1
1
|
var ae = Object.defineProperty;
|
|
2
|
-
var ce = (e, n
|
|
3
|
-
var
|
|
4
|
-
import { filter as v, NEVER as K, merge as A, BehaviorSubject as le, scan as
|
|
5
|
-
function Ae(
|
|
2
|
+
var ce = (t, e, n) => e in t ? ae(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
3
|
+
var m = (t, e, n) => (ce(t, typeof e != "symbol" ? e + "" : e, n), n);
|
|
4
|
+
import { filter as v, NEVER as K, merge as A, BehaviorSubject as le, scan as F, map as h, fromEvent as I, mergeMap as T, defer as ge, of as q, takeUntil as x, endWith as he, switchMap as R, exhaustMap as j, shareReplay as Q, withLatestFrom as Y, first as z, share as P, skipUntil as $e, combineLatest as S, ignoreElements as ue, timer as de, buffer as ve, debounceTime as fe, distinctUntilChanged as E } from "rxjs";
|
|
5
|
+
function Ae(t, e) {
|
|
6
6
|
return Math.sqrt(
|
|
7
|
-
Math.pow(
|
|
7
|
+
Math.pow(e.x - t.x, 2) + Math.pow(e.y - t.y, 2)
|
|
8
8
|
);
|
|
9
9
|
}
|
|
10
|
-
function
|
|
11
|
-
const
|
|
12
|
-
if (
|
|
10
|
+
function ye(t) {
|
|
11
|
+
const e = t.length;
|
|
12
|
+
if (e < 2)
|
|
13
13
|
return 0;
|
|
14
|
-
const
|
|
15
|
-
return
|
|
14
|
+
const n = t.reduce((o, r, p) => o + t.slice(p + 1).reduce((l, a) => l + Ae(r, a), 0), 0), s = e * (e - 1) / 2;
|
|
15
|
+
return n / s;
|
|
16
16
|
}
|
|
17
|
-
function _(
|
|
18
|
-
const
|
|
19
|
-
return Math.atan2(s,
|
|
17
|
+
function _(t, e) {
|
|
18
|
+
const n = e.x - t.x, s = e.y - t.y;
|
|
19
|
+
return Math.atan2(s, n);
|
|
20
20
|
}
|
|
21
|
-
function
|
|
22
|
-
return _(
|
|
21
|
+
function De(t, e) {
|
|
22
|
+
return _(t, e) * (180 / Math.PI);
|
|
23
23
|
}
|
|
24
|
-
function
|
|
25
|
-
const
|
|
24
|
+
function b(t) {
|
|
25
|
+
const e = t.reduce(
|
|
26
26
|
(s, o) => (s.x += o.x, s.y += o.y, s),
|
|
27
27
|
{ x: 0, y: 0 }
|
|
28
|
-
),
|
|
28
|
+
), n = t.length || 1;
|
|
29
29
|
return {
|
|
30
|
-
x:
|
|
31
|
-
y:
|
|
30
|
+
x: e.x / n,
|
|
31
|
+
y: e.y / n
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function me(
|
|
35
|
-
if (
|
|
34
|
+
function me(t, e) {
|
|
35
|
+
if (t.length !== e.length)
|
|
36
36
|
throw new Error("Initial and new points arrays must have the same length.");
|
|
37
|
-
const
|
|
37
|
+
const n = b(t), s = b(e);
|
|
38
38
|
let o = 0;
|
|
39
|
-
for (let l = 0; l <
|
|
39
|
+
for (let l = 0; l < t.length; l++) {
|
|
40
40
|
const a = _(
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
n,
|
|
42
|
+
t[l]
|
|
43
43
|
);
|
|
44
44
|
let c = _(
|
|
45
45
|
s,
|
|
46
|
-
|
|
46
|
+
e[l]
|
|
47
47
|
) - a;
|
|
48
48
|
c > Math.PI ? c -= 2 * Math.PI : c < -Math.PI && (c += 2 * Math.PI), o += c;
|
|
49
49
|
}
|
|
50
|
-
const r = o /
|
|
50
|
+
const r = o / t.length, p = r * (180 / Math.PI);
|
|
51
51
|
return { radianDelta: r, degreesDelta: p };
|
|
52
52
|
}
|
|
53
|
-
function we(
|
|
54
|
-
return
|
|
53
|
+
function we(t) {
|
|
54
|
+
return t != null;
|
|
55
55
|
}
|
|
56
|
-
const
|
|
57
|
-
function Z(e, n
|
|
58
|
-
const s =
|
|
59
|
-
return Math.abs(o.x - s.x) >
|
|
56
|
+
const Me = (t) => t.length > 0, Pe = (t) => t.pipe(v(Me));
|
|
57
|
+
function Z(t, e, n) {
|
|
58
|
+
const s = b([t]), o = b([e]);
|
|
59
|
+
return Math.abs(o.x - s.x) > n || Math.abs(o.y - s.y) > n;
|
|
60
60
|
}
|
|
61
|
-
const Te = (
|
|
62
|
-
const s =
|
|
61
|
+
const Te = (t) => t != null && t.length ? A(...(t == null ? void 0 : t.map(({ start$: e }) => e)) ?? []) : K, xe = (t, e, n) => {
|
|
62
|
+
const s = t > 0 ? e / t : 0, o = t > 0 ? n / t : 0;
|
|
63
63
|
return {
|
|
64
64
|
velocityX: s,
|
|
65
65
|
velocityY: o
|
|
66
66
|
};
|
|
67
67
|
};
|
|
68
|
-
class
|
|
69
|
-
constructor(
|
|
70
|
-
|
|
71
|
-
|
|
68
|
+
class C {
|
|
69
|
+
constructor(e) {
|
|
70
|
+
m(this, "config$", new le({}));
|
|
71
|
+
m(this, "validConfig$", this.config$.pipe(
|
|
72
72
|
v(
|
|
73
|
-
(
|
|
73
|
+
(e) => !!e.container
|
|
74
74
|
)
|
|
75
75
|
));
|
|
76
|
-
this.update(
|
|
76
|
+
this.update(e);
|
|
77
77
|
}
|
|
78
|
-
initialize(
|
|
79
|
-
const
|
|
78
|
+
initialize(e) {
|
|
79
|
+
const n = this.config$.getValue();
|
|
80
80
|
this.config$.next({
|
|
81
|
-
...t,
|
|
82
81
|
...n,
|
|
82
|
+
...e,
|
|
83
83
|
options: {
|
|
84
|
-
...
|
|
85
|
-
...
|
|
84
|
+
...n.options,
|
|
85
|
+
...e.options
|
|
86
86
|
}
|
|
87
87
|
});
|
|
88
88
|
}
|
|
89
|
-
update(
|
|
90
|
-
const
|
|
89
|
+
update(e) {
|
|
90
|
+
const n = this.config$.getValue();
|
|
91
91
|
this.config$.next({
|
|
92
|
-
...
|
|
92
|
+
...n,
|
|
93
93
|
options: {
|
|
94
|
-
...
|
|
95
|
-
...
|
|
94
|
+
...n.options,
|
|
95
|
+
...e
|
|
96
96
|
}
|
|
97
97
|
});
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
const J = (e, n,
|
|
101
|
-
const o =
|
|
100
|
+
const J = (t, e, n, s) => {
|
|
101
|
+
const o = t.x - e.x + n, r = t.y - e.y + s;
|
|
102
102
|
return {
|
|
103
103
|
deltaX: o,
|
|
104
104
|
deltaY: r
|
|
105
105
|
};
|
|
106
|
-
}, W = (
|
|
107
|
-
const
|
|
108
|
-
|
|
106
|
+
}, W = (t) => {
|
|
107
|
+
const e = (n) => b(
|
|
108
|
+
n.latestActivePointers.length ? n.latestActivePointers : [n.event]
|
|
109
109
|
);
|
|
110
|
-
return
|
|
111
|
-
|
|
112
|
-
(
|
|
113
|
-
var
|
|
114
|
-
const o =
|
|
110
|
+
return t.pipe(
|
|
111
|
+
F(
|
|
112
|
+
(n, s) => {
|
|
113
|
+
var y, w;
|
|
114
|
+
const o = e(s), r = n.center, p = n.deltaX, l = n.deltaY, a = ((y = n.latestActivePointers) == null ? void 0 : y.length) ?? 0, $ = ((w = s.latestActivePointers) == null ? void 0 : w.length) ?? 0, c = [
|
|
115
115
|
"pointerdown",
|
|
116
116
|
"pointercancel",
|
|
117
117
|
"pointerleave",
|
|
118
118
|
"pointerup"
|
|
119
119
|
].includes(s.event.type) && a !== $, i = $ > 0, { deltaX: g, deltaY: d } = c && i ? J(o, o, p, l) : J(o, r, p, l), { degreesDelta: f } = a === $ && a >= 2 && $ >= 2 ? me(
|
|
120
|
-
|
|
120
|
+
n.latestActivePointers ?? [],
|
|
121
121
|
s.latestActivePointers ?? []
|
|
122
122
|
) : { degreesDelta: 0 };
|
|
123
123
|
return {
|
|
124
124
|
startTime: (/* @__PURE__ */ new Date()).getTime(),
|
|
125
|
-
...
|
|
125
|
+
...n,
|
|
126
126
|
...s,
|
|
127
127
|
center: o,
|
|
128
128
|
deltaX: g,
|
|
@@ -137,7 +137,7 @@ const J = (e, n, t, s) => {
|
|
|
137
137
|
latestActivePointers: []
|
|
138
138
|
}
|
|
139
139
|
),
|
|
140
|
-
h((
|
|
140
|
+
h((n) => {
|
|
141
141
|
const {
|
|
142
142
|
deltaX: s,
|
|
143
143
|
deltaY: o,
|
|
@@ -146,7 +146,7 @@ const J = (e, n, t, s) => {
|
|
|
146
146
|
center: l,
|
|
147
147
|
event: a,
|
|
148
148
|
deltaPointersAngle: $
|
|
149
|
-
} =
|
|
149
|
+
} = n, c = r ?? [], g = Date.now() - p, { velocityX: d, velocityY: f } = xe(g, s, o), y = ye(r);
|
|
150
150
|
return {
|
|
151
151
|
deltaX: s,
|
|
152
152
|
deltaY: o,
|
|
@@ -158,54 +158,54 @@ const J = (e, n, t, s) => {
|
|
|
158
158
|
startTime: p,
|
|
159
159
|
event: a,
|
|
160
160
|
deltaPointersAngle: $,
|
|
161
|
-
pointersAverageDistance:
|
|
161
|
+
pointersAverageDistance: y
|
|
162
162
|
};
|
|
163
163
|
})
|
|
164
164
|
);
|
|
165
165
|
};
|
|
166
|
-
function U(
|
|
167
|
-
return (
|
|
168
|
-
v((
|
|
166
|
+
function U(t) {
|
|
167
|
+
return (e) => e.pipe(
|
|
168
|
+
v((n) => n.pointerId === t.pointerId)
|
|
169
169
|
);
|
|
170
170
|
}
|
|
171
171
|
const N = ({
|
|
172
|
-
container:
|
|
173
|
-
afterEventReceived:
|
|
172
|
+
container: t,
|
|
173
|
+
afterEventReceived: e = (n) => n
|
|
174
174
|
}) => {
|
|
175
|
-
const
|
|
176
|
-
h(
|
|
177
|
-
), o =
|
|
178
|
-
h(
|
|
179
|
-
), r =
|
|
180
|
-
h(
|
|
181
|
-
), p =
|
|
182
|
-
|
|
175
|
+
const n = ee({ afterEventReceived: e, container: t }), s = I(t, "pointerup").pipe(
|
|
176
|
+
h(e)
|
|
177
|
+
), o = I(t, "pointermove").pipe(
|
|
178
|
+
h(e)
|
|
179
|
+
), r = I(t, "pointerleave").pipe(
|
|
180
|
+
h(e)
|
|
181
|
+
), p = I(
|
|
182
|
+
t,
|
|
183
183
|
"pointercancel"
|
|
184
|
-
).pipe(h(
|
|
184
|
+
).pipe(h(e));
|
|
185
185
|
return {
|
|
186
|
-
pointerDown$:
|
|
186
|
+
pointerDown$: n,
|
|
187
187
|
pointerCancel$: p,
|
|
188
188
|
pointerLeave$: r,
|
|
189
189
|
pointerUp$: s,
|
|
190
190
|
pointerMove$: o
|
|
191
191
|
};
|
|
192
192
|
}, ee = ({
|
|
193
|
-
container:
|
|
194
|
-
afterEventReceived:
|
|
195
|
-
}) =>
|
|
196
|
-
h(
|
|
193
|
+
container: t,
|
|
194
|
+
afterEventReceived: e = (n) => n
|
|
195
|
+
}) => I(t, "pointerdown").pipe(
|
|
196
|
+
h(e)
|
|
197
197
|
), V = ({
|
|
198
|
-
pointerCancel$:
|
|
199
|
-
pointerLeave$:
|
|
200
|
-
pointerUp$:
|
|
198
|
+
pointerCancel$: t,
|
|
199
|
+
pointerLeave$: e,
|
|
200
|
+
pointerUp$: n,
|
|
201
201
|
pointerMove$: s,
|
|
202
202
|
trackMove: o
|
|
203
203
|
}) => (r) => r.pipe(
|
|
204
204
|
T((p) => {
|
|
205
205
|
const l = A(
|
|
206
|
-
t,
|
|
207
206
|
n,
|
|
208
|
-
e
|
|
207
|
+
e,
|
|
208
|
+
t
|
|
209
209
|
).pipe(U(p)), a = ge(() => q(p));
|
|
210
210
|
return A(
|
|
211
211
|
a,
|
|
@@ -217,7 +217,7 @@ const N = ({
|
|
|
217
217
|
he({ id: p.pointerId, event: void 0 })
|
|
218
218
|
);
|
|
219
219
|
}),
|
|
220
|
-
|
|
220
|
+
F(
|
|
221
221
|
(p, { event: l, id: a }) => {
|
|
222
222
|
if (!l) {
|
|
223
223
|
const { [a]: $, ...c } = p;
|
|
@@ -232,14 +232,14 @@ const N = ({
|
|
|
232
232
|
),
|
|
233
233
|
h((p) => Object.values(p).filter(we))
|
|
234
234
|
);
|
|
235
|
-
class B extends
|
|
236
|
-
constructor(
|
|
237
|
-
super(
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this.options =
|
|
235
|
+
class B extends C {
|
|
236
|
+
constructor(n = {}) {
|
|
237
|
+
super(n);
|
|
238
|
+
m(this, "events$");
|
|
239
|
+
m(this, "start$");
|
|
240
|
+
m(this, "end$");
|
|
241
|
+
m(this, "fingers$");
|
|
242
|
+
this.options = n, this.events$ = this.validConfig$.pipe(
|
|
243
243
|
R((s) => {
|
|
244
244
|
const { container: o, afterEventReceived: r } = s, { posThreshold: p = 15 } = s.options ?? {}, {
|
|
245
245
|
pointerCancel$: l,
|
|
@@ -262,7 +262,7 @@ class B extends F {
|
|
|
262
262
|
$,
|
|
263
263
|
c,
|
|
264
264
|
i
|
|
265
|
-
),
|
|
265
|
+
), y = d.pipe(
|
|
266
266
|
V({
|
|
267
267
|
pointerCancel$: l,
|
|
268
268
|
pointerLeave$: $,
|
|
@@ -271,41 +271,41 @@ class B extends F {
|
|
|
271
271
|
trackMove: !0
|
|
272
272
|
}),
|
|
273
273
|
Q()
|
|
274
|
-
),
|
|
274
|
+
), w = A(
|
|
275
275
|
i,
|
|
276
276
|
$,
|
|
277
277
|
l
|
|
278
278
|
).pipe(
|
|
279
|
-
Y(
|
|
280
|
-
v(([u,
|
|
279
|
+
Y(y),
|
|
280
|
+
v(([u, D]) => !D.length),
|
|
281
281
|
h(([u]) => u),
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
),
|
|
282
|
+
z(),
|
|
283
|
+
P()
|
|
284
|
+
), O = d.pipe(
|
|
285
285
|
T(
|
|
286
286
|
(u) => c.pipe(
|
|
287
287
|
U(u),
|
|
288
288
|
// we start pan only if the user started moving a certain distance
|
|
289
289
|
v(
|
|
290
|
-
(
|
|
290
|
+
(D) => Z(
|
|
291
291
|
u,
|
|
292
|
-
|
|
292
|
+
D,
|
|
293
293
|
p
|
|
294
294
|
)
|
|
295
295
|
)
|
|
296
296
|
)
|
|
297
297
|
),
|
|
298
|
-
|
|
298
|
+
z()
|
|
299
299
|
).pipe(
|
|
300
300
|
h(() => ({
|
|
301
301
|
type: "panStart",
|
|
302
302
|
event: g
|
|
303
303
|
})),
|
|
304
|
-
|
|
305
|
-
x(
|
|
306
|
-
), k =
|
|
304
|
+
P(),
|
|
305
|
+
x(w)
|
|
306
|
+
), k = O.pipe(
|
|
307
307
|
T(
|
|
308
|
-
() =>
|
|
308
|
+
() => w.pipe(
|
|
309
309
|
h((u) => ({
|
|
310
310
|
type: "panEnd",
|
|
311
311
|
event: u
|
|
@@ -313,33 +313,33 @@ class B extends F {
|
|
|
313
313
|
)
|
|
314
314
|
)
|
|
315
315
|
), L = f.pipe(
|
|
316
|
-
$e(
|
|
316
|
+
$e(O),
|
|
317
317
|
h((u) => ({
|
|
318
318
|
type: "panMove",
|
|
319
319
|
event: u
|
|
320
320
|
})),
|
|
321
|
-
x(
|
|
322
|
-
), X = A(
|
|
323
|
-
Y(
|
|
324
|
-
h(([u,
|
|
321
|
+
x(w)
|
|
322
|
+
), X = A(O, L, k).pipe(
|
|
323
|
+
Y(y),
|
|
324
|
+
h(([u, D]) => ({
|
|
325
325
|
...u,
|
|
326
|
-
latestActivePointers:
|
|
326
|
+
latestActivePointers: D
|
|
327
327
|
})),
|
|
328
|
-
|
|
328
|
+
P()
|
|
329
329
|
);
|
|
330
330
|
return S([
|
|
331
331
|
X.pipe(W),
|
|
332
332
|
X
|
|
333
333
|
]).pipe(
|
|
334
|
-
h(([u, { type:
|
|
334
|
+
h(([u, { type: D }]) => ({
|
|
335
335
|
...u,
|
|
336
|
-
type:
|
|
336
|
+
type: D
|
|
337
337
|
}))
|
|
338
338
|
);
|
|
339
339
|
})
|
|
340
340
|
);
|
|
341
341
|
}),
|
|
342
|
-
|
|
342
|
+
P()
|
|
343
343
|
), this.start$ = this.events$.pipe(
|
|
344
344
|
v((s) => s.type === "panStart")
|
|
345
345
|
), this.end$ = this.events$.pipe(v((s) => s.type === "panEnd")), this.fingers$ = this.validConfig$.pipe(
|
|
@@ -359,14 +359,14 @@ class B extends F {
|
|
|
359
359
|
);
|
|
360
360
|
}
|
|
361
361
|
}
|
|
362
|
-
const Re = (
|
|
363
|
-
v((
|
|
362
|
+
const Re = (t) => (e) => e.pipe(
|
|
363
|
+
v((n) => Math.abs(n.velocityX) >= t || Math.abs(n.velocityY) >= t)
|
|
364
364
|
);
|
|
365
|
-
class
|
|
366
|
-
constructor(
|
|
367
|
-
super(
|
|
368
|
-
|
|
369
|
-
this.options =
|
|
365
|
+
class Ie extends C {
|
|
366
|
+
constructor(n = {}) {
|
|
367
|
+
super(n);
|
|
368
|
+
m(this, "events$");
|
|
369
|
+
this.options = n, this.events$ = this.validConfig$.pipe(
|
|
370
370
|
R((s) => {
|
|
371
371
|
const { escapeVelocity: o = 0.9, posThreshold: r } = s.options ?? {}, p = new B({ posThreshold: r });
|
|
372
372
|
p.initialize(s);
|
|
@@ -375,11 +375,11 @@ class be extends F {
|
|
|
375
375
|
);
|
|
376
376
|
return p.start$.pipe(
|
|
377
377
|
j((a) => p.end$.pipe(
|
|
378
|
-
|
|
378
|
+
z(),
|
|
379
379
|
Re(o),
|
|
380
380
|
h(({ type: $, ...c }) => ({
|
|
381
381
|
type: "swipe",
|
|
382
|
-
angle:
|
|
382
|
+
angle: De(
|
|
383
383
|
a.event,
|
|
384
384
|
c.event
|
|
385
385
|
),
|
|
@@ -387,17 +387,17 @@ class be extends F {
|
|
|
387
387
|
})),
|
|
388
388
|
x(l)
|
|
389
389
|
)),
|
|
390
|
-
|
|
390
|
+
P()
|
|
391
391
|
);
|
|
392
392
|
})
|
|
393
393
|
);
|
|
394
394
|
}
|
|
395
395
|
}
|
|
396
|
-
class
|
|
397
|
-
constructor(
|
|
398
|
-
super(
|
|
399
|
-
|
|
400
|
-
this.options =
|
|
396
|
+
class be extends C {
|
|
397
|
+
constructor(n) {
|
|
398
|
+
super(n);
|
|
399
|
+
m(this, "events$");
|
|
400
|
+
this.options = n, this.events$ = this.validConfig$.pipe(
|
|
401
401
|
R((s) => {
|
|
402
402
|
const { container: o, afterEventReceived: r } = s, {
|
|
403
403
|
multiTapThreshold: p = 200,
|
|
@@ -411,7 +411,7 @@ class Ce extends F {
|
|
|
411
411
|
} = s.options ?? {}, { pointerUp$: i, pointerLeave$: g, pointerCancel$: d, pointerMove$: f } = N({
|
|
412
412
|
container: o,
|
|
413
413
|
afterEventReceived: r
|
|
414
|
-
}),
|
|
414
|
+
}), y = ee({ container: o, afterEventReceived: r }), w = y.pipe(
|
|
415
415
|
V({
|
|
416
416
|
pointerCancel$: d,
|
|
417
417
|
pointerLeave$: g,
|
|
@@ -420,37 +420,37 @@ class Ce extends F {
|
|
|
420
420
|
trackMove: !1
|
|
421
421
|
}),
|
|
422
422
|
Q(1)
|
|
423
|
-
), G =
|
|
423
|
+
), G = w.pipe(
|
|
424
424
|
v((u) => u.length > 1)
|
|
425
|
-
),
|
|
426
|
-
Y(
|
|
427
|
-
v(([,
|
|
428
|
-
h(([
|
|
425
|
+
), O = (u) => u.pipe(
|
|
426
|
+
Y(w),
|
|
427
|
+
v(([, D]) => D.length === 1),
|
|
428
|
+
h(([D]) => D)
|
|
429
429
|
), k = (u) => u.pipe(
|
|
430
430
|
ve(i.pipe(fe(p))),
|
|
431
|
-
|
|
431
|
+
z()
|
|
432
432
|
), L = Te(c);
|
|
433
433
|
return A(
|
|
434
|
-
|
|
435
|
-
|
|
434
|
+
y,
|
|
435
|
+
w.pipe(ue())
|
|
436
436
|
).pipe(
|
|
437
|
-
|
|
437
|
+
O,
|
|
438
438
|
j((u) => {
|
|
439
|
-
const
|
|
439
|
+
const D = A(q(u), y), te = A(
|
|
440
440
|
i,
|
|
441
441
|
g,
|
|
442
442
|
d,
|
|
443
443
|
f
|
|
444
|
-
), ne =
|
|
444
|
+
), ne = D.pipe(k), se = te.pipe(
|
|
445
445
|
v(
|
|
446
|
-
(
|
|
446
|
+
(M) => Z(
|
|
447
447
|
u,
|
|
448
|
-
|
|
448
|
+
M,
|
|
449
449
|
$
|
|
450
450
|
)
|
|
451
451
|
),
|
|
452
|
-
|
|
453
|
-
), oe =
|
|
452
|
+
z()
|
|
453
|
+
), oe = w.pipe(
|
|
454
454
|
R(() => de(l))
|
|
455
455
|
), ie = A(
|
|
456
456
|
L,
|
|
@@ -459,21 +459,21 @@ class Ce extends F {
|
|
|
459
459
|
se,
|
|
460
460
|
oe
|
|
461
461
|
), H = ne.pipe(
|
|
462
|
-
|
|
463
|
-
v((
|
|
464
|
-
h((
|
|
462
|
+
Pe,
|
|
463
|
+
v((M) => M.length <= a),
|
|
464
|
+
h((M) => ({
|
|
465
465
|
type: "tap",
|
|
466
|
-
taps:
|
|
467
|
-
latestActivePointers:
|
|
468
|
-
event:
|
|
466
|
+
taps: M.length,
|
|
467
|
+
latestActivePointers: M,
|
|
468
|
+
event: M[0]
|
|
469
469
|
}))
|
|
470
470
|
);
|
|
471
471
|
return S([
|
|
472
472
|
H.pipe(W),
|
|
473
473
|
H
|
|
474
474
|
]).pipe(
|
|
475
|
-
h(([
|
|
476
|
-
...
|
|
475
|
+
h(([M, { type: re, taps: pe }]) => ({
|
|
476
|
+
...M,
|
|
477
477
|
type: re,
|
|
478
478
|
taps: pe
|
|
479
479
|
})),
|
|
@@ -482,24 +482,24 @@ class Ce extends F {
|
|
|
482
482
|
})
|
|
483
483
|
);
|
|
484
484
|
}),
|
|
485
|
-
|
|
485
|
+
P()
|
|
486
486
|
);
|
|
487
487
|
}
|
|
488
488
|
}
|
|
489
|
-
class
|
|
490
|
-
constructor(
|
|
491
|
-
super(
|
|
492
|
-
|
|
493
|
-
this.options =
|
|
489
|
+
class Ce extends C {
|
|
490
|
+
constructor(n = {}) {
|
|
491
|
+
super(n);
|
|
492
|
+
m(this, "events$");
|
|
493
|
+
this.options = n, this.events$ = this.config$.pipe(
|
|
494
494
|
R((s) => {
|
|
495
495
|
const { posThreshold: o } = s.options ?? {}, r = new B({ posThreshold: o });
|
|
496
496
|
r.initialize(s);
|
|
497
497
|
const p = r.events$.pipe(
|
|
498
498
|
v(({ pointers: i }) => i.length < 2),
|
|
499
|
-
|
|
499
|
+
E()
|
|
500
500
|
), a = r.events$.pipe(
|
|
501
501
|
h((i) => [i, i.pointers.length > 1]),
|
|
502
|
-
|
|
502
|
+
E(
|
|
503
503
|
([i, g], [d, f]) => g === f
|
|
504
504
|
),
|
|
505
505
|
v(([i, g]) => g)
|
|
@@ -513,7 +513,7 @@ class Fe extends F {
|
|
|
513
513
|
), $ = a.pipe(
|
|
514
514
|
T(
|
|
515
515
|
() => r.events$.pipe(
|
|
516
|
-
|
|
516
|
+
F(
|
|
517
517
|
(i, g) => {
|
|
518
518
|
const d = i.angle + g.deltaPointersAngle;
|
|
519
519
|
return {
|
|
@@ -532,7 +532,7 @@ class Fe extends F {
|
|
|
532
532
|
), c = a.pipe(
|
|
533
533
|
T(
|
|
534
534
|
() => S([$, p]).pipe(
|
|
535
|
-
|
|
535
|
+
z(),
|
|
536
536
|
h(([i]) => ({
|
|
537
537
|
...i,
|
|
538
538
|
type: "rotateEnd"
|
|
@@ -545,20 +545,20 @@ class Fe extends F {
|
|
|
545
545
|
);
|
|
546
546
|
}
|
|
547
547
|
}
|
|
548
|
-
class
|
|
549
|
-
constructor(
|
|
550
|
-
super(
|
|
551
|
-
|
|
552
|
-
this.options =
|
|
548
|
+
class Ee extends C {
|
|
549
|
+
constructor(n = {}) {
|
|
550
|
+
super(n);
|
|
551
|
+
m(this, "events$");
|
|
552
|
+
this.options = n, this.events$ = this.config$.pipe(
|
|
553
553
|
R((s) => {
|
|
554
554
|
const { posThreshold: o } = s.options ?? {}, r = new B({ posThreshold: o });
|
|
555
555
|
r.initialize(s);
|
|
556
556
|
const p = r.events$.pipe(
|
|
557
557
|
v(({ pointers: i }) => i.length < 2),
|
|
558
|
-
|
|
558
|
+
E()
|
|
559
559
|
), a = r.events$.pipe(
|
|
560
560
|
h((i) => [i, i.pointers.length > 1]),
|
|
561
|
-
|
|
561
|
+
E(
|
|
562
562
|
([i, g], [d, f]) => g === f
|
|
563
563
|
),
|
|
564
564
|
v(([i, g]) => g)
|
|
@@ -573,13 +573,13 @@ class ze extends F {
|
|
|
573
573
|
}))
|
|
574
574
|
), $ = a.pipe(
|
|
575
575
|
T((i) => r.events$.pipe(
|
|
576
|
-
|
|
576
|
+
F(
|
|
577
577
|
(g, d) => {
|
|
578
|
-
const f = g.pointersAverageDistance ?? d.pointersAverageDistance,
|
|
578
|
+
const f = g.pointersAverageDistance ?? d.pointersAverageDistance, y = d.pointersAverageDistance / i.pointersAverageDistance;
|
|
579
579
|
return {
|
|
580
580
|
...g,
|
|
581
581
|
...d,
|
|
582
|
-
scale:
|
|
582
|
+
scale: y,
|
|
583
583
|
distance: d.pointersAverageDistance - i.pointersAverageDistance,
|
|
584
584
|
deltaDistance: d.pointersAverageDistance - f,
|
|
585
585
|
deltaDistanceScale: d.pointersAverageDistance / f,
|
|
@@ -593,7 +593,7 @@ class ze extends F {
|
|
|
593
593
|
), c = a.pipe(
|
|
594
594
|
T(
|
|
595
595
|
() => S([$, p]).pipe(
|
|
596
|
-
|
|
596
|
+
z(),
|
|
597
597
|
h(([i]) => ({
|
|
598
598
|
...i,
|
|
599
599
|
type: "pinchEnd"
|
|
@@ -606,22 +606,40 @@ class ze extends F {
|
|
|
606
606
|
);
|
|
607
607
|
}
|
|
608
608
|
}
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
609
|
+
class Fe {
|
|
610
|
+
constructor(e) {
|
|
611
|
+
m(this, "events$");
|
|
612
|
+
m(this, "recognizers");
|
|
613
|
+
this.options = e, this.recognizers = e.recognizers, this.events$ = A(
|
|
614
|
+
...e.recognizers.map((n) => n.events$)
|
|
615
|
+
).pipe(P());
|
|
616
|
+
}
|
|
617
|
+
initialize(e) {
|
|
618
|
+
e.style.touchAction = "none", e.style.userSelect = "none", this.options.recognizers.forEach((n) => {
|
|
619
|
+
n.initialize({
|
|
620
|
+
container: e,
|
|
621
|
+
afterEventReceived: this.options.afterEventReceived
|
|
622
|
+
});
|
|
623
|
+
});
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
const Se = ({
|
|
627
|
+
afterEventReceived: t = (n) => n,
|
|
628
|
+
recognizers: e
|
|
612
629
|
}) => ({ events$: A(
|
|
613
|
-
...
|
|
614
|
-
).pipe(
|
|
615
|
-
o.style.touchAction = "none", o.style.userSelect = "none",
|
|
616
|
-
r.initialize({ container: o, afterEventReceived:
|
|
630
|
+
...e.map((o) => o.events$)
|
|
631
|
+
).pipe(P()), initialize: (o) => {
|
|
632
|
+
o.style.touchAction = "none", o.style.userSelect = "none", e.forEach((r) => {
|
|
633
|
+
r.initialize({ container: o, afterEventReceived: t });
|
|
617
634
|
});
|
|
618
|
-
}, recognizers:
|
|
635
|
+
}, recognizers: e });
|
|
619
636
|
export {
|
|
637
|
+
Fe as Manager,
|
|
620
638
|
B as PanRecognizer,
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
639
|
+
Ee as PinchRecognizer,
|
|
640
|
+
Ce as RotateRecognizer,
|
|
641
|
+
Ie as SwipeRecognizer,
|
|
642
|
+
be as TapRecognizer,
|
|
643
|
+
Se as createManager
|
|
626
644
|
};
|
|
627
645
|
//# sourceMappingURL=index.js.map
|