@stacksjs/bunpress 0.1.21 → 0.2.1

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.
Files changed (57) hide show
  1. package/dist/bin/cli.d.ts +3 -0
  2. package/dist/bin/cli.js +1 -1
  3. package/dist/bin/commands/doctor.d.ts +1 -0
  4. package/dist/bin/commands/seo.d.ts +19 -0
  5. package/dist/{chunk-qrp18ybj.js → chunk-desvs9bx.js} +1 -1
  6. package/dist/chunk-em1tv2bw.js +38 -0
  7. package/dist/{chunk-kxr6zf7e.js → chunk-kfbpnqaw.js} +1308 -696
  8. package/dist/chunk-qqn901qf.js +393 -0
  9. package/dist/{chunk-qdmkac4z.js → chunk-qzhr4d2q.js} +10 -11
  10. package/dist/chunk-y3z183hg.js +10 -0
  11. package/dist/chunk-yfwm5337.js +2 -0
  12. package/dist/{chunk-m0g9vk1e.js → chunk-zkdm5pr7.js} +401 -194
  13. package/dist/src/build-manifest.d.ts +22 -0
  14. package/dist/src/config.d.ts +12 -0
  15. package/dist/src/data-loader.d.ts +6 -3
  16. package/dist/src/highlighter.d.ts +2 -1
  17. package/dist/src/i18n.d.ts +67 -0
  18. package/dist/src/index.d.ts +2 -0
  19. package/dist/src/index.js +1 -1
  20. package/dist/src/markdown-fences.d.ts +37 -0
  21. package/dist/src/page-meta.d.ts +19 -0
  22. package/dist/src/search-index.d.ts +61 -0
  23. package/dist/src/serve.d.ts +20 -5
  24. package/dist/src/toc.d.ts +20 -2
  25. package/dist/src/types.d.ts +80 -8
  26. package/dist/templates/blocks/alerts/caution.stx +2 -2
  27. package/dist/templates/blocks/alerts/important.stx +2 -2
  28. package/dist/templates/blocks/alerts/note.stx +2 -2
  29. package/dist/templates/blocks/alerts/tip.stx +2 -2
  30. package/dist/templates/blocks/alerts/warning.stx +2 -2
  31. package/dist/templates/blocks/containers/danger.stx +2 -2
  32. package/dist/templates/blocks/containers/details.stx +2 -2
  33. package/dist/templates/blocks/containers/info.stx +2 -2
  34. package/dist/templates/blocks/containers/raw.stx +1 -1
  35. package/dist/templates/blocks/containers/tip.stx +2 -2
  36. package/dist/templates/blocks/containers/warning.stx +2 -2
  37. package/dist/templates/copy-page.stx +81 -0
  38. package/dist/templates/doc-footer.stx +51 -0
  39. package/dist/templates/footer.stx +45 -0
  40. package/dist/templates/hero.stx +9 -2
  41. package/dist/templates/layout-doc.stx +8 -125
  42. package/dist/templates/layout-home.stx +7 -14
  43. package/dist/templates/layout-page.stx +7 -14
  44. package/dist/templates/locale-switcher.stx +115 -0
  45. package/dist/templates/navbar.stx +49 -0
  46. package/dist/templates/page-outline.stx +149 -0
  47. package/dist/templates/page-toc.stx +1 -1
  48. package/dist/templates/search-algolia.stx +85 -0
  49. package/dist/templates/search.stx +661 -0
  50. package/dist/templates/sidebar-section.stx +44 -11
  51. package/dist/templates/sidebar.stx +11 -2
  52. package/dist/themes/vitepress/index.ts +558 -165
  53. package/package.json +16 -7
  54. package/dist/chunk-9cm3e4r4.js +0 -688
  55. package/dist/chunk-mjhqecp5.js +0 -467
  56. package/dist/chunk-wmvgjzgh.js +0 -3
  57. package/dist/chunk-zmxtnx2v.js +0 -8
@@ -0,0 +1,149 @@
1
+ <details class="bp-local-outline">
2
+ <summary class="bp-local-outline-summary">
3
+ <svg class="bp-local-outline-icon" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
4
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M4 6h16M4 12h16M4 18h10"></path>
5
+ </svg>
6
+ <span class="bp-local-outline-label">{{ title }}</span>
7
+ <span class="bp-local-outline-count">{{ count }}</span>
8
+ <svg class="bp-local-outline-chevron" fill="none" stroke="currentColor" viewBox="0 0 24 24" aria-hidden="true">
9
+ <path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 9l-7 7-7-7"></path>
10
+ </svg>
11
+ </summary>
12
+ <nav class="bp-local-outline-items" aria-label="{{ title }}">
13
+ {!! items !!}
14
+ </nav>
15
+ </details>
16
+
17
+ <style>
18
+ /* In-content page outline. Fills the range where the fixed .BPDocAside has no
19
+ room to render — see the 1280px rule at the bottom of this block. Built on
20
+ <details> so it collapses, is keyboard operable and survives without JS. */
21
+ .bp-local-outline {
22
+ margin: 0 0 32px;
23
+ border: 1px solid var(--bp-c-divider);
24
+ border-radius: 8px;
25
+ background-color: var(--bp-c-bg-soft);
26
+ overflow: hidden;
27
+ }
28
+
29
+ .bp-local-outline-summary {
30
+ display: flex;
31
+ align-items: center;
32
+ gap: 8px;
33
+ padding: 10px 14px;
34
+ font-size: 13px;
35
+ font-weight: 600;
36
+ color: var(--bp-c-text-1);
37
+ cursor: pointer;
38
+ user-select: none;
39
+ list-style: none;
40
+ transition: color 0.25s;
41
+ }
42
+
43
+ /* Suppress the native disclosure triangle in both engines — the chevron on
44
+ the right is the affordance. */
45
+ .bp-local-outline-summary::-webkit-details-marker {
46
+ display: none;
47
+ }
48
+
49
+ .bp-local-outline-summary::marker {
50
+ content: '';
51
+ }
52
+
53
+ .bp-local-outline-summary:hover {
54
+ color: var(--bp-c-brand-1);
55
+ }
56
+
57
+ .bp-local-outline-summary:focus-visible {
58
+ outline: 2px solid var(--bp-c-brand-1);
59
+ outline-offset: -2px;
60
+ }
61
+
62
+ .bp-local-outline-icon {
63
+ width: 16px;
64
+ height: 16px;
65
+ flex-shrink: 0;
66
+ color: var(--bp-c-text-3);
67
+ }
68
+
69
+ .bp-local-outline-label {
70
+ flex: 1;
71
+ min-width: 0;
72
+ }
73
+
74
+ .bp-local-outline-count {
75
+ font-size: 12px;
76
+ font-weight: 500;
77
+ color: var(--bp-c-text-3);
78
+ font-variant-numeric: tabular-nums;
79
+ }
80
+
81
+ .bp-local-outline-chevron {
82
+ width: 14px;
83
+ height: 14px;
84
+ flex-shrink: 0;
85
+ color: var(--bp-c-text-3);
86
+ transition: transform 0.2s ease;
87
+ }
88
+
89
+ .bp-local-outline[open] .bp-local-outline-chevron {
90
+ transform: rotate(180deg);
91
+ }
92
+
93
+ .bp-local-outline-items {
94
+ display: flex;
95
+ flex-direction: column;
96
+ padding: 4px 0 10px;
97
+ border-top: 1px solid var(--bp-c-divider);
98
+ /* A long page must not turn the outline into a wall of links. */
99
+ max-height: 60vh;
100
+ overflow-y: auto;
101
+ overscroll-behavior: contain;
102
+ }
103
+
104
+ .bp-local-outline-items a {
105
+ padding: 6px 14px 6px 16px;
106
+ font-size: 13px;
107
+ line-height: 1.5;
108
+ font-weight: 400;
109
+ color: var(--bp-c-text-2);
110
+ text-decoration: none;
111
+ border-left: 2px solid transparent;
112
+ transition: color 0.25s, background-color 0.25s;
113
+ }
114
+
115
+ .bp-local-outline-items a:hover {
116
+ color: var(--bp-c-brand-1);
117
+ background-color: var(--bp-c-default-soft, var(--bp-c-gray-soft));
118
+ }
119
+
120
+ .bp-local-outline-items a:focus-visible {
121
+ outline: 2px solid var(--bp-c-brand-1);
122
+ outline-offset: -2px;
123
+ }
124
+
125
+ /* Nesting mirrors the aside's indent scale. */
126
+ .bp-local-outline-items a.level-3 {
127
+ padding-left: 32px;
128
+ }
129
+
130
+ .bp-local-outline-items a.level-4 {
131
+ padding-left: 48px;
132
+ }
133
+
134
+ .bp-local-outline-items a.level-5 {
135
+ padding-left: 64px;
136
+ }
137
+
138
+ .bp-local-outline-items a.level-6 {
139
+ padding-left: 80px;
140
+ }
141
+
142
+ /* From 1280px the fixed aside takes over, so the inline copy would be a
143
+ duplicate. Keep this breakpoint in sync with .BPDocAside in page-toc.stx. */
144
+ @media (min-width: 1280px) {
145
+ .bp-local-outline {
146
+ display: none;
147
+ }
148
+ }
149
+ </style>
@@ -1,6 +1,6 @@
1
1
  <aside class="BPDocAside">
2
2
  <div class="BPDocAsideOutline">
3
- <p class="outline-title">On this page</p>
3
+ <p class="outline-title">{{ title }}</p>
4
4
  <nav class="page-toc">
5
5
  <div class="outline-marker"></div>
6
6
  {!! items !!}
@@ -0,0 +1,85 @@
1
+ <link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@docsearch/css@3">
2
+
3
+ <style>
4
+ /* DocSearch renders its own button, but the nav already has one styled to
5
+ match the site — so the built-in trigger stays hidden and ours drives it. */
6
+ #bp-docsearch {
7
+ display: none;
8
+ }
9
+
10
+ /* Map DocSearch's palette onto the theme's variables so the modal belongs to
11
+ the site in both colour schemes instead of shipping its own blue. */
12
+ :root {
13
+ --docsearch-primary-color: var(--bp-c-brand-1);
14
+ --docsearch-text-color: var(--bp-c-text-1);
15
+ --docsearch-muted-color: var(--bp-c-text-2);
16
+ --docsearch-container-background: rgba(15, 15, 17, 0.55);
17
+ --docsearch-modal-background: var(--bp-c-bg);
18
+ --docsearch-modal-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
19
+ --docsearch-searchbox-background: var(--bp-c-bg-soft);
20
+ --docsearch-searchbox-focus-background: var(--bp-c-bg);
21
+ --docsearch-hit-color: var(--bp-c-text-1);
22
+ --docsearch-hit-background: var(--bp-c-bg-soft);
23
+ --docsearch-hit-shadow: none;
24
+ --docsearch-footer-background: var(--bp-c-bg-soft);
25
+ --docsearch-footer-shadow: 0 -1px 0 var(--bp-c-divider);
26
+ --docsearch-key-gradient: var(--bp-c-bg);
27
+ --docsearch-key-shadow: none;
28
+ }
29
+ </style>
30
+
31
+ <div id="bp-docsearch"></div>
32
+
33
+ <script type="application/json" id="bp-search-config">{!! runtimeConfig !!}</script>
34
+ <script src="https://cdn.jsdelivr.net/npm/@docsearch/js@3" defer></script>
35
+ <script>
36
+ (function () {
37
+ if (window.__bpSearchBound) return;
38
+ window.__bpSearchBound = true;
39
+
40
+ var CONFIG = (function () {
41
+ try { return JSON.parse(document.getElementById('bp-search-config').textContent); }
42
+ catch (_) { return {}; }
43
+ })();
44
+
45
+ var started = false;
46
+
47
+ function start() {
48
+ if (started || typeof window.docsearch !== 'function') return;
49
+ started = true;
50
+
51
+ window.docsearch({
52
+ container: '#bp-docsearch',
53
+ appId: CONFIG.algolia.appId,
54
+ apiKey: CONFIG.algolia.apiKey,
55
+ indexName: CONFIG.algolia.indexName,
56
+ searchParameters: CONFIG.algolia.searchParameters || {},
57
+ placeholder: CONFIG.placeholder,
58
+ // Results are same-origin, so route them through the SPA router instead
59
+ // of a full page load.
60
+ navigator: {
61
+ navigate: function (item) { window.location.assign(item.itemUrl); },
62
+ },
63
+ });
64
+ }
65
+
66
+ // DocSearch owns its own dialog and shortcut handling; the nav button just
67
+ // forwards a click to the trigger it renders.
68
+ function openDocSearch() {
69
+ start();
70
+ var trigger = document.querySelector('#bp-docsearch .DocSearch-Button');
71
+ if (trigger) trigger.click();
72
+ }
73
+
74
+ document.addEventListener('click', function (e) {
75
+ if (e.target.closest('.BPNavBarSearch')) {
76
+ e.preventDefault();
77
+ openDocSearch();
78
+ }
79
+ });
80
+
81
+ if (document.readyState === 'loading') document.addEventListener('DOMContentLoaded', start);
82
+ else start();
83
+ window.addEventListener('load', start);
84
+ })();
85
+ </script>