seemore 1.8.5 → 1.8.7
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/package.json
CHANGED
|
@@ -180,7 +180,10 @@ export function Overview() {
|
|
|
180
180
|
/** Pages render as card grids; a folder opens a titled section holding its own cards. */
|
|
181
181
|
type Segment = { pages: PageTree.Item[] } | { folder: PageTree.Folder };
|
|
182
182
|
|
|
183
|
-
|
|
183
|
+
/** h2 at the top level, one step smaller per nesting level, capped at h6. */
|
|
184
|
+
const SECTION_HEADING_TAGS = ['h2', 'h3', 'h4', 'h5', 'h6'] as const;
|
|
185
|
+
|
|
186
|
+
function OverviewSections({ nodes, depth = 0 }: { nodes: PageTree.Node[]; depth?: number }) {
|
|
184
187
|
const segments: Segment[] = [];
|
|
185
188
|
for (const node of nodes) {
|
|
186
189
|
if (node.type === 'page') {
|
|
@@ -192,6 +195,8 @@ function OverviewSections({ nodes }: { nodes: PageTree.Node[] }) {
|
|
|
192
195
|
}
|
|
193
196
|
}
|
|
194
197
|
|
|
198
|
+
const Heading = SECTION_HEADING_TAGS[Math.min(depth, SECTION_HEADING_TAGS.length - 1)] ?? 'h6';
|
|
199
|
+
|
|
195
200
|
return (
|
|
196
201
|
<>
|
|
197
202
|
{segments.map((segment, index) =>
|
|
@@ -199,7 +204,7 @@ function OverviewSections({ nodes }: { nodes: PageTree.Node[] }) {
|
|
|
199
204
|
<OverviewGrid key={index} pages={segment.pages} />
|
|
200
205
|
) : (
|
|
201
206
|
<section key={index} className="seemore-overview-section">
|
|
202
|
-
<
|
|
207
|
+
<Heading className="seemore-overview-section-title">{segment.folder.name}</Heading>
|
|
203
208
|
{typeof segment.folder.description === 'string' && segment.folder.description !== '' ? (
|
|
204
209
|
<p className="seemore-overview-section-description">{segment.folder.description}</p>
|
|
205
210
|
) : undefined}
|
|
@@ -210,6 +215,7 @@ function OverviewSections({ nodes }: { nodes: PageTree.Node[] }) {
|
|
|
210
215
|
? segment.folder.children
|
|
211
216
|
: [segment.folder.index, ...segment.folder.children]
|
|
212
217
|
}
|
|
218
|
+
depth={depth + 1}
|
|
213
219
|
/>
|
|
214
220
|
</section>
|
|
215
221
|
),
|