@varlet/touch-emulator 3.8.2 → 3.8.3

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.
Files changed (3) hide show
  1. package/iife.js +6 -3
  2. package/index.js +9 -3
  3. package/package.json +11 -11
package/iife.js CHANGED
@@ -79,13 +79,16 @@ var VarletTouchEmulator = (() => {
79
79
  function onMouse(mouseEvent, touchType) {
80
80
  const { type, target } = mouseEvent;
81
81
  initiated = isMousedown(type) ? true : isMouseup(type) ? false : initiated;
82
- if (isMousemove(type) && !initiated)
82
+ if (isMousemove(type) && !initiated) {
83
83
  return;
84
- if (isUpdateTarget(type))
84
+ }
85
+ if (isUpdateTarget(type)) {
85
86
  eventTarget = target;
87
+ }
86
88
  triggerTouch(touchType, mouseEvent);
87
- if (isMouseup(type))
89
+ if (isMouseup(type)) {
88
90
  eventTarget = null;
91
+ }
89
92
  }
90
93
  function createTouchEmulator() {
91
94
  window.addEventListener("mousedown", (event) => onMouse(event, "touchstart"), true);
package/index.js CHANGED
@@ -76,13 +76,19 @@ function onMouse(mouseEvent, touchType) {
76
76
 
77
77
  initiated = isMousedown(type) ? true : isMouseup(type) ? false : initiated
78
78
 
79
- if (isMousemove(type) && !initiated) return
79
+ if (isMousemove(type) && !initiated) {
80
+ return
81
+ }
80
82
 
81
- if (isUpdateTarget(type)) eventTarget = target
83
+ if (isUpdateTarget(type)) {
84
+ eventTarget = target
85
+ }
82
86
 
83
87
  triggerTouch(touchType, mouseEvent)
84
88
 
85
- if (isMouseup(type)) eventTarget = null
89
+ if (isMouseup(type)) {
90
+ eventTarget = null
91
+ }
86
92
  }
87
93
 
88
94
  function createTouchEmulator() {
package/package.json CHANGED
@@ -1,11 +1,21 @@
1
1
  {
2
2
  "name": "@varlet/touch-emulator",
3
- "version": "3.8.2",
3
+ "version": "3.8.3",
4
4
  "description": "touch-emulator",
5
5
  "keywords": [
6
6
  "emulator",
7
7
  "varlet"
8
8
  ],
9
+ "homepage": "https://github.com/varletjs/varlet#readme",
10
+ "bugs": {
11
+ "url": "https://github.com/varletjs/varlet/issues"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://github.com/varletjs/varlet.git"
16
+ },
17
+ "license": "MIT",
18
+ "author": "BeADre <beadre_wang@163.com>",
9
19
  "type": "module",
10
20
  "main": "index.js",
11
21
  "module": "index.js",
@@ -13,16 +23,6 @@
13
23
  "iife.js",
14
24
  "index.js"
15
25
  ],
16
- "author": "BeADre <beadre_wang@163.com>",
17
- "homepage": "https://github.com/varletjs/varlet#readme",
18
- "license": "MIT",
19
- "repository": {
20
- "type": "git",
21
- "url": "git+https://github.com/varletjs/varlet.git"
22
- },
23
- "bugs": {
24
- "url": "https://github.com/varletjs/varlet/issues"
25
- },
26
26
  "devDependencies": {
27
27
  "tsup": "7.2.0"
28
28
  },