@octanejs/docusaurus 0.0.48 → 0.0.50
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 +6 -6
- package/src/client-components.tsrx +10 -6
- package/src/theme-components.tsrx +34 -42
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@octanejs/docusaurus",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.50",
|
|
4
4
|
"description": "Docusaurus content and MDX integration for Octane",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -70,14 +70,14 @@
|
|
|
70
70
|
"./package.json": "./package.json"
|
|
71
71
|
},
|
|
72
72
|
"dependencies": {
|
|
73
|
-
"@octanejs/mdx": "0.1.
|
|
74
|
-
"@octanejs/remix-router": "0.1.
|
|
75
|
-
"@octanejs/seo": "0.0.
|
|
73
|
+
"@octanejs/mdx": "0.1.60",
|
|
74
|
+
"@octanejs/remix-router": "0.1.59",
|
|
75
|
+
"@octanejs/seo": "0.0.49",
|
|
76
76
|
"github-slugger": "1.5.0"
|
|
77
77
|
},
|
|
78
78
|
"peerDependencies": {
|
|
79
79
|
"@docusaurus/core": "3.10.1",
|
|
80
|
-
"octane": "^0.
|
|
80
|
+
"octane": "^0.11.0",
|
|
81
81
|
"vite": ">=7.0.0"
|
|
82
82
|
},
|
|
83
83
|
"peerDependenciesMeta": {
|
|
@@ -89,7 +89,7 @@
|
|
|
89
89
|
"@docusaurus/core": "3.10.1",
|
|
90
90
|
"@docusaurus/plugin-content-docs": "3.10.1",
|
|
91
91
|
"@types/node": "^24.13.3",
|
|
92
|
-
"octane": "0.
|
|
92
|
+
"octane": "0.11.0",
|
|
93
93
|
"vite": "^8.1.5",
|
|
94
94
|
"vitest": "^4.1.10"
|
|
95
95
|
},
|
|
@@ -61,9 +61,9 @@ function mergeRouteContext(
|
|
|
61
61
|
const ownPlugin = resolvedPlugin as DocusaurusPluginIdentifier | undefined;
|
|
62
62
|
const plugin = parent?.plugin ?? ownPlugin ?? route.plugin;
|
|
63
63
|
if (plugin === undefined) {
|
|
64
|
-
throw new Error(
|
|
65
|
-
route.path
|
|
66
|
-
)
|
|
64
|
+
throw new Error(
|
|
65
|
+
`[@octanejs/docusaurus] Route ${String(route.path)} has no Docusaurus plugin context.`,
|
|
66
|
+
);
|
|
67
67
|
}
|
|
68
68
|
return {
|
|
69
69
|
plugin,
|
|
@@ -71,7 +71,7 @@ function mergeRouteContext(
|
|
|
71
71
|
...parent?.data,
|
|
72
72
|
...ownData,
|
|
73
73
|
...(explicitData !== null && typeof explicitData === 'object'
|
|
74
|
-
? explicitData as Record<string, unknown>
|
|
74
|
+
? (explicitData as Record<string, unknown>)
|
|
75
75
|
: {}),
|
|
76
76
|
},
|
|
77
77
|
};
|
|
@@ -120,7 +120,9 @@ export function DocusaurusRouteRenderer(props: {
|
|
|
120
120
|
export function useDocusaurusManifest(): DocusaurusManifestValue {
|
|
121
121
|
const manifest = useContext(ManifestContext);
|
|
122
122
|
if (manifest === null) {
|
|
123
|
-
throw new Error(
|
|
123
|
+
throw new Error(
|
|
124
|
+
'[@octanejs/docusaurus] useDocusaurusManifest() requires DocusaurusRouterProvider.',
|
|
125
|
+
);
|
|
124
126
|
}
|
|
125
127
|
return manifest;
|
|
126
128
|
}
|
|
@@ -128,7 +130,9 @@ export function useDocusaurusManifest(): DocusaurusManifestValue {
|
|
|
128
130
|
export function useDocusaurusRouteContext(): DocusaurusRouteContextValue {
|
|
129
131
|
const context = useContext(RouteContext);
|
|
130
132
|
if (context === null) {
|
|
131
|
-
throw new Error(
|
|
133
|
+
throw new Error(
|
|
134
|
+
'[@octanejs/docusaurus] useDocusaurusRouteContext() requires a matched Docusaurus route.',
|
|
135
|
+
);
|
|
132
136
|
}
|
|
133
137
|
return context;
|
|
134
138
|
}
|
|
@@ -67,16 +67,15 @@ type DocMetadata = {
|
|
|
67
67
|
next?: DocLink;
|
|
68
68
|
};
|
|
69
69
|
|
|
70
|
-
type DocContent =
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
noIndex?: boolean;
|
|
77
|
-
};
|
|
78
|
-
metadata?: DocMetadata;
|
|
70
|
+
type DocContent = ComponentBody<Record<string, unknown>> & {
|
|
71
|
+
contentTitle?: string;
|
|
72
|
+
frontMatter?: {
|
|
73
|
+
title?: string;
|
|
74
|
+
description?: string;
|
|
75
|
+
noIndex?: boolean;
|
|
79
76
|
};
|
|
77
|
+
metadata?: DocMetadata;
|
|
78
|
+
};
|
|
80
79
|
|
|
81
80
|
type RouteProps = {
|
|
82
81
|
attributes?: Record<string, unknown>;
|
|
@@ -131,8 +130,8 @@ function categoryItems(version: DocsVersion, href: string): DocLink[] {
|
|
|
131
130
|
for (const sidebar of Object.values(version.docsSidebars)) {
|
|
132
131
|
const category = findSidebarCategory(sidebar, href);
|
|
133
132
|
if (category === null) continue;
|
|
134
|
-
return (category.items ?? []).flatMap(
|
|
135
|
-
|
|
133
|
+
return (category.items ?? []).flatMap((item) =>
|
|
134
|
+
item.href === undefined
|
|
136
135
|
? []
|
|
137
136
|
: [
|
|
138
137
|
{
|
|
@@ -160,17 +159,13 @@ function ThemeLink(props: {
|
|
|
160
159
|
children?: OctaneNode;
|
|
161
160
|
}) @{
|
|
162
161
|
@if (isExternal(props.href)) {
|
|
163
|
-
<a
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
aria-current={props['aria-current']}
|
|
167
|
-
>{props.children}</a>
|
|
162
|
+
<a href={props.href} class={props.class} aria-current={props['aria-current']}>
|
|
163
|
+
{props.children}
|
|
164
|
+
</a>
|
|
168
165
|
} @else {
|
|
169
|
-
<RouterLink
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
aria-current={props['aria-current']}
|
|
173
|
-
>{props.children}</RouterLink>
|
|
166
|
+
<RouterLink to={props.href} class={props.class} aria-current={props['aria-current']}>
|
|
167
|
+
{props.children}
|
|
168
|
+
</RouterLink>
|
|
174
169
|
}
|
|
175
170
|
}
|
|
176
171
|
|
|
@@ -196,9 +191,9 @@ function Navbar(props: { config?: NavbarConfig }) @{
|
|
|
196
191
|
@for (const item of items; key navigationKey(item)) {
|
|
197
192
|
@if (resolvedHref(item) !== null) {
|
|
198
193
|
<li>
|
|
199
|
-
<ThemeLink
|
|
200
|
-
|
|
201
|
-
|
|
194
|
+
<ThemeLink href={withBaseUrl(manifest.baseUrl, resolvedHref(item)!)}>
|
|
195
|
+
{item.label}
|
|
196
|
+
</ThemeLink>
|
|
202
197
|
</li>
|
|
203
198
|
}
|
|
204
199
|
}
|
|
@@ -224,9 +219,9 @@ function Footer(props: { baseUrl: string; config?: FooterConfig }) @{
|
|
|
224
219
|
@for (const item of group.items; key navigationKey(item)) {
|
|
225
220
|
@if (resolvedHref(item) !== null) {
|
|
226
221
|
<li>
|
|
227
|
-
<ThemeLink
|
|
228
|
-
|
|
229
|
-
|
|
222
|
+
<ThemeLink href={withBaseUrl(props.baseUrl, resolvedHref(item)!)}>
|
|
223
|
+
{item.label}
|
|
224
|
+
</ThemeLink>
|
|
230
225
|
</li>
|
|
231
226
|
}
|
|
232
227
|
}
|
|
@@ -256,7 +251,9 @@ function SidebarItems(props: { items: SidebarItem[]; pathname: string }) @{
|
|
|
256
251
|
href={item.href}
|
|
257
252
|
class="octane-docs-sidebar__category"
|
|
258
253
|
aria-current={item.href === props.pathname ? 'page' : undefined}
|
|
259
|
-
>
|
|
254
|
+
>
|
|
255
|
+
{item.label}
|
|
256
|
+
</ThemeLink>
|
|
260
257
|
} @else {
|
|
261
258
|
<span class="octane-docs-sidebar__category">{item.label}</span>
|
|
262
259
|
}
|
|
@@ -266,7 +263,9 @@ function SidebarItems(props: { items: SidebarItem[]; pathname: string }) @{
|
|
|
266
263
|
<ThemeLink
|
|
267
264
|
href={item.href}
|
|
268
265
|
aria-current={item.href === props.pathname ? 'page' : undefined}
|
|
269
|
-
>
|
|
266
|
+
>
|
|
267
|
+
{item.label}
|
|
268
|
+
</ThemeLink>
|
|
270
269
|
} @else {
|
|
271
270
|
<span>{item.label}</span>
|
|
272
271
|
}
|
|
@@ -291,9 +290,9 @@ function PageMetadata(props: {
|
|
|
291
290
|
<Seo
|
|
292
291
|
title={title}
|
|
293
292
|
description={props.description}
|
|
294
|
-
canonical={
|
|
295
|
-
? undefined
|
|
296
|
-
|
|
293
|
+
canonical={
|
|
294
|
+
props.permalink === undefined ? undefined : absoluteUrl(manifest.site.url, props.permalink)
|
|
295
|
+
}
|
|
297
296
|
openGraph={{ title, description: props.description }}
|
|
298
297
|
robots={props.noIndex === true ? { index: false, follow: false } : undefined}
|
|
299
298
|
/>
|
|
@@ -331,9 +330,7 @@ function CardList(props: { items: DocLink[] }) @{
|
|
|
331
330
|
}
|
|
332
331
|
|
|
333
332
|
export function Root(props: { children?: OctaneNode }) @{
|
|
334
|
-
<>
|
|
335
|
-
{props.children}
|
|
336
|
-
</>
|
|
333
|
+
<>{props.children}</>
|
|
337
334
|
}
|
|
338
335
|
|
|
339
336
|
export function DocsRoot(props: { children?: OctaneNode }) @{
|
|
@@ -351,16 +348,11 @@ export function DocVersionRoot(props: { children?: OctaneNode; version: DocsVers
|
|
|
351
348
|
<VersionContext value={props.version}>{props.children}</VersionContext>
|
|
352
349
|
}
|
|
353
350
|
|
|
354
|
-
export function DocRoot(props: {
|
|
355
|
-
children?: OctaneNode;
|
|
356
|
-
location: Location;
|
|
357
|
-
route: RouteProps;
|
|
358
|
-
}) @{
|
|
351
|
+
export function DocRoot(props: { children?: OctaneNode; location: Location; route: RouteProps }) @{
|
|
359
352
|
const version = useDocsVersion();
|
|
360
353
|
const activeRoute = props.route.routes?.find((route) => route.path === props.location.pathname);
|
|
361
354
|
const sidebarId = activeRoute?.attributes?.sidebar;
|
|
362
|
-
const sidebar =
|
|
363
|
-
typeof sidebarId === 'string' ? version.docsSidebars[sidebarId] ?? [] : [];
|
|
355
|
+
const sidebar = typeof sidebarId === 'string' ? (version.docsSidebars[sidebarId] ?? []) : [];
|
|
364
356
|
|
|
365
357
|
<div class="octane-docs-layout">
|
|
366
358
|
@if (sidebar.length > 0) {
|