1. 07 Nov, 2022 3 commits
  2. 04 Nov, 2022 9 commits
  3. 03 Nov, 2022 2 commits
  4. 02 Nov, 2022 6 commits
    • Lyza Danger Gardner's avatar
      Update highlights CSS to prepare for clustered-highlight styling · 0cf562a1
      Lyza Danger Gardner authored
      Refactor `highlights.scss` to configure highlight style and subsequently apply styles. Add CSS variables for use for dynamic styling of highlight clusters.
      
      Update some comment wording in `gulpfile` for clarity.
      0cf562a1
    • Robert Knight's avatar
      Add a couple of notes in comments · f8f24706
      Robert Knight authored
      These address a couple of issues raised in code review.
      f8f24706
    • Robert Knight's avatar
      Compare annotation locations by CFI and text position · 1f6ea342
      Robert Knight authored
      For annotations on EPUBs, text position selectors can only be validly compared
      when they come from annotations made on the same EPUB Content Document. For
      annotations that come from different content documents, it is necessary to first
      compare the ordering of the content documents using CFIs, and then compare text
      positions.
      
      The use of `Number.POSITIVE_INFINITY` with replaced with
      `Number.MAX_SAFE_INTEGER` when handling annotations without positions, as
      `Math.sign(MAX_SAFE_INTEGER - MAX_SAFE_INTEGER)` is 0 (ie. treat two annotations
      with missing positions as having the same position), but
      `Math.sign(POSITIVE_INFINITY - POSITIVE_INFINITY)` is NaN.
      1f6ea342
    • Robert Knight's avatar
      Add additional tests and clarify string vs number step comparisons · 0b272c0b
      Robert Knight authored
      CFI steps that cannot be parsed as base-10 integers are invalid, but we try to
      fail gracefully in `compareCFIs` by using a string comparison.  This introduces
      a problem when one step is an integer and another is a string. Handle this by
      arbitrarily deciding that numbers sort before strings. We could have chosen
      other approaches as well.
      0b272c0b
    • Robert Knight's avatar
      Correct reference to starting point for CFI resolution · 815cef3c
      Robert Knight authored
      Per https://idpf.org/epub/linking/cfi/#sec-path-res, a CFI refers to a
      location within an EPUB's Package Document starting from the root
      `<package>` element, not the `<spine>`.
      815cef3c
    • Robert Knight's avatar
      Add functions for comparing CFIs and stripping assertions · 8d92de32
      Robert Knight authored
      When sorting EPUB annotations by document location, we will need to consider
      both the chapter/page and the text position within the chapter/page. Add
      utilities for comparing CFIs that will be useful for this purpose.
      
      The full sorting rules are specified by
      https://idpf.org/epub/linking/cfi/#sec-sorting. These utilities currently only
      implement the steps needed to compare simple CFIs which identify a location in
      the book's spine (eg. "/2/4/6"), rather than a "full" CFI which also contains a
      step indrection ("!") followed by the location of the selected content in the
      chapter.
      8d92de32
  5. 01 Nov, 2022 1 commit
    • Lyza Danger Gardner's avatar
      Add `$cluster` client property to annotation objects · 2d25a77e
      Lyza Danger Gardner authored
      This property is set when an annotation object is initialized in:
      
      * annotator: In `guest`, when a user creates a new annotation or highlight
        via the adder controls
      * sidebar: In the `annotations` store module when annotation objects are
        initialized before being added to the store
      
      This property is communicated between the sidebar and the annotator when
      exchanging annotation data. In the annotator, the value of this property
      is used to set an additional CSS class on drawn anchor highlights
      (`<hypothesis-highlight>` `span`s).
      
      The presence of this CSS class will allow subsequent differentiated styling
      for highlight clusters.
      2d25a77e
  6. 31 Oct, 2022 9 commits
  7. 28 Oct, 2022 9 commits
  8. 27 Oct, 2022 1 commit
    • Robert Knight's avatar
      Send frame identifier for guests as part of connection setup · d72c4b1d
      Robert Knight authored
      Guest frames pass an identifier for their associated browser frame to the
      sidebar. The sidebar in turn uses this identifier as a key to refer to different
      guests in various places. This identifier used to be sent as part of the
      `documentInfoChanged` message after a guest <-> sidebar connection is
      established, rather than as part of the initial connection metadata. As a result
      the sidebar had to invent a temporary ID for the new guest, which was used until
      it learned the real ID.
      
      This commit simplifies the picture by adding a `sourceId` attribute to frame
      connection setup messages. This replaces the `frameIdentifier` in the
      `documentInfoChanged` message, and allows the sidebar to know the final ID of
      the guest as soon as it connects.
      d72c4b1d