zudoku 0.1.1-dev.43 → 0.1.1-dev.44
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/lib/components/Layout.js +2 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Spinner.d.ts +3 -0
- package/dist/lib/components/Spinner.js +4 -0
- package/dist/lib/components/Spinner.js.map +1 -0
- package/dist/lib/components/navigation/SideNavigation.js +1 -1
- package/dist/lib/components/navigation/SideNavigation.js.map +1 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.d.ts +1 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.js +1 -1
- package/dist/lib/components/navigation/SideNavigationWrapper.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +2 -0
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +3 -2
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/lib/{util-CnHdxZvn.js → Spinner-Zry2k_pD.js} +278 -268
- package/lib/zudoku.components.js +91 -85
- package/lib/zudoku.plugins.js +127 -135
- package/package.json +1 -1
- package/src/lib/components/Layout.tsx +9 -3
- package/src/lib/components/Spinner.tsx +5 -0
- package/src/lib/components/navigation/SideNavigation.tsx +1 -1
- package/src/lib/components/navigation/SideNavigationWrapper.tsx +7 -3
- package/src/lib/plugins/openapi/OperationList.tsx +3 -0
- package/src/lib/plugins/openapi/playground/Playground.tsx +2 -1
package/package.json
CHANGED
|
@@ -7,7 +7,7 @@ import { Header } from "./Header.js";
|
|
|
7
7
|
import { useDevPortal } from "./context/DevPortalProvider.js";
|
|
8
8
|
import { useViewportAnchor } from "./context/ViewportAnchorContext.js";
|
|
9
9
|
import { SideNavigation } from "./navigation/SideNavigation.js";
|
|
10
|
-
import {
|
|
10
|
+
import { Spinner } from "./Spinner.js";
|
|
11
11
|
|
|
12
12
|
export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
13
13
|
const location = useLocation();
|
|
@@ -42,8 +42,14 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
42
42
|
</Helmet>
|
|
43
43
|
<Header />
|
|
44
44
|
|
|
45
|
-
<div className="max-w-screen-2xl mx-auto pt-[--header-height] px-10 lg:px-12">
|
|
46
|
-
<Suspense
|
|
45
|
+
<div className="max-w-screen-2xl mx-auto pt-[--header-height] px-10 lg:px-12 h-full">
|
|
46
|
+
<Suspense
|
|
47
|
+
fallback={
|
|
48
|
+
<div className="grid h-full place-items-center">
|
|
49
|
+
<Spinner />
|
|
50
|
+
</div>
|
|
51
|
+
}
|
|
52
|
+
>
|
|
47
53
|
<SideNavigation />
|
|
48
54
|
<main
|
|
49
55
|
className="dark:border-white/10 translate-x-0
|
|
@@ -11,7 +11,7 @@ export const SideNavigation = () => {
|
|
|
11
11
|
return (
|
|
12
12
|
<SideNavigationWrapper
|
|
13
13
|
ref={navRef}
|
|
14
|
-
|
|
14
|
+
pushMainContent={navigation.data.items.length > 0}
|
|
15
15
|
>
|
|
16
16
|
{navigation.data.items.map((category) => (
|
|
17
17
|
<SideNavigationCategory key={category.label} category={category} />
|
|
@@ -3,10 +3,14 @@ import { cn } from "../../util/cn.js";
|
|
|
3
3
|
|
|
4
4
|
export const SideNavigationWrapper = forwardRef<
|
|
5
5
|
HTMLDivElement,
|
|
6
|
-
PropsWithChildren<{
|
|
7
|
-
>(({ children, className,
|
|
6
|
+
PropsWithChildren<{ pushMainContent?: boolean; className?: string }>
|
|
7
|
+
>(({ children, className, pushMainContent }, ref) => (
|
|
8
8
|
<nav
|
|
9
|
-
data
|
|
9
|
+
// this data attribute is used in `Layout.tsx` to determine if side navigation
|
|
10
|
+
// is present for the current page so the main content is pushed to the right
|
|
11
|
+
// it's also important to set `peer` class here.
|
|
12
|
+
// maybe this could be simplified by adjusting the layout
|
|
13
|
+
data-navigation={String(pushMainContent)}
|
|
10
14
|
className={cn(
|
|
11
15
|
"peer hidden lg:flex flex-col fixed text-sm overflow-y-auto shrink-0 p-[--padding-nav-item] -mx-[--padding-nav-item] pb-20 pt-[--padding-content-top] w-[--side-nav-width] h-[calc(100%-var(--header-height))] scroll-pt-2 gap-2",
|
|
12
16
|
className,
|
|
@@ -72,12 +72,15 @@ const AllOperationsQuery = graphql(/* GraphQL */ `
|
|
|
72
72
|
}
|
|
73
73
|
`);
|
|
74
74
|
|
|
75
|
+
const suspenseContext = { suspense: true };
|
|
76
|
+
|
|
75
77
|
export const OperationList = () => {
|
|
76
78
|
const { type, input } = useOasConfig();
|
|
77
79
|
|
|
78
80
|
const [result] = useQuery({
|
|
79
81
|
query: AllOperationsQuery,
|
|
80
82
|
variables: { type, input },
|
|
83
|
+
context: suspenseContext,
|
|
81
84
|
});
|
|
82
85
|
|
|
83
86
|
if (!result.data) return null;
|
|
@@ -21,6 +21,7 @@ import { CirclePlayIcon, LoaderCircle, MonitorCheckIcon } from "lucide-react";
|
|
|
21
21
|
import { createUrl } from "./createUrl.js";
|
|
22
22
|
import { UrlDisplay } from "./UrlDisplay.js";
|
|
23
23
|
import { useApiIdentities } from "../../../components/context/DevPortalProvider.js";
|
|
24
|
+
import { Spinner } from "../../../components/Spinner.js";
|
|
24
25
|
|
|
25
26
|
function mimeTypeToLanguage(mimeType: string) {
|
|
26
27
|
const mimeTypeMapping = {
|
|
@@ -305,7 +306,7 @@ const Playground = ({
|
|
|
305
306
|
<div className="grid place-items-center h-full">
|
|
306
307
|
<span className="text-[16px] font-semibold text-muted-foreground">
|
|
307
308
|
{queryMutation.isPending ? (
|
|
308
|
-
<
|
|
309
|
+
<Spinner />
|
|
309
310
|
) : (
|
|
310
311
|
"Send a request first to see the response here"
|
|
311
312
|
)}
|