@internetarchive/collection-browser 3.5.2-alpha-webdev8160.0 → 3.5.2-alpha-webdev8093.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/app-root.js +606 -606
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.js +764 -764
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.js +140 -140
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +23 -23
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +1 -0
- package/dist/src/collection-facets/more-facets-content.js +126 -127
- package/dist/src/collection-facets/more-facets-content.js.map +1 -1
- package/dist/src/collection-facets.js +267 -267
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/data-source/collection-browser-query-state.js.map +1 -1
- package/dist/src/data-source/models.js.map +1 -1
- package/dist/src/models.d.ts +0 -4
- package/dist/src/models.js +0 -8
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/tiles/grid/collection-tile.js +77 -77
- package/dist/src/tiles/grid/collection-tile.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +137 -137
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +8 -0
- package/dist/src/tiles/hover/hover-pane-controller.js +13 -1
- package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
- package/dist/src/tiles/models.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +215 -215
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/test/collection-browser.test.js +189 -189
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +28 -28
- package/dist/test/collection-facets/more-facets-content.test.js.map +1 -1
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- package/package.json +1 -1
- package/src/app-root.ts +1140 -1140
- package/src/collection-browser.ts +3075 -3075
- package/src/collection-facets/facet-row.ts +299 -299
- package/src/collection-facets/facets-template.ts +83 -83
- package/src/collection-facets/more-facets-content.ts +642 -644
- package/src/collection-facets.ts +1010 -1010
- package/src/data-source/collection-browser-data-source-interface.ts +345 -345
- package/src/data-source/collection-browser-data-source.ts +1441 -1441
- package/src/data-source/collection-browser-query-state.ts +59 -59
- package/src/data-source/models.ts +56 -56
- package/src/models.ts +0 -9
- package/src/restoration-state-handler.ts +546 -546
- package/src/tiles/grid/collection-tile.ts +163 -163
- package/src/tiles/grid/item-tile.ts +340 -340
- package/src/tiles/hover/hover-pane-controller.ts +15 -1
- package/src/tiles/models.ts +1 -1
- package/src/tiles/tile-dispatcher.ts +517 -517
- package/test/collection-browser.test.ts +2413 -2413
- package/test/collection-facets/more-facets-content.test.ts +231 -231
- package/test/restoration-state-handler.test.ts +480 -480
- package/vite.config.ts +29 -29
|
@@ -157,6 +157,14 @@ export class HoverPaneController implements HoverPaneControllerInterface {
|
|
|
157
157
|
/** A record of the last mouse position on the host element, for positioning the hover pane */
|
|
158
158
|
private lastPointerClientPos = { x: 0, y: 0 };
|
|
159
159
|
|
|
160
|
+
/**
|
|
161
|
+
* A flag to track whether the host element is being clicked by a pointer device, so that we
|
|
162
|
+
* don't trigger unnecessary keyboard focus behaviors on click. This is needed, e.g., to prevent
|
|
163
|
+
* the hover pane from appearing immediately at its `host` positioning on click, which can
|
|
164
|
+
* obstruct the host element itself (due to the ordering of events fired).
|
|
165
|
+
*/
|
|
166
|
+
private clicking = false;
|
|
167
|
+
|
|
160
168
|
constructor(
|
|
161
169
|
/** The host element to which this controller should attach listeners */
|
|
162
170
|
private readonly host: ReactiveControllerHost &
|
|
@@ -352,6 +360,7 @@ export class HoverPaneController implements HoverPaneControllerInterface {
|
|
|
352
360
|
// keyboard navigation listeners
|
|
353
361
|
this.host.addEventListener('focus', this.handleFocus);
|
|
354
362
|
this.host.addEventListener('blur', this.handleBlur);
|
|
363
|
+
this.host.addEventListener('pointerdown', this.handlePointerDown);
|
|
355
364
|
this.host.addEventListener('keyup', this.handleKeyUp);
|
|
356
365
|
this.host.addEventListener('keydown', this.handleKeyDown);
|
|
357
366
|
|
|
@@ -391,11 +400,12 @@ export class HoverPaneController implements HoverPaneControllerInterface {
|
|
|
391
400
|
}
|
|
392
401
|
|
|
393
402
|
private handleFocus = (): void => {
|
|
394
|
-
if (this.hoverPaneState === 'hidden') {
|
|
403
|
+
if (!this.clicking && this.hoverPaneState === 'hidden') {
|
|
395
404
|
this.showHoverPane({
|
|
396
405
|
anchor: 'host',
|
|
397
406
|
});
|
|
398
407
|
}
|
|
408
|
+
this.clicking = false;
|
|
399
409
|
};
|
|
400
410
|
|
|
401
411
|
private handleBlur = (): void => {
|
|
@@ -404,6 +414,10 @@ export class HoverPaneController implements HoverPaneControllerInterface {
|
|
|
404
414
|
}
|
|
405
415
|
};
|
|
406
416
|
|
|
417
|
+
private handlePointerDown = (): void => {
|
|
418
|
+
this.clicking = true;
|
|
419
|
+
};
|
|
420
|
+
|
|
407
421
|
private handleKeyDown = (e: KeyboardEvent): void => {
|
|
408
422
|
if (
|
|
409
423
|
(e.key === 'ArrowDown' || e.key === 'ArrowUp') &&
|
package/src/tiles/models.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export type SimpleLayoutType = 'none' | 'stats-only' | 'snippets-only';
|
|
1
|
+
export type SimpleLayoutType = 'none' | 'stats-only' | 'snippets-only';
|