@internetarchive/collection-browser 4.4.1 → 4.5.1-alpha-webdev8221.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.
Files changed (85) hide show
  1. package/.editorconfig +29 -29
  2. package/.github/workflows/ci.yml +27 -27
  3. package/.github/workflows/gh-pages-main.yml +39 -39
  4. package/.github/workflows/npm-publish.yml +39 -39
  5. package/.github/workflows/pr-preview.yml +38 -38
  6. package/.husky/pre-commit +1 -1
  7. package/.prettierignore +1 -1
  8. package/LICENSE +661 -661
  9. package/README.md +83 -83
  10. package/dist/index.d.ts +1 -0
  11. package/dist/index.js.map +1 -1
  12. package/dist/src/app-root.d.ts +8 -0
  13. package/dist/src/app-root.js +26 -0
  14. package/dist/src/app-root.js.map +1 -1
  15. package/dist/src/collection-browser.d.ts +8 -4
  16. package/dist/src/collection-browser.js +20 -11
  17. package/dist/src/collection-browser.js.map +1 -1
  18. package/dist/src/collection-facets/facet-row.d.ts +6 -0
  19. package/dist/src/collection-facets/facet-row.js +19 -1
  20. package/dist/src/collection-facets/facet-row.js.map +1 -1
  21. package/dist/src/collection-facets/facets-template.js +2 -0
  22. package/dist/src/collection-facets/facets-template.js.map +1 -1
  23. package/dist/src/data-source/collection-browser-data-source-interface.d.ts +5 -0
  24. package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
  25. package/dist/src/data-source/collection-browser-data-source.d.ts +1 -1
  26. package/dist/src/data-source/collection-browser-data-source.js +8 -6
  27. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  28. package/dist/src/restoration-state-handler.js +2 -4
  29. package/dist/src/restoration-state-handler.js.map +1 -1
  30. package/dist/src/styles/tile-action-styles.d.ts +14 -0
  31. package/dist/src/styles/tile-action-styles.js +59 -0
  32. package/dist/src/styles/tile-action-styles.js.map +1 -0
  33. package/dist/src/tiles/base-tile-component.d.ts +17 -1
  34. package/dist/src/tiles/base-tile-component.js +50 -1
  35. package/dist/src/tiles/base-tile-component.js.map +1 -1
  36. package/dist/src/tiles/grid/item-tile.js +1 -0
  37. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  38. package/dist/src/tiles/list/tile-list-compact-header.js +27 -2
  39. package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
  40. package/dist/src/tiles/list/tile-list-compact.d.ts +1 -1
  41. package/dist/src/tiles/list/tile-list-compact.js +113 -75
  42. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  43. package/dist/src/tiles/list/tile-list.d.ts +1 -1
  44. package/dist/src/tiles/list/tile-list.js +164 -146
  45. package/dist/src/tiles/list/tile-list.js.map +1 -1
  46. package/dist/src/tiles/models.d.ts +11 -0
  47. package/dist/src/tiles/models.js.map +1 -1
  48. package/dist/src/tiles/tile-dispatcher.d.ts +14 -0
  49. package/dist/src/tiles/tile-dispatcher.js +107 -4
  50. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  51. package/dist/src/utils/date-filter-field.d.ts +6 -0
  52. package/dist/src/utils/date-filter-field.js +9 -0
  53. package/dist/src/utils/date-filter-field.js.map +1 -0
  54. package/dist/test/collection-browser.test.js +81 -0
  55. package/dist/test/collection-browser.test.js.map +1 -1
  56. package/dist/test/collection-facets/facet-row.test.js +32 -0
  57. package/dist/test/collection-facets/facet-row.test.js.map +1 -1
  58. package/eslint.config.mjs +53 -53
  59. package/index.html +24 -24
  60. package/index.ts +1 -0
  61. package/local.archive.org.cert +86 -86
  62. package/local.archive.org.key +27 -27
  63. package/package.json +120 -120
  64. package/renovate.json +6 -6
  65. package/src/app-root.ts +30 -0
  66. package/src/collection-browser.ts +17 -13
  67. package/src/collection-facets/facet-row.ts +11 -1
  68. package/src/collection-facets/facets-template.ts +2 -0
  69. package/src/data-source/collection-browser-data-source-interface.ts +6 -0
  70. package/src/data-source/collection-browser-data-source.ts +16 -7
  71. package/src/restoration-state-handler.ts +5 -5
  72. package/src/styles/tile-action-styles.ts +59 -0
  73. package/src/tiles/base-tile-component.ts +60 -1
  74. package/src/tiles/grid/item-tile.ts +1 -0
  75. package/src/tiles/list/tile-list-compact-header.ts +28 -2
  76. package/src/tiles/list/tile-list-compact.ts +114 -75
  77. package/src/tiles/list/tile-list.ts +190 -172
  78. package/src/tiles/models.ts +13 -0
  79. package/src/tiles/tile-dispatcher.ts +114 -4
  80. package/src/utils/date-filter-field.ts +11 -0
  81. package/test/collection-browser.test.ts +132 -0
  82. package/test/collection-facets/facet-row.test.ts +46 -0
  83. package/tsconfig.json +25 -25
  84. package/web-dev-server.config.mjs +30 -30
  85. package/web-test-runner.config.mjs +52 -52
@@ -124,6 +124,13 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
124
124
  * If item management UI active
125
125
  */
126
126
  this.isManageView = false;
127
+ /** Action buttons to display on each tile */
128
+ this.tileActions = [];
129
+ /**
130
+ * The simplified layout to apply to grid-mode tiles, if any. See
131
+ * `LayoutType` for available options. Has no effect on list display modes.
132
+ */
133
+ this.tileLayoutType = 'default';
127
134
  this.manageViewLabel = 'Select items to remove';
128
135
  /** Whether to replace the default sort options with a slot for customization (default: false) */
129
136
  this.enableSortOptionsSlot = false;
@@ -1289,6 +1296,7 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1289
1296
  .mobileBreakpoint=${this.mobileBreakpoint}
1290
1297
  .loggedIn=${this.loggedIn}
1291
1298
  .suppressBlurring=${this.shouldSuppressTileBlurring}
1299
+ .tileActions=${this.tileActions}
1292
1300
  >
1293
1301
  </tile-dispatcher>
1294
1302
  </div>
@@ -1303,18 +1311,9 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1303
1311
  this.analyticsHandler?.sendEvent({
1304
1312
  category: this.searchContext,
1305
1313
  action: analyticsActions.histogramChanged,
1306
- label: this.dateRangeQueryClause,
1314
+ label: this.dataSource.dateRangeQueryClause,
1307
1315
  });
1308
1316
  }
1309
- /**
1310
- * The Lucene query corresponding to the current date range.
1311
- */
1312
- get dateRangeQueryClause() {
1313
- if (!this.minSelectedDate || !this.maxSelectedDate) {
1314
- return undefined;
1315
- }
1316
- return `year:[${this.minSelectedDate} TO ${this.maxSelectedDate}]`;
1317
- }
1318
1317
  /**
1319
1318
  * Emits an event indicating a change in whether the manage mode is shown.
1320
1319
  */
@@ -1411,7 +1410,9 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
1411
1410
  if (changed.has('displayMode') ||
1412
1411
  changed.has('baseNavigationUrl') ||
1413
1412
  changed.has('baseImageUrl') ||
1414
- changed.has('loggedIn')) {
1413
+ changed.has('loggedIn') ||
1414
+ changed.has('tileActions') ||
1415
+ changed.has('tileLayoutType')) {
1415
1416
  this.infiniteScroller?.reload();
1416
1417
  }
1417
1418
  if (changed.has('profileElement')) {
@@ -2065,6 +2066,8 @@ let CollectionBrowser = class CollectionBrowser extends LitElement {
2065
2066
  .loggedIn=${this.loggedIn}
2066
2067
  .suppressBlurring=${this.shouldSuppressTileBlurring}
2067
2068
  .isManageView=${this.isManageView}
2069
+ .tileActions=${this.tileActions}
2070
+ .layoutType=${this.tileLayoutType}
2068
2071
  ?showTvClips=${isTVSearch || isTVCollection}
2069
2072
  ?enableHoverPane=${true}
2070
2073
  ?useLocalTime=${shouldUseLocalTime}
@@ -2726,6 +2729,12 @@ __decorate([
2726
2729
  __decorate([
2727
2730
  property({ type: Boolean })
2728
2731
  ], CollectionBrowser.prototype, "isManageView", void 0);
2732
+ __decorate([
2733
+ property({ type: Array })
2734
+ ], CollectionBrowser.prototype, "tileActions", void 0);
2735
+ __decorate([
2736
+ property({ type: String })
2737
+ ], CollectionBrowser.prototype, "tileLayoutType", void 0);
2729
2738
  __decorate([
2730
2739
  property({ type: String })
2731
2740
  ], CollectionBrowser.prototype, "manageViewLabel", void 0);