@annotorious/annotorious 3.0.19 → 3.0.21
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 +1062 -1049
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +8 -8
- package/src/Annotorious.ts +2 -4
- package/src/annotation/SVGAnnotationLayer.svelte +5 -1
- package/src/annotation/tools/polygon/RubberbandPolygon.svelte +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@annotorious/annotorious",
|
|
3
|
-
"version": "3.0.
|
|
3
|
+
"version": "3.0.21",
|
|
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,17 +40,17 @@
|
|
|
40
40
|
"@sveltejs/vite-plugin-svelte": "^3.1.2",
|
|
41
41
|
"@tsconfig/svelte": "^5.0.4",
|
|
42
42
|
"@types/rbush": "^4.0.0",
|
|
43
|
-
"jsdom": "^
|
|
43
|
+
"jsdom": "^26.0.0",
|
|
44
44
|
"svelte": "^4.2.19",
|
|
45
45
|
"svelte-preprocess": "^6.0.3",
|
|
46
|
-
"typescript": "5.7.
|
|
47
|
-
"vite": "^5.4.
|
|
48
|
-
"vite-plugin-dts": "^4.
|
|
49
|
-
"vitest": "^
|
|
46
|
+
"typescript": "5.7.3",
|
|
47
|
+
"vite": "^5.4.14",
|
|
48
|
+
"vite-plugin-dts": "^4.5.0",
|
|
49
|
+
"vitest": "^3.0.4"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@annotorious/core": "3.0.
|
|
52
|
+
"@annotorious/core": "3.0.21",
|
|
53
53
|
"rbush": "^4.0.1",
|
|
54
|
-
"uuid": "^11.0.
|
|
54
|
+
"uuid": "^11.0.5"
|
|
55
55
|
}
|
|
56
56
|
}
|
package/src/Annotorious.ts
CHANGED
|
@@ -114,10 +114,8 @@ export const createImageAnnotator = <I extends Annotation = ImageAnnotation, E e
|
|
|
114
114
|
// Most of the external API functions are covered in the base annotator
|
|
115
115
|
const base = createBaseAnnotator<I, E>(state, undoStack, opts.adapter);
|
|
116
116
|
|
|
117
|
-
const cancelDrawing = () =>
|
|
118
|
-
annotationLayer
|
|
119
|
-
setTimeout(() => annotationLayer.$set({ drawingEnabled: true }), 1);
|
|
120
|
-
}
|
|
117
|
+
const cancelDrawing = () =>
|
|
118
|
+
annotationLayer.cancelDrawing();
|
|
121
119
|
|
|
122
120
|
const destroy = () => {
|
|
123
121
|
// Destroy Svelte annotation layer
|
|
@@ -23,7 +23,11 @@
|
|
|
23
23
|
export let user: User;
|
|
24
24
|
export let visible = true;
|
|
25
25
|
|
|
26
|
+
// Trick to force tool re-mounting on cancelDrawing
|
|
27
|
+
let toolMountKey = 0;
|
|
28
|
+
|
|
26
29
|
/** API methods */
|
|
30
|
+
export const cancelDrawing = () => toolMountKey += 1;
|
|
27
31
|
export const getDrawingTool = () => toolName;
|
|
28
32
|
export const isDrawingEnabled = () => drawingEnabled;
|
|
29
33
|
|
|
@@ -195,7 +199,7 @@
|
|
|
195
199
|
{/if}
|
|
196
200
|
{/each}
|
|
197
201
|
{:else if (tool && drawingEnabled)}
|
|
198
|
-
{#key toolName}
|
|
202
|
+
{#key `${toolName}-${toolMountKey}`}
|
|
199
203
|
<ToolMount
|
|
200
204
|
target={drawingEl}
|
|
201
205
|
tool={tool}
|