@hyperbook/markdown 0.15.1 → 0.15.3

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.
@@ -2,6 +2,7 @@ var hyperbook = (function () {
2
2
  const collapsibles = document.getElementsByClassName("collapsible");
3
3
  const animationDelay = 100;
4
4
  const calcMaxHeight = (elem) => {
5
+ if (!elem) return;
5
6
  const content = elem.nextElementSibling;
6
7
  if (content) {
7
8
  if (elem.classList.contains("expanded")) {
@@ -569,7 +569,6 @@ nav li+li {
569
569
 
570
570
  .section {
571
571
  margin-top: 8px;
572
- margin-bottom: 8px;
573
572
  }
574
573
 
575
574
  .section>.name {
package/dist/index.js CHANGED
@@ -64544,64 +64544,66 @@ var makeNavigationSectionElement = (ctx, section) => {
64544
64544
  const { virtual, isEmpty, href, name, pages, sections, expanded } = section;
64545
64545
  const children = [];
64546
64546
  let isExpanded = ctx.navigation.current?.href?.startsWith(href || "") || expanded;
64547
- if (!virtual && isEmpty) {
64548
- children.push({
64549
- type: "element",
64550
- tagName: "div",
64551
- properties: {
64552
- class: [
64553
- "collapsible",
64554
- "name",
64555
- "empty",
64556
- ctx.navigation.current?.href === href ? "active" : "",
64557
- isExpanded ? "expanded" : ""
64558
- ].join(" ")
64559
- },
64560
- children: [
64561
- {
64562
- type: "element",
64563
- tagName: "span",
64564
- properties: {
64565
- class: "label"
64566
- },
64567
- children: [
64568
- {
64569
- type: "text",
64570
- value: name
64571
- }
64572
- ]
64573
- }
64574
- ]
64575
- });
64576
- } else {
64577
- children.push({
64578
- type: "element",
64579
- tagName: "div",
64580
- properties: {
64581
- class: [
64582
- "collapsible",
64583
- "name",
64584
- ctx.navigation.current?.href === href ? "active" : "",
64585
- isExpanded ? "expanded" : ""
64586
- ].join(" ")
64587
- },
64588
- children: [
64589
- {
64590
- type: "element",
64591
- tagName: "a",
64592
- properties: {
64593
- href,
64594
- class: "label"
64595
- },
64596
- children: [
64597
- {
64598
- type: "text",
64599
- value: name
64600
- }
64601
- ]
64602
- }
64603
- ]
64604
- });
64547
+ if (!virtual) {
64548
+ if (isEmpty) {
64549
+ children.push({
64550
+ type: "element",
64551
+ tagName: "div",
64552
+ properties: {
64553
+ class: [
64554
+ "collapsible",
64555
+ "name",
64556
+ "empty",
64557
+ ctx.navigation.current?.href === href ? "active" : "",
64558
+ isExpanded ? "expanded" : ""
64559
+ ].join(" ")
64560
+ },
64561
+ children: [
64562
+ {
64563
+ type: "element",
64564
+ tagName: "span",
64565
+ properties: {
64566
+ class: "label"
64567
+ },
64568
+ children: [
64569
+ {
64570
+ type: "text",
64571
+ value: name
64572
+ }
64573
+ ]
64574
+ }
64575
+ ]
64576
+ });
64577
+ } else {
64578
+ children.push({
64579
+ type: "element",
64580
+ tagName: "div",
64581
+ properties: {
64582
+ class: [
64583
+ "collapsible",
64584
+ "name",
64585
+ ctx.navigation.current?.href === href ? "active" : "",
64586
+ isExpanded ? "expanded" : ""
64587
+ ].join(" ")
64588
+ },
64589
+ children: [
64590
+ {
64591
+ type: "element",
64592
+ tagName: "a",
64593
+ properties: {
64594
+ href,
64595
+ class: "label"
64596
+ },
64597
+ children: [
64598
+ {
64599
+ type: "text",
64600
+ value: name
64601
+ }
64602
+ ]
64603
+ }
64604
+ ]
64605
+ });
64606
+ }
64605
64607
  }
64606
64608
  const pagesElements = pages.filter((page) => !page.hide).map((page) => makeNavigationPageElement(ctx, page));
64607
64609
  const linksElements = [];
@@ -64621,7 +64623,7 @@ var makeNavigationSectionElement = (ctx, section) => {
64621
64623
  type: "element",
64622
64624
  tagName: "div",
64623
64625
  properties: {
64624
- class: "collapsible-content links"
64626
+ class: virtual ? "links" : "collapsible-content links"
64625
64627
  },
64626
64628
  children: linksElements
64627
64629
  });