diff --git a/.prettierignore b/.prettierignore index 59d9bbf..baa31e3 100644 --- a/.prettierignore +++ b/.prettierignore @@ -54,3 +54,4 @@ yarn.lock # Library files dist CHANGELOG.md +.yalc diff --git a/.yalc/nextra-renderlesskit-theme-docs/dist/bleed.d.ts b/.yalc/nextra-renderlesskit-theme-docs/dist/bleed.d.ts new file mode 100644 index 0000000..a60f10c --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/dist/bleed.d.ts @@ -0,0 +1,6 @@ +import React from "react"; +interface BleedProps { + full: boolean; +} +declare const Bleed: React.FC; +export default Bleed; diff --git a/.yalc/nextra-renderlesskit-theme-docs/dist/bleed.js b/.yalc/nextra-renderlesskit-theme-docs/dist/bleed.js new file mode 100644 index 0000000..625216e --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/dist/bleed.js @@ -0,0 +1,12 @@ +// src/bleed.tsx +import React from "react"; +import cn from "classnames"; +var Bleed = ({ full, children }) => { + return /* @__PURE__ */ React.createElement("div", { + className: cn("bleed relative mt-6 -mx-6 md:-mx-8 2xl:-mx-24", { full }) + }, children); +}; +var bleed_default = Bleed; +export { + bleed_default as default +}; diff --git a/.yalc/nextra-renderlesskit-theme-docs/dist/callout.d.ts b/.yalc/nextra-renderlesskit-theme-docs/dist/callout.d.ts new file mode 100644 index 0000000..00215cd --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/dist/callout.d.ts @@ -0,0 +1,14 @@ +import React from "react"; +declare const themes: { + default: string; + error: string; + warning: string; +}; +interface CalloutProps { + /** Callout Theme default to 'default' */ + type?: keyof typeof themes; + /** default emoji 💡*/ + emoji: string; +} +declare const Callout: React.FC; +export default Callout; diff --git a/.yalc/nextra-renderlesskit-theme-docs/dist/callout.js b/.yalc/nextra-renderlesskit-theme-docs/dist/callout.js new file mode 100644 index 0000000..1c48944 --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/dist/callout.js @@ -0,0 +1,27 @@ +// src/callout.tsx +import React from "react"; +var themes = { + default: "bg-orange-100 text-orange-800 dark:text-orange-300 dark:bg-orange-200 dark:bg-opacity-10", + error: "bg-red-200 text-red-900 dark:text-red-200 dark:bg-red-600 dark:bg-opacity-30", + warning: "bg-yellow-200 text-yellow-900 dark:text-yellow-200 dark:bg-yellow-700 dark:bg-opacity-30" +}; +var Callout = ({ + children, + type = "default", + emoji = "\u{1F4A1}" +}) => { + return /* @__PURE__ */ React.createElement("div", { + className: `${themes[type]} flex rounded-lg callout mt-6` + }, /* @__PURE__ */ React.createElement("div", { + className: "pl-3 pr-2 py-2 select-none text-xl", + style: { + fontFamily: '"Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol"' + } + }, emoji), /* @__PURE__ */ React.createElement("div", { + className: "pr-4 py-2" + }, children)); +}; +var callout_default = Callout; +export { + callout_default as default +}; diff --git a/.yalc/nextra-renderlesskit-theme-docs/dist/index.js b/.yalc/nextra-renderlesskit-theme-docs/dist/index.js new file mode 100644 index 0000000..a7a824e --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/dist/index.js @@ -0,0 +1,1857 @@ +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +var __objRest = (source, exclude) => { + var target = {}; + for (var prop in source) + if (__hasOwnProp.call(source, prop) && exclude.indexOf(prop) < 0) + target[prop] = source[prop]; + if (source != null && __getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(source)) { + if (exclude.indexOf(prop) < 0 && __propIsEnum.call(source, prop)) + target[prop] = source[prop]; + } + return target; +}; +var __esm = (fn, res) => function __init() { + return fn && (res = (0, fn[__getOwnPropNames(fn)[0]])(fn = 0)), res; +}; +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// src/wasm-loader.js +var wasm_loader_exports = {}; +__export(wasm_loader_exports, { + init: () => init, + wasm_register_index: () => wasm_register_index, + wasm_search: () => wasm_search +}); +function getObject(idx) { + return heap[idx]; +} +function dropObject(idx) { + if (idx < 36) + return; + heap[idx] = heap_next; + heap_next = idx; +} +function takeObject(idx) { + const ret = getObject(idx); + dropObject(idx); + return ret; +} +function getUint8Memory0() { + if (cachegetUint8Memory0 === null || cachegetUint8Memory0.buffer !== wasm.memory.buffer) { + cachegetUint8Memory0 = new Uint8Array(wasm.memory.buffer); + } + return cachegetUint8Memory0; +} +function getStringFromWasm0(ptr, len) { + return cachedTextDecoder.decode(getUint8Memory0().subarray(ptr, ptr + len)); +} +function passStringToWasm0(arg, malloc, realloc) { + if (typeof arg !== "string") + throw new Error("expected a string argument"); + if (realloc === void 0) { + const buf = cachedTextEncoder.encode(arg); + const ptr2 = malloc(buf.length); + getUint8Memory0().subarray(ptr2, ptr2 + buf.length).set(buf); + WASM_VECTOR_LEN = buf.length; + return ptr2; + } + let len = arg.length; + let ptr = malloc(len); + const mem = getUint8Memory0(); + let offset = 0; + for (; offset < len; offset++) { + const code = arg.charCodeAt(offset); + if (code > 127) + break; + mem[ptr + offset] = code; + } + if (offset !== len) { + if (offset !== 0) { + arg = arg.slice(offset); + } + ptr = realloc(ptr, len, len = offset + arg.length * 3); + const view = getUint8Memory0().subarray(ptr + offset, ptr + len); + const ret = encodeString(arg, view); + if (ret.read !== arg.length) + throw new Error("failed to pass whole string"); + offset += ret.written; + } + WASM_VECTOR_LEN = offset; + return ptr; +} +function passArray8ToWasm0(arg, malloc) { + const ptr = malloc(arg.length * 1); + getUint8Memory0().set(arg, ptr / 1); + WASM_VECTOR_LEN = arg.length; + return ptr; +} +function getInt32Memory0() { + if (cachegetInt32Memory0 === null || cachegetInt32Memory0.buffer !== wasm.memory.buffer) { + cachegetInt32Memory0 = new Int32Array(wasm.memory.buffer); + } + return cachegetInt32Memory0; +} +function wasm_register_index(name, data) { + try { + const retptr = wasm.__wbindgen_export_0.value - 16; + wasm.__wbindgen_export_0.value = retptr; + var ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + var ptr1 = passArray8ToWasm0(data, wasm.__wbindgen_malloc); + var len1 = WASM_VECTOR_LEN; + wasm.wasm_register_index(retptr, ptr0, len0, ptr1, len1); + var r0 = getInt32Memory0()[retptr / 4 + 0]; + var r1 = getInt32Memory0()[retptr / 4 + 1]; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_export_0.value += 16; + wasm.__wbindgen_free(r0, r1); + } +} +function wasm_search(name, query) { + try { + const retptr = wasm.__wbindgen_export_0.value - 16; + wasm.__wbindgen_export_0.value = retptr; + var ptr0 = passStringToWasm0(name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + var ptr1 = passStringToWasm0(query, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len1 = WASM_VECTOR_LEN; + wasm.wasm_search(retptr, ptr0, len0, ptr1, len1); + var r0 = getInt32Memory0()[retptr / 4 + 0]; + var r1 = getInt32Memory0()[retptr / 4 + 1]; + return getStringFromWasm0(r0, r1); + } finally { + wasm.__wbindgen_export_0.value += 16; + wasm.__wbindgen_free(r0, r1); + } +} +function logError(f) { + return function() { + try { + return f.apply(this, arguments); + } catch (e) { + let error = function() { + try { + return e instanceof Error ? `${e.message} + +Stack: +${e.stack}` : e.toString(); + } catch (_) { + return ""; + } + }(); + console.error("wasm-bindgen: imported JS function that was not marked as `catch` threw an error:", error); + throw e; + } + }; +} +function addHeapObject(obj) { + if (heap_next === heap.length) + heap.push(heap.length + 1); + const idx = heap_next; + heap_next = heap[idx]; + if (typeof heap_next !== "number") + throw new Error("corrupt heap"); + heap[idx] = obj; + return idx; +} +function load(module, imports) { + return __async(this, null, function* () { + if (typeof Response === "function" && module instanceof Response) { + if (typeof WebAssembly.instantiateStreaming === "function") { + try { + return yield WebAssembly.instantiateStreaming(module, imports); + } catch (e) { + if (module.headers.get("Content-Type") !== "application/wasm") { + console.warn("`WebAssembly.instantiateStreaming` failed because your server does not serve wasm with `application/wasm` MIME type. Falling back to `WebAssembly.instantiate` which is slower. Original error:\n", e); + } else { + throw e; + } + } + } + const bytes = yield module.arrayBuffer(); + return yield WebAssembly.instantiate(bytes, imports); + } else { + const instance = yield WebAssembly.instantiate(module, imports); + if (instance instanceof WebAssembly.Instance) { + return { instance, module }; + } else { + return instance; + } + } + }); +} +function init(input) { + return __async(this, null, function* () { + const imports = {}; + imports.wbg = {}; + imports.wbg.__wbg_error_4bb6c2a97407129a = logError(function(arg0, arg1) { + try { + console.error(getStringFromWasm0(arg0, arg1)); + } finally { + wasm.__wbindgen_free(arg0, arg1); + } + }); + imports.wbg.__wbg_new_59cb74e423758ede = logError(function() { + var ret = new Error(); + return addHeapObject(ret); + }); + imports.wbg.__wbg_stack_558ba5917b466edd = logError(function(arg0, arg1) { + var ret = getObject(arg1).stack; + var ptr0 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc); + var len0 = WASM_VECTOR_LEN; + getInt32Memory0()[arg0 / 4 + 1] = len0; + getInt32Memory0()[arg0 / 4 + 0] = ptr0; + }); + imports.wbg.__wbindgen_object_drop_ref = function(arg0) { + takeObject(arg0); + }; + imports.wbg.__wbindgen_throw = function(arg0, arg1) { + throw new Error(getStringFromWasm0(arg0, arg1)); + }; + const { instance, module } = yield load(yield fetch(input), imports); + wasm = instance.exports; + init.__wbindgen_wasm_module = module; + return wasm; + }); +} +var wasm, heap, heap_next, cachedTextDecoder, cachegetUint8Memory0, WASM_VECTOR_LEN, cachedTextEncoder, encodeString, cachegetInt32Memory0; +var init_wasm_loader = __esm({ + "src/wasm-loader.js"() { + heap = new Array(32).fill(void 0); + heap.push(void 0, null, true, false); + heap_next = heap.length; + cachedTextDecoder = new TextDecoder("utf-8", { + ignoreBOM: true, + fatal: true + }); + cachedTextDecoder.decode(); + cachegetUint8Memory0 = null; + WASM_VECTOR_LEN = 0; + cachedTextEncoder = new TextEncoder("utf-8"); + encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) { + return cachedTextEncoder.encodeInto(arg, view); + } : function(arg, view) { + const buf = cachedTextEncoder.encode(arg); + view.set(buf); + return { + read: arg.length, + written: buf.length + }; + }; + cachegetInt32Memory0 = null; + } +}); + +// src/index.tsx +import React18, { useMemo as useMemo5, useState as useState6 } from "react"; +import { SkipNavContent } from "@reach/skip-nav"; +import cn8 from "classnames"; +import { useRouter as useRouter7 } from "next/router"; +import { ThemeProvider } from "next-themes"; + +// src/misc/active-anchor.tsx +import React, { createContext, useContext, useState } from "react"; +var ActiveAnchorContext = createContext({}); +var ActiveAnchorSetterContext = createContext((s) => s); +var useActiveAnchor = () => useContext(ActiveAnchorContext); +var useActiveAnchorSet = () => useContext(ActiveAnchorSetterContext); +var ActiveAnchor = ({ children }) => { + const state = useState({}); + return /* @__PURE__ */ React.createElement(ActiveAnchorContext.Provider, { + value: state[0] + }, /* @__PURE__ */ React.createElement(ActiveAnchorSetterContext.Provider, { + value: state[1] + }, children)); +}; + +// src/misc/default.config.tsx +import React2 from "react"; +var defaultTheme = { + docsRepositoryBase: "https://github.com/shuding/nextra", + titleSuffix: " \u2013 Nextra", + nextLinks: true, + prevLinks: true, + search: true, + darkMode: true, + defaultMenuCollapsed: false, + font: true, + footer: true, + footerText: `MIT ${new Date().getFullYear()} \xA9 Nextra.`, + footerEditLink: "Edit this page", + logo: /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("span", { + className: "mr-2 font-extrabold hidden md:inline" + }, "Nextra"), /* @__PURE__ */ React2.createElement("span", { + className: "text-gray-600 font-normal hidden md:inline" + }, "The Next Docs Builder")), + head: /* @__PURE__ */ React2.createElement(React2.Fragment, null, /* @__PURE__ */ React2.createElement("meta", { + name: "msapplication-TileColor", + content: "#ffffff" + }), /* @__PURE__ */ React2.createElement("meta", { + name: "theme-color", + content: "#ffffff" + }), /* @__PURE__ */ React2.createElement("meta", { + name: "viewport", + content: "width=device-width, initial-scale=1.0" + }), /* @__PURE__ */ React2.createElement("meta", { + httpEquiv: "Content-Language", + content: "en" + }), /* @__PURE__ */ React2.createElement("meta", { + name: "description", + content: "Nextra: the next docs builder" + }), /* @__PURE__ */ React2.createElement("meta", { + name: "twitter:card", + content: "summary_large_image" + }), /* @__PURE__ */ React2.createElement("meta", { + name: "twitter:site", + content: "@shuding_" + }), /* @__PURE__ */ React2.createElement("meta", { + property: "og:title", + content: "Nextra: the next docs builder" + }), /* @__PURE__ */ React2.createElement("meta", { + property: "og:description", + content: "Nextra: the next docs builder" + }), /* @__PURE__ */ React2.createElement("meta", { + name: "apple-mobile-web-app-title", + content: "Nextra" + })) +}; +var default_config_default = defaultTheme; + +// src/misc/theme.tsx +import React3, { useContext as useContext2, useEffect, useMemo, useRef } from "react"; +import { MDXProvider } from "@mdx-js/react"; +import Slugger from "github-slugger"; +import Link from "next/link"; +import Highlight, { defaultProps } from "prism-react-renderer"; +import "intersection-observer"; +var THEME = { + plain: { + backgroundColor: "transparent" + }, + styles: [ + { + types: ["keyword", "builtin"], + style: { + color: "#ff0078", + fontWeight: "bold" + } + }, + { + types: ["comment"], + style: { + color: "#999", + fontStyle: "italic" + } + }, + { + types: ["variable", "language-javascript"], + style: { + color: "#0076ff" + } + }, + { + types: ["attr-name"], + style: { + color: "#d9931e", + fontStyle: "normal" + } + }, + { + types: ["boolean", "regex"], + style: { + color: "#d9931e" + } + } + ] +}; +var ob = {}; +var obCallback = {}; +var createOrGetObserver = (rootMargin) => { + if (!ob[rootMargin]) { + obCallback[rootMargin] = []; + ob[rootMargin] = new IntersectionObserver((e) => { + obCallback[rootMargin].forEach((cb) => cb(e)); + }, { + rootMargin, + threshold: [0, 1] + }); + } + return ob[rootMargin]; +}; +function useIntersect(margin, ref, cb) { + useEffect(() => { + const callback = (entries) => { + let e; + for (let i = 0; i < entries.length; i++) { + if (entries[i].target === ref.current) { + e = entries[i]; + break; + } + } + if (e) + cb(e); + }; + const observer = createOrGetObserver(margin); + obCallback[margin].push(callback); + if (ref.current) + observer.observe(ref.current); + return () => { + const idx = obCallback[margin].indexOf(callback); + if (idx >= 0) + obCallback[margin].splice(idx, 1); + if (ref.current) + observer.unobserve(ref.current); + }; + }, []); +} +var HeaderLink = (_a) => { + var _b = _a, { + tag: Tag, + children, + slugger, + withObserver = true + } = _b, props = __objRest(_b, [ + "tag", + "children", + "slugger", + "withObserver" + ]); + const setActiveAnchor = useActiveAnchorSet(); + const obRef = useRef(null); + const slug = slugger.slug(children); + const anchor = /* @__PURE__ */ React3.createElement("span", { + className: "subheading-anchor", + id: slug, + ref: obRef + }); + const index = slugger.index++; + useIntersect("0px 0px -50%", obRef, (e) => { + const aboveHalfViewport = e.boundingClientRect.y + e.boundingClientRect.height <= e.rootBounds.y + e.rootBounds.height; + const insideHalfViewport = e.intersectionRatio > 0; + setActiveAnchor((f) => { + const ret = __spreadProps(__spreadValues({}, f), { + [slug]: { + index, + aboveHalfViewport, + insideHalfViewport + } + }); + let activeSlug = ""; + let smallestIndexInViewport = Infinity; + let largestIndexAboveViewport = -1; + for (let s in f) { + ret[s].isActive = false; + if (ret[s].insideHalfViewport && ret[s].index < smallestIndexInViewport) { + smallestIndexInViewport = ret[s].index; + activeSlug = s; + } + if (smallestIndexInViewport === Infinity && ret[s].aboveHalfViewport && ret[s].index > largestIndexAboveViewport) { + largestIndexAboveViewport = ret[s].index; + activeSlug = s; + } + } + if (ret[activeSlug]) + ret[activeSlug].isActive = true; + return ret; + }); + }); + return /* @__PURE__ */ React3.createElement(Tag, __spreadValues({}, props), anchor, /* @__PURE__ */ React3.createElement("a", { + href: "#" + slug, + className: "text-current no-underline no-outline" + }, children, /* @__PURE__ */ React3.createElement("span", { + className: "anchor-icon", + "aria-hidden": true + }, "#"))); +}; +var H2 = ({ slugger }) => (_a) => { + var _b = _a, { children } = _b, props = __objRest(_b, ["children"]); + return /* @__PURE__ */ React3.createElement(HeaderLink, __spreadValues({ + tag: "h2", + slugger + }, props), children); +}; +var H3 = ({ slugger }) => (_a) => { + var _b = _a, { children } = _b, props = __objRest(_b, ["children"]); + return /* @__PURE__ */ React3.createElement(HeaderLink, __spreadValues({ + tag: "h3", + slugger + }, props), children); +}; +var H4 = ({ slugger }) => (_a) => { + var _b = _a, { children } = _b, props = __objRest(_b, ["children"]); + return /* @__PURE__ */ React3.createElement(HeaderLink, __spreadValues({ + tag: "h4", + slugger + }, props), children); +}; +var H5 = ({ slugger }) => (_a) => { + var _b = _a, { children } = _b, props = __objRest(_b, ["children"]); + return /* @__PURE__ */ React3.createElement(HeaderLink, __spreadValues({ + tag: "h5", + slugger + }, props), children); +}; +var H6 = ({ slugger }) => (_a) => { + var _b = _a, { children } = _b, props = __objRest(_b, ["children"]); + return /* @__PURE__ */ React3.createElement(HeaderLink, __spreadValues({ + tag: "h6", + slugger + }, props), children); +}; +var A = (_a) => { + var _b = _a, { + children + } = _b, props = __objRest(_b, [ + "children" + ]); + const isExternal = props.href && props.href.startsWith("https://"); + if (isExternal) { + return /* @__PURE__ */ React3.createElement("a", __spreadValues({ + target: "_blank", + rel: "noreferrer" + }, props), children); + } + return props.href ? /* @__PURE__ */ React3.createElement(Link, { + href: props.href + }, /* @__PURE__ */ React3.createElement("a", __spreadValues({}, props), children)) : /* @__PURE__ */ React3.createElement(React3.Fragment, null); +}; +var PreContext = React3.createContext({}); +var Pre = (_a) => { + var _b = _a, { + children + } = _b, props = __objRest(_b, [ + "children" + ]); + return /* @__PURE__ */ React3.createElement(PreContext.Provider, { + value: props + }, /* @__PURE__ */ React3.createElement("pre", null, children)); +}; +var Code = ({ + children, + className +}) => { + const { highlight } = useContext2(PreContext); + const highlightedRanges = useMemo(() => { + return highlight ? highlight.split(",").map((r) => { + if (r.includes("-")) { + return r.split("-").map((v) => parseInt(v, 10)); + } + return +r; + }) : []; + }, [highlight]); + if (!className) + return /* @__PURE__ */ React3.createElement("code", null, children); + if (typeof children !== "string") + return /* @__PURE__ */ React3.createElement("code", null, children); + const language = className.replace(/language-/, ""); + return /* @__PURE__ */ React3.createElement(Highlight, __spreadProps(__spreadValues({}, defaultProps), { + code: children.trim(), + language, + theme: THEME + }), ({ className: className2, style, tokens, getLineProps, getTokenProps }) => /* @__PURE__ */ React3.createElement("code", { + className: className2, + style: __spreadValues({}, style) + }, tokens.map((line, i) => /* @__PURE__ */ React3.createElement("div", __spreadProps(__spreadValues({ + key: i + }, getLineProps({ line, key: i })), { + style: highlightedRanges.some((r) => Array.isArray(r) ? r[0] <= i + 1 && i + 1 <= r[1] : r === i + 1) ? { + background: "var(--c-highlight)", + margin: "0 -1rem", + padding: "0 1rem" + } : {} + }), line.map((token, key) => /* @__PURE__ */ React3.createElement("span", __spreadValues({ + key + }, getTokenProps({ token, key })))))))); +}; +var Table = ({ children }) => { + return /* @__PURE__ */ React3.createElement("div", { + className: "table-container" + }, /* @__PURE__ */ React3.createElement("table", null, children)); +}; +var getComponents = (args) => ({ + h2: H2(args), + h3: H3(args), + h4: H4(args), + h5: H5(args), + h6: H6(args), + a: A, + pre: Pre, + code: Code, + table: Table +}); +var MDXTheme = ({ children }) => { + const slugger = new Slugger(); + slugger.index = 0; + return /* @__PURE__ */ React3.createElement(MDXProvider, { + components: getComponents({ slugger }) + }, children); +}; +var theme_default = MDXTheme; + +// src/utils/get-fs-route.ts +var getFSRoute = (asPath, locale) => { + if (!locale) + return asPath.replace(new RegExp("/index(/|$)"), "$1"); + return asPath.replace(new RegExp(`.${locale}(/|$)`), "$1").replace(new RegExp("/index(/|$)"), "$1"); +}; + +// src/utils/menu-context.ts +import { createContext as createContext2, useContext as useContext3 } from "react"; +var MenuContext = createContext2({ + menu: false, + setMenu: () => { + }, + defaultMenuCollapsed: true +}); +function useMenuContext() { + return useContext3(MenuContext); +} + +// src/utils/normalize-pages.tsx +import getTitle from "title"; +function getMetaTitle(meta) { + if (typeof meta === "string") + return meta; + if (typeof meta === "object") + return meta.title; + return ""; +} +function getMetaItemType(meta) { + if (typeof meta === "object") + return meta.type; + return "docs"; +} +function getMetaHidden(meta) { + if (typeof meta === "object") + return meta.hidden || false; + return false; +} +function normalizePages({ + list, + locale, + defaultLocale, + route, + docsRoot = "" +}) { + let meta = ""; + for (let item of list) { + if (item.name === "meta.json") { + if (locale === item.locale) { + meta = item.meta; + break; + } + if (!meta) { + meta = item.meta; + } + } + } + if (!meta) { + meta = {}; + } + const metaKeys = Object.keys(meta); + const hasLocale = /* @__PURE__ */ new Map(); + if (locale) { + list.forEach((a) => a.locale === locale ? hasLocale.set(a.name, true) : null); + } + const directories = []; + const flatDirectories = []; + const docsDirectories = []; + const flatDocsDirectories = []; + const pageDirectories = []; + const flatPageDirectories = []; + let activeType = void 0; + let activeIndex = 0; + list.filter((a) => a.name !== "meta.json" && !a.name.startsWith("_") && (a.locale === locale || (a.locale === defaultLocale || !a.locale) && !hasLocale.get(a.name))).sort((a, b) => { + const indexA = metaKeys.indexOf(a.name); + const indexB = metaKeys.indexOf(b.name); + if (indexA === -1 && indexB === -1) + return a.name < b.name ? -1 : 1; + if (indexA === -1) + return 1; + if (indexB === -1) + return -1; + return indexA - indexB; + }).forEach((a) => { + if (typeof meta !== "object") + return; + const title = getMetaTitle(meta[a.name]) || getTitle(a.name); + const type = getMetaItemType(meta[a.name]) || "docs"; + const hidden = getMetaHidden(meta[a.name]); + const isCurrentDocsTree = type === "docs" && route.startsWith(docsRoot); + if (a.route === route) { + activeType = type; + switch (type) { + case "nav": + activeIndex = flatPageDirectories.length; + break; + case "docs": + default: + if (isCurrentDocsTree) { + activeIndex = flatDocsDirectories.length; + } + } + } + const normalizedChildren = a.children ? normalizePages({ + list: a.children, + locale, + defaultLocale, + route, + docsRoot: type === "nav" ? a.route : docsRoot + }) : void 0; + if (normalizedChildren) { + if (normalizedChildren.activeIndex !== void 0 && normalizedChildren.activeType !== void 0) { + activeType = normalizedChildren.activeType; + switch (activeType) { + case "nav": + activeIndex = flatPageDirectories.length + normalizedChildren.activeIndex; + break; + case "docs": + activeIndex = flatDocsDirectories.length + normalizedChildren.activeIndex; + break; + } + } + } + const item = __spreadProps(__spreadValues({}, a), { + title, + type, + children: normalizedChildren ? [] : void 0 + }); + const docsItem = __spreadProps(__spreadValues({}, a), { + title, + type, + children: normalizedChildren ? [] : void 0 + }); + const pageItem = __spreadProps(__spreadValues({}, a), { + title, + type, + hidden, + children: normalizedChildren ? [] : void 0 + }); + if (normalizedChildren) { + switch (type) { + case "nav": + pageItem.children.push(...normalizedChildren.pageDirectories); + docsDirectories.push(...normalizedChildren.docsDirectories); + if (!normalizedChildren.flatPageDirectories.length && normalizedChildren.flatDirectories.length) { + pageItem.firstChildRoute = normalizedChildren.flatDirectories[0].route; + flatPageDirectories.push(pageItem); + } + break; + case "docs": + default: + if (isCurrentDocsTree) { + Array.isArray(docsItem.children) && docsItem.children.push(...normalizedChildren.docsDirectories); + pageDirectories.push(...normalizedChildren.pageDirectories); + } + } + flatDirectories.push(...normalizedChildren.flatDirectories); + flatPageDirectories.push(...normalizedChildren.flatPageDirectories); + flatDocsDirectories.push(...normalizedChildren.flatDocsDirectories); + Array.isArray(item.children) && item.children.push(...normalizedChildren.directories); + } else { + flatDirectories.push(item); + switch (type) { + case "nav": + flatPageDirectories.push(pageItem); + break; + case "docs": + default: + if (isCurrentDocsTree) { + flatDocsDirectories.push(docsItem); + } + } + } + directories.push(item); + switch (type) { + case "nav": + pageDirectories.push(pageItem); + break; + case "docs": + default: + if (isCurrentDocsTree) { + docsDirectories.push(docsItem); + } + } + }); + return { + activeType, + activeIndex, + directories, + flatDirectories, + docsDirectories, + flatDocsDirectories, + pageDirectories, + flatPageDirectories + }; +} + +// src/config.ts +import React4 from "react"; +var ThemeConfigContext = React4.createContext({}); +var useConfig = () => React4.useContext(ThemeConfigContext); + +// src/footer.tsx +import React7 from "react"; +import cn from "classnames"; +import Link2 from "next/link"; +import { useRouter } from "next/router"; +import parseGitUrl from "parse-git-url"; + +// src/icons/arrow-right.tsx +import React5 from "react"; +var ArrowRight = (_a) => { + var _b = _a, { height = 24 } = _b, props = __objRest(_b, ["height"]); + return /* @__PURE__ */ React5.createElement("svg", __spreadValues({ + height, + fill: "none", + viewBox: "0 0 24 24", + stroke: "currentColor" + }, props), /* @__PURE__ */ React5.createElement("path", { + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: 2, + d: "M9 5l7 7-7 7" + })); +}; +var arrow_right_default = ArrowRight; + +// src/utils/render-component.tsx +import React6 from "react"; +var renderComponent = (ComponentOrNode, props) => { + if (!ComponentOrNode) + return null; + if (typeof ComponentOrNode === "function") { + return /* @__PURE__ */ React6.createElement(ComponentOrNode, __spreadValues({}, props)); + } + return ComponentOrNode; +}; +var render_component_default = renderComponent; + +// src/footer.tsx +var NextLink = ({ route, title, isRTL }) => { + return /* @__PURE__ */ React7.createElement(Link2, { + href: route + }, /* @__PURE__ */ React7.createElement("a", { + className: cn("text-lg font-medium p-4 -m-4 no-underline text-gray-600 hover:text-blue-600 flex items-center", { "ml-2": !isRTL, "mr-2": isRTL }), + title + }, title, /* @__PURE__ */ React7.createElement(arrow_right_default, { + className: cn("transform inline flex-shrink-0", { + "rotate-180 mr-1": isRTL, + "ml-1": !isRTL + }) + }))); +}; +var PrevLink = ({ route, title, isRTL }) => { + return /* @__PURE__ */ React7.createElement(Link2, { + href: route + }, /* @__PURE__ */ React7.createElement("a", { + className: cn("text-lg font-medium p-4 -m-4 no-underline text-gray-600 hover:text-blue-600 flex items-center", { "mr-2": !isRTL, "ml-2": isRTL }), + title + }, /* @__PURE__ */ React7.createElement(arrow_right_default, { + className: cn("transform inline flex-shrink-0", { + "rotate-180 mr-1": !isRTL, + "ml-1": isRTL + }) + }), title)); +}; +var createEditUrl = (repository, filepath) => { + const repo = parseGitUrl(repository || ""); + if (!repo) + throw new Error("Invalid `docsRepositoryBase` URL!"); + switch (repo.type) { + case "github": + return `https://github.com/${repo.owner}/${repo.name}/blob/${repo.branch || "main"}/${repo.subdir || "pages"}${filepath}`; + case "gitlab": + return `https://gitlab.com/${repo.owner}/${repo.name}/-/blob/${repo.branch || "master"}/${repo.subdir || "pages"}${filepath}`; + } + return "#"; +}; +var EditPageLink = ({ + repository, + text, + filepath +}) => { + const url = createEditUrl(repository, filepath); + const { locale } = useRouter(); + return /* @__PURE__ */ React7.createElement("a", { + className: "text-sm", + href: url, + target: "_blank", + rel: "noreferrer" + }, text ? render_component_default(text, { + locale + }) : "Edit this page"); +}; +var NavLinks = ({ + flatDirectories, + currentIndex, + isRTL +}) => { + const config = useConfig(); + let prev = flatDirectories[currentIndex - 1]; + let next = flatDirectories[currentIndex + 1]; + return /* @__PURE__ */ React7.createElement("div", { + className: "flex flex-row items-center justify-between" + }, /* @__PURE__ */ React7.createElement("div", null, prev && config.prevLinks ? /* @__PURE__ */ React7.createElement(PrevLink, { + route: prev.route, + title: prev.title, + isRTL + }) : null), /* @__PURE__ */ React7.createElement("div", null, config.nextLinks && next ? /* @__PURE__ */ React7.createElement(NextLink, { + route: next.route, + title: next.title, + isRTL + }) : null)); +}; +var Footer = ({ + filepathWithName, + children +}) => { + const { locale } = useRouter(); + const config = useConfig(); + return /* @__PURE__ */ React7.createElement("footer", { + className: "mt-24" + }, children, /* @__PURE__ */ React7.createElement("hr", null), config.footer ? /* @__PURE__ */ React7.createElement("div", { + className: "mt-24 flex justify-between flex-col-reverse md:flex-row items-center md:items-end" + }, /* @__PURE__ */ React7.createElement("span", { + className: "text-gray-600" + }, render_component_default(config.footerText, { locale })), /* @__PURE__ */ React7.createElement("div", { + className: "mt-6" + }), config.footerEditLink ? /* @__PURE__ */ React7.createElement(EditPageLink, { + filepath: filepathWithName, + repository: config.docsRepositoryBase, + text: config.footerEditLink + }) : null) : null); +}; +var footer_default = Footer; + +// src/head.tsx +import React8 from "react"; +import NextHead from "next/head"; +function Head({ title, locale, meta }) { + const config = useConfig(); + return /* @__PURE__ */ React8.createElement(NextHead, null, config.font ? /* @__PURE__ */ React8.createElement("link", { + rel: "stylesheet", + href: "https://rsms.me/inter/inter.css" + }) : null, /* @__PURE__ */ React8.createElement("title", null, title, render_component_default(config.titleSuffix, { locale, config, title, meta })), config.font ? /* @__PURE__ */ React8.createElement("style", { + dangerouslySetInnerHTML: { + __html: `html{font-family:Inter,sans-serif}@supports(font-variation-settings:normal){html{font-family:'Inter var',sans-serif}}` + } + }) : null, render_component_default(config.head, { locale, config, title, meta }), config.unstable_faviconGlyph ? /* @__PURE__ */ React8.createElement("link", { + rel: "icon", + href: `data:image/svg+xml;utf8,${config.unstable_faviconGlyph}` + }) : null); +} + +// src/navbar.tsx +import React15 from "react"; +import cn5 from "classnames"; +import Link6 from "next/link"; +import { useRouter as useRouter5 } from "next/router"; + +// src/icons/discord.tsx +import React9 from "react"; +var DiscordIcon = ({ height = 40 }) => { + return /* @__PURE__ */ React9.createElement("svg", { + height, + fill: "none", + xmlns: "http://www.w3.org/2000/svg", + viewBox: "0 0 146 146", + "aria-hidden": "true" + }, /* @__PURE__ */ React9.createElement("title", null, "Discord"), /* @__PURE__ */ React9.createElement("path", { + d: "M107.75 125.001s-4.5-5.375-8.25-10.125c16.375-4.625 22.625-14.875 22.625-14.875-5.125 3.375-10 5.75-14.375 7.375-6.25 2.625-12.25 4.375-18.125 5.375-12 2.25-23 1.625-32.375-.125-7.125-1.375-13.25-3.375-18.375-5.375-2.875-1.125-6-2.5-9.125-4.25-.375-.25-.75-.375-1.125-.625-.25-.125-.375-.25-.5-.375-2.25-1.25-3.5-2.125-3.5-2.125s6 10 21.875 14.75c-3.75 4.75-8.375 10.375-8.375 10.375-27.625-.875-38.125-19-38.125-19 0-40.25 18-72.875 18-72.875 18-13.5 35.125-13.125 35.125-13.125l1.25 1.5c-22.5 6.5-32.875 16.375-32.875 16.375s2.75-1.5 7.375-3.625c13.375-5.875 24-7.5 28.375-7.875.75-.125 1.375-.25 2.125-.25 7.625-1 16.25-1.25 25.25-.25 11.875 1.375 24.625 4.875 37.625 12 0 0-9.875-9.375-31.125-15.875l1.75-2S110 19.626 128 33.126c0 0 18 32.625 18 72.875 0 0-10.625 18.125-38.25 19zM49.625 66.626c-7.125 0-12.75 6.25-12.75 13.875s5.75 13.875 12.75 13.875c7.125 0 12.75-6.25 12.75-13.875.125-7.625-5.625-13.875-12.75-13.875zm45.625 0c-7.125 0-12.75 6.25-12.75 13.875s5.75 13.875 12.75 13.875c7.125 0 12.75-6.25 12.75-13.875s-5.625-13.875-12.75-13.875z", + fillRule: "nonzero", + fill: "currentColor" + })); +}; +var discord_default = DiscordIcon; + +// src/icons/github.tsx +import React10 from "react"; +var Github = ({ height = 40 }) => { + return /* @__PURE__ */ React10.createElement("svg", { + height, + viewBox: "2 2 20 20", + fill: "none", + "aria-hidden": "true" + }, /* @__PURE__ */ React10.createElement("path", { + fillRule: "evenodd", + clipRule: "evenodd", + d: "M12 3C7.0275 3 3 7.12937 3 12.2276C3 16.3109 5.57625 19.7597 9.15374 20.9824C9.60374 21.0631 9.77249 20.7863 9.77249 20.5441C9.77249 20.3249 9.76125 19.5982 9.76125 18.8254C7.5 19.2522 6.915 18.2602 6.735 17.7412C6.63375 17.4759 6.19499 16.6569 5.8125 16.4378C5.4975 16.2647 5.0475 15.838 5.80124 15.8264C6.51 15.8149 7.01625 16.4954 7.18499 16.7723C7.99499 18.1679 9.28875 17.7758 9.80625 17.5335C9.885 16.9337 10.1212 16.53 10.38 16.2993C8.3775 16.0687 6.285 15.2728 6.285 11.7432C6.285 10.7397 6.63375 9.9092 7.20749 9.26326C7.1175 9.03257 6.8025 8.08674 7.2975 6.81794C7.2975 6.81794 8.05125 6.57571 9.77249 7.76377C10.4925 7.55615 11.2575 7.45234 12.0225 7.45234C12.7875 7.45234 13.5525 7.55615 14.2725 7.76377C15.9937 6.56418 16.7475 6.81794 16.7475 6.81794C17.2424 8.08674 16.9275 9.03257 16.8375 9.26326C17.4113 9.9092 17.76 10.7281 17.76 11.7432C17.76 15.2843 15.6563 16.0687 13.6537 16.2993C13.98 16.5877 14.2613 17.1414 14.2613 18.0065C14.2613 19.2407 14.25 20.2326 14.25 20.5441C14.25 20.7863 14.4188 21.0746 14.8688 20.9824C16.6554 20.364 18.2079 19.1866 19.3078 17.6162C20.4077 16.0457 20.9995 14.1611 21 12.2276C21 7.12937 16.9725 3 12 3Z", + fill: "currentColor" + })); +}; +var github_default = Github; + +// src/locale-switch.tsx +import React11 from "react"; +import cn2 from "classnames"; +import Link3 from "next/link"; +import { useRouter as useRouter2 } from "next/router"; + +// src/utils/use-mounted.ts +import { useEffect as useEffect2, useState as useState2 } from "react"; +var useMounted = () => { + const [mounted, setMounted] = useState2(false); + useEffect2(() => { + setMounted(true); + }, []); + return mounted; +}; +var use_mounted_default = useMounted; + +// src/locale-switch.tsx +function LocaleSwitch({ options, isRTL }) { + const { locale, asPath } = useRouter2(); + const mounted = use_mounted_default(); + return /* @__PURE__ */ React11.createElement("details", { + className: "locale-switch relative" + }, /* @__PURE__ */ React11.createElement("summary", { + className: "text-current p-2 cursor-pointer outline-none", + tabIndex: 0 + }, /* @__PURE__ */ React11.createElement("svg", { + fill: "none", + viewBox: "0 0 24 24", + width: "24", + height: "24", + stroke: "currentColor", + "aria-hidden": "true" + }, /* @__PURE__ */ React11.createElement("path", { + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: 2, + d: "M3 5h12M9 3v2m1.048 9.5A18.022 18.022 0 016.412 9m6.088 9h7M11 21l5-10 5 10M12.751 5C11.783 10.77 8.07 15.61 3 18.129" + })), /* @__PURE__ */ React11.createElement("span", { + className: "sr-only" + }, "Languages")), mounted ? /* @__PURE__ */ React11.createElement("ul", { + className: cn2("locale-dropdown absolute block bg-white dark:bg-dark border dark:border-gray-700 py-1 rounded shadow-lg", { "right-0": !isRTL, "left-0": isRTL }) + }, Array.isArray(options) && options.map((l) => /* @__PURE__ */ React11.createElement("li", { + key: l.locale + }, /* @__PURE__ */ React11.createElement(Link3, { + href: asPath, + locale: l.locale + }, /* @__PURE__ */ React11.createElement("a", { + className: cn2("block no-underline text-current py-2 px-4 hover:bg-gray-200 dark:hover:bg-gray-800 whitespace-nowrap", { + "font-semibold": locale === l.locale, + "bg-gray-100 dark:bg-gray-900": locale === l.locale + }) + }, l.text))))) : null); +} + +// src/search.tsx +import React12, { + useCallback, + useEffect as useEffect3, + useMemo as useMemo2, + useRef as useRef2, + useState as useState3 +} from "react"; +import cn3 from "classnames"; +import { matchSorter } from "match-sorter"; +import Link4 from "next/link"; +import { useRouter as useRouter3 } from "next/router"; +var Item = ({ title, active, href, onMouseOver, search }) => { + const highlight = title.toLowerCase().indexOf(search.toLowerCase()); + return /* @__PURE__ */ React12.createElement(Link4, { + href + }, /* @__PURE__ */ React12.createElement("a", { + className: "block no-underline", + onMouseOver + }, /* @__PURE__ */ React12.createElement("li", { + className: cn3("p-2", { active }) + }, title.substring(0, highlight), /* @__PURE__ */ React12.createElement("span", { + className: "highlight" + }, title.substring(highlight, highlight + search.length)), title.substring(highlight + search.length)))); +}; +var UP = true; +var DOWN = false; +var Search = ({ directories = [] }) => { + const router = useRouter3(); + const [show, setShow] = useState3(false); + const [search, setSearch] = useState3(""); + const [active, setActive] = useState3(0); + const input = useRef2(null); + const results = useMemo2(() => { + if (!search) + return []; + return matchSorter(directories, search, { keys: ["title"] }); + }, [search]); + const moveActiveItem = (up) => { + const position = active + (up ? -1 : 1); + const { length } = results; + const next = (position + length) % length; + setActive(next); + }; + const handleKeyDown = useCallback((e) => { + const { key, ctrlKey } = e; + if (ctrlKey && key === "n" || key === "ArrowDown") { + e.preventDefault(); + moveActiveItem(DOWN); + } + if (ctrlKey && key === "p" || key === "ArrowUp") { + e.preventDefault(); + moveActiveItem(UP); + } + if (key === "Enter" && results && results[active]) { + router.push(results[active].route); + } + }, [active, results, router]); + useEffect3(() => { + setActive(0); + }, [search]); + useEffect3(() => { + const inputs = ["input", "select", "button", "textarea"]; + const down = (e) => { + var _a; + if (document.activeElement && inputs.indexOf(document.activeElement.tagName.toLowerCase()) === -1) { + if (e.key === "/") { + e.preventDefault(); + (_a = input.current) == null ? void 0 : _a.focus(); + } else if (e.key === "Escape") { + setShow(false); + } + } + }; + window.addEventListener("keydown", down); + return () => window.removeEventListener("keydown", down); + }, []); + const renderList = show && results.length > 0; + return /* @__PURE__ */ React12.createElement("div", { + className: "relative w-full nextra-search md:w-64" + }, renderList && /* @__PURE__ */ React12.createElement("div", { + className: "z-10 search-overlay", + onClick: () => setShow(false) + }), /* @__PURE__ */ React12.createElement("div", { + className: "relative flex items-center" + }, /* @__PURE__ */ React12.createElement("input", { + onChange: (e) => { + setSearch(e.target.value); + setShow(true); + }, + className: "block w-full px-3 py-2 leading-tight border rounded appearance-none focus:outline-none focus:ring", + type: "search", + placeholder: "Search documentation...", + onKeyDown: handleKeyDown, + onFocus: () => setShow(true), + onBlur: () => setShow(false), + ref: input, + spellCheck: false + }), show ? null : /* @__PURE__ */ React12.createElement("div", { + className: "hidden sm:flex absolute inset-y-0 right-0 py-1.5 pr-1.5" + }, /* @__PURE__ */ React12.createElement("kbd", { + className: "inline-flex items-center px-2 font-sans text-sm font-medium text-gray-400 dark:text-gray-800 dark:border-gray-800 border rounded" + }, "/"))), renderList && /* @__PURE__ */ React12.createElement("ul", { + className: "absolute left-0 z-20 w-full p-0 m-0 mt-1 list-none border divide-y rounded shadow-md md:right-0 top-100 md:w-auto" + }, results.map((res, i) => { + return /* @__PURE__ */ React12.createElement(Item, { + key: `search-item-${i}`, + title: res.title, + href: res.route, + active: i === active, + search, + onMouseOver: () => setActive(i) + }); + }))); +}; +var search_default = Search; + +// src/stork-search.js +import React13, { + Fragment, + useCallback as useCallback2, + useEffect as useEffect4, + useMemo as useMemo3, + useRef as useRef3, + useState as useState4 +} from "react"; +import cn4 from "classnames"; +import GraphemeSplitter from "grapheme-splitter"; +import Link5 from "next/link"; +import Router, { useRouter as useRouter4 } from "next/router"; +var splitter = new GraphemeSplitter(); +var TextWithHighlights = React13.memo(({ content, ranges }) => { + const splittedText = content ? splitter.splitGraphemes(content) : []; + const res = []; + let id = 0, index = 0; + for (const range of ranges) { + res.push(/* @__PURE__ */ React13.createElement(Fragment, { + key: id++ + }, splittedText.splice(0, range.beginning - index).join(""))); + res.push(/* @__PURE__ */ React13.createElement("span", { + className: "highlight", + key: id++ + }, splittedText.splice(0, range.end - range.beginning).join(""))); + index = range.end; + } + res.push(/* @__PURE__ */ React13.createElement(Fragment, { + key: id++ + }, splittedText.join(""))); + return res; +}); +var Item2 = ({ title, active, href, onMouseOver, excerpt }) => { + return /* @__PURE__ */ React13.createElement(Link5, { + href + }, /* @__PURE__ */ React13.createElement("a", { + className: "block no-underline", + onMouseOver + }, /* @__PURE__ */ React13.createElement("li", { + className: cn4("py-2 px-4", { active }) + }, /* @__PURE__ */ React13.createElement("span", { + className: "font-semibold" + }, title), excerpt ? /* @__PURE__ */ React13.createElement("div", { + className: "text-gray-600" + }, /* @__PURE__ */ React13.createElement(TextWithHighlights, { + content: excerpt.text, + ranges: excerpt.highlight_ranges + })) : null))); +}; +var stork = {}; +function Search2() { + const router = useRouter4(); + const [show, setShow] = useState4(false); + const [search, setSearch] = useState4(""); + const [active, setActive] = useState4(0); + const setStork = useState4({})[1]; + const input = useRef3(null); + const results = useMemo3(() => { + if (!search) + return []; + const localeCode = Router.locale || "default"; + if (!stork[localeCode]) + return []; + try { + const json = stork[localeCode].wasm_search(`index-${localeCode}`, search); + const obj = JSON.parse(json); + if (!obj.results) + return []; + return obj.results.slice(0, 20).map((result) => { + return { + title: result.entry.title, + route: result.entry.url, + excerpt: result.excerpts[0] + }; + }); + } catch (err) { + console.error(err); + return []; + } + }, [search]); + const handleKeyDown = useCallback2((e) => { + switch (e.key) { + case "ArrowDown": { + e.preventDefault(); + if (active + 1 < results.length) { + setActive(active + 1); + const activeElement = document.querySelector(`.nextra-stork ul > :nth-child(${active + 2})`); + if (activeElement && activeElement.scrollIntoViewIfNeeded) { + activeElement.scrollIntoViewIfNeeded(); + } + } + break; + } + case "ArrowUp": { + e.preventDefault(); + if (active - 1 >= 0) { + setActive(active - 1); + const activeElement = document.querySelector(`.nextra-stork ul > :nth-child(${active})`); + if (activeElement && activeElement.scrollIntoViewIfNeeded) { + activeElement.scrollIntoViewIfNeeded(); + } + } + break; + } + case "Enter": { + router.push(results[active].route); + break; + } + default: + break; + } + }, [active, results, router]); + const load2 = () => __async(this, null, function* () { + const localeCode = Router.locale || "default"; + if (!stork[localeCode]) { + stork[localeCode] = yield Promise.resolve().then(() => (init_wasm_loader(), wasm_loader_exports)); + setStork({}); + const init2 = stork[localeCode].init("/stork.wasm"); + const res = yield fetch(`/index-${localeCode}.st`); + const buf = yield res.arrayBuffer(); + yield init2; + stork[localeCode].wasm_register_index(`index-${localeCode}`, new Uint8Array(buf)); + } + }); + useEffect4(() => { + setActive(0); + }, [search]); + useEffect4(() => { + const inputs = ["input", "select", "button", "textarea"]; + const down = (e) => { + if (document.activeElement && inputs.indexOf(document.activeElement.tagName.toLowerCase()) === -1) { + if (e.key === "/") { + e.preventDefault(); + input.current.focus(); + } else if (e.key === "Escape") { + setShow(false); + } + } + }; + window.addEventListener("keydown", down); + return () => window.removeEventListener("keydown", down); + }, []); + const renderList = show && results.length > 0; + return /* @__PURE__ */ React13.createElement("div", { + className: "relative w-full nextra-search nextra-stork md:w-64" + }, renderList && /* @__PURE__ */ React13.createElement("div", { + className: "z-10 search-overlay", + onClick: () => setShow(false) + }), /* @__PURE__ */ React13.createElement("div", { + className: "relative flex items-center" + }, /* @__PURE__ */ React13.createElement("input", { + onChange: (e) => { + setSearch(e.target.value); + setShow(true); + }, + className: "block w-full px-3 py-2 leading-tight border rounded appearance-none focus:outline-none focus:ring", + type: "search", + placeholder: "Search documentation...", + onKeyDown: handleKeyDown, + onFocus: () => { + load2(); + setShow(true); + }, + onBlur: () => setShow(false), + ref: input, + spellCheck: false + }), show ? null : /* @__PURE__ */ React13.createElement("div", { + className: "hidden sm:flex absolute inset-y-0 right-0 py-1.5 pr-1.5" + }, /* @__PURE__ */ React13.createElement("kbd", { + className: "inline-flex items-center px-2 font-sans text-sm font-medium text-gray-400 dark:text-gray-800 dark:border-gray-800 border rounded" + }, "/"))), renderList && /* @__PURE__ */ React13.createElement("ul", { + className: "absolute z-20 p-0 m-0 mt-1 divide-y top-full" + }, results.map((res, i) => { + return /* @__PURE__ */ React13.createElement(Item2, { + key: `search-item-${i}`, + title: res.title, + href: res.route, + excerpt: res.excerpt, + active: i === active, + onMouseOver: () => setActive(i) + }); + }))); +} + +// src/theme-switch.tsx +import React14 from "react"; +import { useTheme } from "next-themes"; +function ThemeSwitch() { + const { theme, setTheme } = useTheme(); + const mounted = use_mounted_default(); + const toggleTheme = () => { + setTheme(theme === "dark" ? "light" : "dark"); + }; + return /* @__PURE__ */ React14.createElement("button", { + className: "text-current p-2 cursor-pointer focus:ring outline-none", + onClick: toggleTheme, + "aria-label": "Toggle theme", + onKeyDown: (e) => { + if (e.key === "Enter") + toggleTheme(); + } + }, mounted && theme === "dark" ? /* @__PURE__ */ React14.createElement("svg", { + fill: "none", + viewBox: "0 0 24 24", + width: "24", + height: "24", + stroke: "currentColor", + "aria-hidden": "true" + }, /* @__PURE__ */ React14.createElement("path", { + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: 2, + d: "M20.354 15.354A9 9 0 018.646 3.646 9.003 9.003 0 0012 21a9.003 9.003 0 008.354-5.646z" + })) : mounted && theme === "light" ? /* @__PURE__ */ React14.createElement("svg", { + fill: "none", + viewBox: "0 0 24 24", + width: "24", + height: "24", + stroke: "currentColor", + "aria-hidden": "true" + }, /* @__PURE__ */ React14.createElement("path", { + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: 2, + d: "M12 3v1m0 16v1m9-9h-1M4 12H3m15.364 6.364l-.707-.707M6.343 6.343l-.707-.707m12.728 0l-.707.707M6.343 17.657l-.707.707M16 12a4 4 0 11-8 0 4 4 0 018 0z" + })) : /* @__PURE__ */ React14.createElement("svg", { + key: "undefined", + viewBox: "0 0 24 24", + width: "24", + height: "24", + stroke: "currentColor", + strokeWidth: "1.5", + strokeLinecap: "round", + strokeLinejoin: "round", + fill: "none", + shapeRendering: "geometricPrecision", + "aria-hidden": "true" + })); +} + +// src/navbar.tsx +function Navbar({ + isRTL, + flatDirectories, + flatPageDirectories +}) { + const config = useConfig(); + const { locale, asPath } = useRouter5(); + const activeRoute = getFSRoute(asPath, locale).split("#")[0]; + const { menu, setMenu } = useMenuContext(); + return /* @__PURE__ */ React15.createElement("nav", { + className: "flex items-center bg-white z-20 fixed top-0 left-0 right-0 h-16 border-b border-gray-200 px-6 dark:bg-dark dark:border-gray-900 bg-opacity-[.97] dark:bg-opacity-100" + }, /* @__PURE__ */ React15.createElement("div", { + className: "w-full flex items-center mr-2" + }, /* @__PURE__ */ React15.createElement(Link6, { + href: "/" + }, /* @__PURE__ */ React15.createElement("a", { + className: "no-underline text-current inline-flex items-center hover:opacity-75" + }, render_component_default(config.logo, { locale })))), flatPageDirectories ? flatPageDirectories.map((page) => { + var _a; + if (page.hidden) + return null; + let href = page.route; + if (page.children) { + href = (_a = page.firstChildRoute) != null ? _a : href; + } + return /* @__PURE__ */ React15.createElement(Link6, { + href, + key: page.route + }, /* @__PURE__ */ React15.createElement("a", { + className: cn5("no-underline whitespace-nowrap mr-4 hidden md:inline-block", page.route === activeRoute || activeRoute.startsWith(page.route + "/") ? "text-current" : "text-gray-500") + }, page.title)); + }) : null, /* @__PURE__ */ React15.createElement("div", { + className: "flex-1" + }, /* @__PURE__ */ React15.createElement("div", { + className: "hidden md:inline-block mr-2" + }, config.customSearch || (config.search ? config.unstable_stork ? /* @__PURE__ */ React15.createElement(Search2, null) : /* @__PURE__ */ React15.createElement(search_default, { + directories: flatDirectories + }) : null))), config.darkMode ? /* @__PURE__ */ React15.createElement(ThemeSwitch, null) : null, config.i18n ? /* @__PURE__ */ React15.createElement(LocaleSwitch, { + options: config.i18n, + isRTL + }) : null, config.projectLink || config.github ? /* @__PURE__ */ React15.createElement("a", { + className: "text-current p-2", + href: config.projectLink || config.github, + target: "_blank", + rel: "noreferrer" + }, config.projectLinkIcon ? render_component_default(config.projectLinkIcon, { locale }) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(github_default, { + height: 24 + }), /* @__PURE__ */ React15.createElement("span", { + className: "sr-only" + }, "GitHub"))) : null, config.projectChatLink ? /* @__PURE__ */ React15.createElement("a", { + className: "text-current p-2", + href: config.projectChatLink, + target: "_blank", + rel: "noreferrer" + }, config.projectChatLinkIcon ? render_component_default(config.projectChatLinkIcon, { locale }) : /* @__PURE__ */ React15.createElement(React15.Fragment, null, /* @__PURE__ */ React15.createElement(discord_default, { + height: 24 + }), /* @__PURE__ */ React15.createElement("span", { + className: "sr-only" + }, "Discord"))) : null, /* @__PURE__ */ React15.createElement("button", { + className: "block md:hidden p-2", + onClick: () => setMenu(!menu) + }, /* @__PURE__ */ React15.createElement("svg", { + fill: "none", + width: "24", + height: "24", + viewBox: "0 0 24 24", + stroke: "currentColor" + }, /* @__PURE__ */ React15.createElement("path", { + strokeLinecap: "round", + strokeLinejoin: "round", + strokeWidth: 2, + d: "M4 6h16M4 12h16M4 18h16" + }))), /* @__PURE__ */ React15.createElement("div", { + className: "-mr-2" + })); +} + +// src/sidebar.tsx +import React16, { useEffect as useEffect5, useMemo as useMemo4, useState as useState5 } from "react"; +import cn6 from "classnames"; +import Slugger2 from "github-slugger"; +import Link7 from "next/link"; +import { useRouter as useRouter6 } from "next/router"; + +// src/utils/getHeadingText.ts +function getHeadingText(heading) { + if (Array.isArray(heading.children) && heading.children.length === 1) { + const content = heading.children[0]; + if (content.type === "text") + return content.value; + } + return ""; +} + +// src/sidebar.tsx +var TreeState = {}; +function Folder({ item, anchors }) { + var _a; + const { asPath, locale } = useRouter6(); + const routeOriginal = getFSRoute(asPath, locale); + const route = routeOriginal.split("#")[0]; + const active = route === item.route + "/" || route + "/" === item.route + "/"; + const { defaultMenuCollapsed } = useMenuContext(); + const open = (_a = TreeState[item.route]) != null ? _a : !defaultMenuCollapsed; + const [_, render] = useState5(false); + useEffect5(() => { + if (active) { + TreeState[item.route] = true; + } + }, [active]); + return /* @__PURE__ */ React16.createElement("li", { + className: open ? "active" : "" + }, /* @__PURE__ */ React16.createElement("button", { + onClick: () => { + if (active) + return; + TreeState[item.route] = !open; + render((x) => !x); + } + }, item.title), /* @__PURE__ */ React16.createElement("div", { + style: { + display: open ? "initial" : "none" + } + }, Array.isArray(item.children) && /* @__PURE__ */ React16.createElement(Menu, { + directories: item.children, + base: item.route, + anchors + }))); +} +function File({ item, anchors }) { + const { setMenu } = useMenuContext(); + const { asPath, locale } = useRouter6(); + const route = getFSRoute(asPath, locale); + const active = route === item.route + "/" || route + "/" === item.route + "/"; + const slugger = new Slugger2(); + const activeAnchor = useActiveAnchor(); + const title = item.title; + if (anchors && anchors.length) { + if (active) { + let activeIndex = 0; + const anchorInfo = anchors.map((anchor, i) => { + const text = anchor; + const slug = slugger.slug(text); + if (activeAnchor[slug] && activeAnchor[slug].isActive) { + activeIndex = i; + } + return { text, slug }; + }); + return /* @__PURE__ */ React16.createElement("li", { + className: active ? "active" : "" + }, /* @__PURE__ */ React16.createElement(Link7, { + href: item.route + }, /* @__PURE__ */ React16.createElement("a", null, title)), /* @__PURE__ */ React16.createElement("ul", null, anchors.map((_, i) => { + const { slug, text } = anchorInfo[i]; + const isActive = i === activeIndex; + return /* @__PURE__ */ React16.createElement("li", { + key: `a-${slug}` + }, /* @__PURE__ */ React16.createElement("a", { + href: "#" + slug, + onClick: () => setMenu(false), + className: isActive ? "active-anchor" : "" + }, /* @__PURE__ */ React16.createElement("span", { + className: "flex text-sm" + }, /* @__PURE__ */ React16.createElement("span", { + className: "opacity-25" + }, "#"), /* @__PURE__ */ React16.createElement("span", { + className: "mr-2" + }), /* @__PURE__ */ React16.createElement("span", { + className: "inline-block" + }, text)))); + }))); + } + } + return /* @__PURE__ */ React16.createElement("li", { + className: active ? "active" : "" + }, /* @__PURE__ */ React16.createElement(Link7, { + href: item.route + }, /* @__PURE__ */ React16.createElement("a", { + onClick: () => setMenu(false) + }, title))); +} +function Menu({ directories, anchors }) { + return /* @__PURE__ */ React16.createElement("ul", null, directories.map((item) => { + if (item.children) { + return /* @__PURE__ */ React16.createElement(Folder, { + key: item.name, + item, + anchors + }); + } + return /* @__PURE__ */ React16.createElement(File, { + key: item.name, + item, + anchors + }); + })); +} +var emptyHeading = []; +function Sidebar({ + directories, + flatDirectories, + fullDirectories, + mdShow = true, + headings = emptyHeading +}) { + const config = useConfig(); + const anchors = useMemo4(() => headings.filter((v) => v.children && v.depth === 2 && v.type === "heading").map((v) => getHeadingText(v)).filter(Boolean), [headings]); + const { menu } = useMenuContext(); + useEffect5(() => { + if (menu) { + document.body.classList.add("overflow-hidden"); + } else { + document.body.classList.remove("overflow-hidden"); + } + }, [menu]); + return /* @__PURE__ */ React16.createElement("aside", { + className: cn6("fixed h-screen bg-white dark:bg-dark flex-shrink-0 w-full md:w-64 md:sticky z-20", menu ? "" : "hidden", mdShow ? "md:block" : ""), + style: { + top: "4rem", + height: "calc(100vh - 4rem)" + } + }, /* @__PURE__ */ React16.createElement("div", { + className: "sidebar border-gray-200 dark:border-gray-900 w-full p-4 pb-40 md:pb-16 h-full overflow-y-auto" + }, /* @__PURE__ */ React16.createElement("div", { + className: "mb-4 block md:hidden" + }, config.customSearch || (config.search ? config.unstable_stork ? /* @__PURE__ */ React16.createElement(Search2, null) : /* @__PURE__ */ React16.createElement(search_default, { + directories: flatDirectories + }) : null)), /* @__PURE__ */ React16.createElement("div", { + className: "hidden md:block" + }, /* @__PURE__ */ React16.createElement(Menu, { + directories, + anchors: config.floatTOC ? [] : anchors + })), /* @__PURE__ */ React16.createElement("div", { + className: "md:hidden" + }, /* @__PURE__ */ React16.createElement(Menu, { + directories: fullDirectories, + anchors + })))); +} + +// src/toc.tsx +import React17 from "react"; +import cn7 from "classnames"; +import Slugger3 from "github-slugger"; +var indent = (level) => { + switch (level) { + case 3: + return { marginLeft: "1rem " }; + case 4: + return { marginLeft: "2rem " }; + case 5: + return { marginLeft: "3rem " }; + case 6: + return { marginLeft: "4rem " }; + } + return {}; +}; +var emptyHeader = []; +function ToC({ + headings = emptyHeader +}) { + const slugger = new Slugger3(); + const activeAnchor = useActiveAnchor(); + return /* @__PURE__ */ React17.createElement("div", { + className: "w-64 hidden xl:block text-sm pl-4" + }, headings ? /* @__PURE__ */ React17.createElement("ul", { + className: "overflow-y-auto sticky max-h-[calc(100vh-4rem)] top-16 pt-8 pb-10 m-0 list-none" + }, headings.filter((heading) => heading.type === "heading" && heading.depth > 1).map((heading) => { + const text = getHeadingText(heading); + const slug = slugger.slug(text); + const state = activeAnchor[slug]; + return /* @__PURE__ */ React17.createElement("li", { + key: slug, + style: indent(heading.depth) + }, /* @__PURE__ */ React17.createElement("a", { + href: `#${slug}`, + className: cn7("no-underline hover:text-gray-900 dark:hover:text-gray-100", state && state.isActive ? "text-gray-900 dark:text-gray-100 font-semibold" : "text-gray-600") + }, text)); + })) : null); +} + +// src/index.tsx +import "focus-visible"; +function useDirectoryInfo(pageMap) { + const { locale, defaultLocale, asPath } = useRouter7(); + return useMemo5(() => { + const fsPath = getFSRoute(asPath, locale).split("#")[0]; + return normalizePages({ + list: pageMap, + locale, + defaultLocale, + route: fsPath + }); + }, [pageMap, locale, defaultLocale, asPath]); +} +function Body({ meta, toc, filepathWithName, navLinks, children }) { + return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(SkipNavContent, null), meta.full ? /* @__PURE__ */ React18.createElement("article", { + className: "relative pt-16 w-full overflow-x-hidden" + }, children) : /* @__PURE__ */ React18.createElement("article", { + className: "docs-container relative pt-16 pb-16 px-6 md:px-8 w-full max-w-full flex min-w-0" + }, /* @__PURE__ */ React18.createElement("main", { + className: "max-w-screen-md mx-auto pt-4 z-10 min-w-0 w-full" + }, /* @__PURE__ */ React18.createElement(theme_default, null, children), /* @__PURE__ */ React18.createElement(footer_default, { + filepathWithName + }, navLinks)), toc)); +} +var Layout = (props) => { + const { filename, pageMap, meta, children, titleText, headings } = props; + const { route, locale } = useRouter7(); + const config = useConfig(); + const { + activeType, + activeIndex, + flatPageDirectories, + docsDirectories, + flatDirectories, + flatDocsDirectories, + directories + } = useDirectoryInfo(pageMap); + const filepath = route.slice(0, route.lastIndexOf("/") + 1); + const filepathWithName = filepath + filename; + const title = meta.title || titleText || "Untitled"; + const isRTL = useMemo5(() => { + if (!config.i18n) + return config.direction === "rtl" || null; + const localeConfig = config.i18n.find((l) => l.locale === locale); + return localeConfig && localeConfig.direction === "rtl"; + }, [config.i18n, locale]); + const [menu, setMenu] = useState6(false); + if (activeType === "nav") { + return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(Head, { + title, + locale, + meta + }), /* @__PURE__ */ React18.createElement(MenuContext.Provider, { + value: { + menu, + setMenu, + defaultMenuCollapsed: !!config.defaultMenuCollapsed + } + }, /* @__PURE__ */ React18.createElement("div", { + className: cn8("nextra-container main-container flex flex-col", { + rtl: isRTL, + page: true + }) + }, /* @__PURE__ */ React18.createElement(Navbar, { + isRTL, + flatDirectories, + flatPageDirectories + }), /* @__PURE__ */ React18.createElement(ActiveAnchor, null, /* @__PURE__ */ React18.createElement("div", { + className: "flex flex-1 h-full" + }, /* @__PURE__ */ React18.createElement(Sidebar, { + directories: flatPageDirectories, + flatDirectories, + fullDirectories: directories, + mdShow: false, + headings + }), /* @__PURE__ */ React18.createElement(Body, { + meta, + filepathWithName, + navLinks: null + }, children)))))); + } + return /* @__PURE__ */ React18.createElement(React18.Fragment, null, /* @__PURE__ */ React18.createElement(Head, { + title, + locale, + meta + }), /* @__PURE__ */ React18.createElement(MenuContext.Provider, { + value: { + menu, + setMenu, + defaultMenuCollapsed: !!config.defaultMenuCollapsed + } + }, /* @__PURE__ */ React18.createElement("div", { + className: cn8("nextra-container main-container flex flex-col", { + rtl: isRTL + }) + }, /* @__PURE__ */ React18.createElement(Navbar, { + isRTL, + flatDirectories, + flatPageDirectories + }), /* @__PURE__ */ React18.createElement(ActiveAnchor, null, /* @__PURE__ */ React18.createElement("div", { + className: "flex flex-1 h-full" + }, /* @__PURE__ */ React18.createElement(Sidebar, { + directories: docsDirectories, + flatDirectories, + fullDirectories: directories, + headings + }), /* @__PURE__ */ React18.createElement(Body, { + meta, + filepathWithName, + toc: /* @__PURE__ */ React18.createElement(ToC, { + headings: config.floatTOC ? headings : null + }), + navLinks: /* @__PURE__ */ React18.createElement(NavLinks, { + flatDirectories: flatDocsDirectories, + currentIndex: activeIndex, + isRTL + }) + }, children)))))); +}; +var DocsLayout = (opts, config) => { + const extendedConfig = Object.assign({}, default_config_default, config); + return (props) => { + return /* @__PURE__ */ React18.createElement(ThemeConfigContext.Provider, { + value: extendedConfig + }, /* @__PURE__ */ React18.createElement(ThemeProvider, { + attribute: "class" + }, /* @__PURE__ */ React18.createElement(Layout, __spreadValues(__spreadValues({}, opts), props)))); + }; +}; +var src_default = DocsLayout; +export { + src_default as default +}; diff --git a/.yalc/nextra-renderlesskit-theme-docs/dist/types.d.ts b/.yalc/nextra-renderlesskit-theme-docs/dist/types.d.ts new file mode 100644 index 0000000..d3903f1 --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/dist/types.d.ts @@ -0,0 +1,65 @@ +/// +import { Heading } from "mdast"; +export interface PageMapItem { + name: string; + route: string; + locale?: string; + children?: PageMapItem[]; + frontMatter?: Record; + meta?: Record; + active?: boolean; +} +export interface PageOpt { + filename: string; + route: string; + meta: Record; + pageMap: PageMapItem[]; + titleText: string | null; + headings?: Heading[]; + hasH1: boolean; +} +export { Heading }; +export interface DocsThemeConfig { + docsRepositoryBase?: string; + titleSuffix?: string | React.FC<{ + locale: string; + config: DocsThemeConfig; + title: string; + meta: Record; + }>; + nextLinks?: boolean; + prevLinks?: boolean; + search?: boolean; + darkMode?: boolean; + defaultMenuCollapsed?: boolean; + font?: boolean; + footer?: boolean; + footerText?: string; + footerEditLink?: string; + head?: React.ReactNode | React.FC<{ + locale: string; + config: DocsThemeConfig; + title: string; + meta: Record; + }>; + logo?: React.ReactNode; + direction?: string; + i18n?: { + locale: string; + text: string; + direction: string; + }[]; + unstable_faviconGlyph?: string; + customSearch?: boolean; + unstable_stork?: boolean; + projectLink?: string; + github?: string; + projectLinkIcon?: React.FC<{ + locale: string; + }>; + projectChatLink?: string; + projectChatLinkIcon?: React.FC<{ + locale: string; + }>; + floatTOC?: boolean; +} diff --git a/.yalc/nextra-renderlesskit-theme-docs/package.json b/.yalc/nextra-renderlesskit-theme-docs/package.json new file mode 100644 index 0000000..2b0929a --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/package.json @@ -0,0 +1,98 @@ +{ + "name": "nextra-renderlesskit-theme-docs", + "version": "1.0.0", + "description": "Nextra Renderlesskit Theme Docs", + "keywords": [ + "react", + "docs", + "nextra-renderlesskit-theme-docs", + "typescript", + "nextra", + "theme" + ], + "bugs": { + "url": "https://github.com/navin-moorthy/nextra-renderlesskit-theme-docs/issues" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/navin-moorthy/nextra-renderlesskit-theme-docs.git" + }, + "license": "MIT", + "author": "Navin Moorthy ", + "exports": { + "./style.css": "./style.css", + ".": { + "import": "./dist/index.js" + }, + "./callout": { + "import": "./dist/callout.js" + }, + "./bleed": { + "import": "./dist/bleed.js" + } + }, + "main": "dist/index.js", + "module": "dist/index.js", + "source": "src/index.ts", + "types": "./dist/types.d.ts", + "typings": "./dist/types.d.ts", + "files": [ + "dist/*", + "style.css" + ], + "scripts": { + "postinstall": "husky install", + "dev": "node scripts/dev.js", + "build": "yarn build:pkg && yarn build:types", + "build:pkg": "node scripts/build.js", + "build:types": "tsc -p tsconfig.types.json", + "lint": "eslint --color --ext .js,.jsx,.ts,.tsx .", + "lint:fix": "eslint --color --ext .js,.jsx,.ts,.tsx . --fix", + "format": "prettier -wl \"./**/*.{html,css,js,jsx,ts,tsx,md,json}\"", + "format:package": "sort-package-json package.json", + "release": "release-it", + "commit": "gacp", + "contrib:init": "all-contributors init", + "contrib:add": "all-contributors add", + "contrib:generate": "all-contributors generate" + }, + "commitlint": { + "extends": [ + "@commitlint/config-conventional" + ] + }, + "lint-staged": { + "**/*.{js,jsx,tx,tsx}": [ + "yarn lint:fix" + ], + "**/*.{html,css,js,jsx,ts,tsx,md,json}": [ + "yarn format" + ] + }, + "dependencies": { + "@mdx-js/react": "2.0.0-rc.2", + "@reach/skip-nav": "0.16.0", + "classnames": "2.3.1", + "focus-visible": "5.2.0", + "github-slugger": "1.4.0", + "grapheme-splitter": "1.0.4", + "intersection-observer": "0.12.0", + "match-sorter": "6.3.1", + "next-themes": "0.0.15", + "parse-git-url": "1.0.1", + "prism-react-renderer": "1.2.1", + "title": "3.4.3" + }, + "peerDependencies": { + "next": ">=9.5.3", + "react": ">=16.13.1", + "react-dom": ">=16.13.1" + }, + "gacp": { + "add": false, + "push": false, + "emoji": "emoji", + "editor": false + }, + "yalcSig": "ce299f7b490219a9f2f1eb4999c0c447" +} diff --git a/.yalc/nextra-renderlesskit-theme-docs/style.css b/.yalc/nextra-renderlesskit-theme-docs/style.css new file mode 100644 index 0000000..e69a411 --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/style.css @@ -0,0 +1,401 @@ +@tailwind base; + +html { + @apply subpixel-antialiased; + font-size: 16px; + font-feature-settings: "rlig" 1, "calt" 1, "ss01" 1; + scroll-behavior: smooth; +} +body { + @apply bg-white; +} +.dark body { + @apply bg-dark text-gray-100; +} + +h1 { + @apply text-4xl font-bold tracking-tight mt-2; +} +h2 { + @apply text-3xl font-semibold tracking-tight mt-10; + @apply pb-1 border-b; +} +.dark h2 { + @apply border-gray-900; +} +h3 { + @apply text-2xl font-semibold tracking-tight mt-8; +} +h4 { + @apply text-xl font-semibold tracking-tight mt-8; +} +h5 { + @apply text-lg font-semibold tracking-tight mt-8; +} +h6 { + @apply text-base font-semibold tracking-tight mt-8; +} +a { + @apply text-blue-500 underline; + text-underline-position: under; +} +p { + @apply leading-7; +} +p:not(:first-child), +blockquote:not(:first-child), +.table-container:not(:first-child) { + @apply mt-6; +} +hr { + @apply my-8; +} +.dark hr { + @apply border-gray-900; +} +code { + @apply text-gray-800 bg-gray-500 bg-opacity-25 rounded; + box-decoration-break: clone; +} +.dark code { + @apply text-gray-300 bg-gray-800; +} +pre { + @apply p-4 bg-gray-200 rounded-lg mt-6 mb-4 overflow-x-auto; + @apply dark:bg-gray-800; +} +pre code { + @apply p-0 text-sm text-black bg-transparent rounded-none inline-block min-w-full; +} +a code { + @apply text-current no-underline; +} + +@tailwind components; +@tailwind utilities; + +.main-container { + min-height: 100vh; +} + +.sidebar { + @apply select-none md:border-r; +} +.sidebar ul ul { + @apply ml-5 relative; +} +.sidebar a:focus-visible, +.sidebar button:focus-visible { + @apply ring; +} +.sidebar .active-anchor { + @apply font-semibold text-gray-900 dark:text-white; +} +.sidebar li.active > a { + @apply font-semibold text-black bg-gray-200; +} +.dark .sidebar li.active > a { + @apply text-white bg-gray-800; +} +.sidebar button, +.sidebar a { + @apply block w-full text-left text-base no-underline text-gray-600 mt-1 p-2 rounded select-none outline-none; + -webkit-tap-highlight-color: transparent; + -webkit-touch-callout: none; +} +.dark .sidebar button, +.dark .sidebar a { + @apply text-gray-500; +} +.sidebar a:hover, +.sidebar button:hover { + @apply text-gray-900 bg-gray-100; +} +.dark .sidebar a:hover, +.dark .sidebar button:hover { + @apply text-white bg-gray-900; +} +article ul { + @apply list-disc ml-6 mt-6; +} +article li { + @apply mt-2; +} +article ol { + @apply list-decimal ml-6 mt-6; +} +article blockquote { + @apply italic pl-6 border-l-2 border-gray-300 text-gray-700; + @apply dark:border-gray-700 dark:text-gray-400; +} + +.subheading-anchor { + margin-top: -84px; + display: inline-block; + position: absolute; + width: 1px; +} + +.subheading-anchor + a:hover .anchor-icon { + opacity: 1; +} +.anchor-icon { + opacity: 0; + @apply ml-2 text-gray-500 select-none; +} +.dark .anchor-icon { + @apply text-gray-700; +} + +h2 a { + @apply no-underline; +} + +/* Navbar */ +.nextra-container nav { + box-shadow: 0 2px 4px rgba(0, 0, 0, 0.02); +} +.nextra-container nav a:focus, +.nextra-container nav summary:focus { + @apply select-none outline-none; +} +.nextra-container nav a:focus-visible, +.nextra-container nav summary:focus-visible { + @apply ring select-none outline-none; +} + +/* Search */ +.nextra-search input { + @apply border-gray-300 text-gray-900; +} +.dark .nextra-search input { + @apply bg-dark border-gray-800 text-gray-100; +} +.nextra-search input::placeholder { + @apply text-gray-400; +} +.dark .nextra-search input::placeholder { + @apply text-gray-700; +} +.nextra-search ul { + @apply rounded border bg-white text-gray-100 border-gray-300 divide-gray-300 overflow-hidden shadow-lg list-none; +} +.dark .nextra-search ul { + @apply bg-dark text-gray-100 border-gray-700 divide-gray-700; +} +.nextra-search ul li { + @apply text-gray-800; +} +.nextra-search ul li.active, +.nextra-search ul a:focus li { + @apply bg-gray-200; +} +.dark .nextra-search ul li { + @apply text-gray-300; +} +.dark .nextra-search ul li.active, +.dark .nextra-search ul a:focus li { + @apply bg-gray-800; +} +.nextra-search ul li .highlight { + @apply bg-yellow-300; +} +.dark .nextra-search ul li .highlight { + @apply bg-yellow-700; +} +.search-overlay { + position: fixed; + top: 0; + bottom: 0; + left: 0; + right: 0; +} +input[type="search"]::-webkit-search-decoration, +input[type="search"]::-webkit-search-cancel-button, +input[type="search"]::-webkit-search-results-button, +input[type="search"]::-webkit-search-results-decoration { + -webkit-appearance: none; +} +.nextra-search.nextra-stork ul { + @apply overflow-auto left-0 md:-left-80 md:right-0; + max-height: min(calc(100vh - 80px), 400px); + max-width: min(calc(100vw - 2rem), calc(100% + 20rem)); + width: 100vw; +} + +code { + font-size: 0.9em; + padding: 2px 0.25em; +} + +/* Locale */ +.locale-switch summary::-webkit-details-marker { + content: ""; + display: none; +} +.locale-switch summary::marker { + content: ""; + display: none; +} +.locale-switch[open] summary:before { + content: " "; + position: fixed; + top: 0; + right: 0; + bottom: 0; + left: 0; + z-index: 10; + display: block; + cursor: default; + background: transparent; +} +.locale-switch .locale-dropdown { + position: absolute; + z-index: 11; +} + +/* Table */ +table { + @apply p-0; +} +table tr { + @apply m-0 p-0 border-t border-gray-300; + @apply dark:border-gray-700; +} +table tr:nth-child(2n) { + @apply bg-gray-100; + @apply dark:bg-gray-900; +} +table tr th { + @apply font-semibold; +} +table tr th[align="center"], +table tr td[align="center"] { + @apply text-center; +} +table tr th[align="right"], +table tr td[align="right"] { + @apply text-right; +} +table tr th, +table tr td { + @apply text-left; + @apply m-0 px-4 py-2 border border-gray-300; + @apply dark:border-gray-700; +} +.table-container { + overflow: auto; +} + +.contains-task-list { + @apply list-none ml-0; +} + +.contains-task-list input[type="checkbox"] { + @apply mr-1; +} + +pre .prism-code { + --c-highlight: #cce0f5; +} +.dark pre .prism-code { + --c-highlight: #3d4b61; +} +pre .prism-code .token.plain, +pre .prism-code .token.builtin, +pre .prism-code .token.char, +pre .prism-code .token.constant { + color: #000 !important; +} +.dark pre .prism-code .token.plain, +.dark pre .prism-code .token.builtin, +.dark pre .prism-code .token.char, +.dark pre .prism-code .token.constant { + color: #fff !important; +} +pre .prism-code .token.string, +pre .prism-code .token.url, +pre .prism-code .token.attr-value { + color: #028265 !important; +} +.dark pre .prism-code .token.string, +.dark pre .prism-code .token.url, +.dark pre .prism-code .token.attr-value { + color: #20bb98 !important; +} +pre .prism-code .token.punctuation, +pre .prism-code .token.operator { + color: #333 !important; +} +.dark pre .prism-code .token.punctuation, +.dark pre .prism-code .token.operator { + color: #bbb !important; +} +pre .prism-code .token.number, +pre .prism-code .token.function, +pre .prism-code .token.tag:not(.script) { + color: #0076ff !important; +} +.dark pre .prism-code .token.number, +.dark pre .prism-code .token.function, +.dark pre .prism-code .token.tag:not(.script) { + color: #1e86ff !important; +} + +/* RTL */ +.nextra-container.rtl { + direction: rtl; +} +.nextra-container.rtl .sidebar ul ul { + @apply mr-5 ml-0; +} +.nextra-container.rtl .sidebar button, +.nextra-container.rtl .sidebar a { + @apply text-right; +} +.nextra-container.rtl article blockquote { + @apply pr-6 border-r-2 pl-0 border-l-0; +} +.nextra-container:not(.rtl):not(.page) article.docs-container { + @apply xl:pr-8; +} +.nextra-container.rtl:not(.page) .docs-container { + @apply xl:pl-8; +} +@screen md { + .nextra-container:not(.page) article.docs-container .bleed.full { + margin-left: calc(-50vw + 50% + 8rem); + margin-right: calc(-50vw + 50% + 8rem); + } + .nextra-container.page article.docs-container .bleed.full { + margin-left: calc(-50vw + 50%); + margin-right: calc(-50vw + 50%); + } +} +@screen xl { + .nextra-container:not(.rtl):not(.page) article.docs-container .bleed.full { + margin-left: calc(50% - 50vw + 16rem); + margin-right: calc(50% - 50vw); + } + .nextra-container.rtl:not(.page) .docs-container .bleed.full { + margin-left: calc(50% - 50vw); + margin-right: calc(50% - 50vw + 16rem); + } + .nextra-container.page .docs-container .bleed.full { + margin-left: calc(50% - 50vw); + margin-right: calc(50% - 50vw); + } +} +.nextra-container.rtl code { + direction: ltr; +} +.nextra-container.rtl .anchor-icon { + @apply ml-0 mr-2 inline-block; +} +.nextra-container.rtl article ul, +.nextra-container.rtl article ol { + @apply ml-0 mr-6; +} +.nextra-container.rtl .sidebar { + @apply md:border-l; +} diff --git a/.yalc/nextra-renderlesskit-theme-docs/yalc.sig b/.yalc/nextra-renderlesskit-theme-docs/yalc.sig new file mode 100644 index 0000000..b2e6a3d --- /dev/null +++ b/.yalc/nextra-renderlesskit-theme-docs/yalc.sig @@ -0,0 +1 @@ +ce299f7b490219a9f2f1eb4999c0c447 \ No newline at end of file diff --git a/.yalc/nextra/dist/index.js b/.yalc/nextra/dist/index.js new file mode 100644 index 0000000..93b5a04 --- /dev/null +++ b/.yalc/nextra/dist/index.js @@ -0,0 +1,170 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __reExport = (target, module2, copyDefault, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toESM = (module2, isNodeMode) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// src/stork-index.ts +var import_path = __toESM(require("path")); +var import_graceful_fs = __toESM(require("graceful-fs")); +var import_child_process = __toESM(require("child_process")); +var import_util = require("util"); +var import_download = __toESM(require("download")); +var { promises: fs, statSync, mkdirSync } = import_graceful_fs.default; +var execFile = (0, import_util.promisify)(import_child_process.default.execFile); +var isProduction = process.env.NODE_ENV === "production"; +var STORK_WASM = "https://github.com/jameslittle230/stork/releases/download/v1.1.0/stork.wasm"; +var indexed = false; +function buildStorkIndex(storkPath, locales) { + return __async(this, null, function* () { + if (indexed) + return; + if (!isProduction) + return; + indexed = true; + const assetDir = import_path.default.join(process.cwd(), "public"); + locales = locales || ["default"]; + for (const locale of locales) { + const tomlFile = import_path.default.join(assetDir, `index-${locale}.toml`); + let toml = yield fs.readFile(tomlFile, "utf-8"); + toml += "[output]\n"; + toml += `filename = "${import_path.default.join(assetDir, `index-${locale}.st`)}" +`; + toml += `excerpts_per_result = 1 +`; + yield fs.writeFile(tomlFile, toml); + yield execFile(storkPath, ["--build", tomlFile]); + console.log(`Finished Stork index for locale: ${locale}`); + } + const storkWasmPath = import_path.default.join(assetDir, "stork.wasm"); + try { + statSync(storkWasmPath); + } catch (err) { + console.log("No stork.wasm found, downloading from GitHub..."); + yield (0, import_download.default)(STORK_WASM, assetDir); + } + }); +} + +// src/index.js +var defaultExtensions = ["js", "jsx", "ts", "tsx"]; +var markdownExtensions = ["md", "mdx"]; +var markdownExtensionTest = /\.mdx?$/; +var STORK_PATH = process.env.STORK_PATH || "stork"; +module.exports = (...args) => (nextConfig = {}) => { + var _a, _b; + const nextraConfig = typeof args[0] === "string" ? { + theme: args[0], + themeConfig: args[1] + } : args[0]; + const locales = ((_a = nextConfig.i18n) == null ? void 0 : _a.locales) || null; + const defaultLocale = ((_b = nextConfig.i18n) == null ? void 0 : _b.defaultLocale) || null; + let pageExtensions = nextConfig.pageExtensions || [...defaultExtensions]; + if (locales) { + console.log("You have i18n enabled for Nextra."); + if (!defaultLocale) { + console.error("Default locale is missing."); + } + pageExtensions = pageExtensions.concat(markdownExtensions.map((ext) => defaultLocale + "." + ext)); + } else { + pageExtensions = pageExtensions.concat(markdownExtensions); + } + if (nextraConfig.unstable_stork) { + console.log("You have Stork indexing enabled for Nextra. Stork binary:", STORK_PATH); + const originalHeaders = nextConfig.headers || (() => []); + nextConfig.headers = () => __async(exports, null, function* () { + return [ + ...yield originalHeaders(), + { + source: `/:index(index-.+.st)`, + headers: [ + { + key: "content-type", + value: "application/wasm" + } + ] + } + ]; + }); + } + return Object.assign({}, nextConfig, { + pageExtensions, + webpack(config, options) { + config.module.rules.push({ + test: markdownExtensionTest, + use: [ + options.defaultLoaders.babel, + { + loader: "nextra/loader", + options: __spreadProps(__spreadValues({}, nextraConfig), { locales, defaultLocale }) + } + ] + }); + if (!config.plugins) + config.plugins = []; + if (nextraConfig.unstable_stork) { + config.plugins.push({ + apply: (compiler) => { + compiler.hooks.done.tap("buildStorkIndex", () => { + buildStorkIndex(STORK_PATH, locales); + }); + } + }); + } + if (typeof nextConfig.webpack === "function") { + return nextConfig.webpack(config, options); + } + return config; + } + }); +}; diff --git a/.yalc/nextra/dist/loader.mjs b/.yalc/nextra/dist/loader.mjs new file mode 100644 index 0000000..9a4b8db --- /dev/null +++ b/.yalc/nextra/dist/loader.mjs @@ -0,0 +1,569 @@ +var __defProp = Object.defineProperty; +var __defProps = Object.defineProperties; +var __getOwnPropDescs = Object.getOwnPropertyDescriptors; +var __getOwnPropSymbols = Object.getOwnPropertySymbols; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __propIsEnum = Object.prototype.propertyIsEnumerable; +var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; +var __spreadValues = (a, b) => { + for (var prop in b || (b = {})) + if (__hasOwnProp.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + if (__getOwnPropSymbols) + for (var prop of __getOwnPropSymbols(b)) { + if (__propIsEnum.call(b, prop)) + __defNormalProp(a, prop, b[prop]); + } + return a; +}; +var __spreadProps = (a, b) => __defProps(a, __getOwnPropDescs(b)); +var __async = (__this, __arguments, generator) => { + return new Promise((resolve, reject) => { + var fulfilled = (value) => { + try { + step(generator.next(value)); + } catch (e) { + reject(e); + } + }; + var rejected = (value) => { + try { + step(generator.throw(value)); + } catch (e) { + reject(e); + } + }; + var step = (x) => x.done ? resolve(x.value) : Promise.resolve(x.value).then(fulfilled, rejected); + step((generator = generator.apply(__this, __arguments)).next()); + }); +}; + +// src/loader.ts +import path3 from "path"; +import gracefulFs2 from "graceful-fs"; +import grayMatter from "gray-matter"; +import slash from "slash"; + +// src/filter-route-locale.ts +function filterRouteLocale(pageMap, locale, defaultLocale) { + const isDefaultLocale = !locale || locale === defaultLocale; + const filteredPageMap = []; + const fallbackPages = {}; + for (const page of pageMap) { + if (page.children) { + filteredPageMap.push(__spreadProps(__spreadValues({}, page), { + children: filterRouteLocale(page.children, locale, defaultLocale) + })); + continue; + } + const localDoesMatch = !page.locale && isDefaultLocale || page.locale === locale || page.name === "meta.json"; + if (localDoesMatch) { + fallbackPages[page.name] = null; + filteredPageMap.push(page); + } else { + if (fallbackPages[page.name] !== null && (!page.locale || page.locale === defaultLocale)) { + fallbackPages[page.name] = page; + } + } + } + for (const name in fallbackPages) { + if (fallbackPages[name]) { + filteredPageMap.push(fallbackPages[name]); + } + } + return filteredPageMap; +} + +// src/stork-index.ts +import path from "path"; +import gracefulFs from "graceful-fs"; +import cp from "child_process"; +import { promisify } from "util"; +import download from "download"; +var { promises: fs, statSync, mkdirSync } = gracefulFs; +var execFile = promisify(cp.execFile); +var isProduction = process.env.NODE_ENV === "production"; +var files = {}; +var escapeQuote = (str) => typeof str === "string" ? str.replace(/"/g, '\\"') : str.title.replace(/"/g, '\\"'); +var getStemmingLanguage = (locale) => { + if (locale.toLowerCase().startsWith("en")) { + return "English"; + } + return "None"; +}; +var getPlainText = (content) => __async(void 0, null, function* () { + return content; +}); +function addStorkIndex(_0) { + return __async(this, arguments, function* ({ + fileLocale, + route, + title, + data, + content + }) { + if (!isProduction) + return; + if (!files[fileLocale]) + files[fileLocale] = { + toml: `[input] +minimum_indexed_substring_length = 2 +title_boost = "Ridiculous" +stemming = "${getStemmingLanguage(fileLocale)}" + +` + }; + if (!files[fileLocale][route]) { + const plainText = yield getPlainText(content); + files[fileLocale][route] = true; + files[fileLocale].toml += `[[input.files]] +`; + files[fileLocale].toml += `title = "${escapeQuote(data.title || title)}" +`; + files[fileLocale].toml += `url = "${escapeQuote(route)}" +`; + files[fileLocale].toml += `contents = "${escapeQuote(plainText.replace(/\n/g, "\\n"))}" +`; + files[fileLocale].toml += `filetype = "PlainText"`; + files[fileLocale].toml += ` +`; + const assetDir = path.join(process.cwd(), "public"); + const tomlFile = path.join(assetDir, `index-${fileLocale}.toml`); + try { + statSync(assetDir); + } catch (err) { + mkdirSync(assetDir); + } + yield fs.writeFile(tomlFile, files[fileLocale].toml); + } + }); +} + +// src/utils.ts +import fs2 from "fs"; +import path2 from "path"; +function getLocaleFromFilename(name) { + const localeRegex = /\.([a-zA-Z-]+)?\.(mdx?|jsx?|json)$/; + const match = name.match(localeRegex); + if (match) + return match[1]; + return void 0; +} +function removeExtension(name) { + const match = name.match(/^([^.]+)/); + return match !== null ? match[1] : ""; +} +function getFileName(resourcePath) { + return removeExtension(path2.basename(resourcePath)); +} +var parseJsonFile = (content, path4) => { + let parsed = {}; + try { + parsed = JSON.parse(content); + } catch (err) { + console.error(`Error parsing ${path4}, make sure it's a valid JSON +` + err); + } + return parsed; +}; +var existsSync = (f) => { + try { + fs2.accessSync(f, fs2.constants.F_OK); + return true; + } catch (_) { + return false; + } +}; + +// src/compile.ts +import { compile } from "@mdx-js/mdx"; +import remarkGfm from "remark-gfm"; +import { remarkMdxCodeMeta } from "remark-mdx-code-meta"; + +// src/static-image.js +var relative = /^\.{1,2}\//; +function visit(node, type, handler) { + if (node.type === type) { + handler(node); + } + if (node.children) { + node.children.forEach((n) => visit(n, type, handler)); + } +} +function ASTNodeImport(name, from) { + return { + type: "mdxjsEsm", + value: `import ${name} from "${from}"`, + data: { + estree: { + type: "Program", + body: [ + { + type: "ImportDeclaration", + specifiers: [ + { + type: "ImportDefaultSpecifier", + local: { type: "Identifier", name } + } + ], + source: { + type: "Literal", + value: from, + raw: `"${from}"` + } + } + ], + sourceType: "module" + } + } + }; +} +function remarkStaticImage() { + return (tree, _file, done) => { + const importsToInject = []; + visit(tree, "image", visitor); + tree.children.unshift(...importsToInject); + tree.children.unshift(ASTNodeImport("$NextImageNextra", "next/image")); + done(); + function visitor(node) { + const url = node.url; + if (url && relative.test(url)) { + const tempVariableName = `$nextraImage${importsToInject.length}`; + Object.assign(node, { + type: "mdxJsxFlowElement", + name: "$NextImageNextra", + attributes: [ + { + type: "mdxJsxAttribute", + name: "alt", + value: node.alt || "" + }, + { + type: "mdxJsxAttribute", + name: "placeholder", + value: "blur" + }, + { + type: "mdxJsxAttribute", + name: "src", + value: { + type: "mdxJsxAttributeValueExpression", + value: tempVariableName, + data: { + estree: { + type: "Program", + body: [ + { + type: "ExpressionStatement", + expression: { + type: "Identifier", + name: tempVariableName + } + } + ], + sourceType: "module" + } + } + } + } + ], + children: [] + }); + importsToInject.push(ASTNodeImport(tempVariableName, url)); + } + } + }; +} + +// src/get-headers.ts +function isHeading(node) { + return node.type === "heading"; +} +function visit2(node, handler) { + if (isHeading(node)) { + handler(node); + } + if (node.children) { + node.children.forEach((n) => visit2(n, handler)); + } +} +function getHeaders(headers) { + return () => (tree, _file, done) => { + visit2(tree, (node) => headers.push(node)); + done(); + }; +} + +// src/compile.ts +function compileMdx(_0) { + return __async(this, arguments, function* (source, mdxOptions = {}, nextraOptions = { + unstable_staticImage: false + }) { + let headings = []; + const result = yield compile(source, { + jsx: true, + providerImportSource: "@mdx-js/react", + remarkPlugins: [ + ...mdxOptions.remarkPlugins || [], + remarkGfm, + remarkMdxCodeMeta, + getHeaders(headings), + ...nextraOptions.unstable_staticImage ? [remarkStaticImage] : [] + ].filter(Boolean), + rehypePlugins: [...mdxOptions.rehypePlugins || []].filter(Boolean) + }); + if (Array.isArray(headings) && headings.length > 0) { + const h1 = headings.find((v) => v.depth === 1); + if (h1 && Array.isArray(h1.children) && h1.children.length === 1) { + const child = h1.children[0]; + if (child.type === "text") { + return { + result: String(result), + titleText: child.value, + headings, + hasH1: true + }; + } + } + return { + result: String(result), + headings, + hasH1: h1 ? true : false + }; + } + return { + result: String(result), + hasH1: false + }; + }); +} + +// src/loader.ts +var { promises: fs3 } = gracefulFs2; +var extension = /\.mdx?$/; +var metaExtension = /meta\.?([a-zA-Z-]+)?\.json/; +function findPagesDir(dir = process.cwd()) { + if (existsSync(path3.join(dir, "pages"))) + return "pages"; + if (existsSync(path3.join(dir, "src/pages"))) + return "src/pages"; + throw new Error("> Couldn't find a `pages` directory. Please create one under the project root"); +} +function getPageMap(currentResourcePath) { + return __async(this, null, function* () { + const activeRouteLocale = getLocaleFromFilename(currentResourcePath); + let activeRoute = ""; + let activeRouteTitle = ""; + function getFiles(dir, route) { + return __async(this, null, function* () { + const files2 = yield fs3.readdir(dir, { withFileTypes: true }); + let dirMeta = {}; + const items = (yield Promise.all(files2.map((f) => __async(this, null, function* () { + const filePath = path3.resolve(dir, f.name); + const fileRoute = slash(path3.join(route, removeExtension(f.name).replace(/^index$/, ""))); + if (f.isDirectory()) { + if (fileRoute === "/api") + return null; + const children = yield getFiles(filePath, fileRoute); + if (!children || !children.length) + return null; + return { + name: f.name, + children, + route: fileRoute + }; + } else if (extension.test(f.name)) { + const locale = getLocaleFromFilename(f.name); + if (filePath === currentResourcePath) { + activeRoute = fileRoute; + } + const fileContents = yield fs3.readFile(filePath, "utf-8"); + const { data } = grayMatter(fileContents); + if (Object.keys(data).length) { + return { + name: removeExtension(f.name), + route: fileRoute, + frontMatter: data, + locale + }; + } + return { + name: removeExtension(f.name), + route: fileRoute, + locale + }; + } else if (metaExtension.test(f.name)) { + const content = yield fs3.readFile(filePath, "utf-8"); + const meta = parseJsonFile(content, filePath); + const locale = f.name.match(metaExtension)[1]; + if (!activeRouteLocale || locale === activeRouteLocale) { + dirMeta = meta; + } + return { + name: "meta.json", + meta, + locale + }; + } + })))).map((item) => { + if (!item) + return; + if (item.route === activeRoute) { + activeRouteTitle = dirMeta[item.name] || item.name; + } + return __spreadValues({}, item); + }).filter(Boolean); + return items; + }); + } + return [ + yield getFiles(path3.join(process.cwd(), findPagesDir()), "/"), + activeRoute, + activeRouteTitle + ]; + }); +} +function analyzeLocalizedEntries(currentResourcePath, defaultLocale) { + return __async(this, null, function* () { + const filename = getFileName(currentResourcePath); + const dir = path3.dirname(currentResourcePath); + const filenameRe = new RegExp("^" + filename + ".[a-zA-Z-]+.(mdx?|jsx?|tsx?|json)$"); + const files2 = yield fs3.readdir(dir, { withFileTypes: true }); + let hasSSR = false, hasSSG = false, defaultIndex = 0; + const filteredFiles = []; + for (let i = 0; i < files2.length; i++) { + const file = files2[i]; + if (!filenameRe.test(file.name)) + continue; + const content = yield fs3.readFile(path3.join(dir, file.name), "utf-8"); + const locale = getLocaleFromFilename(file.name); + const exportSSR = /^export .+ getServerSideProps[=| |\(]/m.test(content); + const exportSSG = /^export .+ getStaticProps[=| |\(]/m.test(content); + hasSSR = hasSSR || exportSSR; + hasSSG = hasSSG || exportSSG; + if (locale === defaultLocale) + defaultIndex = filteredFiles.length; + filteredFiles.push({ + name: file.name, + locale, + ssr: exportSSR, + ssg: exportSSG + }); + } + return { + ssr: hasSSR, + ssg: hasSSG, + files: filteredFiles, + defaultIndex + }; + }); +} +function loader_default(source) { + return __async(this, null, function* () { + const callback = this.async(); + this.cacheable(); + this.addContextDependency(path3.resolve(findPagesDir())); + const options = this.getOptions(); + const { + theme, + themeConfig, + locales, + defaultLocale, + unstable_stork, + unstable_staticImage, + mdxOptions + } = options; + const { resourcePath, resourceQuery } = this; + const filename = resourcePath.slice(resourcePath.lastIndexOf("/") + 1); + const fileLocale = getLocaleFromFilename(filename) || "default"; + const rawEntry = resourceQuery.includes("nextra-raw"); + if (!theme) { + throw new Error("No Nextra theme found!"); + } + if (locales && !rawEntry) { + const { files: files2, defaultIndex, ssr, ssg } = yield analyzeLocalizedEntries(resourcePath, defaultLocale); + const i18nEntry = ` +import { useRouter } from 'next/router' + +${files2.map((file, index) => `import Page_${index}${file.ssg || file.ssr ? `, { ${file.ssg ? "getStaticProps" : "getServerSideProps"} as page_data_${index} }` : ""} from './${file.name}?nextra-raw'`).join("\n")} + +export default function I18NPage (props) { + const { locale } = useRouter() + ${files2.map((file, index) => `if (locale === '${file.locale}') { + return + } else `).join("")} { + return + } +} + +${ssg || ssr ? `export async function ${ssg ? "getStaticProps" : "getServerSideProps"} (context) { + const locale = context.locale + ${files2.map((file, index) => `if (locale === '${file.locale}' && ${ssg ? file.ssg : file.ssr}) { + return page_data_${index}(context) + } else `).join("")} { + return { props: {} } + } +}` : ""} +`; + return callback(null, i18nEntry); + } + let [pageMap, route, title] = yield getPageMap(resourcePath); + if (locales) { + const locale = getLocaleFromFilename(filename); + if (locale) { + pageMap = filterRouteLocale(pageMap, locale, defaultLocale); + } + } + let { data, content } = grayMatter(source); + if (unstable_stork) { + if (extension.test(filename)) { + yield addStorkIndex({ + fileLocale, + route, + title, + data, + content + }); + } + } + let layout = theme; + let layoutConfig = themeConfig || null; + if (theme.startsWith(".") || theme.startsWith("/")) { + layout = path3.resolve(theme); + } + if (layoutConfig) { + layoutConfig = slash(path3.resolve(layoutConfig)); + } + const prefix = ` +import withLayout from '${layout}' +import { withSSG } from 'nextra/ssg' +${layoutConfig ? `import layoutConfig from '${layoutConfig}'` : ""} + +`; + const { result, titleText, headings, hasH1 } = yield compileMdx(content, mdxOptions, { + unstable_staticImage + }); + content = result; + content = content.replace("export default MDXContent;", "const _mdxContent = ;"); + const suffix = ` + +export default function NextraPage (props) { + return withSSG(withLayout({ + filename: "${slash(filename)}", + route: "${slash(route)}", + meta: ${JSON.stringify(data)}, + pageMap: ${JSON.stringify(pageMap)}, + titleText: ${JSON.stringify(titleText)}, + headings: ${JSON.stringify(headings)}, + hasH1: ${JSON.stringify(hasH1)} + }, ${layoutConfig ? "layoutConfig" : "null"}))({ + ...props, + children: _mdxContent + }) +}`; + return callback(null, prefix + "\n" + content + "\n" + suffix); + }); +} +export { + loader_default as default +}; diff --git a/.yalc/nextra/dist/ssg.js b/.yalc/nextra/dist/ssg.js new file mode 100644 index 0000000..c53a64b --- /dev/null +++ b/.yalc/nextra/dist/ssg.js @@ -0,0 +1,50 @@ +var __create = Object.create; +var __defProp = Object.defineProperty; +var __getOwnPropDesc = Object.getOwnPropertyDescriptor; +var __getOwnPropNames = Object.getOwnPropertyNames; +var __getProtoOf = Object.getPrototypeOf; +var __hasOwnProp = Object.prototype.hasOwnProperty; +var __markAsModule = (target) => __defProp(target, "__esModule", { value: true }); +var __export = (target, all) => { + for (var name in all) + __defProp(target, name, { get: all[name], enumerable: true }); +}; +var __reExport = (target, module2, copyDefault, desc) => { + if (module2 && typeof module2 === "object" || typeof module2 === "function") { + for (let key of __getOwnPropNames(module2)) + if (!__hasOwnProp.call(target, key) && (copyDefault || key !== "default")) + __defProp(target, key, { get: () => module2[key], enumerable: !(desc = __getOwnPropDesc(module2, key)) || desc.enumerable }); + } + return target; +}; +var __toESM = (module2, isNodeMode) => { + return __reExport(__markAsModule(__defProp(module2 != null ? __create(__getProtoOf(module2)) : {}, "default", !isNodeMode && module2 && module2.__esModule ? { get: () => module2.default, enumerable: true } : { value: module2, enumerable: true })), module2); +}; +var __toCommonJS = /* @__PURE__ */ ((cache) => { + return (module2, temp) => { + return cache && cache.get(module2) || (temp = __reExport(__markAsModule({}), module2, 1), cache && cache.set(module2, temp), temp); + }; +})(typeof WeakMap !== "undefined" ? /* @__PURE__ */ new WeakMap() : 0); + +// src/ssg.ts +var ssg_exports = {}; +__export(ssg_exports, { + SSGContext: () => SSGContext, + useSSG: () => useSSG, + withSSG: () => withSSG +}); +var import_react = __toESM(require("react")); +var SSGContext = (0, import_react.createContext)(false); +var useSSG = () => (0, import_react.useContext)(SSGContext); +var withSSG = (Page) => { + return (props) => { + return import_react.default.createElement(SSGContext.Provider, { value: props.ssg }, import_react.default.createElement(Page, props)); + }; +}; +module.exports = __toCommonJS(ssg_exports); +// Annotate the CommonJS export names for ESM import in node: +0 && (module.exports = { + SSGContext, + useSSG, + withSSG +}); diff --git a/.yalc/nextra/dist/types.d.ts b/.yalc/nextra/dist/types.d.ts new file mode 100644 index 0000000..6034734 --- /dev/null +++ b/.yalc/nextra/dist/types.d.ts @@ -0,0 +1,48 @@ +import { Heading } from 'mdast'; +import { ProcessorOptions } from '@mdx-js/mdx'; +export interface LoaderOptions { + theme: Theme; + themeConfig: string; + locales: string[]; + defaultLocale: string; + unstable_stork: boolean; + unstable_staticImage: boolean; + mdxOptions: Pick; +} +export interface PageMapItem { + name: string; + route: string; + locale?: string; + children?: PageMapItem[]; + frontMatter?: Record; + meta?: Record; + active?: boolean; +} +export interface PageOpt { + filename: string; + route: string; + meta: Record; + pageMap: PageMapItem[]; + titleText: string | null; + headings?: Heading[]; + hasH1: boolean; +} +export { Heading }; +export declare type Title = string | { + [key: string]: string; + title: string; +}; +export declare type PageMapResult = [ + pageMap: PageMapItem[], + route: string, + title: Title +]; +declare type Theme = string; +export declare type NextraConfig = { + theme: Theme; + themeConfig: string; + unstable_stork?: boolean; + unstable_staticImage?: boolean; +}; +export declare type withNextra = (...args: [NextraConfig] | [theme: Theme, themeConfig: string]) => (nextConfig: Record) => {}; +export default withNextra; diff --git a/.yalc/nextra/index.js b/.yalc/nextra/index.js new file mode 100755 index 0000000..aae5903 --- /dev/null +++ b/.yalc/nextra/index.js @@ -0,0 +1 @@ +module.exports = require('./dist/index') diff --git a/.yalc/nextra/loader.js b/.yalc/nextra/loader.js new file mode 100755 index 0000000..b7d9ded --- /dev/null +++ b/.yalc/nextra/loader.js @@ -0,0 +1,16 @@ +// https://github.com/mdx-js/mdx/blob/061cdbf440bd8193867fcef3f5a131c08e4fe469/packages/loader/index.cjs + +/** + * Webpack loader + * + * @todo once webpack supports ESM loaders, remove this wrapper. + * + * @param {string} code + */ +module.exports = function (code) { + const callback = this.async() + // Note that `import()` caches, so this should be fast enough. + import('./dist/loader.mjs').then(module => + module.default.call(this, code, callback) + ) +} diff --git a/.yalc/nextra/package.json b/.yalc/nextra/package.json new file mode 100644 index 0000000..5b6c5cb --- /dev/null +++ b/.yalc/nextra/package.json @@ -0,0 +1,36 @@ +{ + "name": "nextra", + "version": "2.0.0", + "description": "Next.js and MDX based site generator.", + "main": "index.js", + "files": [ + "dist/*", + "index.js", + "ssg.js", + "loader.js" + ], + "types": "./dist/types.d.ts", + "repository": "https://github.com/shuding/nextra", + "license": "MIT", + "scripts": { + "build": "node scripts/build.js", + "dev": "node scripts/dev.js", + "types": "tsc --project tsconfig.type.json", + "prepublishOnly": "rm -rf dist && yarn build && yarn types" + }, + "dependencies": { + "@mdx-js/loader": "^2.0.0-rc.2", + "@mdx-js/mdx": "^2.0.0-rc.2", + "download": "^8.0.0", + "graceful-fs": "^4.2.6", + "gray-matter": "^4.0.3", + "remark-gfm": "^3.0.1", + "remark-mdx-code-meta": "^1.0.0", + "slash": "^3.0.0", + "typescript": "^4.5.2" + }, + "peerDependencies": { + "react": ">=16.13.1" + }, + "yalcSig": "cff1249611e56e53654e86ee11e292be" +} diff --git a/.yalc/nextra/ssg.js b/.yalc/nextra/ssg.js new file mode 100755 index 0000000..9016f08 --- /dev/null +++ b/.yalc/nextra/ssg.js @@ -0,0 +1 @@ +module.exports = require('./dist/ssg') diff --git a/.yalc/nextra/yalc.sig b/.yalc/nextra/yalc.sig new file mode 100644 index 0000000..4ec3b39 --- /dev/null +++ b/.yalc/nextra/yalc.sig @@ -0,0 +1 @@ +cff1249611e56e53654e86ee11e292be \ No newline at end of file diff --git a/next.config.js b/next.config.js index 52e5ad5..0fcbd45 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,5 @@ const withNextra = require("nextra")({ - theme: "nextra-theme-docs", + theme: "nextra-renderlesskit-theme-docs", themeConfig: "./theme.config.js", unstable_stork: false, unstable_staticImage: true, diff --git a/package.json b/package.json index f52868d..50c2f8a 100644 --- a/package.json +++ b/package.json @@ -64,12 +64,13 @@ }, "dependencies": { "@renderlesskit/react-tailwind": "0.0.1-alpha.33", + "lodash": "4.17.21", "next": "12.0.7", - "nextra": "2.0.0-beta.5", + "nextra": "link:.yalc/nextra", + "nextra-renderlesskit-theme-docs": "link:.yalc/nextra-renderlesskit-theme-docs", "nextra-theme-docs": "2.0.0-beta.5", "react": "17.0.2", - "react-dom": "17.0.2", - "lodash": "4.17.21" + "react-dom": "17.0.2" }, "devDependencies": { "@babel/core": "7.16.5", diff --git a/yalc.lock b/yalc.lock new file mode 100644 index 0000000..2ae00ae --- /dev/null +++ b/yalc.lock @@ -0,0 +1,14 @@ +{ + "version": "v1", + "packages": { + "nextra-renderlesskit-theme-docs": { + "signature": "ce299f7b490219a9f2f1eb4999c0c447", + "link": true + }, + "nextra": { + "signature": "cff1249611e56e53654e86ee11e292be", + "link": true, + "replaced": "2.0.0-beta.5" + } + } +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index eef0904..27c7915 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1639,7 +1639,7 @@ unist-util-visit "^4.0.0" vfile "^5.0.0" -"@mdx-js/react@^2.0.0-rc.2": +"@mdx-js/react@2.0.0-rc.2", "@mdx-js/react@^2.0.0-rc.2": version "2.0.0-rc.2" resolved "https://registry.yarnpkg.com/@mdx-js/react/-/react-2.0.0-rc.2.tgz#83fa80620bc11eec1112d68d77136048a85497df" integrity sha512-WHksgPnvKyDDNq0RQvTnKboe+wxUcq5A7xD12Ob+ASfUR3NRFo/h//k8fjv3t8dgzWX5M0UeU5jsccjykosDEQ== @@ -1903,6 +1903,14 @@ dependencies: "@babel/runtime" "^7.13.10" +"@reach/skip-nav@0.16.0": + version "0.16.0" + resolved "https://registry.yarnpkg.com/@reach/skip-nav/-/skip-nav-0.16.0.tgz#dec34f3a40a1e804e05647646aacab0ffd73b24d" + integrity sha512-SY4PdNx+hQHbeOr/+qLc+QXdRt9NTVlt0r737bOqY1WURGBIEN9sGgsmIsHluP1/bQuAe0JKdOJ/tXiwQ3Z3ug== + dependencies: + "@reach/utils" "0.16.0" + tslib "^2.3.0" + "@reach/skip-nav@^0.11.2": version "0.11.2" resolved "https://registry.yarnpkg.com/@reach/skip-nav/-/skip-nav-0.11.2.tgz#015498b2125ad8ef1e48cb8ab33dca93925fcbc8" @@ -1920,6 +1928,14 @@ tslib "^2.0.0" warning "^4.0.3" +"@reach/utils@0.16.0": + version "0.16.0" + resolved "https://registry.yarnpkg.com/@reach/utils/-/utils-0.16.0.tgz#5b0777cf16a7cab1ddd4728d5d02762df0ba84ce" + integrity sha512-PCggBet3qaQmwFNcmQ/GqHSefadAFyNCUekq9RrWoaU9hh/S4iaFgf2MBMdM47eQj5i/Bk0Mm07cP/XPFlkN+Q== + dependencies: + tiny-warning "^1.0.3" + tslib "^2.3.0" + "@react-aria/focus@^3.4.1": version "3.5.0" resolved "https://registry.yarnpkg.com/@react-aria/focus/-/focus-3.5.0.tgz#02b85f97d6114af1eccc0902ce40723b626cb7f9" @@ -2422,7 +2438,7 @@ resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.178.tgz#341f6d2247db528d4a13ddbb374bcdc80406f4f8" integrity sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw== -"@types/mdast@^3.0.0": +"@types/mdast@^3.0.0", "@types/mdast@^3.0.3": version "3.0.10" resolved "https://registry.yarnpkg.com/@types/mdast/-/mdast-3.0.10.tgz#4724244a82a4598884cbbe9bcfd73dff927ee8af" integrity sha512-W864tg/Osz1+9f4lrGTZpCSO5/z4608eUp19tbozkq2HJK6i3z1kT0H9tlADXuYIb1YYOBByU4Jsqkk75q48qA== @@ -3441,10 +3457,10 @@ caniuse-lite@^1.0.30001202, caniuse-lite@^1.0.30001219, caniuse-lite@^1.0.300012 resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001294.tgz#4849f27b101fd59ddee3751598c663801032533d" integrity sha512-LiMlrs1nSKZ8qkNhpUf5KD0Al1KCBE3zaT7OLOwEkagXMEDij98SiOovn9wxVGQpklk9vVC/pUSqgYmkmKOS8g== -ccount@^1.0.0: - version "1.1.0" - resolved "https://registry.yarnpkg.com/ccount/-/ccount-1.1.0.tgz#246687debb6014735131be8abab2d93898f8d043" - integrity sha512-vlNK021QdI7PNeiUh/lKkC/mNHHfV0m/Ad5JoI0TYtlBnJAslM/JIkm/tGC88bkLIwO6OQ5uV6ztS6kVAtCDlg== +ccount@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/ccount/-/ccount-2.0.1.tgz#17a3bf82302e0870d6da43a01311a8bc02a3ecf5" + integrity sha512-eyrF0jiFpY+3drT6383f1qhkbGsLSifNAjA61IUjZjmLCWjItY6LB9ft9YhoDgwfmclB2zhu51Lc7+95b8NRAg== chalk@2.3.0: version "2.3.0" @@ -3506,31 +3522,16 @@ character-entities-html4@^2.0.0: resolved "https://registry.yarnpkg.com/character-entities-html4/-/character-entities-html4-2.1.0.tgz#1f1adb940c971a4b22ba39ddca6b618dc6e56b2b" integrity sha512-1v7fgQRj6hnSwFpq1Eu0ynr/CDEw0rXo2B61qXrLNdHZmPKgb7fqS1a2JwF0rISo9q77jDI8VMEHoApn8qDoZA== -character-entities-legacy@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-1.1.4.tgz#94bc1845dce70a5bb9d2ecc748725661293d8fc1" - integrity sha512-3Xnr+7ZFS1uxeiUDvV02wQ+QDbc55o97tIV5zHScSPJpcLm/r0DFPcoY3tYRp+VZukxuMeKgXYmsXQHO05zQeA== - character-entities-legacy@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/character-entities-legacy/-/character-entities-legacy-3.0.0.tgz#76bc83a90738901d7bc223a9e93759fdd560125b" integrity sha512-RpPp0asT/6ufRm//AJVwpViZbGM/MkjQFxJccQRHmISF/22NBtsHqAWmL+/pmkPWoIUJdWyeVleTl1wydHATVQ== -character-entities@^1.0.0: - version "1.2.4" - resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-1.2.4.tgz#e12c3939b7eaf4e5b15e7ad4c5e28e1d48c5b16b" - integrity sha512-iBMyeEHxfVnIakwOuDXpVkc54HijNgCyQB2w0VfGQThle6NXn50zU6V/u+LDhxHcDUPojn6Kpga3PTAD8W1bQw== - character-entities@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/character-entities/-/character-entities-2.0.1.tgz#98724833e1e27990dee0bd0f2b8a859c3476aac7" integrity sha512-OzmutCf2Kmc+6DrFrrPS8/tDh2+DpnrfzdICHWhcVC9eOd0N1PXmQEE1a8iM4IziIAG+8tmTq3K+oo0ubH6RRQ== -character-reference-invalid@^1.0.0: - version "1.1.4" - resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-1.1.4.tgz#083329cda0eae272ab3dbbf37e9a382c13af1560" - integrity sha512-mKKUkUbhPpQlCOfIuZkvSEgktjPFIsZKRRbC6KWVEMvlzblj3i3asQv5ODsrwt0N3pHAEvjP8KTQPHkp0+6jOg== - character-reference-invalid@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/character-reference-invalid/-/character-reference-invalid-2.0.1.tgz#85c66b041e43b47210faf401278abf808ac45cb9" @@ -3599,7 +3600,7 @@ classnames@2.2.6: resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.2.6.tgz#43935bffdd291f326dad0a205309b38d00f650ce" integrity sha512-JR/iSQOSt+LQIWwrwEzJ9uk0xfN3mTVYMwt1Ir5mUcSN6pU+V4zQFFaJsclJbPuAUQH+yfWef6tm7l1quW3C8Q== -classnames@^2.2.6: +classnames@2.3.1, classnames@^2.2.6: version "2.3.1" resolved "https://registry.yarnpkg.com/classnames/-/classnames-2.3.1.tgz#dfcfa3891e306ec1dad105d0e88f4417b8535e8e" integrity sha512-OlQdbZ7gLfGarSqxesMesDa5uz7KFbID8Kpq/SxIoNGDqY8lSYs0D+hhtBXhcdB3rcbXArFr7vlHheLk1voeNA== @@ -4584,11 +4585,6 @@ emojis-list@^2.0.0: resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-2.1.0.tgz#4daa4d9db00f9819880c79fa457ae5b09a1fd389" integrity sha1-TapNnbAPmBmIDHn6RXrlsJof04k= -emojis-list@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/emojis-list/-/emojis-list-3.0.0.tgz#5570662046ad29e2e916e71aae260abdff4f6a78" - integrity sha512-/kyM18EfinwXZbno9FyUGeFh87KC8HRQBQGildHZbEuRyWFOmv1U10o9BBp8XVZDVNNuQKyIGIu5ZYAAXJ0V2Q== - encoding@0.1.13: version "0.1.13" resolved "https://registry.yarnpkg.com/encoding/-/encoding-0.1.13.tgz#56574afdd791f54a8e9b2785c0582a2d26210fa9" @@ -4682,6 +4678,11 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== +escape-string-regexp@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-5.0.0.tgz#4683126b500b61762f2dbebace1806e8be31b1c8" + integrity sha512-/veY75JbMK4j1yjvuUxuVsiS/hr/4iHs9FTT6cgTexxdE0Ly/glccBAkloH/DofkjRbZU3bnoj38mOmhkZ0lHw== + escodegen@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/escodegen/-/escodegen-2.0.0.tgz#5e32b12833e8aa8fa35e1bf0befa89380484c7dd" @@ -5272,7 +5273,7 @@ flatted@^3.1.0: resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.4.tgz#28d9969ea90661b5134259f312ab6aa7929ac5e2" integrity sha512-8/sOawo8tJ4QOBX8YlQBMxL8+RLZfxMQOif9o0KUKTNTjMYElWPE0r/m5VNFxTRd0NSw8qSy8dajrwX4RYI1Hw== -focus-visible@^5.1.0: +focus-visible@5.2.0, focus-visible@^5.1.0: version "5.2.0" resolved "https://registry.yarnpkg.com/focus-visible/-/focus-visible-5.2.0.tgz#3a9e41fccf587bd25dcc2ef045508284f0a4d6b3" integrity sha512-Rwix9pBtC1Nuy5wysTmKy+UjbDJpIfg8eHjw0rjZ1mX4GNLz1Bmd16uDpI3Gk1i70Fgcs8Csg2lPm8HULFg9DQ== @@ -5526,7 +5527,7 @@ gitconfiglocal@^1.0.0: dependencies: ini "^1.3.2" -github-slugger@^1.3.0: +github-slugger@1.4.0, github-slugger@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/github-slugger/-/github-slugger-1.4.0.tgz#206eb96cdb22ee56fdc53a28d5a302338463444e" integrity sha512-w0dzqw/nt51xMVmlaV1+JRzN+oCa1KfcgGEWhxUG16wbdA+Xnt/yoFO8Z8x/V82ZcZ0wy6ln9QDup5avbhiDhQ== @@ -5688,7 +5689,7 @@ graceful-fs@^4.1.10, graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.6 resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.8.tgz#e412b8d33f5e006593cbd3cee6df9f2cebbe802a" integrity sha512-qkIilPUYcNhJpd33n0GBXTB1MMPp14TxEsEs0pTrsSVucApsYzW5V+Q8Qxhik6KU3evy+qkAAowTByymK0avdg== -grapheme-splitter@^1.0.4: +grapheme-splitter@1.0.4, grapheme-splitter@^1.0.4: version "1.0.4" resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== @@ -6094,7 +6095,7 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== -intersection-observer@^0.12.0: +intersection-observer@0.12.0, intersection-observer@^0.12.0: version "0.12.0" resolved "https://registry.yarnpkg.com/intersection-observer/-/intersection-observer-0.12.0.tgz#6c84628f67ce8698e5f9ccf857d97718745837aa" integrity sha512-2Vkz8z46Dv401zTWudDGwO7KiGHNDkMv417T5ItcNYfmvHR/1qCTVBO9vwH8zZmQ0WkA/1ARwpysR9bsnop4NQ== @@ -6124,24 +6125,11 @@ invariant@^2.2.4: dependencies: loose-envify "^1.0.0" -is-alphabetical@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-1.0.4.tgz#9e7d6b94916be22153745d184c298cbf986a686d" - integrity sha512-DwzsA04LQ10FHTZuL0/grVDk4rFoVH1pjAToYwBrHSxcrBIGQuXrQMtD5U1b0U2XVgKZCTLLP8u2Qxqhy3l2Vg== - is-alphabetical@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-alphabetical/-/is-alphabetical-2.0.1.tgz#01072053ea7c1036df3c7d19a6daaec7f19e789b" integrity sha512-FWyyY60MeTNyeSRpkM2Iry0G9hpr7/9kD40mD/cGQEuilcZYS4okz8SN2Q6rLCJ8gbCt6fN+rC+6tMGS99LaxQ== -is-alphanumerical@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-1.0.4.tgz#7eb9a2431f855f6b1ef1a78e326df515696c4dbf" - integrity sha512-UzoZUr+XfVz3t3v4KyGEniVL9BDRoQtY7tOyrRybkVNjDFWyo1yhXNGrrBTQxp3ib9BLAWs7k2YKBQsFRkZG9A== - dependencies: - is-alphabetical "^1.0.0" - is-decimal "^1.0.0" - is-alphanumerical@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-alphanumerical/-/is-alphanumerical-2.0.1.tgz#7c03fbe96e3e931113e57f964b0a368cc2dfd875" @@ -6223,11 +6211,6 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" -is-decimal@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-1.0.4.tgz#65a3a5958a1c5b63a706e1b333d7cd9f630d3fa5" - integrity sha512-RGdriMmQQvZ2aqaQq3awNA6dCGtKpiDFcOzrTWrDAT2MiWrKQVPmxLGHl7Y2nNu6led0kEyoX0enY0qXYsv9zw== - is-decimal@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-decimal/-/is-decimal-2.0.1.tgz#9469d2dc190d0214fd87d78b78caecc0cc14eef7" @@ -6277,11 +6260,6 @@ is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3, is-glob@~4.0.1: dependencies: is-extglob "^2.1.1" -is-hexadecimal@^1.0.0: - version "1.0.4" - resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-1.0.4.tgz#cc35c97588da4bd49a8eedd6bc4082d44dcb23a7" - integrity sha512-gyPJuv83bHMpocVYoqof5VDiZveEoGoFL8m3BXNb2VW8Xs+rz9kqO8LOQ5DH6EsuvilT1ApazU0pyl+ytbPtlw== - is-hexadecimal@^2.0.0: version "2.0.1" resolved "https://registry.yarnpkg.com/is-hexadecimal/-/is-hexadecimal-2.0.1.tgz#86b5bf668fca307498d319dfc03289d781a90027" @@ -7249,15 +7227,6 @@ loader-utils@1.2.3: emojis-list "^2.0.0" json5 "^1.0.1" -loader-utils@^2.0.0: - version "2.0.2" - resolved "https://registry.yarnpkg.com/loader-utils/-/loader-utils-2.0.2.tgz#d6e3b4fb81870721ae4e0868ab11dd638368c129" - integrity sha512-TM57VeHptv569d/GKh6TAYdzKblwDNiumOdkFnejjD0XwTH87K90w3O7AiJRqdQoXygvi1VQTJTLGhJl7WqA7A== - dependencies: - big.js "^5.2.2" - emojis-list "^3.0.0" - json5 "^2.1.2" - locate-path@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-2.0.0.tgz#2b568b265eec944c6d9c0de9c3dbbbca0354cd8e" @@ -7344,11 +7313,6 @@ log-util@^2.3.0: figures "^3.0.0" log-symbols "^3.0.0" -longest-streak@^2.0.0: - version "2.0.4" - resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-2.0.4.tgz#b8599957da5b5dab64dee3fe316fa774597d90e4" - integrity sha512-vM6rUVCVUJJt33bnmHiZEvr7wPT78ztX7rojL+LW51bHtLh6HTjx84LA5W4+oa6aKEJA7jJu5LR6vQRBpA5DVg== - longest-streak@^3.0.0: version "3.0.1" resolved "https://registry.yarnpkg.com/longest-streak/-/longest-streak-3.0.1.tgz#c97315b7afa0e7d9525db9a5a2953651432bdc5d" @@ -7450,12 +7414,18 @@ markdown-extensions@^1.0.0: resolved "https://registry.yarnpkg.com/markdown-extensions/-/markdown-extensions-1.1.1.tgz#fea03b539faeaee9b4ef02a3769b455b189f7fc3" integrity sha512-WWC0ZuMzCyDHYCasEGs4IPvLyTGftYwh6wIEOULOF0HXcqZlhwRzrK0w2VUlxWA98xnvb/jszw4ZSkJ6ADpM6Q== -markdown-table@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-2.0.0.tgz#194a90ced26d31fe753d8b9434430214c011865b" - integrity sha512-Ezda85ToJUBhM6WGaG6veasyym+Tbs3cMAw/ZhOPqXiYsr0jgocBV3j3nx+4lk47plLlIqjwuTm/ywVI+zjJ/A== +markdown-table@^3.0.0: + version "3.0.2" + resolved "https://registry.yarnpkg.com/markdown-table/-/markdown-table-3.0.2.tgz#9b59eb2c1b22fe71954a65ff512887065a7bb57c" + integrity sha512-y8j3a5/DkJCmS5x4dMCQL+OR0+2EAq3DOtio1COSHsmW2BGXnNCK3v12hJt1LrUz5iZH5g0LmuYOjDdI+czghA== + +match-sorter@6.3.1: + version "6.3.1" + resolved "https://registry.yarnpkg.com/match-sorter/-/match-sorter-6.3.1.tgz#98cc37fda756093424ddf3cbc62bfe9c75b92bda" + integrity sha512-mxybbo3pPNuA+ZuCUhm5bwNkXrJTbsk5VWbR5wiwz/GC6LIiegBGn2w3O08UG/jdbYLinw51fSQ5xNU1U3MgBw== dependencies: - repeat-string "^1.0.0" + "@babel/runtime" "^7.12.5" + remove-accents "0.4.2" match-sorter@^4.2.0: version "4.2.1" @@ -7483,14 +7453,14 @@ mdast-util-definitions@^5.0.0: "@types/unist" "^2.0.0" unist-util-visit "^3.0.0" -mdast-util-find-and-replace@^1.1.0: - version "1.1.1" - resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-1.1.1.tgz#b7db1e873f96f66588c321f1363069abf607d1b5" - integrity sha512-9cKl33Y21lyckGzpSmEQnIDjEfeeWelN5s1kUW1LwdB0Fkuq2u+4GdqcGEygYxJE8GVqCl0741bYXHgamfWAZA== +mdast-util-find-and-replace@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/mdast-util-find-and-replace/-/mdast-util-find-and-replace-2.1.0.tgz#69728acd250749f8aac6e150e07d1fd15619e829" + integrity sha512-1w1jbqAd13oU78QPBf5223+xB+37ecNtQ1JElq2feWols5oEYAl+SgNDnOZipe7NfLemoEt362yUS15/wip4mw== dependencies: - escape-string-regexp "^4.0.0" - unist-util-is "^4.0.0" - unist-util-visit-parents "^3.0.0" + escape-string-regexp "^5.0.0" + unist-util-is "^5.0.0" + unist-util-visit-parents "^4.0.0" mdast-util-from-markdown@^1.0.0: version "1.2.0" @@ -7510,47 +7480,60 @@ mdast-util-from-markdown@^1.0.0: unist-util-stringify-position "^3.0.0" uvu "^0.5.0" -mdast-util-gfm-autolink-literal@^0.1.0: - version "0.1.3" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-0.1.3.tgz#9c4ff399c5ddd2ece40bd3b13e5447d84e385fb7" - integrity sha512-GjmLjWrXg1wqMIO9+ZsRik/s7PLwTaeCHVB7vRxUwLntZc8mzmTsLVr6HW1yLokcnhfURsn5zmSVdi3/xWWu1A== +mdast-util-gfm-autolink-literal@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-autolink-literal/-/mdast-util-gfm-autolink-literal-1.0.2.tgz#4032dcbaddaef7d4f2f3768ed830475bb22d3970" + integrity sha512-FzopkOd4xTTBeGXhXSBU0OCDDh5lUj2rd+HQqG92Ld+jL4lpUfgX2AT2OHAVP9aEeDKp7G92fuooSZcYJA3cRg== dependencies: - ccount "^1.0.0" - mdast-util-find-and-replace "^1.1.0" - micromark "^2.11.3" + "@types/mdast" "^3.0.0" + ccount "^2.0.0" + mdast-util-find-and-replace "^2.0.0" + micromark-util-character "^1.0.0" -mdast-util-gfm-strikethrough@^0.2.0: - version "0.2.3" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-0.2.3.tgz#45eea337b7fff0755a291844fbea79996c322890" - integrity sha512-5OQLXpt6qdbttcDG/UxYY7Yjj3e8P7X16LzvpX8pIQPYJ/C2Z1qFGMmcw+1PZMUM3Z8wt8NRfYTvCni93mgsgA== +mdast-util-gfm-footnote@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-footnote/-/mdast-util-gfm-footnote-1.0.0.tgz#355c1e8dc9e17e871d1b3fa5da8824923fc756e0" + integrity sha512-qeg9YoS2YYP6OBmMyUFxKXb6BLwAsbGidIxgwDAXHIMYZQhIwe52L9BSJs+zP29Jp5nSERPkmG3tSwAN23/ZbQ== dependencies: - mdast-util-to-markdown "^0.6.0" + "@types/mdast" "^3.0.0" + mdast-util-to-markdown "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + unist-util-visit "^4.0.0" + +mdast-util-gfm-strikethrough@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-strikethrough/-/mdast-util-gfm-strikethrough-1.0.0.tgz#6cc72ef5d9539f4cee76af3f15dd0daa9e3af40f" + integrity sha512-gM9ipBUdRxYa6Yq1Hd8Otg6jEn/dRxFZ1F9ZX4QHosHOexLGqNZO2dh0A+YFbUEd10RcKjnjb4jOfJJzoXXUew== + dependencies: + "@types/mdast" "^3.0.3" + mdast-util-to-markdown "^1.0.0" -mdast-util-gfm-table@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-0.1.6.tgz#af05aeadc8e5ee004eeddfb324b2ad8c029b6ecf" - integrity sha512-j4yDxQ66AJSBwGkbpFEp9uG/LS1tZV3P33fN1gkyRB2LoRL+RR3f76m0HPHaby6F4Z5xr9Fv1URmATlRRUIpRQ== +mdast-util-gfm-table@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-table/-/mdast-util-gfm-table-1.0.2.tgz#c727c20d5ac0d7d4b238d50b48e2924f0b77cc76" + integrity sha512-pPekvCTChFBF8uCq8bVyQwar8NBU/TaXIy44jj/UzmjMgPBHIa1B1ge8a0JVgzhqgXQAMvGT+PgiKlicdLGfDQ== dependencies: - markdown-table "^2.0.0" - mdast-util-to-markdown "~0.6.0" + markdown-table "^3.0.0" + mdast-util-to-markdown "^1.0.0" -mdast-util-gfm-task-list-item@^0.1.0: - version "0.1.6" - resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-0.1.6.tgz#70c885e6b9f543ddd7e6b41f9703ee55b084af10" - integrity sha512-/d51FFIfPsSmCIRNp7E6pozM9z1GYPIkSy1urQ8s/o4TC22BZ7DqfHFWiqBD23bc7J3vV1Fc9O4QIHBlfuit8A== +mdast-util-gfm-task-list-item@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm-task-list-item/-/mdast-util-gfm-task-list-item-1.0.0.tgz#a0aa2a00c893f9f006d13ba096cbc64608559c7f" + integrity sha512-dwkzOTjQe8JCCHVE3Cb0pLHTYLudf7t9WCAnb20jI8/dW+VHjgWhjtIUVA3oigNkssgjEwX+i+3XesUdCnXGyA== dependencies: - mdast-util-to-markdown "~0.6.0" + "@types/mdast" "^3.0.3" + mdast-util-to-markdown "^1.0.0" -mdast-util-gfm@^0.1.0: - version "0.1.2" - resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-0.1.2.tgz#8ecddafe57d266540f6881f5c57ff19725bd351c" - integrity sha512-NNkhDx/qYcuOWB7xHUGWZYVXvjPFFd6afg6/e2g+SV4r9q5XUcCbV4Wfa3DLYIiD+xAEZc6K4MGaE/m0KDcPwQ== +mdast-util-gfm@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/mdast-util-gfm/-/mdast-util-gfm-2.0.0.tgz#2545856bc18a66d5cc63fbef0b097a020a8e9e3d" + integrity sha512-wMwejlTN3EQADPFuvxe8lmGsay3+f6gSJKdAHR6KBJzpcxvsjJSILB9K6u6G7eQLC7iOTyVIHYGui9uBc9r1Tg== dependencies: - mdast-util-gfm-autolink-literal "^0.1.0" - mdast-util-gfm-strikethrough "^0.2.0" - mdast-util-gfm-table "^0.1.0" - mdast-util-gfm-task-list-item "^0.1.0" - mdast-util-to-markdown "^0.6.1" + mdast-util-gfm-autolink-literal "^1.0.0" + mdast-util-gfm-footnote "^1.0.0" + mdast-util-gfm-strikethrough "^1.0.0" + mdast-util-gfm-table "^1.0.0" + mdast-util-gfm-task-list-item "^1.0.0" mdast-util-mdx-expression@^1.0.0: version "1.1.1" @@ -7608,18 +7591,6 @@ mdast-util-to-hast@^12.1.0: unist-util-position "^4.0.0" unist-util-visit "^4.0.0" -mdast-util-to-markdown@^0.6.0, mdast-util-to-markdown@^0.6.1, mdast-util-to-markdown@~0.6.0: - version "0.6.5" - resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-0.6.5.tgz#b33f67ca820d69e6cc527a93d4039249b504bebe" - integrity sha512-XeV9sDE7ZlOQvs45C9UKMtfTcctcaj/pGwH8YLbMHoMOXNNCn2LsqVQOqrF1+/NU8lKDAqozme9SCXWyo9oAcQ== - dependencies: - "@types/unist" "^2.0.0" - longest-streak "^2.0.0" - mdast-util-to-string "^2.0.0" - parse-entities "^2.0.0" - repeat-string "^1.0.0" - zwitch "^1.0.0" - mdast-util-to-markdown@^1.0.0: version "1.2.6" resolved "https://registry.yarnpkg.com/mdast-util-to-markdown/-/mdast-util-to-markdown-1.2.6.tgz#9d0d1fcb22838e4af83fb04841cbde92525972f3" @@ -7633,11 +7604,6 @@ mdast-util-to-markdown@^1.0.0: unist-util-visit "^4.0.0" zwitch "^2.0.0" -mdast-util-to-string@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-2.0.0.tgz#b8cfe6a713e1091cb5b728fc48885a4767f8b97b" - integrity sha512-AW4DRS3QbBayY/jJmD8437V1Gombjf8RSOUCMFBuo5iHi58AGEgVCKQ+ezHkZZDpAQS75hcBMpLqjpJTjtUL7w== - mdast-util-to-string@^3.0.0, mdast-util-to-string@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/mdast-util-to-string/-/mdast-util-to-string-3.1.0.tgz#56c506d065fbf769515235e577b5a261552d56e9" @@ -7697,50 +7663,84 @@ micromark-core-commonmark@^1.0.0, micromark-core-commonmark@^1.0.1: micromark-util-types "^1.0.1" uvu "^0.5.0" -micromark-extension-gfm-autolink-literal@~0.5.0: - version "0.5.7" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-0.5.7.tgz#53866c1f0c7ef940ae7ca1f72c6faef8fed9f204" - integrity sha512-ePiDGH0/lhcngCe8FtH4ARFoxKTUelMp4L7Gg2pujYD5CSMb9PbblnyL+AAMud/SNMyusbS2XDSiPIRcQoNFAw== +micromark-extension-gfm-autolink-literal@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-autolink-literal/-/micromark-extension-gfm-autolink-literal-1.0.3.tgz#dc589f9c37eaff31a175bab49f12290edcf96058" + integrity sha512-i3dmvU0htawfWED8aHMMAzAVp/F0Z+0bPh3YrbTPPL1v4YAlCZpy5rBO5p0LPYiZo0zFVkoYh7vDU7yQSiCMjg== dependencies: - micromark "~2.11.3" + micromark-util-character "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-strikethrough@~0.6.5: - version "0.6.5" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-0.6.5.tgz#96cb83356ff87bf31670eefb7ad7bba73e6514d1" - integrity sha512-PpOKlgokpQRwUesRwWEp+fHjGGkZEejj83k9gU5iXCbDG+XBA92BqnRKYJdfqfkrRcZRgGuPuXb7DaK/DmxOhw== +micromark-extension-gfm-footnote@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-footnote/-/micromark-extension-gfm-footnote-1.0.3.tgz#5280b29667e4ecb8687f369829aa3322caca7d11" + integrity sha512-bn62pC5y39rIo2g1RqZk1NhF7T7cJLuJlbevunQz41U0iPVCdVOFASe5/L1kke+DFKSgfCRhv24+o42cZ1+ADw== dependencies: - micromark "~2.11.0" + micromark-core-commonmark "^1.0.0" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-normalize-identifier "^1.0.0" + micromark-util-sanitize-uri "^1.0.0" + micromark-util-symbol "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-table@~0.4.0: - version "0.4.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-0.4.3.tgz#4d49f1ce0ca84996c853880b9446698947f1802b" - integrity sha512-hVGvESPq0fk6ALWtomcwmgLvH8ZSVpcPjzi0AjPclB9FsVRgMtGZkUcpE0zgjOCFAznKepF4z3hX8z6e3HODdA== +micromark-extension-gfm-strikethrough@^1.0.0: + version "1.0.4" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-strikethrough/-/micromark-extension-gfm-strikethrough-1.0.4.tgz#162232c284ffbedd8c74e59c1525bda217295e18" + integrity sha512-/vjHU/lalmjZCT5xt7CcHVJGq8sYRm80z24qAKXzaHzem/xsDYb2yLL+NNVbYvmpLx3O7SYPuGL5pzusL9CLIQ== dependencies: - micromark "~2.11.0" + micromark-util-chunked "^1.0.0" + micromark-util-classify-character "^1.0.0" + micromark-util-resolve-all "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-tagfilter@~0.3.0: - version "0.3.0" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-0.3.0.tgz#d9f26a65adee984c9ccdd7e182220493562841ad" - integrity sha512-9GU0xBatryXifL//FJH+tAZ6i240xQuFrSL7mYi8f4oZSbc+NvXjkrHemeYP0+L4ZUT+Ptz3b95zhUZnMtoi/Q== +micromark-extension-gfm-table@^1.0.0: + version "1.0.5" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-table/-/micromark-extension-gfm-table-1.0.5.tgz#7b708b728f8dc4d95d486b9e7a2262f9cddbcbb4" + integrity sha512-xAZ8J1X9W9K3JTJTUL7G6wSKhp2ZYHrFk5qJgY/4B33scJzE2kpfRL6oiw/veJTbt7jiM/1rngLlOKPWr1G+vg== + dependencies: + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" -micromark-extension-gfm-task-list-item@~0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-0.3.3.tgz#d90c755f2533ed55a718129cee11257f136283b8" - integrity sha512-0zvM5iSLKrc/NQl84pZSjGo66aTGd57C1idmlWmE87lkMcXrTxg1uXa/nXomxJytoje9trP0NDLvw4bZ/Z/XCQ== +micromark-extension-gfm-tagfilter@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-tagfilter/-/micromark-extension-gfm-tagfilter-1.0.1.tgz#fb2e303f7daf616db428bb6a26e18fda14a90a4d" + integrity sha512-Ty6psLAcAjboRa/UKUbbUcwjVAv5plxmpUTy2XC/3nJFL37eHej8jrHrRzkqcpipJliuBH30DTs7+3wqNcQUVA== dependencies: - micromark "~2.11.0" + micromark-util-types "^1.0.0" -micromark-extension-gfm@^0.3.0: - version "0.3.3" - resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-0.3.3.tgz#36d1a4c089ca8bdfd978c9bd2bf1a0cb24e2acfe" - integrity sha512-oVN4zv5/tAIA+l3GbMi7lWeYpJ14oQyJ3uEim20ktYFAcfX1x3LNlFGGlmrZHt7u9YlKExmyJdDGaTt6cMSR/A== +micromark-extension-gfm-task-list-item@^1.0.0: + version "1.0.3" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm-task-list-item/-/micromark-extension-gfm-task-list-item-1.0.3.tgz#7683641df5d4a09795f353574d7f7f66e47b7fc4" + integrity sha512-PpysK2S1Q/5VXi72IIapbi/jliaiOFzv7THH4amwXeYXLq3l1uo8/2Be0Ac1rEwK20MQEsGH2ltAZLNY2KI/0Q== dependencies: - micromark "~2.11.0" - micromark-extension-gfm-autolink-literal "~0.5.0" - micromark-extension-gfm-strikethrough "~0.6.5" - micromark-extension-gfm-table "~0.4.0" - micromark-extension-gfm-tagfilter "~0.3.0" - micromark-extension-gfm-task-list-item "~0.3.0" + micromark-factory-space "^1.0.0" + micromark-util-character "^1.0.0" + micromark-util-symbol "^1.0.0" + micromark-util-types "^1.0.0" + uvu "^0.5.0" + +micromark-extension-gfm@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/micromark-extension-gfm/-/micromark-extension-gfm-2.0.1.tgz#40f3209216127a96297c54c67f5edc7ef2d1a2a2" + integrity sha512-p2sGjajLa0iYiGQdT0oelahRYtMWvLjy8J9LOCxzIQsllMCGLbsLW+Nc+N4vi02jcRJvedVJ68cjelKIO6bpDA== + dependencies: + micromark-extension-gfm-autolink-literal "^1.0.0" + micromark-extension-gfm-footnote "^1.0.0" + micromark-extension-gfm-strikethrough "^1.0.0" + micromark-extension-gfm-table "^1.0.0" + micromark-extension-gfm-tagfilter "^1.0.0" + micromark-extension-gfm-task-list-item "^1.0.0" + micromark-util-combine-extensions "^1.0.0" + micromark-util-types "^1.0.0" micromark-extension-mdx-expression@^1.0.0: version "1.0.3" @@ -7981,14 +7981,6 @@ micromark-util-types@^1.0.0, micromark-util-types@^1.0.1: resolved "https://registry.yarnpkg.com/micromark-util-types/-/micromark-util-types-1.0.2.tgz#f4220fdb319205812f99c40f8c87a9be83eded20" integrity sha512-DCfg/T8fcrhrRKTPjRrw/5LLvdGV7BHySf/1LOZx7TzWZdYRjogNtyNq885z3nNallwr3QUKARjqvHqX1/7t+w== -micromark@^2.11.3, micromark@~2.11.0, micromark@~2.11.3: - version "2.11.4" - resolved "https://registry.yarnpkg.com/micromark/-/micromark-2.11.4.tgz#d13436138eea826383e822449c9a5c50ee44665a" - integrity sha512-+WoovN/ppKolQOFIAajxi7Lu9kInbPxFuTBVEavFcL8eAfVstoc5MocPmqBeAdBOJV00uaVjegzH4+MA0DN/uA== - dependencies: - debug "^4.0.0" - parse-entities "^2.0.0" - micromark@^3.0.0: version "3.0.10" resolved "https://registry.yarnpkg.com/micromark/-/micromark-3.0.10.tgz#1eac156f0399d42736458a14b0ca2d86190b457c" @@ -8143,6 +8135,11 @@ new-github-release-url@1.0.0: dependencies: type-fest "^0.4.1" +next-themes@0.0.15: + version "0.0.15" + resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.0.15.tgz#ab0cee69cd763b77d41211f631e108beab39bf7d" + integrity sha512-LTmtqYi03c4gMTJmWwVK9XkHL7h0/+XrtR970Ujvtu3s0kZNeJN24aJsi4rkZOI8i19+qq6f8j+8Duwy5jqcrQ== + next-themes@^0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/next-themes/-/next-themes-0.0.8.tgz#2a1748317085afbc2509e2c32bd04af4f0f6cb7d" @@ -8215,6 +8212,10 @@ next@12.0.7: "@next/swc-win32-ia32-msvc" "12.0.7" "@next/swc-win32-x64-msvc" "12.0.7" +"nextra-renderlesskit-theme-docs@link:.yalc/nextra-renderlesskit-theme-docs": + version "0.0.0" + uid "" + nextra-theme-docs@2.0.0-beta.5: version "2.0.0-beta.5" resolved "https://registry.yarnpkg.com/nextra-theme-docs/-/nextra-theme-docs-2.0.0-beta.5.tgz#6972aa369ee5c1f0fd71c7ef5d3f6f25fd314cb5" @@ -8234,20 +8235,9 @@ nextra-theme-docs@2.0.0-beta.5: react-innertext "^1.1.5" title "^3.4.2" -nextra@2.0.0-beta.5: - version "2.0.0-beta.5" - resolved "https://registry.yarnpkg.com/nextra/-/nextra-2.0.0-beta.5.tgz#37a5947af2c4cc3620ff1fe939971ebb9fcb5041" - integrity sha512-RYhD/wMfTFXzshqe1GOovQR9n0YsvgW/TLsUzu0arTix+A9Eugl/urFVvtGFRahOWxWFOS9/YgYKjp4nRIuMhw== - dependencies: - "@mdx-js/loader" "^2.0.0-rc.2" - "@mdx-js/mdx" "^2.0.0-rc.2" - download "^8.0.0" - graceful-fs "^4.2.6" - gray-matter "^4.0.3" - loader-utils "^2.0.0" - remark-gfm "^1.0.0" - remark-mdx-code-meta "^1.0.0" - slash "^3.0.0" +"nextra@link:.yalc/nextra": + version "0.0.0" + uid "" node-fetch@2.6.1: version "2.6.1" @@ -8634,18 +8624,6 @@ parse-asn1@^5.0.0, parse-asn1@^5.1.5: pbkdf2 "^3.0.3" safe-buffer "^5.1.1" -parse-entities@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-2.0.0.tgz#53c6eb5b9314a1f4ec99fa0fdf7ce01ecda0cbe8" - integrity sha512-kkywGpCcRYhqQIchaWqZ875wzpS/bMKhz5HnN3p7wveJTkTtyAB/AlnS0f8DFSqYW1T82t6yEAkEcB+A1I3MbQ== - dependencies: - character-entities "^1.0.0" - character-entities-legacy "^1.0.0" - character-reference-invalid "^1.0.0" - is-alphanumerical "^1.0.0" - is-decimal "^1.0.0" - is-hexadecimal "^1.0.0" - parse-entities@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/parse-entities/-/parse-entities-4.0.0.tgz#f67c856d4e3fe19b1a445c3fabe78dcdc1053eeb" @@ -8660,7 +8638,7 @@ parse-entities@^4.0.0: is-decimal "^2.0.0" is-hexadecimal "^2.0.0" -parse-git-url@^1.0.1: +parse-git-url@1.0.1, parse-git-url@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/parse-git-url/-/parse-git-url-1.0.1.tgz#92bdaf615a7e24d32bea3bf955ee90a9050aeb57" integrity sha512-Zukjztu09UXpXV/Q+4vgwyVPzUBkUvDjlqHlpG+swv/zYzed/5Igw/33rIEJxFDRc5LxvEqYDVDzhBfnOLWDYw== @@ -8955,7 +8933,7 @@ pretty-format@^27.0.0, pretty-format@^27.0.2, pretty-format@^27.4.2: ansi-styles "^5.0.0" react-is "^17.0.1" -prism-react-renderer@^1.1.1: +prism-react-renderer@1.2.1, prism-react-renderer@^1.1.1: version "1.2.1" resolved "https://registry.yarnpkg.com/prism-react-renderer/-/prism-react-renderer-1.2.1.tgz#392460acf63540960e5e3caa699d851264e99b89" integrity sha512-w23ch4f75V1Tnz8DajsYKvY5lF7H1+WvzvLUcF0paFxkTHSp42RS0H5CttdN2Q8RR3DRGZ9v5xD/h3n8C8kGmg== @@ -9446,13 +9424,15 @@ release-it@14.11.8: yaml "1.10.2" yargs-parser "20.2.9" -remark-gfm@^1.0.0: - version "1.0.0" - resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-1.0.0.tgz#9213643001be3f277da6256464d56fd28c3b3c0d" - integrity sha512-KfexHJCiqvrdBZVbQ6RopMZGwaXz6wFJEfByIuEwGf0arvITHjiKKZ1dpXujjH9KZdm1//XJQwgfnJ3lmXaDPA== +remark-gfm@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/remark-gfm/-/remark-gfm-3.0.1.tgz#0b180f095e3036545e9dddac0e8df3fa5cfee54f" + integrity sha512-lEFDoi2PICJyNrACFOfDD3JlLkuSbOa5Wd8EPt06HUdptv8Gn0bxYTdbU/XXQ3swAPkEaGxxPN9cbnMHvVu1Ig== dependencies: - mdast-util-gfm "^0.1.0" - micromark-extension-gfm "^0.3.0" + "@types/mdast" "^3.0.0" + mdast-util-gfm "^2.0.0" + micromark-extension-gfm "^2.0.0" + unified "^10.0.0" remark-mdx-code-meta@^1.0.0: version "1.0.0" @@ -9497,11 +9477,6 @@ remove-accents@0.4.2: resolved "https://registry.yarnpkg.com/remove-accents/-/remove-accents-0.4.2.tgz#0a43d3aaae1e80db919e07ae254b285d9e1c7bb5" integrity sha1-CkPTqq4egNuRngeuJUsoXZ4ce7U= -repeat-string@^1.0.0: - version "1.6.1" - resolved "https://registry.yarnpkg.com/repeat-string/-/repeat-string-1.6.1.tgz#8dcae470e1c88abc2d600fff4a776286da75e637" - integrity sha1-jcrkcOHIirwtYA//Sndihtp15jc= - require-directory@^2.1.1: version "2.1.1" resolved "https://registry.yarnpkg.com/require-directory/-/require-directory-2.1.1.tgz#8c64ad5fd30dab1c976e2344ffe7f792a6a6df42" @@ -10399,7 +10374,12 @@ tiny-invariant@^1.0.6: resolved "https://registry.yarnpkg.com/tiny-invariant/-/tiny-invariant-1.2.0.tgz#a1141f86b672a9148c72e978a19a73b9b94a15a9" integrity sha512-1Uhn/aqw5C6RI4KejVeTg6mIS7IqxnLJ8Mv2tV5rTc0qWobay7pDUz6Wi392Cnc8ak1H0F2cjoRzb2/AW4+Fvg== -title@^3.4.2: +tiny-warning@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754" + integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA== + +title@3.4.3, title@^3.4.2: version "3.4.3" resolved "https://registry.yarnpkg.com/title/-/title-3.4.3.tgz#76ef6b398310a7814120634620e47849481485d3" integrity sha512-h7KKI5jNaAjGtym8ukn4IrIF3Uae19rlhGmpMst/mB7Ipi/vkNEJkeNfDJwUXi0h+AdGmldcUYQnO+9XMcunjg== @@ -10548,7 +10528,7 @@ tslib@^1.0.0, tslib@^1.8.1, tslib@^1.9.0, tslib@^1.9.3: resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== -tslib@^2.0.0, tslib@^2.1.0: +tslib@^2.0.0, tslib@^2.1.0, tslib@^2.3.0: version "2.3.1" resolved "https://registry.yarnpkg.com/tslib/-/tslib-2.3.1.tgz#e8a335add5ceae51aa261d32a490158ef042ef01" integrity sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw== @@ -10631,7 +10611,7 @@ typedarray@^0.0.6: resolved "https://registry.yarnpkg.com/typedarray/-/typedarray-0.0.6.tgz#867ac74e3864187b1d3d47d996a78ec5c8830777" integrity sha1-hnrHTjhkGHsdPUfZlqeOxciDB3c= -typescript@4.5.4, typescript@^4.4.3: +typescript@4.5.4, typescript@^4.4.3, typescript@^4.5.2: version "4.5.4" resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.5.4.tgz#a17d3a0263bf5c8723b9c52f43c5084edf13c2e8" integrity sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg== @@ -11298,11 +11278,6 @@ yocto-queue@^0.1.0: resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== -zwitch@^1.0.0: - version "1.0.5" - resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-1.0.5.tgz#d11d7381ffed16b742f6af7b3f223d5cd9fe9920" - integrity sha512-V50KMwwzqJV0NpZIZFwfOD5/lyny3WlSzRiXgA0G7VUnRlqttta1L6UQIHzd6EuBY/cHGfwTIck7w1yH6Q5zUw== - zwitch@^2.0.0: version "2.0.2" resolved "https://registry.yarnpkg.com/zwitch/-/zwitch-2.0.2.tgz#91f8d0e901ffa3d66599756dde7f57b17c95dce1"