{"id":48286413,"url":"https://github.com/luccalb/tiptap-annotation-magic","last_synced_at":"2026-04-04T22:57:24.325Z","repository":{"id":188660848,"uuid":"679149339","full_name":"luccalb/tiptap-annotation-magic","owner":"luccalb","description":"An extension for the Tiptap editor, enabling the annotation of text. Comes with support for overlapping annotations, useful for e.g. NLP tokenization.","archived":false,"fork":false,"pushed_at":"2023-09-04T17:24:16.000Z","size":316,"stargazers_count":35,"open_issues_count":6,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-09T17:07:08.216Z","etag":null,"topics":["angular","annotation","extension","javascript","js","nlp","react","rich-text-editor","tiptap","tokenization","tokenizer","vue","wysiwyg","wysiwyg-editor"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/luccalb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2023-08-16T07:50:17.000Z","updated_at":"2025-08-18T02:08:25.000Z","dependencies_parsed_at":null,"dependency_job_id":"a054bda8-373f-4898-97e1-387dec7a6e37","html_url":"https://github.com/luccalb/tiptap-annotation-magic","commit_stats":null,"previous_names":["luccalb/tiptap-annotation-magic"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/luccalb/tiptap-annotation-magic","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luccalb%2Ftiptap-annotation-magic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luccalb%2Ftiptap-annotation-magic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luccalb%2Ftiptap-annotation-magic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luccalb%2Ftiptap-annotation-magic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/luccalb","download_url":"https://codeload.github.com/luccalb/tiptap-annotation-magic/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/luccalb%2Ftiptap-annotation-magic/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31418276,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-04T20:09:54.854Z","status":"ssl_error","status_checked_at":"2026-04-04T20:09:44.350Z","response_time":60,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["angular","annotation","extension","javascript","js","nlp","react","rich-text-editor","tiptap","tokenization","tokenizer","vue","wysiwyg","wysiwyg-editor"],"created_at":"2026-04-04T22:57:23.785Z","updated_at":"2026-04-04T22:57:24.319Z","avatar_url":"https://github.com/luccalb.png","language":"TypeScript","readme":"# Tiptap Annotation Magic\n## Description\n\nThis is an extension for the [Tiptap](https://github.com/ueberdosis/tiptap) editor (based on ProseMirror). It's unique\nfor its ability to **render overlapping annotations** as fragments. Annotations are rendered as [Decorations](https://prosemirror.net/docs/ref/#view.Decorations)\nand are therefore not a part of the Prosemirror Document.\n![Example](./assets/demo.jpg)\n\n## Setup\n\n### Install Tiptap\n\n`npm install --save @tiptap/core @tiptap/pm @tiptap/starter-kit`\n\n### Install Annotation Magic\n\n`npm install --save tiptap-annotation-magic`\n\n### Configuration\n\nDefine a model if you want to store data in annotations.\n\n```{ts}\ninterface AnnotationData {\n    name: string;\n    magicNumber: number;\n}\n```\n\nAdd `AnnotationMagic` to the list of your extensions.\n\n```{ts}\nextensions: [\n    StarterKit,\n    AnnotationMagic\u003cAnnotationData\u003e().configure({\n        onAnnotationListChange: (annotations: Annotation\u003cAnnotationData\u003e[]) =\u003e {\n            // Callback when annotation is created/deleted/updated\n        },\n        onSelectionChange: (selectedAnnotations: Annotation\u003cAnnotationData\u003e[]) =\u003e {\n            // Callback when the selected editor text changes\n        },\n        styles: {\n            // CSS classes to use for different fragments\n            leftFragment: 'fragment-left',\n            rightFragment: 'fragment-right',\n            middleFragment: 'fragment-middle',\n            normal: 'annotation-normal',\n        }\n    })\n]\n```\n\n## Commands\n\n```{ts}\n// Create an annotation containing `data` at the selected text location\neditor.chain().focus().addAnnotation(data).run();\n\n// Update an annotations `data`\neditor.chain().focus().addAnnotation(id, data).run();\n\n// Remove an existing annotation\neditor.chain().focus().deleteAnnotation(id).run();\n```\n\n## Demo\n\nSee a Demo using React on [Stackblitz](https://stackblitz.com/edit/stackblitz-starters-4gxggz?file=src%2FTiptap.tsx)","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluccalb%2Ftiptap-annotation-magic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fluccalb%2Ftiptap-annotation-magic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fluccalb%2Ftiptap-annotation-magic/lists"}