@internetarchive/collection-browser 0.3.5-alpha.1 → 0.3.5
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 +47 -43
- package/dist/src/app-root.js +331 -285
- package/dist/src/app-root.js.map +1 -1
- 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/empty-query.d.ts +2 -2
- package/dist/src/assets/img/icons/empty-query.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/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 +246 -245
- package/dist/src/collection-browser.js +1370 -1359
- 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 +42 -42
- package/dist/src/collection-facets/facet-tombstone-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.d.ts +16 -16
- package/dist/src/collection-facets/facets-template.js +130 -128
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/collection-facets/more-facets-content.d.ts +76 -76
- package/dist/src/collection-facets/more-facets-content.js +353 -353
- package/dist/src/collection-facets/more-facets-pagination.d.ts +36 -36
- package/dist/src/collection-facets/more-facets-pagination.js +192 -192
- package/dist/src/collection-facets.d.ts +77 -77
- package/dist/src/collection-facets.js +551 -551
- package/dist/src/collection-facets.js.map +1 -1
- package/dist/src/empty-placeholder.d.ts +11 -11
- package/dist/src/empty-placeholder.js +42 -42
- 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/mediatype/mediatype-config.d.ts +3 -3
- package/dist/src/mediatype/mediatype-config.js +85 -85
- package/dist/src/models.d.ts +103 -102
- package/dist/src/models.js +117 -117
- package/dist/src/models.js.map +1 -1
- package/dist/src/restoration-state-handler.d.ts +46 -45
- package/dist/src/restoration-state-handler.js +230 -220
- package/dist/src/restoration-state-handler.js.map +1 -1
- package/dist/src/sort-filter-bar/alpha-bar.d.ts +9 -9
- package/dist/src/sort-filter-bar/alpha-bar.js +41 -41
- 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-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 +107 -107
- package/dist/src/sort-filter-bar/sort-filter-bar.js +423 -423
- package/dist/src/styles/item-image-styles.d.ts +8 -8
- package/dist/src/styles/item-image-styles.js +9 -9
- 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 +8 -8
- package/dist/src/tiles/grid/account-tile.js +20 -20
- package/dist/src/tiles/grid/collection-tile.d.ts +7 -7
- package/dist/src/tiles/grid/collection-tile.js +23 -23
- package/dist/src/tiles/grid/item-tile.d.ts +24 -24
- package/dist/src/tiles/grid/item-tile.js +87 -87
- package/dist/src/tiles/grid/tile-stats.d.ts +10 -10
- package/dist/src/tiles/grid/tile-stats.js +46 -40
- package/dist/src/tiles/grid/tile-stats.js.map +1 -1
- package/dist/src/tiles/image-block.d.ts +17 -17
- package/dist/src/tiles/image-block.js +69 -69
- package/dist/src/tiles/item-image.d.ts +31 -31
- package/dist/src/tiles/item-image.js +103 -103
- package/dist/src/tiles/list/account-label.d.ts +1 -1
- package/dist/src/tiles/list/account-label.js +6 -6
- package/dist/src/tiles/list/date-label.d.ts +1 -1
- package/dist/src/tiles/list/date-label.js +12 -12
- package/dist/src/tiles/list/tile-list-compact-header.d.ts +12 -12
- package/dist/src/tiles/list/tile-list-compact-header.js +41 -41
- package/dist/src/tiles/list/tile-list-compact.d.ts +21 -20
- package/dist/src/tiles/list/tile-list-compact.js +94 -90
- package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
- package/dist/src/tiles/list/tile-list.d.ts +50 -50
- package/dist/src/tiles/list/tile-list.js +271 -268
- 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 +49 -47
- package/dist/src/tiles/mediatype-icon.js.map +1 -1
- package/dist/src/tiles/overlay/icon-overlay.d.ts +7 -7
- package/dist/src/tiles/overlay/icon-overlay.js +30 -30
- package/dist/src/tiles/overlay/text-overlay.d.ts +8 -8
- package/dist/src/tiles/overlay/text-overlay.js +31 -31
- package/dist/src/tiles/text-snippet-block.d.ts +29 -29
- package/dist/src/tiles/text-snippet-block.js +81 -81
- package/dist/src/tiles/tile-dispatcher.d.ts +36 -36
- package/dist/src/tiles/tile-dispatcher.js +128 -128
- package/dist/src/utils/analytics-events.d.ts +22 -22
- package/dist/src/utils/analytics-events.js +24 -24
- 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 +23 -23
- package/dist/test/collection-browser.test.d.ts +1 -1
- package/dist/test/collection-browser.test.js +481 -415
- 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 +62 -62
- package/dist/test/collection-facets/facets-template.test.js.map +1 -1
- package/dist/test/collection-facets/more-facets-content.test.d.ts +1 -1
- package/dist/test/collection-facets/more-facets-content.test.js +114 -114
- 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.test.d.ts +2 -2
- package/dist/test/collection-facets.test.js +498 -498
- package/dist/test/empty-placeholder.test.d.ts +1 -1
- package/dist/test/empty-placeholder.test.js +33 -33
- 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 +56 -56
- 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 +7 -7
- package/dist/test/mocks/mock-collection-name-cache.js +13 -13
- package/dist/test/mocks/mock-search-responses.d.ts +8 -8
- package/dist/test/mocks/mock-search-responses.js +198 -198
- package/dist/test/mocks/mock-search-responses.js.map +1 -1
- package/dist/test/mocks/mock-search-service.d.ts +13 -13
- package/dist/test/mocks/mock-search-service.js +32 -32
- package/dist/test/mocks/mock-search-service.js.map +1 -1
- package/dist/test/restoration-state-handler.test.d.ts +1 -1
- package/dist/test/restoration-state-handler.test.js +126 -117
- package/dist/test/restoration-state-handler.test.js.map +1 -1
- 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 +113 -113
- package/dist/test/text-overlay.test.d.ts +1 -1
- package/dist/test/text-overlay.test.js +41 -41
- 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/item-tile.test.d.ts +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +107 -107
- package/dist/test/tiles/list/tile-list-compact.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list-compact.test.js +125 -26
- package/dist/test/tiles/list/tile-list-compact.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.d.ts +1 -1
- package/dist/test/tiles/list/tile-list.test.js +79 -47
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- 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/index.html +24 -24
- package/local.archive.org.cert +86 -86
- package/local.archive.org.key +27 -27
- package/package.json +115 -115
- package/renovate.json +6 -6
- package/src/app-root.ts +104 -55
- package/src/collection-browser.ts +1503 -1488
- package/src/collection-facets/facet-tombstone-row.ts +40 -40
- package/src/collection-facets/facets-template.ts +5 -3
- package/src/collection-facets.ts +635 -635
- package/src/models.ts +1 -0
- package/src/restoration-state-handler.ts +19 -1
- package/src/tiles/grid/tile-stats.ts +18 -5
- package/src/tiles/list/tile-list-compact.ts +7 -3
- package/src/tiles/list/tile-list.ts +6 -1
- package/src/tiles/mediatype-icon.ts +2 -0
- package/test/collection-browser.test.ts +679 -599
- package/test/collection-facets/facets-template.test.ts +5 -3
- package/test/mocks/mock-search-responses.ts +226 -226
- package/test/mocks/mock-search-service.ts +61 -61
- package/test/restoration-state-handler.test.ts +12 -0
- package/test/tiles/list/tile-list-compact.test.ts +110 -0
- package/test/tiles/list/tile-list.test.ts +36 -0
- package/tsconfig.json +21 -21
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +41 -41
|
@@ -4,6 +4,7 @@ import { html } from 'lit';
|
|
|
4
4
|
import type { TileListCompact } from '../../../src/tiles/list/tile-list-compact';
|
|
5
5
|
|
|
6
6
|
import '../../../src/tiles/list/tile-list-compact';
|
|
7
|
+
import type { TileModel } from '../../../src/models';
|
|
7
8
|
|
|
8
9
|
describe('List Tile Compact', () => {
|
|
9
10
|
it('should render initial component', async () => {
|
|
@@ -35,4 +36,113 @@ describe('List Tile Compact', () => {
|
|
|
35
36
|
|
|
36
37
|
expect(creator).to.exist;
|
|
37
38
|
});
|
|
39
|
+
|
|
40
|
+
it('should render weekly views when sorting by week', async () => {
|
|
41
|
+
const el = await fixture<TileListCompact>(html`
|
|
42
|
+
<tile-list-compact
|
|
43
|
+
.model=${{ viewCount: 50, weeklyViewCount: 10 }}
|
|
44
|
+
.sortParam=${{ field: 'week', direction: 'desc' }}
|
|
45
|
+
>
|
|
46
|
+
</tile-list-compact>
|
|
47
|
+
`);
|
|
48
|
+
|
|
49
|
+
const viewsColumn = el.shadowRoot?.getElementById('views');
|
|
50
|
+
expect(viewsColumn).to.exist;
|
|
51
|
+
expect(viewsColumn?.textContent?.trim()).to.equal('10');
|
|
52
|
+
});
|
|
53
|
+
|
|
54
|
+
it('should render 0 for views if missing model', async () => {
|
|
55
|
+
const el = await fixture<TileListCompact>(html`
|
|
56
|
+
<tile-list-compact .sortParam=${{ field: 'week', direction: 'desc' }}>
|
|
57
|
+
</tile-list-compact>
|
|
58
|
+
`);
|
|
59
|
+
|
|
60
|
+
const viewsColumn = el.shadowRoot?.getElementById('views');
|
|
61
|
+
expect(viewsColumn).to.exist;
|
|
62
|
+
expect(viewsColumn?.textContent?.trim()).to.equal('0');
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('should render published date when sorting by it', async () => {
|
|
66
|
+
const model: Partial<TileModel> = {
|
|
67
|
+
dateAdded: new Date('2010-01-01'),
|
|
68
|
+
dateArchived: new Date('2011-01-01'),
|
|
69
|
+
datePublished: new Date('2012-01-01'),
|
|
70
|
+
dateReviewed: new Date('2013-01-01'),
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
const el = await fixture<TileListCompact>(html`
|
|
74
|
+
<tile-list-compact
|
|
75
|
+
.model=${model}
|
|
76
|
+
.sortParam=${{ field: 'date', direction: 'desc' }}
|
|
77
|
+
>
|
|
78
|
+
</tile-list-compact>
|
|
79
|
+
`);
|
|
80
|
+
|
|
81
|
+
const dateColumn = el.shadowRoot?.getElementById('date');
|
|
82
|
+
expect(dateColumn).to.exist;
|
|
83
|
+
expect(dateColumn?.textContent?.trim()).to.equal('Jan 01, 2012');
|
|
84
|
+
});
|
|
85
|
+
|
|
86
|
+
it('should render added date when sorting by it', async () => {
|
|
87
|
+
const model: Partial<TileModel> = {
|
|
88
|
+
dateAdded: new Date('2010-01-01'),
|
|
89
|
+
dateArchived: new Date('2011-01-01'),
|
|
90
|
+
datePublished: new Date('2012-01-01'),
|
|
91
|
+
dateReviewed: new Date('2013-01-01'),
|
|
92
|
+
};
|
|
93
|
+
|
|
94
|
+
const el = await fixture<TileListCompact>(html`
|
|
95
|
+
<tile-list-compact
|
|
96
|
+
.model=${model}
|
|
97
|
+
.sortParam=${{ field: 'addeddate', direction: 'desc' }}
|
|
98
|
+
>
|
|
99
|
+
</tile-list-compact>
|
|
100
|
+
`);
|
|
101
|
+
|
|
102
|
+
const dateColumn = el.shadowRoot?.getElementById('date');
|
|
103
|
+
expect(dateColumn).to.exist;
|
|
104
|
+
expect(dateColumn?.textContent?.trim()).to.equal('Jan 01, 2010');
|
|
105
|
+
});
|
|
106
|
+
|
|
107
|
+
it('should render archived date when sorting by it', async () => {
|
|
108
|
+
const model: Partial<TileModel> = {
|
|
109
|
+
dateAdded: new Date('2010-01-01'),
|
|
110
|
+
dateArchived: new Date('2011-01-01'),
|
|
111
|
+
datePublished: new Date('2012-01-01'),
|
|
112
|
+
dateReviewed: new Date('2013-01-01'),
|
|
113
|
+
};
|
|
114
|
+
|
|
115
|
+
const el = await fixture<TileListCompact>(html`
|
|
116
|
+
<tile-list-compact
|
|
117
|
+
.model=${model}
|
|
118
|
+
.sortParam=${{ field: 'publicdate', direction: 'desc' }}
|
|
119
|
+
>
|
|
120
|
+
</tile-list-compact>
|
|
121
|
+
`);
|
|
122
|
+
|
|
123
|
+
const dateColumn = el.shadowRoot?.getElementById('date');
|
|
124
|
+
expect(dateColumn).to.exist;
|
|
125
|
+
expect(dateColumn?.textContent?.trim()).to.equal('Jan 01, 2011');
|
|
126
|
+
});
|
|
127
|
+
|
|
128
|
+
it('should render reviewed date when sorting by it', async () => {
|
|
129
|
+
const model: Partial<TileModel> = {
|
|
130
|
+
dateAdded: new Date('2010-01-01'),
|
|
131
|
+
dateArchived: new Date('2011-01-01'),
|
|
132
|
+
datePublished: new Date('2012-01-01'),
|
|
133
|
+
dateReviewed: new Date('2013-01-01'),
|
|
134
|
+
};
|
|
135
|
+
|
|
136
|
+
const el = await fixture<TileListCompact>(html`
|
|
137
|
+
<tile-list-compact
|
|
138
|
+
.model=${model}
|
|
139
|
+
.sortParam=${{ field: 'reviewdate', direction: 'desc' }}
|
|
140
|
+
>
|
|
141
|
+
</tile-list-compact>
|
|
142
|
+
`);
|
|
143
|
+
|
|
144
|
+
const dateColumn = el.shadowRoot?.getElementById('date');
|
|
145
|
+
expect(dateColumn).to.exist;
|
|
146
|
+
expect(dateColumn?.textContent?.trim()).to.equal('Jan 01, 2013');
|
|
147
|
+
});
|
|
38
148
|
});
|
|
@@ -5,6 +5,7 @@ import type { TileList } from '../../../src/tiles/list/tile-list';
|
|
|
5
5
|
|
|
6
6
|
import '../../../src/tiles/list/tile-list';
|
|
7
7
|
import { MockCollectionNameCache } from '../../mocks/mock-collection-name-cache';
|
|
8
|
+
import type { TileModel } from '../../../src/models';
|
|
8
9
|
|
|
9
10
|
describe('List Tile', () => {
|
|
10
11
|
it('should render initial component', async () => {
|
|
@@ -69,4 +70,39 @@ describe('List Tile', () => {
|
|
|
69
70
|
'/details/foo'
|
|
70
71
|
);
|
|
71
72
|
});
|
|
73
|
+
|
|
74
|
+
it('should render weekly views when sorting by week', async () => {
|
|
75
|
+
const el = await fixture<TileList>(html`
|
|
76
|
+
<tile-list
|
|
77
|
+
.model=${{ viewCount: 50, weeklyViewCount: 10 }}
|
|
78
|
+
.sortParam=${{ field: 'week', direction: 'desc' }}
|
|
79
|
+
>
|
|
80
|
+
</tile-list>
|
|
81
|
+
`);
|
|
82
|
+
|
|
83
|
+
const viewsRow = el.shadowRoot?.getElementById('views-line');
|
|
84
|
+
expect(viewsRow).to.exist;
|
|
85
|
+
expect(viewsRow?.textContent?.trim()).to.equal('Views: 10');
|
|
86
|
+
});
|
|
87
|
+
|
|
88
|
+
it('should render added date when sorting by it', async () => {
|
|
89
|
+
const model: Partial<TileModel> = {
|
|
90
|
+
dateAdded: new Date('2010-01-01'),
|
|
91
|
+
dateArchived: new Date('2011-01-01'),
|
|
92
|
+
datePublished: new Date('2012-01-01'),
|
|
93
|
+
dateReviewed: new Date('2013-01-01'),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const el = await fixture<TileList>(html`
|
|
97
|
+
<tile-list
|
|
98
|
+
.model=${model}
|
|
99
|
+
.sortParam=${{ field: 'addeddate', direction: 'desc' }}
|
|
100
|
+
>
|
|
101
|
+
</tile-list>
|
|
102
|
+
`);
|
|
103
|
+
|
|
104
|
+
const dateRow = el.shadowRoot?.getElementById('dates-line');
|
|
105
|
+
expect(dateRow).to.exist;
|
|
106
|
+
expect(dateRow?.textContent?.trim()).to.contain('Added: Jan 01, 2010');
|
|
107
|
+
});
|
|
72
108
|
});
|
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
|
+
});
|