- 31 Mar, 2022 1 commit
-
-
Lyza Danger Gardner authored
Add new service to notify ancestor frame on annotation activity, if so configured.
-
- 30 Mar, 2022 6 commits
-
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
Previously, this component was _styled_ as a "panel", via SASS mixins, but did not have any behavioral "panel-ness." For now, use the shared Card (presentational) component for this component, and remove unused SASS and mixins.
-
Robert Knight authored
-
Robert Knight authored
-
Robert Knight authored
-
Robert Knight authored
Listen for key events for keyboard shortcuts on the document element rather than body element, to make them work in XHTML documents. When no interactive element (eg. an input field) is focused in an HTML document, keyboard events are sent to the body element. In an XHTML document however keyboard events are sent to the document element instead in Safari and Chrome (in Firefox they are still sent to the body). The key event listeners used for the adder's shortcuts were installed on the body element, so they didn't work in XHTML documents in Safari and Chrome. My guess is that the reason for this behavioral quirk is that HTML documents are guaranteed to have a body element - an empty one will be generated if none is present in the markup, whereas XHTML documents are not. Fixes https://github.com/hypothesis/client/issues/4364
-
- 29 Mar, 2022 5 commits
-
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
Robert Knight authored
-
Robert Knight authored
Fix two issues found while testing HTML side-by-side mode with a BBC news article [1]: 1. When traversing the DOM tree to choose a scroll anchor, elements were skipped if their bounding rect (`element.getBoundingClientRect()`) did not intersect the viewport. This however did not account for content which overflows the element but is still visible to the user because it is not clipped. 2. The code used the intersection of the scroll root's bounding client rect and `(0, 0, window.innerWidth, window.innerHeight)` to get the viewport rect. In [1] the root element's bounding rect only covers the top (100vw, 100vh) pixels of the document, and most of the actual content of the page overflows that area. Resolve the issue by always using `(0, 0, window.innerWidth, window.innerHeight)` as the viewport, except when explicitly overridden (eg. in tests) [1] https://www.bbc.co.uk/news/world-europe-60693166
-
Lyza Danger Gardner authored
Convert AnnotationHeader and sub-components to use Tailwind utility classes. Lightly refactor props for AnnotationShareInfo for simplicity.
-
- 28 Mar, 2022 13 commits
-
-
Robert Knight authored
As noted in [1], much (most?) XHTML content on the web is actually served with the "text/html" mime type, including the existing documens in the dev server which declare themselves to be XHTML. However serving an XHTML document with the correct "application/xhtml+xml" mime type alters various browser behavior, so we need a page that tests this. [1] https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/XHTML#xhtml_document
-
Robert Knight authored
Safari does not support loading module scripts in XHTML pages that are served with the "application/xhtml" mime type [1]. This is very rare on the open web (XHTML is rare and XHTML documents served with "application/xhtml" as opposed to "text/html" as the MIME type are rarer still [2]) but more common in ebooks. This partly fixes https://github.com/hypothesis/client/issues/4350. [1] https://bugs.webkit.org/show_bug.cgi?id=227469 [2] https://developer.mozilla.org/en-US/docs/Web/Guide/HTML/XHTML#xhtml_document
-
Robert Knight authored
-
Robert Knight authored
-
Robert Knight authored
These were removed by the refactoring in the previous commit. The new implementation checks for both conflicting selector and action names.
-
Robert Knight authored
Move helper functions used only by `createStore` into `create-store.js` and test the functionality as part of the `createStore` tests rather than having direct tests for the helpers. This refactoring decouples the tests for `createStore` from implementation details. Having a single module for `createStore` and its tests should also make it easier for a new developer to grok it. - Move `createReducer` and `bindSelectors` from util.js into create-store.js and refactor `bindSelectors` - Remove dedicated tests for these helpers and instead test the functionality via tests for `createStore`. - Remove check for `namespace` property of modules, as the types for the `createStoreModule` function now enforce the presence of this property. - Remove checks for conflicting selectors. These will be re-added in a subsequent commit.
-
Lyza Danger Gardner authored
Add a new `RPCSettings` type to retain RPC-related settings in `SidebarSettings`. These are derived from values provided in `ConfigFromHost`. Refactor internals of `buildSettings` to have a less ambiguous flow and retain RPC settings. Part of https://github.com/hypothesis/lms/issues/3647
-
dependabot[bot] authored
Bumps [@sentry/browser](https://github.com/getsentry/sentry-javascript) from 6.18.2 to 6.19.2. - [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.18.2...6.19.2) --- updated-dependencies: - dependency-name: "@sentry/browser" dependency-type: direct:development update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [typescript](https://github.com/Microsoft/TypeScript) from 4.6.2 to 4.6.3. - [Release notes](https://github.com/Microsoft/TypeScript/releases) - [Commits](https://github.com/Microsoft/TypeScript/compare/v4.6.2...v4.6.3) --- updated-dependencies: - dependency-name: typescript dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [@rollup/plugin-commonjs](https://github.com/rollup/plugins/tree/HEAD/packages/commonjs) from 21.0.2 to 21.0.3. - [Release notes](https://github.com/rollup/plugins/releases) - [Changelog](https://github.com/rollup/plugins/blob/master/packages/commonjs/CHANGELOG.md) - [Commits](https://github.com/rollup/plugins/commits/commonjs-v21.0.3/packages/commonjs) --- updated-dependencies: - dependency-name: "@rollup/plugin-commonjs" dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
dependabot[bot] authored
Bumps [eslint](https://github.com/eslint/eslint) from 8.11.0 to 8.12.0. - [Release notes](https://github.com/eslint/eslint/releases) - [Changelog](https://github.com/eslint/eslint/blob/main/CHANGELOG.md) - [Commits](https://github.com/eslint/eslint/compare/v8.11.0...v8.12.0) --- updated-dependencies: - dependency-name: eslint 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.1096.0 to 2.1101.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.1096.0...v2.1101.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 [prettier](https://github.com/prettier/prettier) from 2.6.0 to 2.6.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.6.0...2.6.1) --- updated-dependencies: - dependency-name: prettier dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com>
-
- 25 Mar, 2022 2 commits
-
-
Lyza Danger Gardner authored
As foundational step for extending some configuration and settings objects, add some clarification to differentiate between "configuration" and "settings" in the sidebar, and rename the `fetch-config` module to `build-settings` to better reflect its responsibilities. Part of https://github.com/hypothesis/lms/issues/3647
-
Lyza Danger Gardner authored
-
- 24 Mar, 2022 3 commits
-
-
Robert Knight authored
Introduce a pattern for creating store modules which are fully typed, using the "activity" module as a test case / example. This allows TypeScript to check both external usage of the module, as well as internal consistency between the different elements of it (initial state, reducers, action creators, selectors). The elements of this pattern are: - A `State` type is defined in each module, which is typically whatever shape the module's initial state has. - Each function in the `reducers` map specifies the type of its `state` parameter as `State` and defines the fields of the action. - Action creators use a new `makeAction` helper, which ensures that the type of dispatched actions matches what the reducer expects - The `createStoreModule` helper ties all the elements of the module (reducers, actions, selectors) together and makes sure they are consistent with one another. The general structure of a typed store module, to which the various existing modules will converge, is: ```js import { createStoreModule, makeAction } from '../create-store'; const initialState = { ... } /** @typedef {typeof initialState} State */ const reducers = { /** * @param {State} state * @param {{ id: string }} action */ SOME_ACTION(state, action) { ... } } /** * @param {string} id */ function someAction(id) { return makeAction(reducers, 'SOME_ACTION', { id }); } /** * @param {State} */ function someSelector(state) { ... } export someModule = createStoreModule(initialState, { namespace: 'someModule', reducers, actionCreators: { someAction }, selectors: { someSelector }, }); ```
-
Robert Knight authored
Remove a cryptic piece of code that is no longer needed given the ability to specify default values for template arguments [1] [1] https://github.com/microsoft/TypeScript/pull/45483
-
Lyza Danger Gardner authored
-
- 23 Mar, 2022 6 commits
-
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
-
Lyza Danger Gardner authored
* `onSetPrivacy` => `onSetPrivate` * internal `onEditTags` takes `tags` instead of `{ tags }`
-
Lyza Danger Gardner authored
Update tests for the changes to props and callbacks in `AnnotationEditor` and `AnnotationPublishControl` There were some mis-nested tests for `AnnotationEditor`; fix.
-
Lyza Danger Gardner authored
Make `AnnotationPublishControl` more of a controlled component by pulling callbacks and state up to `AnnotationEditor`. Provide a `draft` prop from `Annotation` to `AnnotationEditor`.
-
Lyza Danger Gardner authored
-
- 22 Mar, 2022 2 commits
-
-
Robert Knight authored
This pattern makes it clearer that we are testing for a callback not being invoked after a sequence of events.
-
Robert Knight authored
Fix various issues that could cause the callback to `onDocumentReady` to fire after the subscription had been canceled. - `pollOnUnload` was called twice for the initial document, once at the top level of the function and once by the first call to `checkForDocumentChange`. This resulted into "unload" listeners being added for the same window. - The initial async `checkForDocumentChange` call would still fire if the subscription was immediately canceled - If the current window's "unload" event fired after the subscription was canceled, polling would be restarted, effectively re-subscribing to document changes.
-
- 21 Mar, 2022 2 commits
-
-
Robert Knight authored
-
Robert Knight authored
-