@brillout/docpress 0.5.3 → 0.5.4

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.
@@ -66,7 +66,7 @@ iframe {
66
66
  .doc-page h3[id]:hover::before {
67
67
  content: "#";
68
68
  position: absolute;
69
- left: calc(-1 * (0.75em - 23px));
69
+ left: calc(-1 * (0.75em - 26px));
70
70
  color: #aaa;
71
71
  }
72
72
 
@@ -177,14 +177,28 @@ function sum(arr) {
177
177
  activateNavigationMask();
178
178
  activateMenuToggle();
179
179
  initNavigationFullscreen();
180
+ autoHideNavigationOverlayOnLinkClick();
180
181
  function activateMenuToggle() {
181
182
  const menuToggle = document.getElementById("menu-toggle");
182
- menuToggle.onclick = toggleNavigation;
183
+ menuToggle.onclick = navigationOverlayToggle;
183
184
  }
184
185
  function activateNavigationMask() {
185
186
  const navigationMask = document.getElementById("navigation-mask");
186
- navigationMask.onclick = toggleNavigation;
187
+ navigationMask.onclick = navigationOverlayToggle;
187
188
  }
188
- function toggleNavigation() {
189
+ function autoHideNavigationOverlayOnLinkClick() {
190
+ document.addEventListener("click", (ev) => {
191
+ const el = ev.target;
192
+ if (!el || !("classList" in el))
193
+ return;
194
+ if (!el.classList.contains("nav-item"))
195
+ return;
196
+ navigationOverlayHide();
197
+ });
198
+ }
199
+ function navigationOverlayToggle() {
189
200
  document.body.classList.toggle("show-menu");
190
201
  }
202
+ function navigationOverlayHide() {
203
+ document.body.classList.remove("show-menu");
204
+ }
@@ -1,17 +1,17 @@
1
1
  /* src/navigation/Navigation-layout.css */
2
2
  :root {
3
3
  --mobile-header-height: 60px;
4
- --navigation-min-height: 300px;
5
- --navigation-max-height: 350px;
4
+ --navigation-min-width: 300px;
5
+ --navigation-max-width: 350px;
6
6
  }
7
7
  #navigation-wrapper {
8
- min-width: var(--navigation-min-height);
8
+ min-width: var(--navigation-min-width);
9
9
  }
10
10
  .doc-page #navigation-wrapper {
11
- max-width: var(--navigation-max-height);
11
+ max-width: var(--navigation-max-width);
12
12
  }
13
13
  .landing-page #navigation-wrapper {
14
- max-width: min(var(--navigation-max-height), max(var(--navigation-min-height), calc(var(--navigation-min-height) + 100vw - 1240px)));
14
+ max-width: min(var(--navigation-max-width), max(var(--navigation-min-width), calc(var(--navigation-min-width) + 100% - 1240px)));
15
15
  }
16
16
  #navigation-container {
17
17
  position: sticky;
@@ -29,7 +29,7 @@
29
29
  }
30
30
  #navigation-mask {
31
31
  position: fixed;
32
- width: 100vw;
32
+ width: 100%;
33
33
  height: 100vh;
34
34
  top: 0;
35
35
  left: 0;
@@ -70,7 +70,7 @@
70
70
  margin-left: 0 !important;
71
71
  }
72
72
  #navigation-container {
73
- --width: min(100vw, 350px);
73
+ --width: min(100%, 350px);
74
74
  width: var(--width);
75
75
  left: 0;
76
76
  height: calc(100vh - var(--mobile-header-height));
@@ -92,9 +92,8 @@
92
92
  }
93
93
  }
94
94
  html.navigation-fullscreen #navigation-container {
95
- width: 100vw;
95
+ width: 100%;
96
96
  height: 100vh;
97
- overflow-y: scroll;
98
97
  position: fixed;
99
98
  top: 0;
100
99
  left: 0;
@@ -280,7 +279,7 @@ html.navigation-fullscreen #page-content {
280
279
  #page-layout {
281
280
  display: flex;
282
281
  justify-content: center;
283
- width: 100vw;
282
+ width: 100%;
284
283
  }
285
284
  #page-layout > #navigation-wrapper,
286
285
  #page-layout > #page-wrapper {
@@ -169,7 +169,7 @@ function NavigationFullscreenButton() {
169
169
  function NavigationFullscreenClose() {
170
170
  return /* @__PURE__ */ React2.createElement("a", {
171
171
  id: "navigation-fullscreen-close",
172
- style: { position: "fixed", top: 11, right: 15, zIndex: 10 },
172
+ style: { position: "absolute", top: 11, right: 11, zIndex: 10 },
173
173
  "aria-label": "Press <Esc>",
174
174
  "data-balloon-pos": "left"
175
175
  }, /* @__PURE__ */ React2.createElement("img", {
@@ -331,7 +331,7 @@ function MobileHeader() {
331
331
  id: "mobile-header",
332
332
  style: {
333
333
  height: "var(--mobile-header-height)",
334
- width: "100vw",
334
+ width: "100%",
335
335
  position: "relative"
336
336
  }
337
337
  }, /* @__PURE__ */ React4.createElement("div", {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@brillout/docpress",
3
- "version": "0.5.3",
3
+ "version": "0.5.4",
4
4
  "scripts": {
5
5
  "// Check types while developing": "",
6
6
  "types": "tsc --noEmit --watch",