• Eduardo Sanz García's avatar
    Remove `AnnotationSync` utility · e63a0be7
    Eduardo Sanz García authored
    AnnotationSync utility didn't have a clear purpose, except for assigning a
    temporarily `$tag` to newly created annotations. For that, it used an
    internal cache of annotation objects from the Guest, that were mutated
    in-place. `AnnotationSync` used a very indirect method of communication
    to the `Guest`, using an event emitter, even though their mutual
    relationship was quite straightforward.
    
    In this PR, we have:
    
    * Simplified the messages that are sent between the host and the
      sidebar. We have assumed that a `$tag` value is always present if it
      comes from the `sidebar`, and a temporarily `$tag` is assigned in the
      `Guest` class for newly created annotations. Therefore, the type of
      the message sent between these two frames can be simplified to always
      be of the shape of `AnnotationData`, a safe version of `Annotation`.
    
    * Added a few missing types.
    
    * Changed the RPC method `deleteAnnotation` to send astring tag, similar
      to other RPC methods, like `focusAnnotations` or `scrollToAnnoation`.
      As a consequence of that we changed the `Guest#detach` method
      signature.
    e63a0be7
Name
Last commit
Last update
..
components Loading commit data...
config Loading commit data...
helpers Loading commit data...
services Loading commit data...
store Loading commit data...
test Loading commit data...
util Loading commit data...
cross-origin-rpc.js Loading commit data...
icons.js Loading commit data...
index.js Loading commit data...
markdown-commands.js Loading commit data...
media-embedder.js Loading commit data...
render-markdown.js Loading commit data...
search-client.js Loading commit data...
service-context.js Loading commit data...
websocket.js Loading commit data...