@hyperbook/markdown 0.24.7 → 0.24.9

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.
@@ -6,9 +6,16 @@ var hyperbook = (function () {
6
6
  const initCollapsibles = (root) => {
7
7
  const collapsibleEls = root.getElementsByClassName("collapsible");
8
8
  for (let collapsible of collapsibleEls) {
9
+ const id = collapsible.parentElement.getAttribute("data-id");
10
+
11
+ if (id.startsWith("_nav:") && !collapsible.classList.contains("empty")) {
12
+ const link = collapsible.querySelector("a");
13
+ link?.addEventListener("click", (event) => {
14
+ event.stopPropagation();
15
+ });
16
+ }
9
17
  collapsible.addEventListener("click", () => {
10
18
  collapsible.classList.toggle("expanded");
11
- const id = collapsible.parentElement.getAttribute("data-id");
12
19
  if (id) {
13
20
  store.collapsibles.get(id).then((result) => {
14
21
  if (!result) {
@@ -28,7 +35,7 @@ var hyperbook = (function () {
28
35
  };
29
36
 
30
37
  /**
31
- * @param {HTMLElement} root
38
+ * @param {HTMLElement} root
32
39
  */
33
40
  const updateCollapsibles = (root) => {
34
41
  store.collapsibles.toArray().then((collapsibles) => {
@@ -37,27 +37,27 @@ side-drawer {
37
37
  border-right-color: var(--color-nav-border);
38
38
  }
39
39
 
40
- .sidebar > .author,
41
- .nav-drawer-content > .author {
40
+ .sidebar>.author,
41
+ .nav-drawer-content>.author {
42
42
  color: var(--color-author-color);
43
43
  background: var(--color-author-background);
44
44
  }
45
45
 
46
- .sidebar > .author:hover,
47
- .nav-drawer-content > .author:hover {
46
+ .sidebar>.author:hover,
47
+ .nav-drawer-content>.author:hover {
48
48
  color: var(--color-brand);
49
49
  }
50
50
 
51
51
  /* Three bars for burger menu */
52
- .toggle > .bar1,
53
- .toggle > .bar2,
54
- .toggle > .bar3 {
52
+ .toggle>.bar1,
53
+ .toggle>.bar2,
54
+ .toggle>.bar3 {
55
55
  background-color: var(--color-brand-text);
56
56
  }
57
57
 
58
- .inverted .toggle > .bar1,
59
- .inverted .toggle > .bar2,
60
- .inverted .toggle > .bar3 {
58
+ .inverted .toggle>.bar1,
59
+ .inverted .toggle>.bar2,
60
+ .inverted .toggle>.bar3 {
61
61
  background-color: var(--color-brand);
62
62
  }
63
63
 
@@ -78,11 +78,11 @@ header.inverted {
78
78
  color: var(--color-brand-text);
79
79
  }
80
80
 
81
- header.inverted > .branding {
81
+ header.inverted>.branding {
82
82
  color: var(--color-brand);
83
83
  }
84
84
 
85
- header.inverted > .branding:hover {
85
+ header.inverted>.branding:hover {
86
86
  color: var(--color-brand);
87
87
  }
88
88
 
@@ -90,17 +90,17 @@ header.inverted > .branding:hover {
90
90
  border-top-color: var(--color-spacer);
91
91
  }
92
92
 
93
- .section > .name {
93
+ .section>.name {
94
94
  color: var(--color-text);
95
95
  border-color: var(--color-spacer);
96
96
  }
97
97
 
98
- .section > .name > .label {
98
+ .section>.name>.label {
99
99
  color: var(--color-text);
100
100
  }
101
101
 
102
- .section > .name.active > .label {
103
- color: var(--color-text);
102
+ .section>.name.active>.label {
103
+ color: var(--color-brand);
104
104
  }
105
105
 
106
106
  .section .name.empty {
@@ -109,15 +109,15 @@ header.inverted > .branding:hover {
109
109
  font-style: italic;
110
110
  }
111
111
 
112
- .section > .name:hover {
112
+ .section>.name:hover {
113
113
  background: var(--color-spacer);
114
114
  }
115
115
 
116
- .section > .name.empty:hover {
116
+ .section>.name.empty:hover {
117
117
  background: none;
118
118
  }
119
119
 
120
- .section > .name.active {
120
+ .section>.name.active {
121
121
  background: var(--color-background);
122
122
  color: var(--color-brand);
123
123
  }
@@ -136,7 +136,7 @@ header.inverted > .branding:hover {
136
136
  color: var(--color-brand);
137
137
  }
138
138
 
139
- .section > .links {
139
+ .section>.links {
140
140
  border-left-color: var(--color-spacer);
141
141
  }
142
142
 
@@ -234,21 +234,21 @@ a.jump.previous::before {
234
234
  border-right-color: var(--color-nav-border);
235
235
  }
236
236
 
237
- .sidebar > nav,
238
- .nav-drawer-content > nav {
237
+ .sidebar>nav,
238
+ .nav-drawer-content>nav {
239
239
  padding: 20px;
240
240
  flex: 1;
241
241
  }
242
242
 
243
- .sidebar > .author,
244
- .nav-drawer-content > .author {
243
+ .sidebar>.author,
244
+ .nav-drawer-content>.author {
245
245
  text-align: center;
246
246
  text-decoration: none;
247
247
  padding: 20px;
248
248
  }
249
249
 
250
- .sidebar > .author,
251
- .nav-drawer-content > .author > b {
250
+ .sidebar>.author,
251
+ .nav-drawer-content>.author>b {
252
252
  font-weight: bold;
253
253
  }
254
254
 
@@ -268,9 +268,9 @@ a.jump.previous::before {
268
268
  cursor: pointer;
269
269
  }
270
270
 
271
- .toggle > .bar1,
272
- .toggle > .bar2,
273
- .toggle > .bar3 {
271
+ .toggle>.bar1,
272
+ .toggle>.bar2,
273
+ .toggle>.bar3 {
274
274
  width: 35px;
275
275
  height: 5px;
276
276
  margin: 6px 0;
@@ -386,7 +386,7 @@ header {
386
386
  margin-right: 8px;
387
387
  }
388
388
 
389
- #custom-links-footer > .links-item {
389
+ #custom-links-footer>.links-item {
390
390
  border-radius: 8px;
391
391
  padding: 8px;
392
392
  border: 1px solid var(--color-nav-border);
@@ -565,13 +565,13 @@ header {
565
565
 
566
566
  .section ul,
567
567
  .virtual-section ul,
568
- nav > ul {
568
+ nav>ul {
569
569
  list-style-type: none;
570
570
  margin: 0;
571
571
  padding: 0;
572
572
  }
573
573
 
574
- nav li + li {
574
+ nav li+li {
575
575
  margin-top: 0px;
576
576
  }
577
577
 
@@ -585,7 +585,7 @@ nav li + li {
585
585
  margin-top: 8px;
586
586
  }
587
587
 
588
- .section > .name {
588
+ .section>.name {
589
589
  display: flex;
590
590
  text-decoration: none;
591
591
  padding: 10px;
@@ -595,12 +595,12 @@ nav li + li {
595
595
  user-select: none;
596
596
  }
597
597
 
598
- .section > .name > .label {
598
+ .section>.name>.label {
599
599
  flex: 1;
600
600
  text-decoration: none;
601
601
  }
602
602
 
603
- .section > .name > .toggle {
603
+ .section>.name>.toggle {
604
604
  text-align: right;
605
605
  background: none;
606
606
  border: none;
@@ -613,8 +613,10 @@ nav li + li {
613
613
 
614
614
  .collapsible:after {
615
615
  content: "\002B";
616
+ width: 1.2rem;
616
617
  color: var(--color-text);
617
618
  font-weight: bold;
619
+ text-align: right;
618
620
  float: right;
619
621
  margin-left: 5px;
620
622
  }
@@ -628,7 +630,7 @@ nav li + li {
628
630
  opacity: 0;
629
631
  }
630
632
 
631
- .collapsible.expanded + .collapsible-content {
633
+ .collapsible.expanded+.collapsible-content {
632
634
  display: block;
633
635
  opacity: 1;
634
636
  }
@@ -644,7 +646,7 @@ nav li + li {
644
646
  text-decoration: none;
645
647
  }
646
648
 
647
- .section > .links {
649
+ .section>.links {
648
650
  border-left-width: 1px;
649
651
  border-left-style: solid;
650
652
  }
@@ -676,12 +678,12 @@ nav.toc li {
676
678
  margin-bottom: 8px;
677
679
  }
678
680
 
679
- nav.toc li > a {
681
+ nav.toc li>a {
680
682
  color: var(--color-text);
681
683
  text-decoration: none;
682
684
  }
683
685
 
684
- nav.toc li > a:hover {
686
+ nav.toc li>a:hover {
685
687
  color: var(--color-brand);
686
688
  }
687
689
 
@@ -735,4 +737,4 @@ nav.toc li.level-3 {
735
737
  mask-repeat: no-repeat;
736
738
  cursor: pointer;
737
739
  mask-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXVwbG9hZCI+PHBhdGggZD0iTTIxIDE1djRhMiAyIDAgMCAxLTIgMkg1YTIgMiAwIDAgMS0yLTJ2LTQiLz48cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4Ii8+PGxpbmUgeDE9IjEyIiB4Mj0iMTIiIHkxPSIzIiB5Mj0iMTUiLz48L3N2Zz4=");
738
- }
740
+ }
package/dist/index.js CHANGED
@@ -73314,6 +73314,7 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
73314
73314
  editor = false,
73315
73315
  id = hash(node3)
73316
73316
  } = node3.properties || {};
73317
+ let bEditor = editor === "true";
73317
73318
  expectContainerDirective(node3, file, name);
73318
73319
  registerDirective(file, name, ["client.js"], ["style.css"]);
73319
73320
  requestJS(file, ["code-input", "code-input.min.js"]);
@@ -73342,7 +73343,7 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
73342
73343
  const srcdoc = template.replace("###SLOT###", wrapSketch(srcFile)).replace(/\u00A0/g, " ");
73343
73344
  node3.tagName = "div";
73344
73345
  node3.properties = {
73345
- class: ["directive-p5", editor ? "" : "standalone"].join(" "),
73346
+ class: ["directive-p5", bEditor ? "" : "standalone"].join(" "),
73346
73347
  "data-template": template.replace(/\u00A0/g, " "),
73347
73348
  "data-id": id
73348
73349
  };
@@ -73369,7 +73370,7 @@ ${(code4.scripts ? [cdnLibraryUrl, ...code4.scripts] : []).map((src) => `<script
73369
73370
  }
73370
73371
  ]
73371
73372
  },
73372
- ...editor ? [
73373
+ ...bEditor ? [
73373
73374
  {
73374
73375
  type: "element",
73375
73376
  tagName: "div",