@annotorious/annotorious
Advanced tools
Comparing version 3.0.0-rc.5 to 3.0.0-rc.6
@@ -12,3 +12,3 @@ import type { SvelteComponent } from 'svelte'; | ||
registerShapeEditor(shapeType: ShapeType, editor: typeof SvelteComponent): void; | ||
setDrawingTool(tool: DrawingTool): void; | ||
setDrawingTool(name: DrawingTool): void; | ||
setDrawingEnabled(enabled: boolean): void; | ||
@@ -15,0 +15,0 @@ setTheme(theme: Theme): void; |
{ | ||
"name": "@annotorious/annotorious", | ||
"version": "3.0.0-rc.5", | ||
"version": "3.0.0-rc.6", | ||
"description": "Add image annotation functionality to any web page with a few lines of JavaScript", | ||
@@ -5,0 +5,0 @@ "author": "Rainer Simon", |
@@ -27,3 +27,3 @@ import type { SvelteComponent } from 'svelte'; | ||
setDrawingTool(tool: DrawingTool): void; | ||
setDrawingTool(name: DrawingTool): void; | ||
@@ -124,6 +124,9 @@ setDrawingEnabled(enabled: boolean): void; | ||
const setDrawingTool = (t: DrawingTool) => { | ||
const { tool, opts } = getTool(t); | ||
// @ts-ignore | ||
annotationLayer.$set({ tool, opts }) | ||
const setDrawingTool = (name: DrawingTool) => { | ||
// Validate that the tool exists | ||
const toolSpec = getTool(name); | ||
if (!toolSpec) | ||
throw `No drawing tool named ${name}`; | ||
annotationLayer.$set({ toolName: name }) | ||
} | ||
@@ -130,0 +133,0 @@ |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
958380
5906