zudoku 0.66.2 → 0.66.3
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/config/validators/validate.d.ts +32 -3
- package/dist/config/validators/validate.js +1 -1
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/flat-config.d.ts +1 -1
- package/dist/lib/auth/issuer.js +1 -1
- package/dist/lib/auth/issuer.js.map +1 -1
- package/dist/lib/authentication/authentication.d.ts +3 -2
- package/dist/lib/authentication/hook.d.ts +2 -0
- package/dist/lib/authentication/hook.js +10 -0
- package/dist/lib/authentication/hook.js.map +1 -1
- package/dist/lib/authentication/providers/firebase.js +67 -9
- package/dist/lib/authentication/providers/firebase.js.map +1 -1
- package/dist/lib/authentication/ui/EmailVerificationUi.d.ts +4 -0
- package/dist/lib/authentication/ui/EmailVerificationUi.js +34 -0
- package/dist/lib/authentication/ui/EmailVerificationUi.js.map +1 -0
- package/dist/lib/authentication/ui/ZudokuAuthUi.d.ts +7 -2
- package/dist/lib/authentication/ui/ZudokuAuthUi.js +43 -11
- package/dist/lib/authentication/ui/ZudokuAuthUi.js.map +1 -1
- package/dist/lib/authentication/utils/relativeRedirectUrl.d.ts +1 -0
- package/dist/lib/authentication/utils/relativeRedirectUrl.js +8 -0
- package/dist/lib/authentication/utils/relativeRedirectUrl.js.map +1 -0
- package/dist/lib/components/index.d.ts +2 -0
- package/dist/lib/errors/ErrorMessage.d.ts +3 -0
- package/dist/lib/errors/ErrorMessage.js +16 -0
- package/dist/lib/errors/ErrorMessage.js.map +1 -0
- package/dist/lib/hooks/index.d.ts +2 -0
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js +9 -172
- package/dist/lib/plugins/api-keys/SettingsApiKeys.js.map +1 -1
- package/dist/lib/plugins/api-keys/index.d.ts +4 -1
- package/dist/lib/plugins/api-keys/index.js +19 -14
- package/dist/lib/plugins/api-keys/index.js.map +1 -1
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.d.ts +12 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js +133 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyItem.js.map +1 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.d.ts +4 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.js +30 -0
- package/dist/lib/plugins/api-keys/settings/ApiKeyList.js.map +1 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.d.ts +6 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.js +39 -0
- package/dist/lib/plugins/api-keys/settings/RevealApiKey.js.map +1 -0
- package/dist/vite/config.js +7 -0
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api-keys.js +4 -1
- package/dist/vite/plugin-api-keys.js.map +1 -1
- package/dist/vite/zuplo.d.ts +13 -0
- package/dist/vite/zuplo.js +15 -0
- package/dist/vite/zuplo.js.map +1 -0
- package/lib/{ClaudeLogo-CGRfGTk2.js → ClaudeLogo-BZslN9XF.js} +3 -3
- package/lib/{ClaudeLogo-CGRfGTk2.js.map → ClaudeLogo-BZslN9XF.js.map} +1 -1
- package/lib/{Drawer-Ci7XwhqT.js → Drawer-BRMcpfuF.js} +6 -6
- package/lib/{Drawer-Ci7XwhqT.js.map → Drawer-BRMcpfuF.js.map} +1 -1
- package/lib/Frame-DxlznfVd.js +205 -0
- package/lib/Frame-DxlznfVd.js.map +1 -0
- package/lib/{useMutation-C6RqWmTS.js → Input-D-kqEQ5M.js} +41 -23
- package/lib/Input-D-kqEQ5M.js.map +1 -0
- package/lib/{MdxPage-Bjf72BP3.js → MdxPage-B4zZq5aR.js} +8 -8
- package/lib/{MdxPage-Bjf72BP3.js.map → MdxPage-B4zZq5aR.js.map} +1 -1
- package/lib/{Mermaid-D_VSX7_Q.js → Mermaid-BjSczjLW.js} +3 -3
- package/lib/{Mermaid-D_VSX7_Q.js.map → Mermaid-BjSczjLW.js.map} +1 -1
- package/lib/{OAuthErrorPage-1Ekji0PK.js → OAuthErrorPage-DRY2hlga.js} +20 -21
- package/lib/{OAuthErrorPage-1Ekji0PK.js.map → OAuthErrorPage-DRY2hlga.js.map} +1 -1
- package/lib/{OasProvider-BZxmTyMM.js → OasProvider-lMwTD76Y.js} +4 -4
- package/lib/{OasProvider-BZxmTyMM.js.map → OasProvider-lMwTD76Y.js.map} +1 -1
- package/lib/{OperationList-B7nPIFB8.js → OperationList-Bm76b4vl.js} +23 -24
- package/lib/{OperationList-B7nPIFB8.js.map → OperationList-Bm76b4vl.js.map} +1 -1
- package/lib/{RouteGuard-9wjejsKm.js → RouteGuard-DGc32XJV.js} +4 -4
- package/lib/{RouteGuard-9wjejsKm.js.map → RouteGuard-DGc32XJV.js.map} +1 -1
- package/lib/{SchemaList-16_obkku.js → SchemaList-DX4FPogg.js} +7 -7
- package/lib/{SchemaList-16_obkku.js.map → SchemaList-DX4FPogg.js.map} +1 -1
- package/lib/SchemaView-CjXvSRxy.js +434 -0
- package/lib/SchemaView-CjXvSRxy.js.map +1 -0
- package/lib/{Select-CkxXP5I7.js → Secret-BxGpIhDP.js} +121 -121
- package/lib/Secret-BxGpIhDP.js.map +1 -0
- package/lib/{SignUp-D54_QWFy.js → SignUp-CntxjFGS.js} +4 -4
- package/lib/{SignUp-D54_QWFy.js.map → SignUp-CntxjFGS.js.map} +1 -1
- package/lib/{SyntaxHighlight-j_HRSPCU.js → SyntaxHighlight-Dgd0AaaX.js} +2 -2
- package/lib/{SyntaxHighlight-j_HRSPCU.js.map → SyntaxHighlight-Dgd0AaaX.js.map} +1 -1
- package/lib/{Toc-z05x698-.js → Toc-L1vGGHA1.js} +2 -2
- package/lib/{Toc-z05x698-.js.map → Toc-L1vGGHA1.js.map} +1 -1
- package/lib/{ZudokuContext-BXldanA8.js → ZudokuContext-DNHMZfcP.js} +33 -33
- package/lib/{ZudokuContext-BXldanA8.js.map → ZudokuContext-DNHMZfcP.js.map} +1 -1
- package/lib/{chunk-PVWAREVJ-dLIqswPy.js → chunk-PVWAREVJ-ClM0m2aJ.js} +19 -19
- package/lib/{chunk-PVWAREVJ-dLIqswPy.js.map → chunk-PVWAREVJ-ClM0m2aJ.js.map} +1 -1
- package/lib/{circular-D5sYCIWL.js → circular-BIN_WQ0c.js} +2 -2
- package/lib/{circular-D5sYCIWL.js.map → circular-BIN_WQ0c.js.map} +1 -1
- package/lib/{createServer-BlwU7lIr.js → createServer-BEl12QFw.js} +4 -4
- package/lib/{createServer-BlwU7lIr.js.map → createServer-BEl12QFw.js.map} +1 -1
- package/lib/createVariantComponent-CQVt-H3r.js +18 -0
- package/lib/createVariantComponent-CQVt-H3r.js.map +1 -0
- package/lib/{errors-BtC4Kn2j.js → errors-CtBbD47A.js} +2 -2
- package/lib/{errors-BtC4Kn2j.js.map → errors-CtBbD47A.js.map} +1 -1
- package/lib/{firebase-Ibm_tv3G.js → firebase-CT38ugg4.js} +1588 -1342
- package/lib/firebase-CT38ugg4.js.map +1 -0
- package/lib/hook-CHw_R_xu.js +52 -0
- package/lib/hook-CHw_R_xu.js.map +1 -0
- package/lib/{ErrorAlert-BUlG32M9.js → index-CG2v-T7-.js} +5373 -4335
- package/lib/index-CG2v-T7-.js.map +1 -0
- package/lib/{index-eKVhlB94.js → index-CISwSpdT.js} +2 -2
- package/lib/{index-eKVhlB94.js.map → index-CISwSpdT.js.map} +1 -1
- package/lib/{index-Css56y3F.js → index-DXXZDuSJ.js} +4 -4
- package/lib/{index-Css56y3F.js.map → index-DXXZDuSJ.js.map} +1 -1
- package/lib/{index-CeVTNcfF.js → index-jI2Fjpy-.js} +98 -99
- package/lib/{index-CeVTNcfF.js.map → index-jI2Fjpy-.js.map} +1 -1
- package/lib/{index.esm-BoKBnRoT.js → index.esm-Bu35TNgg.js} +16 -14
- package/lib/index.esm-Bu35TNgg.js.map +1 -0
- package/lib/{mutation-BoVlx8yA.js → mutation-DMHWqmFp.js} +2 -2
- package/lib/{mutation-BoVlx8yA.js.map → mutation-DMHWqmFp.js.map} +1 -1
- package/lib/ui/Drawer.js +2 -2
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/zudoku.__internal.js +507 -479
- 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 +6 -5
- package/lib/zudoku.auth-firebase.js.map +1 -1
- package/lib/zudoku.auth-openid.js +4 -4
- package/lib/zudoku.auth-supabase.js +5 -5
- package/lib/zudoku.components.js +20 -21
- 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 +8 -9
- package/lib/zudoku.plugin-api-catalog.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +580 -543
- 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 +3 -3
- package/lib/zudoku.plugin-redirect.js +1 -1
- package/lib/zudoku.plugin-search-pagefind.js +3 -3
- package/lib/zudoku.router.js +2 -2
- package/package.json +4 -2
- package/src/lib/auth/issuer.ts +1 -1
- package/src/lib/authentication/authentication.ts +8 -2
- package/src/lib/authentication/hook.ts +16 -0
- package/src/lib/authentication/providers/firebase.tsx +98 -6
- package/src/lib/authentication/ui/EmailVerificationUi.tsx +129 -0
- package/src/lib/authentication/ui/ZudokuAuthUi.tsx +170 -38
- package/src/lib/authentication/utils/relativeRedirectUrl.ts +12 -0
- package/src/lib/errors/ErrorMessage.tsx +38 -0
- package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +36 -476
- package/src/lib/plugins/api-keys/index.tsx +33 -18
- package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -0
- package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +64 -0
- package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +124 -0
- package/lib/ErrorAlert-BUlG32M9.js.map +0 -1
- package/lib/RouterError-DfTZblpv.js +0 -42
- package/lib/RouterError-DfTZblpv.js.map +0 -1
- package/lib/SchemaView-eyvR4bRt.js +0 -597
- package/lib/SchemaView-eyvR4bRt.js.map +0 -1
- package/lib/Select-CkxXP5I7.js.map +0 -1
- package/lib/createVariantComponent-B9_dVBvu.js +0 -35
- package/lib/createVariantComponent-B9_dVBvu.js.map +0 -1
- package/lib/firebase-Ibm_tv3G.js.map +0 -1
- package/lib/hook-BNxidGQq.js +0 -40
- package/lib/hook-BNxidGQq.js.map +0 -1
- package/lib/index-DSOi7zVM.js +0 -1059
- package/lib/index-DSOi7zVM.js.map +0 -1
- package/lib/index.esm-BoKBnRoT.js.map +0 -1
- package/lib/useMutation-C6RqWmTS.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-CG2v-T7-.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-DNHMZfcP.js";
|
|
6
|
+
import { C, A as c } from "./errors-CtBbD47A.js";
|
|
7
|
+
import { C as k, O as w } from "./OAuthErrorPage-DRY2hlga.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 l } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { LogOutIcon as f } from "lucide-react";
|
|
3
|
-
import { S as w, a as p, b as v } from "./SignUp-
|
|
4
|
-
import { u as n } from "./ZudokuContext-
|
|
3
|
+
import { S as w, a as p, b as v } from "./SignUp-CntxjFGS.js";
|
|
4
|
+
import { u as n } from "./ZudokuContext-DNHMZfcP.js";
|
|
5
5
|
const b = ({
|
|
6
6
|
clerkPubKey: d,
|
|
7
7
|
jwtTemplateName: m,
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import {
|
|
3
|
-
import "./
|
|
4
|
-
import "./
|
|
5
|
-
import "./
|
|
2
|
+
import { y as e } from "./firebase-CT38ugg4.js";
|
|
3
|
+
import "./invariant-CGOLuIIz.js";
|
|
4
|
+
import "./errors-CtBbD47A.js";
|
|
5
|
+
import "./SignUp-CntxjFGS.js";
|
|
6
|
+
import "./ZudokuContext-DNHMZfcP.js";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
+
e as default
|
|
8
9
|
};
|
|
9
10
|
//# sourceMappingURL=zudoku.auth-firebase.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.auth-firebase.js","sources":[],"sourcesContent":[],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"zudoku.auth-firebase.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as D } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { a as Le } from "./invariant-CGOLuIIz.js";
|
|
3
|
-
import { E as Ue } from "./index-
|
|
3
|
+
import { E as Ue } from "./index-CG2v-T7-.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-DNHMZfcP.js";
|
|
6
|
+
import { C as Ie, O as re, A as R } from "./errors-CtBbD47A.js";
|
|
7
|
+
import { C as je, O as Oe } from "./OAuthErrorPage-DRY2hlga.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 i } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { createClient as h } from "@supabase/supabase-js";
|
|
3
|
-
import { C as m, A as g } from "./errors-
|
|
4
|
-
import { S as f } from "./SignUp-
|
|
5
|
-
import { u } from "./ZudokuContext-
|
|
3
|
+
import { C as m, A as g } from "./errors-CtBbD47A.js";
|
|
4
|
+
import { S as f } from "./SignUp-CntxjFGS.js";
|
|
5
|
+
import { u } from "./ZudokuContext-DNHMZfcP.js";
|
|
6
6
|
import { Auth as v } from "@supabase/auth-ui-react";
|
|
7
7
|
import { ThemeSupa as S } from "@supabase/auth-ui-shared";
|
|
8
|
-
import { b as A } from "./chunk-PVWAREVJ-
|
|
9
|
-
import { H as T } from "./
|
|
8
|
+
import { b as A } from "./chunk-PVWAREVJ-ClM0m2aJ.js";
|
|
9
|
+
import { H as T } from "./index-CG2v-T7-.js";
|
|
10
10
|
const d = ({
|
|
11
11
|
client: s,
|
|
12
12
|
config: e,
|
package/lib/zudoku.components.js
CHANGED
|
@@ -1,30 +1,29 @@
|
|
|
1
1
|
import "./index.esm-DtzT_KoE.js";
|
|
2
|
-
import "./index-
|
|
3
|
-
import "./chunk-PVWAREVJ-
|
|
4
|
-
import "./hook-
|
|
2
|
+
import "./index-DXXZDuSJ.js";
|
|
3
|
+
import "./chunk-PVWAREVJ-ClM0m2aJ.js";
|
|
4
|
+
import "./hook-CHw_R_xu.js";
|
|
5
5
|
import "./ui/Button.js";
|
|
6
6
|
import "./ui/Callout.js";
|
|
7
7
|
import "./ClientOnly-E7hGysn1.js";
|
|
8
|
-
import "./ZudokuContext-
|
|
9
|
-
import "./
|
|
8
|
+
import "./ZudokuContext-DNHMZfcP.js";
|
|
9
|
+
import { B as C, y as l, C as d, q as h, p as k, L as y, o as S, t as Z, S as w, r as x, Z as A, w as B, x as E, v as H, z as L, a as M } from "./index-CG2v-T7-.js";
|
|
10
10
|
import "./Spinner-CI6bRyZw.js";
|
|
11
|
-
import { B as d, i as h, C as l, d as k, c as S, L as y, M, e as T, S as Z, T as c, Z as f, g, h as A, f as B, j as E, u as H } from "./index-DSOi7zVM.js";
|
|
12
11
|
export {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
12
|
+
C as Button,
|
|
13
|
+
l as CACHE_KEYS,
|
|
14
|
+
d as Callout,
|
|
15
|
+
h as ClientOnly,
|
|
16
|
+
k as Head,
|
|
18
17
|
y as Link,
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
18
|
+
S as Markdown,
|
|
19
|
+
Z as Slot,
|
|
20
|
+
w as Spinner,
|
|
21
|
+
x as Typography,
|
|
22
|
+
A as Zudoku,
|
|
23
|
+
B as useAuth,
|
|
24
|
+
E as useCache,
|
|
25
|
+
H as useMDXComponents,
|
|
26
|
+
L as useTheme,
|
|
27
|
+
M as useZudoku
|
|
29
28
|
};
|
|
30
29
|
//# 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-DXXZDuSJ.js";
|
|
2
|
+
import "./hook-CHw_R_xu.js";
|
|
3
|
+
import { C as E } from "./ZudokuContext-DNHMZfcP.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 "./ZudokuContext-
|
|
2
|
+
import "./ZudokuContext-DNHMZfcP.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { M as e } from "./Mermaid-
|
|
5
|
-
import "./index-
|
|
4
|
+
import { M as e } from "./Mermaid-BjSczjLW.js";
|
|
5
|
+
import "./index-DXXZDuSJ.js";
|
|
6
6
|
import "./Spinner-CI6bRyZw.js";
|
|
7
7
|
export {
|
|
8
8
|
e as Mermaid
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { s as f } from "./index-
|
|
3
|
-
import {
|
|
4
|
-
import { u as x, e as v, j as d } from "./ZudokuContext-
|
|
2
|
+
import { s as f } from "./index-CISwSpdT.js";
|
|
3
|
+
import { c as b, m as j } from "./chunk-PVWAREVJ-ClM0m2aJ.js";
|
|
4
|
+
import { u as x, e as v, j as d } from "./ZudokuContext-DNHMZfcP.js";
|
|
5
5
|
import { H as y } from "./index.esm-DtzT_KoE.js";
|
|
6
|
-
import {
|
|
7
|
-
import { H as k, M as S } from "./ErrorAlert-BUlG32M9.js";
|
|
6
|
+
import { H as N, L as k, M as S } from "./index-CG2v-T7-.js";
|
|
8
7
|
const w = ({
|
|
9
8
|
items: o,
|
|
10
9
|
filterCatalogItems: r = (i) => i,
|
|
@@ -21,7 +20,7 @@ const w = ({
|
|
|
21
20
|
c
|
|
22
21
|
] }) }),
|
|
23
22
|
/* @__PURE__ */ t.jsxs("div", { className: "grid gap-4", children: [
|
|
24
|
-
/* @__PURE__ */ t.jsxs(
|
|
23
|
+
/* @__PURE__ */ t.jsxs(N, { level: 2, children: [
|
|
25
24
|
c,
|
|
26
25
|
s && ` - ${s}`
|
|
27
26
|
] }),
|
|
@@ -30,7 +29,7 @@ const w = ({
|
|
|
30
29
|
(n) => n.tags.find((g) => h(n.label, g) === a)
|
|
31
30
|
)
|
|
32
31
|
).map((e) => /* @__PURE__ */ t.jsx(
|
|
33
|
-
|
|
32
|
+
k,
|
|
34
33
|
{
|
|
35
34
|
to: d(e.path),
|
|
36
35
|
className: "no-underline hover:!text-foreground",
|
|
@@ -56,7 +55,7 @@ const w = ({
|
|
|
56
55
|
)) })
|
|
57
56
|
] })
|
|
58
57
|
] });
|
|
59
|
-
}, h = (o, r) => f(`${o}-${r}`),
|
|
58
|
+
}, h = (o, r) => f(`${o}-${r}`), P = ({
|
|
60
59
|
path: o,
|
|
61
60
|
items: r,
|
|
62
61
|
label: c,
|
|
@@ -118,7 +117,7 @@ const w = ({
|
|
|
118
117
|
};
|
|
119
118
|
};
|
|
120
119
|
export {
|
|
121
|
-
|
|
120
|
+
P as apiCatalogPlugin,
|
|
122
121
|
h as getKey
|
|
123
122
|
};
|
|
124
123
|
//# 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,IAC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