zudoku 0.1.1-dev.12 → 0.1.1-dev.14
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/app/main.css +137 -0
- package/dist/config/config.d.ts +0 -1
- package/dist/vite/build.js +2 -8
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +7 -3
- package/dist/vite/config.js +15 -14
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/dev-server.js +7 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/plugin-api.js +1 -1
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +1 -2
- package/dist/vite/plugin-auth.js.map +1 -1
- package/dist/vite/plugin-docs.js +1 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +0 -1
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/package.json +9 -3
- package/src/app/App.tsx +30 -0
- package/src/app/DevPortal.tsx +93 -0
- package/src/app/Heading.tsx +60 -0
- package/src/app/Router.tsx +28 -0
- package/src/app/authentication/authentication.ts +18 -0
- package/src/app/authentication/clerk.ts +47 -0
- package/src/app/authentication/openid.ts +192 -0
- package/src/app/components/AnchorLink.tsx +19 -0
- package/src/app/components/CategoryHeading.tsx +16 -0
- package/src/app/components/Dialog.tsx +119 -0
- package/src/app/components/DynamicIcon.tsx +60 -0
- package/src/app/components/Header.tsx +69 -0
- package/src/app/components/Input.tsx +24 -0
- package/src/app/components/Layout.tsx +56 -0
- package/src/app/components/Markdown.tsx +37 -0
- package/src/app/components/SyntaxHighlight.tsx +94 -0
- package/src/app/components/TopNavigation.tsx +32 -0
- package/src/app/components/context/ComponentsContext.tsx +24 -0
- package/src/app/components/context/DevPortalProvider.ts +54 -0
- package/src/app/components/context/PluginSystem.ts +0 -0
- package/src/app/components/context/ThemeContext.tsx +46 -0
- package/src/app/components/context/ViewportAnchorContext.tsx +139 -0
- package/src/app/components/navigation/SideNavigation.tsx +18 -0
- package/src/app/components/navigation/SideNavigationCategory.tsx +74 -0
- package/src/app/components/navigation/SideNavigationItem.tsx +143 -0
- package/src/app/components/navigation/SideNavigationWrapper.tsx +15 -0
- package/src/app/components/navigation/useNavigationCollapsibleState.ts +27 -0
- package/src/app/components/navigation/util.ts +38 -0
- package/src/app/core/DevPortalContext.ts +164 -0
- package/src/app/core/helmet.ts +5 -0
- package/src/app/core/icons.tsx +1 -0
- package/src/app/core/plugins.ts +43 -0
- package/src/app/core/router.tsx +1 -0
- package/src/app/core/types/combine.ts +16 -0
- package/src/app/main.css +137 -0
- package/src/app/main.tsx +9 -0
- package/src/app/oas/graphql/index.ts +422 -0
- package/src/app/oas/graphql/server.ts +10 -0
- package/src/app/oas/parser/dereference/index.ts +59 -0
- package/src/app/oas/parser/dereference/resolveRef.ts +32 -0
- package/src/app/oas/parser/index.ts +94 -0
- package/src/app/oas/parser/schemas/v3.0.json +1489 -0
- package/src/app/oas/parser/schemas/v3.1.json +1298 -0
- package/src/app/oas/parser/upgrade/index.ts +108 -0
- package/src/app/plugins/api-key/SettingsApiKeys.tsx +22 -0
- package/src/app/plugins/api-key/index.tsx +123 -0
- package/src/app/plugins/markdown/MdxPage.tsx +128 -0
- package/src/app/plugins/markdown/Toc.tsx +122 -0
- package/src/app/plugins/markdown/generateRoutes.tsx +72 -0
- package/src/app/plugins/markdown/index.tsx +31 -0
- package/src/app/plugins/openapi/ColorizedParam.tsx +82 -0
- package/src/app/plugins/openapi/MakeRequest.tsx +49 -0
- package/src/app/plugins/openapi/MethodBadge.tsx +36 -0
- package/src/app/plugins/openapi/OperationList.tsx +117 -0
- package/src/app/plugins/openapi/OperationListItem.tsx +55 -0
- package/src/app/plugins/openapi/ParameterList.tsx +32 -0
- package/src/app/plugins/openapi/ParameterListItem.tsx +60 -0
- package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +51 -0
- package/src/app/plugins/openapi/ResponsesSidecarBox.tsx +60 -0
- package/src/app/plugins/openapi/Select.tsx +35 -0
- package/src/app/plugins/openapi/Sidecar.tsx +160 -0
- package/src/app/plugins/openapi/SidecarBox.tsx +36 -0
- package/src/app/plugins/openapi/graphql/fragment-masking.ts +111 -0
- package/src/app/plugins/openapi/graphql/gql.ts +70 -0
- package/src/app/plugins/openapi/graphql/graphql.ts +795 -0
- package/src/app/plugins/openapi/graphql/index.ts +2 -0
- package/src/app/plugins/openapi/index.tsx +142 -0
- package/src/app/plugins/openapi/playground/Playground.tsx +309 -0
- package/src/app/plugins/openapi/queries.graphql +6 -0
- package/src/app/plugins/openapi/util/generateSchemaExample.ts +59 -0
- package/src/app/plugins/openapi/util/urql.ts +8 -0
- package/src/app/plugins/openapi/worker/createSharedWorkerClient.ts +60 -0
- package/src/app/plugins/openapi/worker/worker.ts +30 -0
- package/src/app/plugins/redirect/index.tsx +20 -0
- package/src/app/tailwind.ts +72 -0
- package/src/app/ui/Button.tsx +56 -0
- package/src/app/ui/Callout.tsx +87 -0
- package/src/app/ui/Card.tsx +82 -0
- package/src/app/ui/Note.tsx +58 -0
- package/src/app/ui/Tabs.tsx +52 -0
- package/src/app/util/MdxComponents.tsx +70 -0
- package/src/app/util/cn.ts +6 -0
- package/src/app/util/createVariantComponent.tsx +30 -0
- package/src/app/util/createWaitForNotify.ts +18 -0
- package/src/app/util/groupBy.ts +24 -0
- package/src/app/util/joinPath.tsx +10 -0
- package/src/app/util/pastellize.ts +25 -0
- package/src/app/util/slugify.ts +3 -0
- package/src/app/util/traverseNavigation.ts +55 -0
- package/src/app/util/useScrollToAnchor.ts +38 -0
- package/src/app/util/useScrollToTop.ts +13 -0
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { useEffect } from "react";
|
|
2
|
+
import { useLocation } from "react-router-dom";
|
|
3
|
+
import { useViewportAnchor } from "../components/context/ViewportAnchorContext.js";
|
|
4
|
+
|
|
5
|
+
export const useScrollToAnchor = () => {
|
|
6
|
+
const location = useLocation();
|
|
7
|
+
const { setActiveAnchor } = useViewportAnchor();
|
|
8
|
+
|
|
9
|
+
useEffect(() => {
|
|
10
|
+
if (!location.hash) return;
|
|
11
|
+
|
|
12
|
+
const hash = location.hash.split("/")[0].slice(1);
|
|
13
|
+
|
|
14
|
+
const element = document.getElementById(decodeURIComponent(hash));
|
|
15
|
+
if (element) {
|
|
16
|
+
// on page navigation element might be in DOM but not yet scrollable, so wait for a frame
|
|
17
|
+
requestAnimationFrame(() => {
|
|
18
|
+
element.scrollIntoView();
|
|
19
|
+
requestIdleCallback(() => setActiveAnchor(hash));
|
|
20
|
+
});
|
|
21
|
+
return;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
// on page load, the element might not be available yet
|
|
25
|
+
const observer = new MutationObserver((_mutations, obs) => {
|
|
26
|
+
const element = document.getElementById(decodeURIComponent(hash));
|
|
27
|
+
if (!element) return;
|
|
28
|
+
|
|
29
|
+
element.scrollIntoView();
|
|
30
|
+
requestIdleCallback(() => setActiveAnchor(hash));
|
|
31
|
+
obs.disconnect();
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
observer.observe(document.body, { childList: true, subtree: true });
|
|
35
|
+
|
|
36
|
+
return () => observer.disconnect();
|
|
37
|
+
}, [location.hash, setActiveAnchor]);
|
|
38
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { useEffect, useRef } from "react";
|
|
2
|
+
import { useLocation } from "react-router-dom";
|
|
3
|
+
|
|
4
|
+
export const useScrollToTop = () => {
|
|
5
|
+
const location = useLocation();
|
|
6
|
+
const previousPath = useRef(location.pathname);
|
|
7
|
+
|
|
8
|
+
useEffect(() => {
|
|
9
|
+
if (previousPath.current === location.pathname) return;
|
|
10
|
+
window.scrollTo(0, 0);
|
|
11
|
+
previousPath.current = location.pathname;
|
|
12
|
+
}, [location.pathname]);
|
|
13
|
+
};
|