Skip to content

Releases: recogito/recogito-js

Version 1.4.5

11 Oct 11:46
Compare
Choose a tag to compare

Feature additions

  • Added a mechanism for widget plugins to use built-in I18N features and register their own localized UI labels
  • New .clearAnnotations method that clears all text and relation annotations
  • The selectAnnotation event now provides the clicked SPAN element as second argument to the event handler function

Behavior

  • 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
  • Cosmetic tweak: 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

  • Existing annotations are now properly cleared when calling .setAnnotations (#50)

Other

  • Upgraded the build to Webpack v5

Version 1.4.3

03 Oct 06:39
Compare
Choose a tag to compare

Bugfixes

  • Relationship drawing is no longer offset when used on scrolled pages

Version 1.4.2

16 Sep 17:50
Compare
Choose a tag to compare

Feature additions

  • Added destroy() API method (#26)

Version 1.4.1

13 Sep 16:47
Compare
Choose a tag to compare

Features & additions

  • Added Finnish, French and Korean UI labels
  • loadAnnotations now allows custom fetch request args for the HTTP request (PR #46)
  • Introduced editorAuotPosition init argument, to disable the editor's behavior to force itself into the visible screen area (see #44)
var r = Recogito.init({
  content: 'content',
  editorAutoPosition: false // defaults to true
});
  • 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/person' }, 
      { 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' },
    ] 
  }]
});

Bugfixes

  • Fixed a bug that cause incomplete deletions for overlapping annotations (#43)

Other

  • Removed axios dependency in favor of standard fetch API, reducing bundle size by ~16kB

Version 1.4.0

11 Jul 18:27
Compare
Choose a tag to compare

IMPORTANT: v1.4 drops built-in support for Internet Explorer!

If you need IE support: don't worry - it's still available. But from v1.4 onwards, you need to include the file
recogito-polyfills.js in addition to recogito.min.js.

Version 1.3.0

03 Jul 07:47
Compare
Choose a tag to compare

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. (React this.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 (#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 given purpose).
// 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);  

Behavior improvements/fixes

  • When the editor opens, the first widget in the list now automatically gets initial focus
  • While RecogitoJS still generates annotations that contain both a TextPositionSelector and a QuoteSelector it will now properly load annotations that only contain a TextPositionSelector.

Version 1.2.2

11 Jun 10:16
Compare
Choose a tag to compare

Maintenance release - adds more build fixes to the plugin API from recogito-client-core.

Version 1.2.1

11 Jun 09:37
Compare
Choose a tag to compare

Maintenance release

  • Dependency security patches
  • Upgraded to latest recogito-client-core, which adds support for React extensions that use hooks

Version 1.2.0

05 Jun 18:48
Compare
Choose a tag to compare

Maintenance release - shouldn't break anything (in theory)

  • Upgraded dependencies to latest versions
  • Cleaned up project structure, removed unused dev dependencies and webpack build
  • Editor now supports widgets built with Preact

Version 1.1.0

03 Jun 07:00
Compare
Choose a tag to compare
  • Delete Annotation button (finally!), with a mechanism that allows widget plugins to control whether delete is possible or not
  • Improved auto-positioning of the editor, so that it now remains inside the viewport in most situations
  • Editor now supports React widgets