zudoku 0.13.1 → 0.13.3

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.
Files changed (85) hide show
  1. package/dist/config/validators/InputSidebarSchema.d.ts +19 -4
  2. package/dist/config/validators/InputSidebarSchema.js +7 -28
  3. package/dist/config/validators/InputSidebarSchema.js.map +1 -1
  4. package/dist/config/validators/SidebarSchema.js +5 -6
  5. package/dist/config/validators/SidebarSchema.js.map +1 -1
  6. package/dist/config/validators/validate.d.ts +6 -6
  7. package/dist/lib/components/MobileTopNavigation.js +1 -1
  8. package/dist/lib/components/MobileTopNavigation.js.map +1 -1
  9. package/dist/lib/components/navigation/Sidebar.js +1 -1
  10. package/dist/lib/components/navigation/Sidebar.js.map +1 -1
  11. package/dist/lib/components/navigation/SidebarCategory.js +18 -7
  12. package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
  13. package/dist/lib/components/navigation/SidebarItem.js +12 -5
  14. package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
  15. package/dist/lib/plugins/custom-pages/CustomPage.js +2 -1
  16. package/dist/lib/plugins/custom-pages/CustomPage.js.map +1 -1
  17. package/dist/lib/plugins/markdown/MdxPage.js +1 -1
  18. package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
  19. package/dist/lib/plugins/openapi/playground/Playground.js +1 -0
  20. package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -1
  21. package/dist/vite/plugin-mdx.js +17 -0
  22. package/dist/vite/plugin-mdx.js.map +1 -1
  23. package/lib/{AuthenticationPlugin-CbgJ5SAh.js → AuthenticationPlugin-D1nhROkO.js} +3 -3
  24. package/lib/{AuthenticationPlugin-CbgJ5SAh.js.map → AuthenticationPlugin-D1nhROkO.js.map} +1 -1
  25. package/lib/CategoryHeading-B7TlPvuN.js +10 -0
  26. package/lib/CategoryHeading-B7TlPvuN.js.map +1 -0
  27. package/lib/{DeveloperHint-CiXPc9Xm.js → DeveloperHint-B_QCCafl.js} +2 -2
  28. package/lib/{DeveloperHint-CiXPc9Xm.js.map → DeveloperHint-B_QCCafl.js.map} +1 -1
  29. package/lib/ErrorPage-DqqAV1dr.js +16 -0
  30. package/lib/{ErrorPage-B-zoPPVx.js.map → ErrorPage-DqqAV1dr.js.map} +1 -1
  31. package/lib/{Input-QMLhK7Rb.js → Input-a9rLgbP_.js} +4 -4
  32. package/lib/{Input-QMLhK7Rb.js.map → Input-a9rLgbP_.js.map} +1 -1
  33. package/lib/{Markdown-D6Nze6qq.js → Markdown-Y__eLG0x.js} +5677 -3406
  34. package/lib/Markdown-Y__eLG0x.js.map +1 -0
  35. package/lib/{MdxPage-DBhq6-5F.js → MdxPage-B4FcPIi5.js} +15 -15
  36. package/lib/MdxPage-B4FcPIi5.js.map +1 -0
  37. package/lib/{OperationList-Ba24gUd2.js → OperationList-BhLMwPSh.js} +23 -23
  38. package/lib/{OperationList-Ba24gUd2.js.map → OperationList-BhLMwPSh.js.map} +1 -1
  39. package/lib/{Route-DI38nxYt.js → Route-fK1i4Ryz.js} +3 -3
  40. package/lib/{Route-DI38nxYt.js.map → Route-fK1i4Ryz.js.map} +1 -1
  41. package/lib/{SidebarBadge-B9-VJSQr.js → SidebarBadge-BdzN0ZBK.js} +3 -3
  42. package/lib/{SidebarBadge-B9-VJSQr.js.map → SidebarBadge-BdzN0ZBK.js.map} +1 -1
  43. package/lib/{SlotletProvider-Cb8mGpBO.js → SlotletProvider-DmqWiVFt.js} +17 -16
  44. package/lib/{SlotletProvider-Cb8mGpBO.js.map → SlotletProvider-DmqWiVFt.js.map} +1 -1
  45. package/lib/{ZudokuContext-BEmsYQoq.js → ZudokuContext-MRoel6bS.js} +2 -2
  46. package/lib/{ZudokuContext-BEmsYQoq.js.map → ZudokuContext-MRoel6bS.js.map} +1 -1
  47. package/lib/{index-dgcPryXi.js → index-BijFM__9.js} +3 -3
  48. package/lib/{index-dgcPryXi.js.map → index-BijFM__9.js.map} +1 -1
  49. package/lib/{index-BRCiYFaL.js → index-DFN92YJN.js} +3 -2
  50. package/lib/{index-BRCiYFaL.js.map → index-DFN92YJN.js.map} +1 -1
  51. package/lib/{index-g_JJcuFg.js → index-_GxJ8hpM.js} +35 -36
  52. package/lib/{index-g_JJcuFg.js.map → index-_GxJ8hpM.js.map} +1 -1
  53. package/lib/{index-DA74gNq3.js → index-dHVZhVNO.js} +111 -111
  54. package/lib/index-dHVZhVNO.js.map +1 -0
  55. package/lib/{router-Oe6YmY6B.js → router-BsfSoK2j.js} +3 -3
  56. package/lib/{router-Oe6YmY6B.js.map → router-BsfSoK2j.js.map} +1 -1
  57. package/lib/{useExposedProps-Csw8oAlt.js → useExposedProps-BWwxa-Hg.js} +2 -2
  58. package/lib/{useExposedProps-Csw8oAlt.js.map → useExposedProps-BWwxa-Hg.js.map} +1 -1
  59. package/lib/{utils-Chi3p5nE.js → utils-C8S3st2k.js} +3 -3
  60. package/lib/{utils-Chi3p5nE.js.map → utils-C8S3st2k.js.map} +1 -1
  61. package/lib/zudoku.auth-clerk.js +1 -1
  62. package/lib/zudoku.auth-openid.js +5 -5
  63. package/lib/zudoku.components.js +650 -644
  64. package/lib/zudoku.components.js.map +1 -1
  65. package/lib/zudoku.plugin-api-keys.js +7 -7
  66. package/lib/zudoku.plugin-custom-pages.js +14 -14
  67. package/lib/zudoku.plugin-custom-pages.js.map +1 -1
  68. package/lib/zudoku.plugin-markdown.js +1 -1
  69. package/lib/zudoku.plugin-openapi.js +7 -7
  70. package/lib/zudoku.plugin-redirect.js +1 -1
  71. package/package.json +1 -1
  72. package/src/app/main.css +0 -1
  73. package/src/lib/components/MobileTopNavigation.tsx +1 -1
  74. package/src/lib/components/navigation/Sidebar.tsx +1 -1
  75. package/src/lib/components/navigation/SidebarCategory.tsx +34 -26
  76. package/src/lib/components/navigation/SidebarItem.tsx +16 -17
  77. package/src/lib/plugins/custom-pages/CustomPage.tsx +4 -1
  78. package/src/lib/plugins/markdown/MdxPage.tsx +10 -8
  79. package/src/lib/plugins/openapi/playground/Playground.tsx +1 -0
  80. package/lib/ErrorPage-B-zoPPVx.js +0 -15
  81. package/lib/Markdown-D6Nze6qq.js.map +0 -1
  82. package/lib/MdxPage-DBhq6-5F.js.map +0 -1
  83. package/lib/cn-BmFQLtkS.js +0 -2279
  84. package/lib/cn-BmFQLtkS.js.map +0 -1
  85. package/lib/index-DA74gNq3.js.map +0 -1
@@ -1,13 +1,13 @@
1
1
  import { j as e } from "./jsx-runtime-B6kdoens.js";
2
- import { S as x, R as f } from "./SlotletProvider-Cb8mGpBO.js";
3
- import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-QMLhK7Rb.js";
4
- import { a as N, L as u, O as I } from "./index-BRCiYFaL.js";
5
- import { u as h, a as E, b as S } from "./ZudokuContext-BEmsYQoq.js";
6
- import { B as l, n as A } from "./index-g_JJcuFg.js";
7
- import { D as C } from "./DeveloperHint-CiXPc9Xm.js";
2
+ import { S as x, R as f } from "./SlotletProvider-DmqWiVFt.js";
3
+ import { u as g, a as d, I as j, S as v, b as w, c as b, d as k, e as K, f as m } from "./Input-a9rLgbP_.js";
4
+ import { a as N, L as u, O as I } from "./index-DFN92YJN.js";
5
+ import { u as h, a as E, b as S } from "./ZudokuContext-MRoel6bS.js";
6
+ import { B as l, n as A } from "./index-_GxJ8hpM.js";
7
+ import { D as C } from "./DeveloperHint-B_QCCafl.js";
8
8
  import { RotateCwIcon as P, TrashIcon as D, EyeOffIcon as R, EyeIcon as q, CheckIcon as O, CopyIcon as z } from "lucide-react";
9
9
  import { useState as p } from "react";
10
- import { c as T } from "./cn-BmFQLtkS.js";
10
+ import { a as T } from "./Markdown-Y__eLG0x.js";
11
11
  function c(t, s) {
12
12
  if (t)
13
13
  return;
@@ -1,18 +1,18 @@
1
- import { j as s } from "./jsx-runtime-B6kdoens.js";
2
- import n from "react";
3
- import { c as a } from "./cn-BmFQLtkS.js";
4
- import { u as c } from "./useExposedProps-Csw8oAlt.js";
5
- const u = ({
6
- element: e,
7
- render: t,
8
- prose: o = !0
1
+ import { j as o } from "./jsx-runtime-B6kdoens.js";
2
+ import a from "react";
3
+ import { a as n, P as u } from "./Markdown-Y__eLG0x.js";
4
+ import { u as c } from "./useExposedProps-BWwxa-Hg.js";
5
+ const l = ({
6
+ element: t,
7
+ render: s,
8
+ prose: e = !0
9
9
  }) => {
10
- const r = c(), m = t ? n.createElement(t, r) : e;
11
- return /* @__PURE__ */ s.jsx("div", { className: a(o && "prose max-w-full"), children: m });
12
- }, f = (e) => ({
13
- getRoutes: () => e.map(({ path: t, ...o }) => ({
14
- path: t,
15
- element: /* @__PURE__ */ s.jsx(u, { ...o })
10
+ const r = c(), m = s ? a.createElement(s, r) : t;
11
+ return /* @__PURE__ */ o.jsx("div", { className: n(e && u, "max-w-full"), children: m });
12
+ }, f = (t) => ({
13
+ getRoutes: () => t.map(({ path: s, ...e }) => ({
14
+ path: s,
15
+ element: /* @__PURE__ */ o.jsx(l, { ...e })
16
16
  }))
17
17
  });
18
18
  export {
@@ -1 +1 @@
1
- {"version":3,"file":"zudoku.plugin-custom-pages.js","sources":["../src/lib/plugins/custom-pages/CustomPage.tsx","../src/lib/plugins/custom-pages/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { cn } from \"../../util/cn.js\";\nimport { useExposedProps } from \"../../util/useExposedProps.js\";\nimport type { CustomPageConfig } from \"./index.js\";\n\nexport const CustomPage = ({\n element,\n render,\n prose = true,\n}: Omit<CustomPageConfig, \"path\">) => {\n const slotletProps = useExposedProps();\n const content = render ? React.createElement(render, slotletProps) : element;\n\n return <div className={cn(prose && \"prose max-w-full\")}>{content}</div>;\n};\n","import { type ComponentType, type ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\nimport { type ExposedComponentProps } from \"../../components/SlotletProvider.js\";\nimport type { DevPortalPlugin, NavigationPlugin } from \"../../core/plugins.js\";\nimport { CustomPage } from \"./CustomPage.js\";\n\nexport type CustomPageConfig = {\n path: string;\n prose?: boolean;\n element?: ReactNode;\n render?: ComponentType<ExposedComponentProps>;\n};\n\nexport const customPagesPlugin = (\n config: CustomPageConfig[],\n): DevPortalPlugin & NavigationPlugin => {\n return {\n getRoutes: (): RouteObject[] =>\n config.map(({ path, ...props }) => ({\n path,\n element: <CustomPage {...props} />,\n })),\n };\n};\n"],"names":["CustomPage","element","render","prose","slotletProps","useExposedProps","content","React","cn","customPagesPlugin","config","path","props","jsx"],"mappings":";;;;AAKO,MAAMA,IAAa,CAAC;AAAA,EACzB,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,MAAsC;AACpC,QAAMC,IAAeC,KACfC,IAAUJ,IAASK,EAAM,cAAcL,GAAQE,CAAY,IAAIH;AAErE,+BAAQ,OAAI,EAAA,WAAWO,EAAGL,KAAS,kBAAkB,GAAI,UAAQG,EAAA,CAAA;AACnE,GCDaG,IAAoB,CAC/BC,OAEO;AAAA,EACL,WAAW,MACTA,EAAO,IAAI,CAAC,EAAE,MAAAC,GAAM,GAAGC,SAAa;AAAA,IAClC,MAAAD;AAAA,IACA,SAASE,gBAAAA,EAAAA,IAACb,GAAY,EAAA,GAAGY,EAAO,CAAA;AAAA,EAAA,EAChC;AAAA;"}
1
+ {"version":3,"file":"zudoku.plugin-custom-pages.js","sources":["../src/lib/plugins/custom-pages/CustomPage.tsx","../src/lib/plugins/custom-pages/index.tsx"],"sourcesContent":["import React from \"react\";\nimport { ProseClasses } from \"../../components/Markdown.js\";\nimport { cn } from \"../../util/cn.js\";\nimport { useExposedProps } from \"../../util/useExposedProps.js\";\nimport type { CustomPageConfig } from \"./index.js\";\n\nexport const CustomPage = ({\n element,\n render,\n prose = true,\n}: Omit<CustomPageConfig, \"path\">) => {\n const slotletProps = useExposedProps();\n const content = render ? React.createElement(render, slotletProps) : element;\n\n return (\n <div className={cn(prose && ProseClasses, \"max-w-full\")}>{content}</div>\n );\n};\n","import { type ComponentType, type ReactNode } from \"react\";\nimport type { RouteObject } from \"react-router-dom\";\nimport { type ExposedComponentProps } from \"../../components/SlotletProvider.js\";\nimport type { DevPortalPlugin, NavigationPlugin } from \"../../core/plugins.js\";\nimport { CustomPage } from \"./CustomPage.js\";\n\nexport type CustomPageConfig = {\n path: string;\n prose?: boolean;\n element?: ReactNode;\n render?: ComponentType<ExposedComponentProps>;\n};\n\nexport const customPagesPlugin = (\n config: CustomPageConfig[],\n): DevPortalPlugin & NavigationPlugin => {\n return {\n getRoutes: (): RouteObject[] =>\n config.map(({ path, ...props }) => ({\n path,\n element: <CustomPage {...props} />,\n })),\n };\n};\n"],"names":["CustomPage","element","render","prose","slotletProps","useExposedProps","content","React","jsx","cn","ProseClasses","customPagesPlugin","config","path","props"],"mappings":";;;;AAMO,MAAMA,IAAa,CAAC;AAAA,EACzB,SAAAC;AAAA,EACA,QAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,MAAsC;AACpC,QAAMC,IAAeC,KACfC,IAAUJ,IAASK,EAAM,cAAcL,GAAQE,CAAY,IAAIH;AAGnE,SAAAO,gBAAAA,MAAC,SAAI,WAAWC,EAAGN,KAASO,GAAc,YAAY,GAAI,UAAQJ,EAAA,CAAA;AAEtE,GCJaK,IAAoB,CAC/BC,OAEO;AAAA,EACL,WAAW,MACTA,EAAO,IAAI,CAAC,EAAE,MAAAC,GAAM,GAAGC,SAAa;AAAA,IAClC,MAAAD;AAAA,IACA,SAASL,gBAAAA,EAAAA,IAACR,GAAY,EAAA,GAAGc,EAAO,CAAA;AAAA,EAAA,EAChC;AAAA;"}
@@ -6,7 +6,7 @@ const x = (t, e, n) => Object.entries(t).flatMap(([a, p]) => {
6
6
  return s ? {
7
7
  path: s,
8
8
  lazy: async () => {
9
- const { MdxPage: i } = await import("./MdxPage-DBhq6-5F.js"), { default: m, ...l } = await p();
9
+ const { MdxPage: i } = await import("./MdxPage-B4FcPIi5.js"), { default: m, ...l } = await p();
10
10
  return {
11
11
  element: /* @__PURE__ */ u.jsx(
12
12
  i,
@@ -1,15 +1,15 @@
1
1
  import "./jsx-runtime-B6kdoens.js";
2
- import { o as u } from "./index-DA74gNq3.js";
3
- import "./ZudokuContext-BEmsYQoq.js";
2
+ import { o as u } from "./index-dHVZhVNO.js";
3
+ import "./ZudokuContext-MRoel6bS.js";
4
4
  import "lucide-react";
5
5
  import "zudoku/openapi-worker";
6
- import "./index-g_JJcuFg.js";
7
- import "./ErrorPage-B-zoPPVx.js";
8
- import "./Markdown-D6Nze6qq.js";
6
+ import "./index-_GxJ8hpM.js";
7
+ import "./ErrorPage-DqqAV1dr.js";
8
+ import "./Markdown-Y__eLG0x.js";
9
9
  import "./joinPath-B7kNnUX4.js";
10
10
  import "./urql-core-KJnLL26g.js";
11
- import "./router-Oe6YmY6B.js";
12
- import "./index-BRCiYFaL.js";
11
+ import "./router-BsfSoK2j.js";
12
+ import "./index-DFN92YJN.js";
13
13
  export {
14
14
  u as openApiPlugin
15
15
  };
@@ -1,4 +1,4 @@
1
- import { r as o } from "./router-Oe6YmY6B.js";
1
+ import { r as o } from "./router-BsfSoK2j.js";
2
2
  const a = (r) => ({
3
3
  getRoutes: () => r.redirects.map(({ from: e, to: t }) => ({
4
4
  path: e,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.13.1",
3
+ "version": "0.13.3",
4
4
  "type": "module",
5
5
  "homepage": "https://zudoku.dev",
6
6
  "repository": {
package/src/app/main.css CHANGED
@@ -142,7 +142,6 @@
142
142
  .CollapsibleContent {
143
143
  --easing: cubic-bezier(0.4, 0, 0.2, 1);
144
144
  --slide-offset: -0.75rem;
145
- @apply overflow-hidden;
146
145
  }
147
146
  .CollapsibleContent[data-state="open"] {
148
147
  animation: slideDown 300ms var(--easing);
@@ -22,7 +22,7 @@ export const MobileTopNavigation = () => {
22
22
  </DrawerTrigger>
23
23
  </div>
24
24
  <DrawerContent
25
- className="lg:hidden h-screen right-0 left-auto w-[320px] rounded-none"
25
+ className="lg:hidden h-screen right-0 left-auto w-[320px] rounded-none overflow-auto"
26
26
  aria-describedby={undefined}
27
27
  >
28
28
  <VisuallyHidden>
@@ -24,7 +24,7 @@ export const Sidebar = () => {
24
24
  <Slotlet name="zudoku-after-navigation" />
25
25
  </SidebarWrapper>
26
26
  <DrawerContent
27
- className="lg:hidden h-screen left-0 p-6 w-[320px] rounded-none"
27
+ className="lg:hidden h-screen left-0 p-6 w-[320px] rounded-none overflow-auto"
28
28
  aria-describedby={undefined}
29
29
  >
30
30
  <VisuallyHidden>
@@ -1,7 +1,7 @@
1
1
  import * as Collapsible from "@radix-ui/react-collapsible";
2
2
  import { ChevronRightIcon } from "lucide-react";
3
3
  import { useEffect, useState } from "react";
4
- import { NavLink } from "react-router-dom";
4
+ import { NavLink, useMatch } from "react-router-dom";
5
5
  import type { SidebarItemCategory } from "../../../config/validators/SidebarSchema.js";
6
6
  import { cn } from "../../util/cn.js";
7
7
  import { joinPath } from "../../util/joinPath.js";
@@ -26,6 +26,7 @@ export const SidebarCategory = ({
26
26
  !isCollapsible || !isCollapsed || isCategoryOpen,
27
27
  );
28
28
  const [open, setOpen] = useState(isDefaultOpen);
29
+ const isActive = useMatch(joinPath(topNavItem?.id, category.link?.id));
29
30
 
30
31
  useEffect(() => {
31
32
  // this is triggered when an item from the sidebar is clicked
@@ -56,46 +57,54 @@ export const SidebarCategory = ({
56
57
 
57
58
  return (
58
59
  <Collapsible.Root
59
- className={cn("flex flex-col", level === 0 && "-mx-[--padding-nav-item]")}
60
+ className="flex flex-col"
60
61
  defaultOpen={isDefaultOpen}
61
62
  open={open}
62
63
  onOpenChange={() => setOpen(true)}
63
64
  >
64
65
  <Collapsible.Trigger className="group" asChild disabled={!isCollapsible}>
65
66
  <div
66
- className={cn(
67
- "text-start",
68
- navigationListItem({ isActive: false, isTopLevel: level === 0 }),
69
- isCollapsible
70
- ? "cursor-pointer"
71
- : "cursor-default hover:bg-transparent",
72
- )}
67
+ onClick={() => setHasInteracted(true)}
68
+ className={navigationListItem({
69
+ isActive: false,
70
+ isTopLevel: level === 0,
71
+ className: [
72
+ "text-start",
73
+ isCollapsible
74
+ ? "cursor-pointer"
75
+ : "cursor-default hover:bg-transparent",
76
+ ],
77
+ })}
73
78
  >
74
79
  {category.icon && (
75
80
  <category.icon
76
81
  size={16}
77
- className="align-[-0.125em] -translate-x-1"
82
+ className={cn(
83
+ "align-[-0.125em] -translate-x-1",
84
+ isActive && "text-primary",
85
+ )}
78
86
  />
79
87
  )}
80
88
  {category.link?.type === "doc" ? (
81
89
  <NavLink
82
90
  to={joinPath(topNavItem?.id, category.link.id)}
83
91
  className="flex-1"
84
- onClick={() => setHasInteracted(true)}
92
+ onClick={() => {
93
+ // if it is the current path and closed then open it because there's no path change to trigger the open
94
+ if (isActive && !open) {
95
+ setOpen(true);
96
+ }
97
+ }}
85
98
  >
86
- {({ isActive }) => (
87
- <div
88
- className={cn(
89
- "flex items-center gap-2 justify-between w-full",
90
- isActive
91
- ? "text-primary font-medium"
92
- : "text-foreground/80",
93
- )}
94
- >
95
- <div className="truncate">{category.label}</div>
96
- {ToggleButton}
97
- </div>
98
- )}
99
+ <div
100
+ className={cn(
101
+ "flex items-center gap-2 justify-between w-full",
102
+ isActive ? "text-primary" : "text-foreground/80",
103
+ )}
104
+ >
105
+ <div className="truncate">{category.label}</div>
106
+ {ToggleButton}
107
+ </div>
99
108
  </NavLink>
100
109
  ) : (
101
110
  <div className="flex items-center justify-between w-full">
@@ -109,10 +118,9 @@ export const SidebarCategory = ({
109
118
  className={cn(
110
119
  // CollapsibleContent class is used to animate and it should only be applied when the user has triggered the toggle
111
120
  hasInteracted && "CollapsibleContent",
112
- "ms-[calc(var(--padding-nav-item)*1.125)]",
113
121
  )}
114
122
  >
115
- <ul className="mt-1 border-l ps-2">
123
+ <ul className="mt-1 border-l ms-0.5">
116
124
  {category.items.map((item) => (
117
125
  <SidebarItem
118
126
  key={
@@ -3,7 +3,6 @@ import { ExternalLinkIcon } from "lucide-react";
3
3
  import { NavLink, useSearchParams } from "react-router-dom";
4
4
 
5
5
  import type { SidebarItem as SidebarItemType } from "../../../config/validators/SidebarSchema.js";
6
- import { cn } from "../../util/cn.js";
7
6
  import { joinPath } from "../../util/joinPath.js";
8
7
  import { AnchorLink } from "../AnchorLink.js";
9
8
  import { useViewportAnchor } from "../context/ViewportAnchorContext.js";
@@ -16,7 +15,8 @@ export const navigationListItem = cva(
16
15
  {
17
16
  variants: {
18
17
  isTopLevel: {
19
- true: "font-semibold",
18
+ true: "font-medium -mx-[--padding-nav-item]",
19
+ false: "-mr-[--padding-nav-item] ml-[--padding-nav-item]",
20
20
  },
21
21
  isActive: {
22
22
  true: "text-primary font-medium",
@@ -27,6 +27,9 @@ export const navigationListItem = cva(
27
27
  false: "",
28
28
  },
29
29
  },
30
+ defaultVariants: {
31
+ isActive: false,
32
+ },
30
33
  },
31
34
  );
32
35
 
@@ -58,7 +61,7 @@ export const SidebarItem = ({
58
61
  {item.icon && <item.icon size={16} className="align-[-0.125em]" />}
59
62
  {item.badge ? (
60
63
  <>
61
- <span className="truncate" title={item.label}>
64
+ <span className="truncate flex-1" title={item.label}>
62
65
  {item.label}
63
66
  </span>
64
67
  <SidebarBadge {...item.badge} />
@@ -73,13 +76,11 @@ export const SidebarItem = ({
73
76
  <AnchorLink
74
77
  to={{ hash: item.href, search: searchParams.toString() }}
75
78
  {...{ [DATA_ANCHOR_ATTR]: item.href.slice(1) }}
76
- className={cn(
77
- "flex gap-2.5 justify-between",
78
- level === 0 && "-mx-[--padding-nav-item]",
79
- navigationListItem({
80
- isActive: item.href.slice(1) === activeAnchor,
81
- }),
82
- )}
79
+ className={navigationListItem({
80
+ isActive: item.href.slice(1) === activeAnchor,
81
+ isTopLevel: level === 0,
82
+ className: item.badge?.placement !== "start" && "justify-between",
83
+ })}
83
84
  >
84
85
  {item.badge ? (
85
86
  <>
@@ -94,7 +95,9 @@ export const SidebarItem = ({
94
95
  </AnchorLink>
95
96
  ) : !item.href.startsWith("http") ? (
96
97
  <NavLink
97
- className={cn("flex gap-2.5 justify-between", navigationListItem())}
98
+ className={navigationListItem({
99
+ className: item.badge?.placement !== "start" && "justify-between",
100
+ })}
98
101
  to={item.href}
99
102
  >
100
103
  {item.badge ? (
@@ -110,10 +113,7 @@ export const SidebarItem = ({
110
113
  </NavLink>
111
114
  ) : (
112
115
  <a
113
- className={cn(
114
- navigationListItem({ isTopLevel: level === 0 }),
115
- "block",
116
- )}
116
+ className={navigationListItem({ isTopLevel: level === 0 })}
117
117
  href={item.href}
118
118
  target="_blank"
119
119
  rel="noopener noreferrer"
@@ -121,8 +121,7 @@ export const SidebarItem = ({
121
121
  <span className="whitespace-normal">{item.label}</span>
122
122
  {/* This prevents that the icon would be positioned in its own line if the text fills a line entirely */}
123
123
  <span className="whitespace-nowrap">
124
- &nbsp;
125
- <ExternalLinkIcon className="inline ml-1" size={12} />
124
+ <ExternalLinkIcon className="inline -translate-y-0.5" size={12} />
126
125
  </span>
127
126
  </a>
128
127
  );
@@ -1,4 +1,5 @@
1
1
  import React from "react";
2
+ import { ProseClasses } from "../../components/Markdown.js";
2
3
  import { cn } from "../../util/cn.js";
3
4
  import { useExposedProps } from "../../util/useExposedProps.js";
4
5
  import type { CustomPageConfig } from "./index.js";
@@ -11,5 +12,7 @@ export const CustomPage = ({
11
12
  const slotletProps = useExposedProps();
12
13
  const content = render ? React.createElement(render, slotletProps) : element;
13
14
 
14
- return <div className={cn(prose && "prose max-w-full")}>{content}</div>;
15
+ return (
16
+ <div className={cn(prose && ProseClasses, "max-w-full")}>{content}</div>
17
+ );
15
18
  };
@@ -68,14 +68,16 @@ export const MdxPage = ({
68
68
  "max-w-full xl:w-full xl:max-w-prose flex-1 flex-shrink pt-[--padding-content-top] pb-[--padding-content-bottom]",
69
69
  )}
70
70
  >
71
- <header>
72
- {category && <CategoryHeading>{category}</CategoryHeading>}
73
- {title && (
74
- <Heading level={1} id={slugify(title)}>
75
- {title}
76
- </Heading>
77
- )}
78
- </header>
71
+ {(category || title) && (
72
+ <header>
73
+ {category && <CategoryHeading>{category}</CategoryHeading>}
74
+ {title && (
75
+ <Heading level={1} id={slugify(title)}>
76
+ {title}
77
+ </Heading>
78
+ )}
79
+ </header>
80
+ )}
79
81
  <MdxComponent
80
82
  components={{ ...useMDXComponents(), ...MarkdownHeadings }}
81
83
  />
@@ -129,6 +129,7 @@ export const Playground = ({
129
129
  .filter((h) => h.name)
130
130
  .map((header) => [header.name, header.value]),
131
131
  ),
132
+ body: data.body ? data.body : undefined,
132
133
  });
133
134
 
134
135
  if (data.identity !== NO_IDENTITY) {
@@ -1,15 +0,0 @@
1
- import { j as e } from "./jsx-runtime-B6kdoens.js";
2
- import { P as n, C as o, H as i } from "./Markdown-D6Nze6qq.js";
3
- const c = ({
4
- title: r = "An error occurred",
5
- message: a,
6
- category: s
7
- }) => /* @__PURE__ */ e.jsxs("div", { className: n + " h-full pt-[--padding-content-top]", children: [
8
- s && /* @__PURE__ */ e.jsx(o, { children: s }),
9
- r && /* @__PURE__ */ e.jsx(i, { level: 1, className: "flex gap-3.5 items-center", children: r }),
10
- /* @__PURE__ */ e.jsx("p", { children: a })
11
- ] });
12
- export {
13
- c as E
14
- };
15
- //# sourceMappingURL=ErrorPage-B-zoPPVx.js.map