@annotorious/annotorious 3.1.3 → 3.1.5
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/annotorious.es.js +205 -200
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +5 -5
- package/src/annotation/SVGAnnotationLayer.svelte +1 -1
- package/src/annotation/tools/polygon/RubberbandPolygon.svelte +9 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@annotorious/annotorious",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
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",
|
|
@@ -43,14 +43,14 @@
|
|
|
43
43
|
"jsdom": "^26.0.0",
|
|
44
44
|
"svelte": "^4.2.19",
|
|
45
45
|
"svelte-preprocess": "^6.0.3",
|
|
46
|
-
"typescript": "5.
|
|
46
|
+
"typescript": "5.8.2",
|
|
47
47
|
"vite": "^5.4.14",
|
|
48
48
|
"vite-plugin-dts": "^4.5.0",
|
|
49
|
-
"vitest": "^3.0.
|
|
49
|
+
"vitest": "^3.0.8"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@annotorious/core": "3.1.
|
|
52
|
+
"@annotorious/core": "3.1.5",
|
|
53
53
|
"rbush": "^4.0.1",
|
|
54
|
-
"uuid": "^11.0
|
|
54
|
+
"uuid": "^11.1.0"
|
|
55
55
|
}
|
|
56
56
|
}
|
|
@@ -156,7 +156,7 @@
|
|
|
156
156
|
{#each $store.filter(a => isImageAnnotation(a)) as annotation}
|
|
157
157
|
{#if isImageAnnotation(annotation) && !isEditable(annotation)}
|
|
158
158
|
{@const selector = annotation.target.selector}
|
|
159
|
-
{#key annotation
|
|
159
|
+
{#key annotation}
|
|
160
160
|
{#if (selector?.type === ShapeType.ELLIPSE)}
|
|
161
161
|
<Ellipse
|
|
162
162
|
annotation={annotation}
|
|
@@ -22,7 +22,7 @@
|
|
|
22
22
|
// Keep track of the user keeping the finger
|
|
23
23
|
// in place. Long pauses will be interpreted like a
|
|
24
24
|
// double click and close the shape.
|
|
25
|
-
let touchPauseTimer:
|
|
25
|
+
let touchPauseTimer: ReturnType<typeof setTimeout> | undefined;
|
|
26
26
|
|
|
27
27
|
let isClosable: boolean = false;
|
|
28
28
|
|
|
@@ -121,17 +121,18 @@
|
|
|
121
121
|
}
|
|
122
122
|
}
|
|
123
123
|
|
|
124
|
-
const onDblClick = () => {
|
|
124
|
+
const onDblClick = () => {
|
|
125
125
|
if (!cursor) return;
|
|
126
126
|
|
|
127
|
-
// Require min 3 points
|
|
128
|
-
//
|
|
129
|
-
const p =
|
|
127
|
+
// Require min 3 points and minimum polygon area.
|
|
128
|
+
// Note that the double click will have added a duplicate point!
|
|
129
|
+
const p = points.slice(0, -1);
|
|
130
|
+
if (p.length < 3) return;
|
|
130
131
|
|
|
131
132
|
const shape: Polygon = {
|
|
132
133
|
type: ShapeType.POLYGON,
|
|
133
134
|
geometry: {
|
|
134
|
-
bounds: boundsFromPoints(
|
|
135
|
+
bounds: boundsFromPoints(points),
|
|
135
136
|
points: p
|
|
136
137
|
}
|
|
137
138
|
}
|
|
@@ -140,7 +141,7 @@
|
|
|
140
141
|
if (area > 4) {
|
|
141
142
|
points = [];
|
|
142
143
|
cursor = undefined;
|
|
143
|
-
|
|
144
|
+
|
|
144
145
|
dispatch('create', shape);
|
|
145
146
|
}
|
|
146
147
|
}
|
|
@@ -156,7 +157,7 @@
|
|
|
156
157
|
|
|
157
158
|
points = [];
|
|
158
159
|
cursor = undefined;
|
|
159
|
-
|
|
160
|
+
|
|
160
161
|
dispatch('create', shape);
|
|
161
162
|
}
|
|
162
163
|
|