@umami/shiso 1.11.0 → 1.13.0
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/bin/shiso.mjs +20 -1
- package/dist/chunks/App.js +412 -51
- package/dist/chunks/abnfDiagram-VCTEODGH.js +109 -0
- package/dist/chunks/arc.js +130 -0
- package/dist/chunks/architecture-7GRP2DOG.js +4 -0
- package/dist/chunks/architectureDiagram-5GKGNRK7.js +7466 -0
- package/dist/chunks/array.js +8 -0
- package/dist/chunks/blockDiagram-I7D4REHJ.js +2546 -0
- package/dist/chunks/c4Diagram-7LVT6UL2.js +3654 -0
- package/dist/chunks/channel.js +9 -0
- package/dist/chunks/chunk-2Q5K7J3B.js +21 -0
- package/dist/chunks/chunk-4HAMMTFA.js +6106 -0
- package/dist/chunks/chunk-5VM5RSS4.js +21 -0
- package/dist/chunks/chunk-75Z2AOVW.js +2185 -0
- package/dist/chunks/chunk-DU6HZSFF.js +8729 -0
- package/dist/chunks/chunk-F27PBJKO.js +95 -0
- package/dist/chunks/chunk-FOHPRMQF.js +27162 -0
- package/dist/chunks/chunk-GMAD6QVW.js +2369 -0
- package/dist/chunks/chunk-GVQU2GXP.js +58 -0
- package/dist/chunks/chunk-IMKFNOWR.js +2593 -0
- package/dist/chunks/chunk-JWPE2WC7.js +12 -0
- package/dist/chunks/chunk-L3NEJ4N5.js +420 -0
- package/dist/chunks/chunk-OSK3NFVY.js +1029 -0
- package/dist/chunks/chunk-P2QGCYS3.js +95 -0
- package/dist/chunks/chunk-POPQ4Y6H.js +33 -0
- package/dist/chunks/chunk-PWAF6VOD.js +467 -0
- package/dist/chunks/chunk-SHT3W25Y.js +4813 -0
- package/dist/chunks/chunk-SVP7TREG.js +686 -0
- package/dist/chunks/chunk-TICWLB2K.js +3800 -0
- package/dist/chunks/chunk-XXDRQBXY.js +12 -0
- package/dist/chunks/chunk-Y2CYZVJY.js +15 -0
- package/dist/chunks/classDiagram-ZZMXUADV.js +33 -0
- package/dist/chunks/classDiagram-v2-VYDZK3BY.js +33 -0
- package/dist/chunks/cose-bilkent-JH36ORCC.js +4268 -0
- package/dist/chunks/cynefin-OW5HDTMX.js +4 -0
- package/dist/chunks/cynefinDiagram-5FMLGOSQ.js +482 -0
- package/dist/chunks/cytoscape.esm.js +28282 -0
- package/dist/chunks/dagre-GXQ25YYZ.js +583 -0
- package/dist/chunks/dagre.js +4235 -0
- package/dist/chunks/defaultLocale.js +246 -0
- package/dist/chunks/diagram-S7CK7UJ4.js +402 -0
- package/dist/chunks/diagram-UQ7AKVKN.js +291 -0
- package/dist/chunks/diagram-VSXAHHWV.js +553 -0
- package/dist/chunks/diagram-VX7I27RA.js +798 -0
- package/dist/chunks/diagram-Z3DM3KII.js +186 -0
- package/dist/chunks/dist.js +92 -0
- package/dist/chunks/docs.js +989 -93
- package/dist/chunks/ebnfDiagram-PWID7BFC.js +123 -0
- package/dist/chunks/erDiagram-RLTQ6QDP.js +2295 -0
- package/dist/chunks/eventmodeling-NTZA5JFV.js +4 -0
- package/dist/chunks/flowDiagram-HODETNUW.js +17 -0
- package/dist/chunks/ganttDiagram-EL5Y4UJY.js +3928 -0
- package/dist/chunks/gitGraph-4MIJSDKK.js +4 -0
- package/dist/chunks/gitGraphDiagram-WWUBYQGX.js +1153 -0
- package/dist/chunks/graphlib.js +4194 -0
- package/dist/chunks/info-A6RAGUB7.js +4 -0
- package/dist/chunks/infoDiagram-27XIBGKW.js +25 -0
- package/dist/chunks/init.js +14 -0
- package/dist/chunks/ishikawaDiagram-5VMMS53U.js +971 -0
- package/dist/chunks/journeyDiagram-3NMN7TZE.js +1226 -0
- package/dist/chunks/kanban-definition-UXKFOSKX.js +1241 -0
- package/dist/chunks/katex.js +26463 -0
- package/dist/chunks/line.js +48 -0
- package/dist/chunks/linear.js +391 -0
- package/dist/chunks/mermaid-parser.core.js +754 -0
- package/dist/chunks/mermaid.core.js +4898 -0
- package/dist/chunks/mindmap-definition-YA3MSWOX.js +1309 -0
- package/dist/chunks/ordinal.js +84 -0
- package/dist/chunks/packet-AYTQ26CC.js +4 -0
- package/dist/chunks/path.js +106 -0
- package/dist/chunks/pegDiagram-XKGWAZYB.js +115 -0
- package/dist/chunks/pie-WAS4IAKB.js +4 -0
- package/dist/chunks/pieDiagram-E7YTZNPT.js +297 -0
- package/dist/chunks/quadrantDiagram-AXDQQJYC.js +2234 -0
- package/dist/chunks/radar-RG4KPBEZ.js +4 -0
- package/dist/chunks/railroad-74A4TZTK.js +4 -0
- package/dist/chunks/railroad-abnf-HS5TGJTU.js +4 -0
- package/dist/chunks/railroad-ebnf-LZEXJU2U.js +4 -0
- package/dist/chunks/railroad-peg-WCYAUIDC.js +4 -0
- package/dist/chunks/railroadDiagram-O6MQD6OU.js +89 -0
- package/dist/chunks/requirementDiagram-BXWQKSXE.js +2464 -0
- package/dist/chunks/rough.esm.js +1396 -0
- package/dist/chunks/sankeyDiagram-P5KCCOFB.js +1308 -0
- package/dist/chunks/sequenceDiagram-WJ2MYXX4.js +5445 -0
- package/dist/chunks/sizeCapture-INFHLROL.js +56 -0
- package/dist/chunks/src.js +2653 -0
- package/dist/chunks/stateDiagram-D77RDMKH.js +368 -0
- package/dist/chunks/stateDiagram-v2-MP3YSRHH.js +33 -0
- package/dist/chunks/swimlanes-42K2YHIH.js +6925 -0
- package/dist/chunks/swimlanesDiagram-VR7AAH4N.js +32 -0
- package/dist/chunks/timeline-definition-24CTP7MA.js +1507 -0
- package/dist/chunks/treeView-Q6P3EWNA.js +4 -0
- package/dist/chunks/treemap-WGGIJYW6.js +4 -0
- package/dist/chunks/vennDiagram-4TSXK5OY.js +2803 -0
- package/dist/chunks/wardley-WFR3VGLG.js +4 -0
- package/dist/chunks/wardleyDiagram-VM6X3IG4.js +877 -0
- package/dist/chunks/xychartDiagram-S5SC5T6Z.js +2698 -0
- package/dist/components.js +2 -2
- package/dist/entry-client.js +2 -2
- package/dist/entry-server.js +31 -3
- package/docs.schema.json +90 -0
- package/mdx.config.ts +13 -97
- package/package.json +6 -4
- package/scripts/build-runtime.mjs +1 -0
- package/scripts/check-content.mjs +358 -0
- package/scripts/expand-navigation-globs.mjs +277 -0
- package/scripts/expand-openapi-navigation.mjs +94 -0
- package/scripts/generate-openapi.mjs +117 -0
- package/scripts/generate-search-index.mjs +31 -1
- package/scripts/lib/openapi.mjs +653 -0
- package/scripts/load-docs-config.mjs +52 -6
- package/scripts/load-shiso-config.mjs +45 -3
- package/scripts/prerender.mjs +83 -3
- package/scripts/vite-docs-config.mjs +27 -6
- package/src/App.tsx +0 -1
- package/src/components/CodeBlock.tsx +108 -8
- package/src/components/DocContent.tsx +18 -0
- package/src/components/Docs.tsx +45 -17
- package/src/components/OpenApiOperation.tsx +205 -0
- package/src/components/SideNav.tsx +13 -2
- package/src/components/docs/Changelog.tsx +163 -0
- package/src/components/docs/CodeGroup.tsx +6 -2
- package/src/components/docs/Mermaid.tsx +164 -0
- package/src/components/docs/Panel.tsx +23 -0
- package/src/components/docs/ParamField.tsx +17 -5
- package/src/components/docs/PropertiesTable.tsx +2 -2
- package/src/components/docs/ResponseField.tsx +17 -5
- package/src/components/docs/Tiles.tsx +59 -0
- package/src/components/docs/Tree.tsx +359 -0
- package/src/components/docs/Update.tsx +72 -0
- package/src/components/docs/index.ts +7 -0
- package/src/components/docs/panel-context.tsx +25 -0
- package/src/components/docs/styles.ts +49 -0
- package/src/components/icons/index.ts +4 -0
- package/src/entry-server.tsx +50 -0
- package/src/lib/code-blocks.ts +18 -0
- package/src/lib/code-meta.ts +87 -0
- package/src/lib/docs-config.ts +4 -1
- package/src/lib/openapi.generated.ts +4 -0
- package/src/lib/openapi.ts +63 -0
- package/src/lib/rehype-shiki.ts +213 -0
- package/src/lib/site-model.ts +2 -0
- package/src/lib/types.ts +116 -2
- package/src/styles/global.css +63 -73
- package/types/components.d.ts +79 -0
- package/types/config.d.ts +11 -4
- package/vite.config.ts +49 -3
- package/CHANGELOG.md +0 -171
package/dist/chunks/App.js
CHANGED
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import { $ as
|
|
1
|
+
import { $ as useFloatingNodeId, $n as useTimeout, A as safePolygon, An as findNonDisabledListIndex, At as CollapsibleContent, B as attachPreventUnmountOnClose, Bn as isTypeableCombobox, Cn as styles, Cr as Link, D as useAnchorPositioning, Dn as getTabbableAfterElement, Dr as Routes, Dt as renderInlineMarkdown, E as getDisabledMountTransitionStyles, En as getNextTabbable, F as createInitialPopupStoreState, Fn as isListIndexDisabled, Ft as COMPOSITE_KEYS, G as useTriggerDataForwarding, Gn as ARROW_LEFT, H as useImplicitActiveTrigger, Hn as contains, I as popupStoreSelectors, In as isVirtualClick, It as inertValue, J as useDismiss, Jn as jsdom, K as useSyncedFloatingRootContext, Kn as ARROW_RIGHT, L as PopupTriggerMap, Ln as isVirtualPointerEvent, Lt as useCompositeItem, M as useHoverFloatingInteraction, Mn as getMinListIndex, N as useFocus, Nn as isElementVisible, O as popupTransitionStateMapping, On as getTabbableBeforeElement, Or as useLocation, Ot as Expandable, P as usePopupHandleStore, Pn as isIndexOutOfListBounds, Pt as CodeGroup, Q as FloatingTree, Qn as useId$2, Qt as Badge$1, R as FOCUSABLE_POPUP_PROPS, Rn as stopEvent, St as usePanelContent, T as usePositioner, Tn as useDirection, Tr as Route, U as useOpenStateTransitions, Un as getTarget, V as setPopupOpenState, Vn as activeElement, W as usePopupInteractionProps, Wn as ARROW_DOWN, X as FloatingFocusManager, Xn as mac, Y as useClick, Yn as webkit, Z as FloatingNode, Zn as useBaseUiId, Zt as Badge, _n as triggerFocus, _r as isLastTraversableNode, a as DialogTitle, an as useValueAsRef, ar as useMergedRefs, at as POPUP_COLLISION_AVOIDANCE, bn as CompositeList, br as Check, c as useOpenInteractionType, cn as createChangeEventDetails, cr as ownerDocument, ct as fastComponent, d as useScrollLock, dn as focusOut, dr as useIsoLayoutEffect, er as Button, et as useFloatingParentNodeId, f as DialogPortal$1, fn as imperativeAction, fr as useStableCallback, g as DialogBackdrop, gn as siblingOpen, gr as isHTMLElement, gt as ResponseField, h as DialogClose, hn as outsidePress, hr as getWindow, i as DialogContent$1, in as useAnimationsFinished, ir as EMPTY_OBJECT, it as DROPDOWN_COLLISION_AVOIDANCE, j as useHoverReferenceInteraction, jn as getMaxListIndex, jt as CollapsibleTrigger, k as pressableTriggerOpenStateMapping, kn as isOutsideEvent, kr as useNavigate, kt as Collapsible, l as DialogTitle$1, ln as cancelOpen, lr as useCompositeRootContext, lt as fastComponentRef, m as DialogPopup, mn as listNavigation, mr as getParentNode, n as ZoomableImage, nn as getIcon, nr as useRenderElement, nt as FloatingTreeStore, o as DialogTrigger, on as useCompositeListItem, or as useButton, ot as enqueueFocus, p as InternalBackdrop, pn as itemPress, pr as useRefWithInit, q as ReactStore, qn as ARROW_UP, r as Dialog$1, rn as useOpenChangeComplete, rr as EMPTY_ARRAY, rt as FloatingPortal, s as DialogTrigger$1, sn as useAnimationFrame, sr as dispatchClickWithModifiers, st as FocusGuard, t as docs_exports, tn as resolveIcon, tr as cn, tt as useFloatingTree, u as DialogRoot, un as escapeKey, ur as mergeProps$1, vn as triggerHover, vr as X$1, w as TooltipProvider, wn as addEventListener, wr as Navigate, xn as Mermaid, xr as createLucideIcon, xt as PanelProvider, yn as triggerPress, yr as ChevronRight, yt as ParamField, z as PopupHandleAttachment, zn as getFloatingFocusElement } from "./docs.js";
|
|
2
2
|
import { n as highlightTerms } from "./search.js";
|
|
3
3
|
import { resolveSearchProvider } from "../search.js";
|
|
4
4
|
import * as React from "react";
|
|
5
5
|
import { useCallback, useEffect, useRef, useState } from "react";
|
|
6
6
|
import "@fontsource-variable/inter/index.css";
|
|
7
7
|
import "@fontsource/jetbrains-mono/400.css";
|
|
8
|
-
import "highlight.js/styles/github.css";
|
|
9
8
|
import "@umami/shiso/styles.css";
|
|
10
9
|
import { MDXProvider } from "@mdx-js/react";
|
|
11
|
-
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
|
|
10
|
+
import { Fragment as Fragment$1, jsx, jsxs } from "react/jsx-runtime";
|
|
12
11
|
import * as ReactDOM from "react-dom";
|
|
13
12
|
import shiso from "virtual:shiso-config";
|
|
14
13
|
import rawConfig from "virtual:shiso-docs-config";
|
|
15
14
|
import { LAST_MODIFIED } from "@/generated/last-modified";
|
|
15
|
+
import { OPENAPI_OPERATIONS } from "@/lib/openapi.generated";
|
|
16
16
|
|
|
17
17
|
//#region ../../node_modules/.pnpm/lucide-react@1.28.0_react@19.2.8/node_modules/lucide-react/dist/esm/icons/arrow-left.mjs
|
|
18
18
|
/**
|
|
@@ -1181,12 +1181,43 @@ function ScrollBar({ className, orientation = "vertical", ...props }) {
|
|
|
1181
1181
|
|
|
1182
1182
|
//#endregion
|
|
1183
1183
|
//#region src/components/CodeBlock.tsx
|
|
1184
|
-
function
|
|
1184
|
+
function reactChildrenToText(node) {
|
|
1185
|
+
if (typeof node === "string" || typeof node === "number") return String(node);
|
|
1186
|
+
if (Array.isArray(node)) return node.map(reactChildrenToText).join("");
|
|
1187
|
+
if (node && typeof node === "object" && "props" in node) {
|
|
1188
|
+
const props = node.props;
|
|
1189
|
+
if (typeof props?.value === "string") return props.value;
|
|
1190
|
+
return reactChildrenToText(props?.children);
|
|
1191
|
+
}
|
|
1192
|
+
return "";
|
|
1193
|
+
}
|
|
1194
|
+
/**
|
|
1195
|
+
* Joins the text of each rendered line. Lines marked as removed by
|
|
1196
|
+
* `// [!code --]` are skipped so the clipboard holds the "after" state; in a
|
|
1197
|
+
* `diff` block the +/- lines are content and are copied verbatim.
|
|
1198
|
+
*/
|
|
1199
|
+
function copyText(pre, language) {
|
|
1200
|
+
if (!pre) return "";
|
|
1201
|
+
const lines = [...pre.querySelectorAll(".line")];
|
|
1202
|
+
if (!lines.length) return pre.textContent || "";
|
|
1203
|
+
return lines.filter((line) => language === "diff" || line.dataset.diff !== "remove").map((line) => line.textContent || "").join("\n");
|
|
1204
|
+
}
|
|
1205
|
+
function CodeBlock({ children, className, style, ...rest }) {
|
|
1206
|
+
const { "data-title": title, "data-language": language, "data-line-start": lineStart, "data-line-count": lineCount, "data-placement": placement, "data-actions": actions, ...preProps } = rest;
|
|
1185
1207
|
const textInput = useRef(null);
|
|
1186
1208
|
const [copied, setCopied] = useState(false);
|
|
1209
|
+
if (language === "mermaid") return /* @__PURE__ */ jsx(Mermaid, {
|
|
1210
|
+
chart: reactChildrenToText(children).replace(/\n$/, ""),
|
|
1211
|
+
title,
|
|
1212
|
+
placement,
|
|
1213
|
+
actions: actions === void 0 ? void 0 : actions !== "false"
|
|
1214
|
+
});
|
|
1215
|
+
const start = Number(lineStart) || 1;
|
|
1216
|
+
const lastLine = start + Math.max(Number(lineCount) || 1, 1) - 1;
|
|
1217
|
+
const gutter = `${String(lastLine).length}ch`;
|
|
1187
1218
|
const handleCopy = () => {
|
|
1188
1219
|
setCopied(true);
|
|
1189
|
-
navigator?.clipboard?.writeText(textInput.current
|
|
1220
|
+
navigator?.clipboard?.writeText(copyText(textInput.current, language));
|
|
1190
1221
|
setTimeout(() => {
|
|
1191
1222
|
setCopied(false);
|
|
1192
1223
|
}, 1e3);
|
|
@@ -1194,23 +1225,38 @@ function CodeBlock({ children, className }) {
|
|
|
1194
1225
|
return /* @__PURE__ */ jsxs("div", {
|
|
1195
1226
|
"data-slot": "code-block",
|
|
1196
1227
|
className: "relative my-5 overflow-hidden rounded-lg bg-card",
|
|
1197
|
-
children: [
|
|
1198
|
-
|
|
1199
|
-
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1228
|
+
children: [
|
|
1229
|
+
title ? /* @__PURE__ */ jsx("div", {
|
|
1230
|
+
"data-slot": "code-block-header",
|
|
1231
|
+
className: "flex h-9 items-center border-border border-b px-3 pr-12 font-mono text-muted-foreground text-xs",
|
|
1232
|
+
children: title
|
|
1233
|
+
}) : null,
|
|
1234
|
+
/* @__PURE__ */ jsx(ScrollArea, {
|
|
1235
|
+
scrollbars: "horizontal",
|
|
1236
|
+
className: "w-full",
|
|
1237
|
+
children: /* @__PURE__ */ jsx("pre", {
|
|
1238
|
+
ref: textInput,
|
|
1239
|
+
...preProps,
|
|
1240
|
+
"data-language": language,
|
|
1241
|
+
style: {
|
|
1242
|
+
...style,
|
|
1243
|
+
counterReset: `line ${start - 1}`,
|
|
1244
|
+
"--code-gutter": gutter
|
|
1245
|
+
},
|
|
1246
|
+
className: cn("code-block w-max min-w-full py-3 font-mono text-foreground text-sm leading-[1.6]", className),
|
|
1247
|
+
children
|
|
1248
|
+
})
|
|
1249
|
+
}),
|
|
1250
|
+
/* @__PURE__ */ jsx(Button, {
|
|
1251
|
+
type: "button",
|
|
1252
|
+
variant: "ghost",
|
|
1253
|
+
size: "icon-sm",
|
|
1254
|
+
className: cn("absolute right-3 inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground", title ? "top-1" : "top-2.5"),
|
|
1255
|
+
onClick: handleCopy,
|
|
1256
|
+
"aria-label": "Copy code",
|
|
1257
|
+
children: copied ? /* @__PURE__ */ jsx(Check, { className: "size-3.5 text-primary" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3.5" })
|
|
1204
1258
|
})
|
|
1205
|
-
|
|
1206
|
-
type: "button",
|
|
1207
|
-
variant: "ghost",
|
|
1208
|
-
size: "icon-sm",
|
|
1209
|
-
className: "absolute top-2.5 right-3 inline-flex size-7 items-center justify-center rounded-sm text-muted-foreground hover:bg-accent hover:text-accent-foreground",
|
|
1210
|
-
onClick: handleCopy,
|
|
1211
|
-
"aria-label": "Copy code",
|
|
1212
|
-
children: copied ? /* @__PURE__ */ jsx(Check, { className: "size-3.5 text-primary" }) : /* @__PURE__ */ jsx(Copy, { className: "size-3.5" })
|
|
1213
|
-
})]
|
|
1259
|
+
]
|
|
1214
1260
|
});
|
|
1215
1261
|
}
|
|
1216
1262
|
|
|
@@ -2725,8 +2771,8 @@ const MenuRoot = fastComponent(function MenuRoot(props) {
|
|
|
2725
2771
|
store.useControlledProp("openProp", openProp);
|
|
2726
2772
|
store.useControlledProp("triggerIdProp", triggerIdProp);
|
|
2727
2773
|
store.useContextCallback("onOpenChangeComplete", onOpenChangeComplete);
|
|
2728
|
-
const rootId = useId$
|
|
2729
|
-
const floatingId = useId$
|
|
2774
|
+
const rootId = useId$2();
|
|
2775
|
+
const floatingId = useId$2();
|
|
2730
2776
|
const floatingTreeRoot = store.useState("floatingTreeRoot");
|
|
2731
2777
|
const floatingNodeIdFromContext = useFloatingNodeId(floatingTreeRoot);
|
|
2732
2778
|
const floatingParentNodeIdFromContext = useFloatingParentNodeId();
|
|
@@ -3422,6 +3468,52 @@ const regex = /[\0-\x1F!-,\.\/:-@\[-\^`\{-\xA9\xAB-\xB4\xB6-\xB9\xBB-\xBF\xD7\xF
|
|
|
3422
3468
|
//#region ../../node_modules/.pnpm/github-slugger@2.0.0/node_modules/github-slugger/index.js
|
|
3423
3469
|
const own = Object.hasOwnProperty;
|
|
3424
3470
|
/**
|
|
3471
|
+
* Slugger.
|
|
3472
|
+
*/
|
|
3473
|
+
var BananaSlug = class {
|
|
3474
|
+
/**
|
|
3475
|
+
* Create a new slug class.
|
|
3476
|
+
*/
|
|
3477
|
+
constructor() {
|
|
3478
|
+
/** @type {Record<string, number>} */
|
|
3479
|
+
this.occurrences;
|
|
3480
|
+
this.reset();
|
|
3481
|
+
}
|
|
3482
|
+
/**
|
|
3483
|
+
* Generate a unique slug.
|
|
3484
|
+
*
|
|
3485
|
+
* Tracks previously generated slugs: repeated calls with the same value
|
|
3486
|
+
* will result in different slugs.
|
|
3487
|
+
* Use the `slug` function to get same slugs.
|
|
3488
|
+
*
|
|
3489
|
+
* @param {string} value
|
|
3490
|
+
* String of text to slugify
|
|
3491
|
+
* @param {boolean} [maintainCase=false]
|
|
3492
|
+
* Keep the current case, otherwise make all lowercase
|
|
3493
|
+
* @return {string}
|
|
3494
|
+
* A unique slug string
|
|
3495
|
+
*/
|
|
3496
|
+
slug(value, maintainCase) {
|
|
3497
|
+
const self = this;
|
|
3498
|
+
let result = slug(value, maintainCase === true);
|
|
3499
|
+
const originalSlug = result;
|
|
3500
|
+
while (own.call(self.occurrences, result)) {
|
|
3501
|
+
self.occurrences[originalSlug]++;
|
|
3502
|
+
result = originalSlug + "-" + self.occurrences[originalSlug];
|
|
3503
|
+
}
|
|
3504
|
+
self.occurrences[result] = 0;
|
|
3505
|
+
return result;
|
|
3506
|
+
}
|
|
3507
|
+
/**
|
|
3508
|
+
* Reset - Forget all previous slugs
|
|
3509
|
+
*
|
|
3510
|
+
* @return void
|
|
3511
|
+
*/
|
|
3512
|
+
reset() {
|
|
3513
|
+
this.occurrences = Object.create(null);
|
|
3514
|
+
}
|
|
3515
|
+
};
|
|
3516
|
+
/**
|
|
3425
3517
|
* Generate a slug.
|
|
3426
3518
|
*
|
|
3427
3519
|
* Does not track previously generated slugs: repeated calls with the same value
|
|
@@ -3444,6 +3536,22 @@ function slug(value, maintainCase) {
|
|
|
3444
3536
|
//#endregion
|
|
3445
3537
|
//#region src/lib/slug.ts
|
|
3446
3538
|
/**
|
|
3539
|
+
* The single slug algorithm in the repo.
|
|
3540
|
+
*
|
|
3541
|
+
* Heading anchors are produced in two independent places — `remarkToc` (which
|
|
3542
|
+
* builds the on-page table of contents) and `rehype-slug` (which sets the `id`
|
|
3543
|
+
* on the rendered heading). Both must agree or every TOC link breaks, so both
|
|
3544
|
+
* go through github-slugger here rather than reimplementing it.
|
|
3545
|
+
*/
|
|
3546
|
+
/**
|
|
3547
|
+
* Creates a stateful slugger. Call `.slug(text)` once per heading in document
|
|
3548
|
+
* order; repeated headings get `-1`, `-2`, ... suffixes exactly as rehype-slug
|
|
3549
|
+
* does, because it is the same implementation.
|
|
3550
|
+
*/
|
|
3551
|
+
function createSlugger() {
|
|
3552
|
+
return new BananaSlug();
|
|
3553
|
+
}
|
|
3554
|
+
/**
|
|
3447
3555
|
* Stateless slugify for one-off ids that do not need de-duplication.
|
|
3448
3556
|
*
|
|
3449
3557
|
* github-slugger does not trim, so padded input would otherwise produce leading
|
|
@@ -3637,7 +3745,8 @@ function addPage(pageRef, context, state, extra = {}) {
|
|
|
3637
3745
|
order,
|
|
3638
3746
|
hidden: extra.hidden || context.hidden || void 0,
|
|
3639
3747
|
icon: extra.icon,
|
|
3640
|
-
tag: extra.tag
|
|
3748
|
+
tag: extra.tag,
|
|
3749
|
+
method: extra.method
|
|
3641
3750
|
});
|
|
3642
3751
|
return order;
|
|
3643
3752
|
}
|
|
@@ -3673,6 +3782,7 @@ function collectPages(items, context, state) {
|
|
|
3673
3782
|
label,
|
|
3674
3783
|
icon: typeof item.icon === "string" ? item.icon : void 0,
|
|
3675
3784
|
tag: typeof item.tag === "string" ? item.tag : void 0,
|
|
3785
|
+
method: typeof item.method === "string" ? item.method : void 0,
|
|
3676
3786
|
hidden: item.hidden === true
|
|
3677
3787
|
})
|
|
3678
3788
|
});
|
|
@@ -4054,6 +4164,24 @@ function getTextDirection(locale) {
|
|
|
4054
4164
|
return RTL_LANGUAGES.has(primary) ? "rtl" : "ltr";
|
|
4055
4165
|
}
|
|
4056
4166
|
|
|
4167
|
+
//#endregion
|
|
4168
|
+
//#region src/lib/code-blocks.ts
|
|
4169
|
+
const DEFAULT_CODE_THEME = {
|
|
4170
|
+
light: "github-light",
|
|
4171
|
+
dark: "github-dark"
|
|
4172
|
+
};
|
|
4173
|
+
/** Applies defaults to `styling.codeBlocks` from docs.json. */
|
|
4174
|
+
function resolveCodeBlockConfig(styling) {
|
|
4175
|
+
const codeBlocks = styling?.codeBlocks;
|
|
4176
|
+
return {
|
|
4177
|
+
lineNumbers: codeBlocks?.lineNumbers === true,
|
|
4178
|
+
theme: {
|
|
4179
|
+
light: codeBlocks?.theme?.light || DEFAULT_CODE_THEME.light,
|
|
4180
|
+
dark: codeBlocks?.theme?.dark || DEFAULT_CODE_THEME.dark
|
|
4181
|
+
}
|
|
4182
|
+
};
|
|
4183
|
+
}
|
|
4184
|
+
|
|
4057
4185
|
//#endregion
|
|
4058
4186
|
//#region src/lib/search/config.ts
|
|
4059
4187
|
const DEFAULT_SEARCH_PROMPT = "Search...";
|
|
@@ -4191,7 +4319,10 @@ function resolveSiteModel(config, docs, shiso) {
|
|
|
4191
4319
|
default: appearance.default === "light" || appearance.default === "dark" ? appearance.default : "system",
|
|
4192
4320
|
strict: appearance.strict === true
|
|
4193
4321
|
},
|
|
4194
|
-
styling: {
|
|
4322
|
+
styling: {
|
|
4323
|
+
eyebrows: config.styling?.eyebrows === "breadcrumbs" ? "breadcrumbs" : "section",
|
|
4324
|
+
codeBlocks: resolveCodeBlockConfig(config.styling)
|
|
4325
|
+
},
|
|
4195
4326
|
search: resolveSearchConfig(config.search),
|
|
4196
4327
|
contextualOptions: config.contextual?.options || [],
|
|
4197
4328
|
error404: {
|
|
@@ -4667,14 +4798,14 @@ var __name$11 = (target, value) => __defProp$11(target, "name", {
|
|
|
4667
4798
|
});
|
|
4668
4799
|
var useReactId = React[" useId ".trim().toString()] || (() => void 0);
|
|
4669
4800
|
var count$1 = 0;
|
|
4670
|
-
function useId(deterministicId) {
|
|
4801
|
+
function useId$1(deterministicId) {
|
|
4671
4802
|
const [id, setId] = React.useState(useReactId());
|
|
4672
4803
|
useLayoutEffect2(() => {
|
|
4673
4804
|
if (!deterministicId) setId((reactId) => reactId ?? String(count$1++));
|
|
4674
4805
|
}, [deterministicId]);
|
|
4675
4806
|
return deterministicId || (id ? `radix-${id}` : "");
|
|
4676
4807
|
}
|
|
4677
|
-
__name$11(useId, "useId");
|
|
4808
|
+
__name$11(useId$1, "useId");
|
|
4678
4809
|
|
|
4679
4810
|
//#endregion
|
|
4680
4811
|
//#region ../../node_modules/.pnpm/@radix-ui+react-use-effect-_e8d5e8242c04825bf34212c7f6280f14/node_modules/@radix-ui/react-use-effect-event/dist/index.mjs
|
|
@@ -6542,9 +6673,9 @@ var Dialog = /* @__PURE__ */ __name((props) => {
|
|
|
6542
6673
|
scope: __scopeDialog,
|
|
6543
6674
|
triggerRef,
|
|
6544
6675
|
contentRef,
|
|
6545
|
-
contentId: useId(),
|
|
6546
|
-
titleId: useId(),
|
|
6547
|
-
descriptionId: useId(),
|
|
6676
|
+
contentId: useId$1(),
|
|
6677
|
+
titleId: useId$1(),
|
|
6678
|
+
descriptionId: useId$1(),
|
|
6548
6679
|
titlePresent: titleCount > 0,
|
|
6549
6680
|
descriptionPresent: descriptionCount > 0,
|
|
6550
6681
|
setTitleCount,
|
|
@@ -6683,7 +6814,7 @@ var DialogContentImpl = /* @__PURE__ */ React.forwardRef(/* @__PURE__ */ __name(
|
|
|
6683
6814
|
const { __scopeDialog, trapFocus, onOpenAutoFocus, onCloseAutoFocus, ...contentProps } = props;
|
|
6684
6815
|
const context = useDialogContext(CONTENT_NAME, __scopeDialog);
|
|
6685
6816
|
useFocusGuards();
|
|
6686
|
-
return /* @__PURE__ */ jsx(Fragment, { children: /* @__PURE__ */ jsx(FocusScope, {
|
|
6817
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: /* @__PURE__ */ jsx(FocusScope, {
|
|
6687
6818
|
asChild: true,
|
|
6688
6819
|
loop: true,
|
|
6689
6820
|
trapped: trapFocus,
|
|
@@ -6735,7 +6866,7 @@ var me = React.forwardRef((r, o) => {
|
|
|
6735
6866
|
groups: /* @__PURE__ */ new Set()
|
|
6736
6867
|
}
|
|
6737
6868
|
};
|
|
6738
|
-
}), u = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p = pe(r), { label: b, children: m, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = !1, vimBindings: j = !0, ...O } = r, $ = useId(), q = useId(), _ = useId(), I = React.useRef(null), v = ke();
|
|
6869
|
+
}), u = L(() => /* @__PURE__ */ new Set()), c = L(() => /* @__PURE__ */ new Map()), d = L(() => /* @__PURE__ */ new Map()), f = L(() => /* @__PURE__ */ new Set()), p = pe(r), { label: b, children: m, value: R, onValueChange: x, filter: C, shouldFilter: S, loop: A, disablePointerSelection: ge = !1, vimBindings: j = !0, ...O } = r, $ = useId$1(), q = useId$1(), _ = useId$1(), I = React.useRef(null), v = ke();
|
|
6739
6870
|
k(() => {
|
|
6740
6871
|
if (R !== void 0) {
|
|
6741
6872
|
let e = R.trim();
|
|
@@ -6933,7 +7064,7 @@ var me = React.forwardRef((r, o) => {
|
|
|
6933
7064
|
});
|
|
6934
7065
|
var he = React.forwardRef((r, o) => {
|
|
6935
7066
|
var _, I;
|
|
6936
|
-
let n = useId(), u = React.useRef(null), c = React.useContext(fe), d = K(), f = pe(r), p = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
|
|
7067
|
+
let n = useId$1(), u = React.useRef(null), c = React.useContext(fe), d = K(), f = pe(r), p = (I = (_ = f.current) == null ? void 0 : _.forceMount) != null ? I : c == null ? void 0 : c.forceMount;
|
|
6937
7068
|
k(() => {
|
|
6938
7069
|
if (!p) return d.item(n, c == null ? void 0 : c.id);
|
|
6939
7070
|
}, [p]);
|
|
@@ -6974,7 +7105,7 @@ var he = React.forwardRef((r, o) => {
|
|
|
6974
7105
|
}, r.children);
|
|
6975
7106
|
});
|
|
6976
7107
|
var Ee = React.forwardRef((r, o) => {
|
|
6977
|
-
let { heading: n, children: u, forceMount: c, ...d } = r, f = useId(), p = React.useRef(null), b = React.useRef(null), m = useId(), R = K(), x = P((S) => c || R.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(f) : !0);
|
|
7108
|
+
let { heading: n, children: u, forceMount: c, ...d } = r, f = useId$1(), p = React.useRef(null), b = React.useRef(null), m = useId$1(), R = K(), x = P((S) => c || R.filter() === !1 ? !0 : S.search ? S.filtered.groups.has(f) : !0);
|
|
6978
7109
|
k(() => R.group(f), []), ve(f, p, [
|
|
6979
7110
|
r.value,
|
|
6980
7111
|
r.heading,
|
|
@@ -7386,7 +7517,7 @@ function Search({ config, labels, className }) {
|
|
|
7386
7517
|
onSelect: () => select(result),
|
|
7387
7518
|
children: [/* @__PURE__ */ jsxs("div", {
|
|
7388
7519
|
className: "text-[0.9rem] font-semibold text-foreground",
|
|
7389
|
-
children: [renderWithQueryHighlight(result.page, query), result.heading ? /* @__PURE__ */ jsxs(Fragment, { children: [" › ", renderWithQueryHighlight(result.heading, query)] }) : null]
|
|
7520
|
+
children: [renderWithQueryHighlight(result.page, query), result.heading ? /* @__PURE__ */ jsxs(Fragment$1, { children: [" › ", renderWithQueryHighlight(result.heading, query)] }) : null]
|
|
7390
7521
|
}), result.snippet && /* @__PURE__ */ jsx("div", {
|
|
7391
7522
|
className: "mt-[0.15rem] line-clamp-2 text-[0.8rem] text-muted-foreground",
|
|
7392
7523
|
children: renderSnippet(result.snippet)
|
|
@@ -7575,7 +7706,7 @@ function NavbarLinkItem({ link, primary = false }) {
|
|
|
7575
7706
|
const iconOnly = !link.label;
|
|
7576
7707
|
const accessibleLabel = link.ariaLabel || link.icon || link.href;
|
|
7577
7708
|
const className = primary ? `ml-1 inline-flex items-center justify-center rounded-full bg-primary text-sm font-semibold text-primary-foreground hover:opacity-90 ${iconOnly ? "size-8" : "gap-1.5 px-3.5 py-1.5"}` : `inline-flex items-center rounded-md text-sm font-medium text-foreground hover:bg-accent hover:text-foreground ${iconOnly ? "size-8 justify-center" : "gap-1.5 px-2.5 py-1.5"}`;
|
|
7578
|
-
const content = /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsx(ConfiguredIcon, { icon: link.icon }), link.label] });
|
|
7709
|
+
const content = /* @__PURE__ */ jsxs(Fragment$1, { children: [/* @__PURE__ */ jsx(ConfiguredIcon, { icon: link.icon }), link.label] });
|
|
7579
7710
|
if (isRoutedHref(link.href, link.target)) return /* @__PURE__ */ jsx(Link, {
|
|
7580
7711
|
to: link.href,
|
|
7581
7712
|
className,
|
|
@@ -7598,11 +7729,11 @@ function Header({ site }) {
|
|
|
7598
7729
|
const brandHref = logo?.href || (hasRootStandalonePage ? "/" : docsHomeUrl);
|
|
7599
7730
|
const hasBrand = !!name || !!logo?.light || !!logo?.dark;
|
|
7600
7731
|
const brandClassName = "inline-flex items-center gap-2 text-xl font-bold text-foreground tracking-[-0.03em]";
|
|
7601
|
-
const brandContent = /* @__PURE__ */ jsxs(Fragment, { children: [logo?.invert && logo.light ? /* @__PURE__ */ jsx("img", {
|
|
7732
|
+
const brandContent = /* @__PURE__ */ jsxs(Fragment$1, { children: [logo?.invert && logo.light ? /* @__PURE__ */ jsx("img", {
|
|
7602
7733
|
src: logo.light,
|
|
7603
7734
|
alt: "",
|
|
7604
7735
|
className: "h-6 w-auto dark:brightness-0 dark:invert"
|
|
7605
|
-
}) : /* @__PURE__ */ jsxs(Fragment, { children: [logo?.light ? /* @__PURE__ */ jsx("img", {
|
|
7736
|
+
}) : /* @__PURE__ */ jsxs(Fragment$1, { children: [logo?.light ? /* @__PURE__ */ jsx("img", {
|
|
7606
7737
|
src: logo.light,
|
|
7607
7738
|
alt: "",
|
|
7608
7739
|
className: "h-6 w-auto dark:hidden"
|
|
@@ -7953,6 +8084,196 @@ function ContextualMenu({ options, labels }) {
|
|
|
7953
8084
|
});
|
|
7954
8085
|
}
|
|
7955
8086
|
|
|
8087
|
+
//#endregion
|
|
8088
|
+
//#region src/lib/openapi.ts
|
|
8089
|
+
const METHOD_COLORS = {
|
|
8090
|
+
GET: "green",
|
|
8091
|
+
POST: "blue",
|
|
8092
|
+
PUT: "orange",
|
|
8093
|
+
PATCH: "purple",
|
|
8094
|
+
DELETE: "red"
|
|
8095
|
+
};
|
|
8096
|
+
function methodColor(method) {
|
|
8097
|
+
return method && METHOD_COLORS[method.toUpperCase()] || "gray";
|
|
8098
|
+
}
|
|
8099
|
+
function statusColor(status) {
|
|
8100
|
+
if (status.startsWith("2")) return "green";
|
|
8101
|
+
if (status.startsWith("3")) return "blue";
|
|
8102
|
+
if (status.startsWith("4") || status.startsWith("5")) return "red";
|
|
8103
|
+
return "gray";
|
|
8104
|
+
}
|
|
8105
|
+
/** Looks up the operation bound by an `openapi:` frontmatter value. */
|
|
8106
|
+
function getOperation(key) {
|
|
8107
|
+
if (typeof key !== "string" || !key.trim()) return;
|
|
8108
|
+
const [method, ...rest] = key.trim().split(/\s+/);
|
|
8109
|
+
return OPENAPI_OPERATIONS[`${method.toUpperCase()} ${rest.join(" ")}`];
|
|
8110
|
+
}
|
|
8111
|
+
function hasParameters(operation) {
|
|
8112
|
+
const { query, path, header, cookie } = operation.parameters;
|
|
8113
|
+
return query.length + path.length + header.length + cookie.length > 0 || operation.security.length > 0;
|
|
8114
|
+
}
|
|
8115
|
+
/**
|
|
8116
|
+
* Section headings for an operation, in render order. The single source of
|
|
8117
|
+
* truth for section ids: the component, the table of contents, the content
|
|
8118
|
+
* checker, and the search indexer all derive their anchors from these labels.
|
|
8119
|
+
*/
|
|
8120
|
+
function operationSections(operation) {
|
|
8121
|
+
const slugger = createSlugger();
|
|
8122
|
+
return [
|
|
8123
|
+
hasParameters(operation) ? "Parameters" : void 0,
|
|
8124
|
+
operation.requestBody ? "Request body" : void 0,
|
|
8125
|
+
operation.responses.length ? "Responses" : void 0,
|
|
8126
|
+
operation.samples.length ? "Code samples" : void 0
|
|
8127
|
+
].filter((name) => Boolean(name)).map((name) => ({
|
|
8128
|
+
name,
|
|
8129
|
+
id: slugger.slug(name),
|
|
8130
|
+
size: 2
|
|
8131
|
+
}));
|
|
8132
|
+
}
|
|
8133
|
+
|
|
8134
|
+
//#endregion
|
|
8135
|
+
//#region src/components/OpenApiOperation.tsx
|
|
8136
|
+
const PARAM_LOCATIONS = [
|
|
8137
|
+
"path",
|
|
8138
|
+
"query",
|
|
8139
|
+
"header",
|
|
8140
|
+
"cookie"
|
|
8141
|
+
];
|
|
8142
|
+
function FieldChildren({ node }) {
|
|
8143
|
+
return /* @__PURE__ */ jsxs(Fragment$1, { children: [
|
|
8144
|
+
node.description,
|
|
8145
|
+
node.enum && node.enum.length > 0 && /* @__PURE__ */ jsxs("div", {
|
|
8146
|
+
className: "mt-1",
|
|
8147
|
+
children: [
|
|
8148
|
+
"Options:",
|
|
8149
|
+
" ",
|
|
8150
|
+
node.enum.map((value, index) => /* @__PURE__ */ jsxs("span", { children: [index > 0 && ", ", /* @__PURE__ */ jsx("code", { children: value })] }, value))
|
|
8151
|
+
]
|
|
8152
|
+
}),
|
|
8153
|
+
node.children && node.children.length > 0 && /* @__PURE__ */ jsx(Expandable, {
|
|
8154
|
+
title: "properties",
|
|
8155
|
+
children: node.children.map((child) => /* @__PURE__ */ jsx(SchemaField, { node: child }, child.name || child.type))
|
|
8156
|
+
})
|
|
8157
|
+
] });
|
|
8158
|
+
}
|
|
8159
|
+
function SchemaField({ node }) {
|
|
8160
|
+
const hasDetails = Boolean(node.description || node.enum?.length || node.children?.length);
|
|
8161
|
+
return /* @__PURE__ */ jsx(ResponseField, {
|
|
8162
|
+
name: node.name || node.type,
|
|
8163
|
+
type: node.name ? node.type : void 0,
|
|
8164
|
+
required: node.required,
|
|
8165
|
+
deprecated: node.deprecated,
|
|
8166
|
+
default: node.default,
|
|
8167
|
+
children: hasDetails ? /* @__PURE__ */ jsx(FieldChildren, { node }) : null
|
|
8168
|
+
});
|
|
8169
|
+
}
|
|
8170
|
+
/** Renders a schema tree: a root object's properties, or the node itself. */
|
|
8171
|
+
function SchemaFields({ node }) {
|
|
8172
|
+
if (!node.name && node.children?.length) return /* @__PURE__ */ jsx(Fragment$1, { children: node.children.map((child) => /* @__PURE__ */ jsx(SchemaField, { node: child }, child.name || child.type)) });
|
|
8173
|
+
return /* @__PURE__ */ jsx(SchemaField, { node });
|
|
8174
|
+
}
|
|
8175
|
+
function HighlightedCode({ language, title, html, source, lineCount }) {
|
|
8176
|
+
return /* @__PURE__ */ jsx(CodeBlock, {
|
|
8177
|
+
"data-language": language,
|
|
8178
|
+
"data-title": title,
|
|
8179
|
+
"data-line-count": lineCount ? String(lineCount) : void 0,
|
|
8180
|
+
children: html ? /* @__PURE__ */ jsx("code", {
|
|
8181
|
+
className: `language-${language}`,
|
|
8182
|
+
dangerouslySetInnerHTML: { __html: html }
|
|
8183
|
+
}) : /* @__PURE__ */ jsx("code", {
|
|
8184
|
+
className: `language-${language}`,
|
|
8185
|
+
children: source
|
|
8186
|
+
})
|
|
8187
|
+
});
|
|
8188
|
+
}
|
|
8189
|
+
/** The generated reference for one API operation, rendered under the page body. */
|
|
8190
|
+
function OpenApiOperation({ operation }) {
|
|
8191
|
+
const sections = new Map(operationSections(operation).map((entry) => [entry.name, entry.id]));
|
|
8192
|
+
const showParameters = sections.has("Parameters");
|
|
8193
|
+
return /* @__PURE__ */ jsxs("div", {
|
|
8194
|
+
className: "docs-markdown",
|
|
8195
|
+
children: [
|
|
8196
|
+
showParameters && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("h2", {
|
|
8197
|
+
id: sections.get("Parameters"),
|
|
8198
|
+
children: "Parameters"
|
|
8199
|
+
}), /* @__PURE__ */ jsxs("div", {
|
|
8200
|
+
className: styles.fieldGroup,
|
|
8201
|
+
children: [operation.security.length > 0 && /* @__PURE__ */ jsxs(ParamField, {
|
|
8202
|
+
header: "Authorization",
|
|
8203
|
+
type: "string",
|
|
8204
|
+
required: true,
|
|
8205
|
+
children: [
|
|
8206
|
+
"Authentication credentials, e.g. ",
|
|
8207
|
+
/* @__PURE__ */ jsx("code", { children: "Bearer <token>" }),
|
|
8208
|
+
"."
|
|
8209
|
+
]
|
|
8210
|
+
}), PARAM_LOCATIONS.map((location) => operation.parameters[location].map((parameter) => /* @__PURE__ */ jsxs(ParamField, {
|
|
8211
|
+
[location]: parameter.name,
|
|
8212
|
+
type: parameter.type,
|
|
8213
|
+
required: parameter.required,
|
|
8214
|
+
children: [/* @__PURE__ */ jsx(FieldChildren, { node: {
|
|
8215
|
+
...parameter,
|
|
8216
|
+
name: void 0,
|
|
8217
|
+
description: void 0
|
|
8218
|
+
} }), parameter.description]
|
|
8219
|
+
}, `${location}-${parameter.name}`)))]
|
|
8220
|
+
})] }),
|
|
8221
|
+
operation.requestBody && /* @__PURE__ */ jsxs("section", { children: [
|
|
8222
|
+
/* @__PURE__ */ jsx("h2", {
|
|
8223
|
+
id: sections.get("Request body"),
|
|
8224
|
+
children: "Request body"
|
|
8225
|
+
}),
|
|
8226
|
+
/* @__PURE__ */ jsx(SchemaFields, { node: operation.requestBody.schema }),
|
|
8227
|
+
operation.requestBody.example && /* @__PURE__ */ jsx(HighlightedCode, {
|
|
8228
|
+
language: "json",
|
|
8229
|
+
title: "Example request",
|
|
8230
|
+
html: operation.requestBody.exampleHtml,
|
|
8231
|
+
source: operation.requestBody.example
|
|
8232
|
+
})
|
|
8233
|
+
] }),
|
|
8234
|
+
operation.responses.length > 0 && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("h2", {
|
|
8235
|
+
id: sections.get("Responses"),
|
|
8236
|
+
children: "Responses"
|
|
8237
|
+
}), operation.responses.map((response) => /* @__PURE__ */ jsxs("div", {
|
|
8238
|
+
className: "mt-6 first:mt-0",
|
|
8239
|
+
children: [
|
|
8240
|
+
/* @__PURE__ */ jsxs("div", {
|
|
8241
|
+
className: "flex items-center gap-2",
|
|
8242
|
+
children: [/* @__PURE__ */ jsx(Badge, {
|
|
8243
|
+
color: statusColor(response.status),
|
|
8244
|
+
size: "sm",
|
|
8245
|
+
children: response.status
|
|
8246
|
+
}), response.description && /* @__PURE__ */ jsx("span", {
|
|
8247
|
+
className: "text-muted-foreground text-sm",
|
|
8248
|
+
children: response.description
|
|
8249
|
+
})]
|
|
8250
|
+
}),
|
|
8251
|
+
response.schema && /* @__PURE__ */ jsx("div", {
|
|
8252
|
+
className: styles.fieldGroup,
|
|
8253
|
+
children: /* @__PURE__ */ jsx(SchemaFields, { node: response.schema })
|
|
8254
|
+
}),
|
|
8255
|
+
response.example && /* @__PURE__ */ jsx(HighlightedCode, {
|
|
8256
|
+
language: "json",
|
|
8257
|
+
title: `${response.status} example`,
|
|
8258
|
+
html: response.exampleHtml,
|
|
8259
|
+
source: response.example
|
|
8260
|
+
})
|
|
8261
|
+
]
|
|
8262
|
+
}, response.status))] }),
|
|
8263
|
+
operation.samples.length > 0 && /* @__PURE__ */ jsxs("section", { children: [/* @__PURE__ */ jsx("h2", {
|
|
8264
|
+
id: sections.get("Code samples"),
|
|
8265
|
+
children: "Code samples"
|
|
8266
|
+
}), /* @__PURE__ */ jsx(CodeGroup, { children: operation.samples.map((sample) => /* @__PURE__ */ jsx(HighlightedCode, {
|
|
8267
|
+
language: sample.language,
|
|
8268
|
+
title: sample.label,
|
|
8269
|
+
html: sample.html,
|
|
8270
|
+
source: sample.source,
|
|
8271
|
+
lineCount: sample.lineCount
|
|
8272
|
+
}, sample.language)) })] })
|
|
8273
|
+
]
|
|
8274
|
+
});
|
|
8275
|
+
}
|
|
8276
|
+
|
|
7956
8277
|
//#endregion
|
|
7957
8278
|
//#region src/components/DocContent.tsx
|
|
7958
8279
|
/**
|
|
@@ -7993,6 +8314,7 @@ function DocContent({ page, doc, site }) {
|
|
|
7993
8314
|
const eyebrow = site.styling.eyebrows === "breadcrumbs" ? [.../* @__PURE__ */ new Set([page.tabLabel, page.section])].filter(Boolean).join(" / ") : page.section;
|
|
7994
8315
|
const contextualOptions = resolveContextualOptions(site.contextualOptions, page, site.labels);
|
|
7995
8316
|
const related = resolveRelated(doc.frontmatter?.related);
|
|
8317
|
+
const operation = getOperation(doc.frontmatter?.openapi);
|
|
7996
8318
|
const dateFormat = new Intl.DateTimeFormat(resolveLocale(page.language, site.locale), {
|
|
7997
8319
|
dateStyle: "medium",
|
|
7998
8320
|
timeZone: "UTC"
|
|
@@ -8022,6 +8344,27 @@ function DocContent({ page, doc, site }) {
|
|
|
8022
8344
|
labels: site.labels
|
|
8023
8345
|
})]
|
|
8024
8346
|
}),
|
|
8347
|
+
operation && /* @__PURE__ */ jsxs("div", {
|
|
8348
|
+
className: "mt-3 flex flex-wrap items-center gap-2",
|
|
8349
|
+
children: [
|
|
8350
|
+
/* @__PURE__ */ jsx(Badge, {
|
|
8351
|
+
color: methodColor(operation.method),
|
|
8352
|
+
size: "sm",
|
|
8353
|
+
className: "font-mono",
|
|
8354
|
+
children: operation.method
|
|
8355
|
+
}),
|
|
8356
|
+
/* @__PURE__ */ jsx("code", {
|
|
8357
|
+
className: "font-mono text-muted-foreground text-sm",
|
|
8358
|
+
children: operation.path
|
|
8359
|
+
}),
|
|
8360
|
+
operation.deprecated && /* @__PURE__ */ jsx(Badge, {
|
|
8361
|
+
color: "red",
|
|
8362
|
+
size: "sm",
|
|
8363
|
+
stroke: true,
|
|
8364
|
+
children: "deprecated"
|
|
8365
|
+
})
|
|
8366
|
+
]
|
|
8367
|
+
}),
|
|
8025
8368
|
description && /* @__PURE__ */ jsx("p", {
|
|
8026
8369
|
className: "mt-3 mb-8 text-lg text-muted-foreground leading-relaxed",
|
|
8027
8370
|
children: description
|
|
@@ -8030,6 +8373,7 @@ function DocContent({ page, doc, site }) {
|
|
|
8030
8373
|
className: "docs-markdown",
|
|
8031
8374
|
children: /* @__PURE__ */ jsx(Content, {})
|
|
8032
8375
|
}),
|
|
8376
|
+
operation && /* @__PURE__ */ jsx(OpenApiOperation, { operation }),
|
|
8033
8377
|
lastModified && /* @__PURE__ */ jsxs("div", {
|
|
8034
8378
|
className: "mt-8 text-sm text-muted-foreground",
|
|
8035
8379
|
children: [
|
|
@@ -8354,7 +8698,7 @@ function NavNodes({ nodes, pathname, depth, drilldown, expandLabel, collapseLabe
|
|
|
8354
8698
|
return;
|
|
8355
8699
|
}
|
|
8356
8700
|
if (node.kind === "page") {
|
|
8357
|
-
const { url, label, icon, tag } = node.page;
|
|
8701
|
+
const { url, label, icon, tag, method } = node.page;
|
|
8358
8702
|
const isSelected = url === pathname;
|
|
8359
8703
|
rendered.push(/* @__PURE__ */ jsxs(Link, {
|
|
8360
8704
|
to: url,
|
|
@@ -8365,8 +8709,14 @@ function NavNodes({ nodes, pathname, depth, drilldown, expandLabel, collapseLabe
|
|
|
8365
8709
|
}),
|
|
8366
8710
|
children: [
|
|
8367
8711
|
resolveIcon(icon),
|
|
8712
|
+
method ? /* @__PURE__ */ jsx(Badge, {
|
|
8713
|
+
color: methodColor(method),
|
|
8714
|
+
size: "xs",
|
|
8715
|
+
className: "w-10 shrink-0 justify-center whitespace-nowrap font-mono",
|
|
8716
|
+
children: method === "DELETE" ? "DEL" : method
|
|
8717
|
+
}) : null,
|
|
8368
8718
|
label,
|
|
8369
|
-
tag ? /* @__PURE__ */ jsx(Badge, {
|
|
8719
|
+
!method && tag ? /* @__PURE__ */ jsx(Badge$1, {
|
|
8370
8720
|
variant: "secondary",
|
|
8371
8721
|
className: "ml-auto h-auto rounded-sm px-[0.35rem] py-[0.05rem] text-[0.7rem] text-muted-foreground uppercase",
|
|
8372
8722
|
children: tag
|
|
@@ -8384,7 +8734,7 @@ function NavNodes({ nodes, pathname, depth, drilldown, expandLabel, collapseLabe
|
|
|
8384
8734
|
collapseLabel
|
|
8385
8735
|
}, `group-${node.label}`));
|
|
8386
8736
|
});
|
|
8387
|
-
return /* @__PURE__ */ jsx(Fragment, { children: rendered });
|
|
8737
|
+
return /* @__PURE__ */ jsx(Fragment$1, { children: rendered });
|
|
8388
8738
|
}
|
|
8389
8739
|
function SideNav({ tabs, navigation, anchors, activeTabId, isSticky, drilldown, navigationLabel, expandLabel, collapseLabel }) {
|
|
8390
8740
|
const { pathname } = useLocation();
|
|
@@ -8488,10 +8838,28 @@ function NotFound({ site }) {
|
|
|
8488
8838
|
});
|
|
8489
8839
|
}
|
|
8490
8840
|
function Docs({ page, doc, site }) {
|
|
8841
|
+
if (!page || !doc) return /* @__PURE__ */ jsxs("div", {
|
|
8842
|
+
className: "flex min-h-full flex-col",
|
|
8843
|
+
children: [/* @__PURE__ */ jsx("div", {
|
|
8844
|
+
className: "grow",
|
|
8845
|
+
children: /* @__PURE__ */ jsx(NotFound, { site })
|
|
8846
|
+
}), /* @__PURE__ */ jsx(Footer, { footer: site.footer })]
|
|
8847
|
+
});
|
|
8848
|
+
const operation = getOperation(doc.frontmatter?.openapi);
|
|
8849
|
+
const toc = operation ? [...doc.toc || [], ...operationSections(operation)] : doc.toc;
|
|
8850
|
+
return /* @__PURE__ */ jsx(PanelProvider, { children: /* @__PURE__ */ jsx(DocsBody, {
|
|
8851
|
+
page,
|
|
8852
|
+
doc,
|
|
8853
|
+
site,
|
|
8854
|
+
toc
|
|
8855
|
+
}) });
|
|
8856
|
+
}
|
|
8857
|
+
function DocsBody({ page, doc, site, toc }) {
|
|
8491
8858
|
const { pathname } = useLocation();
|
|
8492
8859
|
const [menuOpen, setMenuOpen] = useState(false);
|
|
8493
8860
|
const scopeDocs = getScopeByPathname(pathname).docs;
|
|
8494
8861
|
const { tabs, navigation } = scopeDocs;
|
|
8862
|
+
const panel = usePanelContent();
|
|
8495
8863
|
useEffect(() => {
|
|
8496
8864
|
setMenuOpen(false);
|
|
8497
8865
|
if (!window.location.hash) window.scrollTo({
|
|
@@ -8499,13 +8867,6 @@ function Docs({ page, doc, site }) {
|
|
|
8499
8867
|
left: 0
|
|
8500
8868
|
});
|
|
8501
8869
|
}, [pathname]);
|
|
8502
|
-
if (!page || !doc) return /* @__PURE__ */ jsxs("div", {
|
|
8503
|
-
className: "flex min-h-full flex-col",
|
|
8504
|
-
children: [/* @__PURE__ */ jsx("div", {
|
|
8505
|
-
className: "grow",
|
|
8506
|
-
children: /* @__PURE__ */ jsx(NotFound, { site })
|
|
8507
|
-
}), /* @__PURE__ */ jsx(Footer, { footer: site.footer })]
|
|
8508
|
-
});
|
|
8509
8870
|
return /* @__PURE__ */ jsxs("div", {
|
|
8510
8871
|
className: "flex min-h-full flex-col gap-6 lg:gap-0",
|
|
8511
8872
|
children: [/* @__PURE__ */ jsxs(Sheet, {
|
|
@@ -8572,8 +8933,8 @@ function Docs({ page, doc, site }) {
|
|
|
8572
8933
|
site
|
|
8573
8934
|
}), /* @__PURE__ */ jsx("div", {
|
|
8574
8935
|
className: "hidden min-w-0 max-w-60 basis-60 self-start lg:sticky lg:top-[calc(var(--header-height)+1.5rem)] lg:block lg:shrink-0",
|
|
8575
|
-
children: /* @__PURE__ */ jsx(PageLinks, {
|
|
8576
|
-
items:
|
|
8936
|
+
children: panel ?? /* @__PURE__ */ jsx(PageLinks, {
|
|
8937
|
+
items: toc,
|
|
8577
8938
|
title: site.labels.tableOfContents,
|
|
8578
8939
|
navigationLabel: site.labels.tableOfContentsNavigation
|
|
8579
8940
|
})
|
|
@@ -8685,4 +9046,4 @@ function App() {
|
|
|
8685
9046
|
}
|
|
8686
9047
|
|
|
8687
9048
|
//#endregion
|
|
8688
|
-
export { docsSite as a, getSeo as c,
|
|
9049
|
+
export { docsSite as a, getSeo as c, standalonePages as d, getDocModule as f, toAbsoluteUrl as g, BASE_URL as h, docsHomeUrl as i, siteConfig as l, getScopeForPage as m, buildHead as n, getLocaleByPathname as o, getLastModified as p, renderHeadToString as r, getRedirects as s, App as t, siteName as u };
|