1. 07 Nov, 2022 10 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 3 commits
    • Robert Knight's avatar
      Update an outdated comment re. `documentInfoChanged` · 8cbc9978
      Robert Knight authored
      The sidebar now supports guests calling this RPC method multiple times,
      and they do so when a client-side navigation happens. See commit
      a8cff801.
      8cbc9978
    • Robert Knight's avatar
      Add EPUBContentSelector and PageSelector selectors to VS annotations · c304f1f4
      Robert Knight authored
      These will be used for various purposes described in the previous commit.
      EPUBContentSelector selectors are captured for all VS books.  PageSelector
      selectors are currently only captured for PDF-based books where we know the page
      numbers are "fixed" and should not change depending on viewer settings. We
      _might_ be able to capture them for EPUBs as well in future, though we need to
      understand more about how reliable/future-proof they are in that context.
      c304f1f4
    • Robert Knight's avatar
      Capture EPUBContentSelector and PageSelector selectors with VS annotations · b27e7140
      Robert Knight authored
      Add additional selector types to annotations on VitalSource books. These
      selectors will be used to:
      
       - Order annotations in the sidebar by location in the book, when
         sorting by location.
       - Group annotations under headings for the chapter, page or other
         segment in the sidebar
       - Determine which annotations can be anchored in the current chapter,
         so we don't incorrectly mark annotations for chapters other than the
         current one as orphans.
       - Trigger a navigation when the user clicks on an annotation in a
         chapter other than the one currently displayed
      b27e7140