1. 03 Dec, 2021 3 commits
    • Eduardo Sanz García's avatar
      Fix tests with new method signatures · d2ff4a7e
      Eduardo Sanz García authored
      Following the removal of `AnnotationSync` from `Guest` we correct the
      tests.
      d2ff4a7e
    • 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
    • Robert Knight's avatar
      Add fallback for browsers that can't clone errors · 13d0073c
      Robert Knight authored
      Currently only Chrome supports performing a structured clone of Errors.
      Implement a fallback so that we can get information about annotator-side
      errors in other browsers.
      
      Also improve handling if a non-Error value is passed to `sendError`.
      13d0073c
  2. 02 Dec, 2021 9 commits
  3. 01 Dec, 2021 5 commits
  4. 30 Nov, 2021 2 commits
  5. 29 Nov, 2021 21 commits