@internetarchive/ia-topnav 1.1.21 → 1.1.22

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/README.md CHANGED
@@ -12,6 +12,8 @@ yarn add @internetarchive/ia-topnav
12
12
 
13
13
  @see [demo.html](demo.html) for the simplest example with all the defaults
14
14
 
15
+ `yarn start` => open demo: `http://localhost:8000/demo.html`
16
+
15
17
  It shows a dynamic change of the logged in user name -- and how it will re-paint the menus.
16
18
 
17
19
 
@@ -80,6 +82,8 @@ export default IATopNav;
80
82
  --savePageSubmitText: var(--white);
81
83
  --savePageInputBorder: var(--grey60);
82
84
  --savePageErrorText: var(--errorYellow);
85
+
86
+ --topOffset: -1500px;
83
87
  }
84
88
  </style>
85
89
 
@@ -119,6 +123,7 @@ yarn install
119
123
  ```bash
120
124
  yarn start // start development server and typescript compiler
121
125
  ```
126
+ then open demo - http://localhost:8000/demo.html
122
127
 
123
128
  ## Testing
124
129
 
@@ -132,12 +137,6 @@ yarn test
132
137
  yarn test:bs
133
138
  ```
134
139
 
135
- ## Demoing using storybook
136
-
137
- ```bash
138
- yarn storybook
139
- ```
140
-
141
140
  ## Linting
142
141
 
143
142
  ```bash
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@internetarchive/ia-topnav",
3
- "version": "1.1.21",
3
+ "version": "1.1.22",
4
4
  "description": "Top nav for Internet Archive",
5
5
  "license": "AGPL-3.0-only",
6
6
  "main": "index.js",
@@ -18,10 +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
- "site:build": "npm run storybook:build",
23
- "storybook": "start-storybook -p 9001",
24
- "storybook:build": "build-storybook -o _site -s storybook-static"
21
+ "test": "ulimit -v unlimited; web-test-runner 'test/**/*.test.js' --node-resolve --coverage --puppeteer"
25
22
  },
26
23
  "dependencies": {
27
24
  "@internetarchive/ia-wayback-search": "^0.2.3"
@@ -60,6 +57,5 @@
60
57
  "eslint-config-prettier"
61
58
  ]
62
59
  },
63
- "prettier": "@open-wc/prettier-config",
64
- "gitHead": "5de5e1e871f061f14838886d0bb5de5035e1cafd"
60
+ "prettier": "@open-wc/prettier-config"
65
61
  }
package/src/ia-topnav.js CHANGED
@@ -85,6 +85,7 @@ export default class IATopNav extends LitElement {
85
85
  menuSetup() {
86
86
  this.localLinks = this.getAttribute('localLinks') !== 'false' && this.getAttribute('localLinks') !== false;
87
87
  this.username = this.getAttribute('username')
88
+ this.screenName = this.username; // set screenName when username changes to display
88
89
  this.waybackPagesArchived = this.getAttribute('waybackPagesArchived') ?? ''
89
90
 
90
91
  // ensure we update other components that use `baseHost`
@@ -1,10 +1,6 @@
1
1
  import { css } from 'https://offshoot.ux.archive.org/lit.js';
2
2
 
3
3
  export default css`
4
- :host {
5
- --topOffset: -1500px;
6
- }
7
-
8
4
  .nav-container {
9
5
  position: relative;
10
6
  }
@@ -23,7 +19,7 @@ export default css`
23
19
 
24
20
  .initial,
25
21
  .closed {
26
- top: var(--topOffset);
22
+ top: var(--topOffset, -1500px);
27
23
  }
28
24
 
29
25
  .closed {
@@ -1,10 +1,6 @@
1
1
  import { css } from 'https://offshoot.ux.archive.org/lit.js';
2
2
 
3
3
  export default css`
4
- :host {
5
- --topOffset: -800px;
6
- }
7
-
8
4
  .menu-wrapper {
9
5
  position: relative;
10
6
  }
@@ -32,8 +28,7 @@ export default css`
32
28
  }
33
29
  .initial,
34
30
  .closed {
35
- top: var(--topOffset);
36
- display: none;
31
+ top: var(--topOffset, -1500px);
37
32
  }
38
33
  .closed {
39
34
  transition-duration: 0.2s;