- 05 Mar, 2021 3 commits
-
-
Robert Knight authored
The sidebar is not the only other frame that may be interested in new annotations. The notebook is too.
-
Robert Knight authored
- Extract the repeated logic for checking the data passed to the event's callback into a `createCallback` helper - Add separate tests for HTML and PDF documents - Add test for the error path when getting the URL of a PDF fails
-
Robert Knight authored
Replace the "plugin" functionality in the Guest that indirectly instantiates the `DocumentMeta`, `PDF` and `CrossFrame` classes with direct instantiation of those classes. The annotator part of the Hypothesis client is no longer a pluggable toolbox which can be arbitrarily extended by user-provided plugins. Removing the "plugins" logic and replacing it with direct construction of the necessary classes removes a lot of indirection that made the code harder to follow and also makes it easier for TypeScript to statically check the code. It will also enable the `config` object that is passed to `Guest` to be paired down to just the fields that are actually needed and properly typed. In future we will need some kind of plugin/integration facility to support different document viewers. For we will build a more specific document type integration facility when the time comes. - Remove `this.plugins` field from `Guest` class and `pluginClasses` config and replace with direct construction of `PDFIntegration`, `DocumentMeta` and `CrossFrame` classes - Update the `AnchoringImpl` typedef to correctly reflect that some anchoring implementations (HTML) have a synchronous `describe` method - Remove unnecessary `config` argument to `PDF` constructor - Replace the `PDF: {}` content in the guest config with `documentType: 'pdf'` as a more obvious way for the annotator entry point to configure which document viewer integration is loaded. In future we can generalize this to support different types of viewer integration.
-
- 03 Mar, 2021 13 commits
-
-
Eduardo Sanz García authored
-
Eduardo Sanz García authored
This PR prevents scrolling of the body of the host when the notebook is opened. Reported [here](https://github.com/hypothesis/client/pull/3024#pullrequestreview-592240569). This solution doesn't work for iOS < 13.
-
Eduardo Sanz García authored
- made the button stick on the top without taking space from the notebook. I re-enabled the original padding of the notebook. - fixed an issue with window resizing that caused the notebook to disappear. - on touch devices closing the notebook, closed the sidebar too.
-
Eduardo Sanz García authored
The sidebar component directs the opening of the notebook. This is for two reasons: * it's a little bit easier to save the UI state of the current sidebar (immediately before the notebook is opened), in case in the future we want to restored it. * to avoid adding additional events, like `show/hideSidebarControls`, that probably would be needed for granular control of the sidebar, in case the notebook would be directing the process of closing/re-opening the sidebar.
-
Eduardo Sanz García authored
Because I am planning to introduce another method to hide the controls, I renamed the hide/show methods in the sidebar and notebook components to open/close. I also feel it describes better the visual outcome. For consistency, I renamed the show/hideNotebook to open/closeNotebook.
-
Robert Knight authored
Render the bucket bar immediately using the Guest's current set of anchors when it is constructed. This resolves an issue introduced in 68d44395 that the background of the bucket bar did not appear until after the first batch of annotations had been fetched from the API and synced from the sidebar to the annotator. It also ensures that buckets are drawn for any anchors that already exist in the Guest when the BucketBar is initialized.
-
Robert Knight authored
- Move `annotator-bucket-bar-width` variable down into the one file that uses it - Remove unused `annotator-bucket-bar-line-height` variable
-
Robert Knight authored
Rename CSS classes used by the bucket bar to match the `Buckets` component name and move the corresponding styles into src/styles/annotator/components/Buckets.scss. As was recently done with the sidebar's vertical toolbar, the styles on the bucket bar container were moved to an element rendered by the `Buckets` component itself, so that there is a 1:1 association between JS modules and SASS modules for the bucket bar.
-
dependabot[bot] authored
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.13.8 to 7.13.9. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.9/packages/babel-preset-env) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.853.0 to 2.854.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.853.0...v2.854.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.3.0 to 18.3.1. - [Release notes](https://github.com/octokit/rest.js/releases) - [Commits](https://github.com/octokit/rest.js/compare/v18.3.0...v18.3.1) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 6.2.0 to 6.2.1. - [Release notes](https://github.com/getsentry/sentry-javascript/releases) - [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md) - [Commits](https://github.com/getsentry/sentry-javascript/compare/6.2.0...6.2.1) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [chai](https://github.com/chaijs/chai) from 4.3.0 to 4.3.1. - [Release notes](https://github.com/chaijs/chai/releases) - [Changelog](https://github.com/chaijs/chai/blob/main/History.md) - [Commits](https://github.com/chaijs/chai/compare/4.3.0...4.3.1) Signed-off-by: dependabot[bot] <support@github.com>
-
- 02 Mar, 2021 6 commits
-
-
Kyle Keating authored
-
Kyle Keating authored
- Remove github actions related to frontend-shared - Remove scripts and gulp commands related to frontend-shared - frontend-shared is now managed from its own repository.
-
Kyle Keating authored
There was a version issue between the current installed version 1.4.0 and the local copy being using in the subfolder (/frontend-shared). The newest shared package exports an _index.scss file which is required by the client, but it was not formally importing a version of the shared package which exported the _index.scss file. The client now imports 1.9.0 which has _index.scss and now the frontend-shared folder can be fully removed from the client. TL;DR, This is just more reason to move the shared package to its own repo because this issue was being masked.
-
Robert Knight authored
Fix a regression introduced in b52f00e0 where clicking in a PDF when side-by-side is active would cause the sidebar to close instead of remaining open. That PR made `PdfSidebar` no longer inherit (indirectly) from Guest but did not update the references to the `closeSidebarOnDocumentClick` property of the Guest.
-
Robert Knight authored
This handler sets the `document` property of new annotations to metadata extracted from `<meta>` and `<link>` tags on the page. It is unnecessary however because the `Guest` class sets this property using either `DocumentMeta.metadata` or `PDF.getMetadata`, depending on the document type, before it emits the `beforeAnnotationCreated` event. In PDFs this code is a serious hazard because if the `beforeAnnotationCreated` event subscriber in `DocumentMeta` runs before `AnnotationSync`'s corresponding event handler then DocumentMeta will overwrite the PDF document-specific annotation metadata with generic HTML document metadata - losing the critical `documentFingerprint` property. Fortunately this problem did not occur because the `Guest` constructor instantiates the `AnnotationSync` class before the `DocumentMeta` class. Consequently AnnotationSync's `beforeAnnotationCreated` event handler runs before DocumentMeta's and pushes new annotations to the sidebar with the correct document metadata before `DocumentMeta` overwrites it.
-
Kyle Keating authored
The ThreadList component has a required felid `threads` but its value was undefined in tests. The value comes from the mocked version of `useRootThread.children`
-
- 01 Mar, 2021 16 commits
-
-
Robert Knight authored
The recent refactor to change the relationship between the `Guest` and `Sidebar` classes broke PDF.js integration because the `PdfSidebar` class is no longer able to modify the config that is passed to the `Guest` class. Previously it would pass `PDF: {}` in the config to the `super()` call which would then result in the `Guest` class loading the PDF integration. This now has to be done in the `index.js` module. We already had to do this previously for ebooks. Now it has to be done for all scenarios.
-
Eduardo Sanz García authored
If `make sure` or `make checkformatting` are the first command that are run after version update that included prettier, the commands will use the previous version of prettier.
-
Eduardo Sanz García authored
With the recent changes in the gulp test command (#2989), everything that could be achieved by `make servetest` can be done by options to the `make test` target.
-
Eduardo Sanz García authored
Removed @ts-ignore
-
dependabot[bot] authored
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.1.5 to 4.2.2. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.1.5...v4.2.2) Signed-off-by: dependabot[bot] <support@github.com>
-
Robert Knight authored
The `guest` argument is required but the `config` argument is now optional. Swap them so that required arguments come before optional ones and set a default value for `config`.
-
Robert Knight authored
Change the relationship between the `Guest` and `Sidebar` classes from one of inheritance to one where `Sidebar` receives a reference to the `Guest` instance and calls methods on it or subscribes to events from it. The `Guest` also no longer "owns" references to the bucket bar / toolbar objects that logically belong to the sidebar. Instead it emits events which the sidebar responds to. This change makes the interface of the `Guest` used by the `Sidebar` more explicit and ensures a better boundary between the two. This also makes it easier for the `Sidebar` tests to be concerned only with the interface of the `Guest` and not its implementation details. In future this change will also make it possible to have a frame which does not contain a sidebar but is not annotateable. We had a need for this historically when integrating with epub viewers, although it was never implemented. Updating the tests for `PdfSidebar` was complicated by the fact that the `PdfSidebar` tests are not pure unit tests. They instantiate the `Sidebar` base class and so depend on many implementation details of it. To make this change and others easier, the `PdfSidebar` tests have been changed to mock the `Sidebar` base class. The steps involved in this are non-obvious so I extracted the logic into a utility function. - Change `Sidebar` to no longer inherit `Guest` but accept it as a constructor argument - Remove direct references to the `BucketBar` and `ToolbarController` instances from the `Guest` class and instead emit events from the `Guest` which the `Sidebar` responds to. - Add a `mockBaseClass` testing helper in `src/test-util/mock-base.js` and change the `PdfSidebar` tests to use it, so that they are less coupled to `Sidebar` implementation details.
-
dependabot[bot] authored
Bumps [@babel/core](https://github.com/babel/babel/tree/HEAD/packages/babel-core) from 7.12.17 to 7.13.8. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.8/packages/babel-core) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.848.0 to 2.853.0. - [Release notes](https://github.com/aws/aws-sdk-js/releases) - [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/aws/aws-sdk-js/compare/v2.848.0...v2.853.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@babel/preset-env](https://github.com/babel/babel/tree/HEAD/packages/babel-preset-env) from 7.12.17 to 7.13.8. - [Release notes](https://github.com/babel/babel/releases) - [Changelog](https://github.com/babel/babel/blob/main/CHANGELOG.md) - [Commits](https://github.com/babel/babel/commits/v7.13.8/packages/babel-preset-env) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [eslint](https://github.com/eslint/eslint) from 7.20.0 to 7.21.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/master/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v7.20.0...v7.21.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [core-js](https://github.com/zloirock/core-js/tree/HEAD/packages/core-js) from 3.9.0 to 3.9.1. - [Release notes](https://github.com/zloirock/core-js/releases) - [Changelog](https://github.com/zloirock/core-js/blob/master/CHANGELOG.md) - [Commits](https://github.com/zloirock/core-js/commits/v3.9.1/packages/core-js) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [puppeteer](https://github.com/puppeteer/puppeteer) from 7.1.0 to 8.0.0. - [Release notes](https://github.com/puppeteer/puppeteer/releases) - [Changelog](https://github.com/puppeteer/puppeteer/blob/main/CHANGELOG.md) - [Commits](https://github.com/puppeteer/puppeteer/compare/v7.1.0...v8.0.0) Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@octokit/rest](https://github.com/octokit/rest.js) from 18.2.0 to 18.3.0. - [Release notes](https://github.com/octokit/rest.js/releases) - [Commits](https://github.com/octokit/rest.js/compare/v18.2.0...v18.3.0) Signed-off-by: dependabot[bot] <support@github.com>
-
Eduardo Sanz García authored
The purpose of this PR is to be able to easily run karma tests in other browsers without manually editing the karma configuration or making local copies of the karma configuration. Additions: - `yarn test --no-browser` to avoid launching the default browser. It is up to the developer to run the tests in whatever browser she/he chooses by navigating to http://localhost:9876/. - `yarn test --browser <browser>` run the tests in a different browser/s instead of the default browser. Chrome launcher comes by default with karma. Firefox, Safari and others can be installed independently. Modifications: - `yarn gulp test-watch` has been substituted by `yarn test --watch` for consistency.
-
Robert Knight authored
The `disableShadowSidebar` flag and the corresponding behavior no longer exists.
-
- 26 Feb, 2021 2 commits
-
-
Robert Knight authored
The `ToolbarController#getWidth` method started incorrectly returning 0 after 243c06d3. This commit moved the content of the toolbar to a child of `ToolbarController._container` and the `getWidth` method was not updated accordingly. The incorrect result of `this.toolbar.getWidth()` in `Sidebar` later resulted in an incorrect calculation of the sidebar's width and caused `PdfSidebar` to think that the window was too narrow to support side-by-side mode. Fix the problem by updating `ToolbarController#getWidth` so that it returns the correct value again.
-
Lyza Danger Gardner authored
-