hyperbook 0.38.3 → 0.39.0

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.
@@ -1,32 +1,10 @@
1
1
  var hyperbook = (function () {
2
2
  const collapsibles = document.getElementsByClassName("collapsible");
3
- const animationDelay = 100;
4
- const calcMaxHeight = (elem) => {
5
- const content = elem.nextElementSibling;
6
- if (content) {
7
- if (elem.classList.contains("expanded")) {
8
- content.style.maxHeight = content.scrollHeight + "px";
9
- } else {
10
- content.style.maxHeight = "0";
11
- }
12
- }
13
- const nextParentContent = elem.closest(".collapsible-content");
14
- if (nextParentContent !== null) {
15
- const nextParentCollapsible = nextParentContent.previousElementSibling;
16
- setTimeout(function () {
17
- calcMaxHeight(nextParentCollapsible);
18
- }, animationDelay);
19
- }
20
- };
3
+
21
4
  for (let collapsible of collapsibles) {
22
5
  collapsible.addEventListener("click", () => {
23
6
  collapsible.classList.toggle("expanded");
24
- calcMaxHeight(collapsible);
25
7
  });
26
-
27
- if (collapsible.classList.contains("expanded")) {
28
- calcMaxHeight(collapsible);
29
- }
30
8
  }
31
9
 
32
10
  function tocToggle() {
@@ -33,27 +33,27 @@ side-drawer {
33
33
  border-right-color: var(--color-nav-border);
34
34
  }
35
35
 
36
- .sidebar>.author,
37
- .nav-drawer-content>.author {
36
+ .sidebar > .author,
37
+ .nav-drawer-content > .author {
38
38
  color: var(--color-author-color);
39
39
  background: var(--color-author-background);
40
40
  }
41
41
 
42
- .sidebar>.author:hover,
43
- .nav-drawer-content>.author:hover {
42
+ .sidebar > .author:hover,
43
+ .nav-drawer-content > .author:hover {
44
44
  color: var(--color-brand);
45
45
  }
46
46
 
47
47
  /* Three bars for burger menu */
48
- .toggle>.bar1,
49
- .toggle>.bar2,
50
- .toggle>.bar3 {
48
+ .toggle > .bar1,
49
+ .toggle > .bar2,
50
+ .toggle > .bar3 {
51
51
  background-color: var(--color-brand-text);
52
52
  }
53
53
 
54
- .inverted .toggle>.bar1,
55
- .inverted .toggle>.bar2,
56
- .inverted .toggle>.bar3 {
54
+ .inverted .toggle > .bar1,
55
+ .inverted .toggle > .bar2,
56
+ .inverted .toggle > .bar3 {
57
57
  background-color: var(--color-brand);
58
58
  }
59
59
 
@@ -74,11 +74,11 @@ header.inverted {
74
74
  color: var(--color-brand-text);
75
75
  }
76
76
 
77
- header.inverted>.branding {
77
+ header.inverted > .branding {
78
78
  color: var(--color-brand);
79
79
  }
80
80
 
81
- header.inverted>.branding:hover {
81
+ header.inverted > .branding:hover {
82
82
  color: var(--color-brand);
83
83
  }
84
84
 
@@ -86,7 +86,7 @@ header.inverted>.branding:hover {
86
86
  border-top-color: var(--color-spacer);
87
87
  }
88
88
 
89
- .section>.name {
89
+ .section > .name {
90
90
  color: var(--color-text);
91
91
  border-color: var(--color-spacer);
92
92
  }
@@ -96,15 +96,15 @@ header.inverted>.branding:hover {
96
96
  cursor: pointer;
97
97
  }
98
98
 
99
- .section>.name:hover {
99
+ .section > .name:hover {
100
100
  background: var(--color-spacer);
101
101
  }
102
102
 
103
- .section>.name.empty:hover {
103
+ .section > .name.empty:hover {
104
104
  background: none;
105
105
  }
106
106
 
107
- .section>.name.active {
107
+ .section > .name.active {
108
108
  background: var(--color-background);
109
109
  color: var(--color-brand);
110
110
  }
@@ -123,7 +123,7 @@ header.inverted>.branding:hover {
123
123
  color: var(--color-brand);
124
124
  }
125
125
 
126
- .section>.links {
126
+ .section > .links {
127
127
  border-left-color: var(--color-spacer);
128
128
  }
129
129
 
@@ -219,21 +219,21 @@ a.jump.previous::before {
219
219
  border-right-color: var(--color-nav-border);
220
220
  }
221
221
 
222
- .sidebar>nav,
223
- .nav-drawer-content>nav {
222
+ .sidebar > nav,
223
+ .nav-drawer-content > nav {
224
224
  padding: 20px;
225
225
  flex: 1;
226
226
  }
227
227
 
228
- .sidebar>.author,
229
- .nav-drawer-content>.author {
228
+ .sidebar > .author,
229
+ .nav-drawer-content > .author {
230
230
  text-align: center;
231
231
  text-decoration: none;
232
232
  padding: 20px;
233
233
  }
234
234
 
235
- .sidebar>.author,
236
- .nav-drawer-content>.author>b {
235
+ .sidebar > .author,
236
+ .nav-drawer-content > .author > b {
237
237
  font-weight: bold;
238
238
  }
239
239
 
@@ -253,9 +253,9 @@ a.jump.previous::before {
253
253
  cursor: pointer;
254
254
  }
255
255
 
256
- .toggle>.bar1,
257
- .toggle>.bar2,
258
- .toggle>.bar3 {
256
+ .toggle > .bar1,
257
+ .toggle > .bar2,
258
+ .toggle > .bar3 {
259
259
  width: 35px;
260
260
  height: 5px;
261
261
  margin: 6px 0;
@@ -371,7 +371,7 @@ header {
371
371
  margin-right: 8px;
372
372
  }
373
373
 
374
- #custom-links-footer>.links-item {
374
+ #custom-links-footer > .links-item {
375
375
  border-radius: 8px;
376
376
  padding: 8px;
377
377
  border: 1px solid var(--color-nav-border);
@@ -383,7 +383,6 @@ header {
383
383
  margin-left: 24px;
384
384
  }
385
385
 
386
-
387
386
  @media (max-width: 960px) {
388
387
  #custom-links-header {
389
388
  display: none;
@@ -551,13 +550,13 @@ header {
551
550
 
552
551
  .section ul,
553
552
  .virtual-section ul,
554
- nav>ul {
553
+ nav > ul {
555
554
  list-style-type: none;
556
555
  margin: 0;
557
556
  padding: 0;
558
557
  }
559
558
 
560
- nav li+li {
559
+ nav li + li {
561
560
  margin-top: 0px;
562
561
  }
563
562
 
@@ -569,10 +568,9 @@ nav li+li {
569
568
 
570
569
  .section {
571
570
  margin-top: 8px;
572
- margin-bottom: 8px;
573
571
  }
574
572
 
575
- .section>.name {
573
+ .section > .name {
576
574
  display: flex;
577
575
  text-decoration: none;
578
576
  padding: 10px;
@@ -582,12 +580,12 @@ nav li+li {
582
580
  user-select: none;
583
581
  }
584
582
 
585
- .section>.name>.label {
583
+ .section > .name > .label {
586
584
  flex: 1;
587
585
  text-decoration: none;
588
586
  }
589
587
 
590
- .section>.name>.toggle {
588
+ .section > .name > .toggle {
591
589
  text-align: right;
592
590
  background: none;
593
591
  border: none;
@@ -610,14 +608,14 @@ nav li+li {
610
608
  content: "\2212";
611
609
  }
612
610
 
613
- .collapsible.expanded+.collapsible-content {
614
- max-height: 9999px;
611
+ .collapsible-content {
612
+ display: none;
613
+ opacity: 0;
615
614
  }
616
615
 
617
- .collapsible-content {
618
- overflow: hidden;
619
- max-height: 0;
620
- transition: max-height 0.1s ease-out;
616
+ .collapsible.expanded + .collapsible-content {
617
+ display: block;
618
+ opacity: 1;
621
619
  }
622
620
 
623
621
  .section .section {
@@ -631,12 +629,11 @@ nav li+li {
631
629
  text-decoration: none;
632
630
  }
633
631
 
634
- .section>.links {
632
+ .section > .links {
635
633
  border-left-width: 1px;
636
634
  border-left-style: solid;
637
635
  }
638
636
 
639
-
640
637
  .pages {
641
638
  margin-top: 30px;
642
639
  }
@@ -664,12 +661,12 @@ nav.toc li {
664
661
  margin-bottom: 8px;
665
662
  }
666
663
 
667
- nav.toc li>a {
664
+ nav.toc li > a {
668
665
  color: var(--color-text);
669
666
  text-decoration: none;
670
667
  }
671
668
 
672
- nav.toc li>a:hover {
669
+ nav.toc li > a:hover {
673
670
  color: var(--color-brand);
674
671
  }
675
672