- 27 Sep, 2021 3 commits
-
-
dependabot[bot] authored
Bumps [core-js](https://github.com/zloirock/core-js) from 3.18.0 to 3.18.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/compare/v3.18.0...v3.18.1) --- updated-dependencies: - dependency-name: core-js dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.25.3 to 7.26.0. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.25.3...v7.26.0) --- updated-dependencies: - dependency-name: eslint-plugin-react dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [postcss](https://github.com/postcss/postcss) from 8.3.6 to 8.3.8. - [Release notes](https://github.com/postcss/postcss/releases) - [Changelog](https://github.com/postcss/postcss/blob/main/CHANGELOG.md) - [Commits](https://github.com/postcss/postcss/compare/8.3.6...8.3.8) --- updated-dependencies: - dependency-name: postcss dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
- 22 Sep, 2021 4 commits
-
-
Eduardo Sanz García authored
-
Eduardo Sanz García authored
I used these commands (Mac version): ``` % ag -0 -l '@.+Object' | xargs -0 sed -ri '' -e '/@/s/(.*{.*)Object(.*})/\1object\2/' % ag -0 -l '@.+object\.' | xargs -0 sed -ri '' -e '/@/s/object\.</Record</' % ag -0 -l '@.+object<' | xargs -0 sed -ri '' -e '/@/s/object</Record</' ```
-
-
dependabot[bot] authored
Bumps [prettier](https://github.com/prettier/prettier) from 2.4.0 to 2.4.1. - [Release notes](https://github.com/prettier/prettier/releases) - [Changelog](https://github.com/prettier/prettier/blob/main/CHANGELOG.md) - [Commits](https://github.com/prettier/prettier/compare/2.4.0...2.4.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
- 20 Sep, 2021 7 commits
-
-
dependabot[bot] authored
Bumps [core-js](https://github.com/zloirock/core-js) from 3.17.3 to 3.18.0. - [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/compare/v3.17.3...v3.18.0) --- updated-dependencies: - dependency-name: core-js dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [eslint-plugin-react](https://github.com/yannickcr/eslint-plugin-react) from 7.25.1 to 7.25.3. - [Release notes](https://github.com/yannickcr/eslint-plugin-react/releases) - [Changelog](https://github.com/yannickcr/eslint-plugin-react/blob/master/CHANGELOG.md) - [Commits](https://github.com/yannickcr/eslint-plugin-react/compare/v7.25.1...v7.25.3) --- updated-dependencies: - dependency-name: eslint-plugin-react dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@hypothesis/frontend-shared](https://github.com/hypothesis/frontend-shared) from 3.9.0 to 3.10.0. - [Release notes](https://github.com/hypothesis/frontend-shared/releases) - [Changelog](https://github.com/hypothesis/frontend-shared/blob/main/CHANGELOG.md) - [Commits](https://github.com/hypothesis/frontend-shared/compare/v3.9.0...v3.10.0) --- updated-dependencies: - dependency-name: "@hypothesis/frontend-shared" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [dompurify](https://github.com/cure53/DOMPurify) from 2.3.1 to 2.3.2. - [Release notes](https://github.com/cure53/DOMPurify/releases) - [Commits](https://github.com/cure53/DOMPurify/compare/2.3.1...2.3.2) --- updated-dependencies: - dependency-name: dompurify dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [terser](https://github.com/terser/terser) from 5.7.2 to 5.8.0. - [Release notes](https://github.com/terser/terser/releases) - [Changelog](https://github.com/terser/terser/blob/master/CHANGELOG.md) - [Commits](https://github.com/terser/terser/compare/v5.7.2...v5.8.0) --- updated-dependencies: - dependency-name: terser dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.987.0 to 2.991.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.987.0...v2.991.0) --- updated-dependencies: - dependency-name: aws-sdk dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [sass](https://github.com/sass/dart-sass) from 1.39.2 to 1.41.1. - [Release notes](https://github.com/sass/dart-sass/releases) - [Changelog](https://github.com/sass/dart-sass/blob/main/CHANGELOG.md) - [Commits](https://github.com/sass/dart-sass/compare/1.39.2...1.41.1) --- updated-dependencies: - dependency-name: sass dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
- 16 Sep, 2021 3 commits
-
-
Eduardo authored
* check that the iframe's `src` element is not 'about:blank'. * use EventTarget class and fake DOM element for tests * fix typos
-
Eduardo Sanz García authored
I removed the `/* istanbul ignore test */` and created a facade to emulate and iframe for testing.
-
Eduardo Sanz García authored
In certain situations, the logic to check when the iframe's document is ready didn't work as expected. The reason for that is that browsers create an initial blank document before the actual document loads. This blank document has a `readyState` of 'complete' in Safari and Chrome and of 'uninitialized' in Firefox. This blank document can be mistaken by the final document. I was able to reproduce a situation where the Hypothesis client was injected into the blank document. Then, the blank document was replaced by the actual document and the Hypothesis client was not not longer embedded. In addition, this commit: * renames `frame` to `iframe` (only in the test) * renames `_handledFrames` to _annotatableFrames` * removes `isAccessible` (no longer neede)
-
- 15 Sep, 2021 5 commits
-
-
Robert Knight authored
Add commas for readability Co-authored-by: Lyza Gardner <439947+lyzadanger@users.noreply.github.com>
-
Robert Knight authored
When the sidebar is closed or there is not enough room to show the sidebar alongside the PDF content, reserve space for the sidebar's toolbar and bucket bar. This fixes an issue where the sidebar's controls would overlap the document's scrollbar, making scrolling the PDF less convenient, especially in long documents. This also removes the need for some CSS overrides that reposition elements in PDF.js's toolbar. By ensuring that the `<body>` does not overlap the sidebar controls, the PDF.js toolbar which is contained within the body doesn't either. Fixes #3759
-
Robert Knight authored
This is no longer needed after the `Record<K, V>` => `Map<K, V>` change.
-
Robert Knight authored
I expected TypeScript to generate an error for this obvious mistake, but it seems that this only happens if `noImplicitAny` is enabled.
-
Robert Knight authored
Using maps is a little faster and avoids the need for `hasOwnProperty` checks. The quote position cache has been converted to a single level map as this is more ergonomic to work with and the second level maps almost always had exactly one entry in them.
-
- 14 Sep, 2021 10 commits
-
-
Robert Knight authored
When the same text is highlighted multiple times in a PDF, it could be hard to distinguish focused highlights as the `<rect>`s for focused highlights could be obscured by `<rect>`s for overlapping unfocused highlights. SVG elements are painted in the order they appear in the document and don't yet support a z-index property [1], so this commit fixes the issue by moving `<rect>`s to be last amongst siblings when focused. [1] The SVG 2 spec does support a z-index attribute, but none of the major browsers support it yet. See https://bugs.webkit.org/show_bug.cgi?id=90738, https://bugs.chromium.org/p/chromium/issues/detail?id=670177 and https://bugzilla.mozilla.org/show_bug.cgi?id=360148.
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
The general pattern for an input next to an icon-only button has been added to the pattern library in the frontend-shared package and is implemented by the TextInputWithButton component. We don't need custom treatment in this project anymore.
-
Lyza Danger Gardner authored
Use `classes` to extend, not obliterate, component styles, obviating the need to use complex mixins.
-
Lyza Danger Gardner authored
Use `classes` to extend, not obliterate, component styles and obviate the need for complex mixins.
-
Lyza Danger Gardner authored
Use `classes` to extend, not obliterate, components styles and obviate the need to use complex mixins.
-
Lyza Danger Gardner authored
Use `classes` to extend, not obliterate, component styles, and obviate the need to use complex mixins.
-
Robert Knight authored
-
Robert Knight authored
This is functionally the same, just a little cleaner.
-
Robert Knight authored
The rendering of SVG highlights in PDFs triggered an excessive number of style recalculations and forced reflows due to interleaving DOM changes with DOM API calls that require current layout information. This commit makes several changes to reduce reflows: 1. Create all the `<hypothesis-highlight>` elements in the text layer before creating any of the associated SVG elements. This avoids interleaving creating `<hypothesis-highlight>` elements with measuring them in order to position the associated SVG `<rect>`. 2. Change `drawHighlightsAbovePdfCanvas` to accept a list of highlight elements instead of a single element. By assuming all highlights for a single annotation are on the same page, we can avoid some repeated work and add all the `<rect>` elements to the parent `<svg>` in one batch. These changes only reduce the thrash when creating highlights for a single annotation. To eliminate the remaining thrash we'd need to use a combination of optimizing DOM updates across multiple `highlightRange` calls and/or reducing the work for PDF pages which are rendered but not visible on-screen.
-
- 13 Sep, 2021 8 commits
-
-
Robert Knight authored
Combine two separate if blocks into one.
-
Robert Knight authored
-
Robert Knight authored
See https://esbench.com/bench/613f1ca06c89f600a570114b for some related benchmarks.
-
Robert Knight authored
To reduce the chances of mis-anchoring quotes, check for a context match before stopping early. This helps when the quote is a word or phrase that is common in the document and the position hint is wrong, which can occur if the quote selector was created when using a different PDF viewer or version of PDF.js, which exacts text differently. For quotes captured at the start or end of a page we expect a mismatch in the prefix and suffix respectively because quote selectors can currently capture parts of the surrounding pages / DOM in `describe`, but when anchoring we only search for matches in one page of text at a time.
-
Robert Knight authored
We have a basic test of quote matching from the perspective of the `anchor` caller, but we really need to check the data passed to the quote matching logic in more detail.
-
Robert Knight authored
As described in #3705, stopping a quote search as soon as we find an approximate match could result in quotes anchoring to suboptimal matches if the position selector is no longer accurate. We want to balance finding the best match against making the search efficient in long documents. The approach taken in this commit is to continue to search pages in priority order, but instead of returning the first "good enough" match (below `matchQuote`'s error threshold), return the first exact match ignoring whitespace differences, or the nearest match in the whole document otherwise. We ignore whitespace differences because this is the main change between the current version of PDF.js that we include in Hypothesis products, and newer versions that we are trying to migrate to (see #3687). It is also likely to be the main source of text differences between PDF.js and other viewers. - Change `anchorQuote` to ignore whitespace differences when searching for approximate matches - Change `anchorQuote` to keep searching for the best match if it does not find a whitespace-insensitive exact match in the current page - Add tests for whitespace changes Fixes https://github.com/hypothesis/client/issues/3705
-
Robert Knight authored
Add tests to cover the cases where the position is on a page before the quote and where the position is negative.
-
Robert Knight authored
Refactor quote anchoring logic to use async/await instead of Promise chains to make control flow easier to follow and change. - Convert `getPageOffset` and `findPage` helper functions to use async/await rather than Promise chains. - Combine the `prioritizePages` and `findInPages` functions into a single `anchorQuote` function. Combining the two functions allows some redundant work to be eliminated. `findInPages` used to call `getPageOffset` for the current page on each iteration which would in turn fetch the text of every page until it reached the given offset. `prioritizePages` would do a very similar loop in order to enumerate pages close to the given offset. - Replace use of `TextQuoteAnchor.fromSelector` with direct use of `matchQuote`. `fromSelector` wasn't providing any value over just calling `matchQuote` directly, and it required a dummy DOM element to be created and have its text populated.
-