@depup/nextra 4.6.1-depup.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.
Files changed (293) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +56 -0
  3. package/changes.json +110 -0
  4. package/dist/client/components/banner/close-banner-button.d.ts +8 -0
  5. package/dist/client/components/banner/close-banner-button.js +45 -0
  6. package/dist/client/components/banner/index.client.d.ts +5 -0
  7. package/dist/client/components/banner/index.client.js +46 -0
  8. package/dist/client/components/banner/index.d.ts +51 -0
  9. package/dist/client/components/banner/index.js +93 -0
  10. package/dist/client/components/bleed.d.ts +63 -0
  11. package/dist/client/components/bleed.js +54 -0
  12. package/dist/client/components/button.d.ts +9 -0
  13. package/dist/client/components/button.js +55 -0
  14. package/dist/client/components/callout.d.ts +136 -0
  15. package/dist/client/components/callout.js +99 -0
  16. package/dist/client/components/cards.d.ts +104 -0
  17. package/dist/client/components/cards.js +132 -0
  18. package/dist/client/components/collapse.d.ts +12 -0
  19. package/dist/client/components/collapse.js +143 -0
  20. package/dist/client/components/file-tree/file.d.ts +9 -0
  21. package/dist/client/components/file-tree/file.js +43 -0
  22. package/dist/client/components/file-tree/folder.d.ts +12 -0
  23. package/dist/client/components/file-tree/folder.js +94 -0
  24. package/dist/client/components/file-tree/index.d.ts +57 -0
  25. package/dist/client/components/file-tree/index.js +12 -0
  26. package/dist/client/components/file-tree/tree.d.ts +5 -0
  27. package/dist/client/components/file-tree/tree.js +41 -0
  28. package/dist/client/components/head.d.ts +139 -0
  29. package/dist/client/components/head.js +202 -0
  30. package/dist/client/components/image-zoom.d.ts +6 -0
  31. package/dist/client/components/image-zoom.js +79 -0
  32. package/dist/client/components/index.d.ts +56 -0
  33. package/dist/client/components/index.js +42 -0
  34. package/dist/client/components/playground.d.ts +90 -0
  35. package/dist/client/components/playground.js +103 -0
  36. package/dist/client/components/popup/index.client.d.ts +7 -0
  37. package/dist/client/components/popup/index.client.js +83 -0
  38. package/dist/client/components/popup/index.d.ts +12 -0
  39. package/dist/client/components/popup/index.js +11 -0
  40. package/dist/client/components/search.d.ts +88 -0
  41. package/dist/client/components/search.js +426 -0
  42. package/dist/client/components/select.d.ts +19 -0
  43. package/dist/client/components/select.js +109 -0
  44. package/dist/client/components/skip-nav/index.client.d.ts +5 -0
  45. package/dist/client/components/skip-nav/index.client.js +45 -0
  46. package/dist/client/components/skip-nav/index.d.ts +6 -0
  47. package/dist/client/components/skip-nav/index.js +24 -0
  48. package/dist/client/components/steps.d.ts +64 -0
  49. package/dist/client/components/steps.js +74 -0
  50. package/dist/client/components/tabs/index.client.d.ts +21 -0
  51. package/dist/client/components/tabs/index.client.js +243 -0
  52. package/dist/client/components/tabs/index.d.ts +53 -0
  53. package/dist/client/components/tabs/index.js +9 -0
  54. package/dist/client/evaluate.d.ts +30 -0
  55. package/dist/client/evaluate.js +17 -0
  56. package/dist/client/hocs/index.d.ts +4 -0
  57. package/dist/client/hocs/index.js +6 -0
  58. package/dist/client/hocs/with-github-alert.d.ts +11 -0
  59. package/dist/client/hocs/with-github-alert.js +30 -0
  60. package/dist/client/hocs/with-icons.d.ts +6 -0
  61. package/dist/client/hocs/with-icons.js +76 -0
  62. package/dist/client/hooks/index.d.ts +4 -0
  63. package/dist/client/hooks/index.js +10 -0
  64. package/dist/client/hooks/use-copy.d.ts +9 -0
  65. package/dist/client/hooks/use-copy.js +77 -0
  66. package/dist/client/hooks/use-fs-route.d.ts +3 -0
  67. package/dist/client/hooks/use-fs-route.js +20 -0
  68. package/dist/client/hooks/use-hash.d.ts +3 -0
  69. package/dist/client/hooks/use-hash.js +20 -0
  70. package/dist/client/hooks/use-mounted.d.ts +3 -0
  71. package/dist/client/hooks/use-mounted.js +13 -0
  72. package/dist/client/icons/arrow-right.d.ts +5 -0
  73. package/dist/client/icons/arrow-right.js +24 -0
  74. package/dist/client/icons/chatgpt.d.ts +2 -0
  75. package/dist/client/icons/chatgpt.js +24 -0
  76. package/dist/client/icons/check.d.ts +2 -0
  77. package/dist/client/icons/check.js +24 -0
  78. package/dist/client/icons/claude.d.ts +2 -0
  79. package/dist/client/icons/claude.js +81 -0
  80. package/dist/client/icons/copy.d.ts +2 -0
  81. package/dist/client/icons/copy.js +31 -0
  82. package/dist/client/icons/cpp.d.ts +2 -0
  83. package/dist/client/icons/cpp.js +24 -0
  84. package/dist/client/icons/cross-circled.d.ts +2 -0
  85. package/dist/client/icons/cross-circled.js +24 -0
  86. package/dist/client/icons/csharp.d.ts +2 -0
  87. package/dist/client/icons/csharp.js +24 -0
  88. package/dist/client/icons/css.d.ts +2 -0
  89. package/dist/client/icons/css.js +24 -0
  90. package/dist/client/icons/discord.d.ts +2 -0
  91. package/dist/client/icons/discord.js +24 -0
  92. package/dist/client/icons/expand.d.ts +2 -0
  93. package/dist/client/icons/expand.js +31 -0
  94. package/dist/client/icons/file.d.ts +2 -0
  95. package/dist/client/icons/file.js +24 -0
  96. package/dist/client/icons/folder-open.d.ts +2 -0
  97. package/dist/client/icons/folder-open.js +24 -0
  98. package/dist/client/icons/folder.d.ts +2 -0
  99. package/dist/client/icons/folder.js +24 -0
  100. package/dist/client/icons/github-caution.d.ts +2 -0
  101. package/dist/client/icons/github-caution.js +24 -0
  102. package/dist/client/icons/github-important.d.ts +2 -0
  103. package/dist/client/icons/github-important.js +24 -0
  104. package/dist/client/icons/github-note.d.ts +2 -0
  105. package/dist/client/icons/github-note.js +24 -0
  106. package/dist/client/icons/github-tip.d.ts +2 -0
  107. package/dist/client/icons/github-tip.js +24 -0
  108. package/dist/client/icons/github-warning.d.ts +2 -0
  109. package/dist/client/icons/github-warning.js +24 -0
  110. package/dist/client/icons/github.d.ts +2 -0
  111. package/dist/client/icons/github.js +24 -0
  112. package/dist/client/icons/globe.d.ts +2 -0
  113. package/dist/client/icons/globe.js +24 -0
  114. package/dist/client/icons/go.d.ts +2 -0
  115. package/dist/client/icons/go.js +46 -0
  116. package/dist/client/icons/graphql.d.ts +2 -0
  117. package/dist/client/icons/graphql.js +56 -0
  118. package/dist/client/icons/index.d.ts +2 -0
  119. package/dist/client/icons/index.js +92 -0
  120. package/dist/client/icons/javascript.d.ts +2 -0
  121. package/dist/client/icons/javascript.js +24 -0
  122. package/dist/client/icons/json.d.ts +2 -0
  123. package/dist/client/icons/json.js +41 -0
  124. package/dist/client/icons/link-arrow.d.ts +2 -0
  125. package/dist/client/icons/link-arrow.js +31 -0
  126. package/dist/client/icons/link.d.ts +2 -0
  127. package/dist/client/icons/link.js +24 -0
  128. package/dist/client/icons/markdown.d.ts +2 -0
  129. package/dist/client/icons/markdown.js +24 -0
  130. package/dist/client/icons/mdx.d.ts +2 -0
  131. package/dist/client/icons/mdx.js +24 -0
  132. package/dist/client/icons/menu.d.ts +2 -0
  133. package/dist/client/icons/menu.js +36 -0
  134. package/dist/client/icons/moon.d.ts +2 -0
  135. package/dist/client/icons/moon.js +24 -0
  136. package/dist/client/icons/move.d.ts +2 -0
  137. package/dist/client/icons/move.js +24 -0
  138. package/dist/client/icons/python.d.ts +2 -0
  139. package/dist/client/icons/python.js +31 -0
  140. package/dist/client/icons/react.d.ts +2 -0
  141. package/dist/client/icons/react.js +38 -0
  142. package/dist/client/icons/rust.d.ts +2 -0
  143. package/dist/client/icons/rust.js +31 -0
  144. package/dist/client/icons/spinner.d.ts +2 -0
  145. package/dist/client/icons/spinner.js +31 -0
  146. package/dist/client/icons/sun.d.ts +2 -0
  147. package/dist/client/icons/sun.js +24 -0
  148. package/dist/client/icons/svelte.d.ts +2 -0
  149. package/dist/client/icons/svelte.js +31 -0
  150. package/dist/client/icons/terminal.d.ts +2 -0
  151. package/dist/client/icons/terminal.js +24 -0
  152. package/dist/client/icons/terraform.d.ts +2 -0
  153. package/dist/client/icons/terraform.js +24 -0
  154. package/dist/client/icons/typescript.d.ts +2 -0
  155. package/dist/client/icons/typescript.js +24 -0
  156. package/dist/client/icons/word-wrap.d.ts +2 -0
  157. package/dist/client/icons/word-wrap.js +24 -0
  158. package/dist/client/icons/x.d.ts +2 -0
  159. package/dist/client/icons/x.js +24 -0
  160. package/dist/client/mdx-components/anchor.d.ts +10 -0
  161. package/dist/client/mdx-components/anchor.js +109 -0
  162. package/dist/client/mdx-components/code.d.ts +7 -0
  163. package/dist/client/mdx-components/code.js +52 -0
  164. package/dist/client/mdx-components/details.d.ts +5 -0
  165. package/dist/client/mdx-components/details.js +166 -0
  166. package/dist/client/mdx-components/image.d.ts +28 -0
  167. package/dist/client/mdx-components/image.js +39 -0
  168. package/dist/client/mdx-components/index.d.ts +11 -0
  169. package/dist/client/mdx-components/index.js +16 -0
  170. package/dist/client/mdx-components/pre/copy-to-clipboard.d.ts +5 -0
  171. package/dist/client/mdx-components/pre/copy-to-clipboard.js +49 -0
  172. package/dist/client/mdx-components/pre/index.d.ts +16 -0
  173. package/dist/client/mdx-components/pre/index.js +156 -0
  174. package/dist/client/mdx-components/pre/toggle-word-wrap-button.d.ts +7 -0
  175. package/dist/client/mdx-components/pre/toggle-word-wrap-button.js +31 -0
  176. package/dist/client/mdx-components/summary.d.ts +5 -0
  177. package/dist/client/mdx-components/summary.js +80 -0
  178. package/dist/client/mdx-components/table.d.ts +57 -0
  179. package/dist/client/mdx-components/table.js +95 -0
  180. package/dist/client/mdx-components.d.ts +89 -0
  181. package/dist/client/mdx-components.js +15 -0
  182. package/dist/client/mdx-remote.d.ts +62 -0
  183. package/dist/client/mdx-remote.js +36 -0
  184. package/dist/client/normalize-pages.d.ts +84 -0
  185. package/dist/client/normalize-pages.js +232 -0
  186. package/dist/client/package.json +1 -0
  187. package/dist/client/pages.d.ts +131 -0
  188. package/dist/client/pages.js +39 -0
  189. package/dist/client/remove-links.d.ts +6 -0
  190. package/dist/client/remove-links.js +35 -0
  191. package/dist/client/setup-page.d.ts +18 -0
  192. package/dist/client/setup-page.js +14 -0
  193. package/dist/server/compile-metadata.d.ts +12 -0
  194. package/dist/server/compile-metadata.js +39 -0
  195. package/dist/server/compile.d.ts +39 -0
  196. package/dist/server/compile.js +158 -0
  197. package/dist/server/constants.d.ts +15 -0
  198. package/dist/server/constants.js +22 -0
  199. package/dist/server/fetch-filepaths-from-github.d.ts +10 -0
  200. package/dist/server/fetch-filepaths-from-github.js +36 -0
  201. package/dist/server/index.d.ts +39 -0
  202. package/dist/server/index.js +203 -0
  203. package/dist/server/loader.d.ts +18 -0
  204. package/dist/server/loader.js +155 -0
  205. package/dist/server/locales.d.ts +22 -0
  206. package/dist/server/locales.js +38 -0
  207. package/dist/server/page-map/find-meta-and-page-file-paths.d.ts +8 -0
  208. package/dist/server/page-map/find-meta-and-page-file-paths.js +32 -0
  209. package/dist/server/page-map/get.d.ts +50 -0
  210. package/dist/server/page-map/get.js +28 -0
  211. package/dist/server/page-map/index-page.d.ts +21 -0
  212. package/dist/server/page-map/index-page.js +57 -0
  213. package/dist/server/page-map/index.d.ts +26 -0
  214. package/dist/server/page-map/index.js +24 -0
  215. package/dist/server/page-map/merge-meta-with-page-map.d.ts +17 -0
  216. package/dist/server/page-map/merge-meta-with-page-map.js +74 -0
  217. package/dist/server/page-map/normalize.d.ts +17 -0
  218. package/dist/server/page-map/normalize.js +122 -0
  219. package/dist/server/page-map/placeholder.d.ts +2 -0
  220. package/dist/server/page-map/placeholder.js +0 -0
  221. package/dist/server/page-map/to-ast.d.ts +18 -0
  222. package/dist/server/page-map/to-ast.js +47 -0
  223. package/dist/server/page-map/to-js.d.ts +21 -0
  224. package/dist/server/page-map/to-js.js +72 -0
  225. package/dist/server/page-map/to-page-map.d.ts +26 -0
  226. package/dist/server/page-map/to-page-map.js +101 -0
  227. package/dist/server/recma-plugins/index.d.ts +3 -0
  228. package/dist/server/recma-plugins/index.js +4 -0
  229. package/dist/server/recma-plugins/recma-rewrite.d.ts +11 -0
  230. package/dist/server/recma-plugins/recma-rewrite.js +98 -0
  231. package/dist/server/rehype-plugins/index.d.ts +18 -0
  232. package/dist/server/rehype-plugins/index.js +16 -0
  233. package/dist/server/rehype-plugins/rehype-better-react-mathjax.d.ts +24 -0
  234. package/dist/server/rehype-plugins/rehype-better-react-mathjax.js +96 -0
  235. package/dist/server/rehype-plugins/rehype-extract-toc-content.d.ts +6 -0
  236. package/dist/server/rehype-plugins/rehype-extract-toc-content.js +119 -0
  237. package/dist/server/rehype-plugins/rehype-twoslash-popup.d.ts +6 -0
  238. package/dist/server/rehype-plugins/rehype-twoslash-popup.js +50 -0
  239. package/dist/server/rehype-plugins/rehype.d.ts +21 -0
  240. package/dist/server/rehype-plugins/rehype.js +84 -0
  241. package/dist/server/remark-plugins/index.d.ts +15 -0
  242. package/dist/server/remark-plugins/index.js +26 -0
  243. package/dist/server/remark-plugins/remark-assign-frontmatter.d.ts +10 -0
  244. package/dist/server/remark-plugins/remark-assign-frontmatter.js +24 -0
  245. package/dist/server/remark-plugins/remark-custom-heading-id.d.ts +9 -0
  246. package/dist/server/remark-plugins/remark-custom-heading-id.js +18 -0
  247. package/dist/server/remark-plugins/remark-export-only-metadata.d.ts +6 -0
  248. package/dist/server/remark-plugins/remark-export-only-metadata.js +18 -0
  249. package/dist/server/remark-plugins/remark-export-source-code.d.ts +6 -0
  250. package/dist/server/remark-plugins/remark-export-source-code.js +35 -0
  251. package/dist/server/remark-plugins/remark-headings.d.ts +12 -0
  252. package/dist/server/remark-plugins/remark-headings.js +133 -0
  253. package/dist/server/remark-plugins/remark-link-rewrite.d.ts +11 -0
  254. package/dist/server/remark-plugins/remark-link-rewrite.js +12 -0
  255. package/dist/server/remark-plugins/remark-mdx-disable-explicit-jsx.d.ts +10 -0
  256. package/dist/server/remark-plugins/remark-mdx-disable-explicit-jsx.js +10 -0
  257. package/dist/server/remark-plugins/remark-mdx-frontmatter.d.ts +6 -0
  258. package/dist/server/remark-plugins/remark-mdx-frontmatter.js +37 -0
  259. package/dist/server/remark-plugins/remark-mdx-title.d.ts +10 -0
  260. package/dist/server/remark-plugins/remark-mdx-title.js +53 -0
  261. package/dist/server/remark-plugins/remark-remove-imports.d.ts +6 -0
  262. package/dist/server/remark-plugins/remark-remove-imports.js +12 -0
  263. package/dist/server/remark-plugins/remark-static-image.d.ts +6 -0
  264. package/dist/server/remark-plugins/remark-static-image.js +107 -0
  265. package/dist/server/schemas.d.ts +352 -0
  266. package/dist/server/schemas.js +240 -0
  267. package/dist/server/tsdoc/base.d.ts +38 -0
  268. package/dist/server/tsdoc/base.js +284 -0
  269. package/dist/server/tsdoc/index.d.ts +6 -0
  270. package/dist/server/tsdoc/index.js +10 -0
  271. package/dist/server/tsdoc/tsdoc.d.ts +102 -0
  272. package/dist/server/tsdoc/tsdoc.js +262 -0
  273. package/dist/server/tsdoc/types.d.ts +64 -0
  274. package/dist/server/tsdoc/types.js +0 -0
  275. package/dist/server/tsdoc/zod-to-ts.d.ts +5 -0
  276. package/dist/server/tsdoc/zod-to-ts.js +107 -0
  277. package/dist/server/twoslash.d.ts +6 -0
  278. package/dist/server/twoslash.js +60 -0
  279. package/dist/server/utils.d.ts +12 -0
  280. package/dist/server/utils.js +45 -0
  281. package/dist/types.d.ts +128 -0
  282. package/dist/types.generated.d.ts +203 -0
  283. package/dist/types.generated.js +0 -0
  284. package/dist/types.js +0 -0
  285. package/loader.cjs +24 -0
  286. package/package.json +265 -0
  287. package/styles/cards.css +24 -0
  288. package/styles/code-block.css +266 -0
  289. package/styles/default.css +55 -0
  290. package/styles/react-medium-image-zoom.css +101 -0
  291. package/styles/scrollbar.css +14 -0
  292. package/styles/steps.css +22 -0
  293. package/styles/subheading-anchor.css +25 -0
@@ -0,0 +1,52 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import cn from "clsx";
4
+ const Code = (t0) => {
5
+ const $ = _c(11);
6
+ let children;
7
+ let className;
8
+ let props;
9
+ if ($[0] !== t0) {
10
+ const {
11
+ children: t12,
12
+ className: t22,
13
+ "data-language": _language,
14
+ ...t32
15
+ } = t0;
16
+ children = t12;
17
+ className = t22;
18
+ props = t32;
19
+ $[0] = t0;
20
+ $[1] = children;
21
+ $[2] = className;
22
+ $[3] = props;
23
+ } else {
24
+ children = $[1];
25
+ className = $[2];
26
+ props = $[3];
27
+ }
28
+ const t1 = "data-line-numbers" in props && "[counter-reset:line]";
29
+ let t2;
30
+ if ($[4] !== className || $[5] !== t1) {
31
+ t2 = cn("nextra-code", t1, className);
32
+ $[4] = className;
33
+ $[5] = t1;
34
+ $[6] = t2;
35
+ } else {
36
+ t2 = $[6];
37
+ }
38
+ let t3;
39
+ if ($[7] !== children || $[8] !== props || $[9] !== t2) {
40
+ t3 = /* @__PURE__ */ jsx("code", { className: t2, dir: "ltr", ...props, children });
41
+ $[7] = children;
42
+ $[8] = props;
43
+ $[9] = t2;
44
+ $[10] = t3;
45
+ } else {
46
+ t3 = $[10];
47
+ }
48
+ return t3;
49
+ };
50
+ export {
51
+ Code
52
+ };
@@ -0,0 +1,5 @@
1
+ import { FC, ComponentProps } from 'react';
2
+
3
+ declare const Details: FC<ComponentProps<'details'>>;
4
+
5
+ export { Details };
@@ -0,0 +1,166 @@
1
+ "use client";
2
+ import { jsx, jsxs } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import cn from "clsx";
5
+ import { Children, cloneElement, useEffect, useRef, useState } from "react";
6
+ import { Collapse } from "../components/collapse.js";
7
+ import { useHash } from "../hooks/index.js";
8
+ const Details = (t0) => {
9
+ const $ = _c(26);
10
+ let children;
11
+ let className;
12
+ let open;
13
+ let props;
14
+ if ($[0] !== t0) {
15
+ ({
16
+ children,
17
+ open,
18
+ className,
19
+ ...props
20
+ } = t0);
21
+ $[0] = t0;
22
+ $[1] = children;
23
+ $[2] = className;
24
+ $[3] = open;
25
+ $[4] = props;
26
+ } else {
27
+ children = $[1];
28
+ className = $[2];
29
+ open = $[3];
30
+ props = $[4];
31
+ }
32
+ const [isOpen, setIsOpen] = useState(!!open);
33
+ const [delayedOpenState, setDelayedOpenState] = useState(isOpen);
34
+ const animationRef = useRef(0);
35
+ let t1;
36
+ let t2;
37
+ if ($[5] !== isOpen) {
38
+ t1 = () => {
39
+ const animation = animationRef.current;
40
+ if (animation) {
41
+ clearTimeout(animation);
42
+ animationRef.current = 0;
43
+ }
44
+ if (!isOpen) {
45
+ animationRef.current = window.setTimeout(() => setDelayedOpenState(isOpen), 300);
46
+ return () => {
47
+ clearTimeout(animationRef.current);
48
+ };
49
+ }
50
+ setDelayedOpenState(true);
51
+ };
52
+ t2 = [isOpen];
53
+ $[5] = isOpen;
54
+ $[6] = t1;
55
+ $[7] = t2;
56
+ } else {
57
+ t1 = $[6];
58
+ t2 = $[7];
59
+ }
60
+ useEffect(t1, t2);
61
+ let t3;
62
+ if ($[8] !== children) {
63
+ t3 = findSummary(children, setIsOpen);
64
+ $[8] = children;
65
+ $[9] = t3;
66
+ } else {
67
+ t3 = $[9];
68
+ }
69
+ const [summaryElement, restChildren] = t3;
70
+ const hash = useHash();
71
+ const detailsRef = useRef(null);
72
+ let t4;
73
+ let t5;
74
+ if ($[10] !== hash) {
75
+ t4 = () => {
76
+ if (!hash) {
77
+ return;
78
+ }
79
+ const elementWithHashId = detailsRef.current.querySelector(`[id="${hash}"]`);
80
+ if (!elementWithHashId) {
81
+ return;
82
+ }
83
+ setIsOpen(true);
84
+ };
85
+ t5 = [hash];
86
+ $[10] = hash;
87
+ $[11] = t4;
88
+ $[12] = t5;
89
+ } else {
90
+ t4 = $[11];
91
+ t5 = $[12];
92
+ }
93
+ useEffect(t4, t5);
94
+ let t6;
95
+ if ($[13] !== className) {
96
+ t6 = cn("x:not-first:mt-4 x:rounded x:border x:border-gray-200 x:bg-white x:p-2 x:shadow-sm x:dark:border-neutral-800 x:dark:bg-neutral-900", "x:overflow-hidden", className);
97
+ $[13] = className;
98
+ $[14] = t6;
99
+ } else {
100
+ t6 = $[14];
101
+ }
102
+ const t7 = isOpen || delayedOpenState;
103
+ const t8 = isOpen ? "" : void 0;
104
+ let t9;
105
+ if ($[15] === Symbol.for("react.memo_cache_sentinel")) {
106
+ t9 = cn("x:*:pt-2", "x:grid");
107
+ $[15] = t9;
108
+ } else {
109
+ t9 = $[15];
110
+ }
111
+ let t10;
112
+ if ($[16] !== isOpen || $[17] !== restChildren) {
113
+ t10 = /* @__PURE__ */ jsx(Collapse, { isOpen, className: t9, children: restChildren });
114
+ $[16] = isOpen;
115
+ $[17] = restChildren;
116
+ $[18] = t10;
117
+ } else {
118
+ t10 = $[18];
119
+ }
120
+ let t11;
121
+ if ($[19] !== props || $[20] !== summaryElement || $[21] !== t10 || $[22] !== t6 || $[23] !== t7 || $[24] !== t8) {
122
+ t11 = /* @__PURE__ */ jsxs("details", { className: t6, ref: detailsRef, ...props, open: t7, "data-expanded": t8, children: [
123
+ summaryElement,
124
+ t10
125
+ ] });
126
+ $[19] = props;
127
+ $[20] = summaryElement;
128
+ $[21] = t10;
129
+ $[22] = t6;
130
+ $[23] = t7;
131
+ $[24] = t8;
132
+ $[25] = t11;
133
+ } else {
134
+ t11 = $[25];
135
+ }
136
+ return t11;
137
+ };
138
+ function findSummary(list, setIsOpen) {
139
+ let summary;
140
+ const rest = Children.map(list, (child) => {
141
+ if (!summary && // Add onClick only for first summary
142
+ child && typeof child === "object" && "type" in child) {
143
+ if (child.type === "summary") {
144
+ summary = cloneElement(child, {
145
+ // @ts-expect-error -- fixme
146
+ onClick(event) {
147
+ if (event.target.tagName !== "A") {
148
+ event.preventDefault();
149
+ setIsOpen((v) => !v);
150
+ }
151
+ }
152
+ });
153
+ return;
154
+ }
155
+ if (child.type !== Details && child.props.children) {
156
+ ;
157
+ [summary, child] = findSummary(child.props.children, setIsOpen);
158
+ }
159
+ }
160
+ return child;
161
+ });
162
+ return [summary, rest];
163
+ }
164
+ export {
165
+ Details
166
+ };
@@ -0,0 +1,28 @@
1
+ import * as next_image from 'next/image';
2
+ import * as next_dist_shared_lib_get_img_props from 'next/dist/shared/lib/get-img-props';
3
+ import * as react from 'react';
4
+
5
+ declare const Image: react.ForwardRefExoticComponent<Omit<react.DetailedHTMLProps<react.ImgHTMLAttributes<HTMLImageElement>, HTMLImageElement>, "src" | "srcSet" | "ref" | "alt" | "width" | "height" | "loading"> & {
6
+ src: string | next_dist_shared_lib_get_img_props.StaticImport;
7
+ alt: string;
8
+ width?: number | `${number}`;
9
+ height?: number | `${number}`;
10
+ fill?: boolean;
11
+ loader?: next_image.ImageLoader;
12
+ quality?: number | `${number}`;
13
+ preload?: boolean;
14
+ priority?: boolean;
15
+ loading?: "lazy" | "eager" | undefined;
16
+ placeholder?: next_dist_shared_lib_get_img_props.PlaceholderValue;
17
+ blurDataURL?: string;
18
+ unoptimized?: boolean;
19
+ overrideSrc?: string;
20
+ onLoadingComplete?: next_dist_shared_lib_get_img_props.OnLoadingComplete;
21
+ layout?: string;
22
+ objectFit?: string;
23
+ objectPosition?: string;
24
+ lazyBoundary?: string;
25
+ lazyRoot?: string;
26
+ } & react.RefAttributes<HTMLImageElement>>;
27
+
28
+ export { Image };
@@ -0,0 +1,39 @@
1
+ import { jsx } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import NextImage from "next/image";
4
+ import { forwardRef } from "react";
5
+ const Image = forwardRef((props, ref) => {
6
+ const $ = _c(6);
7
+ if (process.env.NODE_ENV !== "production" && typeof props.src === "object" && !("blurDataURL" in props.src)) {
8
+ console.warn(`[nextra] Failed to load blur image "${props.src.src}" due missing "src.blurDataURL" value.
9
+ This is Turbopack bug, which will not occurs on production (since Webpack is used for "next build" command).`);
10
+ let t02;
11
+ if ($[0] !== props) {
12
+ t02 = {
13
+ ...props,
14
+ placeholder: "empty"
15
+ };
16
+ $[0] = props;
17
+ $[1] = t02;
18
+ } else {
19
+ t02 = $[1];
20
+ }
21
+ props = t02;
22
+ }
23
+ const ComponentToUse = typeof props.src === "object" ? NextImage : "img";
24
+ let t0;
25
+ if ($[2] !== ComponentToUse || $[3] !== props || $[4] !== ref) {
26
+ t0 = /* @__PURE__ */ jsx(ComponentToUse, { ...props, ref, "data-pagefind-index-attrs": "title,alt" });
27
+ $[2] = ComponentToUse;
28
+ $[3] = props;
29
+ $[4] = ref;
30
+ $[5] = t0;
31
+ } else {
32
+ t0 = $[5];
33
+ }
34
+ return t0;
35
+ });
36
+ Image.displayName = "Image";
37
+ export {
38
+ Image
39
+ };
@@ -0,0 +1,11 @@
1
+ export { Pre } from './pre/index.js';
2
+ export { Anchor } from './anchor.js';
3
+ export { Code } from './code.js';
4
+ export { Details } from './details.js';
5
+ export { Image } from './image.js';
6
+ export { Summary } from './summary.js';
7
+ export { Table } from './table.js';
8
+ import 'react';
9
+ import 'next/link';
10
+ import 'next/image';
11
+ import 'next/dist/shared/lib/get-img-props';
@@ -0,0 +1,16 @@
1
+ import { Pre } from "./pre/index.js";
2
+ import { Anchor } from "./anchor.js";
3
+ import { Code } from "./code.js";
4
+ import { Details } from "./details.js";
5
+ import { Image } from "./image.js";
6
+ import { Summary } from "./summary.js";
7
+ import { Table } from "./table.js";
8
+ export {
9
+ Anchor,
10
+ Code,
11
+ Details,
12
+ Image,
13
+ Pre,
14
+ Summary,
15
+ Table
16
+ };
@@ -0,0 +1,5 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+
3
+ declare const CopyToClipboard: FC<HTMLAttributes<HTMLButtonElement>>;
4
+
5
+ export { CopyToClipboard };
@@ -0,0 +1,49 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import { Button } from "../../components/button.js";
5
+ import { useCopy } from "../../hooks/use-copy.js";
6
+ import { CheckIcon, CopyIcon } from "../../icons/index.js";
7
+ const CopyToClipboard = (props) => {
8
+ const $ = _c(8);
9
+ const {
10
+ copy,
11
+ isCopied
12
+ } = useCopy();
13
+ let t0;
14
+ if ($[0] !== copy) {
15
+ t0 = async (event) => {
16
+ const container = event.currentTarget.parentNode.parentNode;
17
+ const content = container.querySelector("pre code")?.textContent || "";
18
+ copy(content);
19
+ };
20
+ $[0] = copy;
21
+ $[1] = t0;
22
+ } else {
23
+ t0 = $[1];
24
+ }
25
+ const handleClick = t0;
26
+ const IconToUse = isCopied ? CheckIcon : CopyIcon;
27
+ let t1;
28
+ if ($[2] !== IconToUse) {
29
+ t1 = /* @__PURE__ */ jsx(IconToUse, { height: "1em", className: "nextra-copy-icon" });
30
+ $[2] = IconToUse;
31
+ $[3] = t1;
32
+ } else {
33
+ t1 = $[3];
34
+ }
35
+ let t2;
36
+ if ($[4] !== handleClick || $[5] !== props || $[6] !== t1) {
37
+ t2 = /* @__PURE__ */ jsx(Button, { onClick: handleClick, title: "Copy code", variant: "outline", ...props, children: t1 });
38
+ $[4] = handleClick;
39
+ $[5] = props;
40
+ $[6] = t1;
41
+ $[7] = t2;
42
+ } else {
43
+ t2 = $[7];
44
+ }
45
+ return t2;
46
+ };
47
+ export {
48
+ CopyToClipboard
49
+ };
@@ -0,0 +1,16 @@
1
+ import { HTMLAttributes, ReactNode, FC } from 'react';
2
+
3
+ declare const classes: {
4
+ border: string;
5
+ };
6
+ type PreProps = HTMLAttributes<HTMLPreElement> & {
7
+ 'data-filename'?: string;
8
+ 'data-copy'?: '';
9
+ 'data-language'?: string;
10
+ 'data-word-wrap'?: '';
11
+ 'data-pagefind-ignore'?: string;
12
+ icon?: ReactNode;
13
+ };
14
+ declare const Pre: FC<PreProps>;
15
+
16
+ export { Pre, type PreProps, classes };
@@ -0,0 +1,156 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import cn from "clsx";
4
+ import { WordWrapIcon } from "../../icons/index.js";
5
+ import { CopyToClipboard } from "./copy-to-clipboard.js";
6
+ import { ToggleWordWrapButton } from "./toggle-word-wrap-button.js";
7
+ const classes = {
8
+ border: cn("x:border x:border-gray-300 x:dark:border-neutral-700", "x:contrast-more:border-gray-900 x:contrast-more:dark:border-gray-50")
9
+ };
10
+ const Pre = (t0) => {
11
+ const $ = _c(36);
12
+ let children;
13
+ let className;
14
+ let copy;
15
+ let filename;
16
+ let hasWordWrap;
17
+ let icon;
18
+ let pagefindIgnore;
19
+ let props;
20
+ if ($[0] !== t0) {
21
+ const {
22
+ children: t12,
23
+ className: t22,
24
+ "data-filename": t32,
25
+ "data-copy": t42,
26
+ "data-language": _language,
27
+ "data-word-wrap": t52,
28
+ "data-pagefind-ignore": t62,
29
+ icon: t72,
30
+ ...t82
31
+ } = t0;
32
+ children = t12;
33
+ className = t22;
34
+ filename = t32;
35
+ copy = t42;
36
+ hasWordWrap = t52;
37
+ pagefindIgnore = t62;
38
+ icon = t72;
39
+ props = t82;
40
+ $[0] = t0;
41
+ $[1] = children;
42
+ $[2] = className;
43
+ $[3] = copy;
44
+ $[4] = filename;
45
+ $[5] = hasWordWrap;
46
+ $[6] = icon;
47
+ $[7] = pagefindIgnore;
48
+ $[8] = props;
49
+ } else {
50
+ children = $[1];
51
+ className = $[2];
52
+ copy = $[3];
53
+ filename = $[4];
54
+ hasWordWrap = $[5];
55
+ icon = $[6];
56
+ pagefindIgnore = $[7];
57
+ props = $[8];
58
+ }
59
+ let t1;
60
+ if ($[9] !== copy || $[10] !== filename) {
61
+ t1 = copy === "" && /* @__PURE__ */ jsx(CopyToClipboard, { className: filename ? "x:ms-auto x:text-sm" : "" });
62
+ $[9] = copy;
63
+ $[10] = filename;
64
+ $[11] = t1;
65
+ } else {
66
+ t1 = $[11];
67
+ }
68
+ const copyButton = t1;
69
+ let t2;
70
+ if ($[12] !== copyButton || $[13] !== filename || $[14] !== icon) {
71
+ t2 = filename && /* @__PURE__ */ jsxs("div", { className: cn("x:px-4 x:text-xs x:text-gray-700 x:dark:text-gray-200", "x:bg-gray-100 x:dark:bg-neutral-900", "x:flex x:items-center x:h-12 x:gap-2 x:rounded-t-md", classes.border, "x:border-b-0"), children: [
72
+ icon,
73
+ /* @__PURE__ */ jsx("span", { className: "x:truncate", children: filename }),
74
+ copyButton
75
+ ] });
76
+ $[12] = copyButton;
77
+ $[13] = filename;
78
+ $[14] = icon;
79
+ $[15] = t2;
80
+ } else {
81
+ t2 = $[15];
82
+ }
83
+ const t3 = filename ? "x:rounded-b-md" : "x:rounded-md";
84
+ let t4;
85
+ if ($[16] !== className || $[17] !== t3) {
86
+ t4 = cn("x:group", "x:focus-visible:nextra-focus", "x:overflow-x-auto x:subpixel-antialiased x:text-[.9em]", "x:bg-white x:dark:bg-black x:py-4", "x:ring-1 x:ring-inset x:ring-gray-300 x:dark:ring-neutral-700", "x:contrast-more:ring-gray-900 x:contrast-more:dark:ring-gray-50", "x:contrast-more:contrast-150", t3, "not-prose", className);
87
+ $[16] = className;
88
+ $[17] = t3;
89
+ $[18] = t4;
90
+ } else {
91
+ t4 = $[18];
92
+ }
93
+ const t5 = filename ? "x:top-14" : "x:top-2";
94
+ let t6;
95
+ if ($[19] !== t5) {
96
+ t6 = cn("x:group-hover:opacity-100", "x:group-focus:opacity-100", "x:opacity-0 x:transition x:focus-within:opacity-100", "x:flex x:gap-1 x:absolute x:right-4", t5);
97
+ $[19] = t5;
98
+ $[20] = t6;
99
+ } else {
100
+ t6 = $[20];
101
+ }
102
+ let t7;
103
+ if ($[21] !== hasWordWrap) {
104
+ t7 = hasWordWrap === "" && /* @__PURE__ */ jsx(ToggleWordWrapButton, { children: /* @__PURE__ */ jsx(WordWrapIcon, { height: "1em" }) });
105
+ $[21] = hasWordWrap;
106
+ $[22] = t7;
107
+ } else {
108
+ t7 = $[22];
109
+ }
110
+ const t8 = !filename && copyButton;
111
+ let t9;
112
+ if ($[23] !== t6 || $[24] !== t7 || $[25] !== t8) {
113
+ t9 = /* @__PURE__ */ jsxs("div", { className: t6, children: [
114
+ t7,
115
+ t8
116
+ ] });
117
+ $[23] = t6;
118
+ $[24] = t7;
119
+ $[25] = t8;
120
+ $[26] = t9;
121
+ } else {
122
+ t9 = $[26];
123
+ }
124
+ let t10;
125
+ if ($[27] !== children || $[28] !== props || $[29] !== t4 || $[30] !== t9) {
126
+ t10 = /* @__PURE__ */ jsxs("pre", { className: t4, ...props, children: [
127
+ t9,
128
+ children
129
+ ] });
130
+ $[27] = children;
131
+ $[28] = props;
132
+ $[29] = t4;
133
+ $[30] = t9;
134
+ $[31] = t10;
135
+ } else {
136
+ t10 = $[31];
137
+ }
138
+ let t11;
139
+ if ($[32] !== pagefindIgnore || $[33] !== t10 || $[34] !== t2) {
140
+ t11 = /* @__PURE__ */ jsxs("div", { "data-pagefind-ignore": pagefindIgnore, className: "nextra-code x:relative x:not-first:mt-[1.25em]", children: [
141
+ t2,
142
+ t10
143
+ ] });
144
+ $[32] = pagefindIgnore;
145
+ $[33] = t10;
146
+ $[34] = t2;
147
+ $[35] = t11;
148
+ } else {
149
+ t11 = $[35];
150
+ }
151
+ return t11;
152
+ };
153
+ export {
154
+ Pre,
155
+ classes
156
+ };
@@ -0,0 +1,7 @@
1
+ import { FC, ReactNode } from 'react';
2
+
3
+ declare const ToggleWordWrapButton: FC<{
4
+ children: ReactNode;
5
+ }>;
6
+
7
+ export { ToggleWordWrapButton };
@@ -0,0 +1,31 @@
1
+ "use client";
2
+ import { jsx } from "react/jsx-runtime";
3
+ import { c as _c } from "react-compiler-runtime";
4
+ import { Button } from "../../components/button.js";
5
+ function toggleWordWrap() {
6
+ const htmlDataset = document.documentElement.dataset;
7
+ const hasWordWrap = "nextraWordWrap" in htmlDataset;
8
+ if (hasWordWrap) {
9
+ delete htmlDataset.nextraWordWrap;
10
+ } else {
11
+ htmlDataset.nextraWordWrap = "";
12
+ }
13
+ }
14
+ const ToggleWordWrapButton = (t0) => {
15
+ const $ = _c(2);
16
+ const {
17
+ children
18
+ } = t0;
19
+ let t1;
20
+ if ($[0] !== children) {
21
+ t1 = /* @__PURE__ */ jsx(Button, { onClick: toggleWordWrap, className: "x:md:hidden", title: "Toggle word wrap", variant: "outline", children });
22
+ $[0] = children;
23
+ $[1] = t1;
24
+ } else {
25
+ t1 = $[1];
26
+ }
27
+ return t1;
28
+ };
29
+ export {
30
+ ToggleWordWrapButton
31
+ };
@@ -0,0 +1,5 @@
1
+ import { FC, HTMLAttributes } from 'react';
2
+
3
+ declare const Summary: FC<HTMLAttributes<HTMLElement>>;
4
+
5
+ export { Summary };
@@ -0,0 +1,80 @@
1
+ import { jsx, jsxs } from "react/jsx-runtime";
2
+ import { c as _c } from "react-compiler-runtime";
3
+ import cn from "clsx";
4
+ import { ArrowRightIcon, LinkIcon } from "../icons/index.js";
5
+ const Summary = (t0) => {
6
+ const $ = _c(18);
7
+ let children;
8
+ let className;
9
+ let id;
10
+ let props;
11
+ if ($[0] !== t0) {
12
+ ({
13
+ children,
14
+ className,
15
+ id,
16
+ ...props
17
+ } = t0);
18
+ $[0] = t0;
19
+ $[1] = children;
20
+ $[2] = className;
21
+ $[3] = id;
22
+ $[4] = props;
23
+ } else {
24
+ children = $[1];
25
+ className = $[2];
26
+ id = $[3];
27
+ props = $[4];
28
+ }
29
+ let t1;
30
+ if ($[5] !== className) {
31
+ t1 = cn("x:focus-visible:nextra-focus", "x:cursor-pointer x:transition-colors", "x:hover:bg-gray-100 x:dark:hover:bg-neutral-800", "x:select-none x:rounded", "x:[&::-webkit-details-marker]:hidden", "x:flex x:items-center", className);
32
+ $[5] = className;
33
+ $[6] = t1;
34
+ } else {
35
+ t1 = $[6];
36
+ }
37
+ let t2;
38
+ if ($[7] === Symbol.for("react.memo_cache_sentinel")) {
39
+ t2 = /* @__PURE__ */ jsx(ArrowRightIcon, { height: "1em", className: cn("x:motion-reduce:transition-none x:ms-2 x:me-1 x:shrink-0", "x:rtl:rotate-180 x:[[data-expanded]>summary:first-child>&]:rotate-90 x:transition"), strokeWidth: "3" });
40
+ $[7] = t2;
41
+ } else {
42
+ t2 = $[7];
43
+ }
44
+ let t3;
45
+ if ($[8] !== children || $[9] !== id) {
46
+ t3 = /* @__PURE__ */ jsx("h3", { id, className: "x:grow x:hyphens-auto x:p-1", children });
47
+ $[8] = children;
48
+ $[9] = id;
49
+ $[10] = t3;
50
+ } else {
51
+ t3 = $[10];
52
+ }
53
+ let t4;
54
+ if ($[11] !== id) {
55
+ t4 = id && /* @__PURE__ */ jsx("a", { href: `#${id}`, "aria-label": "Permalink for this section", className: cn("x:self-stretch", "x:flex x:items-center", "x:focus-visible:nextra-focus x:rounded x:px-2", "x:hover:bg-gray-100 x:dark:hover:bg-neutral-800", "x:hover:[summary:has(&)]:bg-transparent"), children: /* @__PURE__ */ jsx(LinkIcon, { height: "1em", className: "x:pointer-events-none" }) });
56
+ $[11] = id;
57
+ $[12] = t4;
58
+ } else {
59
+ t4 = $[12];
60
+ }
61
+ let t5;
62
+ if ($[13] !== props || $[14] !== t1 || $[15] !== t3 || $[16] !== t4) {
63
+ t5 = /* @__PURE__ */ jsxs("summary", { className: t1, ...props, children: [
64
+ t2,
65
+ t3,
66
+ t4
67
+ ] });
68
+ $[13] = props;
69
+ $[14] = t1;
70
+ $[15] = t3;
71
+ $[16] = t4;
72
+ $[17] = t5;
73
+ } else {
74
+ t5 = $[17];
75
+ }
76
+ return t5;
77
+ };
78
+ export {
79
+ Summary
80
+ };