1. 26 Jan, 2021 10 commits
    • Kyle Keating's avatar
      Add svg-icon to frontend-shared package · a6b77079
      Kyle Keating authored
      - Add babel presets for frontend-shared to transpile js/jsx
      - Add `build` script to transpile frontend-shared and output sourcemaps and transpiled js code to /lib
      - Add frontend-shared /src/index.js as a way to serve as a root import location for the frontend-shared lib
      - Fix up frontend-shared/package.json so publishing will work as expecting and include only intended files
      - Add a browserify config in the frontend-shared package.json file so that driving client will be able to bundle it and still import svg and html files that are nested inside /frontend-shared/src
      - Add svg-icon to serve as the first shared js component
      - Move several .svg files into the lib that are relaxant for testing svg-icon that also seem share-worthy
      - Make modifications to ensure that typechecking, linting, and testing all work as expected and ignore /lib folder
      - Change karma config so that tests will automatically run on /frontend-shared, driven from the client's gulp command
      - Added new gulp tasks to help with building and linking the frontend-shared package so that is it fully transparent with existing tooling
      - Add gulp-babel and gulp-sourcemaps packages to help with build tasks for /frontend-shared that are necessary for symlinking / building the package
      - Used new SvgIcon sidebar/index.js as a tester. This requires making two copies of registerIcons while we make the transition. Replacing all call sites of SvgIcon would be too large for an already overwhelming commit
      a6b77079
    • Kyle Keating's avatar
      Add frontend-shared sub-package · dff5882f
      Kyle Keating authored
      - Add basic bare bones frontend-shared package as a sub-package, not a workspace since they can not be "public"
      - Move the mixin/focus.scss file into this package
      - Update scss @use dependencies to reference the new package (this will point to node_module/@hypothesis/frontend-shared/... location)
      dff5882f
    • Eduardo Sanz García's avatar
      Added shadow DOM example page · daf40260
      Eduardo Sanz García authored
      This page will allow us to investigate if it is possible to capture the
      selection event from outside the shadow DOM, and if so, how can we do
      it.
      daf40260
    • Lyza Danger Gardner's avatar
      Move `service-config` into `config` · d2c75c20
      Lyza Danger Gardner authored
      d2c75c20
    • Lyza Danger Gardner's avatar
      Move `host-config` to `config` · e4d696a0
      Lyza Danger Gardner authored
      e4d696a0
    • Lyza Danger Gardner's avatar
      Move `fetch-config` to `config` · 3bcb6981
      Lyza Danger Gardner authored
      3bcb6981
    • Lyza Danger Gardner's avatar
      Move `get-api-url` to `config` · 921bbff2
      Lyza Danger Gardner authored
      Also: update tests for modern syntax
      921bbff2
    • Robert Knight's avatar
      Fix `decayingInterval` mock returning wrong result type · 0f765928
      Robert Knight authored
      The real function returns a function. The mock returned a number. This
      happened not to cause a failure currently but it could break with future
      changes in Preact.
      0f765928
    • Robert Knight's avatar
      Fix incorrect use of `assert.isEmpty()` in UI tests · b0fa3aee
      Robert Knight authored
      `assert.isEmpty()` checks the size of an array, map or set or counts the
      number of keys on an object. It doesn't know how to check that an Enzyme
      wrapper produced no output. `assert.isEmpty(wrapper)` passes due to
      implementation details of the Enzyme wrapper - it behaves like an object
      with no properties. However it _always_ passes regardless of the number of
      nodes in the wrapper, which is not the intended behavior here.
      b0fa3aee
    • Robert Knight's avatar
      Change `style` prop from string to object. · eb354982
      Robert Knight authored
      String styles are a Preact-specific feature which is likely to go away in future.
      Pass an object instead.
      eb354982
  2. 25 Jan, 2021 9 commits
  3. 22 Jan, 2021 5 commits
    • Lyza Danger Gardner's avatar
      4a1d243a
    • Lyza Danger Gardner's avatar
      Extract things into top-level directory · fcf156df
      Lyza Danger Gardner authored
      Move a few modules from `util` to (for now) the top-level
      directory. These modules have multiple dependencies, or are
      otherwise application-specific, but don't fit comfortably in
      the `helpers` modules.
      fcf156df
    • Lyza Danger Gardner's avatar
      Remove unused utilities · 497659cc
      Lyza Danger Gardner authored
      497659cc
    • Lyza Danger Gardner's avatar
      Extract helpers from util · ebf18e52
      Lyza Danger Gardner authored
      Extract modules from the `util` directory that are specific to
      the application domain or have application dependencies
      ebf18e52
    • Eduardo Sanz García's avatar
      Use shadow DOM to encapsulate sidebar's style · 02c32fab
      Eduardo Sanz García authored
      A side effect of using shadow DOM for the sidebar is that the BucketBar
      'plugin' could not be injected easily using a current query mechanism.
      After consulting with @robertknight, we decided to avoid using the
      normal plugin injection mechanism and instead instantiate the BucketBar
      from the sidebar.
      
      This PR also includes:
      
      - a no documented configuration option to disable the shadow DOM
        encapsulation. This can be removed in the future if not needed.
      - more strict types
      - simplification of the logic in the sidebar
      
      I have tested these changes in the following browsers:
      
      Brower\OS    | MacOS              | Windows
      ------------ | ------------------ | -----------------
      Chrome 57    |  | 
      Chrome beta  |  | 
      Edge 17      |                    | 
      Edge beta    |  | 
      Firefox 53   |  | 
      Firefox beta |  | 
      Safari 10    |  |
      Safari 14    |  |
      02c32fab
  4. 21 Jan, 2021 5 commits
  5. 20 Jan, 2021 2 commits
    • Kyle Keating's avatar
      Improve Adder location for touch screen devices · cd6a1288
      Kyle Keating authored
      - Ensure that the adder location is always below the highlighted selection on a touch devices so that it does not compete with the copy/paste bar.
      - Add a little extra margin (10px) to the adder on touch devices to give room for the selection handles
      - Add helper method `isTouchDevice` for touch devices
      - Add comment in isSelectionBackwards to explain that iOS does not have the same selection object as non-iOS devices
      - Add 1 missing test coverage case in adder.js
      cd6a1288
    • Robert Knight's avatar
      Fix incorrect use of `hasClass` in `Button` test · d0001eaf
      Robert Knight authored
      The Enzyme `hasClass` method was being called on a non-DOM node by
      mistake. This didn't cause any problems, but it just meant that the test
      was not checking what it intended to check.
      d0001eaf
  6. 18 Jan, 2021 9 commits