@stacksjs/bunpress 0.2.32 → 0.2.34
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.
- package/dist/bin/cli.js +1 -1
- package/dist/{chunk-15vwh1bm.js → chunk-19em34hd.js} +1 -1
- package/dist/{chunk-f5ycxw18.js → chunk-dgdd6yma.js} +2 -2
- package/dist/chunk-epvd70ef.js +2 -0
- package/dist/{chunk-ttas3mc2.js → chunk-gvc75334.js} +200 -125
- package/dist/{chunk-ebrg03kn.js → chunk-nfaqt4jb.js} +6 -6
- package/dist/{chunk-verdt5gx.js → chunk-nv4f6b5n.js} +1 -1
- package/dist/{chunk-gn1n2yxt.js → chunk-twt99rzk.js} +1 -1
- package/dist/{chunk-5dtz0br7.js → chunk-zxfhq634.js} +2 -2
- package/dist/src/highlighter.d.ts +43 -1
- package/dist/src/hoist-styles.d.ts +3 -0
- package/dist/src/index.js +1 -1
- package/dist/src/long-page.d.ts +51 -0
- package/dist/src/minify-css.d.ts +1 -0
- package/dist/src/template-loader.d.ts +10 -0
- package/dist/templates/layout-doc.stx +1 -1
- package/dist/templates/sidebar-section.stx +0 -192
- package/dist/templates/sidebar.stx +194 -0
- package/package.json +1 -1
- package/dist/chunk-fy78hg56.js +0 -2
|
@@ -5,7 +5,21 @@
|
|
|
5
5
|
</div>
|
|
6
6
|
</nav>
|
|
7
7
|
|
|
8
|
+
{{-- The two section toggles and the section styles live in this template,
|
|
9
|
+
once, rather than in sidebar-section.stx: a template's script and styles are
|
|
10
|
+
emitted wherever it renders, and a sidebar renders that one for each of its
|
|
11
|
+
sections. --}}
|
|
8
12
|
<script>
|
|
13
|
+
function toggleSection(section) {
|
|
14
|
+
section.classList.toggle('collapsed');
|
|
15
|
+
}
|
|
16
|
+
function toggleSidebarGroup(button) {
|
|
17
|
+
var group = button.closest('.BPSidebarGroup');
|
|
18
|
+
if (!group) return;
|
|
19
|
+
var collapsed = group.classList.toggle('collapsed');
|
|
20
|
+
button.setAttribute('aria-expanded', collapsed ? 'false' : 'true');
|
|
21
|
+
}
|
|
22
|
+
|
|
9
23
|
function toggleSidebar(forceState) {
|
|
10
24
|
var sb = document.querySelector('.BPSidebar');
|
|
11
25
|
var bd = document.querySelector('.BPSidebar-backdrop');
|
|
@@ -82,4 +96,184 @@ if (!window.__bpSidebarBound) {
|
|
|
82
96
|
margin-left: 0;
|
|
83
97
|
}
|
|
84
98
|
}
|
|
99
|
+
|
|
100
|
+
/* A section of the sidebar (sidebar-section.stx), styled here for the same
|
|
101
|
+
reason its toggles are defined here: once per sidebar, not once per section. */
|
|
102
|
+
.sidebar-section {
|
|
103
|
+
margin-bottom: 4px;
|
|
104
|
+
padding-bottom: 4px;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
.sidebar-section + .sidebar-section {
|
|
108
|
+
border-top: 1px solid var(--bp-c-divider);
|
|
109
|
+
padding-top: 10px;
|
|
110
|
+
margin-top: 10px;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
.sidebar-section-toggle {
|
|
114
|
+
width: 100%;
|
|
115
|
+
display: flex;
|
|
116
|
+
align-items: center;
|
|
117
|
+
justify-content: space-between;
|
|
118
|
+
gap: 8px;
|
|
119
|
+
padding: 6px 20px 6px 22px;
|
|
120
|
+
font-size: 13px;
|
|
121
|
+
font-weight: 700;
|
|
122
|
+
letter-spacing: 0.01em;
|
|
123
|
+
color: var(--bp-c-text-1);
|
|
124
|
+
background: transparent;
|
|
125
|
+
border: none;
|
|
126
|
+
cursor: pointer;
|
|
127
|
+
transition: color 0.25s;
|
|
128
|
+
font-family: inherit;
|
|
129
|
+
text-align: left;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
.sidebar-section-toggle > span {
|
|
133
|
+
min-width: 0;
|
|
134
|
+
overflow: hidden;
|
|
135
|
+
text-overflow: ellipsis;
|
|
136
|
+
white-space: nowrap;
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
.sidebar-section-toggle:hover {
|
|
140
|
+
color: var(--bp-c-brand-1);
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
.sidebar-section-toggle .chevron {
|
|
144
|
+
width: 14px;
|
|
145
|
+
height: 14px;
|
|
146
|
+
color: var(--bp-c-text-3);
|
|
147
|
+
transition: transform 0.2s ease-in-out;
|
|
148
|
+
flex-shrink: 0;
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
.sidebar-items {
|
|
152
|
+
list-style: none;
|
|
153
|
+
margin: 2px 0 0 0;
|
|
154
|
+
padding: 0;
|
|
155
|
+
}
|
|
156
|
+
|
|
157
|
+
/* Animates to the section's own height. A max-height of 1000px cut off any
|
|
158
|
+
* section longer than that, which nested groups make easy to reach. */
|
|
159
|
+
.sidebar-items-wrapper {
|
|
160
|
+
display: grid;
|
|
161
|
+
grid-template-rows: 1fr;
|
|
162
|
+
transition: grid-template-rows 0.3s ease-in-out, opacity 0.2s ease-in-out;
|
|
163
|
+
opacity: 1;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
.sidebar-items-wrapper > .sidebar-items { overflow: hidden; min-height: 0; }
|
|
167
|
+
|
|
168
|
+
.sidebar-section.collapsed > .sidebar-items-wrapper {
|
|
169
|
+
grid-template-rows: 0fr;
|
|
170
|
+
opacity: 0;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
.sidebar-section.collapsed > .sidebar-section-toggle .chevron {
|
|
174
|
+
transform: rotate(-90deg);
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
.BPSidebarItem-link {
|
|
178
|
+
display: block;
|
|
179
|
+
/* Indented one step past the section title so the hierarchy reads at a
|
|
180
|
+
* glance, and one more step per nested group; the 2px rail is transparent
|
|
181
|
+
* until active, so the label never shifts sideways when you navigate to it. */
|
|
182
|
+
padding: 6px 20px 6px calc(32px + var(--bp-sidebar-depth, 0) * 14px);
|
|
183
|
+
color: var(--bp-c-text-2);
|
|
184
|
+
text-decoration: none;
|
|
185
|
+
font-size: 14px;
|
|
186
|
+
line-height: 1.5;
|
|
187
|
+
transition: color 0.25s, background-color 0.25s;
|
|
188
|
+
border-left: 2px solid transparent;
|
|
189
|
+
overflow-wrap: anywhere;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
.BPSidebarItem-link:hover {
|
|
193
|
+
color: var(--bp-c-brand-1);
|
|
194
|
+
background-color: var(--bp-c-default-soft, var(--bp-c-gray-soft));
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
.BPSidebarItem-link.is-active {
|
|
198
|
+
color: var(--bp-c-brand-1);
|
|
199
|
+
font-weight: 600;
|
|
200
|
+
border-left-color: var(--bp-c-brand-1);
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/* A nested group: its title at the level of its siblings, its items one step
|
|
204
|
+
* further in, folding the way a section does. */
|
|
205
|
+
.BPSidebarGroup-head {
|
|
206
|
+
display: flex;
|
|
207
|
+
align-items: center;
|
|
208
|
+
}
|
|
209
|
+
|
|
210
|
+
.BPSidebarGroup-link,
|
|
211
|
+
.BPSidebarGroup-text {
|
|
212
|
+
flex: 1;
|
|
213
|
+
min-width: 0;
|
|
214
|
+
padding: 6px 4px 6px calc(32px + var(--bp-sidebar-depth, 0) * 14px);
|
|
215
|
+
color: var(--bp-c-text-1);
|
|
216
|
+
font-size: 14px;
|
|
217
|
+
font-weight: 600;
|
|
218
|
+
line-height: 1.5;
|
|
219
|
+
text-decoration: none;
|
|
220
|
+
border-left: 2px solid transparent;
|
|
221
|
+
overflow-wrap: anywhere;
|
|
222
|
+
}
|
|
223
|
+
|
|
224
|
+
.BPSidebarGroup-link:hover { color: var(--bp-c-brand-1); }
|
|
225
|
+
.BPSidebarGroup-link.is-active { color: var(--bp-c-brand-1); border-left-color: var(--bp-c-brand-1); }
|
|
226
|
+
|
|
227
|
+
.BPSidebarGroup-toggle {
|
|
228
|
+
display: flex;
|
|
229
|
+
align-items: center;
|
|
230
|
+
justify-content: center;
|
|
231
|
+
flex-shrink: 0;
|
|
232
|
+
width: 32px;
|
|
233
|
+
height: 32px;
|
|
234
|
+
margin-right: 12px;
|
|
235
|
+
padding: 0;
|
|
236
|
+
color: var(--bp-c-text-3);
|
|
237
|
+
background: transparent;
|
|
238
|
+
border: none;
|
|
239
|
+
border-radius: 6px;
|
|
240
|
+
cursor: pointer;
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
.BPSidebarGroup-toggle:hover { color: var(--bp-c-brand-1); background-color: var(--bp-c-default-soft, var(--bp-c-gray-soft)); }
|
|
244
|
+
|
|
245
|
+
.BPSidebarGroup-toggle .chevron {
|
|
246
|
+
width: 14px;
|
|
247
|
+
height: 14px;
|
|
248
|
+
transition: transform 0.2s ease-in-out;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/* Rows that animate to their content's own height, however long the group:
|
|
252
|
+
* a fixed max-height clipped a long group and lagged on a short one. */
|
|
253
|
+
.BPSidebarGroup-items {
|
|
254
|
+
display: grid;
|
|
255
|
+
grid-template-rows: 1fr;
|
|
256
|
+
transition: grid-template-rows 0.25s ease-in-out, opacity 0.2s ease-in-out;
|
|
257
|
+
}
|
|
258
|
+
|
|
259
|
+
.BPSidebarGroup-items > .sidebar-items { overflow: hidden; min-height: 0; margin: 0; }
|
|
260
|
+
.BPSidebarGroup.collapsed > .BPSidebarGroup-items { grid-template-rows: 0fr; opacity: 0; }
|
|
261
|
+
.BPSidebarGroup.collapsed > .BPSidebarGroup-head .chevron { transform: rotate(-90deg); }
|
|
262
|
+
|
|
263
|
+
@media (prefers-reduced-motion: reduce) {
|
|
264
|
+
.BPSidebarGroup-items, .BPSidebarGroup-toggle .chevron { transition: none; }
|
|
265
|
+
}
|
|
266
|
+
|
|
267
|
+
/* Larger rows on touch layouts, where the drawer is the primary navigation. */
|
|
268
|
+
@media (max-width: 959px) {
|
|
269
|
+
.BPSidebarItem-link {
|
|
270
|
+
padding-top: 9px;
|
|
271
|
+
padding-bottom: 9px;
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
.sidebar-section-toggle {
|
|
275
|
+
padding-top: 10px;
|
|
276
|
+
padding-bottom: 10px;
|
|
277
|
+
}
|
|
278
|
+
}
|
|
85
279
|
</style>
|
package/package.json
CHANGED
package/dist/chunk-fy78hg56.js
DELETED
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
// @bun
|
|
2
|
-
import{j as c,k as d,l as e,m as f,n as g}from"./chunk-ttas3mc2.js";import{aa as b}from"./chunk-f5ycxw18.js";import{ha as a}from"./chunk-gn1n2yxt.js";export{d as wrapInLayout,c as stripConfiguredBasePath,f as startServer,g as serveCLI,e as markdownToHtml,a as getConfiguredBasePath,b as decodeHtmlEntities};
|