@internetarchive/ia-topnav 1.3.6 → 1.3.7

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 (85) hide show
  1. package/.eslintrc +16 -16
  2. package/LICENSE +661 -661
  3. package/README.md +147 -147
  4. package/index.d.ts +109 -109
  5. package/index.js +3 -3
  6. package/package.json +61 -61
  7. package/src/assets/img/hamburger.js +38 -38
  8. package/src/assets/img/ia-icon.js +33 -33
  9. package/src/assets/img/icon-audio.js +23 -23
  10. package/src/assets/img/icon-close.js +16 -16
  11. package/src/assets/img/icon-donate-unpadded.js +16 -16
  12. package/src/assets/img/icon-donate.js +15 -15
  13. package/src/assets/img/icon-ellipses.js +15 -15
  14. package/src/assets/img/icon-ia-logo.js +22 -22
  15. package/src/assets/img/icon-images.js +15 -15
  16. package/src/assets/img/icon-search.js +15 -15
  17. package/src/assets/img/icon-software.js +15 -15
  18. package/src/assets/img/icon-texts.js +15 -15
  19. package/src/assets/img/icon-upload-unpadded.js +14 -14
  20. package/src/assets/img/icon-upload.js +15 -15
  21. package/src/assets/img/icon-user.js +15 -15
  22. package/src/assets/img/icon-video.js +15 -15
  23. package/src/assets/img/icon-web.js +15 -15
  24. package/src/assets/img/icon.js +18 -18
  25. package/src/assets/img/icons.js +33 -33
  26. package/src/assets/img/wordmark-stacked.js +13 -13
  27. package/src/data/menus.js +646 -646
  28. package/src/desktop-subnav.js +45 -45
  29. package/src/dropdown-menu.js +110 -109
  30. package/src/ia-topnav.js +324 -314
  31. package/src/lib/formatUrl.js +1 -1
  32. package/src/lib/keyboard-navigation.js +128 -0
  33. package/src/lib/location-handler.js +5 -5
  34. package/src/lib/query-handler.js +7 -7
  35. package/src/lib/toSentenceCase.js +8 -8
  36. package/src/login-button.js +79 -79
  37. package/src/media-button.js +113 -113
  38. package/src/media-menu.js +154 -133
  39. package/src/media-slider.js +118 -104
  40. package/src/media-subnav.js +112 -112
  41. package/src/more-slider.js +33 -33
  42. package/src/nav-search.js +111 -117
  43. package/src/primary-nav.js +258 -224
  44. package/src/save-page-form.js +59 -59
  45. package/src/search-menu.js +145 -115
  46. package/src/signed-out-dropdown.js +10 -10
  47. package/src/styles/base.js +48 -48
  48. package/src/styles/desktop-subnav.js +37 -37
  49. package/src/styles/dropdown-menu.js +168 -166
  50. package/src/styles/ia-topnav.js +87 -87
  51. package/src/styles/login-button.js +82 -79
  52. package/src/styles/media-button.js +156 -156
  53. package/src/styles/media-menu.js +66 -70
  54. package/src/styles/media-slider.js +81 -81
  55. package/src/styles/media-subnav.js +156 -156
  56. package/src/styles/more-slider.js +15 -15
  57. package/src/styles/nav-search.js +136 -136
  58. package/src/styles/primary-nav.js +311 -300
  59. package/src/styles/save-page-form.js +54 -54
  60. package/src/styles/search-menu.js +105 -99
  61. package/src/styles/signed-out-dropdown.js +31 -31
  62. package/src/styles/user-menu.js +31 -31
  63. package/src/styles/wayback-search.js +48 -48
  64. package/src/styles/wayback-slider.js +30 -30
  65. package/src/tracked-element.js +29 -27
  66. package/src/user-menu.js +56 -42
  67. package/src/wayback-search.js +18 -18
  68. package/src/wayback-slider.js +87 -87
  69. package/test/assets/img/hamburger.test.js +15 -15
  70. package/test/assets/img/user.test.js +15 -15
  71. package/test/data/menus.test.js +19 -19
  72. package/test/dropdown-menu.test.js +25 -25
  73. package/test/ia-icon.test.js +13 -13
  74. package/test/ia-topnav.test.js +273 -273
  75. package/test/login-button.test.js +15 -15
  76. package/test/media-button.test.js +19 -19
  77. package/test/media-menu.test.js +40 -40
  78. package/test/media-slider.test.js +57 -57
  79. package/test/more-slider.test.js +13 -13
  80. package/test/nav-search.test.js +61 -61
  81. package/test/primary-nav.test.js +82 -82
  82. package/test/save-page-form.test.js +35 -35
  83. package/test/search-menu.test.js +49 -49
  84. package/test/user-menu.test.js +33 -33
  85. package/test/wayback-slider.test.js +80 -80
@@ -1,224 +1,258 @@
1
- import { html, nothing } from 'https://offshoot.prod.archive.org/lit.js';
2
- import TrackedElement from './tracked-element.js';
3
- import icons from './assets/img/icons.js';
4
- import './assets/img/hamburger.js';
5
- import './login-button.js';
6
- import './nav-search.js';
7
- import './media-menu.js';
8
- import logoWordmarkStacked from './assets/img/wordmark-stacked.js';
9
- import primaryNavCSS from './styles/primary-nav.js';
10
- import locationHandler from './lib/location-handler.js';
11
- import formatUrl from './lib/formatUrl.js';
12
-
13
- class PrimaryNav extends TrackedElement {
14
- static get styles() {
15
- return primaryNavCSS;
16
- }
17
-
18
- static get properties() {
19
- return {
20
- mediaBaseHost: { type: String },
21
- baseHost: { type: String },
22
- hideSearch: { type: Boolean },
23
- config: { type: Object },
24
- openMenu: { type: String },
25
- screenName: { type: String },
26
- searchIn: { type: String },
27
- searchQuery: { type: String },
28
- secondIdentitySlotMode: { type: String },
29
- selectedMenuOption: { type: String },
30
- signedOutMenuOpen: { type: Boolean },
31
- userMenuOpen: { type: Boolean },
32
- username: { type: String },
33
- userProfileImagePath: { type: String },
34
- };
35
- }
36
-
37
- constructor() {
38
- super();
39
- this.config = {};
40
- this.openMenu = '';
41
- this.searchIn = '';
42
- this.selectedMenuOption = '';
43
- this.signedOutMenuOpen = false;
44
- this.userMenuOpen = false;
45
- this.mediaBaseHost = 'https://archive.org';
46
- this.secondIdentitySlotMode = '';
47
- }
48
-
49
- toggleMediaMenu(e) {
50
- this.trackClick(e);
51
- this.dispatchEvent(
52
- new CustomEvent('menuToggled', {
53
- detail: {
54
- menuName: 'media',
55
- },
56
- }),
57
- );
58
- }
59
-
60
- toggleSearchMenu(e) {
61
- this.trackClick(e);
62
- this.dispatchEvent(
63
- new CustomEvent('menuToggled', {
64
- detail: {
65
- menuName: 'search',
66
- },
67
- }),
68
- );
69
- }
70
-
71
- toggleUserMenu(e) {
72
- this.trackClick(e);
73
- this.dispatchEvent(
74
- new CustomEvent('menuToggled', {
75
- detail: {
76
- menuName: 'user',
77
- },
78
- }),
79
- );
80
- }
81
-
82
- get userIcon() {
83
- const userMenuClass = this.openMenu === 'user' ? 'active' : '';
84
- const userMenuToolTip = this.openMenu === 'user' ? 'Close user menu' : 'Expand user menu';
85
-
86
- return html`
87
- <button
88
- class="user-menu ${userMenuClass}"
89
- title="${userMenuToolTip}"
90
- @click="${this.toggleUserMenu}"
91
- data-event-click-tracking="${this.config.eventCategory}|NavUserMenu"
92
- >
93
- <img
94
- src="${this.mediaBaseHost}${this.userProfileImagePath}"
95
- alt="${this.screenName}"
96
- />
97
- <span class="screen-name" dir="auto">${this.screenName}</span>
98
- </button>
99
- `;
100
- }
101
-
102
- get loginIcon() {
103
- return html`
104
- <login-button
105
- .baseHost=${this.baseHost}
106
- .config=${this.config}
107
- .dropdownOpen=${this.signedOutMenuOpen}
108
- .openMenu=${this.openMenu}
109
- @signedOutMenuToggled=${this.signedOutMenuToggled}
110
- ></login-button>
111
- `;
112
- }
113
-
114
- get searchMenuOpen() {
115
- return this.openMenu === 'search';
116
- }
117
-
118
- get allowSecondaryIcon() {
119
- return this.secondIdentitySlotMode === 'allow';
120
- }
121
-
122
- get searchMenu() {
123
- if (this.hideSearch) return nothing;
124
-
125
- return html`
126
- <button
127
- class="search-trigger"
128
- @click="${this.toggleSearchMenu}"
129
- data-event-click-tracking="${this.config.eventCategory}|NavSearchOpen"
130
- >
131
- ${icons.search}
132
- </button>
133
- <nav-search
134
- .baseHost=${this.baseHost}
135
- .config=${this.config}
136
- .locationHandler=${locationHandler}
137
- .open=${this.searchMenuOpen}
138
- .openMenu=${this.openMenu}
139
- .searchIn=${this.searchIn}
140
- .searchQuery=${this.searchQuery}
141
- ></nav-search>
142
- `;
143
- }
144
-
145
- get mobileDonateHeart() {
146
- return html`
147
- <a class="mobile-donate-link" href=${formatUrl('/donate/?origin=iawww-mbhrt', this.baseHost)}>
148
- ${icons.donateUnpadded}
149
- <span class="sr-only">"Donate to the archive"</span>
150
- </a>
151
- `;
152
- }
153
-
154
- get uploadButtonTemplate() {
155
- return html`<a href="${formatUrl('/create', this.baseHost)}" class="upload">
156
- ${icons.upload}
157
- <span>Upload</span>
158
- </a>`;
159
- }
160
-
161
- get userStateTemplate() {
162
- return html`<div class="user-info">
163
- ${this.username ? this.userIcon : this.loginIcon}
164
- </div>`;
165
- }
166
-
167
- get secondLogoSlot() {
168
- return this.allowSecondaryIcon
169
- ? html`
170
- <slot name="opt-sec-logo"></slot>
171
- <slot name="opt-sec-logo-mobile"></slot>
172
- `
173
- : nothing;
174
- }
175
-
176
- get secondLogoClass() {
177
- return this.allowSecondaryIcon ? 'second-logo' : '';
178
- }
179
-
180
- render() {
181
- const mediaMenuTabIndex = this.openMenu === 'media' ? '' : '-1';
182
- return html`
183
- <nav class=${this.hideSearch ? 'hide-search' : nothing}>
184
- <div class=${`branding ${this.secondLogoClass}`}>
185
- <a
186
- href=${formatUrl('/', this.baseHost)}
187
- @click=${this.trackClick}
188
- data-event-click-tracking="${this.config.eventCategory}|NavHome"
189
- title="Go home"
190
- class="link-home"
191
- >${icons.iaLogo}${logoWordmarkStacked}</a
192
- >
193
- ${this.secondLogoSlot}
194
- </div>
195
-
196
- <div class="right-side-section">
197
- ${this.mobileDonateHeart}
198
- ${this.searchMenu}
199
- ${this.uploadButtonTemplate}
200
- ${this.userStateTemplate}
201
- </div>
202
- <media-menu
203
- .baseHost=${this.baseHost}
204
- .config=${this.config}
205
- ?mediaMenuAnimate="${this.mediaMenuAnimate}"
206
- tabindex="${mediaMenuTabIndex}"
207
- .selectedMenuOption=${this.selectedMenuOption}
208
- .openMenu=${this.openMenu}
209
- ></media-menu>
210
- <button
211
- class="hamburger"
212
- @click="${this.toggleMediaMenu}"
213
- tabindex="1"
214
- data-event-click-tracking="${this.config.eventCategory}|NavHamburger"
215
- title="Open main menu"
216
- >
217
- <icon-hamburger ?active=${this.openMenu === 'media'}></icon-hamburger>
218
- </button>
219
- </nav>
220
- `;
221
- }
222
- }
223
-
224
- customElements.define('primary-nav', PrimaryNav);
1
+ import { html, nothing } from 'https://offshoot.prod.archive.org/lit.js';
2
+ import TrackedElement from './tracked-element.js';
3
+ import icons from './assets/img/icons.js';
4
+ import './assets/img/hamburger.js';
5
+ import './login-button.js';
6
+ import './nav-search.js';
7
+ import './media-menu.js';
8
+ import logoWordmarkStacked from './assets/img/wordmark-stacked.js';
9
+ import primaryNavCSS from './styles/primary-nav.js';
10
+ import locationHandler from './lib/location-handler.js';
11
+ import formatUrl from './lib/formatUrl.js';
12
+
13
+ class PrimaryNav extends TrackedElement {
14
+ static get styles() {
15
+ return primaryNavCSS;
16
+ }
17
+
18
+ static get properties() {
19
+ return {
20
+ mediaBaseHost: { type: String },
21
+ baseHost: { type: String },
22
+ hideSearch: { type: Boolean },
23
+ config: { type: Object },
24
+ openMenu: { type: String },
25
+ screenName: { type: String },
26
+ searchIn: { type: String },
27
+ searchQuery: { type: String },
28
+ secondIdentitySlotMode: { type: String },
29
+ selectedMenuOption: { type: String },
30
+ signedOutMenuOpen: { type: Boolean },
31
+ userMenuOpen: { type: Boolean },
32
+ username: { type: String },
33
+ userProfileImagePath: { type: String },
34
+ currentTab: { type: Object },
35
+ };
36
+ }
37
+
38
+ constructor() {
39
+ super();
40
+ this.config = {};
41
+ this.openMenu = '';
42
+ this.searchIn = '';
43
+ this.selectedMenuOption = '';
44
+ this.signedOutMenuOpen = false;
45
+ this.userMenuOpen = false;
46
+ this.mediaBaseHost = 'https://archive.org';
47
+ this.secondIdentitySlotMode = '';
48
+ this.currentTab = {};
49
+ }
50
+
51
+ toggleMediaMenu(e) {
52
+ this.trackClick(e);
53
+ this.dispatchEvent(
54
+ new CustomEvent('menuToggled', {
55
+ detail: {
56
+ menuName: 'media',
57
+ },
58
+ }),
59
+ );
60
+ }
61
+
62
+ toggleSearchMenu(e) {
63
+ this.trackClick(e);
64
+ this.dispatchEvent(
65
+ new CustomEvent('menuToggled', {
66
+ detail: {
67
+ menuName: 'search',
68
+ },
69
+ }),
70
+ );
71
+ }
72
+
73
+ toggleUserMenu(e) {
74
+ this.trackClick(e);
75
+ this.dispatchEvent(
76
+ new CustomEvent('menuToggled', {
77
+ detail: {
78
+ menuName: 'user',
79
+ },
80
+ }),
81
+ );
82
+ }
83
+
84
+ updated(props) {
85
+ if (props.has('currentTab')) {
86
+ // early return
87
+ if (Object.keys(this.currentTab).length === 0) return nothing;
88
+
89
+ const isUserMenuTab = this.currentTab && this.currentTab.mediatype === 'usermenu';
90
+ if (isUserMenuTab) {
91
+ const mediaButtons = Array.from(this.shadowRoot.querySelector('media-menu').shadowRoot.querySelectorAll('media-button'));
92
+ const lastMediaButton = mediaButtons.filter(element => {
93
+ return element.shadowRoot.querySelector('a').classList.contains('images')
94
+ });
95
+
96
+ const focusElement = this.currentTab.moveTo === 'next'
97
+ ? this.shadowRoot.querySelector('a.upload')
98
+ : lastMediaButton[0]?.shadowRoot.querySelector('a.menu-item');
99
+
100
+ if (focusElement) {
101
+ focusElement.focus();
102
+ }
103
+ } else if (this.currentTab.moveTo === 'next') {
104
+ if (this.shadowRoot.querySelector('.user-menu')) {
105
+ this.shadowRoot.querySelector('.user-menu').focus();
106
+ } else {
107
+ this.shadowRoot.querySelector('login-button').shadowRoot.querySelectorAll('span a')[0]?.focus();
108
+ }
109
+ }
110
+ }
111
+ }
112
+
113
+ get userIcon() {
114
+ const userMenuClass = this.openMenu === 'user' ? 'active' : '';
115
+ const userMenuToolTip = this.openMenu === 'user' ? 'Close user menu' : 'Expand user menu';
116
+
117
+ return html`
118
+ <button
119
+ class="user-menu ${userMenuClass}"
120
+ title="${userMenuToolTip}"
121
+ @click="${this.toggleUserMenu}"
122
+ data-event-click-tracking="${this.config.eventCategory}|NavUserMenu"
123
+ >
124
+ <img
125
+ src="${this.mediaBaseHost}${this.userProfileImagePath}"
126
+ alt="${this.screenName}"
127
+ />
128
+ <span class="screen-name" dir="auto">${this.screenName}</span>
129
+ </button>
130
+ `;
131
+ }
132
+
133
+ get loginIcon() {
134
+ return html`
135
+ <login-button
136
+ .baseHost=${this.baseHost}
137
+ .config=${this.config}
138
+ .dropdownOpen=${this.signedOutMenuOpen}
139
+ .openMenu=${this.openMenu}
140
+ @signedOutMenuToggled=${this.signedOutMenuToggled}
141
+ ></login-button>
142
+ `;
143
+ }
144
+
145
+ get searchMenuOpen() {
146
+ return this.openMenu === 'search';
147
+ }
148
+
149
+ get allowSecondaryIcon() {
150
+ return this.secondIdentitySlotMode === 'allow';
151
+ }
152
+
153
+ get searchMenu() {
154
+ if (this.hideSearch) return nothing;
155
+
156
+ return html`
157
+ <button
158
+ class="search-trigger"
159
+ @click="${this.toggleSearchMenu}"
160
+ data-event-click-tracking="${this.config.eventCategory}|NavSearchOpen"
161
+ >
162
+ ${icons.search}
163
+ </button>
164
+ <nav-search
165
+ .baseHost=${this.baseHost}
166
+ .config=${this.config}
167
+ .locationHandler=${locationHandler}
168
+ .open=${this.searchMenuOpen}
169
+ .openMenu=${this.openMenu}
170
+ .searchIn=${this.searchIn}
171
+ .searchQuery=${this.searchQuery}
172
+ ></nav-search>
173
+ `;
174
+ }
175
+
176
+ get mobileDonateHeart() {
177
+ return html`
178
+ <a class="mobile-donate-link" href=${formatUrl('/donate/?origin=iawww-mbhrt', this.baseHost)}>
179
+ ${icons.donateUnpadded}
180
+ <span class="sr-only">"Donate to the archive"</span>
181
+ </a>
182
+ `;
183
+ }
184
+
185
+ get uploadButtonTemplate() {
186
+ return html`
187
+ <a href="${formatUrl('/create', this.baseHost)}"
188
+ class="upload"
189
+ @focus=${this.toggleMediaMenu}
190
+ >
191
+ ${icons.upload}
192
+ <span>Upload</span>
193
+ </a>`;
194
+ }
195
+
196
+ get userStateTemplate() {
197
+ return html`<div class="user-info">
198
+ ${this.username ? this.userIcon : this.loginIcon}
199
+ </div>`;
200
+ }
201
+
202
+ get secondLogoSlot() {
203
+ return this.allowSecondaryIcon
204
+ ? html`
205
+ <slot name="opt-sec-logo"></slot>
206
+ <slot name="opt-sec-logo-mobile"></slot>
207
+ `
208
+ : nothing;
209
+ }
210
+
211
+ get secondLogoClass() {
212
+ return this.allowSecondaryIcon ? 'second-logo' : '';
213
+ }
214
+
215
+ render() {
216
+ const mediaMenuTabIndex = this.openMenu === 'media' ? '' : '-1';
217
+ return html`
218
+ <nav class=${this.hideSearch ? 'hide-search' : nothing}>
219
+ <button
220
+ class="hamburger"
221
+ @click="${this.toggleMediaMenu}"
222
+ data-event-click-tracking="${this.config.eventCategory}|NavHamburger"
223
+ title="Open main menu"
224
+ >
225
+ <icon-hamburger ?active=${this.openMenu === 'media'}></icon-hamburger>
226
+ </button>
227
+
228
+ <div class=${`branding ${this.secondLogoClass}`}>
229
+ <a
230
+ href=${formatUrl('/', this.baseHost)}
231
+ @click=${this.trackClick}
232
+ data-event-click-tracking="${this.config.eventCategory}|NavHome"
233
+ title="Go home"
234
+ class="link-home"
235
+ >${icons.iaLogo}${logoWordmarkStacked}</a
236
+ >
237
+ ${this.secondLogoSlot}
238
+ </div>
239
+ <media-menu
240
+ .baseHost=${this.baseHost}
241
+ .config=${this.config}
242
+ ?mediaMenuAnimate="${this.mediaMenuAnimate}"
243
+ .selectedMenuOption=${this.selectedMenuOption}
244
+ .openMenu=${this.openMenu}
245
+ .currentTab=${this.currentTab}
246
+ ></media-menu>
247
+ <div class="right-side-section">
248
+ ${this.mobileDonateHeart}
249
+ ${this.userStateTemplate}
250
+ ${this.uploadButtonTemplate}
251
+ ${this.searchMenu}
252
+ </div>
253
+ </nav>
254
+ `;
255
+ }
256
+ }
257
+
258
+ customElements.define('primary-nav', PrimaryNav);
@@ -1,59 +1,59 @@
1
- import { html } from 'https://offshoot.prod.archive.org/lit.js';
2
- import TrackedElement from './tracked-element.js';
3
- import savePageFormCSS from './styles/save-page-form.js';
4
-
5
- class SavePageForm extends TrackedElement {
6
- static get styles() {
7
- return savePageFormCSS;
8
- }
9
-
10
- static get properties() {
11
- return {
12
- config: { type: Object },
13
- inputValid: { type: Boolean }
14
- };
15
- }
16
-
17
- constructor() {
18
- super();
19
- this.config = {
20
- eventCategory: ''
21
- };
22
- this.inputValid = true;
23
- }
24
-
25
- validateURL(e) {
26
- const urlInput = e.target.querySelector('[name="url_preload"]');
27
- const valid = /\..{2,}$/.test(urlInput.value);
28
-
29
- if (!valid) {
30
- e.preventDefault();
31
- this.inputValid = false;
32
- return;
33
- }
34
- this.inputValid = true;
35
- this.trackSubmit(e);
36
- }
37
-
38
- get errorClass() {
39
- return `error${this.inputValid ? '' : ' visible'}`;
40
- }
41
-
42
- render() {
43
- return html`
44
- <form action="//web.archive.org/save" method="post" data-event-submit-tracking="${this.config.eventCategory}|SavePageSubmit" @submit=${this.validateURL}>
45
- <h3>Save Page Now</h3>
46
- <p>Capture a web page as it appears now for use as a trusted citation in the future.</p>
47
- <div>
48
- <input type="text" name="url_preload" placeholder="https://" />
49
- <input type="submit" value="Save" />
50
- </div>
51
- <p class=${this.errorClass}>Please enter a valid web address</p>
52
- </form>
53
- `;
54
- }
55
- }
56
-
57
- customElements.define('save-page-form', SavePageForm);
58
-
59
- export default SavePageForm;
1
+ import { html } from 'https://offshoot.prod.archive.org/lit.js';
2
+ import TrackedElement from './tracked-element.js';
3
+ import savePageFormCSS from './styles/save-page-form.js';
4
+
5
+ class SavePageForm extends TrackedElement {
6
+ static get styles() {
7
+ return savePageFormCSS;
8
+ }
9
+
10
+ static get properties() {
11
+ return {
12
+ config: { type: Object },
13
+ inputValid: { type: Boolean }
14
+ };
15
+ }
16
+
17
+ constructor() {
18
+ super();
19
+ this.config = {
20
+ eventCategory: ''
21
+ };
22
+ this.inputValid = true;
23
+ }
24
+
25
+ validateURL(e) {
26
+ const urlInput = e.target.querySelector('[name="url_preload"]');
27
+ const valid = /\..{2,}$/.test(urlInput.value);
28
+
29
+ if (!valid) {
30
+ e.preventDefault();
31
+ this.inputValid = false;
32
+ return;
33
+ }
34
+ this.inputValid = true;
35
+ this.trackSubmit(e);
36
+ }
37
+
38
+ get errorClass() {
39
+ return `error${this.inputValid ? '' : ' visible'}`;
40
+ }
41
+
42
+ render() {
43
+ return html`
44
+ <form action="//web.archive.org/save" method="post" data-event-submit-tracking="${this.config.eventCategory}|SavePageSubmit" @submit=${this.validateURL}>
45
+ <h3>Save Page Now</h3>
46
+ <p>Capture a web page as it appears now for use as a trusted citation in the future.</p>
47
+ <div>
48
+ <input type="text" name="url_preload" placeholder="https://" />
49
+ <input type="submit" value="Save" />
50
+ </div>
51
+ <p class=${this.errorClass}>Please enter a valid web address</p>
52
+ </form>
53
+ `;
54
+ }
55
+ }
56
+
57
+ customElements.define('save-page-form', SavePageForm);
58
+
59
+ export default SavePageForm;