@thi.ng/rstream-gestures 4.1.32 → 4.1.34
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/CHANGELOG.md +1 -1
- package/README.md +9 -19
- package/api.d.ts +4 -4
- package/gesture-stream.d.ts +10 -12
- package/gesture-stream.js +10 -12
- package/package.json +16 -12
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
<!-- This file is generated - DO NOT EDIT! -->
|
|
2
2
|
|
|
3
|
-
# 
|
|
3
|
+
# 
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@thi.ng/rstream-gestures)
|
|
6
6
|

|
|
7
|
-
[](https://mastodon.thi.ng/@toxi)
|
|
8
8
|
|
|
9
9
|
This project is part of the
|
|
10
10
|
[@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo.
|
|
@@ -22,13 +22,11 @@ This project is part of the
|
|
|
22
22
|
- [GestureStreamOpts](#gesturestreamopts)
|
|
23
23
|
- [Basic usage](#basic-usage)
|
|
24
24
|
- [Authors](#authors)
|
|
25
|
-
- [Maintainer](#maintainer)
|
|
26
|
-
- [Contributors](#contributors)
|
|
27
25
|
- [License](#license)
|
|
28
26
|
|
|
29
27
|
## About
|
|
30
28
|
|
|
31
|
-
Unified mouse, mouse wheel & multi-touch event stream abstraction
|
|
29
|
+
Unified mouse, mouse wheel & multi-touch event stream abstraction
|
|
32
30
|
|
|
33
31
|
## Status
|
|
34
32
|
|
|
@@ -62,11 +60,8 @@ ES module import:
|
|
|
62
60
|
|
|
63
61
|
For Node.js REPL:
|
|
64
62
|
|
|
65
|
-
```
|
|
66
|
-
|
|
67
|
-
node --experimental-repl-await
|
|
68
|
-
|
|
69
|
-
> const rstreamGestures = await import("@thi.ng/rstream-gestures");
|
|
63
|
+
```js
|
|
64
|
+
const rstreamGestures = await import("@thi.ng/rstream-gestures");
|
|
70
65
|
```
|
|
71
66
|
|
|
72
67
|
Package sizes (brotli'd, pre-treeshake): ESM: 1.07 KB
|
|
@@ -193,14 +188,9 @@ gestures.subscribe(
|
|
|
193
188
|
|
|
194
189
|
## Authors
|
|
195
190
|
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
-
|
|
199
|
-
|
|
200
|
-
### Contributors
|
|
201
|
-
|
|
202
|
-
- Arthur Carabott ([@acarabott](https://github.com/acarabott))
|
|
203
|
-
- Matei Adriel ([@Mateiadrielrafael](https://github.com/Mateiadrielrafael))
|
|
191
|
+
- [Karsten Schmidt](https://thi.ng) (Main author)
|
|
192
|
+
- [Arthur Carabott](https://github.com/acarabott)
|
|
193
|
+
- [Matei Adriel](https://github.com/Mateiadrielrafael)
|
|
204
194
|
|
|
205
195
|
If this project contributes to an academic publication, please cite it as:
|
|
206
196
|
|
|
@@ -215,4 +205,4 @@ If this project contributes to an academic publication, please cite it as:
|
|
|
215
205
|
|
|
216
206
|
## License
|
|
217
207
|
|
|
218
|
-
© 2018 - 2022 Karsten Schmidt // Apache
|
|
208
|
+
© 2018 - 2022 Karsten Schmidt // Apache License 2.0
|
package/api.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { IID } from "@thi.ng/api";
|
|
2
2
|
import type { StreamMerge } from "@thi.ng/rstream";
|
|
3
|
-
export
|
|
4
|
-
export
|
|
5
|
-
export
|
|
6
|
-
export
|
|
3
|
+
export type GestureStream = StreamMerge<UIEvent, GestureEvent>;
|
|
4
|
+
export type UIEvent = MouseEvent | TouchEvent | WheelEvent;
|
|
5
|
+
export type UIEventID = "mousedown" | "mousemove" | "mouseup" | "touchstart" | "touchmove" | "touchend" | "touchcancel" | "wheel";
|
|
6
|
+
export type GestureType = "move" | "start" | "drag" | "end" | "zoom";
|
|
7
7
|
export interface GestureInfo {
|
|
8
8
|
/**
|
|
9
9
|
* Touch/cursor ID. For mouse cursors this always is zero.
|
package/gesture-stream.d.ts
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
import type { GestureStream, GestureStreamOpts } from "./api.js";
|
|
2
2
|
/**
|
|
3
|
-
* Attaches mouse & touch event listeners to given DOM element and
|
|
4
|
-
*
|
|
5
|
-
* {@link GestureInfo} details.
|
|
3
|
+
* Attaches mouse & touch event listeners to given DOM element and returns a
|
|
4
|
+
* stream of {@link GestureEvent}s and their {@link GestureInfo} details.
|
|
6
5
|
*
|
|
7
|
-
* In multi-touch environments, a `GestureEvent` can contain multiple
|
|
8
|
-
*
|
|
9
|
-
* `
|
|
10
|
-
*
|
|
11
|
-
* of `[x,y]` coordinates.
|
|
6
|
+
* In multi-touch environments, a `GestureEvent` can contain multiple such
|
|
7
|
+
* `GestureInfo` objects (one per active touch). In general, the `click` and
|
|
8
|
+
* `delta` values are only present if the abstracted event `type == "drag"`.
|
|
9
|
+
* Both (and `pos` too) are 2-element arrays of `[x,y]` coordinates.
|
|
12
10
|
*
|
|
13
|
-
* The `zoom` value is always present, but is only updated with wheel
|
|
14
|
-
*
|
|
15
|
-
*
|
|
11
|
+
* The `zoom` value is always present, but is only updated with wheel events.
|
|
12
|
+
* The value will be constrained to `minZoom` ... `maxZoom` interval (provided
|
|
13
|
+
* via options object).
|
|
16
14
|
*
|
|
17
15
|
* Note: If using `preventDefault` and attaching the event stream to
|
|
18
16
|
* `document.body`, the following event listener options SHOULD be used:
|
|
@@ -22,7 +20,7 @@ import type { GestureStream, GestureStreamOpts } from "./api.js";
|
|
|
22
20
|
* eventOpts: { passive: false }
|
|
23
21
|
* ```
|
|
24
22
|
*
|
|
25
|
-
*
|
|
23
|
+
* https://www.chromestatus.com/features/5093566007214080
|
|
26
24
|
*
|
|
27
25
|
* @param el -
|
|
28
26
|
* @param opts -
|
package/gesture-stream.js
CHANGED
|
@@ -21,19 +21,17 @@ const EVENT_GESTURETYPES = {
|
|
|
21
21
|
wheel: "zoom",
|
|
22
22
|
};
|
|
23
23
|
/**
|
|
24
|
-
* Attaches mouse & touch event listeners to given DOM element and
|
|
25
|
-
*
|
|
26
|
-
* {@link GestureInfo} details.
|
|
24
|
+
* Attaches mouse & touch event listeners to given DOM element and returns a
|
|
25
|
+
* stream of {@link GestureEvent}s and their {@link GestureInfo} details.
|
|
27
26
|
*
|
|
28
|
-
* In multi-touch environments, a `GestureEvent` can contain multiple
|
|
29
|
-
*
|
|
30
|
-
* `
|
|
31
|
-
*
|
|
32
|
-
* of `[x,y]` coordinates.
|
|
27
|
+
* In multi-touch environments, a `GestureEvent` can contain multiple such
|
|
28
|
+
* `GestureInfo` objects (one per active touch). In general, the `click` and
|
|
29
|
+
* `delta` values are only present if the abstracted event `type == "drag"`.
|
|
30
|
+
* Both (and `pos` too) are 2-element arrays of `[x,y]` coordinates.
|
|
33
31
|
*
|
|
34
|
-
* The `zoom` value is always present, but is only updated with wheel
|
|
35
|
-
*
|
|
36
|
-
*
|
|
32
|
+
* The `zoom` value is always present, but is only updated with wheel events.
|
|
33
|
+
* The value will be constrained to `minZoom` ... `maxZoom` interval (provided
|
|
34
|
+
* via options object).
|
|
37
35
|
*
|
|
38
36
|
* Note: If using `preventDefault` and attaching the event stream to
|
|
39
37
|
* `document.body`, the following event listener options SHOULD be used:
|
|
@@ -43,7 +41,7 @@ const EVENT_GESTURETYPES = {
|
|
|
43
41
|
* eventOpts: { passive: false }
|
|
44
42
|
* ```
|
|
45
43
|
*
|
|
46
|
-
*
|
|
44
|
+
* https://www.chromestatus.com/features/5093566007214080
|
|
47
45
|
*
|
|
48
46
|
* @param el -
|
|
49
47
|
* @param opts -
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@thi.ng/rstream-gestures",
|
|
3
|
-
"version": "4.1.
|
|
3
|
+
"version": "4.1.34",
|
|
4
4
|
"description": "Unified mouse, mouse wheel & multi-touch event stream abstraction",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"module": "./index.js",
|
|
@@ -21,7 +21,11 @@
|
|
|
21
21
|
"url": "https://patreon.com/thing_umbrella"
|
|
22
22
|
}
|
|
23
23
|
],
|
|
24
|
-
"author": "Karsten Schmidt
|
|
24
|
+
"author": "Karsten Schmidt (https://thi.ng)",
|
|
25
|
+
"contributors": [
|
|
26
|
+
"Arthur Carabott (https://github.com/acarabott)",
|
|
27
|
+
"Matei Adriel (https://github.com/Mateiadrielrafael)"
|
|
28
|
+
],
|
|
25
29
|
"license": "Apache-2.0",
|
|
26
30
|
"scripts": {
|
|
27
31
|
"build": "yarn clean && tsc --declaration",
|
|
@@ -34,19 +38,19 @@
|
|
|
34
38
|
"test": "testament test"
|
|
35
39
|
},
|
|
36
40
|
"dependencies": {
|
|
37
|
-
"@thi.ng/api": "^8.
|
|
38
|
-
"@thi.ng/checks": "^3.3.
|
|
39
|
-
"@thi.ng/math": "^5.3.
|
|
40
|
-
"@thi.ng/rstream": "^7.2.
|
|
41
|
-
"@thi.ng/transducers": "^8.3.
|
|
41
|
+
"@thi.ng/api": "^8.6.1",
|
|
42
|
+
"@thi.ng/checks": "^3.3.5",
|
|
43
|
+
"@thi.ng/math": "^5.3.17",
|
|
44
|
+
"@thi.ng/rstream": "^7.2.32",
|
|
45
|
+
"@thi.ng/transducers": "^8.3.27"
|
|
42
46
|
},
|
|
43
47
|
"devDependencies": {
|
|
44
|
-
"@microsoft/api-extractor": "^7.33.
|
|
45
|
-
"@thi.ng/testament": "^0.3.
|
|
48
|
+
"@microsoft/api-extractor": "^7.33.7",
|
|
49
|
+
"@thi.ng/testament": "^0.3.7",
|
|
46
50
|
"rimraf": "^3.0.2",
|
|
47
51
|
"tools": "^0.0.1",
|
|
48
|
-
"typedoc": "^0.23.
|
|
49
|
-
"typescript": "^4.
|
|
52
|
+
"typedoc": "^0.23.22",
|
|
53
|
+
"typescript": "^4.9.4"
|
|
50
54
|
},
|
|
51
55
|
"keywords": [
|
|
52
56
|
"animation",
|
|
@@ -91,5 +95,5 @@
|
|
|
91
95
|
],
|
|
92
96
|
"year": 2018
|
|
93
97
|
},
|
|
94
|
-
"gitHead": "
|
|
98
|
+
"gitHead": "7b2af448da8a63fb21704a79cc4cdf1f3d7d7a64\n"
|
|
95
99
|
}
|