@annotorious/annotorious 3.7.17 → 3.7.19

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.17",
3
+ "version": "3.7.19",
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,9 +40,9 @@
40
40
  },
41
41
  "devDependencies": {
42
42
  "@sveltejs/vite-plugin-svelte": "^3.1.2",
43
- "@tsconfig/svelte": "^5.0.5",
43
+ "@tsconfig/svelte": "^5.0.6",
44
44
  "@types/rbush": "^4.0.0",
45
- "jsdom": "^27.1.0",
45
+ "jsdom": "^27.2.0",
46
46
  "svelte": "^4.2.20",
47
47
  "svelte-preprocess": "^6.0.3",
48
48
  "typescript": "^5.9.3",
@@ -51,7 +51,7 @@
51
51
  "vitest": "^3.2.4"
52
52
  },
53
53
  "dependencies": {
54
- "@annotorious/core": "3.7.17",
54
+ "@annotorious/core": "3.7.19",
55
55
  "dequal": "^2.0.3",
56
56
  "rbush": "^4.0.1",
57
57
  "simplify-js": "^1.2.4",
@@ -10,7 +10,7 @@ import type { ImageAnnotation, ShapeType } from './model';
10
10
  import { createSvelteImageAnnotatorState } from './state';
11
11
  import { setTheme as _setTheme } from './themes';
12
12
  import { fillDefaults, type Theme } from './AnnotoriousOpts';
13
- import type { AnnotoriousOpts } from './AnnotoriousOpts';
13
+ import type { AnnotoriousOpts, DrawingMode } from './AnnotoriousOpts';
14
14
  import { initKeyboardCommands } from './keyboardCommands';
15
15
 
16
16
  import './Annotorious.css';
@@ -37,6 +37,8 @@ export interface ImageAnnotator<I extends Annotation = ImageAnnotation, E extend
37
37
 
38
38
  setDrawingEnabled(enabled: boolean): void;
39
39
 
40
+ setDrawingMode(mode: DrawingMode): void;
41
+
40
42
  setTheme(theme: Theme): void;
41
43
 
42
44
  }
@@ -156,6 +158,9 @@ export const createImageAnnotator = <I extends Annotation = ImageAnnotation, E e
156
158
 
157
159
  const setDrawingEnabled = (enabled: boolean) =>
158
160
  annotationLayer.$set({ drawingEnabled: enabled });
161
+
162
+ const setDrawingMode = (mode: DrawingMode) =>
163
+ annotationLayer.$set({ preferredDrawingMode: mode });
159
164
 
160
165
  const setFilter = (_: Filter) => {
161
166
  console.warn('Filter not implemented yet');
@@ -188,6 +193,7 @@ export const createImageAnnotator = <I extends Annotation = ImageAnnotation, E e
188
193
  registerDrawingTool,
189
194
  registerShapeEditor,
190
195
  setDrawingEnabled,
196
+ setDrawingMode,
191
197
  setDrawingTool,
192
198
  setFilter,
193
199
  setStyle,