zudoku 0.66.6 → 0.66.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/dist/index.d.ts +2 -1
- package/dist/index.js +2 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/components/Pagination.js +2 -2
- package/dist/lib/components/Pagination.js.map +1 -1
- package/dist/lib/components/index.d.ts +3 -0
- package/dist/lib/components/index.js +4 -0
- package/dist/lib/components/index.js.map +1 -1
- package/dist/lib/components/navigation/NavigationItem.js +2 -2
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/core/react-query.d.ts +1 -0
- package/dist/lib/core/react-query.js +2 -0
- package/dist/lib/core/react-query.js.map +1 -0
- package/dist/lib/oas/graphql/circular.d.ts +1 -0
- package/dist/lib/oas/graphql/circular.js +15 -8
- package/dist/lib/oas/graphql/circular.js.map +1 -1
- package/dist/lib/oas/graphql/circular.test.d.ts +1 -0
- package/dist/lib/oas/graphql/circular.test.js +152 -0
- package/dist/lib/oas/graphql/circular.test.js.map +1 -0
- package/dist/vite/config.js +2 -0
- package/dist/vite/config.js.map +1 -1
- package/lib/{ClaudeLogo-BpqHBMS8.js → ClaudeLogo-DHxJUhN_.js} +20 -20
- package/lib/ClaudeLogo-DHxJUhN_.js.map +1 -0
- package/lib/HydrationBoundary-CNF2ZV3E.js +601 -0
- package/lib/HydrationBoundary-CNF2ZV3E.js.map +1 -0
- package/lib/Input-Cx-GeKoF.js +22 -0
- package/lib/Input-Cx-GeKoF.js.map +1 -0
- package/lib/{MdxPage-CeFSxGb_.js → MdxPage-CD36PJ17.js} +7 -7
- package/lib/{MdxPage-CeFSxGb_.js.map → MdxPage-CD36PJ17.js.map} +1 -1
- package/lib/{Mermaid-COVtAqcZ.js → Mermaid-Koc3z8mU.js} +3 -3
- package/lib/{Mermaid-COVtAqcZ.js.map → Mermaid-Koc3z8mU.js.map} +1 -1
- package/lib/{OAuthErrorPage-XTPBOMN8.js → OAuthErrorPage-4mN5DA86.js} +23 -22
- package/lib/{OAuthErrorPage-XTPBOMN8.js.map → OAuthErrorPage-4mN5DA86.js.map} +1 -1
- package/lib/{OasProvider-BS4rdzZC.js → OasProvider-DSe-hk5Y.js} +3 -3
- package/lib/{OasProvider-BS4rdzZC.js.map → OasProvider-DSe-hk5Y.js.map} +1 -1
- package/lib/{OperationList-Dg0Nm1tg.js → OperationList-CaknPbvq.js} +32 -31
- package/lib/{OperationList-Dg0Nm1tg.js.map → OperationList-CaknPbvq.js.map} +1 -1
- package/lib/{RouteGuard-kCicqF3x.js → RouteGuard--A04ESy8.js} +3 -3
- package/lib/{RouteGuard-kCicqF3x.js.map → RouteGuard--A04ESy8.js.map} +1 -1
- package/lib/{SchemaList-DZKBH2WC.js → SchemaList-Dw3-CJPb.js} +7 -7
- package/lib/{SchemaList-DZKBH2WC.js.map → SchemaList-Dw3-CJPb.js.map} +1 -1
- package/lib/{SchemaView-DBaqV2yU.js → SchemaView-DyJkiQkD.js} +3 -3
- package/lib/{SchemaView-DBaqV2yU.js.map → SchemaView-DyJkiQkD.js.map} +1 -1
- package/lib/{SignUp-DNmOFbLD.js → SignUp-DRvN-8cq.js} +3 -3
- package/lib/{SignUp-DNmOFbLD.js.map → SignUp-DRvN-8cq.js.map} +1 -1
- package/lib/{SyntaxHighlight-C75W8uCn.js → SyntaxHighlight-klTH8c6-.js} +2 -2
- package/lib/{SyntaxHighlight-C75W8uCn.js.map → SyntaxHighlight-klTH8c6-.js.map} +1 -1
- package/lib/{Toc-ICilS65g.js → Toc-PbuF-u9x.js} +2 -2
- package/lib/{Toc-ICilS65g.js.map → Toc-PbuF-u9x.js.map} +1 -1
- package/lib/ZudokuContext-BZB1TWdT.js +387 -0
- package/lib/ZudokuContext-BZB1TWdT.js.map +1 -0
- package/lib/{circular-DleWPaPP.js → circular-DFquXeY2.js} +21 -19
- package/lib/{circular-DleWPaPP.js.map → circular-DFquXeY2.js.map} +1 -1
- package/lib/{createServer-nqMW9kro.js → createServer-BXZ0CAUn.js} +4 -4
- package/lib/{createServer-nqMW9kro.js.map → createServer-BXZ0CAUn.js.map} +1 -1
- package/lib/{errors-D2FbERKl.js → errors-rWHkzVTd.js} +2 -2
- package/lib/{errors-D2FbERKl.js.map → errors-rWHkzVTd.js.map} +1 -1
- package/lib/{firebase-Cn9CmB6h.js → firebase-BmGU1FuD.js} +17 -15
- package/lib/{firebase-Cn9CmB6h.js.map → firebase-BmGU1FuD.js.map} +1 -1
- package/lib/{hook-B2nmfmYN.js → hook-BGlHBdET.js} +2 -2
- package/lib/{hook-B2nmfmYN.js.map → hook-BGlHBdET.js.map} +1 -1
- package/lib/{index-D5NeW2z6.js → index-BDsEwofZ.js} +1709 -1707
- package/lib/index-BDsEwofZ.js.map +1 -0
- package/lib/{index-CSDW7CHl.js → index-BQB9hb6n.js} +151 -149
- package/lib/{index-CSDW7CHl.js.map → index-BQB9hb6n.js.map} +1 -1
- package/lib/{index-CC4L3gtM.js → index-DBjOT2H1.js} +3 -3
- package/lib/{index-CC4L3gtM.js.map → index-DBjOT2H1.js.map} +1 -1
- package/lib/{index-DSKBOdpT.js → index-DRBOFufT.js} +2 -2
- package/lib/{index-DSKBOdpT.js.map → index-DRBOFufT.js.map} +1 -1
- package/lib/{index.esm-B35e7P83.js → index.esm-Cx8B1YJQ.js} +2 -2
- package/lib/index.esm-Cx8B1YJQ.js.map +1 -0
- package/lib/{mutation-BOYnEDf6.js → mutation-BISOc7OM.js} +2 -2
- package/lib/{mutation-BOYnEDf6.js.map → mutation-BISOc7OM.js.map} +1 -1
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/{Input-B6YcAPv-.js → useMutation-CFMGlAMW.js} +23 -40
- package/lib/useMutation-CFMGlAMW.js.map +1 -0
- package/lib/useSuspenseQuery-CSB_rVek.js +1226 -0
- package/lib/useSuspenseQuery-CSB_rVek.js.map +1 -0
- package/lib/zudoku.__internal.js +928 -1457
- package/lib/zudoku.__internal.js.map +1 -1
- package/lib/zudoku.auth-auth0.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +4 -4
- package/lib/zudoku.auth-clerk.js +2 -2
- package/lib/zudoku.auth-firebase.js +4 -4
- package/lib/zudoku.auth-openid.js +4 -4
- package/lib/zudoku.auth-supabase.js +4 -4
- package/lib/zudoku.components.js +21 -18
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.hooks.js +3 -3
- package/lib/zudoku.mermaid.js +3 -3
- package/lib/zudoku.plugin-api-catalog.js +6 -5
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +23 -21
- package/lib/zudoku.plugin-api-keys.js.map +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/lib/zudoku.plugin-search-pagefind.js +29 -28
- package/lib/zudoku.plugin-search-pagefind.js.map +1 -1
- package/lib/zudoku.react-query.js +440 -0
- package/lib/zudoku.react-query.js.map +1 -0
- package/package.json +5 -1
- package/src/lib/components/Pagination.tsx +4 -5
- package/src/lib/components/index.ts +4 -0
- package/src/lib/components/navigation/NavigationItem.tsx +9 -3
- package/src/lib/core/react-query.ts +1 -0
- package/src/lib/oas/graphql/circular.test.ts +186 -0
- package/src/lib/oas/graphql/circular.ts +22 -16
- package/lib/ClaudeLogo-BpqHBMS8.js.map +0 -1
- package/lib/Input-B6YcAPv-.js.map +0 -1
- package/lib/ZudokuContext-Ea7gxmGq.js +0 -1581
- package/lib/ZudokuContext-Ea7gxmGq.js.map +0 -1
- package/lib/index-D5NeW2z6.js.map +0 -1
- package/lib/index.esm-B35e7P83.js.map +0 -1
package/lib/zudoku.auth-auth0.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as n } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { PublicClientApplication as A, EventType as f } from "@azure/msal-browser";
|
|
3
|
-
import { E as I } from "./index-
|
|
3
|
+
import { E as I } from "./index-BDsEwofZ.js";
|
|
4
4
|
import { C as T } from "./ClientOnly-E7hGysn1.js";
|
|
5
|
-
import { j as S, u as h } from "./ZudokuContext-
|
|
6
|
-
import { C, A as c } from "./errors-
|
|
7
|
-
import { C as k, O as w } from "./OAuthErrorPage-
|
|
5
|
+
import { j as S, u as h } from "./ZudokuContext-BZB1TWdT.js";
|
|
6
|
+
import { C, A as c } from "./errors-rWHkzVTd.js";
|
|
7
|
+
import { C as k, O as w } from "./OAuthErrorPage-4mN5DA86.js";
|
|
8
8
|
const u = "/oauth/callback";
|
|
9
9
|
class y extends C {
|
|
10
10
|
msalInstance;
|
package/lib/zudoku.auth-clerk.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { j as a } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { LogOutIcon as m } from "lucide-react";
|
|
3
|
-
import { S as p, a as f, b as h } from "./SignUp-
|
|
4
|
-
import { u as r } from "./ZudokuContext-
|
|
3
|
+
import { S as p, a as f, b as h } from "./SignUp-DRvN-8cq.js";
|
|
4
|
+
import { u as r } from "./ZudokuContext-BZB1TWdT.js";
|
|
5
5
|
const R = ({
|
|
6
6
|
clerkPubKey: u,
|
|
7
7
|
jwtTemplateName: c,
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { y as e } from "./firebase-
|
|
2
|
+
import { y as e } from "./firebase-BmGU1FuD.js";
|
|
3
3
|
import "./invariant-BJAl77rw.js";
|
|
4
|
-
import "./errors-
|
|
5
|
-
import "./SignUp-
|
|
6
|
-
import "./ZudokuContext-
|
|
4
|
+
import "./errors-rWHkzVTd.js";
|
|
5
|
+
import "./SignUp-DRvN-8cq.js";
|
|
6
|
+
import "./ZudokuContext-BZB1TWdT.js";
|
|
7
7
|
export {
|
|
8
8
|
e as default
|
|
9
9
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as D } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { a as Le } from "./invariant-BJAl77rw.js";
|
|
3
|
-
import { E as Ue } from "./index-
|
|
3
|
+
import { E as Ue } from "./index-BDsEwofZ.js";
|
|
4
4
|
import { C as xe } from "./ClientOnly-E7hGysn1.js";
|
|
5
|
-
import { j as Ce, u as S } from "./ZudokuContext-
|
|
6
|
-
import { C as Ie, O as re, A as R } from "./errors-
|
|
7
|
-
import { C as je, O as Oe } from "./OAuthErrorPage-
|
|
5
|
+
import { j as Ce, u as S } from "./ZudokuContext-BZB1TWdT.js";
|
|
6
|
+
import { C as Ie, O as re, A as R } from "./errors-rWHkzVTd.js";
|
|
7
|
+
import { C as je, O as Oe } from "./OAuthErrorPage-4mN5DA86.js";
|
|
8
8
|
var J = { exports: {} }, De = J.exports, oe;
|
|
9
9
|
function Je() {
|
|
10
10
|
return oe || (oe = 1, (function(t) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as a } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { createClient as g } from "@supabase/supabase-js";
|
|
3
|
-
import { C as m, A as h } from "./errors-
|
|
4
|
-
import { S as f } from "./SignUp-
|
|
5
|
-
import { u } from "./ZudokuContext-
|
|
3
|
+
import { C as m, A as h } from "./errors-rWHkzVTd.js";
|
|
4
|
+
import { S as f } from "./SignUp-DRvN-8cq.js";
|
|
5
|
+
import { u } from "./ZudokuContext-BZB1TWdT.js";
|
|
6
6
|
import { Auth as v } from "@supabase/auth-ui-react";
|
|
7
7
|
import { ThemeSupa as S } from "@supabase/auth-ui-shared";
|
|
8
8
|
import { b as T } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
9
|
-
import { H as A } from "./index-
|
|
9
|
+
import { H as A } from "./index-BDsEwofZ.js";
|
|
10
10
|
const c = ({
|
|
11
11
|
client: i,
|
|
12
12
|
config: e,
|
package/lib/zudoku.components.js
CHANGED
|
@@ -1,29 +1,32 @@
|
|
|
1
1
|
import "./index.esm-B_0dvNjB.js";
|
|
2
|
-
import "./index-
|
|
2
|
+
import "./index-DBjOT2H1.js";
|
|
3
3
|
import "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
4
|
-
import "./hook-
|
|
4
|
+
import "./hook-BGlHBdET.js";
|
|
5
5
|
import "./ui/Button.js";
|
|
6
6
|
import "./ui/Callout.js";
|
|
7
|
+
import "./invariant-BJAl77rw.js";
|
|
7
8
|
import "./ClientOnly-E7hGysn1.js";
|
|
8
|
-
import "./ZudokuContext-
|
|
9
|
-
import { B as
|
|
9
|
+
import "./ZudokuContext-BZB1TWdT.js";
|
|
10
|
+
import { B as d, F as k, C as l, r as h, p as y, q as S, L as Z, o as E, v as H, S as g, t as w, Z as x, w as A, y as B, z as L, x as M, G as T, a as c } from "./index-BDsEwofZ.js";
|
|
10
11
|
import "./Spinner-CI6bRyZw.js";
|
|
11
12
|
export {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
d as Button,
|
|
14
|
+
k as CACHE_KEYS,
|
|
15
|
+
l as Callout,
|
|
15
16
|
h as ClientOnly,
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
17
|
+
y as Head,
|
|
18
|
+
S as Heading,
|
|
19
|
+
Z as Link,
|
|
20
|
+
E as Markdown,
|
|
21
|
+
H as Slot,
|
|
22
|
+
g as Spinner,
|
|
23
|
+
w as Typography,
|
|
24
|
+
x as Zudoku,
|
|
25
|
+
A as ZudokuError,
|
|
23
26
|
B as useAuth,
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
L as useCache,
|
|
28
|
+
M as useMDXComponents,
|
|
29
|
+
T as useTheme,
|
|
30
|
+
c as useZudoku
|
|
28
31
|
};
|
|
29
32
|
//# sourceMappingURL=zudoku.components.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.components.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zudoku.components.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;"}
|
package/lib/zudoku.hooks.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { b as o, h as u, e as p, f as r, g as t, a as m, c as C } from "./index-
|
|
2
|
-
import "./hook-
|
|
3
|
-
import { C as E } from "./ZudokuContext-
|
|
1
|
+
import { b as o, h as u, e as p, f as r, g as t, a as m, c as C } from "./index-DBjOT2H1.js";
|
|
2
|
+
import "./hook-BGlHBdET.js";
|
|
3
|
+
import { C as E } from "./ZudokuContext-BZB1TWdT.js";
|
|
4
4
|
export {
|
|
5
5
|
E as CACHE_KEYS,
|
|
6
6
|
o as useAuth,
|
package/lib/zudoku.mermaid.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import "./
|
|
2
|
+
import "./useSuspenseQuery-CSB_rVek.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { M as e } from "./Mermaid-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { M as e } from "./Mermaid-Koc3z8mU.js";
|
|
5
|
+
import "./index-DBjOT2H1.js";
|
|
6
6
|
import "./Spinner-CI6bRyZw.js";
|
|
7
7
|
export {
|
|
8
8
|
e as Mermaid
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { s as f } from "./index-
|
|
2
|
+
import { s as f } from "./index-DRBOFufT.js";
|
|
3
3
|
import { c as b, m as j } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
4
|
-
import { u as x,
|
|
4
|
+
import { u as x, j as d } from "./ZudokuContext-BZB1TWdT.js";
|
|
5
|
+
import { u as v } from "./useSuspenseQuery-CSB_rVek.js";
|
|
5
6
|
import { H as y } from "./index.esm-B_0dvNjB.js";
|
|
6
|
-
import { H as N, L as k, M as S } from "./index-
|
|
7
|
+
import { H as N, L as k, M as S } from "./index-BDsEwofZ.js";
|
|
7
8
|
const w = ({
|
|
8
9
|
items: o,
|
|
9
10
|
filterCatalogItems: r = (i) => i,
|
|
@@ -55,7 +56,7 @@ const w = ({
|
|
|
55
56
|
)) })
|
|
56
57
|
] })
|
|
57
58
|
] });
|
|
58
|
-
}, h = (o, r) => f(`${o}-${r}`),
|
|
59
|
+
}, h = (o, r) => f(`${o}-${r}`), q = ({
|
|
59
60
|
path: o,
|
|
60
61
|
items: r,
|
|
61
62
|
label: c,
|
|
@@ -117,7 +118,7 @@ const w = ({
|
|
|
117
118
|
};
|
|
118
119
|
};
|
|
119
120
|
export {
|
|
120
|
-
|
|
121
|
+
q as apiCatalogPlugin,
|
|
121
122
|
h as getKey
|
|
122
123
|
};
|
|
123
124
|
//# sourceMappingURL=zudoku.plugin-api-catalog.js.map
|
|
@@ -1 +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 { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMatch } from \"react-router\";\nimport { Link } from \"zudoku/components\";\nimport { useAuthState } from \"../../authentication/state.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { type ApiCatalogPluginOptions, getKey } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n filterCatalogItems = (items) => items,\n label = \"API Library\",\n categoryLabel,\n}: Omit<ApiCatalogPluginOptions, \"path\"> & {\n categoryLabel?: string;\n}) => {\n const auth = useAuthState();\n const match = useMatch({ path: \"/catalog/:category\" });\n const activeCategory = match?.params.category;\n\n const catalogItems = useSuspenseQuery({\n queryFn: () => filterCatalogItems(items, { auth }),\n queryKey: [\"catalogItems\", auth],\n });\n\n // Only index the overview page, ignore the rest\n const dataSet = activeCategory ? { \"data-pagefind-ignore\": \"all\" } : {};\n\n return (\n <section className=\"pt-(--padding-content-top)\" {...dataSet}>\n <Helmet>\n <title>\n {categoryLabel ? `${categoryLabel} - ` : \"\"}\n {label}\n </title>\n </Helmet>\n <div className=\"grid gap-4\">\n <Heading level={2}>\n {label}\n {categoryLabel && ` - ${categoryLabel}`}\n </Heading>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {catalogItems.data\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find((t) => getKey(c.label, t) === activeCategory),\n ),\n )\n .map((api) => (\n <Link\n to={joinUrl(api.path)}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div className=\"border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\">\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 components={{\n // Because we're wrapping the description in a Link already,\n // we need to strip out other links to not get a hydration error, like:\n // > In HTML, <a> cannot be a descendant of <a>.\n // > This will cause a hydration error.\n a: (props) => <span {...props} />,\n }}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </section>\n );\n};\n","import slugify from \"@sindresorhus/slugify\";\nimport { matchPath } from \"react-router\";\nimport type { NavigationItem } from \"../../../config/validators/NavigationSchema.js\";\nimport type { AuthState } from \"../../authentication/state.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport const getKey = (category: string, tag: string) =>\n slugify(`${category}-${tag}`);\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 path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n};\n\nexport type CatalogContext<ProviderData = unknown> = {\n auth: AuthState<ProviderData>;\n};\n\nexport type FilterCatalogItemsFn<ProviderData = unknown> = (\n items: ApiCatalogItem[],\n { auth }: CatalogContext<ProviderData>,\n) => ApiCatalogItem[];\n\nexport const apiCatalogPlugin = ({\n path,\n items,\n label,\n categories = [],\n filterCatalogItems,\n}: {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n}): ZudokuPlugin => {\n const paths = Object.fromEntries(\n categories.flatMap((category) =>\n [undefined, ...category.tags].map((tag) => [\n joinUrl(path, tag ? getKey(category.label, tag) : undefined),\n tag,\n ]),\n ),\n );\n\n return {\n getNavigation: async (currentPath) => {\n const matches = Object.keys(paths).some((path) =>\n matchPath(path, currentPath),\n );\n\n if (!matches) {\n return [];\n }\n\n const navigation: NavigationItem[] = categories.map((category) => ({\n type: \"category\",\n label: category.label,\n collapsible: false,\n items: category.tags.map((tag) => ({\n type: \"link\",\n to: joinUrl(path, getKey(category.label, tag)),\n label: tag,\n badge: {\n label: String(\n items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n ),\n color: \"outline\",\n },\n })),\n }));\n\n navigation.unshift({\n type: \"link\",\n to: joinUrl(path),\n label: \"Overview\",\n badge: { label: String(items.length), color: \"outline\" },\n });\n\n return navigation;\n },\n getRoutes: () =>\n Object.entries(paths).map(([path, tag]) => ({\n path,\n element: (\n <Catalog\n label={label}\n categoryLabel={tag}\n items={items}\n filterCatalogItems={filterCatalogItems}\n categories={categories}\n />\n ),\n })),\n };\n};\n"],"names":["Catalog","items","filterCatalogItems","label","categoryLabel","auth","useAuthState","activeCategory","useMatch","catalogItems","useSuspenseQuery","dataSet","jsxs","jsx","Helmet","Heading","api","c","t","getKey","Link","joinUrl","Markdown","props","category","tag","slugify","apiCatalogPlugin","path","categories","paths","currentPath","matchPath","navigation"],"mappings":"
|
|
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 { useSuspenseQuery } from \"@tanstack/react-query\";\nimport { Helmet } from \"@zudoku/react-helmet-async\";\nimport { useMatch } from \"react-router\";\nimport { Link } from \"zudoku/components\";\nimport { useAuthState } from \"../../authentication/state.js\";\nimport { Heading } from \"../../components/Heading.js\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { type ApiCatalogPluginOptions, getKey } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n filterCatalogItems = (items) => items,\n label = \"API Library\",\n categoryLabel,\n}: Omit<ApiCatalogPluginOptions, \"path\"> & {\n categoryLabel?: string;\n}) => {\n const auth = useAuthState();\n const match = useMatch({ path: \"/catalog/:category\" });\n const activeCategory = match?.params.category;\n\n const catalogItems = useSuspenseQuery({\n queryFn: () => filterCatalogItems(items, { auth }),\n queryKey: [\"catalogItems\", auth],\n });\n\n // Only index the overview page, ignore the rest\n const dataSet = activeCategory ? { \"data-pagefind-ignore\": \"all\" } : {};\n\n return (\n <section className=\"pt-(--padding-content-top)\" {...dataSet}>\n <Helmet>\n <title>\n {categoryLabel ? `${categoryLabel} - ` : \"\"}\n {label}\n </title>\n </Helmet>\n <div className=\"grid gap-4\">\n <Heading level={2}>\n {label}\n {categoryLabel && ` - ${categoryLabel}`}\n </Heading>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {catalogItems.data\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find((t) => getKey(c.label, t) === activeCategory),\n ),\n )\n .map((api) => (\n <Link\n to={joinUrl(api.path)}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div className=\"border h-full rounded-lg p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\">\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 components={{\n // Because we're wrapping the description in a Link already,\n // we need to strip out other links to not get a hydration error, like:\n // > In HTML, <a> cannot be a descendant of <a>.\n // > This will cause a hydration error.\n a: (props) => <span {...props} />,\n }}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </section>\n );\n};\n","import slugify from \"@sindresorhus/slugify\";\nimport { matchPath } from \"react-router\";\nimport type { NavigationItem } from \"../../../config/validators/NavigationSchema.js\";\nimport type { AuthState } from \"../../authentication/state.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { joinUrl } from \"../../util/joinUrl.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport const getKey = (category: string, tag: string) =>\n slugify(`${category}-${tag}`);\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 path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n};\n\nexport type CatalogContext<ProviderData = unknown> = {\n auth: AuthState<ProviderData>;\n};\n\nexport type FilterCatalogItemsFn<ProviderData = unknown> = (\n items: ApiCatalogItem[],\n { auth }: CatalogContext<ProviderData>,\n) => ApiCatalogItem[];\n\nexport const apiCatalogPlugin = ({\n path,\n items,\n label,\n categories = [],\n filterCatalogItems,\n}: {\n path: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n filterCatalogItems?: FilterCatalogItemsFn;\n}): ZudokuPlugin => {\n const paths = Object.fromEntries(\n categories.flatMap((category) =>\n [undefined, ...category.tags].map((tag) => [\n joinUrl(path, tag ? getKey(category.label, tag) : undefined),\n tag,\n ]),\n ),\n );\n\n return {\n getNavigation: async (currentPath) => {\n const matches = Object.keys(paths).some((path) =>\n matchPath(path, currentPath),\n );\n\n if (!matches) {\n return [];\n }\n\n const navigation: NavigationItem[] = categories.map((category) => ({\n type: \"category\",\n label: category.label,\n collapsible: false,\n items: category.tags.map((tag) => ({\n type: \"link\",\n to: joinUrl(path, getKey(category.label, tag)),\n label: tag,\n badge: {\n label: String(\n items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n ),\n color: \"outline\",\n },\n })),\n }));\n\n navigation.unshift({\n type: \"link\",\n to: joinUrl(path),\n label: \"Overview\",\n badge: { label: String(items.length), color: \"outline\" },\n });\n\n return navigation;\n },\n getRoutes: () =>\n Object.entries(paths).map(([path, tag]) => ({\n path,\n element: (\n <Catalog\n label={label}\n categoryLabel={tag}\n items={items}\n filterCatalogItems={filterCatalogItems}\n categories={categories}\n />\n ),\n })),\n };\n};\n"],"names":["Catalog","items","filterCatalogItems","label","categoryLabel","auth","useAuthState","activeCategory","useMatch","catalogItems","useSuspenseQuery","dataSet","jsxs","jsx","Helmet","Heading","api","c","t","getKey","Link","joinUrl","Markdown","props","category","tag","slugify","apiCatalogPlugin","path","categories","paths","currentPath","matchPath","navigation"],"mappings":";;;;;;;AAUO,MAAMA,IAAU,CAAC;AAAA,EACtB,OAAAC;AAAA,EACA,oBAAAC,IAAqB,CAACD,MAAUA;AAAAA,EAChC,OAAAE,IAAQ;AAAA,EACR,eAAAC;AACF,MAEM;AACJ,QAAMC,IAAOC,EAAA,GAEPC,IADQC,EAAS,EAAE,MAAM,sBAAsB,GACvB,OAAO,UAE/BC,IAAeC,EAAiB;AAAA,IACpC,SAAS,MAAMR,EAAmBD,GAAO,EAAE,MAAAI,GAAM;AAAA,IACjD,UAAU,CAAC,gBAAgBA,CAAI;AAAA,EAAA,CAChC,GAGKM,IAAUJ,IAAiB,EAAE,wBAAwB,MAAA,IAAU,CAAA;AAErE,SACEK,gBAAAA,EAAAA,KAAC,WAAA,EAAQ,WAAU,8BAA8B,GAAGD,GAClD,UAAA;AAAA,IAAAE,gBAAAA,EAAAA,IAACC,GAAA,EACC,iCA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OAAO,OAAO3B,EAAM,MAAM,GAAG,OAAO,UAAA;AAAA,MAAU,CACxD,GAEMgC;AAAA,IACT;AAAA,IACA,WAAW,MACT,OAAO,QAAQH,CAAK,EAAE,IAAI,CAAC,CAACF,GAAMH,CAAG,OAAO;AAAA,MAC1C,MAAAG;AAAAA,MACA,SACEf,gBAAAA,EAAAA;AAAAA,QAACb;AAAA,QAAA;AAAA,UACC,OAAAG;AAAA,UACA,eAAesB;AAAA,UACf,OAAAxB;AAAA,UACA,oBAAAC;AAAA,UACA,YAAA2B;AAAA,QAAA;AAAA,MAAA;AAAA,IACF,EAEF;AAAA,EAAA;AAER;"}
|
|
@@ -3,21 +3,23 @@ import { TrashIcon as me, CircleSlashIcon as z, CheckIcon as xe, XIcon as ye, Pe
|
|
|
3
3
|
import { Z as M, i as E } from "./invariant-BJAl77rw.js";
|
|
4
4
|
import * as F from "react";
|
|
5
5
|
import { createContext as Q, useRef as A, useLayoutEffect as Ce, useEffect as ie, useId as H, useContext as V, useInsertionEffect as we, useMemo as L, useCallback as ke, Children as Ee, isValidElement as Ie, useState as I } from "react";
|
|
6
|
-
import { D as be, c as Ke, d as ee, B as De, E as Pe } from "./index-
|
|
7
|
-
import { b as re } from "./index-
|
|
6
|
+
import { D as be, c as Ke, d as ee, B as De, E as Pe } from "./index-BDsEwofZ.js";
|
|
7
|
+
import { b as re } from "./index-DBjOT2H1.js";
|
|
8
8
|
import { F as Ae, g as Se, j as Re, h as Ne, d as Oe, I as Te, a as qe, b as Me, k as Fe, c as $e } from "./Frame-DKlOmSkU.js";
|
|
9
|
-
import { A as D, a as P, b as ae } from "./Mermaid-
|
|
9
|
+
import { A as D, a as P, b as ae } from "./Mermaid-Koc3z8mU.js";
|
|
10
10
|
import { e as _, f as S, D as B, g as Z, a as G, b as J, c as Y, d as oe } from "./Dialog-hlvmmQ_c.js";
|
|
11
11
|
import { Button as le } from "./ui/Button.js";
|
|
12
|
-
import { a as
|
|
13
|
-
import { u as q
|
|
14
|
-
import { a as
|
|
15
|
-
import { u as
|
|
16
|
-
import { A as
|
|
17
|
-
import { S as
|
|
18
|
-
import {
|
|
12
|
+
import { a as ce, u as ze } from "./useSuspenseQuery-CSB_rVek.js";
|
|
13
|
+
import { u as q } from "./useMutation-CFMGlAMW.js";
|
|
14
|
+
import { a as Le } from "./index.esm-BYObtETB.js";
|
|
15
|
+
import { u as Qe } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
16
|
+
import { A as He } from "./ActionButton-B0CXL1Lq.js";
|
|
17
|
+
import { S as Ve, a as _e, b as Be, c as Ze, d as Ge, e as te, f as Je } from "./Secret-BDBqq4p3.js";
|
|
18
|
+
import { a as U } from "./ZudokuContext-BZB1TWdT.js";
|
|
19
|
+
import { Input as Ye } from "./ui/Input.js";
|
|
19
20
|
import { c as W } from "./cn-5-Gd1Dss.js";
|
|
20
21
|
import { B as k } from "./Button-GUVe7pmt.js";
|
|
22
|
+
import { I as Ue } from "./Input-Cx-GeKoF.js";
|
|
21
23
|
function We({ error: t }) {
|
|
22
24
|
const a = t instanceof Error ? t.message : "Something went wrong", s = process.env.NODE_ENV === "development", n = t instanceof M ? t.developerHint : void 0, r = t instanceof M ? t.title : "Something went wrong", i = t instanceof Error ? t.stack : void 0, o = t instanceof Error ? t.cause : void 0, d = o instanceof Error ? String(o.stack) : i;
|
|
23
25
|
return /* @__PURE__ */ e.jsxs(e.Fragment, { children: [
|
|
@@ -40,7 +42,7 @@ const Xe = ({
|
|
|
40
42
|
service: t,
|
|
41
43
|
onOpenChange: a
|
|
42
44
|
}) => {
|
|
43
|
-
const s = U(), n = ce(), r =
|
|
45
|
+
const s = U(), n = ce(), r = Qe(), i = Le({
|
|
44
46
|
defaultValues: {
|
|
45
47
|
expiresOn: "30"
|
|
46
48
|
}
|
|
@@ -80,16 +82,16 @@ const Xe = ({
|
|
|
80
82
|
] }),
|
|
81
83
|
/* @__PURE__ */ e.jsxs("div", { className: "flex gap-2 flex-col text-sm font-medium", children: [
|
|
82
84
|
"Name",
|
|
83
|
-
/* @__PURE__ */ e.jsx(
|
|
85
|
+
/* @__PURE__ */ e.jsx(Ye, { ...i.register("description") }),
|
|
84
86
|
"Expiration",
|
|
85
87
|
/* @__PURE__ */ e.jsxs(
|
|
86
|
-
|
|
88
|
+
Ve,
|
|
87
89
|
{
|
|
88
90
|
onValueChange: (c) => i.setValue("expiresOn", c),
|
|
89
91
|
defaultValue: i.getValues("expiresOn"),
|
|
90
92
|
children: [
|
|
91
|
-
/* @__PURE__ */ e.jsx(
|
|
92
|
-
/* @__PURE__ */ e.jsx(
|
|
93
|
+
/* @__PURE__ */ e.jsx(_e, { children: /* @__PURE__ */ e.jsx(Be, {}) }),
|
|
94
|
+
/* @__PURE__ */ e.jsx(Ze, { children: /* @__PURE__ */ e.jsxs(Ge, { children: [
|
|
93
95
|
[7, 30, 60, 90].map((c) => /* @__PURE__ */ e.jsxs(te, { value: String(c), children: [
|
|
94
96
|
c,
|
|
95
97
|
" days"
|
|
@@ -101,7 +103,7 @@ const Xe = ({
|
|
|
101
103
|
),
|
|
102
104
|
/* @__PURE__ */ e.jsxs(_, { children: [
|
|
103
105
|
/* @__PURE__ */ e.jsx(S, { asChild: !0, children: /* @__PURE__ */ e.jsx(le, { variant: "outline", children: "Cancel" }) }),
|
|
104
|
-
/* @__PURE__ */ e.jsx(
|
|
106
|
+
/* @__PURE__ */ e.jsx(He, { isPending: d.isPending, children: "Generate Key" })
|
|
105
107
|
] })
|
|
106
108
|
] })
|
|
107
109
|
]
|
|
@@ -302,7 +304,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
302
304
|
return /* @__PURE__ */ e.jsxs("div", { className: W("grid col-span-full grid-cols-subgrid p-6", s), children: [
|
|
303
305
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
304
306
|
/* @__PURE__ */ e.jsx(
|
|
305
|
-
|
|
307
|
+
Je,
|
|
306
308
|
{
|
|
307
309
|
className: "max-w-fit w-full",
|
|
308
310
|
secret: i,
|
|
@@ -448,7 +450,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
448
450
|
/* @__PURE__ */ e.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
449
451
|
r ? /* @__PURE__ */ e.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
450
452
|
/* @__PURE__ */ e.jsx(
|
|
451
|
-
|
|
453
|
+
Ue,
|
|
452
454
|
{
|
|
453
455
|
maxLength: 32,
|
|
454
456
|
value: o,
|
|
@@ -730,7 +732,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
730
732
|
}));
|
|
731
733
|
},
|
|
732
734
|
...a
|
|
733
|
-
}),
|
|
735
|
+
}), Ht = (t) => t, Vt = ({
|
|
734
736
|
deploymentName: t,
|
|
735
737
|
isZuplo: a,
|
|
736
738
|
...s
|
|
@@ -778,7 +780,7 @@ const ht = ({ children: t, custom: a, initial: s = !0, onExitComplete: n, presen
|
|
|
778
780
|
};
|
|
779
781
|
};
|
|
780
782
|
export {
|
|
781
|
-
|
|
782
|
-
|
|
783
|
+
Vt as apiKeyPlugin,
|
|
784
|
+
Ht as createApiKeyService
|
|
783
785
|
};
|
|
784
786
|
//# sourceMappingURL=zudoku.plugin-api-keys.js.map
|