1. 29 Nov, 2021 4 commits
    • Eduardo Sanz García's avatar
      Correct some oddities · 35a59b38
      Eduardo Sanz García authored
      * import only the `generateHexString` function
      * declare the `typdef` on one common JSDoc comment after the imports
      * remove unnecessary helper function
      35a59b38
    • Eduardo Sanz García's avatar
      Move `random.js` from `src/sidebar/util` to `src/shared` · 521127dd
      Eduardo Sanz García authored
      This file will be useful for components in `src/annotator` so it will be
      better to move it to common path for both the sidebar and annotator.
      521127dd
    • Robert Knight's avatar
      Use standard CSS reset in annotator bundle · e7cdcc0d
      Robert Knight authored
      Replace the scoped CSS reset in the annotator CSS bundle with the same
      un-scoped reset that the sidebar uses, as well as associated specificity
      hacks in other modules.
      
      The scoped reset was needed when the annotator CSS was loaded directly
      into the host page. It is no longer needed as annotator UI elements now always
      use Shadow DOM for style isolation from the host page.
      e7cdcc0d
    • Robert Knight's avatar
      Add shared module for config fragment generation and parsing · d017358b
      Robert Knight authored
      The logic for generating the `#config=<URI-encoded JSON blob>` fragment,
      that is used to pass configuration from the annotator to the sidebar
      application, was duplicated in several places in the code.
      
      Add a shared module in `shared/config-fragment.js` with functions for
      adding configuration to and extracting it from the URL.
      d017358b
  2. 26 Nov, 2021 11 commits
  3. 25 Nov, 2021 9 commits
  4. 24 Nov, 2021 3 commits
    • Robert Knight's avatar
      Revise `PortProvider._channels` data structure · 82541f3a
      Robert Knight authored
      The `PortProvider._channels` map was used only to keep track of which
      channel requests have been handled for a particular frame. The
      `WeakMap<Window, MessageChannel>` was in fact used as a set rather than
      a map. Only the presence of entries affected behavior, not the stored
      MessageChannel values.
      
      Change the data structure and comments to make its purpose clearer.
      82541f3a
    • Robert Knight's avatar
      Remove a misplaced comment · 20567b07
      Robert Knight authored
      This comment provides general information about how MessagePorts work,
      but isn't directly related to any of the surrounding code.
      
      Of the two comments here, the second one is the most useful information
      to consumers of the PortProvider and PortFinder interfaces, but it is
      well covered by eg. MDN's documentation on MessagePort.
      20567b07
    • Robert Knight's avatar
      Streamline code for responding to port requests · 625bdb9d
      Robert Knight authored
      Rework the code to make the code path for the sidebar-host channel more
      similar to other channels. As a result the `_sendPorts` helper was only
      called in one place and can be inlined where it is called to make the
      overall logic easier to follow.
      625bdb9d
  5. 23 Nov, 2021 13 commits