@internetarchive/collection-browser 4.4.1 → 4.5.1-alpha-webdev8221.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- 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 +26 -0
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +8 -4
- package/dist/src/collection-browser.js +20 -11
- 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 +19 -1
- package/dist/src/collection-facets/facet-row.js.map +1 -1
- package/dist/src/collection-facets/facets-template.js +2 -0
- package/dist/src/collection-facets/facets-template.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source-interface.d.ts +5 -0
- package/dist/src/data-source/collection-browser-data-source-interface.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.d.ts +1 -1
- package/dist/src/data-source/collection-browser-data-source.js +8 -6
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/restoration-state-handler.js +2 -4
- package/dist/src/restoration-state-handler.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 +1 -0
- package/dist/src/tiles/grid/item-tile.js.map +1 -1
- package/dist/src/tiles/list/tile-list-compact-header.js +27 -2
- 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 +113 -75
- 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 +164 -146
- 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 +107 -4
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/utils/date-filter-field.d.ts +6 -0
- package/dist/src/utils/date-filter-field.js +9 -0
- package/dist/src/utils/date-filter-field.js.map +1 -0
- package/dist/test/collection-browser.test.js +81 -0
- package/dist/test/collection-browser.test.js.map +1 -1
- package/dist/test/collection-facets/facet-row.test.js +32 -0
- package/dist/test/collection-facets/facet-row.test.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- package/index.ts +1 -0
- 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 +30 -0
- package/src/collection-browser.ts +17 -13
- package/src/collection-facets/facet-row.ts +11 -1
- package/src/collection-facets/facets-template.ts +2 -0
- package/src/data-source/collection-browser-data-source-interface.ts +6 -0
- package/src/data-source/collection-browser-data-source.ts +16 -7
- package/src/restoration-state-handler.ts +5 -5
- package/src/styles/tile-action-styles.ts +59 -0
- package/src/tiles/base-tile-component.ts +60 -1
- package/src/tiles/grid/item-tile.ts +1 -0
- package/src/tiles/list/tile-list-compact-header.ts +28 -2
- package/src/tiles/list/tile-list-compact.ts +114 -75
- package/src/tiles/list/tile-list.ts +190 -172
- package/src/tiles/models.ts +13 -0
- package/src/tiles/tile-dispatcher.ts +114 -4
- package/src/utils/date-filter-field.ts +11 -0
- package/test/collection-browser.test.ts +132 -0
- package/test/collection-facets/facet-row.test.ts +46 -0
- package/tsconfig.json +25 -25
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +52 -52
|
@@ -2504,4 +2504,136 @@ describe('Collection Browser', () => {
|
|
|
2504
2504
|
const initialResults = el.dataSource.getAllPages();
|
|
2505
2505
|
expect(Object.keys(initialResults).length).to.deep.equal(numberOfPages);
|
|
2506
2506
|
});
|
|
2507
|
+
|
|
2508
|
+
it('uses date filter field for YYYY-MM selected dates', async () => {
|
|
2509
|
+
const searchService = new MockSearchService();
|
|
2510
|
+
const el = await fixture<CollectionBrowser>(
|
|
2511
|
+
html`<collection-browser .searchService=${searchService}>
|
|
2512
|
+
</collection-browser>`,
|
|
2513
|
+
);
|
|
2514
|
+
|
|
2515
|
+
el.baseQuery = 'months';
|
|
2516
|
+
el.searchType = SearchType.TV;
|
|
2517
|
+
el.minSelectedDate = '2001-02';
|
|
2518
|
+
el.maxSelectedDate = '2002-12';
|
|
2519
|
+
await el.updateComplete;
|
|
2520
|
+
await el.initialSearchComplete;
|
|
2521
|
+
|
|
2522
|
+
expect(searchService.searchParams?.filters?.date?.['2001-02']).to.equal(
|
|
2523
|
+
FilterConstraint.GREATER_OR_EQUAL,
|
|
2524
|
+
);
|
|
2525
|
+
expect(searchService.searchParams?.filters?.date?.['2002-12']).to.equal(
|
|
2526
|
+
FilterConstraint.LESS_OR_EQUAL,
|
|
2527
|
+
);
|
|
2528
|
+
expect(searchService.searchParams?.filters?.year).not.to.exist;
|
|
2529
|
+
});
|
|
2530
|
+
|
|
2531
|
+
it('still uses year filter field for YYYY selected dates', async () => {
|
|
2532
|
+
const searchService = new MockSearchService();
|
|
2533
|
+
const el = await fixture<CollectionBrowser>(
|
|
2534
|
+
html`<collection-browser .searchService=${searchService}>
|
|
2535
|
+
</collection-browser>`,
|
|
2536
|
+
);
|
|
2537
|
+
|
|
2538
|
+
el.baseQuery = 'years';
|
|
2539
|
+
el.minSelectedDate = '1950';
|
|
2540
|
+
el.maxSelectedDate = '1970';
|
|
2541
|
+
await el.updateComplete;
|
|
2542
|
+
await el.initialSearchComplete;
|
|
2543
|
+
|
|
2544
|
+
expect(searchService.searchParams?.filters?.year?.['1950']).to.equal(
|
|
2545
|
+
FilterConstraint.GREATER_OR_EQUAL,
|
|
2546
|
+
);
|
|
2547
|
+
expect(searchService.searchParams?.filters?.year?.['1970']).to.equal(
|
|
2548
|
+
FilterConstraint.LESS_OR_EQUAL,
|
|
2549
|
+
);
|
|
2550
|
+
expect(searchService.searchParams?.filters?.date).not.to.exist;
|
|
2551
|
+
});
|
|
2552
|
+
|
|
2553
|
+
it('selects date_histogram for isTVCollection even with metadata searchType', async () => {
|
|
2554
|
+
const searchService = new MockSearchService();
|
|
2555
|
+
const el = await fixture<CollectionBrowser>(
|
|
2556
|
+
html`<collection-browser
|
|
2557
|
+
.searchService=${searchService}
|
|
2558
|
+
.suppressPlaceholders=${true}
|
|
2559
|
+
>
|
|
2560
|
+
</collection-browser>`,
|
|
2561
|
+
);
|
|
2562
|
+
|
|
2563
|
+
el.baseQuery = 'months';
|
|
2564
|
+
el.isTVCollection = true;
|
|
2565
|
+
el.showHistogramDatePicker = true;
|
|
2566
|
+
await el.updateComplete;
|
|
2567
|
+
await el.initialSearchComplete;
|
|
2568
|
+
await nextTick();
|
|
2569
|
+
|
|
2570
|
+
const facets = el.shadowRoot?.querySelector(
|
|
2571
|
+
'collection-facets',
|
|
2572
|
+
) as CollectionFacets;
|
|
2573
|
+
await facets?.updateComplete;
|
|
2574
|
+
await nextTick();
|
|
2575
|
+
|
|
2576
|
+
const histogram = facets?.shadowRoot?.querySelector(
|
|
2577
|
+
'histogram-date-range',
|
|
2578
|
+
) as HistogramDateRange;
|
|
2579
|
+
|
|
2580
|
+
expect(histogram, 'histogram exists').to.exist;
|
|
2581
|
+
});
|
|
2582
|
+
|
|
2583
|
+
it('uses date: query clause for YYYY-MM date ranges', async () => {
|
|
2584
|
+
const searchService = new MockSearchService();
|
|
2585
|
+
const mockAnalyticsHandler = new MockAnalyticsHandler();
|
|
2586
|
+
const el = await fixture<CollectionBrowser>(
|
|
2587
|
+
html`<collection-browser
|
|
2588
|
+
.searchService=${searchService}
|
|
2589
|
+
.analyticsHandler=${mockAnalyticsHandler}
|
|
2590
|
+
.suppressPlaceholders=${true}
|
|
2591
|
+
>
|
|
2592
|
+
</collection-browser>`,
|
|
2593
|
+
);
|
|
2594
|
+
|
|
2595
|
+
el.baseQuery = 'months';
|
|
2596
|
+
el.searchType = SearchType.TV;
|
|
2597
|
+
el.showHistogramDatePicker = true;
|
|
2598
|
+
await el.updateComplete;
|
|
2599
|
+
|
|
2600
|
+
const facets = el.shadowRoot?.querySelector(
|
|
2601
|
+
'collection-facets',
|
|
2602
|
+
) as CollectionFacets;
|
|
2603
|
+
await facets?.updateComplete;
|
|
2604
|
+
|
|
2605
|
+
await nextTick();
|
|
2606
|
+
|
|
2607
|
+
const histogram = facets?.shadowRoot?.querySelector(
|
|
2608
|
+
'histogram-date-range',
|
|
2609
|
+
) as HistogramDateRange;
|
|
2610
|
+
|
|
2611
|
+
expect(histogram, 'histogram exists').to.exist;
|
|
2612
|
+
|
|
2613
|
+
// Enter a new min date into the date picker
|
|
2614
|
+
const minDateInput = histogram.shadowRoot?.querySelector(
|
|
2615
|
+
'#date-min',
|
|
2616
|
+
) as HTMLInputElement;
|
|
2617
|
+
|
|
2618
|
+
const pressEnterEvent = new KeyboardEvent('keyup', {
|
|
2619
|
+
key: 'Enter',
|
|
2620
|
+
});
|
|
2621
|
+
|
|
2622
|
+
minDateInput.value = '2001-02';
|
|
2623
|
+
minDateInput.dispatchEvent(pressEnterEvent);
|
|
2624
|
+
|
|
2625
|
+
// Wait for the histogram's update delay
|
|
2626
|
+
await aTimeout(histogram.updateDelay + 50);
|
|
2627
|
+
|
|
2628
|
+
await el.updateComplete;
|
|
2629
|
+
expect(el.minSelectedDate).to.equal('2001-02');
|
|
2630
|
+
expect(el.maxSelectedDate).to.equal('2002-12');
|
|
2631
|
+
|
|
2632
|
+
// Verify the analytics event used date: not year:
|
|
2633
|
+
expect(mockAnalyticsHandler.callAction).to.equal(
|
|
2634
|
+
analyticsActions.histogramChanged,
|
|
2635
|
+
);
|
|
2636
|
+
expect(mockAnalyticsHandler.callLabel).to.include('date:');
|
|
2637
|
+
expect(mockAnalyticsHandler.callLabel).not.to.include('year:');
|
|
2638
|
+
});
|
|
2507
2639
|
});
|
|
@@ -122,6 +122,52 @@ describe('Facet row', () => {
|
|
|
122
122
|
);
|
|
123
123
|
});
|
|
124
124
|
|
|
125
|
+
it('omits hide button when property is specified (and facet state is not hidden)', async () => {
|
|
126
|
+
const bucket = {
|
|
127
|
+
key: 'foo',
|
|
128
|
+
state: 'none' as FacetState,
|
|
129
|
+
count: 5,
|
|
130
|
+
};
|
|
131
|
+
|
|
132
|
+
const el = await fixture<FacetRow>(
|
|
133
|
+
html`<facet-row
|
|
134
|
+
.facetType=${'subject'}
|
|
135
|
+
.bucket=${bucket}
|
|
136
|
+
omitHideButton
|
|
137
|
+
></facet-row>`,
|
|
138
|
+
);
|
|
139
|
+
|
|
140
|
+
// Hide button's container is hidden
|
|
141
|
+
expect(
|
|
142
|
+
el.shadowRoot
|
|
143
|
+
?.querySelector('.hide-facet-container')
|
|
144
|
+
?.hasAttribute('hidden'),
|
|
145
|
+
).to.be.true;
|
|
146
|
+
});
|
|
147
|
+
|
|
148
|
+
it('does not omit hide button when facet state is hidden, even if property specified', async () => {
|
|
149
|
+
const bucket = {
|
|
150
|
+
key: 'foo',
|
|
151
|
+
state: 'hidden' as FacetState,
|
|
152
|
+
count: 5,
|
|
153
|
+
};
|
|
154
|
+
|
|
155
|
+
const el = await fixture<FacetRow>(
|
|
156
|
+
html`<facet-row
|
|
157
|
+
.facetType=${'subject'}
|
|
158
|
+
.bucket=${bucket}
|
|
159
|
+
omitHideButton
|
|
160
|
+
></facet-row>`,
|
|
161
|
+
);
|
|
162
|
+
|
|
163
|
+
// Hide button's container is NOT hidden (i.e., we SHOW the hide button like normal)
|
|
164
|
+
expect(
|
|
165
|
+
el.shadowRoot
|
|
166
|
+
?.querySelector('.hide-facet-container')
|
|
167
|
+
?.hasAttribute('hidden'),
|
|
168
|
+
).to.be.false;
|
|
169
|
+
});
|
|
170
|
+
|
|
125
171
|
it('renders correct accessible label for unchecked negative facets', async () => {
|
|
126
172
|
const bucket = {
|
|
127
173
|
key: 'foo',
|
package/tsconfig.json
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"target": "esnext",
|
|
4
|
-
"module": "esnext",
|
|
5
|
-
"moduleResolution": "bundler",
|
|
6
|
-
"noEmitOnError": true,
|
|
7
|
-
"lib": [
|
|
8
|
-
"ESNext",
|
|
9
|
-
"dom",
|
|
10
|
-
"dom.iterable"
|
|
11
|
-
],
|
|
12
|
-
"strict": true,
|
|
13
|
-
"esModuleInterop": false,
|
|
14
|
-
"allowSyntheticDefaultImports": true,
|
|
15
|
-
"experimentalDecorators": true,
|
|
16
|
-
"importHelpers": true,
|
|
17
|
-
"outDir": "dist",
|
|
18
|
-
"sourceMap": true,
|
|
19
|
-
"inlineSources": true,
|
|
20
|
-
"rootDir": "./",
|
|
21
|
-
"declaration": true,
|
|
22
|
-
"useDefineForClassFields": false,
|
|
23
|
-
},
|
|
24
|
-
"include": ["src", "test", "index.ts", "types"],
|
|
25
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "esnext",
|
|
4
|
+
"module": "esnext",
|
|
5
|
+
"moduleResolution": "bundler",
|
|
6
|
+
"noEmitOnError": true,
|
|
7
|
+
"lib": [
|
|
8
|
+
"ESNext",
|
|
9
|
+
"dom",
|
|
10
|
+
"dom.iterable"
|
|
11
|
+
],
|
|
12
|
+
"strict": true,
|
|
13
|
+
"esModuleInterop": false,
|
|
14
|
+
"allowSyntheticDefaultImports": true,
|
|
15
|
+
"experimentalDecorators": true,
|
|
16
|
+
"importHelpers": true,
|
|
17
|
+
"outDir": "dist",
|
|
18
|
+
"sourceMap": true,
|
|
19
|
+
"inlineSources": true,
|
|
20
|
+
"rootDir": "./",
|
|
21
|
+
"declaration": true,
|
|
22
|
+
"useDefineForClassFields": false,
|
|
23
|
+
},
|
|
24
|
+
"include": ["src", "test", "index.ts", "types"],
|
|
25
|
+
}
|
|
@@ -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,52 +1,52 @@
|
|
|
1
|
-
import rollupImage from '@rollup/plugin-image';
|
|
2
|
-
import { rollupAdapter } from '@web/dev-server-rollup';
|
|
3
|
-
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
4
|
-
|
|
5
|
-
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
6
|
-
|
|
7
|
-
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
8
|
-
/** Test files to run */
|
|
9
|
-
files: 'dist/test/**/*.test.js',
|
|
10
|
-
|
|
11
|
-
/** Resolve bare module imports */
|
|
12
|
-
nodeResolve: {
|
|
13
|
-
exportConditions: ['browser', 'development'],
|
|
14
|
-
},
|
|
15
|
-
|
|
16
|
-
mimeTypes: {
|
|
17
|
-
'**/*.scss': 'js',
|
|
18
|
-
'**/*.css': 'js',
|
|
19
|
-
'**/*.svg': 'js',
|
|
20
|
-
'**/*.json': 'js',
|
|
21
|
-
},
|
|
22
|
-
|
|
23
|
-
/** Filter out lit dev mode logs */
|
|
24
|
-
filterBrowserLogs(log) {
|
|
25
|
-
for (const arg of log.args) {
|
|
26
|
-
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
27
|
-
return false;
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
return true;
|
|
31
|
-
},
|
|
32
|
-
|
|
33
|
-
plugins: [rollupAdapter(rollupImage())],
|
|
34
|
-
|
|
35
|
-
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
36
|
-
// esbuildTarget: 'auto',
|
|
37
|
-
|
|
38
|
-
/** Amount of browsers to run concurrently */
|
|
39
|
-
// concurrentBrowsers: 2,
|
|
40
|
-
|
|
41
|
-
/** Amount of test files per browser to test concurrently */
|
|
42
|
-
// concurrency: 1,
|
|
43
|
-
|
|
44
|
-
/** Browsers to run tests on */
|
|
45
|
-
// browsers: [
|
|
46
|
-
// playwrightLauncher({ product: 'chromium' }),
|
|
47
|
-
// playwrightLauncher({ product: 'firefox' }),
|
|
48
|
-
// playwrightLauncher({ product: 'webkit' }),
|
|
49
|
-
// ],
|
|
50
|
-
|
|
51
|
-
// See documentation for all available options
|
|
52
|
-
});
|
|
1
|
+
import rollupImage from '@rollup/plugin-image';
|
|
2
|
+
import { rollupAdapter } from '@web/dev-server-rollup';
|
|
3
|
+
// import { playwrightLauncher } from '@web/test-runner-playwright';
|
|
4
|
+
|
|
5
|
+
const filteredLogs = ['Running in dev mode', 'lit-html is in dev mode'];
|
|
6
|
+
|
|
7
|
+
export default /** @type {import("@web/test-runner").TestRunnerConfig} */ ({
|
|
8
|
+
/** Test files to run */
|
|
9
|
+
files: 'dist/test/**/*.test.js',
|
|
10
|
+
|
|
11
|
+
/** Resolve bare module imports */
|
|
12
|
+
nodeResolve: {
|
|
13
|
+
exportConditions: ['browser', 'development'],
|
|
14
|
+
},
|
|
15
|
+
|
|
16
|
+
mimeTypes: {
|
|
17
|
+
'**/*.scss': 'js',
|
|
18
|
+
'**/*.css': 'js',
|
|
19
|
+
'**/*.svg': 'js',
|
|
20
|
+
'**/*.json': 'js',
|
|
21
|
+
},
|
|
22
|
+
|
|
23
|
+
/** Filter out lit dev mode logs */
|
|
24
|
+
filterBrowserLogs(log) {
|
|
25
|
+
for (const arg of log.args) {
|
|
26
|
+
if (typeof arg === 'string' && filteredLogs.some(l => arg.includes(l))) {
|
|
27
|
+
return false;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
return true;
|
|
31
|
+
},
|
|
32
|
+
|
|
33
|
+
plugins: [rollupAdapter(rollupImage())],
|
|
34
|
+
|
|
35
|
+
/** Compile JS for older browsers. Requires @web/dev-server-esbuild plugin */
|
|
36
|
+
// esbuildTarget: 'auto',
|
|
37
|
+
|
|
38
|
+
/** Amount of browsers to run concurrently */
|
|
39
|
+
// concurrentBrowsers: 2,
|
|
40
|
+
|
|
41
|
+
/** Amount of test files per browser to test concurrently */
|
|
42
|
+
// concurrency: 1,
|
|
43
|
+
|
|
44
|
+
/** Browsers to run tests on */
|
|
45
|
+
// browsers: [
|
|
46
|
+
// playwrightLauncher({ product: 'chromium' }),
|
|
47
|
+
// playwrightLauncher({ product: 'firefox' }),
|
|
48
|
+
// playwrightLauncher({ product: 'webkit' }),
|
|
49
|
+
// ],
|
|
50
|
+
|
|
51
|
+
// See documentation for all available options
|
|
52
|
+
});
|