@internetarchive/collection-browser 4.4.0 → 4.5.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/index.d.ts +1 -0
- package/dist/index.js.map +1 -1
- package/dist/src/app-root.d.ts +8 -0
- package/dist/src/app-root.js +26 -0
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +8 -0
- package/dist/src/collection-browser.js +19 -1
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-row.d.ts +6 -0
- package/dist/src/collection-facets/facet-row.js +158 -140
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +25 -23
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/styles/tile-action-styles.d.ts +14 -0
- package/dist/src/styles/tile-action-styles.js +59 -0
- package/dist/src/styles/tile-action-styles.js.map +1 -0
- package/dist/src/tiles/base-tile-component.d.ts +17 -1
- package/dist/src/tiles/base-tile-component.js +50 -1
- package/dist/src/tiles/base-tile-component.js.map +1 -1
- package/dist/src/tiles/grid/item-tile.js +139 -138
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/item-image.js +28 -28
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js +71 -46
- package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact.d.ts +1 -1
- package/dist/src/tiles/list/tile-list-compact.js +138 -100
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +1 -1
- package/dist/src/tiles/list/tile-list.js +316 -298
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/models.d.ts +11 -0
- package/dist/src/tiles/models.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.d.ts +14 -0
- package/dist/src/tiles/tile-dispatcher.js +319 -216
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.js +2 -1
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +55 -23
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +79 -79
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +136 -136
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +101 -87
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/index.ts +29 -28
- package/package.json +2 -2
- package/src/app-root.ts +30 -0
- package/src/collection-browser.ts +16 -1
- package/src/collection-facets/facet-row.ts +309 -299
- package/src/collection-facets/facets-template.ts +85 -83
- package/src/data-source/collection-browser-data-source.ts +1465 -1465
- package/src/styles/tile-action-styles.ts +59 -0
- package/src/tiles/base-tile-component.ts +124 -65
- package/src/tiles/grid/item-tile.ts +347 -346
- package/src/tiles/item-image.ts +214 -214
- package/src/tiles/list/tile-list-compact-header.ts +112 -86
- package/src/tiles/list/tile-list-compact.ts +278 -239
- package/src/tiles/list/tile-list.ts +718 -700
- package/src/tiles/models.ts +21 -8
- package/src/tiles/tile-dispatcher.ts +637 -527
- package/src/tiles/tile-display-value-provider.ts +133 -134
- package/test/collection-facets/facet-row.test.ts +421 -375
- package/test/tiles/grid/item-tile.test.ts +520 -520
- package/test/tiles/list/tile-list.test.ts +576 -576
- package/test/tiles/tile-dispatcher.test.ts +320 -300
package/index.ts
CHANGED
|
@@ -1,28 +1,29 @@
|
|
|
1
|
-
export { CollectionBrowser } from './src/collection-browser';
|
|
2
|
-
export { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';
|
|
3
|
-
export { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';
|
|
4
|
-
export { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';
|
|
5
|
-
export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';
|
|
6
|
-
export {
|
|
7
|
-
CollectionDisplayMode,
|
|
8
|
-
SortField,
|
|
9
|
-
TileModel,
|
|
10
|
-
FacetOption,
|
|
11
|
-
SelectedFacets,
|
|
12
|
-
getDefaultSelectedFacets,
|
|
13
|
-
} from './src/models';
|
|
14
|
-
export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';
|
|
15
|
-
export { CollectionTile } from './src/tiles/grid/collection-tile';
|
|
16
|
-
export { AccountTile } from './src/tiles/grid/account-tile';
|
|
17
|
-
export { ItemTile } from './src/tiles/grid/item-tile';
|
|
18
|
-
export { TileList } from './src/tiles/list/tile-list';
|
|
19
|
-
export { TileListCompact } from './src/tiles/list/tile-list-compact';
|
|
20
|
-
export { TileDispatcher } from './src/tiles/tile-dispatcher';
|
|
21
|
-
export { LayoutType } from './src/tiles/models';
|
|
22
|
-
export {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
export
|
|
1
|
+
export { CollectionBrowser } from './src/collection-browser';
|
|
2
|
+
export { CollectionBrowserDataSource } from './src/data-source/collection-browser-data-source';
|
|
3
|
+
export { CollectionBrowserDataSourceInterface } from './src/data-source/collection-browser-data-source-interface';
|
|
4
|
+
export { CollectionBrowserQueryState } from './src/data-source/collection-browser-query-state';
|
|
5
|
+
export { SortFilterBar } from './src/sort-filter-bar/sort-filter-bar';
|
|
6
|
+
export {
|
|
7
|
+
CollectionDisplayMode,
|
|
8
|
+
SortField,
|
|
9
|
+
TileModel,
|
|
10
|
+
FacetOption,
|
|
11
|
+
SelectedFacets,
|
|
12
|
+
getDefaultSelectedFacets,
|
|
13
|
+
} from './src/models';
|
|
14
|
+
export { CollectionBrowserLoadingTile } from './src/tiles/collection-browser-loading-tile';
|
|
15
|
+
export { CollectionTile } from './src/tiles/grid/collection-tile';
|
|
16
|
+
export { AccountTile } from './src/tiles/grid/account-tile';
|
|
17
|
+
export { ItemTile } from './src/tiles/grid/item-tile';
|
|
18
|
+
export { TileList } from './src/tiles/list/tile-list';
|
|
19
|
+
export { TileListCompact } from './src/tiles/list/tile-list-compact';
|
|
20
|
+
export { TileDispatcher } from './src/tiles/tile-dispatcher';
|
|
21
|
+
export { LayoutType } from './src/tiles/models';
|
|
22
|
+
export type { TileAction } from './src/tiles/models';
|
|
23
|
+
export {
|
|
24
|
+
SmartQueryHeuristic,
|
|
25
|
+
KeywordFacetMap,
|
|
26
|
+
SmartFacet,
|
|
27
|
+
} from './src/collection-facets/smart-facets/models';
|
|
28
|
+
export * from './src/collection-facets/smart-facets/heuristics/index';
|
|
29
|
+
export { SmartQueryHeuristicGroup } from './src/collection-facets/smart-facets/smart-facet-heuristics';
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"description": "The Internet Archive Collection Browser.",
|
|
4
4
|
"license": "AGPL-3.0-only",
|
|
5
5
|
"author": "Internet Archive",
|
|
6
|
-
"version": "4.
|
|
6
|
+
"version": "4.5.0",
|
|
7
7
|
"main": "dist/index.js",
|
|
8
8
|
"module": "dist/index.js",
|
|
9
9
|
"scripts": {
|
|
@@ -33,7 +33,7 @@
|
|
|
33
33
|
"@internetarchive/iaux-item-metadata": "^1.0.5",
|
|
34
34
|
"@internetarchive/infinite-scroller": "^2.0.0",
|
|
35
35
|
"@internetarchive/modal-manager": "^2.0.5",
|
|
36
|
-
"@internetarchive/search-service": "^2.7.
|
|
36
|
+
"@internetarchive/search-service": "^2.7.2",
|
|
37
37
|
"@internetarchive/shared-resize-observer": "^0.2.0",
|
|
38
38
|
"@lit/localize": "^0.12.2",
|
|
39
39
|
"dompurify": "^3.2.4",
|
package/src/app-root.ts
CHANGED
|
@@ -384,6 +384,16 @@ export class AppRoot extends LitElement {
|
|
|
384
384
|
/>
|
|
385
385
|
<label for="enable-smart-facet-bar">Enable smart facet bar</label>
|
|
386
386
|
</div>
|
|
387
|
+
<div class="checkbox-control">
|
|
388
|
+
<input
|
|
389
|
+
type="checkbox"
|
|
390
|
+
id="enable-tile-actions"
|
|
391
|
+
@click=${this.tileActionsCheckboxChanged}
|
|
392
|
+
/>
|
|
393
|
+
<label for="enable-tile-actions"
|
|
394
|
+
>Enable tile action buttons</label
|
|
395
|
+
>
|
|
396
|
+
</div>
|
|
387
397
|
</fieldset>
|
|
388
398
|
|
|
389
399
|
<fieldset class="cb-visual-appearance">
|
|
@@ -584,6 +594,7 @@ export class AppRoot extends LitElement {
|
|
|
584
594
|
@manageModeChanged=${this.manageModeChanged}
|
|
585
595
|
@itemRemovalRequested=${this.handleItemRemovalRequest}
|
|
586
596
|
@itemManagerRequested=${this.handleItemManagerRequest}
|
|
597
|
+
@tileActionClicked=${this.handleTileActionClicked}
|
|
587
598
|
>
|
|
588
599
|
${this.toggleSlots
|
|
589
600
|
? html`<div slot="sortbar-left-slot">Sort Slot</div>`
|
|
@@ -805,6 +816,25 @@ export class AppRoot extends LitElement {
|
|
|
805
816
|
this.collectionBrowser.showSmartFacetBar = target.checked;
|
|
806
817
|
}
|
|
807
818
|
|
|
819
|
+
/**
|
|
820
|
+
* Handler for when the dev panel's "Enable tile action buttons" checkbox is changed.
|
|
821
|
+
*/
|
|
822
|
+
private tileActionsCheckboxChanged(e: Event) {
|
|
823
|
+
const target = e.target as HTMLInputElement;
|
|
824
|
+
this.collectionBrowser.tileActions = target.checked
|
|
825
|
+
? [{ id: 'demo-action', label: 'Return' }]
|
|
826
|
+
: [];
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
/**
|
|
830
|
+
* Handler for tile action button clicks (logs to console for QA).
|
|
831
|
+
*/
|
|
832
|
+
private handleTileActionClicked(
|
|
833
|
+
e: CustomEvent<{ actionId: string; model: unknown }>,
|
|
834
|
+
) {
|
|
835
|
+
console.log('Tile action clicked:', e.detail.actionId, e.detail.model);
|
|
836
|
+
}
|
|
837
|
+
|
|
808
838
|
/**
|
|
809
839
|
* Handler for when the dev panel's "Show facet top slot" checkbox is changed.
|
|
810
840
|
*/
|
|
@@ -78,6 +78,7 @@ import { sha1 } from './utils/sha1';
|
|
|
78
78
|
import type { PlaceholderType } from './empty-placeholder';
|
|
79
79
|
import type { ManageBar } from './manage/manage-bar';
|
|
80
80
|
import type { SmartFacetBar } from './collection-facets/smart-facets/smart-facet-bar';
|
|
81
|
+
import type { LayoutType, TileAction } from './tiles/models';
|
|
81
82
|
|
|
82
83
|
import '@internetarchive/elements/ia-combo-box/ia-combo-box';
|
|
83
84
|
import './empty-placeholder';
|
|
@@ -297,6 +298,15 @@ export class CollectionBrowser
|
|
|
297
298
|
*/
|
|
298
299
|
@property({ type: Boolean }) isManageView = false;
|
|
299
300
|
|
|
301
|
+
/** Action buttons to display on each tile */
|
|
302
|
+
@property({ type: Array }) tileActions: TileAction[] = [];
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* The simplified layout to apply to grid-mode tiles, if any. See
|
|
306
|
+
* `LayoutType` for available options. Has no effect on list display modes.
|
|
307
|
+
*/
|
|
308
|
+
@property({ type: String }) tileLayoutType: LayoutType = 'default';
|
|
309
|
+
|
|
300
310
|
@property({ type: String }) manageViewLabel = 'Select items to remove';
|
|
301
311
|
|
|
302
312
|
/** Whether to replace the default sort options with a slot for customization (default: false) */
|
|
@@ -1652,6 +1662,7 @@ export class CollectionBrowser
|
|
|
1652
1662
|
.mobileBreakpoint=${this.mobileBreakpoint}
|
|
1653
1663
|
.loggedIn=${this.loggedIn}
|
|
1654
1664
|
.suppressBlurring=${this.shouldSuppressTileBlurring}
|
|
1665
|
+
.tileActions=${this.tileActions}
|
|
1655
1666
|
>
|
|
1656
1667
|
</tile-dispatcher>
|
|
1657
1668
|
</div>
|
|
@@ -1801,7 +1812,9 @@ export class CollectionBrowser
|
|
|
1801
1812
|
changed.has('displayMode') ||
|
|
1802
1813
|
changed.has('baseNavigationUrl') ||
|
|
1803
1814
|
changed.has('baseImageUrl') ||
|
|
1804
|
-
changed.has('loggedIn')
|
|
1815
|
+
changed.has('loggedIn') ||
|
|
1816
|
+
changed.has('tileActions') ||
|
|
1817
|
+
changed.has('tileLayoutType')
|
|
1805
1818
|
) {
|
|
1806
1819
|
this.infiniteScroller?.reload();
|
|
1807
1820
|
}
|
|
@@ -2635,6 +2648,8 @@ export class CollectionBrowser
|
|
|
2635
2648
|
.loggedIn=${this.loggedIn}
|
|
2636
2649
|
.suppressBlurring=${this.shouldSuppressTileBlurring}
|
|
2637
2650
|
.isManageView=${this.isManageView}
|
|
2651
|
+
.tileActions=${this.tileActions}
|
|
2652
|
+
.layoutType=${this.tileLayoutType}
|
|
2638
2653
|
?showTvClips=${isTVSearch || isTVCollection}
|
|
2639
2654
|
?enableHoverPane=${true}
|
|
2640
2655
|
?useLocalTime=${shouldUseLocalTime}
|