@annotorious/annotorious 3.3.3 → 3.3.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/annotation/tools/drawingToolsRegistry.d.ts +2 -2
- package/dist/annotorious.es.js +5 -3
- package/dist/annotorious.es.js.map +1 -1
- package/dist/annotorious.js +1 -1
- package/dist/annotorious.js.map +1 -1
- package/package.json +6 -6
- package/src/annotation/tools/drawingToolsRegistry.ts +2 -2
- package/src/model/w3c/W3CImageFormatAdapter.ts +6 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@annotorious/annotorious",
|
|
3
|
-
"version": "3.3.
|
|
3
|
+
"version": "3.3.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",
|
|
@@ -40,16 +40,16 @@
|
|
|
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": "^26.
|
|
43
|
+
"jsdom": "^26.1.0",
|
|
44
44
|
"svelte": "^4.2.19",
|
|
45
45
|
"svelte-preprocess": "^6.0.3",
|
|
46
|
-
"typescript": "5.8.
|
|
47
|
-
"vite": "^5.4.
|
|
46
|
+
"typescript": "5.8.3",
|
|
47
|
+
"vite": "^5.4.18",
|
|
48
48
|
"vite-plugin-dts": "^4.5.3",
|
|
49
|
-
"vitest": "^3.
|
|
49
|
+
"vitest": "^3.1.2"
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
|
-
"@annotorious/core": "3.3.
|
|
52
|
+
"@annotorious/core": "3.3.5",
|
|
53
53
|
"rbush": "^4.0.1",
|
|
54
54
|
"svg-pathdata": "^7.2.0",
|
|
55
55
|
"uuid": "^11.1.0"
|
|
@@ -14,7 +14,7 @@ export type DrawingToolOpts = {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
// @ts-ignore
|
|
17
|
-
const REGISTERED = new Map<DrawingTool, { tool: typeof SvelteComponent, opts
|
|
17
|
+
const REGISTERED = new Map<DrawingTool, { tool: typeof SvelteComponent, opts: DrawingToolOpts }>([
|
|
18
18
|
['rectangle', { tool: RubberbandRectangle }],
|
|
19
19
|
['polygon', { tool: RubberbandPolygon }]
|
|
20
20
|
]);
|
|
@@ -23,5 +23,5 @@ export const listDrawingTools = () => [...REGISTERED.keys()];
|
|
|
23
23
|
|
|
24
24
|
export const getTool = (name: string) => REGISTERED.get(name);
|
|
25
25
|
|
|
26
|
-
export const registerTool = (name: string, tool: typeof SvelteComponent, opts
|
|
26
|
+
export const registerTool = (name: string, tool: typeof SvelteComponent, opts: DrawingToolOpts = {}) =>
|
|
27
27
|
REGISTERED.set(name, { tool, opts });
|
|
@@ -63,6 +63,9 @@ export const parseW3CImageAnnotation = (
|
|
|
63
63
|
w3cSelector?.type === 'SvgSelector' ?
|
|
64
64
|
parseSVGSelector(w3cSelector as SVGSelector) : undefined;
|
|
65
65
|
|
|
66
|
+
const target =
|
|
67
|
+
Array.isArray(rest.target) ? rest.target[0] : rest.targret;
|
|
68
|
+
|
|
66
69
|
return (selector || !opts.strict) ? {
|
|
67
70
|
parsed: {
|
|
68
71
|
...rest,
|
|
@@ -72,7 +75,8 @@ export const parseW3CImageAnnotation = (
|
|
|
72
75
|
created: created ? new Date(created) : undefined,
|
|
73
76
|
creator: parseW3CUser(creator),
|
|
74
77
|
updated: modified ? new Date(modified) : undefined,
|
|
75
|
-
|
|
78
|
+
// Note the target can be a string and we don't want to spread the characters...
|
|
79
|
+
...(typeof target === 'string' ? {} : target),
|
|
76
80
|
annotation: annotationId,
|
|
77
81
|
selector: selector || w3cSelector
|
|
78
82
|
}
|
|
@@ -121,6 +125,7 @@ export const serializeW3CImageAnnotation = (
|
|
|
121
125
|
target: {
|
|
122
126
|
...rest,
|
|
123
127
|
source,
|
|
128
|
+
type: 'SpecificResource',
|
|
124
129
|
selector: w3cSelector
|
|
125
130
|
}
|
|
126
131
|
} as W3CImageAnnotation;
|