Releases: annotorious/annotorious-openseadragon
Releases · annotorious/annotorious-openseadragon
Version 2.5.9
Feature additions/behavior
- Escape key now cancels drawing
- Added
getAnnotationById
API method - Added
removeDrawingTool
API method - When adding a drawing tool that has the same ID as an existing one,
addDrawingTool
will replace it - Drawing tools can now implement behavior where drawing starts on a single click, rather than a drag. The default polygon tool implements this behavior already. Note that this behavior is disabled by default and can be enabled with a new
drawOnSingleClick: true
config property - It's now possible to display SVG shape annotations for which no drawing tool is available. (E.g. created with other tools, or created in another Annotorious instance that had specific tool plugins installed.) In this case, selecting the annotation will show the editor popup normally. The shape just won't be editable.
Bugfixes
- Fixed a regression that broke touch selection and touchpad-tap selection on some devices (#99)
- Fixed a regression that broke the
disableSelect
instance field - Fixed a bug that caused TiltedBox selections to become dumbed-down to polygons in gigapixel mode
Version 2.5.8
Architecture
This version introduces a new rendering implementation that supports more annotations. Previous versions became sluggish
after adding about 300 annotations. The new implementation should be good up to around 3.000.
Editor
- Cosmetic fixes to draggable surfaces: move cursor no longer shows on non-draggable surfaces + no more move cursor when editor is configured to fixed (=non-detachable) mode (#85)
- Cosmetic tweaks to editor auto-position behavior to avoid the jump when dragging the editor from the upwards-oriented position.
- When the editor is configured as draggable, text comment fields are no longer drag surfaces. This way, it's possible to select (and copy) text from comment fields
- Comment widget: the purpose selection dropdown is no longer obscured by tags
Bugfixes
- Fixed a bug that caused an error when calling
selectAnnotation
in headless mode (#95)
Widget API
- Breaking change!
onRemoveAndAppend
was dropped in favour of the more flexibleonBatchModify
. To upgrade, replace code like this:
const bodiesToRemove = [...];
const bodiesToAppend = [...];
const saveImmediately = true;
props.onRemoveAndAppend(bodiesToRemove, bodiesToAppend, saveImmediately);
with the following:
const changes = [
{ 'action': 'remove', body: bodyToRemove },
{ 'action': 'remove', body: anotherBodyToRemove },
{ 'action': 'append', body: bodyToAppend }
]);
props.onBatchModify(changes);
Other
- Replaced deprecated
@babel/polyfill
(#86)
Version 2.5.7
Features
- Added a mechanism for widget plugins to use built-in I18N features and register their own localized UI labels
Behavior
- Performance enhancement: for large numbers of annotations (>1.000), closing the editor no longer stalls the application. (The stall was caused by redrawing all annotations, to make sure larger annotations don't cover smaller ones. With the new change, only annotations overlapping the current selection are redrawn. Querying overlaps is accelerated with a 2D index.)
- The editor now adjusts position when widgets are changing. This is to avoid mis-placement when the editor grows/shrinks
- Draggable surfaces on the editor are now properly indicated with cursor
move
icon - In cases where the editor is pushed from its original position to remain in the view, the litte arrow now hides. This is to avoid the arrow pointing outside of the annotation.
Bugfixes
- When dragging the image while an annotation is selected, dragging no longer closes the editor (#89)
- Fixed a bug that caused layout problems in some cases, where CSS
position
was applied to the OSD container element (#87) - When importing via script-tag, source map file now loads properly
- Fixed a regression bug that caused
getSelected
to always returnundefined
in headless mode - The
saveImmediately
option onupdateSelected
didn't work - fixed - Fixed a regression that broke the Vite production build
Other
- Development build upgraded to Webpack 5
Version 2.5.6
Feature additions
- Added Finnish and Korean UI labels
- Added support for percent-encoded Media Fragment selectors. (Annotorious will read both
pixel
andpercent
-encoded fragments. When new rectangle annotations are created, thefragmentUnit
init parameter determines their encoding. SetfragementUnit: 'percent'
to write percent-encoded annotations, orfragmentUnit: 'pixel'
(default) to write pixel-encoded annotations. - Added support for tagging vocabularies with ontology terms, where each vocabulary item consists of a label and a URI.
var r = Recogito.init({
content: 'content', // Element id or DOM node to attach to
widgets: [{
widget: 'TAG',
vocabulary: [
{ label: 'Place', uri: 'http://www.example.com/ontology/place' },
{ label: 'Person', uri: 'http://www.example.com/ontology/place' },
{ label: 'Event', uri: 'http://www.example.com/ontology/event' },
{ label: 'Organization', uri: 'http://www.example.com/ontology/organization' },
{ label: 'Animal', uri: 'http://www.example.com/ontology/animal' }
]
}]
});
It's also possible to mix normal terms and ontology terms.
var r = Recogito.init({
content: 'content', // Element id or DOM node to attach to
widgets: [{
widget: 'TAG',
vocabulary: [
{ label: 'Place', uri: 'http://www.example.com/ontology/place' },
'Person',
{ label: 'Event', uri: 'http://www.example.com/ontology/event' },
]
}]
});
Behavior/bugfixes
- Clicking outside the selected annotation now cancels the selection
- Fixed various behavior issues in headless mode (=
disableEditor
set totrue
) - Fixes a bug that caused Annotorious to crash when calling
destroy
and initializing a new Annotorious instance on the same OSD viewer - Widget API:
saveImmediately
andonUpsertBody
methods now properly exposed to VanillaJS widgets
Version 2.5.5
Feature additions
gigapixelMode
init option (experimental!)disableSelect
is now an init option (annotorious/annotorious#158)wigets
can now a getter/setter option (annotorious/annotorious#161)
anno.widgets = [...anno.widgets, MyCustomWidget ];
Behavior/bugfixes
- Editor no longer resets when moving shape
anno.getSelected
now returns live editor state- Minor behavior fixes to draggable editor behavior
Version 2.5.4
Minor changes to the tool plugin API, as required for the new Tilted Box plugin.
Version 2.5.3
Features
- Added French UI labels
Behavior improvements/fixes
- It's (finally) possible to select regions inside an existing annotation (issue #75)
- Setting
disableSelect
totrue
no longer clears the current selection - The widget API now allows an additional
force: 'React'
widget property to force a plugin widget into React mode. This is a fallback for some cases where the auto-detection for the widget type (function vs. React component) fails (annotorious/annotorious#153)
var anno = Annotorious.init({
image: 'hallstatt',
widgets: [
{ widget: ColorSelectorWidget, force: 'React' }, // or force: 'PlainJS'
'COMMENT',
'TAG'
]
});
Bugfixes
- Fixed a bug that caused the
selectAnnotation
event to fire when programmatically selecting an annotation (annotorious/annotorious#145) - Fixed a regression that caused I18N to break after switching from Webpack to Vite for production build (recogito/recogito-client-core#71)
- Right-click no longer triggers the selection tools (annotorious/annotorious#149)
Version 2.5.2
Bugfixes
- Fixed a bug that caused the
selectAnnotation
event to fire when programmatically selecting an annotation (#73) - Fixed a major regression that prevented editable shapes from being resize- and draggable
Version 2.5.1
Features
- New property
disableSelect
to temporarily disable all selection functionality - New event
clickAnnotation
- Added
.once
method for registering a one-time event handler
Version 2.5.0
IMPORTANT: v2.5 drops built-in support for Internet Explorer!
If you need IE support: don't worry - it's still available. But from v2.5 onwards, you need to include the file
recogito-polyfills.js
in addition to openseadragon-annotorious.min.js
.
Features
- Added a crosshair feature that can optionally replace the mouse cursor, for more precise selection. Enable via a
crosshair:true
init option. - New
.setWidgets
API method that allows changing editor widget configuration at runtime
Behavior improvements/fixes
- When the editor opens, the first widget in the list now automatically gets initial focus
- The
mouseEnterAnnotation
,mouseLeaveAnnotation
andselectAnnotation
events now provide a reference to the SVG shape in addition to the annotation.
anno.on('mouseEnterAnnotation', function(annotation, element) {
console.log(annotation); // W3C annotation as JS object
console.log(element); // SVG <g> annotation shape element
});
Bugfixes
- Fixed a regression that caused selected annotations to appear twice when calling
getAnnotations
from within theselectAnnotation
event handler #63
Editor plugin API
- The
Editor
was refactored from a React functional component to a class component. This allows attaching follow-up actions to state changes. (Reactthis.setState({...}, callback)
- which isn't available in functional components.) The use case for this are widget actions that modify the current annotation (add or remove bodies) and then save & close the editor immediately (recogito/recogito-client-core#66). - The editor plugin API callback function
.onUpsertBody
now simplifies the use of single-body plugins (i.e. plugins like dropdowns or input fields, which only insert or replace a single body of a givenpurpose
).
// Replaces the first existing body of purpose 'my-purpose' or appends, if none
props.onUpsertBody({ value: 'Some value', purpose: 'my-purpose' });
- The widget API has a new callback
onBatchModify
which allows applying any combination of body modifications in one go (append, remove, update, upsert), with or without closing the editor immediately afterwards. (#65)
const changes = [
{ action: 'append', body: bodyToAppend },
{ action: 'update', previous: prevBody, updated: updatedBody }
{ action: 'remove', body: bodyToRemove },
// Normal upsert, previous is optional
{ action: 'upsert', previous: prevBody, updated: updatedBody }
// Auto-upsert based on purpose
{ action: 'upsert', body: bodyToUpser }
];
const saveImmediately = true;
args.onBatchModify(changes, saveImmediately);
Other
- Separation of IE support reduces the core bundle size by 76kB (now ~265kB)