You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When a user chooses a highlighting color - that piece of data should be recorded into the styleClass prop.
In my app, I manually extended the TextAnnotationTarget type in a .d.ts file with styleClass. So I'm able to record it with store.updateAnnotation(merge({}, annotation, { target: { styleClass } })). Which gets correctly serialized for the W3C annos:
The styleClass from the w3c anno never ends up on the core model and we lose it... 😭
The question of whether we should have the styleClass on the core model has already been brought up previously. The decision at that point was to not add it because:
it should stay out of the core. In the longer run (hopefully not too far future...) both the selectAction and the style function would be affected by the adapter. Which means you would get a W3CTextAnnotation as an argument to your style (or pointerAction) function.
Unfortunately, now I see a small flaw in that logic... If we don't have the styleClass somewhere in the Core model - there will nothing for the adapter to put into the W3CTextAnnotation 🤷🏻♂️
Possible Solution
Add the styleClass?: string type to the TextAnnotation model
Add copying of the styleClass from the W3CTextAnnotation to the TextAnnotation
The text was updated successfully, but these errors were encountered:
Issue
When a user chooses a highlighting color - that piece of data should be recorded into the
styleClass
prop.In my app, I manually extended the
TextAnnotationTarget
type in a.d.ts
file withstyleClass
. So I'm able to record it withstore.updateAnnotation(merge({}, annotation, { target: { styleClass } }))
. Which gets correctly serialized for the W3C annos:text-annotator-js/packages/text-annotator/src/model/w3c/W3CTextFormatAdapter.ts
Lines 141 to 146 in 3a70b9e
But, unfortunately, not having that type on the
TextAnnotation
itself - led to a parsing bug:text-annotator-js/packages/text-annotator/src/model/w3c/W3CTextFormatAdapter.ts
Lines 42 to 48 in 3a70b9e
The
styleClass
from the w3c anno never ends up on the core model and we lose it... 😭The question of whether we should have the
styleClass
on the core model has already been brought up previously. The decision at that point was to not add it because:Unfortunately, now I see a small flaw in that logic... If we don't have the
styleClass
somewhere in the Core model - there will nothing for the adapter to put into theW3CTextAnnotation
🤷🏻♂️Possible Solution
styleClass?: string
type to theTextAnnotation
modelstyleClass
from theW3CTextAnnotation
to theTextAnnotation
The text was updated successfully, but these errors were encountered: