zudoku 0.3.0-dev.67 → 0.3.0-dev.68
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/context/ViewportAnchorContext.js +2 -1
- package/dist/lib/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/lib/plugins/markdown/Toc.js +2 -1
- package/dist/lib/plugins/markdown/Toc.js.map +1 -1
- package/dist/lib/plugins/openapi/StaggeredRender.js +3 -2
- package/dist/lib/plugins/openapi/StaggeredRender.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/QueryParams.js.map +1 -1
- package/dist/lib/util/requestIdle.d.ts +2 -0
- package/dist/lib/util/requestIdle.js +3 -0
- package/dist/lib/util/requestIdle.js.map +1 -0
- package/dist/lib/util/useScrollToAnchor.js +3 -2
- package/dist/lib/util/useScrollToAnchor.js.map +1 -1
- package/lib/{AnchorLink-C_pYhuZi.js → AnchorLink-61IZfWrS.js} +2 -2
- package/lib/{AnchorLink-C_pYhuZi.js.map → AnchorLink-61IZfWrS.js.map} +1 -1
- package/lib/{CategoryHeading-D5Q-X6lE.js → CategoryHeading-aW8CL0KA.js} +2 -2
- package/lib/{CategoryHeading-D5Q-X6lE.js.map → CategoryHeading-aW8CL0KA.js.map} +1 -1
- package/lib/{Combination-Cq0UkOXq.js → Combination-BbWKjDLe.js} +2 -2
- package/lib/{Combination-Cq0UkOXq.js.map → Combination-BbWKjDLe.js.map} +1 -1
- package/lib/{Input-DdAxw3vC.js → Input-BY0B_0qy.js} +3 -3
- package/lib/{Input-DdAxw3vC.js.map → Input-BY0B_0qy.js.map} +1 -1
- package/lib/{Markdown-DsCvZnhw.js → Markdown-BO5EsS-C.js} +748 -746
- package/lib/Markdown-BO5EsS-C.js.map +1 -0
- package/lib/{MdxPage-B_7x36CA.js → MdxPage-DEfyHwSx.js} +28 -28
- package/lib/MdxPage-DEfyHwSx.js.map +1 -0
- package/lib/{OperationList-C1YlOjB7.js → OperationList-VK1_1rzp.js} +10 -9
- package/lib/{OperationList-C1YlOjB7.js.map → OperationList-VK1_1rzp.js.map} +1 -1
- package/lib/{Spinner-DyDcSKPz.js → Spinner-6NfpF1CA.js} +56 -56
- package/lib/Spinner-6NfpF1CA.js.map +1 -0
- package/lib/{hook-Cz5jddRs.js → hook-gOGk1OUF.js} +4 -4
- package/lib/{hook-Cz5jddRs.js.map → hook-gOGk1OUF.js.map} +1 -1
- package/lib/{index-3RQC9Hni.js → index-7W7DUZbY.js} +4 -4
- package/lib/{index-3RQC9Hni.js.map → index-7W7DUZbY.js.map} +1 -1
- package/lib/zudoku.components.js +351 -351
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-api-keys.js +4 -4
- package/lib/zudoku.plugin-custom-page.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/package.json +1 -1
- package/src/lib/components/context/ViewportAnchorContext.tsx +2 -1
- package/src/lib/plugins/markdown/Toc.tsx +2 -1
- package/src/lib/plugins/openapi/StaggeredRender.tsx +3 -2
- package/src/lib/plugins/openapi/playground/Playground.tsx +2 -1
- package/src/lib/plugins/openapi/playground/QueryParams.tsx +1 -3
- package/src/lib/util/requestIdle.ts +4 -0
- package/src/lib/util/useScrollToAnchor.ts +3 -2
- package/lib/Markdown-DsCvZnhw.js.map +0 -1
- package/lib/MdxPage-B_7x36CA.js.map +0 -1
- package/lib/Spinner-DyDcSKPz.js.map +0 -1
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { b as f, j as e, O as j } from "./jsx-runtime-BIr0WBt_.js";
|
|
2
|
-
import { u as g, R as v } from "./hook-
|
|
3
|
-
import { u as w, a as p, I as b, S as k, b as K, c as N, d as E, e as A, f as h } from "./Input-
|
|
4
|
-
import { c as l, L as x, a as P } from "./Markdown-
|
|
2
|
+
import { u as g, R as v } from "./hook-gOGk1OUF.js";
|
|
3
|
+
import { u as w, a as p, I as b, S as k, b as K, c as N, d as E, e as A, f as h } from "./Input-BY0B_0qy.js";
|
|
4
|
+
import { c as l, L as x, a as P } from "./Markdown-BO5EsS-C.js";
|
|
5
5
|
import { u as m, x as S, y as I } from "./DevPortalProvider-BBhQ8kgI.js";
|
|
6
|
-
import { B as c, p as C } from "./Combination-
|
|
6
|
+
import { B as c, p as C } from "./Combination-BbWKjDLe.js";
|
|
7
7
|
import { useState as D } from "react";
|
|
8
8
|
/**
|
|
9
9
|
* @license lucide-react v0.378.0 - ISC
|
|
@@ -9,7 +9,7 @@ const f = (t, e) => {
|
|
|
9
9
|
return {
|
|
10
10
|
path: i.at(-1) === "index" ? i.slice(0, -1).join("/") : s,
|
|
11
11
|
lazy: async () => {
|
|
12
|
-
const { MdxPage: u } = await import("./MdxPage-
|
|
12
|
+
const { MdxPage: u } = await import("./MdxPage-DEfyHwSx.js"), { default: c, ...l } = await m();
|
|
13
13
|
return {
|
|
14
14
|
element: /* @__PURE__ */ o.jsx(
|
|
15
15
|
u,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./jsx-runtime-BIr0WBt_.js";
|
|
2
|
-
import { o as n } from "./index-
|
|
2
|
+
import { o as n } from "./index-7W7DUZbY.js";
|
|
3
3
|
import "./urql-DMlBWUKL.js";
|
|
4
4
|
import "zudoku/openapi-worker";
|
|
5
|
-
import "./Markdown-
|
|
5
|
+
import "./Markdown-BO5EsS-C.js";
|
|
6
6
|
import "./router-BiRCp01d.js";
|
|
7
7
|
export {
|
|
8
8
|
n as openApiPlugin
|
package/package.json
CHANGED
|
@@ -8,6 +8,7 @@ import {
|
|
|
8
8
|
useRef,
|
|
9
9
|
useState,
|
|
10
10
|
} from "react";
|
|
11
|
+
import { requestIdle } from "../../util/requestIdle.js";
|
|
11
12
|
|
|
12
13
|
type AnchorContextType = {
|
|
13
14
|
activeAnchor?: string;
|
|
@@ -95,7 +96,7 @@ export const ViewportAnchorProvider = ({
|
|
|
95
96
|
// reset the active anchor when we reach the top
|
|
96
97
|
setActiveAnchor("");
|
|
97
98
|
} else if (hasReachedBottom) {
|
|
98
|
-
|
|
99
|
+
requestIdle(() => {
|
|
99
100
|
// set the last anchor when we reach the bottom
|
|
100
101
|
const lastItem = Array.from(elements).pop();
|
|
101
102
|
setActiveAnchor(lastItem?.id ?? "");
|
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
import { AnchorLink } from "../../components/AnchorLink.js";
|
|
11
11
|
import { useViewportAnchor } from "../../components/context/ViewportAnchorContext.js";
|
|
12
12
|
import { cn } from "../../util/cn.js";
|
|
13
|
+
import { requestIdle } from "../../util/requestIdle.js";
|
|
13
14
|
|
|
14
15
|
const DATA_ANCHOR_ATTR = "data-active";
|
|
15
16
|
|
|
@@ -83,7 +84,7 @@ export const Toc = ({ entries }: { entries: TocEntry[] }) => {
|
|
|
83
84
|
if (paintedOnce.current) return;
|
|
84
85
|
|
|
85
86
|
// after all is painted, the indicator should animate
|
|
86
|
-
|
|
87
|
+
requestIdle(() => {
|
|
87
88
|
paintedOnce.current = true;
|
|
88
89
|
});
|
|
89
90
|
}, [activeAnchor]);
|
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
useEffect,
|
|
7
7
|
useState,
|
|
8
8
|
} from "react";
|
|
9
|
+
import { cancelIdle, requestIdle } from "../../util/requestIdle.js";
|
|
9
10
|
|
|
10
11
|
export const StaggeredRenderContext = createContext({ stagger: false });
|
|
11
12
|
|
|
@@ -18,11 +19,11 @@ const StaggeredRender = ({ children }: { children: ReactNode[] }) => {
|
|
|
18
19
|
return;
|
|
19
20
|
}
|
|
20
21
|
|
|
21
|
-
const
|
|
22
|
+
const idle = requestIdle(() => {
|
|
22
23
|
setRenderAll(true);
|
|
23
24
|
});
|
|
24
25
|
|
|
25
|
-
return () =>
|
|
26
|
+
return () => cancelIdle(idle);
|
|
26
27
|
}, [renderAll]);
|
|
27
28
|
|
|
28
29
|
return !renderAll ? Children.toArray(children).slice(0, 3) : children;
|
|
@@ -188,9 +188,10 @@ export const Playground = ({
|
|
|
188
188
|
|
|
189
189
|
const urlQueryParams = formState.queryParams
|
|
190
190
|
.filter((p) => p.active)
|
|
191
|
-
.map((p) => (
|
|
191
|
+
.map((p, i, arr) => (
|
|
192
192
|
<Fragment key={p.name}>
|
|
193
193
|
{p.name}={encodeURIComponent(p.value).replaceAll("%20", "+")}
|
|
194
|
+
{i < arr.length - 1 && "&"}
|
|
194
195
|
<wbr />
|
|
195
196
|
</Fragment>
|
|
196
197
|
));
|
|
@@ -57,9 +57,7 @@ export const QueryParams = ({
|
|
|
57
57
|
title={requiredFields[i] ? "Required field" : undefined}
|
|
58
58
|
>
|
|
59
59
|
{field.value}
|
|
60
|
-
{requiredFields[i] &&
|
|
61
|
-
<sup className="text-destructive">*</sup>
|
|
62
|
-
)}
|
|
60
|
+
{requiredFields[i] && <sup> *</sup>}
|
|
63
61
|
</label>
|
|
64
62
|
</InlineInput>
|
|
65
63
|
)}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { useEffect } from "react";
|
|
2
2
|
import { useLocation } from "react-router-dom";
|
|
3
3
|
import { useViewportAnchor } from "../components/context/ViewportAnchorContext.js";
|
|
4
|
+
import { requestIdle } from "./requestIdle.js";
|
|
4
5
|
|
|
5
6
|
export const useScrollToAnchor = () => {
|
|
6
7
|
const location = useLocation();
|
|
@@ -16,7 +17,7 @@ export const useScrollToAnchor = () => {
|
|
|
16
17
|
// on page navigation element might be in DOM but not yet scrollable, so wait for a frame
|
|
17
18
|
requestAnimationFrame(() => {
|
|
18
19
|
element.scrollIntoView();
|
|
19
|
-
|
|
20
|
+
requestIdle(() => setActiveAnchor(hash));
|
|
20
21
|
});
|
|
21
22
|
return;
|
|
22
23
|
}
|
|
@@ -27,7 +28,7 @@ export const useScrollToAnchor = () => {
|
|
|
27
28
|
if (!element) return;
|
|
28
29
|
|
|
29
30
|
element.scrollIntoView();
|
|
30
|
-
|
|
31
|
+
requestIdle(() => setActiveAnchor(hash));
|
|
31
32
|
obs.disconnect();
|
|
32
33
|
});
|
|
33
34
|
|