@internetarchive/collection-browser 4.3.2-rc-webdev-8334.2 → 4.4.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/src/app-root.js +676 -672
- package/dist/src/app-root.js.map +1 -1
- package/dist/src/collection-browser.d.ts +41 -0
- package/dist/src/collection-browser.js +890 -797
- package/dist/src/collection-browser.js.map +1 -1
- package/dist/src/data-source/collection-browser-data-source.js.map +1 -1
- package/dist/src/tiles/item-image.d.ts +9 -1
- package/dist/src/tiles/item-image.js +50 -30
- package/dist/src/tiles/item-image.js.map +1 -1
- package/dist/src/tiles/tile-dispatcher.js +1 -6
- package/dist/src/tiles/tile-dispatcher.js.map +1 -1
- package/dist/src/tiles/tile-display-value-provider.js +1 -2
- package/dist/src/tiles/tile-display-value-provider.js.map +1 -1
- package/dist/test/tiles/grid/item-tile.test.js +2 -2
- package/dist/test/tiles/grid/item-tile.test.js.map +1 -1
- package/dist/test/tiles/list/tile-list.test.js +2 -2
- package/dist/test/tiles/list/tile-list.test.js.map +1 -1
- package/dist/test/tiles/tile-dispatcher.test.js +0 -28
- package/dist/test/tiles/tile-dispatcher.test.js.map +1 -1
- package/eslint.config.mjs +53 -53
- package/index.html +24 -24
- 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 +1254 -1251
- package/src/collection-browser.ts +3161 -3049
- package/src/data-source/collection-browser-data-source.ts +1465 -1465
- package/src/tiles/item-image.ts +214 -187
- package/src/tiles/tile-dispatcher.ts +1 -6
- package/src/tiles/tile-display-value-provider.ts +3 -2
- package/test/tiles/grid/item-tile.test.ts +2 -2
- package/test/tiles/list/tile-list.test.ts +2 -2
- package/test/tiles/tile-dispatcher.test.ts +0 -36
- package/tsconfig.json +25 -25
- package/web-dev-server.config.mjs +30 -30
- package/web-test-runner.config.mjs +52 -52
package/src/tiles/item-image.ts
CHANGED
|
@@ -1,187 +1,214 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
} from '
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
this.
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
.
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
1
|
+
import {
|
|
2
|
+
css,
|
|
3
|
+
CSSResultGroup,
|
|
4
|
+
html,
|
|
5
|
+
LitElement,
|
|
6
|
+
nothing,
|
|
7
|
+
PropertyValues,
|
|
8
|
+
} from 'lit';
|
|
9
|
+
import { customElement, property, query, state } from 'lit/decorators.js';
|
|
10
|
+
import { ClassInfo, classMap } from 'lit/directives/class-map.js';
|
|
11
|
+
|
|
12
|
+
import type { TileModel } from '../models';
|
|
13
|
+
|
|
14
|
+
import {
|
|
15
|
+
baseItemImageStyles,
|
|
16
|
+
waveformGradientStyles,
|
|
17
|
+
} from '../styles/item-image-styles';
|
|
18
|
+
import { searchIcon } from '../assets/img/icons/mediatype/search';
|
|
19
|
+
|
|
20
|
+
@customElement('item-image')
|
|
21
|
+
export class ItemImage extends LitElement {
|
|
22
|
+
/**
|
|
23
|
+
* Map to cache which identifiers have waveform-style thumbnails, so that
|
|
24
|
+
* they can have their waveform styling applied immediately, rather than
|
|
25
|
+
* waiting for the image content to load before applying it (which can
|
|
26
|
+
* cause noticeable flicker when such tiles refresh).
|
|
27
|
+
*/
|
|
28
|
+
private static readonly waveformByIdentifier = new Map<string, boolean>();
|
|
29
|
+
|
|
30
|
+
@property({ type: Object }) model?: TileModel;
|
|
31
|
+
|
|
32
|
+
@property({ type: String }) baseImageUrl?: string;
|
|
33
|
+
|
|
34
|
+
@property({ type: Boolean }) isListTile = false;
|
|
35
|
+
|
|
36
|
+
@property({ type: Boolean }) isCompactTile = false;
|
|
37
|
+
|
|
38
|
+
@property({ type: Boolean }) loggedIn = false;
|
|
39
|
+
|
|
40
|
+
@property({ type: Boolean }) suppressBlurring = false;
|
|
41
|
+
|
|
42
|
+
@state() private isWaveform = false;
|
|
43
|
+
|
|
44
|
+
@state() private isNotFound = false;
|
|
45
|
+
|
|
46
|
+
@query('img') private baseImage!: HTMLImageElement;
|
|
47
|
+
|
|
48
|
+
protected willUpdate(changed: PropertyValues): void {
|
|
49
|
+
if (changed.has('model')) {
|
|
50
|
+
// If this identifier is known to have a waveform image, then set isWaveform upfront
|
|
51
|
+
const identifier = this.model?.identifier;
|
|
52
|
+
this.isWaveform =
|
|
53
|
+
ItemImage.waveformByIdentifier.get(identifier as string) === true;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
render() {
|
|
58
|
+
return html`
|
|
59
|
+
<div class=${classMap(this.itemBaseClass)}>${this.imageTemplate}</div>
|
|
60
|
+
`;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
private get imageTemplate() {
|
|
64
|
+
if (this.model?.mediatype === 'search') {
|
|
65
|
+
return html`${searchIcon}`;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
return html`
|
|
69
|
+
<img
|
|
70
|
+
class=${classMap(this.itemImageClass)}
|
|
71
|
+
src="${this.imageSrc}"
|
|
72
|
+
alt=""
|
|
73
|
+
@load=${this.onLoad}
|
|
74
|
+
@error=${this.onError}
|
|
75
|
+
/>
|
|
76
|
+
`;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Helpers
|
|
81
|
+
*/
|
|
82
|
+
private get imageSrc() {
|
|
83
|
+
if (this.isNotFound) return this.notFoundSrc;
|
|
84
|
+
|
|
85
|
+
// Use the correct image for web capture tiles, if possible
|
|
86
|
+
if (this.model?.captureDates && this.model.identifier) {
|
|
87
|
+
try {
|
|
88
|
+
const url = new URL(this.model.identifier);
|
|
89
|
+
const domain = encodeURIComponent(url.hostname);
|
|
90
|
+
return this.baseImageUrl
|
|
91
|
+
? `https://web.archive.org/thumb/${domain}?generate=1`
|
|
92
|
+
: nothing;
|
|
93
|
+
} catch {
|
|
94
|
+
return `${this.baseImageUrl}/images/notfound.png`;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Use the thumbnail URL specified in the model if it exists
|
|
99
|
+
if (this.model?.thumbnailUrl) return this.model.thumbnailUrl;
|
|
100
|
+
|
|
101
|
+
// Don't try to load invalid image URLs
|
|
102
|
+
return this.baseImageUrl && this.model?.identifier
|
|
103
|
+
? `${this.baseImageUrl}/services/img/${this.model.identifier}`
|
|
104
|
+
: nothing;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
private get notFoundSrc() {
|
|
108
|
+
return this.baseImageUrl
|
|
109
|
+
? `${this.baseImageUrl}/images/notfound.png`
|
|
110
|
+
: nothing;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
private get hashBasedGradient() {
|
|
114
|
+
if (!this.model?.identifier) {
|
|
115
|
+
return 'waveform-grad0';
|
|
116
|
+
}
|
|
117
|
+
const gradient = this.hashStrToInt(this.model.identifier) % 6; // returns 0-5
|
|
118
|
+
return `waveform-grad${gradient}`;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
private hashStrToInt(str: string): number {
|
|
122
|
+
return str
|
|
123
|
+
.split('')
|
|
124
|
+
.reduce((acc: number, char: string) => acc + char.charCodeAt(0), 0);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Classes
|
|
129
|
+
*/
|
|
130
|
+
private get itemBaseClass(): ClassInfo {
|
|
131
|
+
return {
|
|
132
|
+
'drop-shadow': true,
|
|
133
|
+
'list-box': this.isListTile,
|
|
134
|
+
'search-image': this.model?.mediatype === 'search',
|
|
135
|
+
[this.hashBasedGradient]: this.isWaveform,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
private get itemImageClass(): ClassInfo {
|
|
140
|
+
const hasSensitiveContent = !!(
|
|
141
|
+
this.model?.contentWarning || this.model?.loginRequired
|
|
142
|
+
);
|
|
143
|
+
const shouldBlur = hasSensitiveContent && !this.suppressBlurring;
|
|
144
|
+
|
|
145
|
+
return {
|
|
146
|
+
contain: !this.isCompactTile && !this.isWaveform,
|
|
147
|
+
cover: this.isCompactTile,
|
|
148
|
+
blur: shouldBlur,
|
|
149
|
+
waveform: this.isWaveform,
|
|
150
|
+
'account-image': this.isAccountImage, // for account tile image
|
|
151
|
+
'collection-image': this.model?.mediatype === 'collection', // for collection tile image
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Helper function to determine if account tile image
|
|
157
|
+
*/
|
|
158
|
+
private get isAccountImage() {
|
|
159
|
+
return (
|
|
160
|
+
this.model?.mediatype === 'account' &&
|
|
161
|
+
!this.isCompactTile &&
|
|
162
|
+
!this.isListTile
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Event listener sets isWaveform true if image is waveform
|
|
168
|
+
*/
|
|
169
|
+
private onLoad() {
|
|
170
|
+
if (
|
|
171
|
+
(this.model?.mediatype === 'audio' ||
|
|
172
|
+
this.model?.mediatype === 'etree') &&
|
|
173
|
+
this.baseImage.naturalWidth / this.baseImage.naturalHeight === 4
|
|
174
|
+
) {
|
|
175
|
+
this.isWaveform = true;
|
|
176
|
+
if (this.model?.identifier) {
|
|
177
|
+
ItemImage.waveformByIdentifier.set(this.model.identifier, true);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
private onError() {
|
|
183
|
+
this.isNotFound = true;
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
/**
|
|
187
|
+
* CSS
|
|
188
|
+
*/
|
|
189
|
+
static get styles(): CSSResultGroup {
|
|
190
|
+
return [
|
|
191
|
+
baseItemImageStyles,
|
|
192
|
+
waveformGradientStyles,
|
|
193
|
+
css`
|
|
194
|
+
img {
|
|
195
|
+
height: var(--imgHeight, 16rem);
|
|
196
|
+
width: var(--imgWidth, 16rem);
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
.search-image {
|
|
200
|
+
display: flex;
|
|
201
|
+
align-items: center;
|
|
202
|
+
justify-content: center;
|
|
203
|
+
background: rgb(245, 245, 247);
|
|
204
|
+
border-radius: 4px;
|
|
205
|
+
}
|
|
206
|
+
|
|
207
|
+
svg {
|
|
208
|
+
height: 10rem;
|
|
209
|
+
width: 10rem;
|
|
210
|
+
}
|
|
211
|
+
`,
|
|
212
|
+
];
|
|
213
|
+
}
|
|
214
|
+
}
|
|
@@ -176,12 +176,7 @@ export class TileDispatcher
|
|
|
176
176
|
// Use the server-specified href if available.
|
|
177
177
|
// Otherwise, construct a details page URL from the item identifier.
|
|
178
178
|
if (this.model.href) {
|
|
179
|
-
|
|
180
|
-
// target URL was incorrectly percent-encoded — decode it before use.
|
|
181
|
-
const href = /%3A/i.test(this.model.href)
|
|
182
|
-
? decodeURIComponent(this.model.href)
|
|
183
|
-
: this.model.href;
|
|
184
|
-
return `${this.baseNavigationUrl}${href}`;
|
|
179
|
+
return `${this.baseNavigationUrl}${this.model.href}`;
|
|
185
180
|
}
|
|
186
181
|
|
|
187
182
|
return this.displayValueProvider.itemPageUrl(
|
|
@@ -124,8 +124,9 @@ export class TileDisplayValueProvider {
|
|
|
124
124
|
.toISOString()
|
|
125
125
|
.replace(/[TZ:-]/g, '')
|
|
126
126
|
.replace(/\..*/, '');
|
|
127
|
-
|
|
128
|
-
|
|
127
|
+
const captureHref = `https://web.archive.org/web/${captureDateStr}/${encodeURIComponent(
|
|
128
|
+
url,
|
|
129
|
+
)}`;
|
|
129
130
|
const captureText = formatDate(date, 'long');
|
|
130
131
|
|
|
131
132
|
return html` <a href=${captureHref}> ${captureText} </a> `;
|
|
@@ -453,7 +453,7 @@ describe('Item Tile', () => {
|
|
|
453
453
|
const firstDateLink = captureDatesUl?.children[0]?.querySelector('a[href]');
|
|
454
454
|
expect(firstDateLink, 'first date link').to.exist;
|
|
455
455
|
expect(firstDateLink?.getAttribute('href')).to.equal(
|
|
456
|
-
'https://web.archive.org/web/20100102123456/https
|
|
456
|
+
'https://web.archive.org/web/20100102123456/https%3A%2F%2Fexample.com%2F',
|
|
457
457
|
);
|
|
458
458
|
expect(firstDateLink?.textContent?.trim()).to.equal('Jan 02, 2010');
|
|
459
459
|
|
|
@@ -461,7 +461,7 @@ describe('Item Tile', () => {
|
|
|
461
461
|
captureDatesUl?.children[1]?.querySelector('a[href]');
|
|
462
462
|
expect(secondDateLink, 'second date link').to.exist;
|
|
463
463
|
expect(secondDateLink?.getAttribute('href')).to.equal(
|
|
464
|
-
'https://web.archive.org/web/20110203124321/https
|
|
464
|
+
'https://web.archive.org/web/20110203124321/https%3A%2F%2Fexample.com%2F',
|
|
465
465
|
);
|
|
466
466
|
expect(secondDateLink?.textContent?.trim()).to.equal('Feb 03, 2011');
|
|
467
467
|
});
|
|
@@ -509,7 +509,7 @@ describe('List Tile', () => {
|
|
|
509
509
|
const firstDateLink = captureDatesUl?.children[0]?.querySelector('a[href]');
|
|
510
510
|
expect(firstDateLink, 'first date link').to.exist;
|
|
511
511
|
expect(firstDateLink?.getAttribute('href')).to.equal(
|
|
512
|
-
'https://web.archive.org/web/20100102123456/https
|
|
512
|
+
'https://web.archive.org/web/20100102123456/https%3A%2F%2Fexample.com%2F',
|
|
513
513
|
);
|
|
514
514
|
expect(firstDateLink?.textContent?.trim()).to.equal('Jan 02, 2010');
|
|
515
515
|
|
|
@@ -517,7 +517,7 @@ describe('List Tile', () => {
|
|
|
517
517
|
captureDatesUl?.children[1]?.querySelector('a[href]');
|
|
518
518
|
expect(secondDateLink, 'second date link').to.exist;
|
|
519
519
|
expect(secondDateLink?.getAttribute('href')).to.equal(
|
|
520
|
-
'https://web.archive.org/web/20110203124321/https
|
|
520
|
+
'https://web.archive.org/web/20110203124321/https%3A%2F%2Fexample.com%2F',
|
|
521
521
|
);
|
|
522
522
|
expect(secondDateLink?.textContent?.trim()).to.equal('Feb 03, 2011');
|
|
523
523
|
});
|
|
@@ -110,42 +110,6 @@ describe('Tile Dispatcher', () => {
|
|
|
110
110
|
window.open = oldWindowOpen;
|
|
111
111
|
});
|
|
112
112
|
|
|
113
|
-
it('should use model href as-is when not percent-encoded', async () => {
|
|
114
|
-
const el = await fixture<TileDispatcher>(html`
|
|
115
|
-
<tile-dispatcher
|
|
116
|
-
.model=${{
|
|
117
|
-
identifier: 'foo',
|
|
118
|
-
href: 'https://web.archive.org/web/20180613065659/http://www.sankei.com/',
|
|
119
|
-
}}
|
|
120
|
-
.baseNavigationUrl=${''}
|
|
121
|
-
></tile-dispatcher>
|
|
122
|
-
`);
|
|
123
|
-
|
|
124
|
-
const tileLink = el.shadowRoot?.querySelector('a[href]') as HTMLAnchorElement;
|
|
125
|
-
expect(tileLink).to.exist;
|
|
126
|
-
expect(tileLink.getAttribute('href')).to.equal(
|
|
127
|
-
'https://web.archive.org/web/20180613065659/http://www.sankei.com/',
|
|
128
|
-
);
|
|
129
|
-
});
|
|
130
|
-
|
|
131
|
-
it('should decode percent-encoded model href before use', async () => {
|
|
132
|
-
const el = await fixture<TileDispatcher>(html`
|
|
133
|
-
<tile-dispatcher
|
|
134
|
-
.model=${{
|
|
135
|
-
identifier: 'foo',
|
|
136
|
-
href: 'https://web.archive.org/web/20180613065659/http%3A%2F%2Fwww.sankei.com%2F',
|
|
137
|
-
}}
|
|
138
|
-
.baseNavigationUrl=${''}
|
|
139
|
-
></tile-dispatcher>
|
|
140
|
-
`);
|
|
141
|
-
|
|
142
|
-
const tileLink = el.shadowRoot?.querySelector('a[href]') as HTMLAnchorElement;
|
|
143
|
-
expect(tileLink).to.exist;
|
|
144
|
-
expect(tileLink.getAttribute('href')).to.equal(
|
|
145
|
-
'https://web.archive.org/web/20180613065659/http://www.sankei.com/',
|
|
146
|
-
);
|
|
147
|
-
});
|
|
148
|
-
|
|
149
113
|
it('should toggle model checked state when manage check clicked', async () => {
|
|
150
114
|
const el = await fixture<TileDispatcher>(html`
|
|
151
115
|
<tile-dispatcher
|
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
|
+
});
|