@internetarchive/collection-browser 4.4.1 → 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/.editorconfig +29 -29
- package/.github/workflows/ci.yml +27 -27
- 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 +1 -1
- package/.prettierignore +1 -1
- package/LICENSE +661 -661
- package/README.md +83 -83
- 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 +698 -672
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +8 -0
- package/dist/src/collection-browser.js +782 -764
- 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/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/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.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 +77 -77
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +134 -134
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +92 -92
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/index.ts +29 -28
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +120 -120
- package/renovate.json +6 -6
- package/src/app-root.ts +1284 -1254
- package/src/collection-browser.ts +3176 -3161
- package/src/collection-facets/facet-row.ts +309 -299
- package/src/collection-facets/facets-template.ts +85 -83
- 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/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 -133
- 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 -320
- package/tsconfig.json +25 -25
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +52 -52
|
@@ -2,6 +2,7 @@ var TileDispatcher_1;
|
|
|
2
2
|
import { __decorate } from "tslib";
|
|
3
3
|
import { css, html, nothing } from 'lit';
|
|
4
4
|
import { customElement, property, query } from 'lit/decorators.js';
|
|
5
|
+
import { classMap } from 'lit/directives/class-map.js';
|
|
5
6
|
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
6
7
|
import { msg } from '@lit/localize';
|
|
7
8
|
import './grid/collection-tile';
|
|
@@ -15,11 +16,13 @@ import './list/tile-list-compact-header';
|
|
|
15
16
|
import { BaseTileComponent } from './base-tile-component';
|
|
16
17
|
import { HoverPaneController, } from './hover/hover-pane-controller';
|
|
17
18
|
import { srOnlyStyle } from '../styles/sr-only';
|
|
19
|
+
import { tileActionStyles } from '../styles/tile-action-styles';
|
|
18
20
|
let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
19
21
|
constructor() {
|
|
20
22
|
/*
|
|
21
23
|
* Reactive properties inherited from BaseTileComponent:
|
|
22
24
|
* - model?: TileModel;
|
|
25
|
+
* - tileActions: TileAction[] = [];
|
|
23
26
|
* - currentWidth?: number;
|
|
24
27
|
* - currentHeight?: number;
|
|
25
28
|
* - baseNavigationUrl?: string;
|
|
@@ -41,6 +44,14 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
41
44
|
/** Whether this tile should include a hover pane at all (for applicable tile modes) */
|
|
42
45
|
this.enableHoverPane = false;
|
|
43
46
|
this.manageCheckTitle = msg('Remove this item from the list');
|
|
47
|
+
/**
|
|
48
|
+
* When the mouse enters the grid-mode tile actions area, dispatch a
|
|
49
|
+
* synthetic mouseleave on the host to cancel the hover pane's show timer
|
|
50
|
+
* and hide any visible pane.
|
|
51
|
+
*/
|
|
52
|
+
this.handleGridActionsMouseEnter = () => {
|
|
53
|
+
this.dispatchEvent(new MouseEvent('mouseleave', { bubbles: false }));
|
|
54
|
+
};
|
|
44
55
|
}
|
|
45
56
|
static { TileDispatcher_1 = this; }
|
|
46
57
|
acquireFocus() {
|
|
@@ -58,14 +69,20 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
58
69
|
}; }
|
|
59
70
|
render() {
|
|
60
71
|
const isGridMode = this.tileDisplayMode === 'grid';
|
|
72
|
+
const hasTileActions = isGridMode && this.showGridTileActions;
|
|
61
73
|
const hoverPaneTemplate = this.hoverPaneController?.getTemplate() ?? nothing;
|
|
62
|
-
|
|
63
|
-
|
|
74
|
+
const containerClasses = classMap({
|
|
75
|
+
hoverable: isGridMode,
|
|
76
|
+
'has-tile-actions': hasTileActions,
|
|
77
|
+
});
|
|
78
|
+
return html `
|
|
79
|
+
<div id="container" class=${containerClasses}>
|
|
64
80
|
${this.tileDisplayMode === 'list-header'
|
|
65
81
|
? this.headerTemplate
|
|
66
|
-
: this.tileTemplate}
|
|
67
|
-
${this.
|
|
68
|
-
|
|
82
|
+
: this.tileTemplate}
|
|
83
|
+
${this.gridTileActionsTemplate} ${this.manageCheckTemplate}
|
|
84
|
+
${hoverPaneTemplate}
|
|
85
|
+
</div>
|
|
69
86
|
`;
|
|
70
87
|
}
|
|
71
88
|
firstUpdated() {
|
|
@@ -78,42 +95,43 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
78
95
|
}
|
|
79
96
|
get headerTemplate() {
|
|
80
97
|
const { currentWidth, sortParam, defaultSortParam, mobileBreakpoint } = this;
|
|
81
|
-
return html `
|
|
82
|
-
<tile-list-compact-header
|
|
83
|
-
class="header"
|
|
84
|
-
.currentWidth=${currentWidth}
|
|
85
|
-
.sortParam=${sortParam ?? defaultSortParam}
|
|
86
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
87
|
-
|
|
88
|
-
|
|
98
|
+
return html `
|
|
99
|
+
<tile-list-compact-header
|
|
100
|
+
class="header"
|
|
101
|
+
.currentWidth=${currentWidth}
|
|
102
|
+
.sortParam=${sortParam ?? defaultSortParam}
|
|
103
|
+
.mobileBreakpoint=${mobileBreakpoint}
|
|
104
|
+
.tileActions=${this.tileActions}
|
|
105
|
+
>
|
|
106
|
+
</tile-list-compact-header>
|
|
89
107
|
`;
|
|
90
108
|
}
|
|
91
109
|
get tileTemplate() {
|
|
92
|
-
return html `
|
|
110
|
+
return html `
|
|
93
111
|
${this.tileDisplayMode === 'list-detail'
|
|
94
112
|
? this.tile
|
|
95
|
-
: this.linkTileTemplate}
|
|
113
|
+
: this.linkTileTemplate}
|
|
96
114
|
`;
|
|
97
115
|
}
|
|
98
116
|
get linkTileTemplate() {
|
|
99
|
-
return html `
|
|
100
|
-
<a
|
|
101
|
-
href=${this.linkTileHref}
|
|
102
|
-
aria-label=${this.model?.title ?? 'Untitled item'}
|
|
103
|
-
aria-describedby="link-aria-description"
|
|
104
|
-
aria-haspopup=${this.shouldPrepareHoverPane ? 'dialog' : 'false'}
|
|
117
|
+
return html `
|
|
118
|
+
<a
|
|
119
|
+
href=${this.linkTileHref}
|
|
120
|
+
aria-label=${this.model?.title ?? 'Untitled item'}
|
|
121
|
+
aria-describedby="link-aria-description"
|
|
122
|
+
aria-haspopup=${this.shouldPrepareHoverPane ? 'dialog' : 'false'}
|
|
105
123
|
title=${this.shouldPrepareHoverPane
|
|
106
124
|
? nothing // Don't show title tooltips when we have the tile info popups
|
|
107
|
-
: ifDefined(this.model?.title)}
|
|
108
|
-
@click=${this.handleLinkClicked}
|
|
109
|
-
@contextmenu=${this.handleLinkContextMenu}
|
|
110
|
-
class="tile-link"
|
|
111
|
-
>
|
|
112
|
-
${this.tile}
|
|
113
|
-
</a>
|
|
114
|
-
<div id="link-aria-description" class="sr-only">
|
|
115
|
-
${msg('Press Down Arrow to preview item details')}
|
|
116
|
-
</div>
|
|
125
|
+
: ifDefined(this.model?.title)}
|
|
126
|
+
@click=${this.handleLinkClicked}
|
|
127
|
+
@contextmenu=${this.handleLinkContextMenu}
|
|
128
|
+
class="tile-link"
|
|
129
|
+
>
|
|
130
|
+
${this.tile}
|
|
131
|
+
</a>
|
|
132
|
+
<div id="link-aria-description" class="sr-only">
|
|
133
|
+
${msg('Press Down Arrow to preview item details')}
|
|
134
|
+
</div>
|
|
117
135
|
`;
|
|
118
136
|
}
|
|
119
137
|
get linkTileHref() {
|
|
@@ -129,15 +147,15 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
129
147
|
get manageCheckTemplate() {
|
|
130
148
|
if (!this.isManageView || this.tileDisplayMode !== 'grid')
|
|
131
149
|
return nothing;
|
|
132
|
-
return html `
|
|
133
|
-
<div class="manage-check">
|
|
134
|
-
<input
|
|
135
|
-
type="checkbox"
|
|
136
|
-
title=${this.manageCheckTitle}
|
|
137
|
-
?checked=${this.model?.checked}
|
|
138
|
-
@change=${this.handleLinkClicked}
|
|
139
|
-
/>
|
|
140
|
-
</div>
|
|
150
|
+
return html `
|
|
151
|
+
<div class="manage-check">
|
|
152
|
+
<input
|
|
153
|
+
type="checkbox"
|
|
154
|
+
title=${this.manageCheckTitle}
|
|
155
|
+
?checked=${this.model?.checked}
|
|
156
|
+
@change=${this.handleLinkClicked}
|
|
157
|
+
/>
|
|
158
|
+
</div>
|
|
141
159
|
`;
|
|
142
160
|
}
|
|
143
161
|
/**
|
|
@@ -226,6 +244,37 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
226
244
|
enableTouchBackdrop: true,
|
|
227
245
|
});
|
|
228
246
|
}
|
|
247
|
+
/** Whether tile action buttons should be rendered in grid mode */
|
|
248
|
+
get showGridTileActions() {
|
|
249
|
+
return (this.tileActions.length > 0 &&
|
|
250
|
+
!this.isManageView &&
|
|
251
|
+
this.tileDisplayMode === 'grid');
|
|
252
|
+
}
|
|
253
|
+
/**
|
|
254
|
+
* Template for the grid-mode action buttons. Rendered alongside the inner
|
|
255
|
+
* tile link inside the dispatcher's shadow root so the action buttons can
|
|
256
|
+
* suppress the hover pane on hover.
|
|
257
|
+
*/
|
|
258
|
+
get gridTileActionsTemplate() {
|
|
259
|
+
if (!this.showGridTileActions)
|
|
260
|
+
return nothing;
|
|
261
|
+
return html `
|
|
262
|
+
<div
|
|
263
|
+
class="tile-actions grid-tile-actions"
|
|
264
|
+
@mouseenter=${this.handleGridActionsMouseEnter}
|
|
265
|
+
@mousemove=${(e) => e.stopPropagation()}
|
|
266
|
+
>
|
|
267
|
+
${this.tileActions.map(action => html `
|
|
268
|
+
<button
|
|
269
|
+
class="tile-action-btn"
|
|
270
|
+
@click=${(e) => this.handleTileActionClick(e, action)}
|
|
271
|
+
>
|
|
272
|
+
${action.label}
|
|
273
|
+
</button>
|
|
274
|
+
`)}
|
|
275
|
+
</div>
|
|
276
|
+
`;
|
|
277
|
+
}
|
|
229
278
|
get tile() {
|
|
230
279
|
const { model, collectionPagePath, baseNavigationUrl, currentWidth, currentHeight, sortParam, creatorFilter, mobileBreakpoint, defaultSortParam, } = this;
|
|
231
280
|
if (!model)
|
|
@@ -234,103 +283,105 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
234
283
|
case 'grid':
|
|
235
284
|
switch (model.mediatype) {
|
|
236
285
|
case 'collection':
|
|
237
|
-
return html `<collection-tile
|
|
238
|
-
.model=${model}
|
|
239
|
-
.collectionPagePath=${collectionPagePath}
|
|
240
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
241
|
-
.currentWidth=${currentWidth}
|
|
242
|
-
.currentHeight=${currentHeight}
|
|
243
|
-
.creatorFilter=${creatorFilter}
|
|
244
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
245
|
-
.isManageView=${this.isManageView}
|
|
246
|
-
.layoutType=${this.layoutType}
|
|
247
|
-
?showInfoButton=${this.shouldShowInfoButton}
|
|
248
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
249
|
-
>
|
|
286
|
+
return html `<collection-tile
|
|
287
|
+
.model=${model}
|
|
288
|
+
.collectionPagePath=${collectionPagePath}
|
|
289
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
290
|
+
.currentWidth=${currentWidth}
|
|
291
|
+
.currentHeight=${currentHeight}
|
|
292
|
+
.creatorFilter=${creatorFilter}
|
|
293
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
294
|
+
.isManageView=${this.isManageView}
|
|
295
|
+
.layoutType=${this.layoutType}
|
|
296
|
+
?showInfoButton=${this.shouldShowInfoButton}
|
|
297
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
298
|
+
>
|
|
250
299
|
</collection-tile>`;
|
|
251
300
|
case 'account':
|
|
252
|
-
return html `<account-tile
|
|
253
|
-
.model=${model}
|
|
254
|
-
.collectionPagePath=${collectionPagePath}
|
|
255
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
256
|
-
.currentWidth=${currentWidth}
|
|
257
|
-
.currentHeight=${currentHeight}
|
|
258
|
-
.creatorFilter=${creatorFilter}
|
|
259
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
260
|
-
.isManageView=${this.isManageView}
|
|
261
|
-
?showInfoButton=${this.shouldShowInfoButton}
|
|
262
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
263
|
-
>
|
|
301
|
+
return html `<account-tile
|
|
302
|
+
.model=${model}
|
|
303
|
+
.collectionPagePath=${collectionPagePath}
|
|
304
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
305
|
+
.currentWidth=${currentWidth}
|
|
306
|
+
.currentHeight=${currentHeight}
|
|
307
|
+
.creatorFilter=${creatorFilter}
|
|
308
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
309
|
+
.isManageView=${this.isManageView}
|
|
310
|
+
?showInfoButton=${this.shouldShowInfoButton}
|
|
311
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
312
|
+
>
|
|
264
313
|
</account-tile>`;
|
|
265
314
|
case 'search':
|
|
266
|
-
return html `<search-tile
|
|
267
|
-
.model=${model}
|
|
268
|
-
.collectionPagePath=${collectionPagePath}
|
|
269
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
270
|
-
.currentWidth=${currentWidth}
|
|
271
|
-
.currentHeight=${currentHeight}
|
|
272
|
-
.creatorFilter=${creatorFilter}
|
|
273
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
274
|
-
.isManageView=${this.isManageView}
|
|
275
|
-
?showInfoButton=${false}
|
|
276
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
277
|
-
>
|
|
315
|
+
return html `<search-tile
|
|
316
|
+
.model=${model}
|
|
317
|
+
.collectionPagePath=${collectionPagePath}
|
|
318
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
319
|
+
.currentWidth=${currentWidth}
|
|
320
|
+
.currentHeight=${currentHeight}
|
|
321
|
+
.creatorFilter=${creatorFilter}
|
|
322
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
323
|
+
.isManageView=${this.isManageView}
|
|
324
|
+
?showInfoButton=${false}
|
|
325
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
326
|
+
>
|
|
278
327
|
</search-tile>`;
|
|
279
328
|
default:
|
|
280
|
-
return html `<item-tile
|
|
281
|
-
.model=${model}
|
|
282
|
-
.collectionPagePath=${collectionPagePath}
|
|
283
|
-
.currentWidth=${this.currentWidth}
|
|
284
|
-
.currentHeight=${this.currentHeight}
|
|
285
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
286
|
-
.sortParam=${sortParam}
|
|
287
|
-
.defaultSortParam=${defaultSortParam}
|
|
288
|
-
.creatorFilter=${creatorFilter}
|
|
289
|
-
.loggedIn=${this.loggedIn}
|
|
290
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
291
|
-
.isManageView=${this.isManageView}
|
|
292
|
-
.layoutType=${this.layoutType}
|
|
293
|
-
?showTvClips=${this.showTvClips}
|
|
294
|
-
?showInfoButton=${this.shouldShowInfoButton}
|
|
295
|
-
?useLocalTime=${this.useLocalTime}
|
|
296
|
-
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
297
|
-
>
|
|
329
|
+
return html `<item-tile
|
|
330
|
+
.model=${model}
|
|
331
|
+
.collectionPagePath=${collectionPagePath}
|
|
332
|
+
.currentWidth=${this.currentWidth}
|
|
333
|
+
.currentHeight=${this.currentHeight}
|
|
334
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
335
|
+
.sortParam=${sortParam}
|
|
336
|
+
.defaultSortParam=${defaultSortParam}
|
|
337
|
+
.creatorFilter=${creatorFilter}
|
|
338
|
+
.loggedIn=${this.loggedIn}
|
|
339
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
340
|
+
.isManageView=${this.isManageView}
|
|
341
|
+
.layoutType=${this.layoutType}
|
|
342
|
+
?showTvClips=${this.showTvClips}
|
|
343
|
+
?showInfoButton=${this.shouldShowInfoButton}
|
|
344
|
+
?useLocalTime=${this.useLocalTime}
|
|
345
|
+
@infoButtonPressed=${this.tileInfoButtonPressed}
|
|
346
|
+
>
|
|
298
347
|
</item-tile>`;
|
|
299
348
|
}
|
|
300
349
|
case 'list-compact':
|
|
301
|
-
return html `<tile-list-compact
|
|
302
|
-
.model=${model}
|
|
303
|
-
.collectionPagePath=${collectionPagePath}
|
|
304
|
-
.currentWidth=${currentWidth}
|
|
305
|
-
.currentHeight=${currentHeight}
|
|
306
|
-
.baseNavigationUrl=${baseNavigationUrl}
|
|
307
|
-
.sortParam=${sortParam}
|
|
308
|
-
.defaultSortParam=${defaultSortParam}
|
|
309
|
-
.creatorFilter=${creatorFilter}
|
|
310
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
311
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
312
|
-
.loggedIn=${this.loggedIn}
|
|
313
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
314
|
-
|
|
315
|
-
|
|
350
|
+
return html `<tile-list-compact
|
|
351
|
+
.model=${model}
|
|
352
|
+
.collectionPagePath=${collectionPagePath}
|
|
353
|
+
.currentWidth=${currentWidth}
|
|
354
|
+
.currentHeight=${currentHeight}
|
|
355
|
+
.baseNavigationUrl=${baseNavigationUrl}
|
|
356
|
+
.sortParam=${sortParam}
|
|
357
|
+
.defaultSortParam=${defaultSortParam}
|
|
358
|
+
.creatorFilter=${creatorFilter}
|
|
359
|
+
.mobileBreakpoint=${mobileBreakpoint}
|
|
360
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
361
|
+
.loggedIn=${this.loggedIn}
|
|
362
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
363
|
+
.tileActions=${this.isManageView ? [] : this.tileActions}
|
|
364
|
+
?useLocalTime=${this.useLocalTime}
|
|
365
|
+
>
|
|
316
366
|
</tile-list-compact>`;
|
|
317
367
|
case 'list-detail':
|
|
318
|
-
return html `<tile-list
|
|
319
|
-
.model=${model}
|
|
320
|
-
.collectionPagePath=${collectionPagePath}
|
|
321
|
-
.collectionTitles=${this.collectionTitles}
|
|
322
|
-
.currentWidth=${currentWidth}
|
|
323
|
-
.currentHeight=${currentHeight}
|
|
324
|
-
.baseNavigationUrl=${baseNavigationUrl}
|
|
325
|
-
.sortParam=${sortParam}
|
|
326
|
-
.defaultSortParam=${defaultSortParam}
|
|
327
|
-
.creatorFilter=${creatorFilter}
|
|
328
|
-
.mobileBreakpoint=${mobileBreakpoint}
|
|
329
|
-
.baseImageUrl=${this.baseImageUrl}
|
|
330
|
-
.loggedIn=${this.loggedIn}
|
|
331
|
-
.suppressBlurring=${this.suppressBlurring}
|
|
332
|
-
|
|
333
|
-
|
|
368
|
+
return html `<tile-list
|
|
369
|
+
.model=${model}
|
|
370
|
+
.collectionPagePath=${collectionPagePath}
|
|
371
|
+
.collectionTitles=${this.collectionTitles}
|
|
372
|
+
.currentWidth=${currentWidth}
|
|
373
|
+
.currentHeight=${currentHeight}
|
|
374
|
+
.baseNavigationUrl=${baseNavigationUrl}
|
|
375
|
+
.sortParam=${sortParam}
|
|
376
|
+
.defaultSortParam=${defaultSortParam}
|
|
377
|
+
.creatorFilter=${creatorFilter}
|
|
378
|
+
.mobileBreakpoint=${mobileBreakpoint}
|
|
379
|
+
.baseImageUrl=${this.baseImageUrl}
|
|
380
|
+
.loggedIn=${this.loggedIn}
|
|
381
|
+
.suppressBlurring=${this.suppressBlurring}
|
|
382
|
+
.tileActions=${this.isManageView ? [] : this.tileActions}
|
|
383
|
+
?useLocalTime=${this.useLocalTime}
|
|
384
|
+
>
|
|
334
385
|
</tile-list>`;
|
|
335
386
|
default:
|
|
336
387
|
return nothing;
|
|
@@ -339,96 +390,148 @@ let TileDispatcher = class TileDispatcher extends BaseTileComponent {
|
|
|
339
390
|
static get styles() {
|
|
340
391
|
return [
|
|
341
392
|
srOnlyStyle,
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
--
|
|
351
|
-
--
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
--
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
--
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
--
|
|
367
|
-
--
|
|
368
|
-
--
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
display:
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
#
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
393
|
+
tileActionStyles,
|
|
394
|
+
css `
|
|
395
|
+
:host {
|
|
396
|
+
display: block;
|
|
397
|
+
height: 100%;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
collection-tile {
|
|
401
|
+
--tileBorderColor: #555555;
|
|
402
|
+
--tileBackgroundColor: #666666;
|
|
403
|
+
--imageBlockBackgroundColor: #666666;
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
account-tile {
|
|
407
|
+
--tileBorderColor: #dddddd;
|
|
408
|
+
--imageBlockBackgroundColor: #fcf5e6;
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
item-tile {
|
|
412
|
+
--tileBorderColor: #dddddd;
|
|
413
|
+
--imageBlockBackgroundColor: #f1f1f4;
|
|
414
|
+
}
|
|
415
|
+
|
|
416
|
+
search-tile {
|
|
417
|
+
--tileBorderColor: #555555;
|
|
418
|
+
--tileBackgroundColor: #666666;
|
|
419
|
+
--imageBlockBackgroundColor: #666666;
|
|
420
|
+
--iconFillColor: #2c2c2c;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
#container {
|
|
424
|
+
position: relative;
|
|
425
|
+
height: 100%;
|
|
426
|
+
border-radius: 4px;
|
|
427
|
+
}
|
|
428
|
+
|
|
429
|
+
/*
|
|
430
|
+
* When tile actions are present, the container takes on the role of
|
|
431
|
+
* the tile's visual card so the tile content and action row appear
|
|
432
|
+
* as a single unified element. The inner tile's own shadow/radius
|
|
433
|
+
* are disabled via CSS variable overrides to avoid visual
|
|
434
|
+
* duplication, and the action row sits as a footer inside the same
|
|
435
|
+
* card.
|
|
436
|
+
*/
|
|
437
|
+
#container.has-tile-actions {
|
|
438
|
+
display: flex;
|
|
439
|
+
flex-direction: column;
|
|
440
|
+
overflow: hidden;
|
|
441
|
+
box-shadow: var(--tileShadow, 1px 1px 2px 0);
|
|
442
|
+
--tileBoxShadow: none;
|
|
443
|
+
--tileCornerRadius: 0;
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
#container.has-tile-actions .tile-link {
|
|
447
|
+
flex: 1;
|
|
448
|
+
min-height: 0;
|
|
449
|
+
overflow: hidden;
|
|
450
|
+
border-radius: 0;
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
/* Normal hover shadow lives on the inner anchor for plain tiles */
|
|
454
|
+
#container.hoverable:not(.has-tile-actions) a:focus,
|
|
455
|
+
#container.hoverable:not(.has-tile-actions) a:hover {
|
|
456
|
+
box-shadow: var(
|
|
457
|
+
--tileHoverBoxShadow,
|
|
458
|
+
0 0 6px 2px rgba(8, 8, 32, 0.8)
|
|
459
|
+
);
|
|
460
|
+
transition: box-shadow 0.1s ease;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
/*
|
|
464
|
+
* When the container owns the card visuals, the hover shadow needs
|
|
465
|
+
* to move up to the container so it wraps the action row too.
|
|
466
|
+
*/
|
|
467
|
+
#container.hoverable.has-tile-actions:hover {
|
|
468
|
+
box-shadow: var(
|
|
469
|
+
--tileHoverBoxShadow,
|
|
470
|
+
0 0 6px 2px rgba(8, 8, 32, 0.8)
|
|
471
|
+
);
|
|
472
|
+
transition: box-shadow 0.1s ease;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
a {
|
|
476
|
+
display: block;
|
|
477
|
+
height: 100%;
|
|
478
|
+
color: unset;
|
|
479
|
+
text-decoration: none;
|
|
480
|
+
transition: transform 0.05s ease;
|
|
481
|
+
border-radius: 4px;
|
|
482
|
+
outline: none;
|
|
483
|
+
}
|
|
484
|
+
|
|
485
|
+
a :first-child {
|
|
486
|
+
display: block;
|
|
487
|
+
height: 100%;
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
.manage-check {
|
|
491
|
+
position: absolute;
|
|
492
|
+
right: 0;
|
|
493
|
+
top: 0;
|
|
494
|
+
border: 5px solid #2c2c2c;
|
|
495
|
+
border-radius: 3px;
|
|
496
|
+
background-color: #2c2c2c;
|
|
497
|
+
z-index: 1;
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
.manage-check > input[type='checkbox'] {
|
|
501
|
+
display: block;
|
|
502
|
+
margin: 0;
|
|
503
|
+
}
|
|
504
|
+
|
|
505
|
+
#touch-backdrop {
|
|
506
|
+
position: fixed;
|
|
507
|
+
width: 100vw;
|
|
508
|
+
height: 100vh;
|
|
509
|
+
top: 0;
|
|
510
|
+
left: 0;
|
|
511
|
+
z-index: 2;
|
|
512
|
+
background: transparent;
|
|
513
|
+
}
|
|
514
|
+
|
|
515
|
+
tile-hover-pane {
|
|
516
|
+
position: absolute;
|
|
517
|
+
top: 0;
|
|
518
|
+
left: -9999px;
|
|
519
|
+
z-index: 2;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/*
|
|
523
|
+
* Grid-mode action row sits flush against the bottom of the card —
|
|
524
|
+
* the buttons' own borders form the visible bottom edge. The outer
|
|
525
|
+
* buttons get rounded bottom corners to match the container so the
|
|
526
|
+
* red border traces cleanly around the card's bottom corners.
|
|
527
|
+
*/
|
|
528
|
+
.grid-tile-actions .tile-action-btn:first-child {
|
|
529
|
+
border-bottom-left-radius: 4px;
|
|
530
|
+
}
|
|
531
|
+
|
|
532
|
+
.grid-tile-actions .tile-action-btn:last-child {
|
|
533
|
+
border-bottom-right-radius: 4px;
|
|
534
|
+
}
|
|
432
535
|
`,
|
|
433
536
|
];
|
|
434
537
|
}
|