@annotorious/annotorious 3.7.7 → 3.7.9

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@annotorious/annotorious",
3
- "version": "3.7.7",
3
+ "version": "3.7.9",
4
4
  "description": "Add image annotation functionality to any web page with a few lines of JavaScript",
5
5
  "author": "Rainer Simon",
6
6
  "license": "BSD-3-Clause",
@@ -40,16 +40,16 @@
40
40
  "@sveltejs/vite-plugin-svelte": "^3.1.2",
41
41
  "@tsconfig/svelte": "^5.0.5",
42
42
  "@types/rbush": "^4.0.0",
43
- "jsdom": "^26.1.0",
43
+ "jsdom": "^27.0.0",
44
44
  "svelte": "^4.2.20",
45
45
  "svelte-preprocess": "^6.0.3",
46
- "typescript": "^5.9.2",
46
+ "typescript": "^5.9.3",
47
47
  "vite": "^5.4.20",
48
48
  "vite-plugin-dts": "^4.5.4",
49
49
  "vitest": "^3.2.4"
50
50
  },
51
51
  "dependencies": {
52
- "@annotorious/core": "3.7.7",
52
+ "@annotorious/core": "3.7.9",
53
53
  "dequal": "^2.0.3",
54
54
  "rbush": "^4.0.1",
55
55
  "simplify-js": "^1.2.4",
@@ -71,11 +71,6 @@
71
71
  }
72
72
 
73
73
  const onPointerUp = (event: Event) => {
74
- // Edge case: if anno.setDrawingEnabled(true) is called
75
- // while the pointer is down, this handler may fire with
76
- // an undefined cursor. In this case: ignore.
77
- if (!cursor) return;
78
-
79
74
  const evt = event as PointerEvent;
80
75
 
81
76
  if (touchPauseTimer) clearTimeout(touchPauseTimer);
@@ -99,9 +94,15 @@
99
94
 
100
95
  cursor = point;
101
96
  } else {
102
- points.push(cursor!);
97
+ if (cursor)
98
+ points.push(cursor);
103
99
  }
104
100
  } else {
101
+ // Edge case: if anno.setDrawingEnabled(true) is called while
102
+ // the pointer is down, this handler may fire with an undefined
103
+ // cursor (in drag mode). In this case: ignore.
104
+ if (!cursor) return;
105
+
105
106
  // Require minimum drag of 4px
106
107
  if (points.length === 1) {
107
108
  const dist = distance(points[0], cursor!);
@@ -121,7 +122,7 @@
121
122
  if (isClosable) {
122
123
  stopDrawing();
123
124
  } else {
124
- points.push(cursor!);
125
+ points.push(cursor);
125
126
  }
126
127
  }
127
128
  }