zudoku 0.1.1-dev.15 → 0.1.1-dev.16

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 (387) hide show
  1. package/dist/app/App.js +3 -1
  2. package/dist/app/App.js.map +1 -1
  3. package/dist/config/config.d.ts +3 -3
  4. package/dist/index.d.ts +2 -6
  5. package/dist/index.js +1 -5
  6. package/dist/index.js.map +1 -1
  7. package/dist/{app → lib}/DevPortal.d.ts +2 -2
  8. package/dist/{app → lib}/DevPortal.js +4 -4
  9. package/dist/{app → lib}/DevPortal.js.map +1 -1
  10. package/dist/{app → lib}/Heading.js.map +1 -1
  11. package/dist/{app → lib}/Router.js.map +1 -1
  12. package/dist/lib/auth.d.ts +1 -0
  13. package/dist/lib/auth.js +2 -0
  14. package/dist/lib/auth.js.map +1 -0
  15. package/dist/lib/authentication/authentication.js.map +1 -0
  16. package/dist/{app → lib}/authentication/clerk.d.ts +1 -2
  17. package/dist/{app → lib}/authentication/clerk.js +1 -2
  18. package/dist/lib/authentication/clerk.js.map +1 -0
  19. package/dist/{app → lib}/authentication/openid.js.map +1 -1
  20. package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
  21. package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
  22. package/dist/{app → lib}/components/Dialog.js.map +1 -1
  23. package/dist/{app → lib}/components/DynamicIcon.js.map +1 -1
  24. package/dist/{app → lib}/components/Header.js.map +1 -1
  25. package/dist/{app → lib}/components/Input.js.map +1 -1
  26. package/dist/{app → lib}/components/Layout.js.map +1 -1
  27. package/dist/{app → lib}/components/Markdown.js.map +1 -1
  28. package/dist/{app → lib}/components/SyntaxHighlight.js.map +1 -1
  29. package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
  30. package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
  31. package/dist/{app → lib}/components/context/DevPortalProvider.js.map +1 -1
  32. package/dist/lib/components/context/PluginSystem.js.map +1 -0
  33. package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
  34. package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
  35. package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
  36. package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
  37. package/dist/{app → lib}/components/navigation/SideNavigationItem.js.map +1 -1
  38. package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js.map +1 -1
  39. package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
  40. package/dist/{app → lib}/components/navigation/util.js.map +1 -1
  41. package/dist/lib/components.d.ts +3 -0
  42. package/dist/lib/components.js +4 -0
  43. package/dist/lib/components.js.map +1 -0
  44. package/dist/{app → lib}/core/DevPortalContext.js.map +1 -1
  45. package/dist/{app → lib}/core/helmet.js.map +1 -1
  46. package/dist/lib/core/icons.js.map +1 -0
  47. package/dist/{app → lib}/core/plugins.js.map +1 -1
  48. package/dist/lib/core/router.js.map +1 -0
  49. package/dist/lib/core/types/combine.js.map +1 -0
  50. package/dist/{app → lib}/oas/graphql/index.js.map +1 -1
  51. package/dist/{app → lib}/oas/graphql/server.js.map +1 -1
  52. package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
  53. package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
  54. package/dist/{app → lib}/oas/parser/index.js.map +1 -1
  55. package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
  56. package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js.map +1 -1
  57. package/dist/{app → lib}/plugins/api-key/index.js.map +1 -1
  58. package/dist/{app → lib}/plugins/markdown/MdxPage.js.map +1 -1
  59. package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
  60. package/dist/{app → lib}/plugins/markdown/generateRoutes.js.map +1 -1
  61. package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
  62. package/dist/{app → lib}/plugins/openapi/ColorizedParam.js.map +1 -1
  63. package/dist/{app → lib}/plugins/openapi/MakeRequest.js.map +1 -1
  64. package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
  65. package/dist/{app → lib}/plugins/openapi/OperationList.js.map +1 -1
  66. package/dist/{app → lib}/plugins/openapi/OperationListItem.js.map +1 -1
  67. package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
  68. package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
  69. package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js.map +1 -1
  70. package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js.map +1 -1
  71. package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
  72. package/dist/{app → lib}/plugins/openapi/Sidecar.js.map +1 -1
  73. package/dist/{app → lib}/plugins/openapi/SidecarBox.js.map +1 -1
  74. package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js.map +1 -1
  75. package/dist/{app → lib}/plugins/openapi/graphql/gql.js.map +1 -1
  76. package/dist/{app → lib}/plugins/openapi/graphql/graphql.js.map +1 -1
  77. package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
  78. package/dist/{app → lib}/plugins/openapi/index.js.map +1 -1
  79. package/dist/{app → lib}/plugins/openapi/playground/Playground.js.map +1 -1
  80. package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js.map +1 -1
  81. package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
  82. package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -1
  83. package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
  84. package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
  85. package/dist/lib/plugins.d.ts +4 -0
  86. package/dist/lib/plugins.js +6 -0
  87. package/dist/lib/plugins.js.map +1 -0
  88. package/dist/{app → lib}/ui/Button.d.ts +1 -1
  89. package/dist/{app → lib}/ui/Button.js.map +1 -1
  90. package/dist/{app → lib}/ui/Callout.js.map +1 -1
  91. package/dist/{app → lib}/ui/Card.js.map +1 -1
  92. package/dist/{app → lib}/ui/Note.js.map +1 -1
  93. package/dist/{app → lib}/ui/Tabs.js.map +1 -1
  94. package/dist/{app → lib}/util/MdxComponents.js.map +1 -1
  95. package/dist/{app → lib}/util/cn.js.map +1 -1
  96. package/dist/{app → lib}/util/createVariantComponent.js.map +1 -1
  97. package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
  98. package/dist/{app → lib}/util/groupBy.js.map +1 -1
  99. package/dist/{app → lib}/util/joinPath.js.map +1 -1
  100. package/dist/{app → lib}/util/pastellize.js.map +1 -1
  101. package/dist/lib/util/slugify.js.map +1 -0
  102. package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
  103. package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
  104. package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
  105. package/dist/vite/config.d.ts +0 -1
  106. package/dist/vite/config.js +18 -14
  107. package/dist/vite/config.js.map +1 -1
  108. package/dist/vite/dev-server.js +1 -1
  109. package/dist/vite/plugin-api.js +1 -1
  110. package/dist/vite/plugin-api.js.map +1 -1
  111. package/dist/vite/plugin-auth.js +2 -2
  112. package/dist/vite/plugin-auth.js.map +1 -1
  113. package/dist/vite/plugin-component.d.ts +3 -0
  114. package/dist/vite/plugin-component.js +22 -0
  115. package/dist/vite/plugin-component.js.map +1 -0
  116. package/dist/vite/plugin-docs.js +1 -1
  117. package/dist/vite/plugin-docs.js.map +1 -1
  118. package/dist/vite/plugin-html.js +0 -3
  119. package/dist/vite/plugin-html.js.map +1 -1
  120. package/dist/vite/plugin-mdx.js +1 -1
  121. package/dist/vite/plugin-mdx.js.map +1 -1
  122. package/package.json +15 -16
  123. package/src/app/App.tsx +4 -1
  124. package/dist/app/authentication/authentication.js.map +0 -1
  125. package/dist/app/authentication/clerk.js.map +0 -1
  126. package/dist/app/components/context/PluginSystem.js.map +0 -1
  127. package/dist/app/core/icons.js.map +0 -1
  128. package/dist/app/core/router.js.map +0 -1
  129. package/dist/app/core/types/combine.js.map +0 -1
  130. package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
  131. package/dist/app/util/slugify.js.map +0 -1
  132. package/dist/auth.d.ts +0 -2
  133. package/dist/auth.js +0 -3
  134. package/dist/auth.js.map +0 -1
  135. package/dist/plugins.d.ts +0 -4
  136. package/dist/plugins.js +0 -6
  137. package/dist/plugins.js.map +0 -1
  138. package/src/app/DevPortal.tsx +0 -93
  139. package/src/app/Heading.tsx +0 -60
  140. package/src/app/Router.tsx +0 -28
  141. package/src/app/authentication/authentication.ts +0 -18
  142. package/src/app/authentication/clerk.ts +0 -47
  143. package/src/app/authentication/openid.ts +0 -192
  144. package/src/app/components/AnchorLink.tsx +0 -19
  145. package/src/app/components/CategoryHeading.tsx +0 -16
  146. package/src/app/components/Dialog.tsx +0 -119
  147. package/src/app/components/DynamicIcon.tsx +0 -60
  148. package/src/app/components/Header.tsx +0 -69
  149. package/src/app/components/Input.tsx +0 -24
  150. package/src/app/components/Layout.tsx +0 -56
  151. package/src/app/components/Markdown.tsx +0 -37
  152. package/src/app/components/SyntaxHighlight.tsx +0 -94
  153. package/src/app/components/TopNavigation.tsx +0 -32
  154. package/src/app/components/context/ComponentsContext.tsx +0 -24
  155. package/src/app/components/context/DevPortalProvider.ts +0 -54
  156. package/src/app/components/context/PluginSystem.ts +0 -0
  157. package/src/app/components/context/ThemeContext.tsx +0 -46
  158. package/src/app/components/context/ViewportAnchorContext.tsx +0 -139
  159. package/src/app/components/navigation/SideNavigation.tsx +0 -18
  160. package/src/app/components/navigation/SideNavigationCategory.tsx +0 -74
  161. package/src/app/components/navigation/SideNavigationItem.tsx +0 -143
  162. package/src/app/components/navigation/SideNavigationWrapper.tsx +0 -15
  163. package/src/app/components/navigation/useNavigationCollapsibleState.ts +0 -27
  164. package/src/app/components/navigation/util.ts +0 -38
  165. package/src/app/core/DevPortalContext.ts +0 -164
  166. package/src/app/core/helmet.ts +0 -5
  167. package/src/app/core/icons.tsx +0 -1
  168. package/src/app/core/plugins.ts +0 -43
  169. package/src/app/core/router.tsx +0 -1
  170. package/src/app/core/types/combine.ts +0 -16
  171. package/src/app/oas/graphql/index.ts +0 -422
  172. package/src/app/oas/graphql/server.ts +0 -10
  173. package/src/app/oas/parser/dereference/index.ts +0 -59
  174. package/src/app/oas/parser/dereference/resolveRef.ts +0 -32
  175. package/src/app/oas/parser/index.ts +0 -94
  176. package/src/app/oas/parser/schemas/v3.0.json +0 -1489
  177. package/src/app/oas/parser/schemas/v3.1.json +0 -1298
  178. package/src/app/oas/parser/upgrade/index.ts +0 -108
  179. package/src/app/plugins/api-key/SettingsApiKeys.tsx +0 -22
  180. package/src/app/plugins/api-key/index.tsx +0 -123
  181. package/src/app/plugins/markdown/MdxPage.tsx +0 -128
  182. package/src/app/plugins/markdown/Toc.tsx +0 -122
  183. package/src/app/plugins/markdown/generateRoutes.tsx +0 -72
  184. package/src/app/plugins/markdown/index.tsx +0 -31
  185. package/src/app/plugins/openapi/ColorizedParam.tsx +0 -82
  186. package/src/app/plugins/openapi/MakeRequest.tsx +0 -49
  187. package/src/app/plugins/openapi/MethodBadge.tsx +0 -36
  188. package/src/app/plugins/openapi/OperationList.tsx +0 -117
  189. package/src/app/plugins/openapi/OperationListItem.tsx +0 -55
  190. package/src/app/plugins/openapi/ParameterList.tsx +0 -32
  191. package/src/app/plugins/openapi/ParameterListItem.tsx +0 -60
  192. package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +0 -51
  193. package/src/app/plugins/openapi/ResponsesSidecarBox.tsx +0 -60
  194. package/src/app/plugins/openapi/Select.tsx +0 -35
  195. package/src/app/plugins/openapi/Sidecar.tsx +0 -160
  196. package/src/app/plugins/openapi/SidecarBox.tsx +0 -36
  197. package/src/app/plugins/openapi/graphql/fragment-masking.ts +0 -111
  198. package/src/app/plugins/openapi/graphql/gql.ts +0 -70
  199. package/src/app/plugins/openapi/graphql/graphql.ts +0 -795
  200. package/src/app/plugins/openapi/graphql/index.ts +0 -2
  201. package/src/app/plugins/openapi/index.tsx +0 -142
  202. package/src/app/plugins/openapi/playground/Playground.tsx +0 -309
  203. package/src/app/plugins/openapi/queries.graphql +0 -6
  204. package/src/app/plugins/openapi/util/generateSchemaExample.ts +0 -59
  205. package/src/app/plugins/openapi/util/urql.ts +0 -8
  206. package/src/app/plugins/openapi/worker/createSharedWorkerClient.ts +0 -60
  207. package/src/app/plugins/openapi/worker/worker.ts +0 -30
  208. package/src/app/plugins/redirect/index.tsx +0 -20
  209. package/src/app/ui/Button.tsx +0 -56
  210. package/src/app/ui/Callout.tsx +0 -87
  211. package/src/app/ui/Card.tsx +0 -82
  212. package/src/app/ui/Note.tsx +0 -58
  213. package/src/app/ui/Tabs.tsx +0 -52
  214. package/src/app/util/MdxComponents.tsx +0 -70
  215. package/src/app/util/cn.ts +0 -6
  216. package/src/app/util/createVariantComponent.tsx +0 -30
  217. package/src/app/util/createWaitForNotify.ts +0 -18
  218. package/src/app/util/groupBy.ts +0 -24
  219. package/src/app/util/joinPath.tsx +0 -10
  220. package/src/app/util/pastellize.ts +0 -25
  221. package/src/app/util/slugify.ts +0 -3
  222. package/src/app/util/traverseNavigation.ts +0 -55
  223. package/src/app/util/useScrollToAnchor.ts +0 -38
  224. package/src/app/util/useScrollToTop.ts +0 -13
  225. /package/dist/{app → lib}/Heading.d.ts +0 -0
  226. /package/dist/{app → lib}/Heading.js +0 -0
  227. /package/dist/{app → lib}/Router.d.ts +0 -0
  228. /package/dist/{app → lib}/Router.js +0 -0
  229. /package/dist/{app → lib}/authentication/authentication.d.ts +0 -0
  230. /package/dist/{app → lib}/authentication/authentication.js +0 -0
  231. /package/dist/{app → lib}/authentication/openid.d.ts +0 -0
  232. /package/dist/{app → lib}/authentication/openid.js +0 -0
  233. /package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
  234. /package/dist/{app → lib}/components/AnchorLink.js +0 -0
  235. /package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
  236. /package/dist/{app → lib}/components/CategoryHeading.js +0 -0
  237. /package/dist/{app → lib}/components/Dialog.d.ts +0 -0
  238. /package/dist/{app → lib}/components/Dialog.js +0 -0
  239. /package/dist/{app → lib}/components/DynamicIcon.d.ts +0 -0
  240. /package/dist/{app → lib}/components/DynamicIcon.js +0 -0
  241. /package/dist/{app → lib}/components/Header.d.ts +0 -0
  242. /package/dist/{app → lib}/components/Header.js +0 -0
  243. /package/dist/{app → lib}/components/Input.d.ts +0 -0
  244. /package/dist/{app → lib}/components/Input.js +0 -0
  245. /package/dist/{app → lib}/components/Layout.d.ts +0 -0
  246. /package/dist/{app → lib}/components/Layout.js +0 -0
  247. /package/dist/{app → lib}/components/Markdown.d.ts +0 -0
  248. /package/dist/{app → lib}/components/Markdown.js +0 -0
  249. /package/dist/{app → lib}/components/SyntaxHighlight.d.ts +0 -0
  250. /package/dist/{app → lib}/components/SyntaxHighlight.js +0 -0
  251. /package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
  252. /package/dist/{app → lib}/components/TopNavigation.js +0 -0
  253. /package/dist/{app → lib}/components/context/ComponentsContext.d.ts +0 -0
  254. /package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
  255. /package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -0
  256. /package/dist/{app → lib}/components/context/DevPortalProvider.js +0 -0
  257. /package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
  258. /package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
  259. /package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
  260. /package/dist/{app → lib}/components/context/ThemeContext.js +0 -0
  261. /package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
  262. /package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
  263. /package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
  264. /package/dist/{app → lib}/components/navigation/SideNavigation.js +0 -0
  265. /package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
  266. /package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +0 -0
  267. /package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +0 -0
  268. /package/dist/{app → lib}/components/navigation/SideNavigationItem.js +0 -0
  269. /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +0 -0
  270. /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js +0 -0
  271. /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -0
  272. /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
  273. /package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
  274. /package/dist/{app → lib}/components/navigation/util.js +0 -0
  275. /package/dist/{app → lib}/core/DevPortalContext.d.ts +0 -0
  276. /package/dist/{app → lib}/core/DevPortalContext.js +0 -0
  277. /package/dist/{app → lib}/core/helmet.d.ts +0 -0
  278. /package/dist/{app → lib}/core/helmet.js +0 -0
  279. /package/dist/{app → lib}/core/icons.d.ts +0 -0
  280. /package/dist/{app → lib}/core/icons.js +0 -0
  281. /package/dist/{app → lib}/core/plugins.d.ts +0 -0
  282. /package/dist/{app → lib}/core/plugins.js +0 -0
  283. /package/dist/{app → lib}/core/router.d.ts +0 -0
  284. /package/dist/{app → lib}/core/router.js +0 -0
  285. /package/dist/{app → lib}/core/types/combine.d.ts +0 -0
  286. /package/dist/{app → lib}/core/types/combine.js +0 -0
  287. /package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
  288. /package/dist/{app → lib}/oas/graphql/index.js +0 -0
  289. /package/dist/{app → lib}/oas/graphql/server.d.ts +0 -0
  290. /package/dist/{app → lib}/oas/graphql/server.js +0 -0
  291. /package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
  292. /package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
  293. /package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
  294. /package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
  295. /package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
  296. /package/dist/{app → lib}/oas/parser/index.js +0 -0
  297. /package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
  298. /package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
  299. /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.d.ts +0 -0
  300. /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js +0 -0
  301. /package/dist/{app → lib}/plugins/api-key/index.d.ts +0 -0
  302. /package/dist/{app → lib}/plugins/api-key/index.js +0 -0
  303. /package/dist/{app → lib}/plugins/markdown/MdxPage.d.ts +0 -0
  304. /package/dist/{app → lib}/plugins/markdown/MdxPage.js +0 -0
  305. /package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
  306. /package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
  307. /package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
  308. /package/dist/{app → lib}/plugins/markdown/generateRoutes.js +0 -0
  309. /package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -0
  310. /package/dist/{app → lib}/plugins/markdown/index.js +0 -0
  311. /package/dist/{app → lib}/plugins/openapi/ColorizedParam.d.ts +0 -0
  312. /package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +0 -0
  313. /package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
  314. /package/dist/{app → lib}/plugins/openapi/MakeRequest.js +0 -0
  315. /package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
  316. /package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
  317. /package/dist/{app → lib}/plugins/openapi/OperationList.d.ts +0 -0
  318. /package/dist/{app → lib}/plugins/openapi/OperationList.js +0 -0
  319. /package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +0 -0
  320. /package/dist/{app → lib}/plugins/openapi/OperationListItem.js +0 -0
  321. /package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +0 -0
  322. /package/dist/{app → lib}/plugins/openapi/ParameterList.js +0 -0
  323. /package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
  324. /package/dist/{app → lib}/plugins/openapi/ParameterListItem.js +0 -0
  325. /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
  326. /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.js +0 -0
  327. /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
  328. /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +0 -0
  329. /package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
  330. /package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
  331. /package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
  332. /package/dist/{app → lib}/plugins/openapi/Sidecar.js +0 -0
  333. /package/dist/{app → lib}/plugins/openapi/SidecarBox.d.ts +0 -0
  334. /package/dist/{app → lib}/plugins/openapi/SidecarBox.js +0 -0
  335. /package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.d.ts +0 -0
  336. /package/dist/{app → lib}/plugins/openapi/graphql/fragment-masking.js +0 -0
  337. /package/dist/{app → lib}/plugins/openapi/graphql/gql.d.ts +0 -0
  338. /package/dist/{app → lib}/plugins/openapi/graphql/gql.js +0 -0
  339. /package/dist/{app → lib}/plugins/openapi/graphql/graphql.d.ts +0 -0
  340. /package/dist/{app → lib}/plugins/openapi/graphql/graphql.js +0 -0
  341. /package/dist/{app → lib}/plugins/openapi/graphql/index.d.ts +0 -0
  342. /package/dist/{app → lib}/plugins/openapi/graphql/index.js +0 -0
  343. /package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -0
  344. /package/dist/{app → lib}/plugins/openapi/index.js +0 -0
  345. /package/dist/{app → lib}/plugins/openapi/playground/Playground.d.ts +0 -0
  346. /package/dist/{app → lib}/plugins/openapi/playground/Playground.js +0 -0
  347. /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +0 -0
  348. /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +0 -0
  349. /package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -0
  350. /package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
  351. /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
  352. /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +0 -0
  353. /package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
  354. /package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
  355. /package/dist/{app → lib}/plugins/redirect/index.d.ts +0 -0
  356. /package/dist/{app → lib}/plugins/redirect/index.js +0 -0
  357. /package/dist/{app → lib}/ui/Button.js +0 -0
  358. /package/dist/{app → lib}/ui/Callout.d.ts +0 -0
  359. /package/dist/{app → lib}/ui/Callout.js +0 -0
  360. /package/dist/{app → lib}/ui/Card.d.ts +0 -0
  361. /package/dist/{app → lib}/ui/Card.js +0 -0
  362. /package/dist/{app → lib}/ui/Note.d.ts +0 -0
  363. /package/dist/{app → lib}/ui/Note.js +0 -0
  364. /package/dist/{app → lib}/ui/Tabs.d.ts +0 -0
  365. /package/dist/{app → lib}/ui/Tabs.js +0 -0
  366. /package/dist/{app → lib}/util/MdxComponents.d.ts +0 -0
  367. /package/dist/{app → lib}/util/MdxComponents.js +0 -0
  368. /package/dist/{app → lib}/util/cn.d.ts +0 -0
  369. /package/dist/{app → lib}/util/cn.js +0 -0
  370. /package/dist/{app → lib}/util/createVariantComponent.d.ts +0 -0
  371. /package/dist/{app → lib}/util/createVariantComponent.js +0 -0
  372. /package/dist/{app → lib}/util/createWaitForNotify.d.ts +0 -0
  373. /package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
  374. /package/dist/{app → lib}/util/groupBy.d.ts +0 -0
  375. /package/dist/{app → lib}/util/groupBy.js +0 -0
  376. /package/dist/{app → lib}/util/joinPath.d.ts +0 -0
  377. /package/dist/{app → lib}/util/joinPath.js +0 -0
  378. /package/dist/{app → lib}/util/pastellize.d.ts +0 -0
  379. /package/dist/{app → lib}/util/pastellize.js +0 -0
  380. /package/dist/{app → lib}/util/slugify.d.ts +0 -0
  381. /package/dist/{app → lib}/util/slugify.js +0 -0
  382. /package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
  383. /package/dist/{app → lib}/util/traverseNavigation.js +0 -0
  384. /package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
  385. /package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
  386. /package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
  387. /package/dist/{app → lib}/util/useScrollToTop.js +0 -0
@@ -1,56 +0,0 @@
1
- import * as React from "react"
2
- import { Slot } from "@radix-ui/react-slot"
3
- import { cva, type VariantProps } from "class-variance-authority"
4
- import { cn } from "../util/cn.js";
5
-
6
- const buttonVariants = cva(
7
- "inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
8
- {
9
- variants: {
10
- variant: {
11
- default:
12
- "bg-primary text-primary-foreground shadow hover:bg-primary/90",
13
- destructive:
14
- "bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
15
- outline:
16
- "border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
17
- secondary:
18
- "bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
19
- ghost: "hover:bg-accent hover:text-accent-foreground",
20
- link: "text-primary underline-offset-4 hover:underline",
21
- },
22
- size: {
23
- default: "h-9 px-4 py-2",
24
- sm: "h-8 rounded-md px-3 text-xs",
25
- lg: "h-10 rounded-md px-8",
26
- icon: "h-9 w-9",
27
- },
28
- },
29
- defaultVariants: {
30
- variant: "default",
31
- size: "default",
32
- },
33
- }
34
- )
35
-
36
- export interface ButtonProps
37
- extends React.ButtonHTMLAttributes<HTMLButtonElement>,
38
- VariantProps<typeof buttonVariants> {
39
- asChild?: boolean
40
- }
41
-
42
- const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
43
- ({ className, variant, size, asChild = false, ...props }, ref) => {
44
- const Comp = asChild ? Slot : "button"
45
- return (
46
- <Comp
47
- className={cn(buttonVariants({ variant, size, className }))}
48
- ref={ref}
49
- {...props}
50
- />
51
- )
52
- }
53
- )
54
- Button.displayName = "Button"
55
-
56
- export { Button, buttonVariants }
@@ -1,87 +0,0 @@
1
- import type { ReactNode } from "react";
2
- import {
3
- AlertTriangleIcon,
4
- InfoIcon,
5
- LightbulbIcon,
6
- ShieldAlertIcon,
7
- } from "../core/icons.js";
8
- import { cn } from "../util/cn.js";
9
-
10
- const stylesMap = {
11
- note: {
12
- border: "border-gray-300 dark:border-zinc-800",
13
- bg: "bg-gray-100 dark:bg-zinc-800/50",
14
- iconColor: "text-gray-600 dark:text-zinc-300",
15
- titleColor: "text-gray-600 dark:text-zinc-300",
16
- textColor: "text-gray-600 dark:text-zinc-300",
17
- Icon: InfoIcon,
18
- },
19
- tip: {
20
- border: "border-green-500 dark:border-green-800",
21
- bg: "bg-green-200/25 dark:bg-green-950/70",
22
- iconColor: "text-green-600 dark:text-green-200",
23
- titleColor: "text-green-700 dark:text-green-200",
24
- textColor: "text-green-600 dark:text-green-50",
25
- Icon: LightbulbIcon,
26
- },
27
- info: {
28
- border: "border-blue-400 dark:border-blue-900/60",
29
- bg: "bg-blue-50 dark:bg-blue-950/40",
30
- iconColor: "text-blue-400 dark:text-blue-200",
31
- titleColor: "text-blue-700 dark:text-blue-200",
32
- textColor: "text-blue-600 dark:text-blue-100",
33
- Icon: InfoIcon,
34
- },
35
- caution: {
36
- border: "border-yellow-400 dark:border-yellow-400/25",
37
- bg: "bg-yellow-100/60 dark:bg-yellow-400/10",
38
- iconColor: "text-yellow-500 dark:text-yellow-300",
39
- titleColor: "text-yellow-600 dark:text-yellow-300",
40
- textColor: "text-yellow-700 dark:text-yellow-200",
41
- Icon: AlertTriangleIcon,
42
- },
43
- danger: {
44
- border: "border-rose-400 dark:border-rose-800",
45
- bg: "bg-rose-50 dark:bg-rose-950/40",
46
- iconColor: "text-rose-400 dark:text-rose-300",
47
- titleColor: "text-rose-800 dark:text-rose-300",
48
- textColor: "text-rose-700 dark:text-rose-100",
49
- Icon: ShieldAlertIcon,
50
- },
51
- };
52
-
53
- type CalloutProps = {
54
- type: keyof typeof stylesMap;
55
- title?: string;
56
- children: ReactNode;
57
- className?: string;
58
- };
59
-
60
- export const Callout = ({ type, children, title, className }: CalloutProps) => {
61
- const { border, bg, iconColor, titleColor, textColor, Icon } =
62
- stylesMap[type];
63
-
64
- return (
65
- <div
66
- className={cn(
67
- "not-prose grid grid-cols-[fit-content_1fr] grid-rows-[fit-content_1fr] gap-x-4 gap-y-2 text-md rounded-md border p-4",
68
- "[&_a]:underline [&_a]:decoration-current [&_a]:decoration-from-font [&_a]:underline-offset-4 hover:[&_a]:decoration-1",
69
- "[&_code]:!bg-transparent [&_code]:!border-none",
70
- title && "items-center",
71
- border,
72
- bg,
73
- className,
74
- )}
75
- >
76
- <Icon
77
- className={cn(!title && "mt-1 translate-y-px", iconColor)}
78
- size={20}
79
- aria-hidden="true"
80
- />
81
- {title && <h3 className={cn("font-medium", titleColor)}>{title}</h3>}
82
- <div className={cn("col-start-2", !title && "row-start-1", textColor)}>
83
- {children}
84
- </div>
85
- </div>
86
- );
87
- };
@@ -1,82 +0,0 @@
1
- import * as React from "react";
2
- import { cn } from "../util/cn.js";
3
-
4
- const Card = React.forwardRef<
5
- HTMLDivElement,
6
- React.HTMLAttributes<HTMLDivElement>
7
- >(({ className, ...props }, ref) => (
8
- <div
9
- ref={ref}
10
- className={cn(
11
- "rounded-xl border border-border bg-card text-card-foreground shadow",
12
- className,
13
- )}
14
- {...props}
15
- />
16
- ));
17
- Card.displayName = "Card";
18
-
19
- const CardHeader = React.forwardRef<
20
- HTMLDivElement,
21
- React.HTMLAttributes<HTMLDivElement>
22
- >(({ className, ...props }, ref) => (
23
- <div
24
- ref={ref}
25
- className={cn("flex flex-col space-y-1.5 p-6", className)}
26
- {...props}
27
- />
28
- ));
29
- CardHeader.displayName = "CardHeader";
30
-
31
- const CardTitle = React.forwardRef<
32
- HTMLParagraphElement,
33
- React.HTMLAttributes<HTMLHeadingElement>
34
- >(({ className, ...props }, ref) => (
35
- <h3
36
- ref={ref}
37
- className={cn("font-semibold leading-none tracking-tight", className)}
38
- {...props}
39
- />
40
- ));
41
- CardTitle.displayName = "CardTitle";
42
-
43
- const CardDescription = React.forwardRef<
44
- HTMLParagraphElement,
45
- React.HTMLAttributes<HTMLParagraphElement>
46
- >(({ className, ...props }, ref) => (
47
- <p
48
- ref={ref}
49
- className={cn("text-sm text-muted-foreground", className)}
50
- {...props}
51
- />
52
- ));
53
- CardDescription.displayName = "CardDescription";
54
-
55
- const CardContent = React.forwardRef<
56
- HTMLDivElement,
57
- React.HTMLAttributes<HTMLDivElement>
58
- >(({ className, ...props }, ref) => (
59
- <div ref={ref} className={cn("p-6 pt-0", className)} {...props} />
60
- ));
61
- CardContent.displayName = "CardContent";
62
-
63
- const CardFooter = React.forwardRef<
64
- HTMLDivElement,
65
- React.HTMLAttributes<HTMLDivElement>
66
- >(({ className, ...props }, ref) => (
67
- <div
68
- ref={ref}
69
- className={cn("flex items-center p-6 pt-0", className)}
70
- {...props}
71
- />
72
- ));
73
- CardFooter.displayName = "CardFooter";
74
-
75
- export {
76
- Card,
77
- CardContent,
78
- CardDescription,
79
- CardFooter,
80
- CardHeader,
81
- CardTitle,
82
- };
@@ -1,58 +0,0 @@
1
- import { cva, type VariantProps } from "class-variance-authority";
2
- import * as React from "react";
3
- import { cn } from "../util/cn.js";
4
-
5
- const noteVariants = cva(
6
- "relative w-full rounded-lg border p-4 [&>svg~*]:pl-7 [&>svg+div]:translate-y-[-3px] [&>svg]:absolute [&>svg]:left-4 [&>svg]:top-4 [&>svg]:text-foreground",
7
- {
8
- variants: {
9
- variant: {
10
- default: "bg-background text-foreground",
11
- destructive:
12
- "border-destructive/50 text-destructive dark:border-destructive [&>svg]:text-destructive",
13
- },
14
- },
15
- defaultVariants: {
16
- variant: "default",
17
- },
18
- },
19
- );
20
-
21
- const Note = React.forwardRef<
22
- HTMLDivElement,
23
- React.HTMLAttributes<HTMLDivElement> & VariantProps<typeof noteVariants>
24
- >(({ className, variant, ...props }, ref) => (
25
- <div
26
- ref={ref}
27
- role="alert"
28
- className={cn(noteVariants({ variant }), className)}
29
- {...props}
30
- />
31
- ));
32
- Note.displayName = "Alert";
33
-
34
- const NoteTitle = React.forwardRef<
35
- HTMLParagraphElement,
36
- React.HTMLAttributes<HTMLHeadingElement>
37
- >(({ className, ...props }, ref) => (
38
- <h5
39
- ref={ref}
40
- className={cn("mb-1 font-medium leading-none tracking-tight", className)}
41
- {...props}
42
- />
43
- ));
44
- NoteTitle.displayName = "AlertTitle";
45
-
46
- const NoteDescription = React.forwardRef<
47
- HTMLParagraphElement,
48
- React.HTMLAttributes<HTMLParagraphElement>
49
- >(({ className, ...props }, ref) => (
50
- <div
51
- ref={ref}
52
- className={cn("text-sm [&_p]:leading-relaxed", className)}
53
- {...props}
54
- />
55
- ));
56
- NoteDescription.displayName = "AlertDescription";
57
-
58
- export { Note, NoteDescription, NoteTitle };
@@ -1,52 +0,0 @@
1
- import * as React from "react";
2
- import * as TabsPrimitive from "@radix-ui/react-tabs";
3
- import { cn } from "../util/cn.js";
4
-
5
- const Tabs = TabsPrimitive.Root;
6
-
7
- const TabsList = React.forwardRef<
8
- React.ElementRef<typeof TabsPrimitive.List>,
9
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
10
- >(({ className, ...props }, ref) => (
11
- <TabsPrimitive.List
12
- ref={ref}
13
- className={cn(
14
- "inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
15
- className,
16
- )}
17
- {...props}
18
- />
19
- ));
20
- TabsList.displayName = TabsPrimitive.List.displayName;
21
-
22
- const TabsTrigger = React.forwardRef<
23
- React.ElementRef<typeof TabsPrimitive.Trigger>,
24
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
25
- >(({ className, ...props }, ref) => (
26
- <TabsPrimitive.Trigger
27
- ref={ref}
28
- className={cn(
29
- "inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
30
- className,
31
- )}
32
- {...props}
33
- />
34
- ));
35
- TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
36
-
37
- const TabsContent = React.forwardRef<
38
- React.ElementRef<typeof TabsPrimitive.Content>,
39
- React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
40
- >(({ className, ...props }, ref) => (
41
- <TabsPrimitive.Content
42
- ref={ref}
43
- className={cn(
44
- "mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
45
- className,
46
- )}
47
- {...props}
48
- />
49
- ));
50
- TabsContent.displayName = TabsPrimitive.Content.displayName;
51
-
52
- export { Tabs, TabsList, TabsTrigger, TabsContent };
@@ -1,70 +0,0 @@
1
- import { MDXProvider } from "@mdx-js/react";
2
- import type { ComponentProps } from "react";
3
-
4
- import { Link } from "react-router-dom";
5
- import { Heading } from "../Heading.js";
6
- import { SyntaxHighlight } from "../components/SyntaxHighlight.js";
7
- import { Callout } from "../ui/Callout.js";
8
- import { cn } from "./cn.js";
9
-
10
- export type MdxComponentsType = ComponentProps<
11
- typeof MDXProvider
12
- >["components"];
13
-
14
- export const MdxComponents = {
15
- img: (props) => {
16
- if (/\.(mp4|webm|mov|avi)$/.test(props.src ?? "")) {
17
- return <video src={props.src} controls playsInline autoPlay loop />;
18
- }
19
- return <img {...props} className="rounded-md" />;
20
- },
21
- h1: ({ children, id }) => <Heading level={1} id={id} children={children} />,
22
- h2: ({ children, id }) => <Heading level={2} id={id} children={children} />,
23
- h3: ({ children, id }) => <Heading level={3} id={id} children={children} />,
24
- h4: ({ children, id }) => <Heading level={4} id={id} children={children} />,
25
- h5: ({ children, id }) => <Heading level={5} id={id} children={children} />,
26
- h6: ({ children, id }) => <Heading level={6} id={id} children={children} />,
27
- a: ({ href, ...props }) =>
28
- href && !href.startsWith("http") ? (
29
- <Link to={href} relative="path" {...props} />
30
- ) : (
31
- <a href={href} target="_blank" {...props} />
32
- ),
33
- Callout,
34
- tip: (props) => <Callout type="tip" {...props} />,
35
- info: (props) => <Callout type="info" {...props} />,
36
- note: (props) => <Callout type="note" {...props} />,
37
- caution: (props) => <Callout type="caution" {...props} />,
38
- warning: (props) => <Callout type="caution" {...props} />,
39
- danger: (props) => <Callout type="danger" {...props} />,
40
-
41
- pre: ({ children }) => <>{children}</>,
42
- code: ({ className, children, ...props }) => {
43
- // `inline` provided by the rehype plugin, as react-markdown removed support for that
44
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
45
- const inline = (props as any).inline;
46
-
47
- if (!inline) {
48
- const match = className?.match(/language?-(\w+)/);
49
-
50
- return (
51
- <SyntaxHighlight
52
- language={match?.[1] ?? "markup"}
53
- className="rounded-xl overflow-x-auto p-4 border border-border dark:!bg-foreground/10 dark:border-transparent"
54
- code={String(children).trim()}
55
- />
56
- );
57
- }
58
-
59
- return (
60
- <code
61
- className={cn(
62
- className,
63
- "font-mono border border-border p-1 py-0.5 rounded bg-border/50 dark:bg-border/70",
64
- )}
65
- >
66
- {children}
67
- </code>
68
- );
69
- },
70
- } satisfies MdxComponentsType;
@@ -1,6 +0,0 @@
1
- import { clsx, type ClassValue } from "clsx";
2
- import { twMerge } from "tailwind-merge";
3
-
4
- export function cn(...inputs: ClassValue[]) {
5
- return twMerge(clsx(inputs));
6
- }
@@ -1,30 +0,0 @@
1
- import { cva } from "class-variance-authority";
2
- import { ClassValue } from "clsx";
3
- import * as React from "react";
4
- import { JSX } from "react/jsx-runtime";
5
- import { cn } from "./cn.js";
6
-
7
- const createVariantComponent = <
8
- E extends keyof React.ReactHTML,
9
- C extends ReturnType<typeof cva>,
10
- >(
11
- tag: E,
12
- cvx: ClassValue | C,
13
- // variantProps: Array<keyof VariantProps<C>> = [],
14
- ) => {
15
- const MyVariant = ({
16
- className,
17
- ...props
18
- }: JSX.IntrinsicElements[E] & { className?: ClassValue }) =>
19
- React.createElement(tag, {
20
- ...props,
21
- className:
22
- typeof cvx === "function" ? cvx({ className }) : cn(cvx, className),
23
- });
24
-
25
- MyVariant.displayName = `VariantComponent(${tag})`;
26
-
27
- return MyVariant;
28
- };
29
-
30
- export default createVariantComponent;
@@ -1,18 +0,0 @@
1
- export const createWaitForNotify = <T extends NonNullable<unknown>>() => {
2
- const resolveMap = new Map<string, (value: T | PromiseLike<T>) => void>();
3
-
4
- const waitFor = (id: string) =>
5
- new Promise<T>((resolve) => {
6
- resolveMap.set(id, resolve);
7
- });
8
-
9
- const notify = (id: string, data: T) => {
10
- const resolveFn = resolveMap.get(id);
11
- if (resolveFn) {
12
- resolveFn(data);
13
- resolveMap.delete(id);
14
- }
15
- };
16
-
17
- return [waitFor, notify] as const;
18
- };
@@ -1,24 +0,0 @@
1
- type MapValuesToKeysIfAllowed<T> = {
2
- [K in keyof T]: T[K] extends PropertyKey ? K : never;
3
- };
4
- type Filter<T> = MapValuesToKeysIfAllowed<T>[keyof T];
5
-
6
- export const groupBy = <
7
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
8
- T extends Record<PropertyKey, any>,
9
- Key extends Filter<T>,
10
- >(
11
- arr: T[],
12
- key: Key,
13
- ): Record<T[Key], T[]> =>
14
- arr.reduce(
15
- (accumulator, val) => {
16
- const groupedKey = val[key];
17
- if (!accumulator[groupedKey]) {
18
- accumulator[groupedKey] = [];
19
- }
20
- accumulator[groupedKey].push(val);
21
- return accumulator;
22
- },
23
- {} as Record<T[Key], T[]>,
24
- );
@@ -1,10 +0,0 @@
1
- export const joinPath = (
2
- ...parts: Array<string | null | undefined | boolean>
3
- ) => {
4
- const cleanPath = parts
5
- .filter((part): part is string => Boolean(part))
6
- .map((part) => part.replace(/(^\/+|\/+$)/g, "")) // Strip leading and trailing slashes
7
- .join("/");
8
-
9
- return cleanPath ? `/${cleanPath}` : "";
10
- };
@@ -1,25 +0,0 @@
1
- const c2n = (c: string) =>
2
- Math.abs(
3
- isNaN(parseInt(c))
4
- ? c.toLowerCase().charCodeAt(0) - 96
5
- : isNaN(parseInt(c))
6
- ? 0
7
- : parseInt(c),
8
- );
9
- const s2n = (s: string) =>
10
- s.length > 1
11
- ? parseInt(s.split("").reduce((a, c) => `${c2n(a) + c2n(c)}`))
12
- : c2n(s);
13
-
14
- export const pastellize = (
15
- s: string,
16
- options: {
17
- saturation?: number;
18
- lightness?: number;
19
- } = {},
20
- ) => {
21
- const hue = (3 * s2n(s) + 2 * s2n(s) + s2n(s)) % 360;
22
- const { saturation = 75, lightness = 60 } = options;
23
-
24
- return `${hue}deg ${saturation}% ${lightness}%`;
25
- };
@@ -1,3 +0,0 @@
1
- import slugify from "slugify";
2
-
3
- export default slugify;
@@ -1,55 +0,0 @@
1
- import { isPathItem } from "../components/navigation/util.js";
2
- import type {
3
- NavigationCategory,
4
- NavigationCategoryItem,
5
- NavigationItem,
6
- } from "../core/DevPortalContext.js";
7
- import { joinPath } from "./joinPath.js";
8
-
9
- export type NavigationNode = NavigationCategoryItem | NavigationCategory;
10
- type Callback<T> = (
11
- node: NavigationNode,
12
- fullPath: string,
13
- parentNodes: NavigationNode[],
14
- ) => T | undefined;
15
-
16
- export const traverseNavigationNode = <T>(
17
- node: NavigationNode,
18
- callback: Callback<T>,
19
- parentPath: string,
20
- parentNodes: NavigationNode[] = [],
21
- ): T | undefined => {
22
- const newPath = isPathItem(node)
23
- ? joinPath(parentPath, node.path)
24
- : parentPath;
25
- const result = callback(node, newPath, parentNodes);
26
-
27
- if (result !== undefined) return result;
28
-
29
- if ("children" in node && node.children) {
30
- const newParentNodes = [...parentNodes, node];
31
- for (const child of node.children) {
32
- const childResult = traverseNavigationNode(
33
- child,
34
- callback,
35
- newPath,
36
- newParentNodes,
37
- );
38
- if (childResult !== undefined) return childResult;
39
- }
40
- }
41
- return undefined;
42
- };
43
-
44
- export const traverseNavigation = <T>(
45
- navItem: NavigationItem,
46
- callback: Callback<T>,
47
- ): T | undefined => {
48
- if (navItem.categories) {
49
- for (const category of navItem.categories) {
50
- const result = traverseNavigationNode(category, callback, navItem.path);
51
- if (result !== undefined) return result;
52
- }
53
- }
54
- return undefined;
55
- };
@@ -1,38 +0,0 @@
1
- import { useEffect } from "react";
2
- import { useLocation } from "react-router-dom";
3
- import { useViewportAnchor } from "../components/context/ViewportAnchorContext.js";
4
-
5
- export const useScrollToAnchor = () => {
6
- const location = useLocation();
7
- const { setActiveAnchor } = useViewportAnchor();
8
-
9
- useEffect(() => {
10
- if (!location.hash) return;
11
-
12
- const hash = location.hash.split("/")[0].slice(1);
13
-
14
- const element = document.getElementById(decodeURIComponent(hash));
15
- if (element) {
16
- // on page navigation element might be in DOM but not yet scrollable, so wait for a frame
17
- requestAnimationFrame(() => {
18
- element.scrollIntoView();
19
- requestIdleCallback(() => setActiveAnchor(hash));
20
- });
21
- return;
22
- }
23
-
24
- // on page load, the element might not be available yet
25
- const observer = new MutationObserver((_mutations, obs) => {
26
- const element = document.getElementById(decodeURIComponent(hash));
27
- if (!element) return;
28
-
29
- element.scrollIntoView();
30
- requestIdleCallback(() => setActiveAnchor(hash));
31
- obs.disconnect();
32
- });
33
-
34
- observer.observe(document.body, { childList: true, subtree: true });
35
-
36
- return () => observer.disconnect();
37
- }, [location.hash, setActiveAnchor]);
38
- };
@@ -1,13 +0,0 @@
1
- import { useEffect, useRef } from "react";
2
- import { useLocation } from "react-router-dom";
3
-
4
- export const useScrollToTop = () => {
5
- const location = useLocation();
6
- const previousPath = useRef(location.pathname);
7
-
8
- useEffect(() => {
9
- if (previousPath.current === location.pathname) return;
10
- window.scrollTo(0, 0);
11
- previousPath.current = location.pathname;
12
- }, [location.pathname]);
13
- };
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes
File without changes