zudoku 0.0.0-z63644134 → 0.0.0-z6b1ecd2d
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/InputNavigationSchema.d.ts +51 -1
- package/dist/config/validators/InputNavigationSchema.js +17 -0
- package/dist/config/validators/InputNavigationSchema.js.map +1 -1
- package/dist/config/validators/NavigationSchema.d.ts +10 -2
- package/dist/config/validators/NavigationSchema.js +7 -0
- package/dist/config/validators/NavigationSchema.js.map +1 -1
- package/dist/flat-config.d.ts +11 -0
- package/dist/lib/components/MobileTopNavigation.js +2 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +7 -1
- package/dist/lib/components/TopNavigation.js +7 -2
- package/dist/lib/components/TopNavigation.js.map +1 -1
- package/dist/lib/components/context/ZudokuContext.d.ts +8 -1
- package/dist/lib/components/context/ZudokuContext.js +2 -0
- package/dist/lib/components/context/ZudokuContext.js.map +1 -1
- package/dist/lib/components/navigation/Navigation.js +4 -3
- package/dist/lib/components/navigation/Navigation.js.map +1 -1
- package/dist/lib/components/navigation/NavigationCategory.js +8 -0
- package/dist/lib/components/navigation/NavigationCategory.js.map +1 -1
- package/dist/lib/components/navigation/NavigationFilterContext.d.ts +8 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js +12 -0
- package/dist/lib/components/navigation/NavigationFilterContext.js.map +1 -0
- package/dist/lib/components/navigation/NavigationFilterInput.d.ts +3 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js +9 -0
- package/dist/lib/components/navigation/NavigationFilterInput.js.map +1 -0
- package/dist/lib/components/navigation/NavigationItem.js +11 -1
- package/dist/lib/components/navigation/NavigationItem.js.map +1 -1
- package/dist/lib/components/navigation/utils.d.ts +2 -1
- package/dist/lib/components/navigation/utils.js +22 -1
- package/dist/lib/components/navigation/utils.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/fileUtils.d.ts +1 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js +3 -0
- package/dist/lib/plugins/openapi/playground/fileUtils.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.d.ts +6 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js +20 -0
- package/dist/lib/plugins/openapi/playground/result-panel/AudioPlayer.js.map +1 -0
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js +7 -2
- package/dist/lib/plugins/openapi/playground/result-panel/ResponseTab.js.map +1 -1
- package/dist/lib/ui/InputGroup.d.ts +16 -0
- package/dist/lib/ui/InputGroup.js +65 -0
- package/dist/lib/ui/InputGroup.js.map +1 -0
- package/lib/{ClaudeLogo-C6q-Xn_l.js → ClaudeLogo-OpUSMQJe.js} +3 -3
- package/lib/{ClaudeLogo-C6q-Xn_l.js.map → ClaudeLogo-OpUSMQJe.js.map} +1 -1
- package/lib/{MdxPage-B1G4W1TK.js → MdxPage-dzCPGdvD.js} +6 -6
- package/lib/{MdxPage-B1G4W1TK.js.map → MdxPage-dzCPGdvD.js.map} +1 -1
- package/lib/{Mermaid-B1xNo-pf.js → Mermaid-JEnWyK0s.js} +2 -2
- package/lib/{Mermaid-B1xNo-pf.js.map → Mermaid-JEnWyK0s.js.map} +1 -1
- package/lib/{OAuthErrorPage-01Ke086W.js → OAuthErrorPage-D7n-_cqN.js} +5 -5
- package/lib/{OAuthErrorPage-01Ke086W.js.map → OAuthErrorPage-D7n-_cqN.js.map} +1 -1
- package/lib/{OasProvider-oHPiMJZg.js → OasProvider-DPPdikt_.js} +3 -3
- package/lib/{OasProvider-oHPiMJZg.js.map → OasProvider-DPPdikt_.js.map} +1 -1
- package/lib/{OperationList-CZ4OK8Pm.js → OperationList-cEveQ_l5.js} +12 -13
- package/lib/{OperationList-CZ4OK8Pm.js.map → OperationList-cEveQ_l5.js.map} +1 -1
- package/lib/{RouteGuard-B1lCR0C_.js → RouteGuard-BMbu_Yb7.js} +3 -3
- package/lib/{RouteGuard-B1lCR0C_.js.map → RouteGuard-BMbu_Yb7.js.map} +1 -1
- package/lib/{SchemaList-DoQFkJgM.js → SchemaList-CRC8n5co.js} +6 -6
- package/lib/{SchemaList-DoQFkJgM.js.map → SchemaList-CRC8n5co.js.map} +1 -1
- package/lib/{SchemaView-D2k6ZJck.js → SchemaView-BR6dtnPg.js} +3 -3
- package/lib/{SchemaView-D2k6ZJck.js.map → SchemaView-BR6dtnPg.js.map} +1 -1
- package/lib/{SignUp-8kDBaLbO.js → SignUp-ChqXj9vd.js} +4 -4
- package/lib/{SignUp-8kDBaLbO.js.map → SignUp-ChqXj9vd.js.map} +1 -1
- package/lib/{SyntaxHighlight-hZOFnYl0.js → SyntaxHighlight-O-IZOPLg.js} +2 -2
- package/lib/{SyntaxHighlight-hZOFnYl0.js.map → SyntaxHighlight-O-IZOPLg.js.map} +1 -1
- package/lib/{Toc-qEIii_-W.js → Toc-DQF7trHT.js} +2 -2
- package/lib/{Toc-qEIii_-W.js.map → Toc-DQF7trHT.js.map} +1 -1
- package/lib/{Zudoku-DUsdmPME.js → Zudoku-DA1yA-te.js} +2719 -2544
- package/lib/Zudoku-DA1yA-te.js.map +1 -0
- package/lib/{ZudokuContext-BBI06sOx.js → ZudokuContext-C6wlLMUH.js} +136 -134
- package/lib/{ZudokuContext-BBI06sOx.js.map → ZudokuContext-C6wlLMUH.js.map} +1 -1
- package/lib/{circular-D9tSKG2c.js → circular-C4l1Kj1N.js} +2 -2
- package/lib/{circular-D9tSKG2c.js.map → circular-C4l1Kj1N.js.map} +1 -1
- package/lib/{createServer-BprC4n85.js → createServer-DoRZ6tMa.js} +4 -4
- package/lib/{createServer-BprC4n85.js.map → createServer-DoRZ6tMa.js.map} +1 -1
- package/lib/{errors-7hgPDs1h.js → errors-CYLN8SNc.js} +2 -2
- package/lib/{errors-7hgPDs1h.js.map → errors-CYLN8SNc.js.map} +1 -1
- package/lib/{firebase-Dwn-2ju-.js → firebase-DF-VVKB7.js} +13 -13
- package/lib/{firebase-Dwn-2ju-.js.map → firebase-DF-VVKB7.js.map} +1 -1
- package/lib/{hook-ZEd1Es7D.js → hook-C35h0YhF.js} +2 -2
- package/lib/{hook-ZEd1Es7D.js.map → hook-C35h0YhF.js.map} +1 -1
- package/lib/{index-CyIW9rHv.js → index-Ck4TmzTO.js} +653 -619
- package/lib/index-Ck4TmzTO.js.map +1 -0
- package/lib/{index-Dxdhrp-I.js → index-DrAVvbXa.js} +2 -2
- package/lib/{index-Dxdhrp-I.js.map → index-DrAVvbXa.js.map} +1 -1
- package/lib/{index.esm-DG4KaDKR.js → index.esm-B2cLXwjS.js} +2 -2
- package/lib/index.esm-B2cLXwjS.js.map +1 -0
- package/lib/ui/InputGroup.js +155 -0
- package/lib/ui/InputGroup.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +2 -2
- package/lib/zudoku.__internal.js +368 -368
- 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 +3 -3
- package/lib/zudoku.hooks.js +3 -3
- package/lib/zudoku.mermaid.js +2 -2
- package/lib/zudoku.plugin-api-catalog.js +3 -3
- package/lib/zudoku.plugin-api-keys.js +4 -4
- 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 +2 -2
- package/package.json +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +13 -8
- package/src/lib/components/TopNavigation.tsx +25 -7
- package/src/lib/components/context/ZudokuContext.ts +1 -0
- package/src/lib/components/navigation/Navigation.tsx +4 -3
- package/src/lib/components/navigation/NavigationCategory.tsx +9 -0
- package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -0
- package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -0
- package/src/lib/components/navigation/NavigationItem.tsx +17 -1
- package/src/lib/components/navigation/utils.ts +32 -1
- package/src/lib/plugins/openapi/playground/fileUtils.ts +4 -0
- package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -0
- package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +33 -17
- package/src/lib/ui/InputGroup.tsx +168 -0
- package/lib/Separator-BXt1LYnm.js +0 -27
- package/lib/Separator-BXt1LYnm.js.map +0 -1
- package/lib/Zudoku-DUsdmPME.js.map +0 -1
- package/lib/index-CyIW9rHv.js.map +0 -1
- package/lib/index.esm-DG4KaDKR.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 "./Zudoku-
|
|
3
|
+
import { E as I } from "./Zudoku-DA1yA-te.js";
|
|
4
4
|
import { C as T } from "./ClientOnly-E7hGysn1.js";
|
|
5
|
-
import { j as S, b 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, b as h } from "./ZudokuContext-C6wlLMUH.js";
|
|
6
|
+
import { C, A as c } from "./errors-CYLN8SNc.js";
|
|
7
|
+
import { C as k, O as w } from "./OAuthErrorPage-D7n-_cqN.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 { b as r } from "./ZudokuContext-
|
|
3
|
+
import { S as p, a as f, b as h } from "./SignUp-ChqXj9vd.js";
|
|
4
|
+
import { b as r } from "./ZudokuContext-C6wlLMUH.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-DF-VVKB7.js";
|
|
3
3
|
import "./invariant-B_t_F2s_.js";
|
|
4
|
-
import "./errors-
|
|
5
|
-
import "./SignUp-
|
|
6
|
-
import "./ZudokuContext-
|
|
4
|
+
import "./errors-CYLN8SNc.js";
|
|
5
|
+
import "./SignUp-ChqXj9vd.js";
|
|
6
|
+
import "./ZudokuContext-C6wlLMUH.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 { g as Le } from "./invariant-B_t_F2s_.js";
|
|
3
|
-
import { E as Ue } from "./Zudoku-
|
|
3
|
+
import { E as Ue } from "./Zudoku-DA1yA-te.js";
|
|
4
4
|
import { C as xe } from "./ClientOnly-E7hGysn1.js";
|
|
5
|
-
import { j as Ce, b 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, b as S } from "./ZudokuContext-C6wlLMUH.js";
|
|
6
|
+
import { C as Ie, O as re, A as R } from "./errors-CYLN8SNc.js";
|
|
7
|
+
import { C as je, O as Oe } from "./OAuthErrorPage-D7n-_cqN.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 { b as u } from "./ZudokuContext-
|
|
3
|
+
import { C as m, A as h } from "./errors-CYLN8SNc.js";
|
|
4
|
+
import { S as f } from "./SignUp-ChqXj9vd.js";
|
|
5
|
+
import { b as u } from "./ZudokuContext-C6wlLMUH.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 "./Zudoku-
|
|
9
|
+
import { H as A } from "./Zudoku-DA1yA-te.js";
|
|
10
10
|
const c = ({
|
|
11
11
|
client: i,
|
|
12
12
|
config: e,
|
package/lib/zudoku.components.js
CHANGED
|
@@ -3,11 +3,11 @@ import { Button as s } from "./ui/Button.js";
|
|
|
3
3
|
import { Callout as u } from "./ui/Callout.js";
|
|
4
4
|
import { Z as m } from "./invariant-B_t_F2s_.js";
|
|
5
5
|
import { C as x } from "./ClientOnly-E7hGysn1.js";
|
|
6
|
-
import { H as C, M as d, S, a as h, T as k, Z as l } from "./Zudoku-
|
|
6
|
+
import { H as C, M as d, S, a as h, T as k, Z as l } from "./Zudoku-DA1yA-te.js";
|
|
7
7
|
import { S as Z } from "./Spinner-CI6bRyZw.js";
|
|
8
8
|
import { z as y } from "./index-DAWHN3cH.js";
|
|
9
|
-
import { u as M } from "./hook-
|
|
10
|
-
import { C as c, u as g, a as A } from "./ZudokuContext-
|
|
9
|
+
import { u as M } from "./hook-C35h0YhF.js";
|
|
10
|
+
import { C as c, u as g, a as A } from "./ZudokuContext-C6wlLMUH.js";
|
|
11
11
|
import { L as w } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
12
12
|
import { u as B } from "./useExposedProps-CzTDfXfq.js";
|
|
13
13
|
export {
|
package/lib/zudoku.hooks.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { z as C } from "./index-DAWHN3cH.js";
|
|
2
|
-
import { u as D } from "./hook-
|
|
3
|
-
import { a as n } from "./ZudokuContext-
|
|
4
|
-
import { C as z, u as A } from "./ZudokuContext-
|
|
2
|
+
import { u as D } from "./hook-C35h0YhF.js";
|
|
3
|
+
import { a as n } from "./ZudokuContext-C6wlLMUH.js";
|
|
4
|
+
import { C as z, u as A } from "./ZudokuContext-C6wlLMUH.js";
|
|
5
5
|
import { a as S, u as v } from "./useExposedProps-CzTDfXfq.js";
|
|
6
6
|
import { useState as f, useEffect as m } from "react";
|
|
7
7
|
function E(t, e) {
|
package/lib/zudoku.mermaid.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import "./useSuspenseQuery-CSB_rVek.js";
|
|
3
3
|
import "react";
|
|
4
|
-
import { M } from "./Mermaid-
|
|
4
|
+
import { M } from "./Mermaid-JEnWyK0s.js";
|
|
5
5
|
import "./index-DAWHN3cH.js";
|
|
6
|
-
import "./ZudokuContext-
|
|
6
|
+
import "./ZudokuContext-C6wlLMUH.js";
|
|
7
7
|
import "./Spinner-CI6bRyZw.js";
|
|
8
8
|
export {
|
|
9
9
|
M as Mermaid
|
|
@@ -1,13 +1,13 @@
|
|
|
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-DrAVvbXa.js";
|
|
3
3
|
import { c as b, L as j, m as x } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
4
|
-
import { b as v, j as p } from "./ZudokuContext-
|
|
4
|
+
import { b as v, j as p } from "./ZudokuContext-C6wlLMUH.js";
|
|
5
5
|
import { u as y } from "./useSuspenseQuery-CSB_rVek.js";
|
|
6
6
|
import { H as N } from "./index.esm-Ca5zvoff.js";
|
|
7
7
|
import "./ui/Button.js";
|
|
8
8
|
import "lucide-react";
|
|
9
9
|
import "react";
|
|
10
|
-
import { H as k, M as S } from "./Zudoku-
|
|
10
|
+
import { H as k, M as S } from "./Zudoku-DA1yA-te.js";
|
|
11
11
|
import "./index-DAWHN3cH.js";
|
|
12
12
|
const w = ({
|
|
13
13
|
items: n,
|
|
@@ -3,13 +3,13 @@ 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-B_t_F2s_.js";
|
|
4
4
|
import * as F from "react";
|
|
5
5
|
import { createContext as Q, useRef as A, useLayoutEffect as Ce, useEffect as re, 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 Ke,
|
|
6
|
+
import { D as Ke, d as be, a as te, E as De } from "./Zudoku-DA1yA-te.js";
|
|
7
7
|
import { Button as _ } from "./ui/Button.js";
|
|
8
|
-
import { a as B } from "./ZudokuContext-
|
|
8
|
+
import { a as B } from "./ZudokuContext-C6wlLMUH.js";
|
|
9
9
|
import "./index-DAWHN3cH.js";
|
|
10
|
-
import { u as ae } from "./hook-
|
|
10
|
+
import { u as ae } from "./hook-C35h0YhF.js";
|
|
11
11
|
import { F as Pe, g as Ae, j as Se, h as Re, d as Ne, I as Oe, a as Te, b as qe, k as Me, c as Fe } from "./Frame-DKlOmSkU.js";
|
|
12
|
-
import { A as D, a as P, b as oe } from "./Mermaid-
|
|
12
|
+
import { A as D, a as P, b as oe } from "./Mermaid-JEnWyK0s.js";
|
|
13
13
|
import { e as Z, f as S, D as G, g as J, a as Y, b as U, c as W, d as le } from "./Dialog-hlvmmQ_c.js";
|
|
14
14
|
import { a as ce, u as $e } from "./useSuspenseQuery-CSB_rVek.js";
|
|
15
15
|
import { u as q } from "./useMutation-CFMGlAMW.js";
|
|
@@ -4,7 +4,7 @@ const p = (t) => ({
|
|
|
4
4
|
([e, a]) => ({
|
|
5
5
|
path: e,
|
|
6
6
|
lazy: async () => {
|
|
7
|
-
const { MdxPage: n } = await import("./MdxPage-
|
|
7
|
+
const { MdxPage: n } = await import("./MdxPage-dzCPGdvD.js"), { default: o, ...s } = await a();
|
|
8
8
|
return {
|
|
9
9
|
element: /* @__PURE__ */ r.jsx(
|
|
10
10
|
n,
|
|
@@ -2,8 +2,8 @@ import "./jsx-runtime-BzflLqGi.js";
|
|
|
2
2
|
import "lucide-react";
|
|
3
3
|
import "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
4
4
|
import "./ui/Button.js";
|
|
5
|
-
import "./ZudokuContext-
|
|
6
|
-
import { y as e, U as n, z as s } from "./index-
|
|
5
|
+
import "./ZudokuContext-C6wlLMUH.js";
|
|
6
|
+
import { y as e, U as n, z as s } from "./index-Ck4TmzTO.js";
|
|
7
7
|
export {
|
|
8
8
|
e as GetNavigationOperationsQuery,
|
|
9
9
|
n as UNTAGGED_PATH,
|
|
@@ -8,8 +8,8 @@ import { B as D } from "./Button-GUVe7pmt.js";
|
|
|
8
8
|
import { C as B, a as S, b as N, c as O, d as V, e as z } from "./Command-N6VujV30.js";
|
|
9
9
|
import { c as K } from "./Dialog-hlvmmQ_c.js";
|
|
10
10
|
import { cn as w } from "./ui/util.js";
|
|
11
|
-
import { j as E, b as G, a as L } from "./ZudokuContext-
|
|
12
|
-
import { S as U } from "./RouteGuard-
|
|
11
|
+
import { j as E, b as G, a as L } from "./ZudokuContext-C6wlLMUH.js";
|
|
12
|
+
import { S as U } from "./RouteGuard-BMbu_Yb7.js";
|
|
13
13
|
import { u as H, L as k } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
14
14
|
function h({ className: r, ...a }) {
|
|
15
15
|
return /* @__PURE__ */ e.jsx(
|
package/package.json
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
2
2
|
import { MenuIcon } from "lucide-react";
|
|
3
3
|
import { useState } from "react";
|
|
4
|
+
import { Separator } from "zudoku/ui/Separator.js";
|
|
4
5
|
import { Skeleton } from "zudoku/ui/Skeleton.js";
|
|
5
6
|
import { useAuth } from "../authentication/hook.js";
|
|
6
7
|
import {
|
|
@@ -43,7 +44,7 @@ export const MobileTopNavigation = () => {
|
|
|
43
44
|
<PageProgress />
|
|
44
45
|
</div>
|
|
45
46
|
<DrawerContent
|
|
46
|
-
className="lg:hidden h-
|
|
47
|
+
className="lg:hidden h-dvh end-0 start-auto w-[320px] rounded-none"
|
|
47
48
|
aria-describedby={undefined}
|
|
48
49
|
>
|
|
49
50
|
<div className="p-4 overflow-y-auto overscroll-none h-full flex flex-col justify-between">
|
|
@@ -84,13 +85,17 @@ export const MobileTopNavigation = () => {
|
|
|
84
85
|
)}
|
|
85
86
|
</ClientOnly>
|
|
86
87
|
)}
|
|
87
|
-
{filteredItems.map((item) =>
|
|
88
|
-
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
88
|
+
{filteredItems.map((item) =>
|
|
89
|
+
item.type === "separator" ? (
|
|
90
|
+
<Separator className="w-full" key={item.label} />
|
|
91
|
+
) : item.type !== "section" && item.type !== "filter" ? (
|
|
92
|
+
<li key={item.label}>
|
|
93
|
+
<button type="button" onClick={() => setDrawerOpen(false)}>
|
|
94
|
+
<TopNavItem {...item} />
|
|
95
|
+
</button>
|
|
96
|
+
</li>
|
|
97
|
+
) : null,
|
|
98
|
+
)}
|
|
94
99
|
{isAuthEnabled && isAuthenticated && accountItems.length > 0 && (
|
|
95
100
|
<ClientOnly
|
|
96
101
|
fallback={<Skeleton className="rounded-sm h-5 w-24 mr-4" />}
|
|
@@ -2,6 +2,7 @@ import { cx } from "class-variance-authority";
|
|
|
2
2
|
import { deepEqual } from "fast-equals";
|
|
3
3
|
import { Suspense } from "react";
|
|
4
4
|
import { NavLink, type NavLinkProps } from "react-router";
|
|
5
|
+
import { Separator } from "zudoku/ui/Separator.js";
|
|
5
6
|
import type { NavigationItem } from "../../config/validators/NavigationSchema.js";
|
|
6
7
|
import { useAuth } from "../authentication/hook.js";
|
|
7
8
|
import { joinUrl } from "../util/joinUrl.js";
|
|
@@ -24,11 +25,17 @@ export const TopNavigation = () => {
|
|
|
24
25
|
<div className="items-center justify-between px-8 h-(--top-nav-height) hidden lg:flex text-sm relative">
|
|
25
26
|
<nav className="text-sm">
|
|
26
27
|
<ul className="flex flex-row items-center gap-8">
|
|
27
|
-
{filteredItems.map((item) =>
|
|
28
|
-
|
|
29
|
-
<
|
|
30
|
-
|
|
31
|
-
|
|
28
|
+
{filteredItems.map((item) =>
|
|
29
|
+
item.type === "separator" ? (
|
|
30
|
+
<li key={item.label} className="-mx-4 h-7">
|
|
31
|
+
<Separator orientation="vertical" />
|
|
32
|
+
</li>
|
|
33
|
+
) : item.type !== "section" && item.type !== "filter" ? (
|
|
34
|
+
<li key={item.label + item.type}>
|
|
35
|
+
<TopNavItem {...item} />
|
|
36
|
+
</li>
|
|
37
|
+
) : null,
|
|
38
|
+
)}
|
|
32
39
|
</ul>
|
|
33
40
|
</nav>
|
|
34
41
|
<Slot.Target name="top-navigation-side" />
|
|
@@ -51,7 +58,11 @@ const getPathForItem = (item: NavigationItem): string => {
|
|
|
51
58
|
|
|
52
59
|
return (
|
|
53
60
|
traverseNavigationItem(item, (child) => {
|
|
54
|
-
if (
|
|
61
|
+
if (
|
|
62
|
+
child.type !== "category" &&
|
|
63
|
+
child.type !== "separator" &&
|
|
64
|
+
child.type !== "section"
|
|
65
|
+
) {
|
|
55
66
|
return getPathForItem(child);
|
|
56
67
|
}
|
|
57
68
|
}) ?? ""
|
|
@@ -59,6 +70,8 @@ const getPathForItem = (item: NavigationItem): string => {
|
|
|
59
70
|
}
|
|
60
71
|
case "custom-page":
|
|
61
72
|
return item.path;
|
|
73
|
+
default:
|
|
74
|
+
return "";
|
|
62
75
|
}
|
|
63
76
|
};
|
|
64
77
|
|
|
@@ -97,7 +110,12 @@ export const TopNavLink = ({
|
|
|
97
110
|
);
|
|
98
111
|
};
|
|
99
112
|
|
|
100
|
-
export const TopNavItem = (
|
|
113
|
+
export const TopNavItem = (
|
|
114
|
+
item: Exclude<
|
|
115
|
+
NavigationItem,
|
|
116
|
+
{ type: "separator" } | { type: "section" } | { type: "filter" }
|
|
117
|
+
>,
|
|
118
|
+
) => {
|
|
101
119
|
const currentNav = useCurrentNavigation();
|
|
102
120
|
const isActiveTopNavItem = deepEqual(currentNav.topNavItem, item);
|
|
103
121
|
|
|
@@ -77,6 +77,7 @@ export const useCurrentNavigation = () => {
|
|
|
77
77
|
const location = useLocation();
|
|
78
78
|
|
|
79
79
|
const navItem = traverseNavigation(navigation, (item, parentCategories) => {
|
|
80
|
+
if (item.type === "link") return;
|
|
80
81
|
if (getItemPath(item) === location.pathname) {
|
|
81
82
|
return parentCategories.at(0) ?? item;
|
|
82
83
|
}
|
|
@@ -2,6 +2,7 @@ import { VisuallyHidden } from "@radix-ui/react-visually-hidden";
|
|
|
2
2
|
import type { NavigationItem as NavigationItemType } from "../../../config/validators/NavigationSchema.js";
|
|
3
3
|
import { DrawerContent, DrawerTitle } from "../../ui/Drawer.js";
|
|
4
4
|
import { Slot } from "../Slot.js";
|
|
5
|
+
import { NavigationFilterProvider } from "./NavigationFilterContext.js";
|
|
5
6
|
import { NavigationItem } from "./NavigationItem.js";
|
|
6
7
|
import { NavigationWrapper } from "./NavigationWrapper.js";
|
|
7
8
|
|
|
@@ -12,7 +13,7 @@ export const Navigation = ({
|
|
|
12
13
|
onRequestClose?: () => void;
|
|
13
14
|
navigation: NavigationItemType[];
|
|
14
15
|
}) => (
|
|
15
|
-
|
|
16
|
+
<NavigationFilterProvider>
|
|
16
17
|
<NavigationWrapper>
|
|
17
18
|
<Slot.Target name="navigation-before" />
|
|
18
19
|
{navigation.map((item) => (
|
|
@@ -30,7 +31,7 @@ export const Navigation = ({
|
|
|
30
31
|
<Slot.Target name="navigation-after" />
|
|
31
32
|
</NavigationWrapper>
|
|
32
33
|
<DrawerContent
|
|
33
|
-
className="lg:hidden h-
|
|
34
|
+
className="lg:hidden h-dvh start-0 w-[320px] rounded-none"
|
|
34
35
|
aria-describedby={undefined}
|
|
35
36
|
>
|
|
36
37
|
<div className="p-4 overflow-y-auto overscroll-none">
|
|
@@ -46,5 +47,5 @@ export const Navigation = ({
|
|
|
46
47
|
))}
|
|
47
48
|
</div>
|
|
48
49
|
</DrawerContent>
|
|
49
|
-
|
|
50
|
+
</NavigationFilterProvider>
|
|
50
51
|
);
|
|
@@ -7,6 +7,7 @@ import { Button } from "zudoku/ui/Button.js";
|
|
|
7
7
|
import type { NavigationCategory as NavigationCategoryType } from "../../../config/validators/NavigationSchema.js";
|
|
8
8
|
import { cn } from "../../util/cn.js";
|
|
9
9
|
import { joinUrl } from "../../util/joinUrl.js";
|
|
10
|
+
import { useNavigationFilter } from "./NavigationFilterContext.js";
|
|
10
11
|
import { NavigationItem } from "./NavigationItem.js";
|
|
11
12
|
import { navigationListItem, useIsCategoryOpen } from "./utils.js";
|
|
12
13
|
|
|
@@ -20,6 +21,7 @@ const NavigationCategoryInner = ({
|
|
|
20
21
|
const isCategoryOpen = useIsCategoryOpen(category);
|
|
21
22
|
const [hasInteracted, setHasInteracted] = useState(false);
|
|
22
23
|
const location = useLocation();
|
|
24
|
+
const { query: filterQuery } = useNavigationFilter();
|
|
23
25
|
|
|
24
26
|
const isCollapsible = category.collapsible ?? true;
|
|
25
27
|
const isCollapsed = category.collapsed ?? true;
|
|
@@ -37,6 +39,13 @@ const NavigationCategoryInner = ({
|
|
|
37
39
|
}
|
|
38
40
|
}, [isCategoryOpen]);
|
|
39
41
|
|
|
42
|
+
// Auto-expand when there's an active filter query
|
|
43
|
+
useEffect(() => {
|
|
44
|
+
if (filterQuery.trim()) {
|
|
45
|
+
setOpen(true);
|
|
46
|
+
}
|
|
47
|
+
}, [filterQuery]);
|
|
48
|
+
|
|
40
49
|
const ToggleButton = isCollapsible && (
|
|
41
50
|
<Button
|
|
42
51
|
onClick={(e) => {
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import {
|
|
2
|
+
createContext,
|
|
3
|
+
type PropsWithChildren,
|
|
4
|
+
useContext,
|
|
5
|
+
useState,
|
|
6
|
+
} from "react";
|
|
7
|
+
|
|
8
|
+
type NavigationFilterContextType = {
|
|
9
|
+
query: string;
|
|
10
|
+
setQuery: (query: string) => void;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const NavigationFilterContext = createContext<NavigationFilterContextType>({
|
|
14
|
+
query: "",
|
|
15
|
+
setQuery: () => {},
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
export const NavigationFilterProvider = ({ children }: PropsWithChildren) => {
|
|
19
|
+
const [query, setQuery] = useState("");
|
|
20
|
+
|
|
21
|
+
return (
|
|
22
|
+
<NavigationFilterContext.Provider value={{ query, setQuery }}>
|
|
23
|
+
{children}
|
|
24
|
+
</NavigationFilterContext.Provider>
|
|
25
|
+
);
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
export const useNavigationFilter = () => useContext(NavigationFilterContext);
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { SearchIcon, XIcon } from "lucide-react";
|
|
2
|
+
import {
|
|
3
|
+
InputGroup,
|
|
4
|
+
InputGroupAddon,
|
|
5
|
+
InputGroupButton,
|
|
6
|
+
InputGroupInput,
|
|
7
|
+
} from "zudoku/ui/InputGroup.js";
|
|
8
|
+
import { useNavigationFilter } from "./NavigationFilterContext.js";
|
|
9
|
+
|
|
10
|
+
export const NavigationFilterInput = ({
|
|
11
|
+
placeholder,
|
|
12
|
+
}: {
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
}) => {
|
|
15
|
+
const { query, setQuery } = useNavigationFilter();
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<InputGroup className="my-2">
|
|
19
|
+
<InputGroupAddon>
|
|
20
|
+
<SearchIcon className="size-3.5" />
|
|
21
|
+
</InputGroupAddon>
|
|
22
|
+
<InputGroupInput
|
|
23
|
+
type="text"
|
|
24
|
+
placeholder={placeholder}
|
|
25
|
+
value={query}
|
|
26
|
+
onChange={(e) => setQuery(e.target.value)}
|
|
27
|
+
/>
|
|
28
|
+
{query && (
|
|
29
|
+
<InputGroupButton onClick={() => setQuery("")}>
|
|
30
|
+
<XIcon className="size-3" />
|
|
31
|
+
</InputGroupButton>
|
|
32
|
+
)}
|
|
33
|
+
</InputGroup>
|
|
34
|
+
);
|
|
35
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { ExternalLinkIcon } from "lucide-react";
|
|
2
2
|
import { useEffect, useRef, useState } from "react";
|
|
3
3
|
import { NavLink, useLocation } from "react-router";
|
|
4
|
+
import { Separator } from "zudoku/ui/Separator.js";
|
|
4
5
|
import { Tooltip, TooltipContent, TooltipTrigger } from "zudoku/ui/Tooltip.js";
|
|
5
6
|
import type { NavigationItem as NavigationItemType } from "../../../config/validators/NavigationSchema.js";
|
|
6
7
|
import { useAuth } from "../../authentication/hook.js";
|
|
@@ -11,6 +12,8 @@ import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
|
|
|
11
12
|
import { useZudoku } from "../context/ZudokuContext.js";
|
|
12
13
|
import { NavigationBadge } from "./NavigationBadge.js";
|
|
13
14
|
import { NavigationCategory } from "./NavigationCategory.js";
|
|
15
|
+
import { useNavigationFilter } from "./NavigationFilterContext.js";
|
|
16
|
+
import { NavigationFilterInput } from "./NavigationFilterInput.js";
|
|
14
17
|
import { navigationListItem, shouldShowItem } from "./utils.js";
|
|
15
18
|
|
|
16
19
|
const TruncatedLabel = ({
|
|
@@ -65,8 +68,9 @@ export const NavigationItem = ({
|
|
|
65
68
|
const { activeAnchor } = useViewportAnchor();
|
|
66
69
|
const auth = useAuth();
|
|
67
70
|
const context = useZudoku();
|
|
71
|
+
const { query } = useNavigationFilter();
|
|
68
72
|
|
|
69
|
-
if (!shouldShowItem(auth, context)(item)) {
|
|
73
|
+
if (!shouldShowItem(auth, context, query)(item)) {
|
|
70
74
|
return null;
|
|
71
75
|
}
|
|
72
76
|
|
|
@@ -75,6 +79,18 @@ export const NavigationItem = ({
|
|
|
75
79
|
return (
|
|
76
80
|
<NavigationCategory category={item} onRequestClose={onRequestClose} />
|
|
77
81
|
);
|
|
82
|
+
case "separator":
|
|
83
|
+
return (
|
|
84
|
+
<Separator className="my-1 mx-auto w-[calc(100%-var(--padding-nav-item)*2)]!" />
|
|
85
|
+
);
|
|
86
|
+
case "section":
|
|
87
|
+
return (
|
|
88
|
+
<div className="mt-4 px-(--padding-nav-item) text-xs font-semibold text-muted-foreground uppercase tracking-wider">
|
|
89
|
+
{item.label}
|
|
90
|
+
</div>
|
|
91
|
+
);
|
|
92
|
+
case "filter":
|
|
93
|
+
return <NavigationFilterInput placeholder={item.placeholder} />;
|
|
78
94
|
case "doc":
|
|
79
95
|
return (
|
|
80
96
|
<NavLink
|
|
@@ -86,6 +86,13 @@ export const usePrevNext = (): {
|
|
|
86
86
|
let foundCurrent = false;
|
|
87
87
|
|
|
88
88
|
traverseNavigation(navigation, (item) => {
|
|
89
|
+
if (
|
|
90
|
+
item.type === "separator" ||
|
|
91
|
+
item.type === "section" ||
|
|
92
|
+
item.type === "filter"
|
|
93
|
+
)
|
|
94
|
+
return;
|
|
95
|
+
|
|
89
96
|
const itemId =
|
|
90
97
|
item.type === "doc"
|
|
91
98
|
? joinUrl(item.path)
|
|
@@ -133,9 +140,33 @@ export const navigationListItem = cva(
|
|
|
133
140
|
},
|
|
134
141
|
);
|
|
135
142
|
|
|
143
|
+
export const itemMatchesFilter = (
|
|
144
|
+
item: NavigationItem,
|
|
145
|
+
query: string,
|
|
146
|
+
): boolean => {
|
|
147
|
+
if (["separator", "section", "filter"].includes(item.type)) {
|
|
148
|
+
return true;
|
|
149
|
+
}
|
|
150
|
+
if (item.label?.toLowerCase().includes(query.toLowerCase())) {
|
|
151
|
+
return true;
|
|
152
|
+
}
|
|
153
|
+
|
|
154
|
+
if (item.type === "category") {
|
|
155
|
+
return item.items.some((child) => itemMatchesFilter(child, query));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
return false;
|
|
159
|
+
};
|
|
160
|
+
|
|
136
161
|
export const shouldShowItem =
|
|
137
|
-
(auth: UseAuthReturn, context: ZudokuContext) =>
|
|
162
|
+
(auth: UseAuthReturn, context: ZudokuContext, filterQuery?: string) =>
|
|
138
163
|
(item: NavigationItem): boolean => {
|
|
164
|
+
if (item.type === "filter") return true;
|
|
165
|
+
|
|
166
|
+
if (filterQuery?.trim() && !itemMatchesFilter(item, filterQuery)) {
|
|
167
|
+
return false;
|
|
168
|
+
}
|
|
169
|
+
|
|
139
170
|
if (typeof item.display === "function") {
|
|
140
171
|
return item.display({ context, auth });
|
|
141
172
|
}
|
|
@@ -4,6 +4,10 @@ export function isBinaryContentType(contentType: string) {
|
|
|
4
4
|
);
|
|
5
5
|
}
|
|
6
6
|
|
|
7
|
+
export function isAudioContentType(contentType: string) {
|
|
8
|
+
return /^audio\//i.test(contentType);
|
|
9
|
+
}
|
|
10
|
+
|
|
7
11
|
export const extractFileName = (
|
|
8
12
|
headers: Array<[string, string]>,
|
|
9
13
|
url: string,
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { DownloadIcon } from "lucide-react";
|
|
2
|
+
import { useEffect, useState } from "react";
|
|
3
|
+
import { Button } from "zudoku/ui/Button.js";
|
|
4
|
+
import { humanFileSize } from "../../../../util/humanFileSize.js";
|
|
5
|
+
|
|
6
|
+
export const AudioPlayer = ({
|
|
7
|
+
blob,
|
|
8
|
+
fileName,
|
|
9
|
+
size,
|
|
10
|
+
onDownload,
|
|
11
|
+
}: {
|
|
12
|
+
blob: Blob;
|
|
13
|
+
fileName: string;
|
|
14
|
+
size: number;
|
|
15
|
+
onDownload: () => void;
|
|
16
|
+
}) => {
|
|
17
|
+
const [audioUrl, setAudioUrl] = useState<string | null>(null);
|
|
18
|
+
|
|
19
|
+
useEffect(() => {
|
|
20
|
+
const url = URL.createObjectURL(blob);
|
|
21
|
+
setAudioUrl(url);
|
|
22
|
+
|
|
23
|
+
return () => {
|
|
24
|
+
URL.revokeObjectURL(url);
|
|
25
|
+
};
|
|
26
|
+
}, [blob]);
|
|
27
|
+
|
|
28
|
+
if (!audioUrl) {
|
|
29
|
+
return (
|
|
30
|
+
<div className="p-4 text-center">
|
|
31
|
+
<div className="text-sm text-muted-foreground">Loading audio...</div>
|
|
32
|
+
</div>
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
return (
|
|
37
|
+
<div className="p-4 text-center">
|
|
38
|
+
<div className="flex flex-col items-center gap-4">
|
|
39
|
+
{/* biome-ignore lint/a11y/useMediaCaption: API response audio cannot have predefined captions */}
|
|
40
|
+
<audio controls src={audioUrl} className="w-full max-w-md">
|
|
41
|
+
Your browser does not support the audio element.
|
|
42
|
+
</audio>
|
|
43
|
+
<Button onClick={onDownload} className="flex items-center gap-2">
|
|
44
|
+
<DownloadIcon className="h-4 w-4" />
|
|
45
|
+
Download {fileName} ({humanFileSize(size)})
|
|
46
|
+
</Button>
|
|
47
|
+
</div>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
};
|