Git Product home page Git Product logo

luccalb / tiptap-annotation-magic Goto Github PK

View Code? Open in Web Editor NEW
25.0 25.0 0.0 316 KB

An extension for the Tiptap editor, enabling the annotation of text. Comes with support for overlapping annotations, useful for e.g. NLP tokenization.

License: MIT License

TypeScript 100.00%
angular annotation extension javascript js nlp react rich-text-editor tiptap tokenization tokenizer vue wysiwyg wysiwyg-editor

tiptap-annotation-magic's People

Contributors

luccalb avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

tiptap-annotation-magic's Issues

Improve annotation deletion

When the textof an annotation is deleted, the annotation visually disappears but is still stored in the annotation map with to === from, which is an invalid annotation state.

  • either completely delete the annotation from storage on document remapping
  • orprovide a callback function like onAnnotationDelete():boolean to be called when changing the document would result in the removl of an annotation, the user could then provide a function to decide if the document change should pass or not (e.g. a modal)

Introduce a "z-index" for annotations, giving more control over the rendering

Feature Description

Currently, annotations are rendered so that as many annotations as possbile are visible at the same time. The new feature should implement a new "rendering strategy", making it possible to specify which annotation should be rendered above others, possibly hiding other annotations completely. This can be compared to the CSS z-index attribute.

Enable switchin between token-based and free text annotation

For many NLP applications, text should be annotated with "tokens" as the smallest annotatable unit.

  • Add a configuration option (global default) and an option for addAnnotation() command that forces the annotation of tokens
  • from and to attributes should always point to start/end of the respective token

Annotations cannot be undone by history

Currently the annotation changes are not tracked by the histories undo() and redo() commands. This is probably due to the fact that annotations are not stored inside the plugins storage field in the editor state but in an ordinary map.

  • Move the annotaitons map to the extensions storage field

Refactor the annotation contracts

Currently three different contracts are used for annotations: annotation.model.ts, term.model.ts, TermItem.ts
They are mixed in describing either the real annotation object, or the tiptap decoration and should be clearly identifiable as such.

  • Merge annotation.model.ts and term.model.ts
  • Reevaluate if TermItem.ts is necessary, if it is make it clear that it describes the Decoration
  • Make the data attribute in annotations strongly typed

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.