zudoku 0.0.0-fa903e7 → 0.0.0-fc5c03b
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/client.d.ts +7 -0
- package/dist/app/entry.client.d.ts +1 -0
- package/dist/app/entry.client.js +13 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +1 -0
- package/dist/app/entry.server.js +1 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +2 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.d.ts +3 -0
- package/dist/app/sentry.js +19 -0
- package/dist/app/sentry.js.map +1 -0
- package/dist/app/tailwind.d.ts +2 -1
- package/dist/app/tailwind.js +64 -52
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cli.js +0 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/outdated.js +2 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/config/common.d.ts +8 -0
- package/dist/config/common.js +2 -0
- package/dist/config/common.js.map +1 -0
- package/dist/config/config.d.ts +3 -2
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.js +154 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +14 -13
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +4911 -0
- package/dist/config/validators/common.js +276 -0
- package/dist/config/validators/common.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +1 -0
- package/dist/config/validators/icon-types.js +2 -0
- package/dist/config/validators/icon-types.js.map +1 -0
- package/dist/config/validators/validate.d.ts +760 -524
- package/dist/config/validators/validate.js +9 -234
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/authentication/providers/openid.js +7 -2
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +4 -4
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +3 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +1 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +1 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/ReactMarkdown.d.ts +29 -0
- package/dist/lib/components/ReactMarkdown.js +182 -0
- package/dist/lib/components/ReactMarkdown.js.map +1 -0
- package/dist/lib/components/Search.d.ts +3 -1
- package/dist/lib/components/Search.js +3 -3
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +0 -4
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +2 -2
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +3 -4
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +2 -4
- package/dist/lib/components/navigation/SidebarItem.js +5 -10
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +1 -1
- package/dist/lib/oas/graphql/index.js +4 -1
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +6 -0
- package/dist/lib/plugins/api-catalog/Catalog.js +29 -0
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -0
- package/dist/lib/plugins/api-catalog/index.d.ts +23 -0
- package/dist/lib/plugins/api-catalog/index.js +15 -0
- package/dist/lib/plugins/api-catalog/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +1 -1
- package/dist/lib/plugins/markdown/MdxPage.js +2 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +47 -2
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +2 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/redirect/index.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/util/MdxComponents.d.ts +2 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/vite/build.js +15 -3
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +6 -4
- package/dist/vite/config.js +42 -15
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +4 -1
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.js +12 -3
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/output.d.ts +1 -1
- package/dist/vite/output.js +25 -16
- package/dist/vite/output.js.map +1 -1
- package/dist/vite/plugin-api.js +44 -1
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +1 -0
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +1 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.js +20 -0
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-mdx.js +48 -1
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/{plugin-custom-css.d.ts → plugin-theme-css.d.ts} +2 -2
- package/dist/vite/{plugin-custom-css.js → plugin-theme-css.js} +10 -3
- package/dist/vite/plugin-theme-css.js.map +1 -0
- package/dist/vite/plugin.d.ts +1 -2
- package/dist/vite/plugin.js +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +2 -1
- package/dist/vite/prerender.js +2 -2
- package/dist/vite/prerender.js.map +1 -1
- package/dist/vite/sitemap.d.ts +1 -1
- package/dist/zuplo/env.d.ts +6 -0
- package/dist/zuplo/env.js +9 -0
- package/dist/zuplo/env.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +2 -2
- package/dist/zuplo/with-zuplo.js.map +1 -1
- package/lib/AnchorLink-BR0MvI7n.js +35 -0
- package/lib/AnchorLink-BR0MvI7n.js.map +1 -0
- package/lib/{Markdown-ievDDhFT.js → Markdown-CRsmPPfY.js} +13084 -13096
- package/lib/Markdown-CRsmPPfY.js.map +1 -0
- package/lib/{MdxPage-B2FpJ9KC.js → MdxPage-Wp8QU0-q.js} +85 -80
- package/lib/MdxPage-Wp8QU0-q.js.map +1 -0
- package/lib/{OperationList-BkNQEsNs.js → OperationList-u8xHU9-b.js} +982 -969
- package/lib/{OperationList-BkNQEsNs.js.map → OperationList-u8xHU9-b.js.map} +1 -1
- package/lib/{SlotletProvider-DyomlzGx.js → SlotletProvider-BgvYIPQe.js} +2 -2
- package/lib/{SlotletProvider-DyomlzGx.js.map → SlotletProvider-BgvYIPQe.js.map} +1 -1
- package/lib/{SyntaxHighlight-DkLOsjHS.js → SyntaxHighlight-C31iouiO.js} +1 -3
- package/lib/{SyntaxHighlight-DkLOsjHS.js.map → SyntaxHighlight-C31iouiO.js.map} +1 -1
- package/lib/assets/{worker-BHClFO3A.js → worker-C_2va8B8.js} +435 -432
- package/lib/assets/{worker-BHClFO3A.js.map → worker-C_2va8B8.js.map} +1 -1
- package/lib/{createServer-CpJlUPtn.js → createServer-BCAHdrpE.js} +5 -2
- package/lib/{createServer-CpJlUPtn.js.map → createServer-BCAHdrpE.js.map} +1 -1
- package/lib/{index-C7SaIME0.js → index-CmdLGbbk.js} +7 -5
- package/lib/index-CmdLGbbk.js.map +1 -0
- package/lib/{AnchorLink-CDlhr8gL.js → index.esm-Bm8pj-bc.js} +223 -254
- package/lib/index.esm-Bm8pj-bc.js.map +1 -0
- package/lib/ui/Drawer.js +79 -79
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/zudoku.auth-openid.js +42 -37
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +386 -367
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +121 -0
- package/lib/zudoku.plugin-api-catalog.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/package.json +19 -6
- package/src/app/entry.client.tsx +15 -0
- package/src/app/entry.server.tsx +1 -0
- package/src/app/main.tsx +5 -1
- package/src/app/sentry.ts +24 -0
- package/src/app/tailwind.ts +67 -52
- package/src/lib/authentication/providers/openid.tsx +7 -2
- package/src/lib/components/Heading.tsx +13 -13
- package/src/lib/components/Layout.tsx +8 -3
- package/src/lib/components/Markdown.tsx +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +18 -18
- package/src/lib/components/ReactMarkdown.license.txt +21 -0
- package/src/lib/components/ReactMarkdown.tsx +264 -0
- package/src/lib/components/Search.tsx +3 -3
- package/src/lib/components/SyntaxHighlight.tsx +0 -4
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/navigation/Sidebar.tsx +18 -8
- package/src/lib/components/navigation/SidebarCategory.tsx +10 -9
- package/src/lib/components/navigation/SidebarItem.tsx +10 -13
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
- package/src/lib/core/ZudokuContext.ts +1 -1
- package/src/lib/oas/graphql/index.ts +4 -1
- package/src/lib/plugins/api-catalog/Catalog.tsx +124 -0
- package/src/lib/plugins/api-catalog/index.tsx +50 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +2 -0
- package/src/lib/plugins/markdown/index.tsx +2 -1
- package/src/lib/plugins/markdown/resolver.ts +2 -4
- package/src/lib/plugins/openapi/OperationList.tsx +64 -3
- package/src/lib/plugins/openapi/graphql/gql.ts +2 -2
- package/src/lib/plugins/openapi/graphql/graphql.ts +3 -0
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -0
- package/src/lib/plugins/redirect/index.tsx +1 -1
- package/src/lib/util/MdxComponents.tsx +2 -5
- package/dist/vite/plugin-custom-css.js.map +0 -1
- package/lib/AnchorLink-CDlhr8gL.js.map +0 -1
- package/lib/Markdown-ievDDhFT.js.map +0 -1
- package/lib/MdxPage-B2FpJ9KC.js.map +0 -1
- package/lib/index-C7SaIME0.js.map +0 -1
- package/lib/prism-markup-templating-DZrrEs0A.js +0 -62
- package/lib/prism-markup-templating-DZrrEs0A.js.map +0 -1
- package/lib/prism-php.min-o7FpoMP_.js +0 -11
- package/lib/prism-php.min-o7FpoMP_.js.map +0 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
+
import { s as n } from "./index-LNp6rxyU.js";
|
|
3
|
+
import { Fragment as x } from "react";
|
|
4
|
+
import { Head as f, Link as h } from "./zudoku.components.js";
|
|
5
|
+
import { M as u } from "./Markdown-CRsmPPfY.js";
|
|
6
|
+
import { u as j } from "./useExposedProps-CTPtylCV.js";
|
|
7
|
+
const b = ({
|
|
8
|
+
items: l,
|
|
9
|
+
categories: i,
|
|
10
|
+
label: o = "API Library"
|
|
11
|
+
}) => {
|
|
12
|
+
const { searchParams: c, setSearchParams: m } = j(), t = c.get("category");
|
|
13
|
+
return /* @__PURE__ */ e.jsxs("section", { className: "pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
|
|
14
|
+
/* @__PURE__ */ e.jsx(f, { children: /* @__PURE__ */ e.jsx("title", { children: o }) }),
|
|
15
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-12 gap-12", children: [
|
|
16
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-4 col-span-3 px-4 not-prose sticky top-48", children: /* @__PURE__ */ e.jsx("div", { className: "justify-between", children: i.map((s, a) => /* @__PURE__ */ e.jsxs(x, { children: [
|
|
17
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mb-2.5", children: [
|
|
18
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: s.label }),
|
|
19
|
+
a === 0 && t && /* @__PURE__ */ e.jsx(
|
|
20
|
+
"button",
|
|
21
|
+
{
|
|
22
|
+
type: "button",
|
|
23
|
+
className: "text-end text-sm mr-8 text-foreground/60 hover:text-foreground",
|
|
24
|
+
onClick: () => m({}),
|
|
25
|
+
children: "Clear"
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ e.jsx("ul", { className: "space-y-1 [&>li]:py-2", children: Array.from(
|
|
30
|
+
new Set(
|
|
31
|
+
s.tags.map((r) => ({
|
|
32
|
+
tag: r,
|
|
33
|
+
count: l.filter(
|
|
34
|
+
(d) => d.categories.find((p) => p.tags.includes(r))
|
|
35
|
+
).length
|
|
36
|
+
})).map(({ tag: r, count: d }) => /* @__PURE__ */ e.jsxs(
|
|
37
|
+
"li",
|
|
38
|
+
{
|
|
39
|
+
className: `flex px-4 rounded-lg -translate-x-4 justify-between text-sm cursor-pointer hover:text-primary transition ${n(r) === t ? "font-medium bg-border/30 rounded" : ""}`,
|
|
40
|
+
onClick: () => m({
|
|
41
|
+
category: n(s.label + " " + r)
|
|
42
|
+
}),
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ e.jsx("span", { children: r }),
|
|
45
|
+
/* @__PURE__ */ e.jsx(
|
|
46
|
+
"span",
|
|
47
|
+
{
|
|
48
|
+
className: `flex items-center justify-center border rounded-md w-8 text-xs font-semibold ${n(r) === t ? "bg-primary border-primary text-primary-foreground" : ""}`,
|
|
49
|
+
children: d
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
n(s.label + " " + r)
|
|
55
|
+
))
|
|
56
|
+
)
|
|
57
|
+
) })
|
|
58
|
+
] }, s.label)) }) }),
|
|
59
|
+
/* @__PURE__ */ e.jsxs("div", { className: "col-span-9", children: [
|
|
60
|
+
/* @__PURE__ */ e.jsx("h3", { className: "mt-0 text-2xl font-bold mb-4", children: o }),
|
|
61
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-4", children: l.filter(
|
|
62
|
+
(s) => !t || s.categories.find(
|
|
63
|
+
(a) => a.tags.find(
|
|
64
|
+
(r) => n(a.label + " " + r) === t
|
|
65
|
+
)
|
|
66
|
+
)
|
|
67
|
+
).map((s, a) => /* @__PURE__ */ e.jsx(
|
|
68
|
+
h,
|
|
69
|
+
{
|
|
70
|
+
to: {
|
|
71
|
+
pathname: `/${s.path}`,
|
|
72
|
+
search: t ? `category=${t}` : ""
|
|
73
|
+
},
|
|
74
|
+
className: "no-underline hover:!text-foreground",
|
|
75
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: "border h-full rounded p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: s.label }),
|
|
81
|
+
/* @__PURE__ */ e.jsx(
|
|
82
|
+
u,
|
|
83
|
+
{
|
|
84
|
+
className: "text-sm whitespace-pre-wrap mb-6 line-clamp-2",
|
|
85
|
+
content: s.description
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
a
|
|
91
|
+
)
|
|
92
|
+
},
|
|
93
|
+
s.path
|
|
94
|
+
)) })
|
|
95
|
+
] })
|
|
96
|
+
] })
|
|
97
|
+
] });
|
|
98
|
+
}, k = ({
|
|
99
|
+
navigationId: l,
|
|
100
|
+
items: i,
|
|
101
|
+
label: o,
|
|
102
|
+
categories: c
|
|
103
|
+
}) => ({
|
|
104
|
+
getRoutes: () => [
|
|
105
|
+
{
|
|
106
|
+
path: l,
|
|
107
|
+
element: /* @__PURE__ */ e.jsx(
|
|
108
|
+
b,
|
|
109
|
+
{
|
|
110
|
+
label: o,
|
|
111
|
+
items: i,
|
|
112
|
+
categories: c ?? []
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
export {
|
|
119
|
+
k as apiCatalogPlugin
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=zudoku.plugin-api-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-api-catalog.js","sources":["../src/lib/plugins/api-catalog/Catalog.tsx","../src/lib/plugins/api-catalog/index.tsx"],"sourcesContent":["import slugify from \"@sindresorhus/slugify\";\nimport { Fragment } from \"react\";\nimport { Head, Link } from \"zudoku/components\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { useExposedProps } from \"../../util/useExposedProps.js\";\nimport type { ApiCatalogItem, CatalogCategory } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n categories,\n label = \"API Library\",\n}: {\n label: string;\n items: ApiCatalogItem[];\n categories: CatalogCategory[];\n}) => {\n const { searchParams, setSearchParams } = useExposedProps();\n const activeCategory = searchParams.get(\"category\");\n return (\n <section className=\"pt-[--padding-content-top] pb-[--padding-content-bottom]\">\n <Head>\n <title>{label}</title>\n </Head>\n <div className=\"grid grid-cols-12 gap-12\">\n <div className=\"flex flex-col gap-4 col-span-3 px-4 not-prose sticky top-48\">\n <div className=\"justify-between\">\n {categories.map((category, idx) => (\n <Fragment key={category.label}>\n <div className=\"flex justify-between mb-2.5\">\n <span className=\"font-medium text-sm\">{category.label}</span>\n {idx === 0 && activeCategory && (\n <button\n type=\"button\"\n className=\"text-end text-sm mr-8 text-foreground/60 hover:text-foreground\"\n onClick={() => setSearchParams({})}\n >\n Clear\n </button>\n )}\n </div>\n <ul className=\"space-y-1 [&>li]:py-2\">\n {Array.from(\n new Set(\n category.tags\n .map((tag) => ({\n tag,\n count: items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n }))\n .map(({ tag, count }) => (\n <li\n key={slugify(category.label + \" \" + tag)}\n className={`flex px-4 rounded-lg -translate-x-4 justify-between text-sm cursor-pointer hover:text-primary transition ${\n slugify(tag) === activeCategory\n ? \"font-medium bg-border/30 rounded\"\n : \"\"\n }`}\n onClick={() =>\n setSearchParams({\n category: slugify(category.label + \" \" + tag),\n })\n }\n >\n <span>{tag}</span>\n <span\n className={`flex items-center justify-center border rounded-md w-8 text-xs font-semibold ${\n slugify(tag) === activeCategory\n ? \"bg-primary border-primary text-primary-foreground\"\n : \"\"\n }`}\n >\n {count}\n </span>\n </li>\n )),\n ),\n )}\n </ul>\n </Fragment>\n ))}\n </div>\n </div>\n <div className=\"col-span-9\">\n <h3 className=\"mt-0 text-2xl font-bold mb-4\">{label}</h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {items\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find(\n (t) => slugify(c.label + \" \" + t) === activeCategory,\n ),\n ),\n )\n .map((api, i) => (\n <Link\n to={{\n pathname: `/${api.path}`,\n search: activeCategory ? `category=${activeCategory}` : \"\",\n }}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div\n className=\"border h-full rounded p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\"\n key={i}\n >\n <span className=\"font-semibold\">{api.label}</span>\n <Markdown\n className=\"text-sm whitespace-pre-wrap mb-6 line-clamp-2\"\n content={api.description}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </div>\n </section>\n );\n};\n","import type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport type ApiCatalogItem = {\n path: string;\n label: string;\n description: string;\n categories: CatalogCategory[];\n};\n\nexport type CatalogCategory = {\n label: string;\n tags: string[];\n};\n\nexport type ApiCatalogPluginOptions = {\n navigationId: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n};\n\nexport const apiCatalogPlugin = ({\n navigationId,\n items,\n label,\n categories,\n}: {\n navigationId: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n}): ZudokuPlugin => {\n return {\n getRoutes: () => {\n return [\n {\n path: navigationId,\n element: (\n <Catalog\n label={label}\n items={items}\n categories={categories ?? []}\n />\n ),\n },\n ];\n },\n };\n};\n"],"names":["Catalog","items","categories","label","searchParams","setSearchParams","useExposedProps","activeCategory","jsxs","jsx","Head","category","idx","Fragment","tag","api","c","count","slugify","t","i","Link","Markdown","apiCatalogPlugin","navigationId"],"mappings":";;;;;;AAOO,MAAMA,IAAU,CAAC;AAAA,EACtB,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,MAIM;AACJ,QAAM,EAAE,cAAAC,GAAc,iBAAAC,EAAgB,IAAIC,EAAgB,GACpDC,IAAiBH,EAAa,IAAI,UAAU;AAEhD,SAAAI,gBAAAA,EAAA,KAAC,WAAQ,EAAA,WAAU,4DACjB,UAAA;AAAA,IAAAC,gBAAAA,MAACC,GACC,EAAA,UAAAD,gBAAAA,EAAA,IAAC,SAAO,EAAA,UAAAN,EAAM,CAAA,G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BAAA;AAAA,cAAA;AAAA,cANKK;AAAA,YAOP;AAAA,UAAA;AAAA,UAXKL,EAAI;AAAA,QAaZ,CAAA,GACL;AAAA,MAAA,GACF;AAAA,IAAA,GACF;AAAA,EACF,EAAA,CAAA;AAEJ,GCrGaQ,IAAmB,CAAC;AAAA,EAC/B,cAAAC;AAAA,EACA,OAAAvB;AAAA,EACA,OAAAE;AAAA,EACA,YAAAD;AACF,OAMS;AAAA,EACL,WAAW,MACF;AAAA,IACL;AAAA,MACE,MAAMsB;AAAA,MACN,SACEf,gBAAAA,EAAA;AAAA,QAACT;AAAA,QAAA;AAAA,UACC,OAAAG;AAAA,UACA,OAAAF;AAAA,UACA,YAAYC,KAAc,CAAC;AAAA,QAAA;AAAA,MAC7B;AAAA,IAEJ;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { RotateCwIcon as g, TrashIcon as f, EyeOffIcon as j, EyeIcon as v, CheckIcon as w, CopyIcon as b, FileKey2Icon as K } from "lucide-react";
|
|
3
|
-
import { D as k, S as m, R as N } from "./SlotletProvider-
|
|
3
|
+
import { D as k, S as m, R as N } from "./SlotletProvider-BgvYIPQe.js";
|
|
4
4
|
import { i as c } from "./invariant-Caa8-XvF.js";
|
|
5
5
|
import { u as d, S as I, a as S, b as A, c as C, d as E, e as x } from "./Select-O9ZM3ZgX.js";
|
|
6
6
|
import { a as P } from "./index.esm-C5mr_sKO.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import a from "react";
|
|
3
|
-
import { P as n } from "./Markdown-
|
|
3
|
+
import { P as n } from "./Markdown-CRsmPPfY.js";
|
|
4
4
|
import { c } from "./cn-BmFQLtkS.js";
|
|
5
5
|
import { u as p } from "./useExposedProps-CTPtylCV.js";
|
|
6
6
|
const u = ({
|
|
@@ -74,7 +74,7 @@ const C = (n) => ({
|
|
|
74
74
|
const h = {
|
|
75
75
|
path: r,
|
|
76
76
|
lazy: async () => {
|
|
77
|
-
const { MdxPage: l } = await import("./MdxPage-
|
|
77
|
+
const { MdxPage: l } = await import("./MdxPage-Wp8QU0-q.js"), { default: p, ...g } = await a();
|
|
78
78
|
return {
|
|
79
79
|
element: /* @__PURE__ */ P.jsx(
|
|
80
80
|
l,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/resolver.ts","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport {\
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/resolver.ts","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport { ZudokuDocsConfig } from \"../../../config/validators/common.js\";\nimport { ZudokuConfig } from \"../../../config/validators/validate.js\";\n\nconst DEFAULT_DOCS_FILES = \"/pages/**/*.{md,mdx}\";\n\n// TODO: This should be dynamic based on the glob selector\nconst SUPPORTED_EXTENSIONS = [\".md\", \".mdx\"];\n\n/**\n * Utilities for resolving markdown file paths and routes\n */\nexport class DocResolver {\n constructor(private config: ZudokuConfig) {}\n\n fileMap = new Map<string, string>();\n\n /**\n * Gets the default docs config from the zudoku config\n */\n getDocsConfigs() {\n const docsConfigs: ZudokuDocsConfig[] = this.config.docs\n ? Array.isArray(this.config.docs)\n ? this.config.docs\n : [this.config.docs]\n : [{ files: DEFAULT_DOCS_FILES }];\n\n return docsConfigs;\n }\n\n /**\n * Resolves the first matching file system path for a given docId\n * @param docId - The docId to resolve\n * @returns\n */\n resolveFilePath(docId: string) {\n const docsConfigs = this.getDocsConfigs();\n let fsPath: string | undefined;\n\n docsConfigs.forEach(({ files: fileGlob }) => {\n if (fsPath) {\n return;\n }\n const rootDir = DocResolver.getRootDir(fileGlob);\n for (const ext of SUPPORTED_EXTENSIONS) {\n if (fsPath) {\n return;\n }\n const checkPath = path.join(rootDir, `${docId}${ext}`);\n if (fs.existsSync(checkPath)) {\n fsPath = checkPath;\n }\n }\n });\n\n return fsPath;\n }\n\n /**\n * Gets the root directory from a files glob\n */\n private static getRootDir(filesGlob: string) {\n let rootDir = filesGlob.split(\"**\")[0];\n if (!rootDir) {\n throw new Error(\"Invalid files glob. Must have '**' in the path.\");\n }\n rootDir = rootDir.replace(\"/**\", \"/\");\n return rootDir;\n }\n\n /**\n * Resolves the route path for a given file system path\n * @param options - The options to resolve the route path\n * @returns The string route path\n */\n static resolveRoutePath({\n filesGlob,\n fsPath,\n }: {\n filesGlob: string;\n fsPath: string;\n }) {\n const rootDir = this.getRootDir(filesGlob);\n const re = new RegExp(`^${rootDir}(.*).mdx?`);\n const match = fsPath.match(re);\n const routePath = match?.at(1);\n return routePath;\n }\n}\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport { RouteObject } from \"react-router-dom\";\nimport { ZudokuDocsConfig } from \"../../../config/validators/common.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { DocResolver } from \"./resolver.js\";\n\nexport interface MarkdownPluginOptions extends ZudokuDocsConfig {\n fileImports: Record<string, () => Promise<MDXImport>>;\n}\nexport type MarkdownPluginDefaultOptions = Pick<\n Frontmatter,\n \"toc\" | \"disablePager\"\n>;\n\nexport type Frontmatter = {\n title?: string;\n description?: string;\n category?: string;\n toc?: boolean;\n disablePager?: boolean;\n};\n\nexport type MDXImport = {\n tableOfContents: Toc;\n frontmatter: Frontmatter;\n excerpt?: string;\n default: (props: MDXProps) => JSX.Element;\n};\n\nexport const markdownPlugin = (\n options: MarkdownPluginOptions[],\n): ZudokuPlugin => ({\n getRoutes: () => {\n const routeMap = new Map<string, RouteObject>();\n options.forEach(({ fileImports, files, defaultOptions }) =>\n Object.entries(fileImports).flatMap(([file, importPromise]) => {\n const routePath = DocResolver.resolveRoutePath({\n filesGlob: files,\n fsPath: file,\n });\n\n if (!routePath) return [];\n\n if (routeMap.has(routePath)) {\n // eslint-disable-next-line no-console\n console.warn(\n `Duplicate route path found for ${routePath}. Skipping file at '${file}'.`,\n );\n return [];\n }\n\n const route: RouteObject = {\n path: routePath,\n lazy: async () => {\n const { MdxPage } = await import(\"./MdxPage.js\");\n const { default: Component, ...props } = await importPromise();\n return {\n element: (\n <MdxPage\n file={file}\n mdxComponent={Component}\n {...props}\n defaultOptions={defaultOptions}\n />\n ),\n };\n },\n };\n routeMap.set(routePath, route);\n }),\n );\n return [...routeMap.values()];\n },\n});\n"],"names":["DEFAULT_DOCS_FILES","SUPPORTED_EXTENSIONS","DocResolver","config","__publicField","docId","docsConfigs","fsPath","fileGlob","rootDir","ext","checkPath","path","fs","filesGlob","re","match","markdownPlugin","options","routeMap","fileImports","files","defaultOptions","file","importPromise","routePath","route","MdxPage","Component","props","jsx"],"mappings":";;;;;AAKA,MAAMA,IAAqB,wBAGrBC,IAAuB,CAAC,OAAO,MAAM;AAKpC,MAAMC,EAAY;AAAA,EACvB,YAAoBC,GAAsB;AAE1C,IAAAC,EAAA,qCAAc;AAFM,SAAA,SAAAD;AAAA,EAAuB;AAAA;AAAA;AAAA;AAAA,EAO3C,iBAAiB;AAOR,WANiC,KAAK,OAAO,OAChD,MAAM,QAAQ,KAAK,OAAO,IAAI,IAC5B,KAAK,OAAO,OACZ,CAAC,KAAK,OAAO,IAAI,IACnB,CAAC,EAAE,OAAOH,EAAA,CAAoB;AAAA,EAGpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgBK,GAAe;AACvB,UAAAC,IAAc,KAAK;AACrB,QAAAC;AAEJ,WAAAD,EAAY,QAAQ,CAAC,EAAE,OAAOE,QAAe;AAC3C,UAAID;AACF;AAEI,YAAAE,IAAUP,EAAY,WAAWM,CAAQ;AAC/C,iBAAWE,KAAOT,GAAsB;AACtC,YAAIM;AACF;AAEI,cAAA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AAO,uBAAc,GACzC,EAAE,SAASC,GAAW,GAAGC,EAAM,IAAI,MAAML;AACxC,mBAAA;AAAA,cACL,SACEM,gBAAAA,EAAA;AAAA,gBAACH;AAAA,gBAAA;AAAA,kBACC,MAAAJ;AAAA,kBACA,cAAcK;AAAA,kBACb,GAAGC;AAAA,kBACJ,gBAAAP;AAAA,gBAAA;AAAA,cACF;AAAA,YAAA;AAAA,UAGN;AAAA,QAAA;AAEO,QAAAH,EAAA,IAAIM,GAAWC,CAAK;AAAA,MAAA,CAC9B;AAAA,IAAA,GAEI,CAAC,GAAGP,EAAS,OAAA,CAAQ;AAAA,EAC9B;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-redirect.js","sources":["../src/lib/plugins/redirect/index.tsx"],"sourcesContent":["import { redirect } from \"react-router-dom\";\nimport { ZudokuRedirect } from \"../../../config/validators/
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-redirect.js","sources":["../src/lib/plugins/redirect/index.tsx"],"sourcesContent":["import { redirect } from \"react-router-dom\";\nimport { ZudokuRedirect } from \"../../../config/validators/common.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\n\nexport const redirectPlugin = (options: {\n redirects: ZudokuRedirect[];\n}): ZudokuPlugin => {\n return {\n getRoutes: () =>\n options.redirects.map(({ from, to }) => ({\n path: from,\n loader: () => redirect(to, 301),\n })),\n };\n};\n"],"names":["redirectPlugin","options","from","to","redirect"],"mappings":";AAIa,MAAAA,IAAiB,CAACC,OAGtB;AAAA,EACL,WAAW,MACTA,EAAQ,UAAU,IAAI,CAAC,EAAE,MAAAC,GAAM,IAAAC,SAAU;AAAA,IACvC,MAAMD;AAAA,IACN,QAAQ,MAAME,EAASD,GAAI,GAAG;AAAA,EAAA,EAC9B;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-fc5c03b",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://zudoku.dev",
|
|
6
6
|
"repository": {
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
"import": "./lib/zudoku.plugin-api-keys.js",
|
|
55
55
|
"types": "./dist/lib/plugins/api-keys/index.d.ts"
|
|
56
56
|
},
|
|
57
|
+
"./plugins/api-catalog": {
|
|
58
|
+
"import": "./lib/zudoku.plugin-api-catalog.js",
|
|
59
|
+
"types": "./dist/lib/plugins/api-catalog/index.d.ts"
|
|
60
|
+
},
|
|
57
61
|
"./plugins/markdown": {
|
|
58
62
|
"import": "./lib/zudoku.plugin-markdown.js",
|
|
59
63
|
"types": "./dist/lib/plugins/markdown/index.d.ts"
|
|
@@ -149,7 +153,6 @@
|
|
|
149
153
|
"@types/react": "18.3.11",
|
|
150
154
|
"@types/react-dom": "18.3.1",
|
|
151
155
|
"@vitejs/plugin-react": "4.3.4",
|
|
152
|
-
"@zudoku/config": "0.0.0-fa903e7",
|
|
153
156
|
"@zudoku/httpsnippet": "10.0.9",
|
|
154
157
|
"@zudoku/react-helmet-async": "2.0.4",
|
|
155
158
|
"autoprefixer": "10.4.20",
|
|
@@ -157,7 +160,7 @@
|
|
|
157
160
|
"class-variance-authority": "0.7.0",
|
|
158
161
|
"clsx": "2.1.1",
|
|
159
162
|
"cmdk": "1.0.4",
|
|
160
|
-
"
|
|
163
|
+
"devlop": "^1.1.0",
|
|
161
164
|
"embla-carousel-react": "8.3.1",
|
|
162
165
|
"estree-util-value-to-estree": "3.2.1",
|
|
163
166
|
"express": "4.21.1",
|
|
@@ -166,6 +169,9 @@
|
|
|
166
169
|
"graphql-type-json": "0.3.2",
|
|
167
170
|
"graphql-yoga": "5.7.0",
|
|
168
171
|
"gray-matter": "4.0.3",
|
|
172
|
+
"hast-util-to-jsx-runtime": "^2.3.2",
|
|
173
|
+
"hast-util-to-string": "3.0.1",
|
|
174
|
+
"html-url-attributes": "^3.0.1",
|
|
169
175
|
"http-terminator": "3.2.0",
|
|
170
176
|
"loglevel": "1.9.2",
|
|
171
177
|
"lru-cache": "11.0.1",
|
|
@@ -182,7 +188,6 @@
|
|
|
182
188
|
"react-error-boundary": "4.1.2",
|
|
183
189
|
"react-hook-form": "7.53.0",
|
|
184
190
|
"react-is": "18.3.1",
|
|
185
|
-
"react-markdown": "9.0.1",
|
|
186
191
|
"react-router-dom": "6.27.0",
|
|
187
192
|
"rehype-raw": "7.0.0",
|
|
188
193
|
"rehype-slug": "6.0.0",
|
|
@@ -192,6 +197,8 @@
|
|
|
192
197
|
"remark-frontmatter": "5.0.0",
|
|
193
198
|
"remark-gfm": "4.0.0",
|
|
194
199
|
"remark-mdx-frontmatter": "5.0.0",
|
|
200
|
+
"remark-parse": "^11.0.0",
|
|
201
|
+
"remark-rehype": "^11.1.1",
|
|
195
202
|
"rollup": "4.24.0",
|
|
196
203
|
"semver": "7.6.3",
|
|
197
204
|
"sitemap": "8.0.0",
|
|
@@ -199,10 +206,12 @@
|
|
|
199
206
|
"strip-ansi": "7.1.0",
|
|
200
207
|
"tailwind-merge": "2.5.4",
|
|
201
208
|
"tailwindcss": "3.4.13",
|
|
209
|
+
"tsx": "^4.19.2",
|
|
202
210
|
"ulidx": "2.4.1",
|
|
211
|
+
"unified": "^11.0.5",
|
|
203
212
|
"unist-util-visit": "5.0.0",
|
|
204
213
|
"urql": "4.1.0",
|
|
205
|
-
"vaul": "1.1.
|
|
214
|
+
"vaul": "1.1.1",
|
|
206
215
|
"vfile": "6.0.3",
|
|
207
216
|
"vite": "5.4.9",
|
|
208
217
|
"yaml": "2.6.0",
|
|
@@ -217,6 +226,7 @@
|
|
|
217
226
|
"@types/estree": "1.0.6",
|
|
218
227
|
"@types/express": "5.0.0",
|
|
219
228
|
"@types/har-format": "1.2.15",
|
|
229
|
+
"@types/hast": "^3.0.4",
|
|
220
230
|
"@types/json-schema": "7.0.15",
|
|
221
231
|
"@types/mdast": "4.0.4",
|
|
222
232
|
"@types/mdx": "2.0.13",
|
|
@@ -224,6 +234,7 @@
|
|
|
224
234
|
"@types/object-hash": "3.0.6",
|
|
225
235
|
"@types/react-is": "18.3.0",
|
|
226
236
|
"@types/semver": "7.5.8",
|
|
237
|
+
"@types/unist": "^3.0.3",
|
|
227
238
|
"@types/yargs": "17.0.33",
|
|
228
239
|
"@vitest/coverage-v8": "2.1.8",
|
|
229
240
|
"mdast-util-mdx": "3.0.0",
|
|
@@ -239,11 +250,13 @@
|
|
|
239
250
|
},
|
|
240
251
|
"optionalDependencies": {
|
|
241
252
|
"@clerk/clerk-js": "5.11.0",
|
|
242
|
-
"@inkeep/widgets": "^0.2.289"
|
|
253
|
+
"@inkeep/widgets": "^0.2.289",
|
|
254
|
+
"@sentry/react": "^8.45.1"
|
|
243
255
|
},
|
|
244
256
|
"scripts": {
|
|
245
257
|
"build": "tsc --project tsconfig.json",
|
|
246
258
|
"build:vite": "vite build",
|
|
259
|
+
"generate:icon-types": "tsx ./scripts/generate-icon-types.ts",
|
|
247
260
|
"build:standalone:vite": "vite build --mode standalone --config vite.standalone.config.ts",
|
|
248
261
|
"build:standalone:html": "cp ./src/app/standalone.html ./standalone/standalone.html && cp ./src/app/demo.html ./standalone/demo.html && cp ./src/app/demo-cdn.html ./standalone/index.html",
|
|
249
262
|
"hack:fix-worker-paths": "node ./scripts/hack-worker.mjs",
|
package/src/app/entry.client.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from "react-router-dom";
|
|
7
7
|
import config from "virtual:zudoku-config";
|
|
8
8
|
import "virtual:zudoku-theme.css";
|
|
9
|
+
import "vite/modulepreload-polyfill";
|
|
9
10
|
import { Bootstrap } from "zudoku/components";
|
|
10
11
|
import "./main.css";
|
|
11
12
|
import { getRoutesByConfig } from "./main.js";
|
|
@@ -13,6 +14,12 @@ import { getRoutesByConfig } from "./main.js";
|
|
|
13
14
|
const routes = getRoutesByConfig(config);
|
|
14
15
|
const root = document.getElementById("root")!;
|
|
15
16
|
|
|
17
|
+
if (process.env.SENTRY_DSN) {
|
|
18
|
+
void import("./sentry.js").then((mod) => {
|
|
19
|
+
mod.initSentry({ dsn: process.env.SENTRY_DSN as string });
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
if (root.childElementCount > 0) {
|
|
17
24
|
void hydrate(routes);
|
|
18
25
|
} else {
|
|
@@ -64,3 +71,11 @@ async function hydrate(routes: RouteObject[]) {
|
|
|
64
71
|
|
|
65
72
|
hydrateRoot(root, <Bootstrap hydrate router={router} />);
|
|
66
73
|
}
|
|
74
|
+
|
|
75
|
+
// This is a workaround to avoid version skewing
|
|
76
|
+
// See https://vite.dev/guide/build.html#load-error-handling
|
|
77
|
+
// TODO: Implement a more advanced solution if there are CDN urls or e.g. Vercel Skew Protection
|
|
78
|
+
window.addEventListener("vite:preloadError", (e) => {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
window.location.reload();
|
|
81
|
+
});
|
package/src/app/entry.server.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
createStaticRouter,
|
|
11
11
|
} from "react-router-dom/server.js";
|
|
12
12
|
import "virtual:zudoku-theme.css";
|
|
13
|
+
import "vite/modulepreload-polyfill";
|
|
13
14
|
import { BootstrapStatic, ServerError } from "zudoku/components";
|
|
14
15
|
import type { ZudokuConfig } from "../config/config.js";
|
|
15
16
|
import type { FileWritingResponse } from "../vite/prerender.js";
|
package/src/app/main.tsx
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type RouteObject } from "react-router-dom";
|
|
2
2
|
import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
configuredApiCatalogPlugins,
|
|
5
|
+
configuredApiPlugins,
|
|
6
|
+
} from "virtual:zudoku-api-plugins";
|
|
4
7
|
import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
5
8
|
import { configuredCustomPagesPlugin } from "virtual:zudoku-custom-pages-plugin";
|
|
6
9
|
import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
|
|
@@ -57,6 +60,7 @@ export const convertZudokuConfigToOptions = (
|
|
|
57
60
|
...(configuredRedirectPlugin ? [configuredRedirectPlugin] : []),
|
|
58
61
|
...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
|
|
59
62
|
...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
|
|
63
|
+
...configuredApiCatalogPlugins,
|
|
60
64
|
...(configuredAuthProvider?.getAuthenticationPlugin
|
|
61
65
|
? [configuredAuthProvider.getAuthenticationPlugin()]
|
|
62
66
|
: []),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/react";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import {
|
|
4
|
+
createRoutesFromChildren,
|
|
5
|
+
matchRoutes,
|
|
6
|
+
useLocation,
|
|
7
|
+
useNavigationType,
|
|
8
|
+
} from "react-router-dom";
|
|
9
|
+
|
|
10
|
+
export const initSentry = ({ dsn }: { dsn: string }) => {
|
|
11
|
+
Sentry.init({
|
|
12
|
+
dsn,
|
|
13
|
+
integrations: [
|
|
14
|
+
Sentry.reactRouterV6BrowserTracingIntegration({
|
|
15
|
+
useEffect,
|
|
16
|
+
useLocation,
|
|
17
|
+
useNavigationType,
|
|
18
|
+
createRoutesFromChildren,
|
|
19
|
+
matchRoutes,
|
|
20
|
+
}),
|
|
21
|
+
Sentry.replayIntegration(),
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
};
|
package/src/app/tailwind.ts
CHANGED
|
@@ -1,68 +1,83 @@
|
|
|
1
1
|
import typographyPlugin from "@tailwindcss/typography";
|
|
2
2
|
import type { Config } from "tailwindcss";
|
|
3
3
|
import defaultTheme from "tailwindcss/defaultTheme.js";
|
|
4
|
+
import type { LoadedConfig } from "../config/config.js";
|
|
4
5
|
|
|
5
6
|
const content = [
|
|
6
7
|
"./src/**/*.{js,ts,jsx,tsx,md,mdx}",
|
|
7
8
|
"./node_modules/zudoku/dist/**/*.{js,ts,jsx,tsx,md,mdx}",
|
|
8
9
|
];
|
|
9
10
|
|
|
10
|
-
const config: Omit<Config, "content">
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
foreground: "hsl(var(--foreground))",
|
|
34
|
-
primary: {
|
|
35
|
-
DEFAULT: "hsl(var(--primary))",
|
|
36
|
-
foreground: "hsl(var(--primary-foreground))",
|
|
37
|
-
},
|
|
38
|
-
secondary: {
|
|
39
|
-
DEFAULT: "hsl(var(--secondary))",
|
|
40
|
-
foreground: "hsl(var(--secondary-foreground))",
|
|
41
|
-
},
|
|
42
|
-
destructive: {
|
|
43
|
-
DEFAULT: "hsl(var(--destructive))",
|
|
44
|
-
foreground: "hsl(var(--destructive-foreground))",
|
|
45
|
-
},
|
|
46
|
-
muted: {
|
|
47
|
-
DEFAULT: "hsl(var(--muted))",
|
|
48
|
-
foreground: "hsl(var(--muted-foreground))",
|
|
49
|
-
},
|
|
50
|
-
accent: {
|
|
51
|
-
DEFAULT: "hsl(var(--accent))",
|
|
52
|
-
foreground: "hsl(var(--accent-foreground))",
|
|
53
|
-
},
|
|
54
|
-
popover: {
|
|
55
|
-
DEFAULT: "hsl(var(--popover))",
|
|
56
|
-
foreground: "hsl(var(--popover-foreground))",
|
|
11
|
+
const config = (zudokuConfig?: LoadedConfig): Omit<Config, "content"> => {
|
|
12
|
+
const sans = zudokuConfig?.theme?.fonts?.sans
|
|
13
|
+
? ([
|
|
14
|
+
zudokuConfig.theme.fonts.sans.fontFamily,
|
|
15
|
+
...defaultTheme.fontFamily.sans,
|
|
16
|
+
] as const)
|
|
17
|
+
: ([
|
|
18
|
+
["Geist", ...defaultTheme.fontFamily.sans],
|
|
19
|
+
{ fontFeatureSettings: '"rlig" 1, "calt" 0' },
|
|
20
|
+
] as const);
|
|
21
|
+
|
|
22
|
+
const mono = zudokuConfig?.theme?.fonts?.mono
|
|
23
|
+
? zudokuConfig.theme.fonts.mono.fontFamily
|
|
24
|
+
: defaultTheme.fontFamily.mono;
|
|
25
|
+
|
|
26
|
+
return {
|
|
27
|
+
darkMode: "selector",
|
|
28
|
+
content,
|
|
29
|
+
theme: {
|
|
30
|
+
extend: {
|
|
31
|
+
fontFamily: {
|
|
32
|
+
sans,
|
|
33
|
+
mono,
|
|
57
34
|
},
|
|
58
|
-
|
|
59
|
-
DEFAULT:
|
|
60
|
-
|
|
35
|
+
typography: () => ({
|
|
36
|
+
DEFAULT: {
|
|
37
|
+
css: {
|
|
38
|
+
blockquote: { quotes: "none" },
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
}),
|
|
42
|
+
colors: {
|
|
43
|
+
border: "hsl(var(--border))",
|
|
44
|
+
input: "hsl(var(--input))",
|
|
45
|
+
ring: "hsl(var(--ring))",
|
|
46
|
+
background: "hsl(var(--background))",
|
|
47
|
+
foreground: "hsl(var(--foreground))",
|
|
48
|
+
primary: {
|
|
49
|
+
DEFAULT: "hsl(var(--primary))",
|
|
50
|
+
foreground: "hsl(var(--primary-foreground))",
|
|
51
|
+
},
|
|
52
|
+
secondary: {
|
|
53
|
+
DEFAULT: "hsl(var(--secondary))",
|
|
54
|
+
foreground: "hsl(var(--secondary-foreground))",
|
|
55
|
+
},
|
|
56
|
+
destructive: {
|
|
57
|
+
DEFAULT: "hsl(var(--destructive))",
|
|
58
|
+
foreground: "hsl(var(--destructive-foreground))",
|
|
59
|
+
},
|
|
60
|
+
muted: {
|
|
61
|
+
DEFAULT: "hsl(var(--muted))",
|
|
62
|
+
foreground: "hsl(var(--muted-foreground))",
|
|
63
|
+
},
|
|
64
|
+
accent: {
|
|
65
|
+
DEFAULT: "hsl(var(--accent))",
|
|
66
|
+
foreground: "hsl(var(--accent-foreground))",
|
|
67
|
+
},
|
|
68
|
+
popover: {
|
|
69
|
+
DEFAULT: "hsl(var(--popover))",
|
|
70
|
+
foreground: "hsl(var(--popover-foreground))",
|
|
71
|
+
},
|
|
72
|
+
card: {
|
|
73
|
+
DEFAULT: "hsl(var(--card))",
|
|
74
|
+
foreground: "hsl(var(--card-foreground))",
|
|
75
|
+
},
|
|
61
76
|
},
|
|
62
77
|
},
|
|
63
78
|
},
|
|
64
|
-
|
|
65
|
-
|
|
79
|
+
plugins: [typographyPlugin],
|
|
80
|
+
};
|
|
66
81
|
};
|
|
67
82
|
|
|
68
83
|
export default config;
|
|
@@ -203,9 +203,14 @@ export class OpenIDAuthenticationProvider implements AuthenticationProvider {
|
|
|
203
203
|
}
|
|
204
204
|
const tokenState = providerData as TokenState;
|
|
205
205
|
|
|
206
|
-
if (tokenState.expiresOn < new Date()) {
|
|
206
|
+
if (new Date(tokenState.expiresOn) < new Date()) {
|
|
207
207
|
if (!tokenState.refreshToken) {
|
|
208
|
-
|
|
208
|
+
useAuthState.setState({
|
|
209
|
+
isAuthenticated: false,
|
|
210
|
+
isPending: false,
|
|
211
|
+
profile: null,
|
|
212
|
+
providerData: null,
|
|
213
|
+
});
|
|
209
214
|
return "";
|
|
210
215
|
}
|
|
211
216
|
|
|
@@ -38,23 +38,22 @@ const getComponent = (level: number) => {
|
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
|
|
41
|
-
export
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
}
|
|
41
|
+
export type HeadingProps = React.ButtonHTMLAttributes<HTMLButtonElement> &
|
|
42
|
+
VariantProps<typeof heading> & {
|
|
43
|
+
children: ReactNode;
|
|
44
|
+
className?: string;
|
|
45
|
+
id?: string;
|
|
46
|
+
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
47
|
+
registerSidebarAnchor?: boolean;
|
|
48
|
+
};
|
|
50
49
|
|
|
51
|
-
export const Heading
|
|
50
|
+
export const Heading = ({
|
|
52
51
|
level,
|
|
53
52
|
children,
|
|
54
53
|
id,
|
|
55
54
|
className,
|
|
56
55
|
registerSidebarAnchor,
|
|
57
|
-
}) => {
|
|
56
|
+
}: HeadingProps) => {
|
|
58
57
|
const Component = getComponent(level ?? 1);
|
|
59
58
|
const { ref } = useRegisterAnchorElement();
|
|
60
59
|
|
|
@@ -67,10 +66,11 @@ export const Heading: React.FC<HeadingProps> = ({
|
|
|
67
66
|
{id && (
|
|
68
67
|
<a
|
|
69
68
|
href={`#${id}`}
|
|
70
|
-
className="no-underline absolute text-primary -left-[0.8em] pr-2.5 opacity-0 group-hover:opacity-50 hover:!opacity-100 transition-opacity duration-200"
|
|
69
|
+
className="before:content-['#'] no-underline absolute text-primary -left-[0.8em] pr-2.5 opacity-0 group-hover:opacity-50 hover:!opacity-100 transition-opacity duration-200"
|
|
71
70
|
aria-label={`Link to ${id}`}
|
|
72
71
|
>
|
|
73
|
-
|
|
72
|
+
{/* Zero width space */}
|
|
73
|
+
​
|
|
74
74
|
</a>
|
|
75
75
|
)}
|
|
76
76
|
{children}
|