@internetarchive/ia-topnav 1.1.37-alpha.0 → 1.1.37-alpha2
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/package.json +2 -3
- package/src/assets/img/icons.js +0 -2
- package/src/data/menus.js +0 -1
- package/src/dropdown-menu.js +0 -4
- package/src/styles/dropdown-menu.js +1 -14
- package/src/styles/ia-topnav.js +4 -2
- package/src/styles/nav-search.js +1 -1
- package/src/styles/primary-nav.js +2 -1
- package/src/styles/search-menu.js +1 -0
- package/test/primary-nav.test.js +12 -0
- package/src/assets/img/icon-upload-unpadded.js +0 -15
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@internetarchive/ia-topnav",
|
|
3
|
-
"version": "1.1.37-
|
|
3
|
+
"version": "1.1.37-alpha2",
|
|
4
4
|
"description": "Top nav for Internet Archive",
|
|
5
5
|
"license": "AGPL-3.0-only",
|
|
6
6
|
"main": "index.js",
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
"format:prettier": "prettier \"**/*.js\" --write --ignore-path .gitignore",
|
|
19
19
|
"lint": "npm run lint:eslint",
|
|
20
20
|
"format": "npm run format:eslint && npm run format:prettier",
|
|
21
|
-
"test": "ulimit -v unlimited; web-test-runner 'test/**/*.test.js' --node-resolve --coverage --puppeteer"
|
|
22
|
-
"publish:alpha": "npm run test && npm version prerelease --preid alpha --no-git-tag-version && npm publish --tag alpha"
|
|
21
|
+
"test": "ulimit -v unlimited; web-test-runner 'test/**/*.test.js' --node-resolve --coverage --puppeteer"
|
|
23
22
|
},
|
|
24
23
|
"dependencies": {
|
|
25
24
|
"@internetarchive/ia-wayback-search": "^0.2.3"
|
package/src/assets/img/icons.js
CHANGED
|
@@ -8,7 +8,6 @@ import search from './icon-search.js';
|
|
|
8
8
|
import software from './icon-software.js';
|
|
9
9
|
import texts from './icon-texts.js';
|
|
10
10
|
import upload from './icon-upload.js';
|
|
11
|
-
import uploadUnpadded from './icon-upload-unpadded.js';
|
|
12
11
|
import user from './icon-user.js';
|
|
13
12
|
import video from './icon-video.js';
|
|
14
13
|
import web from './icon-web.js';
|
|
@@ -24,7 +23,6 @@ export default {
|
|
|
24
23
|
software,
|
|
25
24
|
texts,
|
|
26
25
|
upload,
|
|
27
|
-
uploadUnpadded,
|
|
28
26
|
user,
|
|
29
27
|
video,
|
|
30
28
|
web,
|
package/src/data/menus.js
CHANGED
package/src/dropdown-menu.js
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { html, nothing } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
-
import { ifDefined } from 'lit/directives/if-defined.js';
|
|
3
2
|
import TrackedElement from './tracked-element.js';
|
|
4
3
|
import dropdownMenuCSS from './styles/dropdown-menu.js';
|
|
5
4
|
import formatUrl from './lib/formatUrl.js';
|
|
6
|
-
import icons from './assets/img/icons.js';
|
|
7
5
|
|
|
8
6
|
class DropdownMenu extends TrackedElement {
|
|
9
7
|
static get styles() {
|
|
@@ -57,10 +55,8 @@ class DropdownMenu extends TrackedElement {
|
|
|
57
55
|
const calloutText = this.config.callouts?.[link.title];
|
|
58
56
|
return html`<a
|
|
59
57
|
href="${formatUrl(link.url, this.baseHost)}"
|
|
60
|
-
class="${ifDefined(link.class)}"
|
|
61
58
|
@click=${this.trackClick}
|
|
62
59
|
data-event-click-tracking="${this.config.eventCategory}|Nav${link.analyticsEvent}"
|
|
63
|
-
${link.class === 'mobile-upload' ? icons.uploadUnpadded : nothing}
|
|
64
60
|
aria-label=${calloutText ? `New feature: ${link.title}` : nothing}>
|
|
65
61
|
${link.title}
|
|
66
62
|
${calloutText ? html`<span class="callout" aria-hidden="true">${calloutText}</span>` : nothing}
|
|
@@ -3,6 +3,7 @@ import { css } from 'https://offshoot.prod.archive.org/lit.js';
|
|
|
3
3
|
export default css`
|
|
4
4
|
.nav-container {
|
|
5
5
|
position: relative;
|
|
6
|
+
z-index: 4;
|
|
6
7
|
}
|
|
7
8
|
|
|
8
9
|
nav {
|
|
@@ -76,16 +77,6 @@ export default css`
|
|
|
76
77
|
color: #2c2c2c;
|
|
77
78
|
font-size: 1.4rem;
|
|
78
79
|
font-weight: bold;
|
|
79
|
-
|
|
80
|
-
a.mobile-upload {
|
|
81
|
-
display: flex;
|
|
82
|
-
justify-content: left;
|
|
83
|
-
align-items: center;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
a.mobile-upload svg {
|
|
87
|
-
fill: #fff;
|
|
88
|
-
margin-right: 10px;
|
|
89
80
|
}
|
|
90
81
|
|
|
91
82
|
@media (min-width: 890px) {
|
|
@@ -156,9 +147,5 @@ export default css`
|
|
|
156
147
|
opacity: 1;
|
|
157
148
|
overflow: visible;
|
|
158
149
|
}
|
|
159
|
-
|
|
160
|
-
a.mobile-upload {
|
|
161
|
-
display: none;
|
|
162
|
-
}
|
|
163
150
|
}
|
|
164
151
|
`;
|
package/src/styles/ia-topnav.js
CHANGED
|
@@ -69,7 +69,7 @@ export default css`
|
|
|
69
69
|
right: 0;
|
|
70
70
|
bottom: 0;
|
|
71
71
|
left: 0;
|
|
72
|
-
z-index:
|
|
72
|
+
z-index: 3;
|
|
73
73
|
}
|
|
74
74
|
#close-layer.visible {
|
|
75
75
|
display: block;
|
|
@@ -77,12 +77,14 @@ export default css`
|
|
|
77
77
|
|
|
78
78
|
.topnav {
|
|
79
79
|
position: relative;
|
|
80
|
-
z-index: 3;
|
|
81
80
|
}
|
|
82
81
|
|
|
83
82
|
@media (max-width: 889px) {
|
|
84
83
|
desktop-subnav {
|
|
85
84
|
display: none;
|
|
86
85
|
}
|
|
86
|
+
.topnav {
|
|
87
|
+
z-index: 4;
|
|
88
|
+
}
|
|
87
89
|
}
|
|
88
90
|
`;
|
package/src/styles/nav-search.js
CHANGED
|
@@ -201,7 +201,6 @@ export default css`
|
|
|
201
201
|
|
|
202
202
|
nav {
|
|
203
203
|
display: block;
|
|
204
|
-
z-index: 3;
|
|
205
204
|
height: 5rem;
|
|
206
205
|
padding-right: 1.5rem;
|
|
207
206
|
}
|
|
@@ -274,6 +273,8 @@ export default css`
|
|
|
274
273
|
nav-search {
|
|
275
274
|
float: right;
|
|
276
275
|
margin-left: 1rem;
|
|
276
|
+
z-index: 4;
|
|
277
|
+
position: inherit;
|
|
277
278
|
}
|
|
278
279
|
|
|
279
280
|
login-button {
|
package/test/primary-nav.test.js
CHANGED
|
@@ -44,6 +44,18 @@ describe('<primary-nav>', () => {
|
|
|
44
44
|
expect(el.shadowRoot.querySelector('nav-search')).to.equal(null);
|
|
45
45
|
});
|
|
46
46
|
|
|
47
|
+
it('truncates a long screenname', async () => {
|
|
48
|
+
const el = await fixture(component({
|
|
49
|
+
baseHost: 'archive.org',
|
|
50
|
+
username: 'boop',
|
|
51
|
+
screenName: 'somesuperlongscreenname'
|
|
52
|
+
}));
|
|
53
|
+
|
|
54
|
+
const usernameSpan = el.shadowRoot.querySelector('.username');
|
|
55
|
+
|
|
56
|
+
expect(usernameSpan.innerText).to.equal('somesuper…');
|
|
57
|
+
});
|
|
58
|
+
|
|
47
59
|
it('opens a slot with `secondIdentitySlotMode`', async () => {
|
|
48
60
|
const el = await fixture(component({
|
|
49
61
|
baseHost: 'archive.org',
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { html } from 'https://offshoot.prod.archive.org/lit.js';
|
|
2
|
-
|
|
3
|
-
export default html`
|
|
4
|
-
<svg
|
|
5
|
-
height="14"
|
|
6
|
-
width="14"
|
|
7
|
-
viewBox="8 8 24 24"
|
|
8
|
-
xmlns="http://www.w3.org/2000/svg"
|
|
9
|
-
aria-labelledby="uploadTitleID uploadDescID"
|
|
10
|
-
>
|
|
11
|
-
<title id="uploadTitleID">Upload icon</title>
|
|
12
|
-
<desc id="uploadDescID">An illustration of a horizontal line over an up pointing arrow.</desc>
|
|
13
|
-
<path class="fill-color" d="m20 12.8 8 10.4h-4.8v8.8h-6.4v-8.8h-4.8zm12-4.8v3.2h-24v-3.2z" fill-rule="evenodd"/>
|
|
14
|
-
</svg>
|
|
15
|
-
`;
|