@internetarchive/collection-browser 2.15.1-alpha-webdev7667.3 → 2.16.1-webdev-7558.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 (107) hide show
  1. package/.editorconfig +29 -29
  2. package/.husky/pre-commit +4 -4
  3. package/LICENSE +661 -661
  4. package/README.md +83 -83
  5. package/dist/src/app-root.js +6 -0
  6. package/dist/src/app-root.js.map +1 -1
  7. package/dist/src/collection-browser.d.ts +0 -17
  8. package/dist/src/collection-browser.js +3 -70
  9. package/dist/src/collection-browser.js.map +1 -1
  10. package/dist/src/collection-facets/more-facets-content.d.ts +2 -1
  11. package/dist/src/collection-facets/more-facets-content.js +6 -3
  12. package/dist/src/collection-facets/more-facets-content.js.map +1 -1
  13. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js +1 -1
  14. package/dist/src/collection-facets/smart-facets/smart-facet-bar.js.map +1 -1
  15. package/dist/src/collection-facets.d.ts +9 -3
  16. package/dist/src/collection-facets.js +85 -41
  17. package/dist/src/collection-facets.js.map +1 -1
  18. package/dist/src/data-source/collection-browser-data-source-interface.d.ts +8 -3
  19. package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
  20. package/dist/src/data-source/collection-browser-data-source.d.ts +5 -1
  21. package/dist/src/data-source/collection-browser-data-source.js +25 -8
  22. package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
  23. package/dist/src/data-source/models.d.ts +4 -0
  24. package/dist/src/data-source/models.js.map +1 -1
  25. package/dist/src/expanded-date-picker.d.ts +4 -0
  26. package/dist/src/expanded-date-picker.js +10 -0
  27. package/dist/src/expanded-date-picker.js.map +1 -1
  28. package/dist/src/models.d.ts +0 -7
  29. package/dist/src/models.js +0 -31
  30. package/dist/src/models.js.map +1 -1
  31. package/dist/src/tiles/base-tile-component.d.ts +0 -1
  32. package/dist/src/tiles/base-tile-component.js +0 -4
  33. package/dist/src/tiles/base-tile-component.js.map +1 -1
  34. package/dist/src/tiles/grid/account-tile.js +0 -2
  35. package/dist/src/tiles/grid/account-tile.js.map +1 -1
  36. package/dist/src/tiles/grid/collection-tile.js +0 -2
  37. package/dist/src/tiles/grid/collection-tile.js.map +1 -1
  38. package/dist/src/tiles/grid/item-tile.js +0 -2
  39. package/dist/src/tiles/grid/item-tile.js.map +1 -1
  40. package/dist/src/tiles/grid/search-tile.js +0 -2
  41. package/dist/src/tiles/grid/search-tile.js.map +1 -1
  42. package/dist/src/tiles/hover/hover-pane-controller.d.ts +0 -1
  43. package/dist/src/tiles/hover/hover-pane-controller.js +12 -7
  44. package/dist/src/tiles/hover/hover-pane-controller.js.map +1 -1
  45. package/dist/src/tiles/hover/tile-hover-pane.d.ts +0 -1
  46. package/dist/src/tiles/hover/tile-hover-pane.js +0 -5
  47. package/dist/src/tiles/hover/tile-hover-pane.js.map +1 -1
  48. package/dist/src/tiles/image-block.d.ts +0 -1
  49. package/dist/src/tiles/image-block.js +0 -7
  50. package/dist/src/tiles/image-block.js.map +1 -1
  51. package/dist/src/tiles/item-image.d.ts +0 -1
  52. package/dist/src/tiles/item-image.js +2 -7
  53. package/dist/src/tiles/item-image.js.map +1 -1
  54. package/dist/src/tiles/list/tile-list-compact-header.js +0 -1
  55. package/dist/src/tiles/list/tile-list-compact-header.js.map +1 -1
  56. package/dist/src/tiles/list/tile-list-compact.js +0 -2
  57. package/dist/src/tiles/list/tile-list-compact.js.map +1 -1
  58. package/dist/src/tiles/list/tile-list.js +0 -2
  59. package/dist/src/tiles/list/tile-list.js.map +1 -1
  60. package/dist/src/tiles/tile-dispatcher.js +0 -7
  61. package/dist/src/tiles/tile-dispatcher.js.map +1 -1
  62. package/dist/test/collection-browser.test.js +44 -1
  63. package/dist/test/collection-browser.test.js.map +1 -1
  64. package/dist/test/collection-facets.test.js +24 -14
  65. package/dist/test/collection-facets.test.js.map +1 -1
  66. package/dist/test/mocks/mock-search-responses.d.ts +2 -0
  67. package/dist/test/mocks/mock-search-responses.js +92 -0
  68. package/dist/test/mocks/mock-search-responses.js.map +1 -1
  69. package/dist/test/mocks/mock-search-service.d.ts +1 -0
  70. package/dist/test/mocks/mock-search-service.js +6 -1
  71. package/dist/test/mocks/mock-search-service.js.map +1 -1
  72. package/dist/test/tiles/hover/hover-pane-controller.test.js +0 -1
  73. package/dist/test/tiles/hover/hover-pane-controller.test.js.map +1 -1
  74. package/local.archive.org.cert +86 -86
  75. package/local.archive.org.key +27 -27
  76. package/package.json +3 -3
  77. package/renovate.json +6 -6
  78. package/src/app-root.ts +6 -0
  79. package/src/collection-browser.ts +3 -68
  80. package/src/collection-facets/more-facets-content.ts +5 -2
  81. package/src/collection-facets/smart-facets/smart-facet-bar.ts +2 -1
  82. package/src/collection-facets.ts +109 -40
  83. package/src/data-source/collection-browser-data-source-interface.ts +13 -3
  84. package/src/data-source/collection-browser-data-source.ts +30 -9
  85. package/src/data-source/models.ts +5 -0
  86. package/src/expanded-date-picker.ts +10 -0
  87. package/src/models.ts +0 -36
  88. package/src/tiles/base-tile-component.ts +0 -2
  89. package/src/tiles/grid/account-tile.ts +0 -2
  90. package/src/tiles/grid/collection-tile.ts +0 -2
  91. package/src/tiles/grid/item-tile.ts +0 -2
  92. package/src/tiles/grid/search-tile.ts +0 -2
  93. package/src/tiles/hover/hover-pane-controller.ts +7 -2
  94. package/src/tiles/hover/tile-hover-pane.ts +0 -3
  95. package/src/tiles/image-block.ts +0 -5
  96. package/src/tiles/item-image.ts +2 -6
  97. package/src/tiles/list/tile-list-compact-header.ts +0 -1
  98. package/src/tiles/list/tile-list-compact.ts +0 -2
  99. package/src/tiles/list/tile-list.ts +0 -2
  100. package/src/tiles/tile-dispatcher.ts +0 -7
  101. package/test/collection-browser.test.ts +68 -1
  102. package/test/collection-facets.test.ts +24 -14
  103. package/test/mocks/mock-search-responses.ts +100 -0
  104. package/test/mocks/mock-search-service.ts +10 -0
  105. package/test/tiles/hover/hover-pane-controller.test.ts +0 -1
  106. package/web-dev-server.config.mjs +30 -30
  107. package/web-test-runner.config.mjs +41 -41
@@ -237,6 +237,60 @@ export const getMockSuccessWithYearHistogramAggs: () => Result<
237
237
  },
238
238
  });
239
239
 
240
+ export const getMockSuccessWithDateHistogramAggs: () => Result<
241
+ SearchResponse,
242
+ SearchServiceError
243
+ > = () => ({
244
+ success: {
245
+ request: {
246
+ kind: 'hits',
247
+ clientParameters: {
248
+ user_query: 'months',
249
+ sort: [],
250
+ },
251
+ backendRequests: {
252
+ primary: {
253
+ kind: 'hits',
254
+ finalized_parameters: {
255
+ user_query: 'months',
256
+ sort: [],
257
+ },
258
+ },
259
+ },
260
+ },
261
+ rawResponse: {},
262
+ sessionContext: {},
263
+ response: {
264
+ totalResults: 1,
265
+ returnedCount: 1,
266
+ aggregations: {
267
+ subject: new Aggregation({
268
+ buckets: [
269
+ {
270
+ key: 'foo',
271
+ doc_count: 3,
272
+ },
273
+ ],
274
+ }),
275
+ date_histogram: new Aggregation({
276
+ buckets: [1, 2, 3, 3, 2, 1],
277
+ first_bucket_year: 2000,
278
+ first_bucket_month: 1,
279
+ last_bucket_year: 2002,
280
+ last_bucket_month: 7,
281
+ interval_in_months: 6,
282
+ number_buckets: 6,
283
+ }),
284
+ },
285
+ results: [],
286
+ },
287
+ responseHeader: {
288
+ succeeded: true,
289
+ query_time: 0,
290
+ },
291
+ },
292
+ });
293
+
240
294
  export const getMockSuccessLoggedInResult: () => Result<
241
295
  SearchResponse,
242
296
  SearchServiceError
@@ -511,6 +565,52 @@ export const getMockSuccessWithCollectionTitles: () => Result<
511
565
  },
512
566
  });
513
567
 
568
+ export const getMockSuccessWithChannelAliases: () => Result<
569
+ SearchResponse,
570
+ SearchServiceError
571
+ > = () => ({
572
+ success: {
573
+ request: {
574
+ kind: 'hits',
575
+ clientParameters: {
576
+ user_query: 'collection:foo',
577
+ sort: [],
578
+ },
579
+ backendRequests: {
580
+ primary: {
581
+ kind: 'hits',
582
+ finalized_parameters: {
583
+ user_query: 'collection:foo',
584
+ sort: [],
585
+ },
586
+ },
587
+ },
588
+ },
589
+ rawResponse: {},
590
+ sessionContext: {},
591
+ response: {
592
+ totalResults: 1,
593
+ returnedCount: 1,
594
+ results: [
595
+ new TvClipHit({
596
+ fields: {
597
+ identifier: 'foo',
598
+ creator: ['foo', 'bar'],
599
+ },
600
+ }),
601
+ ],
602
+ tvChannelAliases: {
603
+ foo: 'Foo Network',
604
+ bar: 'Bar Network',
605
+ },
606
+ },
607
+ responseHeader: {
608
+ succeeded: true,
609
+ query_time: 0,
610
+ },
611
+ },
612
+ });
613
+
514
614
  export const getMockSuccessWithCollectionAggregations: () => Result<
515
615
  SearchResponse,
516
616
  SearchServiceError
@@ -14,12 +14,14 @@ import {
14
14
  getMockSuccessNoPreviewResult,
15
15
  getMockSuccessLoggedInAndNoPreviewResult,
16
16
  getMockSuccessWithYearHistogramAggs,
17
+ getMockSuccessWithDateHistogramAggs,
17
18
  getMockSuccessMultiLineDescription,
18
19
  getMockSuccessFirstTitleResult,
19
20
  getMockSuccessFirstCreatorResult,
20
21
  getMockErrorResult,
21
22
  getMockMalformedResult,
22
23
  getMockSuccessWithCollectionTitles,
24
+ getMockSuccessWithChannelAliases,
23
25
  getMockSuccessWithCollectionAggregations,
24
26
  getMockSuccessExtraQuotedHref,
25
27
  getMockSuccessWithDefaultSort,
@@ -40,6 +42,7 @@ const responses: Record<
40
42
  > = {
41
43
  'single-result': getMockSuccessSingleResult,
42
44
  years: getMockSuccessWithYearHistogramAggs,
45
+ months: getMockSuccessWithDateHistogramAggs,
43
46
  'multi-line-description': getMockSuccessMultiLineDescription,
44
47
  loggedin: getMockSuccessLoggedInResult,
45
48
  'no-preview': getMockSuccessNoPreviewResult,
@@ -47,6 +50,7 @@ const responses: Record<
47
50
  'first-title': getMockSuccessFirstTitleResult,
48
51
  'first-creator': getMockSuccessFirstCreatorResult,
49
52
  'collection-titles': getMockSuccessWithCollectionTitles,
53
+ 'channel-aliases': getMockSuccessWithChannelAliases,
50
54
  'collection-aggregations': getMockSuccessWithCollectionAggregations,
51
55
  'extra-quoted-href': getMockSuccessExtraQuotedHref,
52
56
  'default-sort': getMockSuccessWithDefaultSort,
@@ -116,4 +120,10 @@ export class MockSearchService implements SearchServiceInterface {
116
120
 
117
121
  return result;
118
122
  }
123
+
124
+ async itemDetails(
125
+ identifier: string,
126
+ ): Promise<Result<SearchResponse, SearchServiceError>> {
127
+ throw new Error('Method not implemented.');
128
+ }
119
129
  }
@@ -54,7 +54,6 @@ class HostElement extends LitElement implements HoverPaneProviderInterface {
54
54
  return {
55
55
  model: tileModel,
56
56
  loggedIn: false,
57
- suppressBlurring: false,
58
57
  sortParam: null,
59
58
  };
60
59
  }
@@ -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
+ });