@internetarchive/collection-browser 1.14.1-alpha.0 → 1.14.2-alpha1
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/.editorconfig +29 -29
- package/.github/workflows/ci.yml +26 -26
- package/.github/workflows/gh-pages-main.yml +39 -39
- package/.github/workflows/npm-publish.yml +39 -39
- package/.github/workflows/pr-preview.yml +38 -38
- package/.husky/pre-commit +4 -4
- package/LICENSE +661 -661
- package/README.md +83 -83
- package/dist/index.d.ts +9 -9
- package/dist/index.js +9 -9
- package/dist/src/app-root.d.ts +64 -64
- package/dist/src/app-root.js +311 -311
- package/dist/src/assets/img/icons/arrow-left.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-left.js +2 -2
- package/dist/src/assets/img/icons/arrow-right.d.ts +2 -2
- package/dist/src/assets/img/icons/arrow-right.js +2 -2
- package/dist/src/assets/img/icons/chevron.d.ts +2 -2
- package/dist/src/assets/img/icons/chevron.js +2 -2
- package/dist/src/assets/img/icons/contract.d.ts +2 -2
- package/dist/src/assets/img/icons/contract.js +2 -2
- package/dist/src/assets/img/icons/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.js +2 -2
- package/dist/src/assets/img/icons/expand.d.ts +2 -2
- package/dist/src/assets/img/icons/expand.js +2 -2
- package/dist/src/assets/img/icons/eye-closed.d.ts +2 -2
- package/dist/src/assets/img/icons/eye-closed.js +2 -2
- package/dist/src/assets/img/icons/eye.d.ts +2 -2
- package/dist/src/assets/img/icons/eye.js +2 -2
- package/dist/src/assets/img/icons/favorite-filled.d.ts +1 -1
- package/dist/src/assets/img/icons/favorite-filled.js +2 -2
- package/dist/src/assets/img/icons/login-required.d.ts +1 -1
- package/dist/src/assets/img/icons/login-required.js +2 -2
- package/dist/src/assets/img/icons/mediatype/account.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/account.js +2 -2
- package/dist/src/assets/img/icons/mediatype/audio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/audio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/collection.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/collection.js +2 -2
- package/dist/src/assets/img/icons/mediatype/data.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/data.js +2 -2
- package/dist/src/assets/img/icons/mediatype/etree.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/etree.js +2 -2
- package/dist/src/assets/img/icons/mediatype/film.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/film.js +2 -2
- package/dist/src/assets/img/icons/mediatype/images.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/images.js +2 -2
- package/dist/src/assets/img/icons/mediatype/radio.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/radio.js +2 -2
- package/dist/src/assets/img/icons/mediatype/search.d.ts +1 -0
- package/dist/src/assets/img/icons/mediatype/search.js +14 -0
- package/dist/src/assets/img/icons/mediatype/search.js.map +1 -0
- package/dist/src/assets/img/icons/mediatype/software.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/software.js +2 -2
- package/dist/src/assets/img/icons/mediatype/texts.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/texts.js +2 -2
- package/dist/src/assets/img/icons/mediatype/tv.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/tv.js +2 -2
- package/dist/src/assets/img/icons/mediatype/video.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/video.js +2 -2
- package/dist/src/assets/img/icons/mediatype/web.d.ts +1 -1
- package/dist/src/assets/img/icons/mediatype/web.js +2 -2
- package/dist/src/assets/img/icons/null-result.d.ts +2 -2
- package/dist/src/assets/img/icons/null-result.js +2 -2
- package/dist/src/assets/img/icons/restricted.d.ts +1 -1
- package/dist/src/assets/img/icons/restricted.js +2 -2
- package/dist/src/assets/img/icons/reviews.d.ts +1 -1
- package/dist/src/assets/img/icons/reviews.js +2 -2
- package/dist/src/assets/img/icons/upload.d.ts +1 -1
- package/dist/src/assets/img/icons/upload.js +2 -2
- package/dist/src/assets/img/icons/views.d.ts +1 -1
- package/dist/src/assets/img/icons/views.js +2 -2
- package/dist/src/circular-activity-indicator.d.ts +5 -5
- package/dist/src/circular-activity-indicator.js +17 -17
- package/dist/src/collection-browser.d.ts +524 -522
- package/dist/src/collection-browser.js +1859 -1834
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/collection-facets/facet-tombstone-row.d.ts +5 -5
- package/dist/src/collection-facets/facet-tombstone-row.js +15 -15
- package/dist/src/collection-facets/facets-template.d.ts +20 -20
- package/dist/src/collection-facets/facets-template.js +152 -152
- package/dist/src/collection-facets/more-facets-content.d.ts +77 -77
- package/dist/src/collection-facets/more-facets-content.js +359 -359
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
- package/dist/src/collection-facets/more-facets-pagination.js +196 -196
- package/dist/src/collection-facets/toggle-switch.d.ts +41 -41
- package/dist/src/collection-facets/toggle-switch.js +94 -94
- package/dist/src/collection-facets.d.ts +104 -104
- package/dist/src/collection-facets.js +506 -506
- package/dist/src/empty-placeholder.d.ts +23 -23
- package/dist/src/empty-placeholder.js +74 -74
- package/dist/src/expanded-date-picker.d.ts +43 -43
- package/dist/src/expanded-date-picker.js +109 -109
- package/dist/src/language-code-handler/language-code-handler.d.ts +37 -37
- package/dist/src/language-code-handler/language-code-handler.js +26 -26
- package/dist/src/language-code-handler/language-code-mapping.d.ts +1 -1
- package/dist/src/language-code-handler/language-code-mapping.js +562 -562
- package/dist/src/manage/manage-bar.d.ts +26 -26
- package/dist/src/manage/manage-bar.js +53 -53
- package/dist/src/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +91 -85
- package/dist/src/mediatype/mediatype-config.js.map +1 -1
- package/dist/src/models.d.ts +164 -164
- package/dist/src/models.js +269 -269
- package/dist/src/restoration-state-handler.d.ts +70 -70
- package/dist/src/restoration-state-handler.js +355 -355
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.d.ts +6 -6
- package/dist/src/sort-filter-bar/alpha-bar-tooltip.js +24 -24
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +21 -21
- package/dist/src/sort-filter-bar/alpha-bar.js +128 -128
- package/dist/src/sort-filter-bar/img/compact.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/compact.js +2 -2
- package/dist/src/sort-filter-bar/img/list.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/list.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-disabled.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-down.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-down.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-toggle-up.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-toggle-up.js +2 -2
- package/dist/src/sort-filter-bar/img/sort-triangle.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/sort-triangle.js +2 -2
- package/dist/src/sort-filter-bar/img/tile.d.ts +1 -1
- package/dist/src/sort-filter-bar/img/tile.js +2 -2
- package/dist/src/sort-filter-bar/sort-filter-bar.d.ts +208 -208
- package/dist/src/sort-filter-bar/sort-filter-bar.js +637 -637
- package/dist/src/styles/item-image-styles.d.ts +8 -8
- package/dist/src/styles/item-image-styles.js +13 -9
- package/dist/src/styles/item-image-styles.js.map +1 -1
- package/dist/src/styles/sr-only.d.ts +1 -1
- package/dist/src/styles/sr-only.js +2 -2
- package/dist/src/tiles/base-tile-component.d.ts +18 -18
- package/dist/src/tiles/base-tile-component.js +59 -59
- package/dist/src/tiles/collection-browser-loading-tile.d.ts +5 -5
- package/dist/src/tiles/collection-browser-loading-tile.js +15 -15
- package/dist/src/tiles/grid/account-tile.d.ts +18 -18
- package/dist/src/tiles/grid/account-tile.js +72 -72
- package/dist/src/tiles/grid/collection-tile.d.ts +15 -15
- package/dist/src/tiles/grid/collection-tile.js +80 -80
- package/dist/src/tiles/grid/item-tile.d.ts +27 -27
- package/dist/src/tiles/grid/item-tile.js +134 -134
- package/dist/src/tiles/grid/search-tile.d.ts +10 -0
- package/dist/src/tiles/grid/search-tile.js +92 -0
- package/dist/src/tiles/grid/search-tile.js.map +1 -0
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.d.ts +1 -1
- package/dist/src/tiles/grid/styles/tile-grid-shared-styles.js +8 -8
- package/dist/src/tiles/grid/tile-stats.d.ts +11 -11
- package/dist/src/tiles/grid/tile-stats.js +48 -48
- package/dist/src/tiles/hover/hover-pane-controller.d.ts +219 -219
- package/dist/src/tiles/hover/hover-pane-controller.js +352 -352
- package/dist/src/tiles/hover/tile-hover-pane.d.ts +15 -15
- package/dist/src/tiles/hover/tile-hover-pane.js +38 -38
- package/dist/src/tiles/image-block.d.ts +17 -17
- package/dist/src/tiles/image-block.js +75 -73
- package/dist/src/tiles/image-block.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +36 -35
- package/dist/src/tiles/item-image.js +148 -125
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +6 -6
- package/dist/src/tiles/list/tile-list-compact-header.js +38 -38
- package/dist/src/tiles/list/tile-list-compact.d.ts +15 -15
- package/dist/src/tiles/list/tile-list-compact.js +114 -114
- package/dist/src/tiles/list/tile-list.d.ts +46 -46
- package/dist/src/tiles/list/tile-list.js +302 -298
- package/dist/src/tiles/list/tile-list.js.map +1 -1
- package/dist/src/tiles/mediatype-icon.d.ts +9 -9
- package/dist/src/tiles/mediatype-icon.js +47 -47
- package/dist/src/tiles/overlay/icon-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/icon-overlay.js +40 -40
- package/dist/src/tiles/overlay/icon-text-overlay.d.ts +9 -9
- package/dist/src/tiles/overlay/icon-text-overlay.js +38 -38
- package/dist/src/tiles/overlay/text-overlay.d.ts +10 -10
- package/dist/src/tiles/overlay/text-overlay.js +42 -42
- package/dist/src/tiles/text-snippet-block.d.ts +27 -27
- package/dist/src/tiles/text-snippet-block.js +73 -73
- package/dist/src/tiles/tile-dispatcher.d.ts +64 -63
- package/dist/src/tiles/tile-dispatcher.js +249 -225
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.d.ts +43 -43
- package/dist/src/tiles/tile-display-value-provider.js +80 -80
- package/dist/src/utils/analytics-events.d.ts +25 -25
- package/dist/src/utils/analytics-events.js +27 -27
- package/dist/src/utils/array-equals.d.ts +4 -4
- package/dist/src/utils/array-equals.js +10 -10
- package/dist/src/utils/format-count.d.ts +7 -7
- package/dist/src/utils/format-count.js +76 -76
- package/dist/src/utils/format-date.d.ts +2 -2
- package/dist/src/utils/format-date.js +25 -25
- package/dist/src/utils/format-unit-size.d.ts +2 -2
- package/dist/src/utils/format-unit-size.js +33 -33
- package/dist/src/utils/local-date-from-utc.d.ts +9 -9
- package/dist/src/utils/local-date-from-utc.js +15 -15
- package/dist/src/utils/sha1.d.ts +2 -2
- package/dist/src/utils/sha1.js +8 -8
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +1098 -1099
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facets-template.test.d.ts +1 -1
- package/dist/test/collection-facets/facets-template.test.js +134 -134
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +133 -133
- package/dist/test/collection-facets/more-facets-pagination.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-pagination.test.js +117 -117
- package/dist/test/collection-facets/toggle-switch.test.d.ts +1 -1
- package/dist/test/collection-facets/toggle-switch.test.js +73 -73
- package/dist/test/collection-facets.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +682 -682
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +63 -63
- package/dist/test/expanded-date-picker.test.d.ts +1 -1
- package/dist/test/expanded-date-picker.test.js +95 -95
- package/dist/test/icon-overlay.test.d.ts +1 -1
- package/dist/test/icon-overlay.test.js +24 -24
- package/dist/test/image-block.test.d.ts +1 -1
- package/dist/test/image-block.test.js +48 -48
- package/dist/test/item-image.test.d.ts +1 -1
- package/dist/test/item-image.test.js +86 -86
- package/dist/test/manage/manage-bar.test.d.ts +1 -1
- package/dist/test/manage/manage-bar.test.js +72 -72
- package/dist/test/mediatype-config.test.d.ts +1 -1
- package/dist/test/mediatype-config.test.js +16 -16
- package/dist/test/mocks/mock-analytics-handler.d.ts +10 -10
- package/dist/test/mocks/mock-analytics-handler.js +15 -15
- package/dist/test/mocks/mock-collection-name-cache.d.ts +9 -9
- package/dist/test/mocks/mock-collection-name-cache.js +17 -17
- package/dist/test/mocks/mock-search-responses.d.ts +21 -21
- package/dist/test/mocks/mock-search-responses.js +709 -709
- package/dist/test/mocks/mock-search-service.d.ts +15 -15
- package/dist/test/mocks/mock-search-service.js +50 -50
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +270 -270
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar-tooltip.test.js +12 -12
- package/dist/test/sort-filter-bar/alpha-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/alpha-bar.test.js +73 -73
- package/dist/test/sort-filter-bar/sort-filter-bar.test.d.ts +1 -1
- package/dist/test/sort-filter-bar/sort-filter-bar.test.js +378 -378
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +48 -48
- package/dist/test/text-snippet-block.test.d.ts +1 -1
- package/dist/test/text-snippet-block.test.js +57 -57
- package/dist/test/tile-stats.test.d.ts +1 -1
- package/dist/test/tile-stats.test.js +33 -33
- package/dist/test/tiles/grid/account-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/account-tile.test.js +76 -76
- package/dist/test/tiles/grid/collection-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/collection-tile.test.js +73 -73
- package/dist/test/tiles/grid/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +254 -254
- package/dist/test/tiles/grid/search-tile.test.d.ts +1 -0
- package/dist/test/tiles/grid/search-tile.test.js +67 -0
- package/dist/test/tiles/grid/search-tile.test.js.map +1 -0
- package/dist/test/tiles/hover/hover-pane-controller.test.d.ts +1 -1
- package/dist/test/tiles/hover/hover-pane-controller.test.js +258 -258
- package/dist/test/tiles/hover/tile-hover-pane.test.d.ts +1 -1
- package/dist/test/tiles/hover/tile-hover-pane.test.js +13 -13
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +143 -143
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +242 -242
- package/dist/test/tiles/tile-dispatcher.test.d.ts +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +94 -94
- package/dist/test/tiles/tile-display-value-provider.test.d.ts +1 -1
- package/dist/test/tiles/tile-display-value-provider.test.js +141 -141
- package/dist/test/utils/array-equals.test.d.ts +1 -1
- package/dist/test/utils/array-equals.test.js +26 -26
- package/dist/test/utils/format-count.test.d.ts +1 -1
- package/dist/test/utils/format-count.test.js +23 -23
- package/dist/test/utils/format-date.test.d.ts +1 -1
- package/dist/test/utils/format-date.test.js +17 -17
- package/dist/test/utils/format-unit-size.test.d.ts +1 -1
- package/dist/test/utils/format-unit-size.test.js +17 -17
- package/dist/test/utils/local-date-from-utc.test.d.ts +1 -1
- package/dist/test/utils/local-date-from-utc.test.js +26 -26
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +4 -4
- package/renovate.json +6 -6
- package/src/assets/img/icons/mediatype/search.ts +14 -0
- package/src/collection-browser.ts +29 -1
- package/src/mediatype/mediatype-config.ts +6 -0
- package/src/styles/item-image-styles.ts +4 -0
- package/src/tiles/grid/search-tile.ts +87 -0
- package/src/tiles/image-block.ts +3 -1
- package/src/tiles/item-image.ts +31 -8
- package/src/tiles/list/tile-list.ts +5 -0
- package/src/tiles/tile-dispatcher.ts +23 -1
- package/test/collection-browser.test.ts +1 -2
- package/test/tiles/grid/search-tile.test.ts +76 -0
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
package/src/tiles/item-image.ts
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
baseItemImageStyles,
|
|
9
9
|
waveformGradientStyles,
|
|
10
10
|
} from '../styles/item-image-styles';
|
|
11
|
+
import { searchIcon } from '../assets/img/icons/mediatype/search';
|
|
11
12
|
|
|
12
13
|
@customElement('item-image')
|
|
13
14
|
export class ItemImage extends LitElement {
|
|
@@ -27,14 +28,22 @@ export class ItemImage extends LitElement {
|
|
|
27
28
|
|
|
28
29
|
render() {
|
|
29
30
|
return html`
|
|
30
|
-
<div class=${classMap(this.itemBaseClass)}>
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
<div class=${classMap(this.itemBaseClass)}>${this.imageTemplate}</div>
|
|
32
|
+
`;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
private get imageTemplate() {
|
|
36
|
+
if (this.model?.mediatype === 'search') {
|
|
37
|
+
return html`${searchIcon}`;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
return html`
|
|
41
|
+
<img
|
|
42
|
+
class=${classMap(this.itemImageClass)}
|
|
43
|
+
src="${this.imageSrc}"
|
|
44
|
+
alt=""
|
|
45
|
+
@load=${this.onLoad}
|
|
46
|
+
/>
|
|
38
47
|
`;
|
|
39
48
|
}
|
|
40
49
|
|
|
@@ -69,6 +78,7 @@ export class ItemImage extends LitElement {
|
|
|
69
78
|
return {
|
|
70
79
|
'drop-shadow': true,
|
|
71
80
|
'list-box': this.isListTile,
|
|
81
|
+
'search-image': this.model?.mediatype === 'search',
|
|
72
82
|
[this.hashBasedGradient]: this.isWaveform,
|
|
73
83
|
};
|
|
74
84
|
}
|
|
@@ -122,6 +132,19 @@ export class ItemImage extends LitElement {
|
|
|
122
132
|
height: var(--imgHeight, 16rem);
|
|
123
133
|
width: var(--imgWidth, 16rem);
|
|
124
134
|
}
|
|
135
|
+
|
|
136
|
+
.search-image {
|
|
137
|
+
display: flex;
|
|
138
|
+
align-items: center;
|
|
139
|
+
justify-content: center;
|
|
140
|
+
background: rgb(245, 245, 247);
|
|
141
|
+
border-radius: 4px;
|
|
142
|
+
}
|
|
143
|
+
|
|
144
|
+
svg {
|
|
145
|
+
height: 10rem;
|
|
146
|
+
width: 10rem;
|
|
147
|
+
}
|
|
125
148
|
`,
|
|
126
149
|
];
|
|
127
150
|
}
|
|
@@ -239,6 +239,11 @@ export class TileList extends BaseTileComponent {
|
|
|
239
239
|
? this.model?.weeklyViewCount // weekly views
|
|
240
240
|
: this.model?.viewCount; // all-time views
|
|
241
241
|
|
|
242
|
+
// when its a search-tile, we don't have any stats to show
|
|
243
|
+
if (this.model?.mediatype === 'search') {
|
|
244
|
+
return this.metadataTemplate('(Favorited search query)', '');
|
|
245
|
+
}
|
|
246
|
+
|
|
242
247
|
return this.metadataTemplate(
|
|
243
248
|
`${formatCount(viewCount ?? 0, this.formatSize)}`,
|
|
244
249
|
msg('Views')
|
|
@@ -11,6 +11,7 @@ import type { TileDisplayMode } from '../models';
|
|
|
11
11
|
import './grid/collection-tile';
|
|
12
12
|
import './grid/item-tile';
|
|
13
13
|
import './grid/account-tile';
|
|
14
|
+
import './grid/search-tile';
|
|
14
15
|
import './hover/tile-hover-pane';
|
|
15
16
|
import './list/tile-list';
|
|
16
17
|
import './list/tile-list-compact';
|
|
@@ -181,7 +182,8 @@ export class TileDispatcher
|
|
|
181
182
|
return (
|
|
182
183
|
this.enableHoverPane &&
|
|
183
184
|
!!this.tileDisplayMode &&
|
|
184
|
-
TileDispatcher.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode]
|
|
185
|
+
TileDispatcher.HOVER_PANE_DISPLAY_MODES[this.tileDisplayMode] &&
|
|
186
|
+
this.model?.mediatype !== 'search' // don't show hover panes on search tiles
|
|
185
187
|
);
|
|
186
188
|
}
|
|
187
189
|
|
|
@@ -311,6 +313,19 @@ export class TileDispatcher
|
|
|
311
313
|
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
312
314
|
>
|
|
313
315
|
</account-tile>`;
|
|
316
|
+
case 'search':
|
|
317
|
+
return html`<search-tile
|
|
318
|
+
.model=${model}
|
|
319
|
+
.collectionPagePath=${collectionPagePath}
|
|
320
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
321
|
+
.currentWidth=${currentWidth}
|
|
322
|
+
.currentHeight=${currentHeight}
|
|
323
|
+
.creatorFilter=${creatorFilter}
|
|
324
|
+
.isManageView=${this.isManageView}
|
|
325
|
+
?showInfoButton=${false}
|
|
326
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
327
|
+
>
|
|
328
|
+
</search-tile>`;
|
|
314
329
|
default:
|
|
315
330
|
return html`<item-tile
|
|
316
331
|
.model=${model}
|
|
@@ -385,6 +400,13 @@ export class TileDispatcher
|
|
|
385
400
|
--imageBlockBackgroundColor: #f1f1f4;
|
|
386
401
|
}
|
|
387
402
|
|
|
403
|
+
search-tile {
|
|
404
|
+
--tileBorderColor: #555555;
|
|
405
|
+
--tileBackgroundColor: #666666;
|
|
406
|
+
--imageBlockBackgroundColor: #666666;
|
|
407
|
+
--iconFillColor: #2c2c2c;
|
|
408
|
+
}
|
|
409
|
+
|
|
388
410
|
#container {
|
|
389
411
|
position: relative;
|
|
390
412
|
height: 100%;
|
|
@@ -1211,8 +1211,7 @@ describe('Collection Browser', () => {
|
|
|
1211
1211
|
await el.updateComplete;
|
|
1212
1212
|
|
|
1213
1213
|
const infiniteScroller = el.shadowRoot?.querySelector('infinite-scroller');
|
|
1214
|
-
(infiniteScroller as InfiniteScroller).
|
|
1215
|
-
infiniteScrollerRefreshSpy;
|
|
1214
|
+
(infiniteScroller as InfiniteScroller).reload = infiniteScrollerRefreshSpy;
|
|
1216
1215
|
expect(infiniteScrollerRefreshSpy.called).to.be.false;
|
|
1217
1216
|
expect(infiniteScrollerRefreshSpy.callCount).to.equal(0);
|
|
1218
1217
|
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
/* eslint-disable import/no-duplicates */
|
|
2
|
+
import { expect, fixture } from '@open-wc/testing';
|
|
3
|
+
import { html } from 'lit';
|
|
4
|
+
import type { SearchTile } from '../../../src/tiles/grid/search-tile';
|
|
5
|
+
|
|
6
|
+
import '../../../src/tiles/grid/search-tile';
|
|
7
|
+
|
|
8
|
+
describe('Search Tile', () => {
|
|
9
|
+
it('should render initial component', async () => {
|
|
10
|
+
const el = await fixture<SearchTile>(html`<search-tile></search-tile>`);
|
|
11
|
+
|
|
12
|
+
const itemInfo = el.shadowRoot?.querySelector('.item-info');
|
|
13
|
+
const itemImage = el.shadowRoot?.querySelector('image-block');
|
|
14
|
+
const title = el.shadowRoot?.querySelector('#title');
|
|
15
|
+
const itemStats = el.shadowRoot?.querySelector('#item-stats');
|
|
16
|
+
|
|
17
|
+
expect(itemInfo).to.exist;
|
|
18
|
+
expect(itemImage).to.exist;
|
|
19
|
+
expect(title).to.exist;
|
|
20
|
+
expect(itemStats).not.exist; // search tiles doesn't have stats bar
|
|
21
|
+
});
|
|
22
|
+
|
|
23
|
+
it('should render with title element', async () => {
|
|
24
|
+
const el = await fixture<SearchTile>(html`
|
|
25
|
+
<search-tile
|
|
26
|
+
.model=${{
|
|
27
|
+
identifier: 'searched query',
|
|
28
|
+
title: 'searched query',
|
|
29
|
+
}}
|
|
30
|
+
>
|
|
31
|
+
</search-tile>
|
|
32
|
+
`);
|
|
33
|
+
await el.updateComplete;
|
|
34
|
+
|
|
35
|
+
const itemInfo = el.shadowRoot?.querySelector('.item-info');
|
|
36
|
+
const itemTitle = el.shadowRoot?.querySelector('#title');
|
|
37
|
+
|
|
38
|
+
expect(itemInfo).to.exist;
|
|
39
|
+
expect(itemTitle).to.exist;
|
|
40
|
+
expect(itemTitle?.querySelector('.truncated')?.textContent).to.equal(
|
|
41
|
+
'searched query'
|
|
42
|
+
);
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('should render with image-block element', async () => {
|
|
46
|
+
const el = await fixture<SearchTile>(html`
|
|
47
|
+
<search-tile
|
|
48
|
+
.model=${{
|
|
49
|
+
identifier: 'title:hello-world',
|
|
50
|
+
}}
|
|
51
|
+
>
|
|
52
|
+
</search-tile>
|
|
53
|
+
`);
|
|
54
|
+
await el.updateComplete;
|
|
55
|
+
|
|
56
|
+
const itemImageBlock = el.shadowRoot?.querySelector('image-block');
|
|
57
|
+
expect(itemImageBlock).to.exist;
|
|
58
|
+
});
|
|
59
|
+
|
|
60
|
+
it('should not render with item stats element', async () => {
|
|
61
|
+
const el = await fixture<SearchTile>(html`
|
|
62
|
+
<search-tile
|
|
63
|
+
.model=${{
|
|
64
|
+
identifier: '@jack-sparrow',
|
|
65
|
+
itemCount: 14521,
|
|
66
|
+
collectionSize: 23222543,
|
|
67
|
+
}}
|
|
68
|
+
>
|
|
69
|
+
</search-tile>
|
|
70
|
+
`);
|
|
71
|
+
await el.updateComplete;
|
|
72
|
+
|
|
73
|
+
const itemStats = el.shadowRoot?.querySelector('#item-stats');
|
|
74
|
+
expect(itemStats).not.exist;
|
|
75
|
+
});
|
|
76
|
+
});
|
package/tsconfig.json
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "es2018",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "node",
|
|
6
|
-
"noEmitOnError": true,
|
|
7
|
-
"lib": ["es2017", "dom"],
|
|
8
|
-
"strict": true,
|
|
9
|
-
"esModuleInterop": false,
|
|
10
|
-
"allowSyntheticDefaultImports": true,
|
|
11
|
-
"experimentalDecorators": true,
|
|
12
|
-
"importHelpers": true,
|
|
13
|
-
"outDir": "dist",
|
|
14
|
-
"sourceMap": true,
|
|
15
|
-
"inlineSources": true,
|
|
16
|
-
"rootDir": "./",
|
|
17
|
-
"declaration": true,
|
|
18
|
-
"importsNotUsedAsValues": "error"
|
|
19
|
-
},
|
|
20
|
-
"include": ["src", "test", "index.ts", "types"],
|
|
21
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2018",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "node",
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"lib": ["es2017", "dom"],
|
|
8
|
+
"strict": true,
|
|
9
|
+
"esModuleInterop": false,
|
|
10
|
+
"allowSyntheticDefaultImports": true,
|
|
11
|
+
"experimentalDecorators": true,
|
|
12
|
+
"importHelpers": true,
|
|
13
|
+
"outDir": "dist",
|
|
14
|
+
"sourceMap": true,
|
|
15
|
+
"inlineSources": true,
|
|
16
|
+
"rootDir": "./",
|
|
17
|
+
"declaration": true,
|
|
18
|
+
"importsNotUsedAsValues": "error"
|
|
19
|
+
},
|
|
20
|
+
"include": ["src", "test", "index.ts", "types"],
|
|
21
|
+
}
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
-
|
|
3
|
-
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
-
const hmr = process.argv.includes('--hmr');
|
|
5
|
-
|
|
6
|
-
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
-
nodeResolve: true,
|
|
8
|
-
open: '/',
|
|
9
|
-
watch: !hmr,
|
|
10
|
-
|
|
11
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
12
|
-
// esbuildTarget: 'auto'
|
|
13
|
-
|
|
14
|
-
/** Set appIndex to enable SPA routing */
|
|
15
|
-
// appIndex: 'demo/index.html',
|
|
16
|
-
|
|
17
|
-
/** Confgure bare import resolve plugin */
|
|
18
|
-
// nodeResolve: {
|
|
19
|
-
// exportConditions: ['browser', 'development']
|
|
20
|
-
// },
|
|
21
|
-
|
|
22
|
-
plugins: [
|
|
23
|
-
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
24
|
-
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
25
|
-
],
|
|
26
|
-
|
|
27
|
-
http2: true,
|
|
28
|
-
sslCert: './local.archive.org.cert',
|
|
29
|
-
sslKey: './local.archive.org.key',
|
|
30
|
-
});
|
|
1
|
+
// import { hmrPlugin, presets } from '@open-wc/dev-server-hmr';
|
|
2
|
+
|
|
3
|
+
/** Use Hot Module replacement by adding --hmr to the start command */
|
|
4
|
+
const hmr = process.argv.includes('--hmr');
|
|
5
|
+
|
|
6
|
+
export default /** @type {import('@web/dev-server').DevServerConfig} */ ({
|
|
7
|
+
nodeResolve: true,
|
|
8
|
+
open: '/',
|
|
9
|
+
watch: !hmr,
|
|
10
|
+
|
|
11
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
12
|
+
// esbuildTarget: 'auto'
|
|
13
|
+
|
|
14
|
+
/** Set appIndex to enable SPA routing */
|
|
15
|
+
// appIndex: 'demo/index.html',
|
|
16
|
+
|
|
17
|
+
/** Confgure bare import resolve plugin */
|
|
18
|
+
// nodeResolve: {
|
|
19
|
+
// exportConditions: ['browser', 'development']
|
|
20
|
+
// },
|
|
21
|
+
|
|
22
|
+
plugins: [
|
|
23
|
+
/** Use Hot Module Replacement by uncommenting. Requires @open-wc/dev-server-hmr plugin */
|
|
24
|
+
// hmr && hmrPlugin({ exclude: ['**/*/node_modules/**/*'], presets: [presets.litElement] }),
|
|
25
|
+
],
|
|
26
|
+
|
|
27
|
+
http2: true,
|
|
28
|
+
sslCert: './local.archive.org.cert',
|
|
29
|
+
sslKey: './local.archive.org.key',
|
|
30
|
+
});
|
|
@@ -1,41 +1,41 @@
|
|
|
1
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
-
|
|
3
|
-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
-
|
|
5
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
-
/** Test files to run */
|
|
7
|
-
files: 'dist/test/**/*.test.js',
|
|
8
|
-
|
|
9
|
-
/** Resolve bare module imports */
|
|
10
|
-
nodeResolve: {
|
|
11
|
-
exportConditions: ['browser', 'development'],
|
|
12
|
-
},
|
|
13
|
-
|
|
14
|
-
/** Filter out lit dev mode logs */
|
|
15
|
-
filterBrowserLogs(log) {
|
|
16
|
-
for (const arg of log.args) {
|
|
17
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
-
return false;
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
return true;
|
|
22
|
-
},
|
|
23
|
-
|
|
24
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
|
-
// esbuildTarget: 'auto',
|
|
26
|
-
|
|
27
|
-
/** Amount of browsers to run concurrently */
|
|
28
|
-
// concurrentBrowsers: 2,
|
|
29
|
-
|
|
30
|
-
/** Amount of test files per browser to test concurrently */
|
|
31
|
-
// concurrency: 1,
|
|
32
|
-
|
|
33
|
-
/** Browsers to run tests on */
|
|
34
|
-
// browsers: [
|
|
35
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
36
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
37
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
38
|
-
// ],
|
|
39
|
-
|
|
40
|
-
// See documentation for all available options
|
|
41
|
-
});
|
|
1
|
+
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
2
|
+
|
|
3
|
+
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
4
|
+
|
|
5
|
+
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
6
|
+
/** Test files to run */
|
|
7
|
+
files: 'dist/test/**/*.test.js',
|
|
8
|
+
|
|
9
|
+
/** Resolve bare module imports */
|
|
10
|
+
nodeResolve: {
|
|
11
|
+
exportConditions: ['browser', 'development'],
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
/** Filter out lit dev mode logs */
|
|
15
|
+
filterBrowserLogs(log) {
|
|
16
|
+
for (const arg of log.args) {
|
|
17
|
+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
18
|
+
return false;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
return true;
|
|
22
|
+
},
|
|
23
|
+
|
|
24
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
25
|
+
// esbuildTarget: 'auto',
|
|
26
|
+
|
|
27
|
+
/** Amount of browsers to run concurrently */
|
|
28
|
+
// concurrentBrowsers: 2,
|
|
29
|
+
|
|
30
|
+
/** Amount of test files per browser to test concurrently */
|
|
31
|
+
// concurrency: 1,
|
|
32
|
+
|
|
33
|
+
/** Browsers to run tests on */
|
|
34
|
+
// browsers: [
|
|
35
|
+
// playwrightLauncher({ product: 'chromium' }),
|
|
36
|
+
// playwrightLauncher({ product: 'firefox' }),
|
|
37
|
+
// playwrightLauncher({ product: 'webkit' }),
|
|
38
|
+
// ],
|
|
39
|
+
|
|
40
|
+
// See documentation for all available options
|
|
41
|
+
});
|