diff --git a/.gitignore b/.gitignore index b5101c2deb404..6a8b69a74b034 100644 --- a/.gitignore +++ b/.gitignore @@ -60,5 +60,4 @@ store todos.md examples/*/*.lock examples/*/*-lock.yaml -.store -.nextra \ No newline at end of file +.store \ No newline at end of file diff --git a/docs/nextra-theme-docs/flexsearch.js b/docs/nextra-theme-docs/flexsearch.js index c18134c658d31..d89ce17983b42 100644 --- a/docs/nextra-theme-docs/flexsearch.js +++ b/docs/nextra-theme-docs/flexsearch.js @@ -190,7 +190,7 @@ export default function Search() { if (!indexes[localeCode] && !loading) { setLoading(true); const data = await ( - await fetch(`/.nextra/data-${localeCode}.json`) + await fetch(`/_next/static/chunks/nextra-data-${localeCode}.json`) ).json(); const index = new FlexSearch.Document({ @@ -243,7 +243,7 @@ export default function Search() { indexes[localeCode] = index; setLoading(false); - setSearch((s) => s + " "); // Trigger the effect + setSearch((s) => (s ? s + " " : s)); // Trigger the effect } }; diff --git a/docs/nextra-theme-docs/index.js b/docs/nextra-theme-docs/index.js index 082d25455630d..a5f97c777458a 100644 --- a/docs/nextra-theme-docs/index.js +++ b/docs/nextra-theme-docs/index.js @@ -35,7 +35,7 @@ function useDirectoryInfo(pageMap) { }, [pageMap, locale, defaultLocale, asPath]); } -function Body({ meta, toc, filepathWithName, navLinks, MDXContent, postList }) { +function Body({ meta, toc, filepathWithName, navLinks, children, postList }) { const config = useConfig(); return ( @@ -45,15 +45,13 @@ function Body({ meta, toc, filepathWithName, navLinks, MDXContent, postList }) {
- + {children}
) : ( -
- -
+
{children}
) ) : postList ? (
@@ -65,7 +63,7 @@ function Body({ meta, toc, filepathWithName, navLinks, MDXContent, postList }) {
) : meta.full ? (
- + {children}
) : meta.type === "post" ? (
@@ -83,7 +81,7 @@ function Body({ meta, toc, filepathWithName, navLinks, MDXContent, postList }) {
- + {children}
@@ -91,7 +89,7 @@ function Body({ meta, toc, filepathWithName, navLinks, MDXContent, postList }) { ) : (
- + {children}
{navLinks}
@@ -108,7 +106,7 @@ const Layout = ({ pageMap, meta, route: _route, - MDXContent, + children, headings, titleText, }) => { @@ -291,8 +289,9 @@ const Layout = ({ ) : null } postList={postList} - MDXContent={MDXContent} - /> + > + {children} + @@ -346,8 +345,9 @@ const Layout = ({ isRTL={isRTL} /> } - MDXContent={MDXContent} - /> + > + {children} + diff --git a/docs/nextra-theme-docs/misc/theme.js b/docs/nextra-theme-docs/misc/theme.js index 71494e36e0b60..cf09adc65cbfe 100644 --- a/docs/nextra-theme-docs/misc/theme.js +++ b/docs/nextra-theme-docs/misc/theme.js @@ -3,6 +3,7 @@ import Link from "next/link"; import React, { useEffect, useRef, useState } from "react"; import innerText from "react-innertext"; import "intersection-observer"; +import { MDXProvider } from "@mdx-js/react"; import { useActiveAnchorSet } from "./active-anchor"; @@ -220,8 +221,12 @@ const getComponents = (args) => ({ table: Table, }); -export const MDXTheme = ({ MDXContent }) => { +export const MDXTheme = ({ children }) => { const slugger = new Slugger(); slugger.index = 0; - return ; + return ( + + {children} + + ); }; diff --git a/docs/package.json b/docs/package.json index 22fcd2ebc2e1d..19a4ae17f781a 100644 --- a/docs/package.json +++ b/docs/package.json @@ -43,7 +43,7 @@ "match-sorter": "^6.3.1", "next": "^12.0.8", "next-themes": "^0.0.15", - "nextra": "2.0.0-alpha.21", + "nextra": "^2.0.0-alpha.23", "parse-git-url": "^1.0.1", "react": "^17.0.2", "react-dom": "^17.0.2", diff --git a/package.json b/package.json index 20835f0a4e716..9ece25bd5a1c6 100644 --- a/package.json +++ b/package.json @@ -56,8 +56,7 @@ "build": { "outputs": [ "dist/**/*", - ".next/**/*", - "public/.nextra/**/*" + ".next/**/*" ], "dependsOn": [ "^build" diff --git a/yarn.lock b/yarn.lock index c9b487e6d4aa1..7a5a3d89f5610 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1092,18 +1092,6 @@ dependencies: "@babel/types" "^7.3.0" -"@types/chai-subset@^1.3.3": - version "1.3.3" - resolved "https://registry.yarnpkg.com/@types/chai-subset/-/chai-subset-1.3.3.tgz#97893814e92abd2c534de422cb377e0e0bdaac94" - integrity sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw== - dependencies: - "@types/chai" "*" - -"@types/chai@*", "@types/chai@^4.3.0": - version "4.3.0" - resolved "https://registry.yarnpkg.com/@types/chai/-/chai-4.3.0.tgz#23509ebc1fa32f1b4d50d6a66c4032d5b8eaabdc" - integrity sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw== - "@types/chalk-animation@^1.6.0": version "1.6.1" resolved "https://registry.yarnpkg.com/@types/chalk-animation/-/chalk-animation-1.6.1.tgz#5e7439b78f8344a0c5d2cf261eb36b0c267fe609" @@ -1743,11 +1731,6 @@ arrify@^1.0.0, arrify@^1.0.1: resolved "https://registry.yarnpkg.com/arrify/-/arrify-1.0.1.tgz#898508da2226f380df904728456849c1501a4b0d" integrity sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0= -assertion-error@^1.1.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/assertion-error/-/assertion-error-1.1.0.tgz#e60b6b0e8f301bd97e5375215bda406c85118c0b" - integrity sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw== - ast-types-flow@^0.0.7: version "0.0.7" resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad" @@ -2028,18 +2011,6 @@ ccount@^2.0.0: resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== -chai@^4.3.4: - version "4.3.4" - resolved "https://registry.yarnpkg.com/chai/-/chai-4.3.4.tgz#b55e655b31e1eac7099be4c08c21964fce2e6c49" - integrity sha512-yS5H68VYOCtN1cjfwumDSuzn/9c+yza4f3reKXlE5rUg7SFcCEy90gJvydNgOYtblyf4Zi6jIWRnXOgErta0KA== - dependencies: - assertion-error "^1.1.0" - check-error "^1.0.2" - deep-eql "^3.0.1" - get-func-name "^2.0.0" - pathval "^1.1.1" - type-detect "^4.0.5" - chalk@2.3.0: version "2.3.0" resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.3.0.tgz#b5ea48efc9c1793dccc9b4767c93914d3f2d52ba" @@ -2104,11 +2075,6 @@ chardet@^0.7.0: resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== -check-error@^1.0.2: - version "1.0.2" - resolved "https://registry.yarnpkg.com/check-error/-/check-error-1.0.2.tgz#574d312edd88bb5dd8912e9286dd6c0aed4aac82" - integrity sha1-V00xLt2Iu13YkS6Sht1sCu1KrII= - chokidar@^3.5.1, chokidar@^3.5.2: version "3.5.2" resolved "https://registry.yarnpkg.com/chokidar/-/chokidar-3.5.2.tgz#dba3976fcadb016f66fd365021d91600d01c1e75" @@ -2437,13 +2403,6 @@ dedent@^0.7.0: resolved "https://registry.yarnpkg.com/dedent/-/dedent-0.7.0.tgz#2495ddbaf6eb874abb0e1be9df22d2e5a544326c" integrity sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw= -deep-eql@^3.0.1: - version "3.0.1" - resolved "https://registry.yarnpkg.com/deep-eql/-/deep-eql-3.0.1.tgz#dfc9404400ad1c8fe023e7da1df1c147c4b444df" - integrity sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw== - dependencies: - type-detect "^4.0.0" - deep-extend@^0.6.0: version "0.6.0" resolved "https://registry.yarnpkg.com/deep-extend/-/deep-extend-0.6.0.tgz#c4fa7c95404a17a9c3e8ca7e1537312b736330ac" @@ -2727,7 +2686,7 @@ esbuild-windows-arm64@0.13.15: resolved "https://registry.yarnpkg.com/esbuild-windows-arm64/-/esbuild-windows-arm64-0.13.15.tgz#482173070810df22a752c686509c370c3be3b3c3" integrity sha512-zzvyCVVpbwQQATaf3IG8mu1IwGEiDxKkYUdA4FpoCHi1KtPa13jeScYDjlW0Qh+ebWzpKfR2ZwvqAQkSWNcKjA== -esbuild@^0.13.12, esbuild@^0.13.15: +esbuild@^0.13.15: version "0.13.15" resolved "https://registry.yarnpkg.com/esbuild/-/esbuild-0.13.15.tgz#db56a88166ee373f87dbb2d8798ff449e0450cdf" integrity sha512-raCxt02HBKv8RJxE8vkTSCXGIyKHdEdGfUmiYb8wnabnaEmHzyW7DCHb5tEN0xU8ryqg5xw54mcwnYkC4x3AIw== @@ -3327,11 +3286,6 @@ get-caller-file@^2.0.5: resolved "https://registry.yarnpkg.com/get-caller-file/-/get-caller-file-2.0.5.tgz#4f94412a82db32f36e3b0b9741f8a97feb031f7e" integrity sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg== -get-func-name@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/get-func-name/-/get-func-name-2.0.0.tgz#ead774abee72e20409433a066366023dd6887a41" - integrity sha1-6td0q+5y4gQJQzoGY2YCPdaIekE= - get-intrinsic@^1.0.2, get-intrinsic@^1.1.0, get-intrinsic@^1.1.1: version "1.1.1" resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.1.1.tgz#15f59f376f855c446963948f0d24cd3637b4abc6" @@ -4648,11 +4602,6 @@ loader-utils@1.2.3: emojis-list "^2.0.0" json5 "^1.0.1" -local-pkg@^0.4.1: - version "0.4.1" - resolved "https://registry.yarnpkg.com/local-pkg/-/local-pkg-0.4.1.tgz#e7b0d7aa0b9c498a1110a5ac5b00ba66ef38cfff" - integrity sha512-lL87ytIGP2FU5PWwNDo0w3WhIo2gopIAxPg9RxDYF7m4rr5ahuZxP22xnJHIvaLTe4Z9P6uKKY2UHiwyB4pcrw== - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -5440,11 +5389,6 @@ nanoid@^3.1.23: resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.1.23.tgz#f744086ce7c2bc47ee0a8472574d5c78e4183a81" integrity sha512-FiB0kzdP0FFVGDKlRLEQ1BgDzU87dy5NnzjeW9YZNt+/c3+q82EQDUwniSAUxp/F0gFNI1ZhKU1FqYsMuqZVnw== -nanoid@^3.1.30: - version "3.2.0" - resolved "https://registry.yarnpkg.com/nanoid/-/nanoid-3.2.0.tgz#62667522da6673971cca916a6d3eff3f415ff80c" - integrity sha512-fmsZYa9lpn69Ad5eDn7FMcnnSR+8R34W9qJEijxYhTbfOWzr22n1QxCMzXLK+ODyW2973V3Fux959iQoUxzUIA== - natural-compare@^1.4.0: version "1.4.0" resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" @@ -5489,10 +5433,10 @@ next@^12.0.8: "@next/swc-win32-ia32-msvc" "12.0.8" "@next/swc-win32-x64-msvc" "12.0.8" -nextra@2.0.0-alpha.21: - version "2.0.0-alpha.21" - resolved "https://registry.yarnpkg.com/nextra/-/nextra-2.0.0-alpha.21.tgz#afd724542ff0f78dcb1910de1ee18c402b996cae" - integrity sha512-2FhIwcPXfhyA/X4hm+DpY9luW26jxvzCwR2ba1sW1PFbmY+O+PvosJYBhtHlWK2vnOXf5pm1WMxAW/yYp6/jYw== +nextra@^2.0.0-alpha.23: + version "2.0.0-alpha.23" + resolved "https://registry.yarnpkg.com/nextra/-/nextra-2.0.0-alpha.23.tgz#01d3ad1c6cc78ad86615e0b33ed02453bd9bddce" + integrity sha512-o2Lbtf5yq2uMYOWJKhVjDpp/IL4filx++5rzrltu0fH9ERitiKarXk+S+fj0LDtAQB+rI6Q3FR/c8ER4z3DWIQ== dependencies: "@mdx-js/mdx" "^2.0.0-rc.2" github-slugger "^1.4.0" @@ -5502,8 +5446,6 @@ nextra@2.0.0-alpha.21: remark-gfm "^3.0.1" shiki "0.10.0" slash "^3.0.0" - typescript "^4.5.2" - vitest "^0.0.141" nice-try@^1.0.4: version "1.0.5" @@ -5864,11 +5806,6 @@ path-type@^4.0.0: resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== -pathval@^1.1.1: - version "1.1.1" - resolved "https://registry.yarnpkg.com/pathval/-/pathval-1.1.1.tgz#8534e77a77ce7ac5a2512ea21e0fdb8fcf6c3d8d" - integrity sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ== - periscopic@^3.0.0: version "3.0.4" resolved "https://registry.yarnpkg.com/periscopic/-/periscopic-3.0.4.tgz#b3fbed0d1bc844976b977173ca2cd4a0ef4fa8d1" @@ -5973,15 +5910,6 @@ postcss@^8.3.5: nanoid "^3.1.23" source-map-js "^0.6.2" -postcss@^8.4.5: - version "8.4.5" - resolved "https://registry.yarnpkg.com/postcss/-/postcss-8.4.5.tgz#bae665764dfd4c6fcc24dc0fdf7e7aa00cc77f95" - integrity sha512-jBDboWM8qpaqwkMwItqTQTiFikhs/67OYVvblFFTM7MrZjt6yMKd6r2kgXizEbTTljacm4NldIlZnhbjr84QYg== - dependencies: - nanoid "^3.1.30" - picocolors "^1.0.0" - source-map-js "^1.0.1" - prelude-ls@^1.2.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" @@ -6344,13 +6272,6 @@ rimraf@^3.0.0, rimraf@^3.0.2: dependencies: glob "^7.1.3" -rollup@^2.59.0: - version "2.66.0" - resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.66.0.tgz#ee529ea15a20485d579039637fec3050bad03bbb" - integrity sha512-L6mKOkdyP8HK5kKJXaiWG7KZDumPJjuo1P+cfyHOJPNNTK3Moe7zCH5+fy7v8pVmHXtlxorzaBjvkBMB23s98g== - optionalDependencies: - fsevents "~2.3.2" - rollup@^2.60.0: version "2.60.2" resolved "https://registry.yarnpkg.com/rollup/-/rollup-2.60.2.tgz#3f45ace36a9b10b4297181831ea0719922513463" @@ -6543,11 +6464,6 @@ source-map-js@^0.6.2: resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-0.6.2.tgz#0bb5de631b41cfbda6cfba8bd05a80efdfd2385e" integrity sha512-/3GptzWzu0+0MBQFrDKzw/DvvMTUORvgY6k6jd/VS6iCR4RDTKWH6v6WPwQoUO8667uQEf9Oe38DxAYWY5F/Ug== -source-map-js@^1.0.1: - version "1.0.2" - resolved "https://registry.yarnpkg.com/source-map-js/-/source-map-js-1.0.2.tgz#adbc361d9c62df380125e7f161f71c826f1e490c" - integrity sha512-R0XvVJ9WusLiqTCEiGCmICCMplcCkIwwR11mOSD9CR5u+IXYdiseeEuXCVAjS54zqwkLcPNnmU4OeJ6tUrWhDw== - source-map-support@^0.5.6, source-map-support@~0.5.20: version "0.5.21" resolved "https://registry.yarnpkg.com/source-map-support/-/source-map-support-0.5.21.tgz#04fe7c7f9e1ed2d662233c28cb2b35b9f63f6e4f" @@ -6967,16 +6883,6 @@ tinygradient@^1.1.5: "@types/tinycolor2" "^1.4.0" tinycolor2 "^1.0.0" -tinypool@^0.1.1: - version "0.1.1" - resolved "https://registry.yarnpkg.com/tinypool/-/tinypool-0.1.1.tgz#99eaf29d030feeca2da6c1d6b33f90fc18093bc7" - integrity sha512-sW2fQZ2BRb/GX5v55NkHiTrbMLx0eX0xNpP+VGhOe2f7Oo04+LeClDyM19zCE/WCy7jJ8kzIJ0Ojrxj3UhN9Sg== - -tinyspy@^0.2.8: - version "0.2.8" - resolved "https://registry.yarnpkg.com/tinyspy/-/tinyspy-0.2.8.tgz#b821b3d43a7d5ae47bc575a5d8627e84fdf4e809" - integrity sha512-4VXqQzzh9gC5uOLk77cLr9R3wqJq07xJlgM9IUdCNJCet139r+046ETKbU1x7mGs7B0k7eopyH5U6yflbBXNyA== - title@^3.4.3: version "3.4.3" resolved "https://registry.yarnpkg.com/title/-/title-3.4.3.tgz#76ef6b398310a7814120634620e47849481485d3" @@ -7141,7 +7047,7 @@ type-check@~0.3.2: dependencies: prelude-ls "~1.1.2" -type-detect@4.0.8, type-detect@^4.0.0, type-detect@^4.0.5: +type-detect@4.0.8: version "4.0.8" resolved "https://registry.yarnpkg.com/type-detect/-/type-detect-4.0.8.tgz#7646fb5f18871cfbb7749e69bd39a6388eb7450c" integrity sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g== @@ -7178,11 +7084,6 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" -typescript@^4.5.2: - version "4.5.5" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.5.tgz#d8c953832d28924a9e3d37c73d729c846c5896f3" - integrity sha512-TCTIul70LyWe6IJWT8QSYeA54WQe8EjQFU4wY52Fasj5UKx88LNYKCgBEHcOMOrFF1rKGbD8v/xcNWVUq9SymA== - typescript@^4.5.3: version "4.5.3" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.3.tgz#afaa858e68c7103317d89eb90c5d8906268d353c" @@ -7382,31 +7283,6 @@ vfile@^5.0.0: unist-util-stringify-position "^3.0.0" vfile-message "^3.0.0" -vite@>=2.7.10: - version "2.7.13" - resolved "https://registry.yarnpkg.com/vite/-/vite-2.7.13.tgz#99b56e27dfb1e4399e407cf94648f5c7fb9d77f5" - integrity sha512-Mq8et7f3aK0SgSxjDNfOAimZGW9XryfHRa/uV0jseQSilg+KhYDSoNb9h1rknOy6SuMkvNDLKCYAYYUMCE+IgQ== - dependencies: - esbuild "^0.13.12" - postcss "^8.4.5" - resolve "^1.20.0" - rollup "^2.59.0" - optionalDependencies: - fsevents "~2.3.2" - -vitest@^0.0.141: - version "0.0.141" - resolved "https://registry.yarnpkg.com/vitest/-/vitest-0.0.141.tgz#687f66acc21692222095dc5d3a3729fa8d7c8010" - integrity sha512-CQwNWGbifAs5OrG1MXyiveeFT3KYpU/UZiZzNUR5ZHMUWKam9OeoDX0U3sFuyaERp/0b2vhoL0oaMccY2PJPSQ== - dependencies: - "@types/chai" "^4.3.0" - "@types/chai-subset" "^1.3.3" - chai "^4.3.4" - local-pkg "^0.4.1" - tinypool "^0.1.1" - tinyspy "^0.2.8" - vite ">=2.7.10" - vscode-oniguruma@^1.6.1: version "1.6.1" resolved "https://registry.yarnpkg.com/vscode-oniguruma/-/vscode-oniguruma-1.6.1.tgz#2bf4dfcfe3dd2e56eb549a3068c8ee39e6c30ce5"