@djangocfg/ui-tools 2.1.292 → 2.1.293
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/{DocsLayout-5WTQR3BR.cjs → DocsLayout-PLWQJBGU.cjs} +9 -3
- package/dist/DocsLayout-PLWQJBGU.cjs.map +1 -0
- package/dist/{DocsLayout-YZR5RLCJ.mjs → DocsLayout-XB55R7YG.mjs} +10 -4
- package/dist/{DocsLayout-YZR5RLCJ.mjs.map → DocsLayout-XB55R7YG.mjs.map} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.mjs +2 -2
- package/package.json +6 -6
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/EndpointRow.tsx +12 -1
- package/src/tools/OpenapiViewer/components/DocsLayout/Sidebar/SidebarBody.tsx +1 -1
- package/dist/DocsLayout-5WTQR3BR.cjs.map +0 -1
|
@@ -2,7 +2,7 @@ import { deduplicateEndpoints, dereferenceSchema, resolveBaseUrl, usePlaygroundC
|
|
|
2
2
|
import { JsonTree_default } from './chunk-LFWQ36LJ.mjs';
|
|
3
3
|
import './chunk-SSUOENAZ.mjs';
|
|
4
4
|
import { __name } from './chunk-CGILA3WO.mjs';
|
|
5
|
-
import React12, {
|
|
5
|
+
import React12, { useRef, useEffect, createContext, useCallback, useMemo, useState, useContext } from 'react';
|
|
6
6
|
import { groupBy, orderBy, partition, sortBy, keyBy } from 'lodash-es';
|
|
7
7
|
import { Tooltip, TooltipTrigger, TooltipContent, DropdownMenu, DropdownMenuTrigger, Button, DropdownMenuContent, DropdownMenuLabel, DropdownMenuSeparator, DropdownMenuItem, Input, Combobox, SafeTooltipProvider, CopyButton, Switch, Textarea, SidePanel, ResponsiveSheet, ResponsiveSheetContent, ResponsiveSheetHeader, ResponsiveSheetTitle, Skeleton, TooltipProvider } from '@djangocfg/ui-core/components';
|
|
8
8
|
import { toast, useMediaQuery } from '@djangocfg/ui-core/hooks';
|
|
@@ -886,10 +886,16 @@ var EndpointRow = React12.memo(/* @__PURE__ */ __name(function EndpointRow2({
|
|
|
886
886
|
onNavigate
|
|
887
887
|
}) {
|
|
888
888
|
const displayLabel = row.label.replace(/\.$/, "");
|
|
889
|
+
const buttonRef = useRef(null);
|
|
890
|
+
useEffect(() => {
|
|
891
|
+
if (!row.isActive || !buttonRef.current) return;
|
|
892
|
+
buttonRef.current.scrollIntoView({ block: "nearest", inline: "nearest" });
|
|
893
|
+
}, [row.isActive]);
|
|
889
894
|
return /* @__PURE__ */ jsxs(Tooltip, { delayDuration: 350, children: [
|
|
890
895
|
/* @__PURE__ */ jsx(TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxs(
|
|
891
896
|
"button",
|
|
892
897
|
{
|
|
898
|
+
ref: buttonRef,
|
|
893
899
|
onClick: () => onNavigate(row.anchor, row.schemaId),
|
|
894
900
|
"aria-current": row.isActive ? "location" : void 0,
|
|
895
901
|
className: cn(
|
|
@@ -937,7 +943,7 @@ function SidebarBody({ body, onNavigate }) {
|
|
|
937
943
|
if (body.categories.length === 0) {
|
|
938
944
|
return /* @__PURE__ */ jsx("div", { className: "py-10 px-4 text-center text-xs text-muted-foreground", children: body.emptyText });
|
|
939
945
|
}
|
|
940
|
-
return /* @__PURE__ */ jsx("nav", { className: "
|
|
946
|
+
return /* @__PURE__ */ jsx("nav", { className: "pt-1.5 pb-[10vh]", children: body.categories.map((cat) => /* @__PURE__ */ jsx(CategoryBlock, { category: cat, onNavigate }, cat.key)) });
|
|
941
947
|
}
|
|
942
948
|
if (body.sections.length === 0) {
|
|
943
949
|
return /* @__PURE__ */ jsx("div", { className: "py-10 px-4 text-center text-xs text-muted-foreground", children: body.emptyText });
|
|
@@ -3453,5 +3459,5 @@ var DocsLayout = /* @__PURE__ */ __name(() => {
|
|
|
3453
3459
|
}, "DocsLayout");
|
|
3454
3460
|
|
|
3455
3461
|
export { DocsLayout };
|
|
3456
|
-
//# sourceMappingURL=DocsLayout-
|
|
3457
|
-
//# sourceMappingURL=DocsLayout-
|
|
3462
|
+
//# sourceMappingURL=DocsLayout-XB55R7YG.mjs.map
|
|
3463
|
+
//# sourceMappingURL=DocsLayout-XB55R7YG.mjs.map
|