zudoku 0.1.1-dev.40 → 0.1.1-dev.41
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/lib/plugins/markdown/MdxPage.d.ts +3 -1
- package/dist/lib/plugins/markdown/MdxPage.js +7 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/generateRoutes.js +1 -7
- package/dist/lib/plugins/markdown/generateRoutes.js.map +1 -1
- package/lib/zudoku.plugins.js +12 -12
- package/package.json +1 -1
- package/src/lib/plugins/markdown/MdxPage.tsx +20 -3
- package/src/lib/plugins/markdown/generateRoutes.tsx +1 -19
|
@@ -1,3 +1,5 @@
|
|
|
1
1
|
import { type PropsWithChildren } from "react";
|
|
2
2
|
import type { MDXImport } from "./index.js";
|
|
3
|
-
export declare const MdxPage: ({
|
|
3
|
+
export declare const MdxPage: ({ mdxComponent: MdxComponent, frontmatter, tableOfContents, }: PropsWithChildren<Omit<MDXImport, "default"> & {
|
|
4
|
+
mdxComponent: MDXImport["default"];
|
|
5
|
+
}>) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -11,7 +11,12 @@ import { cn } from "../../util/cn.js";
|
|
|
11
11
|
import slugify from "../../util/slugify.js";
|
|
12
12
|
import { traverseNavigation } from "../../util/traverseNavigation.js";
|
|
13
13
|
import { Toc } from "./Toc.js";
|
|
14
|
-
|
|
14
|
+
import { useMDXComponents } from "@mdx-js/react";
|
|
15
|
+
const MarkdownHeadings = {
|
|
16
|
+
h2: ({ children, id }) => (_jsx(Heading, { level: 2, id: id, children: children, registerSidebarAnchor: true })),
|
|
17
|
+
h3: ({ children, id }) => (_jsx(Heading, { level: 3, id: id, children: children, registerSidebarAnchor: true })),
|
|
18
|
+
};
|
|
19
|
+
export const MdxPage = ({ mdxComponent: MdxComponent, frontmatter, tableOfContents, }) => {
|
|
15
20
|
const navItem = useTopNavigationItem();
|
|
16
21
|
const location = useLocation();
|
|
17
22
|
const categoryTitle = navItem
|
|
@@ -50,6 +55,6 @@ export const MdxPage = ({ children, frontmatter, tableOfContents, }) => {
|
|
|
50
55
|
});
|
|
51
56
|
return { prev, next };
|
|
52
57
|
}, [navItem, location.pathname]);
|
|
53
|
-
return (_jsxs("div", { className: "xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between", children: [_jsx(Helmet, { children: _jsx("title", { children: pageTitle }) }), _jsxs("div", { className: cn(ProseClasses, "max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]"), children: [_jsxs("header", { children: [category && _jsx(CategoryHeading, { children: category }), title && (_jsx(Heading, { level: 1, id: slugify(title, { lower: true }), children: title })), frontmatter?.description && (_jsx("p", { className: "prose-lg", children: frontmatter.description }))] }),
|
|
58
|
+
return (_jsxs("div", { className: "xl:grid grid-cols-[--sidecar-grid-cols] gap-8 justify-between", children: [_jsx(Helmet, { children: _jsx("title", { children: pageTitle }) }), _jsxs("div", { className: cn(ProseClasses, "max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]"), children: [_jsxs("header", { children: [category && _jsx(CategoryHeading, { children: category }), title && (_jsx(Heading, { level: 1, id: slugify(title, { lower: true }), children: title })), frontmatter?.description && (_jsx("p", { className: "prose-lg", children: frontmatter.description }))] }), _jsx(MdxComponent, { components: { ...useMDXComponents(), ...MarkdownHeadings } }), _jsx("hr", {}), _jsxs("div", { className: "not-prose flex items-center justify-between gap-8", children: [prev.path ? (_jsxs(Link, { to: prev.path, className: "flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-start hover:border-primary/85 transition shadow-sm hover:shadow-md", title: typeof prev.label === "string" ? prev.label : undefined, children: [_jsx("div", { className: "text-sm text-muted-foreground", children: "\u2190 Previous page" }), _jsx("div", { className: "text-lg text-primary truncate", children: prev.label })] })) : (_jsx("div", { className: "flex-1" })), next.path ? (_jsxs(Link, { to: next.path, className: "flex flex-col items-stretch gap-2 flex-1 truncate border border-border rounded px-6 py-4 text-end hover:border-primary/85 transition shadow-sm hover:shadow-md", title: typeof next.label === "string" ? next.label : undefined, children: [_jsx("div", { className: "text-sm text-muted-foreground", children: "Next page \u2192" }), _jsx("div", { className: "text-lg text-primary truncate", children: next.label })] })) : (_jsx("div", { className: "flex-1" }))] })] }), _jsx("div", { className: "hidden xl:block", children: showToc && _jsx(Toc, { entries: tocEntries }) })] }));
|
|
54
59
|
};
|
|
55
60
|
//# sourceMappingURL=MdxPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"MdxPage.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/MdxPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAA0C,MAAM,OAAO,CAAC;AACxE,OAAO,EAAE,eAAe,EAAE,MAAM,qCAAqC,CAAC;AACtE,OAAO,EAAE,OAAO,EAAE,MAAM,6BAA6B,CAAC;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,8BAA8B,CAAC;AAC5D,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AAC9C,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,EAAE,EAAE,MAAM,kBAAkB,CAAC;AACtC,OAAO,OAAO,MAAM,uBAAuB,CAAC;AAC5C,OAAO,EAAE,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"MdxPage.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/MdxPage.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAA0C,MAAM,OAAO,CAAC;AACxE,OAAO,EAA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components/Heading.js";
|
|
3
2
|
import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
|
|
4
3
|
import { isPathItem } from "../../components/navigation/util.js";
|
|
5
4
|
import { Navigate } from "../../core/router.js";
|
|
6
5
|
import { traverseNavigation } from "../../util/traverseNavigation.js";
|
|
7
6
|
import { MdxPage } from "./MdxPage.js";
|
|
8
|
-
import { useMDXComponents } from "@mdx-js/react";
|
|
9
|
-
const MarkdownHeadings = {
|
|
10
|
-
h2: ({ children, id }) => (_jsx(Heading, { level: 2, id: id, children: children, registerSidebarAnchor: true })),
|
|
11
|
-
h3: ({ children, id }) => (_jsx(Heading, { level: 3, id: id, children: children, registerSidebarAnchor: true })),
|
|
12
|
-
};
|
|
13
7
|
export const generateRoutes = (markdownFiles) => {
|
|
14
8
|
const routes = Object.entries(markdownFiles).flatMap(([file, importPromise]) => {
|
|
15
9
|
// @todo we can pass in the folder name and then filter the markdown files based on that path
|
|
@@ -27,7 +21,7 @@ export const generateRoutes = (markdownFiles) => {
|
|
|
27
21
|
lazy: async () => {
|
|
28
22
|
const { default: Component, ...props } = await importPromise();
|
|
29
23
|
return {
|
|
30
|
-
element:
|
|
24
|
+
element: _jsx(MdxPage, { mdxComponent: Component, ...props }),
|
|
31
25
|
};
|
|
32
26
|
},
|
|
33
27
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generateRoutes.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/generateRoutes.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"generateRoutes.js","sourceRoot":"","sources":["../../../../src/lib/plugins/markdown/generateRoutes.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,+CAA+C,CAAC;AACrF,OAAO,EAAE,UAAU,EAAE,MAAM,qCAAqC,CAAC;AACjE,OAAO,EAAE,QAAQ,EAAoB,MAAM,sBAAsB,CAAC;AAClE,OAAO,EAAE,kBAAkB,EAA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K,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAC5D,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC;QACd,IAAI,EAAE,IAAI,GAAG,EAAE;QACf,OAAO,EAAE,KAAC,QAAQ,KAAG;KACtB,CAAC,CAAC,CAAC;IAEJ,OAAO,CAAC,GAAG,MAAM,EAAE,GAAG,UAAU,CAAC,CAAC;AACpC,CAAC,CAAC;AAEF,MAAM,QAAQ,GAAG,GAAG,EAAE;IACpB,MAAM,OAAO,GAAG,oBAAoB,EAAE,CAAC;IAEvC,IAAI,CAAC,OAAO;QAAE,OAAO,IAAI,CAAC;IAE1B,OAAO,kBAAkB,CAAC,OAAO,EAAE,CAAC,IAAI,EAAE,QAAQ,EAAE,EAAE;QACpD,IAAI,UAAU,IAAI,IAAI,IAAI,CAAC,UAAU,CAAC,IAAI,CAAC;YAAE,OAAO;QACpD,OAAO,KAAC,QAAQ,IAAC,EAAE,EAAE,QAAQ,EAAE,OAAO,SAAG,CAAC;IAC5C,CAAC,CAAC,CAAC;AACL,CAAC,CAAC"}
|
package/lib/zudoku.plugins.js
CHANGED
|
@@ -10386,8 +10386,11 @@ const Mx = /* @__PURE__ */ Ra(Dx), lc = "data-active", Ps = ({
|
|
|
10386
10386
|
}
|
|
10387
10387
|
)
|
|
10388
10388
|
] });
|
|
10389
|
-
}, zx =
|
|
10390
|
-
children: e,
|
|
10389
|
+
}, zx = {
|
|
10390
|
+
h2: ({ children: e, id: n }) => /* @__PURE__ */ y.jsx(Kt, { level: 2, id: n, children: e, registerSidebarAnchor: !0 }),
|
|
10391
|
+
h3: ({ children: e, id: n }) => /* @__PURE__ */ y.jsx(Kt, { level: 3, id: n, children: e, registerSidebarAnchor: !0 })
|
|
10392
|
+
}, Bx = ({
|
|
10393
|
+
mdxComponent: e,
|
|
10391
10394
|
frontmatter: n,
|
|
10392
10395
|
tableOfContents: t
|
|
10393
10396
|
}) => {
|
|
@@ -10422,7 +10425,12 @@ const Mx = /* @__PURE__ */ Ra(Dx), lc = "data-active", Ps = ({
|
|
|
10422
10425
|
a && /* @__PURE__ */ y.jsx(Kt, { level: 1, id: Mx(a, { lower: !0 }), children: a }),
|
|
10423
10426
|
(n == null ? void 0 : n.description) && /* @__PURE__ */ y.jsx("p", { className: "prose-lg", children: n.description })
|
|
10424
10427
|
] }),
|
|
10425
|
-
|
|
10428
|
+
/* @__PURE__ */ y.jsx(
|
|
10429
|
+
e,
|
|
10430
|
+
{
|
|
10431
|
+
components: { ...ed(), ...zx }
|
|
10432
|
+
}
|
|
10433
|
+
),
|
|
10426
10434
|
/* @__PURE__ */ y.jsx("hr", {}),
|
|
10427
10435
|
/* @__PURE__ */ y.jsxs("div", { className: "not-prose flex items-center justify-between gap-8", children: [
|
|
10428
10436
|
d.path ? /* @__PURE__ */ y.jsxs(
|
|
@@ -10455,9 +10463,6 @@ const Mx = /* @__PURE__ */ Ra(Dx), lc = "data-active", Ps = ({
|
|
|
10455
10463
|
),
|
|
10456
10464
|
/* @__PURE__ */ y.jsx("div", { className: "hidden xl:block", children: f && /* @__PURE__ */ y.jsx(qx, { entries: c }) })
|
|
10457
10465
|
] });
|
|
10458
|
-
}, Bx = {
|
|
10459
|
-
h2: ({ children: e, id: n }) => /* @__PURE__ */ y.jsx(Kt, { level: 2, id: n, children: e, registerSidebarAnchor: !0 }),
|
|
10460
|
-
h3: ({ children: e, id: n }) => /* @__PURE__ */ y.jsx(Kt, { level: 3, id: n, children: e, registerSidebarAnchor: !0 })
|
|
10461
10466
|
}, Ux = (e) => {
|
|
10462
10467
|
const n = Object.entries(e).flatMap(
|
|
10463
10468
|
([r, i]) => {
|
|
@@ -10469,12 +10474,7 @@ const Mx = /* @__PURE__ */ Ra(Dx), lc = "data-active", Ps = ({
|
|
|
10469
10474
|
lazy: async () => {
|
|
10470
10475
|
const { default: c, ...f } = await i();
|
|
10471
10476
|
return {
|
|
10472
|
-
element: /* @__PURE__ */ y.jsx(
|
|
10473
|
-
c,
|
|
10474
|
-
{
|
|
10475
|
-
components: { ...ed(), ...Bx }
|
|
10476
|
-
}
|
|
10477
|
-
) })
|
|
10477
|
+
element: /* @__PURE__ */ y.jsx(Bx, { mdxComponent: c, ...f })
|
|
10478
10478
|
};
|
|
10479
10479
|
}
|
|
10480
10480
|
};
|
package/package.json
CHANGED
|
@@ -11,12 +11,27 @@ import slugify from "../../util/slugify.js";
|
|
|
11
11
|
import { traverseNavigation } from "../../util/traverseNavigation.js";
|
|
12
12
|
import { Toc } from "./Toc.js";
|
|
13
13
|
import type { MDXImport } from "./index.js";
|
|
14
|
+
import { useMDXComponents } from "@mdx-js/react";
|
|
15
|
+
import type { MdxComponentsType } from "../../util/MdxComponents.js";
|
|
16
|
+
|
|
17
|
+
const MarkdownHeadings = {
|
|
18
|
+
h2: ({ children, id }) => (
|
|
19
|
+
<Heading level={2} id={id} children={children} registerSidebarAnchor />
|
|
20
|
+
),
|
|
21
|
+
h3: ({ children, id }) => (
|
|
22
|
+
<Heading level={3} id={id} children={children} registerSidebarAnchor />
|
|
23
|
+
),
|
|
24
|
+
} satisfies MdxComponentsType;
|
|
14
25
|
|
|
15
26
|
export const MdxPage = ({
|
|
16
|
-
|
|
27
|
+
mdxComponent: MdxComponent,
|
|
17
28
|
frontmatter,
|
|
18
29
|
tableOfContents,
|
|
19
|
-
}: PropsWithChildren<
|
|
30
|
+
}: PropsWithChildren<
|
|
31
|
+
Omit<MDXImport, "default"> & {
|
|
32
|
+
mdxComponent: MDXImport["default"];
|
|
33
|
+
}
|
|
34
|
+
>) => {
|
|
20
35
|
const navItem = useTopNavigationItem();
|
|
21
36
|
const location = useLocation();
|
|
22
37
|
|
|
@@ -89,7 +104,9 @@ export const MdxPage = ({
|
|
|
89
104
|
<p className="prose-lg">{frontmatter.description}</p>
|
|
90
105
|
)}
|
|
91
106
|
</header>
|
|
92
|
-
|
|
107
|
+
<MdxComponent
|
|
108
|
+
components={{ ...useMDXComponents(), ...MarkdownHeadings }}
|
|
109
|
+
/>
|
|
93
110
|
<hr />
|
|
94
111
|
<div className="not-prose flex items-center justify-between gap-8">
|
|
95
112
|
{prev.path ? (
|
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import { Heading } from "../../components/Heading.js";
|
|
2
1
|
import { useTopNavigationItem } from "../../components/context/DevPortalProvider.js";
|
|
3
2
|
import { isPathItem } from "../../components/navigation/util.js";
|
|
4
3
|
import { Navigate, type RouteObject } from "../../core/router.js";
|
|
5
|
-
import type { MdxComponentsType } from "../../util/MdxComponents.js";
|
|
6
4
|
import { traverseNavigation } from "../../util/traverseNavigation.js";
|
|
7
5
|
import { MdxPage } from "./MdxPage.js";
|
|
8
6
|
import type { MarkdownPluginOptions } from "./index.js";
|
|
9
|
-
import { useMDXComponents } from "@mdx-js/react";
|
|
10
|
-
|
|
11
|
-
const MarkdownHeadings = {
|
|
12
|
-
h2: ({ children, id }) => (
|
|
13
|
-
<Heading level={2} id={id} children={children} registerSidebarAnchor />
|
|
14
|
-
),
|
|
15
|
-
h3: ({ children, id }) => (
|
|
16
|
-
<Heading level={3} id={id} children={children} registerSidebarAnchor />
|
|
17
|
-
),
|
|
18
|
-
} satisfies MdxComponentsType;
|
|
19
7
|
|
|
20
8
|
export const generateRoutes = (
|
|
21
9
|
markdownFiles: MarkdownPluginOptions["markdownFiles"],
|
|
@@ -40,13 +28,7 @@ export const generateRoutes = (
|
|
|
40
28
|
const { default: Component, ...props } = await importPromise();
|
|
41
29
|
|
|
42
30
|
return {
|
|
43
|
-
element:
|
|
44
|
-
<MdxPage {...props}>
|
|
45
|
-
<Component
|
|
46
|
-
components={{ ...useMDXComponents(), ...MarkdownHeadings }}
|
|
47
|
-
/>
|
|
48
|
-
</MdxPage>
|
|
49
|
-
),
|
|
31
|
+
element: <MdxPage mdxComponent={Component} {...props} />,
|
|
50
32
|
};
|
|
51
33
|
},
|
|
52
34
|
} satisfies RouteObject;
|