osuresearch / annotator Goto Github PK
View Code? Open in Web Editor NEWReact components for annotating forms and documents
License: MIT License
React components for annotating forms and documents
License: MIT License
I misinterpreted the spec at some point, this should be document IRI not a field within the document (as I was using it previously). Requires a bit of refactoring of how I'm re-associating threads to targets.
This also brings up a potential issue with text position selectors not knowing which particular field to target. May require changing the IRI to something like UUID#field
Outstanding issues with the comment threading feature for me to track, in no particular order:
Field
and collection instancesDocuments that have anchors going to external websites (or linking to documents) without opening in a new tab will cause the iframe to attempt to load cross-domain content, which of course crashes the whole thing.
Either the links need to be sanitized or disabled to ensure they can't open in the same frame when parsing a source document.
Reviewable external documents need to autogenerate a TOC from heading levels to reach feature parity with the legacy document review component. Docusaurus uses a third party library for this, might be able to leverage the same.
Add a set of feature flags we can toggle in the main provider. Ideas so far:
The packing algo in useCellList
will execute ~4x each time we click a NoteAnchor
due to various focus changes, container height changes, and cell position changes that all happen in various render cycles. Since there's a sort in there as well, performance isn't going to scale well.
Throttle the packing algo, or figure out some other way to reduce call count through some memoization magicks.
My notes / TODO on the integration with Adobe's DC viewer
Typical double rendering issue - anchors end up duplicating in the useAnchors
item list which causes various components to render twice into portals in the iframe DOM.
I've spent a good amount of time trying to trace this down, but no luck so far.
Repro:
Basically, since the thread's Tiptap instance has keyboard focus on mount and the thread is usually in mid transit down the page due to our translateY
rule telling to hurry down to the target anchor - there's a chance that the browser will attempt to focus on the element when it's somewhere up higher on the page before the animation has settled.
Lazy solution: Focus delay that's longer than the animation + packing speed.
Better solution: TBD.
Really no longer need the custom RUIAnnoSelector
type. Anything we can annotate can conform to W3C now. The only annotator-specific data is attached as a body to each annotation.
Thus, use the following selectors instead:
RUIAnnoSelector.subtype == 'highlight'
will use a TextPositionSelector instead:
"target": {
"source": "XXXX-XXX-XXX-XXXX",
"selector": {
"type": "TextPositionSelector",
"start": 412,
"end": 795
}
}
RUIAnnoSelector.subtype == 'note'
to be:
"target": {
"source": "XXXX-XXX-XXX-XXXX",
"selector": {
"type": "FragmentSelector",
"value": "Field5",
}
}
Instead of using source
to denote which field is being annotated, target.source
will now specify the source document being annotated to better conform to the standard and allow us to combine multiple annotation sources together without conflict. E.g. annotations against multiple instances of the same form, or annotations that are for a parent form + any attached documents, each with their own IRI.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.