Releases: annotorious/annotorious-openseadragon
Releases · annotorious/annotorious-openseadragon
Version 2.4.2
Features
- Detachable editor: it's now possible to grab and drag the editor away from the annotation with mouse or touch, e.g. to avoid the editor getting in the way of shape resizing. The editor stays detached until closed.
Bugfixes
- Fixes a bug that caused resize handes to be offset on Safari for responsive images, and on the OpenSeadragon plugin (#62)
- Added a workaround that prevents touch navigation from breaking after a pinch/pan gesture was started on an annotation (#44)
Other
- Internal changes to the plugin API to support drawing tools for different shape types
- Internal changes to support OpenSeadragon sequence mode (#52)
- Switched to vite for the production build, reducing the bundle size by ~65kByte (#59)
Version 2.4.1
Feature extensions
- Support for formatters that insert DOM elements, like e.g. the Shape Labels plugin
- New
startSelection
event fired when the user starts drawing a shape (#58) - Editor now supports widgets built with Preact, and no longer breaks for widgets using React hooks
Bugfixes
.getAnnotations
no longer causes an error when an annotation is currently selected (annotorious/annotorious#118)- Calling
.setDrawingEnabled
or.setDrawingTool
in read-only mode no longer causes error (#55) cancelSelected
event is now fired properly when using the Escape key to cancel editing (annotorious/annotorious#122)- Fixed a bug that caused an error when selecting an annotation while a formatter function is configured (annotorious/annotorious#127)
- Setting
readOnly
dynamically now works properly, even when the initial setting wasreadOnly: true
(#56) - Formatter styles provided via
{ 'style': '<css string>' }
are now applied correctly (annotorious/annotorious#112) - Additional fixes to the widget plugin API
Version 2.4.0
Feature extensions
- New init option
handleRadius
, for setting the radius of the resize handles - New init option
messages
to override UI labels when initializing - Escape key now cancels editing (annotorious/annotorious#68)
- Formatters now support insertion of DOM elements into the annotation SVG group (annotorious/annotorious#104)
- Added support for React editor widgets
Behavior improvements/fixes
- Improved auto-positioning of the editor, so that it now remains inside the viewport in (almost) all situations
- Shapes are now constrained to the image area (when editing a shape, it's no longer possible to push it outside the image, issue #109)
- When resizing a rectangle selection, it is now possible to move the dragged handle into neighbour quadrants without creating a zero-size rectangle (annotorious/annotorious#103)
anno.cancelSelected()
now stops drawing if a tool is currently active (issue #51)
Bugfixes
- Annotations now sorted by size on init, so that larger annotations no longer cover smaller ones initially
- Fixed polygon area computation (annotorious/annotorious#105) - larger polygons no longer cover smaller rectangles
- Fixed polygon serialization syntax, which was working in most browser, but technically not compliant to the SVG spec (annotorious/annotorious#115)
- Fixed broken/missing
setVisible
API implementation (issue #46)
Other
- Removed axios dependency in
.loadAnnotations
in favor of standard fetch API, reducing uncompressed download size by ~12kB - SVG selectors now go through basic security sanitization: removes
<script>
tags anon...
event handlers (annotorious/annotorious#32) - Added most recently available dependency security patches
Version 2.3.1
Maintenance release
- Adds CSS fixes to the style of the tag widget
- Bugfix: calling
.selectAnnotation
triggered twoselectAnnotation
events, when it should trigger any at all - fixed - Fixed a bug that caused coordinates to shift when annotating images on scrolled-down on touch devices
- Fixed various minor behavior bugs in touch mode
- Fixed a bug that caused polygons to close in touch mode after ~500ms of idleness, even if the finger wasn't on the screen (intended behavior is tap-and-hold for ~500ms) - issue #100
- Bugfix: when creating a new selection, attemptinga to modify the shape caused a 'cancel'. Newly created shapes can now be modified immediately
- Editor now (finally) auto-positions correctly when moving it outside the browser viewport
- When allowing empty annotations (
allowEmpty: true
config option), empty annotations get a delete button
Version 2.3.0
- Enhanced browser compatibility: added additional polyfills
- Bugfix:
.fitBounds
method no longer brakes on non-rectangle shapes (issue #36) - Delete Annotation button (finally!), with a mechanism that allows widget plugins to control whether delete is possible or not
- Bugfix:
.removeAnnotation
now allows annotation object or annotation ID as argument (issue #37) - Added touch support (issue #34)
- Lots of behaviour tweaks to headless mode (running Annotorious with disableEditor: true)
headless
config option now deprecated. UsedisableEditor
instead (#95)disableEditor
can be changed without re-initializing Annotorious (#92). E.g.:
anno.disableEditor = !anno.disableEditor;
- ReadOnly mode can now be changed without re-initializing Annotorious (#93), through the
.readOnly
property. E.g.:
anno.readOnly = !anno.readOnly;
allowEmpty
config option, will cause Annotorious to keep annotations with no bodies- When changing the drawing tool, the current drawing tool is properly stopped in case drawing is currently ongoing
Version 2.2.3
Bugfix release. Changes nothing about the library, but corrects a bug in the build + package configuration that caused v2.2.2 from getting properly published on the NPM registry and JSDELIVR.
Version 2.2.2
- Fixes a regression bug on
readOnly
mode (issue #2) - Annotations are now properly aligned with flipped images
- Annotations now remain sorted by size, so that larger annotations no longer obstruct smaller annotations
- Switched to Terser for code optimization, due to ongoing security issues with Uglify
- Internal API changes to enable more powerful plugins
.addDrawingTool
and.listDrawingTools
API methods
Version 2.2.1
- Fixed bug that would cause annotations to become offset when the OpenSeadragon container width < height.
- Shape edit handles can now be customized via CSS
transform: scale(...)
- Editor
- Fixed a minor bug concerning proper display of
created
/lastModified
times - Greek UI language translation
- Fixed a minor bug concerning proper display of
- Widget API
- Widgets now get an updated annotation instance when the user changes the selection target (e.g. move/resize in Annotorious)
- Added
.onSetProperty
method that allows widgets to attach top-level props the annotation
Version 2.2.0
- Added Dutch UI translation
- New API method
clearAnnotations
- New API method
getSelected
- New API method
setVisible
- Added
cancelSelection
event, when user hits 'cancel' on a newly created shape - Revised
headless
API- New API method
saveSelected
to save changes to an annotation programmatically - New API method
cancelSelected
to cancel programmatically
- New API method
- Removed support for
applyTemplate
API function in favor of newheadless
API. Example: to apply a tag automatically in headless mode, use the following code.
// Run Annotorious in headless mode, without editor popup
var anno = Annotorious.init({
image: document.getElementById('my-image'),
headless: true
});
// Whenever a new annotation is created by the user, we want to append this body
var templateBody = {
type: 'TextualBody',
value: 'My Tag',
purpose: 'tagging'
};
// On select, update the selection with the body
anno.on('createSelection', function(selection) {
selection.body = templateBody;
anno.updateSelected(selection, true); // True saves immediately, otherwise use anno.saveSelected();
});
Version 2.1.4
- Editor bugfixes
getSelectedImageSnippet
API method