@internetarchive/ia-topnav 1.1.32 → 1.1.33-alpha1

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-topnav",
3
- "version": "1.1.32",
3
+ "version": "1.1.33-alpha1",
4
4
  "description": "Top nav for Internet Archive",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "index.js",
@@ -0,0 +1,15 @@
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
+ `;
@@ -8,6 +8,7 @@ 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';
11
12
  import user from './icon-user.js';
12
13
  import video from './icon-video.js';
13
14
  import web from './icon-web.js';
@@ -23,6 +24,7 @@ export default {
23
24
  software,
24
25
  texts,
25
26
  upload,
27
+ uploadUnpadded,
26
28
  user,
27
29
  video,
28
30
  web,
package/src/data/menus.js CHANGED
@@ -524,6 +524,7 @@ export function buildTopNavMenus(userid = '___USERID___', localLinks = true, way
524
524
  url: `${prefix}/create`,
525
525
  title: 'Upload files',
526
526
  analyticsEvent: 'UserUpload',
527
+ class: 'mobile-upload',
527
528
  },
528
529
  {
529
530
  url: `${prefix}/details/@${userid}`,
@@ -540,6 +541,16 @@ export function buildTopNavMenus(userid = '___USERID___', localLinks = true, way
540
541
  title: 'My favorites',
541
542
  analyticsEvent: 'UserFavorites',
542
543
  },
544
+ {
545
+ url: `${prefix}/details/@${userid}?tab=lists`,
546
+ title: 'My lists',
547
+ analyticsEvent: 'UserLists',
548
+ },
549
+ {
550
+ url: `${prefix}/details/@${userid}?tab=collections`,
551
+ title: 'My collections',
552
+ analyticsEvent: 'UserCollections',
553
+ },
543
554
  {
544
555
  url: `${prefix}/details/@${userid}/web-archive`,
545
556
  title: 'My web archives',
@@ -1,7 +1,9 @@
1
1
  import { html, nothing } from 'https://offshoot.prod.archive.org/lit.js';
2
+ import { ifDefined } from 'lit/directives/if-defined.js';
2
3
  import TrackedElement from './tracked-element.js';
3
4
  import dropdownMenuCSS from './styles/dropdown-menu.js';
4
5
  import formatUrl from './lib/formatUrl.js';
6
+ import icons from './assets/img/icons.js';
5
7
 
6
8
  class DropdownMenu extends TrackedElement {
7
9
  static get styles() {
@@ -52,7 +54,7 @@ class DropdownMenu extends TrackedElement {
52
54
  }
53
55
 
54
56
  dropdownLink(link) {
55
- return html`<a href="${formatUrl(link.url, this.baseHost)}" @click=${this.trackClick} data-event-click-tracking="${this.config.eventCategory}|Nav${link.analyticsEvent}">${link.title}</a>`;
57
+ return html`<a href="${formatUrl(link.url, this.baseHost)}" class="${ifDefined(link.class)}" @click=${this.trackClick} data-event-click-tracking="${this.config.eventCategory}|Nav${link.analyticsEvent}">${link.class === 'mobile-upload' ? icons.uploadUnpadded : nothing} ${link.title}</a>`;
56
58
  }
57
59
 
58
60
  static dropdownText(item) {
@@ -67,6 +67,16 @@ export default css`
67
67
  color: var(--dropdownMenuInfoItem);
68
68
  }
69
69
 
70
+ a.mobile-upload {
71
+ display: flex;
72
+ justify-content: left;
73
+ align-items: center;
74
+ }
75
+ a.mobile-upload svg {
76
+ fill: #fff;
77
+ margin-right: 10px;
78
+ }
79
+
70
80
  @media (min-width: 890px) {
71
81
  nav {
72
82
  overflow: visible;
@@ -135,5 +145,9 @@ export default css`
135
145
  opacity: 1;
136
146
  overflow: visible;
137
147
  }
148
+
149
+ a.mobile-upload {
150
+ display: none;
151
+ }
138
152
  }
139
153
  `;